/* Shared with the visual language of Qiu Set: paper, forest green and brass. */
:root {
  --bg:#fcfbf7; --surface:#fff; --sidebar:#f3f1ea;
  --ink:#202a25; --muted:#69716c; --line:#d9d8d1; --soft:#f1eee6;
  --accent:#244b37; --accent-hover:#315a43; --on-accent:#fff;
  --heading:#193c2a; --warm:#98703a; --accent-soft:#e9eee7;
  --art-edge:#87998b; --art-dim:#cbd3c7; --art-hi:#315a43;
  --field-focus-edge:#62826a; --field-focus-ring:#244b3710; --text-selection:#dce5d8;
  --priority-high:#aa4f45; --priority-medium:#98702f; --priority-normal:#69716c;
  --editorial-shadow:0 10px 30px #1d302614;
  --font-editorial:Georgia,"Noto Serif SC","Source Han Serif SC","Songti SC",SimSun,serif;
}
:root[data-theme="dark"] {
  --bg:#141b17; --surface:#1b241e; --sidebar:#17201a;
  --ink:#e7e8df; --muted:#a5afa4; --line:#354236; --soft:#253127;
  --accent:#adc7a8; --accent-hover:#c4d8bd; --on-accent:#17231b;
  --heading:#dde6d5; --warm:#d3b583; --accent-soft:#293c2f;
  --art-edge:#8c9f87; --art-dim:#445542; --art-hi:#b6caaa;
  --field-focus-edge:#93ac8a; --field-focus-ring:#adc7a814; --text-selection:#3b513d;
  --priority-high:#eca095; --priority-medium:#d6b47b; --priority-normal:#a5afa4;
  --editorial-shadow:0 10px 30px #0003;
}
body { background:var(--bg); }
:focus-visible { outline-color:var(--accent); }
input[type="checkbox"], input[type="radio"] { accent-color:var(--accent); }
.workspace-mode .sidebar { background:var(--bg); }
.brand { color:var(--heading); font-family:var(--font-editorial); font-weight:400; letter-spacing:0; }
.brand-mark { width:32px; height:34px; border:1px solid var(--accent); color:var(--accent); transform:none; font-family:var(--font-editorial); font-size:24px; font-weight:400; line-height:1; }
.brand-dot { color:var(--warm); }
.workspace-mode .nav-link { border-radius:0; }
.workspace-mode .sidebar-footer { border-radius:0; }
.workspace-mode .sidebar-footer .space-nav-icon.gradient-avatar { width:21px; height:21px; border-radius:0; }
.workspace-mode .nav-link.active { background:var(--accent); color:var(--on-accent); }
.workspace-mode .nav-link:hover:not(.active) { background:var(--soft); color:var(--accent); }
.workspace-mode .topbar { background:var(--bg); }
.breadcrumb-slash { color:var(--warm); }
#page-label { color:var(--heading); }
.icon-button, .sync-now { border-radius:0; }
.sync-indicator { color:var(--accent); }
.sync-now { color:var(--accent); background:var(--surface); }
.plans-page, .plan-content, .module-content { background:var(--bg); }
.plan-sidebar { background:var(--sidebar); }
.plan-filter { border-radius:0; }
.plan-filter.selected { color:var(--accent); background:var(--accent-soft); box-shadow:none; }
.plan-filter:hover { color:var(--accent); }
.sidebar-section-title, .plan-nav-label { color:var(--warm); letter-spacing:1px; }
.plan-list-heading { padding-bottom:21px; border-bottom:1px solid var(--line); }
.plan-heading-date { color:var(--warm); font-size:10px; letter-spacing:.6px; }
.plan-list-heading h1, .module-content .plan-list-heading h1, .person-heading h1 {
  color:var(--heading); font-family:var(--font-editorial); font-size:34px; font-weight:400; letter-spacing:0; line-height:1.25;
}
.button-primary, .button-secondary, .primary-link { border-radius:0; transition:background-color 180ms ease,border-color 180ms ease,color 180ms ease; }
.button-primary, .primary-link { background:var(--accent); border-color:var(--accent); color:var(--on-accent); }
.button-primary:hover, .primary-link:hover { background:var(--accent-hover); border-color:var(--accent-hover); opacity:1; }
.button-secondary { color:var(--accent); background:var(--surface); }
.button-secondary:hover { border-color:var(--accent); background:var(--accent-soft); opacity:1; }
.text-button:hover { color:var(--accent); }
.plan-list-footer { color:var(--muted); }
.plan-list-footer > span:last-child { color:var(--warm); }

/* A compact editorial cover for the overview, keeping the app navigation. */
.overview .module-content > .plan-list-heading {
  padding:28px 30px; margin-bottom:0; gap:24px;
  color:#fff; background:#244b37; border:1px solid #244b37; border-top:2px solid #b99a65;
}
.overview .plan-list-heading h1 { color:#fff; font-size:38px; margin-bottom:12px; }
.overview .plan-heading-date { color:#decba8; }
.overview .plan-count { color:#e0e6db; font-size:12px; line-height:1.8; }
.overview .plan-heading-actions .button-primary { color:#244b37; background:#f7f3e9; border-color:#f7f3e9; }
.overview .plan-heading-actions .button-primary:hover { background:#fff; }
.overview .plan-category-toggle { color:#e0e6db; }
.overview-stats { background:var(--surface); border-radius:0; border-top:0; }
.overview-stat { transition:background-color 180ms ease; }
.overview-stat:hover { background:var(--soft); }
.overview-stat strong { color:var(--heading); font-family:var(--font-editorial); font-size:32px; font-weight:400; }
.overview-stat > span .icon { color:var(--warm); }
.module-section-heading { border-top:2px solid var(--accent); }
.module-section-heading h2 { color:var(--heading); font-family:var(--font-editorial); font-size:18px; font-weight:400; }
.module-section-heading h2 .icon { color:var(--accent); }
.module-section-heading a { color:var(--accent); }
.overview-task { background:transparent; }
.overview-task:hover { background:var(--soft); }
.empty-state h3, .people-empty h2, .ai-config-empty h3 { color:var(--heading); font-family:var(--font-editorial); font-weight:400; }

/* Shared surfaces and fields; circular avatars and calendar markers stay round. */
.person-info-section, .person-profile-grid > .person-inline-form, .ai-config-card, .ai-config-empty,
.person-chat-message, .milestone-edit-row, .project-card, .space-featured-project,
.space-profile-view .personal-profile .person-info-section { border-radius:0; background:var(--surface); }
.storage-settings .storage-card { border-radius:0; }
.person-info-section h2, .storage-settings .storage-card h2, .storage-preview h3,
.ai-config-title h3, .project-card h2, .space-featured-project h3 {
  color:var(--heading); font-family:var(--font-editorial); font-weight:400;
}
.person-info-section h2, .storage-settings .storage-card h2 { font-size:17px; }
.ai-config-title h3 { font-size:18px; }
.project-card h2 { font-size:18px; }
.project-card progress { appearance:none; height:3px; border:0; border-radius:0; background:var(--soft); accent-color:var(--accent); }
.project-card progress::-webkit-progress-bar { background:var(--soft); }
.project-card progress::-webkit-progress-value { background:var(--accent); }
.project-card progress::-moz-progress-bar { background:var(--accent); }
.ai-config-symbol, .storage-status-icon, .person-tab-empty-icon { border-radius:0; color:var(--accent); background:var(--accent-soft); }
.ai-active-badge, .storage-mode-badge { border-radius:0; background:var(--accent-soft); color:var(--accent); }
.ai-active-badge::before { background:var(--accent); }
.storage-preview, .storage-settings .sync-conflict { border-radius:0; }
.storage-preview { border-top:2px solid var(--warm); }
.storage-preview-counts dd { color:var(--heading); font-family:var(--font-editorial); }
.storage-settings .storage-path { font-size:12px; }
.ai-editor-dialog .editor-heading h2 { color:var(--heading); font-family:var(--font-editorial); font-size:20px; font-weight:400; }
.task-dialog, .task-dialog.task-modal-dialog, .category-dialog, .select-popover, .date-popover, .time-popover,
.week-picker, .plan-options-popover, .contact-type-options { border-radius:0; box-shadow:var(--editorial-shadow); }
.select-trigger, .quick-add, .search-field,
.integration-form input:not([type="checkbox"]), .task-form input:not([type="checkbox"]):not([type="radio"]),
.task-form textarea, .people-form :is(input,textarea,select), .person-edit-fields input,
.milestone-edit-row input, .contact-edit-row input, [data-storage-form] select { border-radius:0; }
.select-popover [role="option"], .schedule-mode-options, .schedule-mode-choice > span { border-radius:0; }
.select-popover [aria-selected="true"] { color:var(--accent); background:var(--accent-soft); }
.select-popover [role="option"] .icon { color:var(--accent); }
.schedule-mode-choice:has(input:checked) > span { color:var(--accent); border-color:var(--art-edge); }
.task-check:checked { background:var(--accent); border-color:var(--accent); }
.task-check:checked::after { background:var(--on-accent); }
.month-day.is-today .month-date strong { background:var(--accent); color:var(--on-accent); }
.calendar-grid .chosen { background:var(--accent); color:var(--on-accent); }
.toast { border-radius:0; box-shadow:var(--editorial-shadow); }
.toast-success .toast-symbol { color:var(--accent); }
.toast-error .toast-symbol { color:var(--priority-high); }
.toast-action { color:var(--accent); }
.setup-icon { color:var(--accent); }
.setup-panel h1 { color:var(--heading); font-family:var(--font-editorial); font-weight:400; }
.setup-panel { border-radius:0; }
.people-group-list > .people-group { margin-top:0; }
.people-page-actions [data-edit-current-group][hidden] { display:none; }
.people-group-list .section-tabs-scroll-thumb { border-radius:0; }
.bulk-panel, .bulk-panel :is(input,select,.select-control,.select-trigger,.select-popover),
.people-bulk-row, .bulk-selected { border-radius:0; }
.personal-space .space-stat-strip { border-radius:0; }

/* Square controls are shared across every workspace and popover. */
button, a.button-primary, a.button-secondary, a.primary-link { border-radius:0 !important; }
.topbar .sync-now, .topbar .icon-button { height:34px; min-height:34px; }
.topbar .sync-now { padding-block:0; }
.topbar .icon-button { color:var(--accent); background:var(--surface); border-color:var(--line); }
.topbar :is(.icon-button,.sync-now):hover { color:var(--accent); background:var(--accent-soft); border-color:var(--art-edge); }
.week-scroll, .month-scroll, .week-calendar, .month-calendar, .week-density-switch,
.day-inspector, .week-preview { border-radius:0; }
.week-day-heading .week-day { flex-direction:column; gap:4px; }
.week-day-date { display:flex; align-items:center; justify-content:center; gap:4px; white-space:nowrap; }
.week-day-date strong { width:24px; min-width:24px; height:24px; flex:0 0 24px; line-height:1; }
.week-grid-lines { position:absolute; inset:0; z-index:1; pointer-events:none; }
.week-grid-lines > span { position:absolute; left:62px; right:0; height:1px; background:var(--line); }
.week-timeline .week-time-day { background-image:none; }
.week-hours + .week-time-day { border-left:0; }

/* One surface and one column geometry from the table headings to the last row. */
.week-calendar { --calendar-gutter:62px; position:relative; background:var(--surface); }
.week-day-heading, .week-all-day, .week-timeline { grid-template-columns:var(--calendar-gutter) repeat(7,minmax(0,1fr)); }
.week-timeline, .week-timeline .week-time-day, .week-timeline .week-time-day.is-today,
.week-all-day, .month-calendar, .month-days, .month-day, .month-day.outside-month { background-color:var(--surface); }
.week-grid-lines > span { left:var(--calendar-gutter); }
.week-date-grid { position:relative; border-left:0; }
.week-day-heading .week-day, .week-timeline .week-time-day { border-left:0; }
.week-hours, .week-all-day > .week-gutter { border-right:0; }
.week-column-lines { position:absolute; inset:0; z-index:6; display:grid; grid-template-columns:var(--calendar-gutter) repeat(7,minmax(0,1fr)); pointer-events:none; }
.week-column-lines > span + span { border-left:1px solid var(--line); }
.week-date-marker, .week-time-marker { z-index:7; }
.month-day.outside-month { background-color:color-mix(in srgb,var(--muted) 10%,var(--surface)); }
.week-day.is-today strong { background:var(--accent); color:var(--on-accent); }
.month-weekdays > span { border-right:1px solid var(--line); }
.month-weekdays > span:last-child { border-right:0; }
.month-date { position:relative; justify-content:center; }
.month-date small { position:absolute; right:3px; }

/* Paging and date text occupy the same heading rows as ordinary page titles. */
.plan-heading-date { display:flex; align-items:center; min-height:22px; }
.plans-page #view-title { font-size:34px; line-height:1.4; min-height:1.4em; }
.plans-page #view-title .week-range { font:inherit; line-height:inherit; min-height:1.4em; color:inherit; vertical-align:top; }
.plan-content > .plan-list-heading:has(#view-title) {
  --page-title-size:34px; --page-title-lines:1;
  display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; flex:none;
  grid-template-rows:22px calc(var(--page-title-size) * 1.4 * var(--page-title-lines)) 20px; gap:8px 12px;
}
.plan-list-heading:has(#view-title) .plan-title-block,
.plan-list-heading:has(#view-title) .plan-title-block > div { display:contents; }
.plan-list-heading:has(#view-title) .plan-heading-date { grid-area:1 / 1 / 2 / 3; margin:0; }
.plan-list-heading:has(#view-title) #view-title { grid-area:2 / 1; align-items:flex-start; min-width:0; height:100%; margin:0; }
.plan-list-heading:has(#view-title) .plan-count { grid-area:3 / 1 / 4 / 3; display:block; min-height:20px; line-height:20px; }
.plan-list-heading:has(#view-title) .plan-heading-actions { grid-area:2 / 2; padding:0; margin-top:calc((var(--page-title-size) * 1.4 - 36px) / 2); }
.plan-list-heading:has(#view-title) [data-new] { display:inline-flex; align-items:center; justify-content:center; gap:6px; height:36px; padding:0 13px; font-size:12px; }
.plan-list-heading:has(#view-title) + .plan-toolbar { height:34px; min-height:34px; flex:0 0 34px; margin-bottom:18px; }
.plans-page #view-title .week-range { display:block; position:relative; min-width:0; max-width:100%; padding-right:20px; }
.plans-page #view-title .week-range .icon { position:absolute; right:0; top:50%; transform:translateY(-50%); }

/* Flat segmented choices avoid a separate inset box around the selected item. */
.task-modal-dialog .schedule-mode-options { gap:0; padding:0; background:var(--surface); border:1px solid var(--line); border-radius:0; }
.task-modal-dialog .schedule-mode-choice + .schedule-mode-choice { border-left:1px solid var(--line); }
.task-modal-dialog .schedule-mode-choice > span { height:38px; min-height:38px; padding:7px 4px; border:0; border-radius:0; background:transparent; color:var(--muted); }
.task-modal-dialog .schedule-mode-choice:hover > span { background:var(--bg); color:var(--accent); }
.task-modal-dialog .schedule-mode-choice:has(input:checked) > span { background:var(--accent-soft); color:var(--accent); }
.task-modal-dialog .schedule-mode-choice:has(input:focus-visible) > span { outline:2px solid var(--field-focus-edge); outline-offset:-2px; box-shadow:none; }

/* Subtasks read as editable list rows instead of nested cards and input boxes. */
.task-modal-dialog [data-subtask-list] { margin-left:16px; border-top:1px solid var(--line); }
.task-modal-dialog .subtask-edit-row { grid-template-columns:20px minmax(0,1fr) 72px; margin:0; padding:6px 0; border:0; border-bottom:1px solid var(--line); border-radius:0; gap:6px; }
.task-modal-dialog .subtask-copy { gap:2px; }
.task-modal-dialog .subtask-copy .person-mention-textarea { border-radius:0; background:transparent; }
.task-modal-dialog .subtask-copy .person-mention-textarea:focus-within { background:var(--bg); }
.task-modal-dialog .subtask-edit-row .subtask-copy :is(input[data-subtask-title],textarea) { height:28px; min-height:28px; border:1px solid transparent; border-radius:0; background:transparent; padding:4px 6px; line-height:18px; }
.task-modal-dialog .task-form .subtask-edit-row .subtask-copy input[type="text"][data-subtask-title] { height:28px; min-height:28px; padding:4px 6px; }
.task-modal-dialog .subtask-edit-row .subtask-copy textarea[data-subtask-note] { height:26px; min-height:26px; padding-block:3px; }
.task-modal-dialog .subtask-edit-row .subtask-copy :is(input[data-subtask-title],textarea):focus { border-color:var(--field-focus-edge); background:transparent; box-shadow:none; outline:none; }
.task-modal-dialog .subtask-leading { gap:4px; padding-top:6px; }
.task-modal-dialog .subtask-leading .subtask-drag { width:20px; height:20px; padding:3px; }
.task-modal-dialog .subtask-controls { display:flex; gap:0; padding-top:2px; }
.task-modal-dialog .task-subtasks > .field-hint { padding-left:16px; }
.task-modal-dialog .subtask-edit-row .subtask-completion { border-radius:0; }

@media(max-width:760px) {
  .plan-content > .plan-list-heading:has(#view-title) { --page-title-size:28px; }
  .week-calendar { --calendar-gutter:34px; }
  .week-grid-lines > span { left:34px; }
  .week-day-date { gap:3px; }
  .week-day-date strong { width:22px; min-width:22px; height:22px; flex-basis:22px; }
  .plans-page #view-title { font-size:28px; }
  .plan-list-heading h1, .module-content .plan-list-heading h1, .person-heading h1 { font-size:28px; }
  .overview .module-content > .plan-list-heading { padding:24px 20px; gap:18px; }
  .overview .plan-list-heading h1 { font-size:32px; }
  .overview-stat strong { font-size:27px; }
  .workspace-mode .sidebar .brand-mark { width:32px; height:34px; }
}
@media(max-width:480px) {
  .plan-content > .plan-list-heading:has(#view-title) { --page-title-lines:2; }
  .week-day-date { gap:2px; font-size:8px; }
  .week-day-date strong { width:20px; min-width:20px; height:20px; flex-basis:20px; font-size:13px; }
}

/* These thumbs float over the content; native scrolling remains on the host. */
.overlay-scroll-host { scrollbar-width:none !important; }
.overlay-scroll-host::-webkit-scrollbar { display:none; }
.overlay-scrollbar { position:fixed; z-index:30; width:8px; padding:0; border:0; background:transparent; touch-action:none; user-select:none; }
.overlay-scrollbar[hidden] { display:none; }
.overlay-scrollbar:focus-visible { outline:none; }
.overlay-scrollbar-thumb { position:absolute; top:0; left:2px; width:4px; background:color-mix(in srgb,var(--accent) 35%,transparent); pointer-events:none; }
.overlay-scrollbar:hover .overlay-scrollbar-thumb, .overlay-scrollbar:focus-visible .overlay-scrollbar-thumb,
.overlay-scrollbar.is-dragging .overlay-scrollbar-thumb { background:color-mix(in srgb,var(--accent) 60%,transparent); }
@media(forced-colors:active) { .overlay-scrollbar-thumb { background:CanvasText; } }
