:root {
  color-scheme: light;
  --bg: #eeece6;
  --paper: #fbfaf7;
  --paper-strong: #ffffff;
  --text: #20211f;
  --muted: #77776f;
  --line: #dedbd3;
  --accent: #354f43;
  --accent-soft: #e3ebe5;
  --danger: #b64c3f;
  --amber: #b97529;
  --shadow: 0 24px 70px rgba(38, 37, 32, 0.09);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% -10%, rgba(255,255,255,.9), transparent 34rem),
    var(--bg);
  color: var(--text);
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.app-shell {
  width: min(100%, 820px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: max(20px, env(safe-area-inset-top)) 28px 14px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(18px) saturate(1.25);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}
.brand-row, .canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.eyebrow {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.area-switcher { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--text); font-size: 28px; font-weight: 760; line-height: 1; letter-spacing: -.04em; cursor: pointer; }
.area-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.project-switcher { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-strong); color: var(--accent); font-size: 11px; font-weight: 750; cursor: pointer; }
.area-meta { display: grid; gap: 2px; color: var(--text); font-size: 12px; font-weight: 650; line-height: 1.1; }
.area-meta small { color: var(--muted); font-size: 9px; font-weight: 500; }
.flow-sections { margin: 0 auto 14px; width: fit-content; }
.area-chevron { color: var(--muted); font-size: 15px; font-weight: 600; }
.storage-state {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.state-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.capture {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 20px;
  padding: 6px 6px 6px 16px;
  background: var(--paper-strong);
  border: 1px solid #d7d3ca;
  border-radius: 17px;
  box-shadow: 0 9px 30px rgba(53, 51, 44, .07);
}
.capture:focus-within { border-color: #8fa094; box-shadow: 0 0 0 3px var(--accent-soft), 0 10px 30px rgba(53, 51, 44, .08); }
.capture input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.capture input::placeholder { color: #9a9890; }
.capture-submit {
  width: 40px; height: 40px; border: 0; border-radius: 12px;
  background: var(--accent); color: white; font-size: 20px; cursor: pointer;
}
.capture-submit-group { display: flex; gap: 6px; }
.capture-submit-green { background: var(--accent); }
.capture-submit-red { background: #c75d58; }
.capture-help { display: flex; justify-content: space-between; align-items: center; margin: 7px 2px 14px; color: #929087; font-size: 11px; }
.capture-help button { padding: 2px 0; border: 0; background: none; color: var(--accent); font-size: 12px; font-weight: 650; cursor: pointer; }

.filters { display: flex; gap: 8px; overflow-x: auto; padding: 1px 0 3px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: #62625c; font-size: 12px; font-weight: 650; cursor: pointer;
}
.filter-chip span { margin-left: 4px; color: #aaa89f; }
.filter-chip.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.filter-chip.status-open { background: var(--accent-soft); border-color: transparent; color: var(--accent); }

.workspace { padding: 24px 28px 150px; }
.canvas-header { padding: 0; margin-bottom: 18px; }
.canvas-header h2 { margin: 0 0 4px; font-size: 17px; letter-spacing: -.02em; }
.canvas-header p { margin: 0; color: var(--muted); font-size: 12px; }
.home-date { display: grid; gap: 3px; text-align: right; color: var(--text); font-size: 13px; font-weight: 650; text-transform: none; }
.home-date small { color: var(--muted); font-size: 10px; font-weight: 400; }
.icon-button { border: 0; background: transparent; color: var(--muted); letter-spacing: 3px; cursor: pointer; }
.canvas-actions { display: flex; align-items: center; gap: 8px; }
.view-toggle { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-strong); color: var(--accent); font-size: 18px; cursor: pointer; }
.view-toggle[hidden] { display: none; }
.undo-button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-strong); color: var(--accent); font-size: 11px; font-weight: 750; cursor: pointer; }
.undo-button:disabled { opacity: .35; cursor: default; }
.canvas-actions .task-edit-button { display: inline-grid; place-items: center; width: 34px; min-width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-strong); color: var(--accent); cursor: pointer; }
.canvas-actions .task-edit-button .inline-ui-icon { width: 18px; height: 18px; }
.canvas-actions .task-edit-button:hover { background: var(--bg-subtle); color: var(--text-primary); }
.canvas-actions .task-edit-button:active { transform: scale(.97); }
.canvas-actions .task-edit-button[hidden] { display: none; }
.quick-fire { display: grid; place-items: center; width: 25px; height: 25px; padding: 0; border: 0; border-radius: 8px; background: transparent; filter: grayscale(1); opacity: .32; cursor: pointer; }
.quick-fire.active { background: transparent; filter: none; opacity: 1; }
.area-popover { position: fixed; z-index: 40; display: grid; min-width: 230px; padding: 7px; border: 1px solid var(--line); border-radius: 16px; background: rgba(252,251,247,.98); box-shadow: 0 16px 45px rgba(33,38,34,.18); backdrop-filter: blur(18px); }
.project-popover { row-gap: 12px; }
.area-popover button { display: grid; gap: 2px; padding: 11px 13px; border: 0; border-radius: 11px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.area-popover button.active { background: var(--accent-soft); color: var(--accent); }
.area-popover small { color: var(--muted); font-size: 10px; }
.scroll-jump { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(140px, calc(env(safe-area-inset-bottom) + 128px)); z-index: 11; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 14px; background: rgba(252,251,247,.92); color: var(--accent); font-size: 20px; box-shadow: 0 7px 22px rgba(33,57,46,.14); backdrop-filter: blur(12px); cursor: pointer; }
.agenda-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.agenda-head h3 { margin: 0; }
.agenda-head button { padding: 7px 10px; border: 0; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 750; }
.calendar-day small { color: var(--muted); font-size: 8px; }
.calendar-event { box-shadow: inset 3px 0 0 #8ea5c2; }
.canvas { border-top: 1px solid var(--line); }

.task-row {
  display: grid;
  grid-template-columns: 24px minmax(0,1fr);
  gap: 12px;
  padding: 19px 2px;
  border-bottom: 1px solid var(--line);
}
.check {
  width: 21px; height: 21px; margin-top: 1px; border: 1.5px solid #aaa89f;
  border-radius: 7px; background: transparent; cursor: pointer;
}
.task-body { position: relative; min-width: 0; padding-right: 58px; }
.task-title-line { display: flex; align-items: flex-start; gap: 10px; }
.task-title { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; font-size: 15.5px; font-weight: 620; line-height: 1.4; letter-spacing: -.012em; }
.fire-mark { margin-right: 5px; font-size: 13px; }
.task-trailing { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; min-height: 22px; }
.urgency-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: #94aa99; box-shadow: 0 0 0 4px rgba(148,170,153,.13); }
.deadline-short { color: #64645d; font-size: 12px; font-weight: 760; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.deadline-short.urgent { color: var(--danger); }
.deadline-urgency-Обычная, .deadline-urgency-Низкая { color: var(--text-secondary); }
.deadline-urgency-Высокая { color: var(--text-secondary); }
.deadline-urgency-Критично { color: var(--danger); }
.urgency-Критично { background: #ce6257; box-shadow: 0 0 0 4px rgba(206,98,87,.13); }
.urgency-Высокая { background: #d58a55; box-shadow: 0 0 0 4px rgba(213,138,85,.13); }
.urgency-Обычная { background: #d1b05d; box-shadow: 0 0 0 4px rgba(209,176,93,.13); }
.urgency-Низкая { background: #83a58a; box-shadow: 0 0 0 4px rgba(131,165,138,.13); }
.meta-line { display: flex; align-items: center; flex-wrap: wrap; gap: 0; margin-top: 7px; color: #828078; font-size: 11.5px; line-height: 1.5; }
.meta-line span + span::before { content: "·"; padding: 0 6px; color: #bbb8af; }
.meta-line .task-type { margin: 0 5px 0 0; }
.task-reminder-bell { display: inline-flex; align-items: center; margin-left: 7px; color: #8b948e; line-height: 1; vertical-align: middle; }
.task-reminder-bell svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.meta-line .task-type::before { content: none; padding: 0; }
.task-type { display: inline-flex; align-items: center; align-self: baseline; width: fit-content; margin-left: 0 !important; padding: 1px 6px 1px 0; border-radius: 999px; background: color-mix(in srgb, var(--type-color) 19%, transparent); color: color-mix(in srgb, var(--type-color) 72%, #34342f); font-size: 11px; font-weight: 720; line-height: 1.25; vertical-align: baseline; transform: none; }
.meta-line .urgent { color: var(--danger); }
.task-detail { margin: 8px 0 0; color: #66645d; font-size: 13px; line-height: 1.5; }
.editable-text { outline: none; white-space: pre-wrap; }
.task-detail.empty::before { content: attr(data-placeholder); color: #aaa89f; }
.task-detail.empty { opacity: .72; }
.task-detail:focus { margin-left: -7px; padding: 6px 7px; border-radius: 8px; background: #f1efe9; opacity: 1; }
.note-block { position: relative; padding: 17px 46px 17px 18px; margin: 16px 0; border-left: 3px solid #89998e; background: #eef2ee; border-radius: 3px 14px 14px 3px; }
.note-block.subtle { border-left-color: #b1a68f; background: #f3f0e9; }
.note-block p { margin: 0; color: #50534e; font-family: ui-serif, Georgia, serif; font-size: 14px; line-height: 1.55; }
.note-editor { min-height: 22px; color: #50534e; font-family: ui-serif, Georgia, serif; font-size: 14px; line-height: 1.55; }
.note-menu { position: absolute; top: 12px; right: 12px; border: 0; background: transparent; color: #99988f; letter-spacing: 2px; cursor: pointer; }
.completed .check { border-color: var(--accent); background: var(--accent); color: white; font-size: 12px; }
.completed .task-title { color: #99978f; text-decoration: line-through; }
.completed .meta-line, .completed .task-detail { opacity: .62; }
.insert-between { display: flex; align-items: center; gap: 4px; height: 0; margin: 0 auto; padding: 0 8px; transform: translateY(-1px); overflow: hidden; opacity: 0; border: 0; border-radius: 999px; background: var(--paper); color: var(--accent); font-size: 11px; cursor: pointer; transition: .15s ease; }
.canvas:hover .insert-between, .insert-between:focus { height: 24px; margin-top: -12px; margin-bottom: -12px; opacity: .55; }
.insert-between:hover, .insert-between:focus { opacity: 1 !important; background: var(--accent-soft); }
.empty-state { padding: 70px 20px; text-align: center; color: var(--muted); }
.empty-state div { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.empty-state h3 { margin: 0 0 6px; color: var(--text); font-size: 16px; }
.empty-state p { margin: 0; font-size: 13px; }
.note-mode { border-color: #aa9c7c; box-shadow: 0 0 0 3px #f1ecdf; }
.note-mode .capture-submit { background: #8b7654; }
.storage-state.offline { color: #8b6b36; background: #f6f0e4; border-color: #e5d8bd; }
.storage-state.offline .state-dot { background: #b47c25; box-shadow: 0 0 0 4px #f1e2c6; }
.storage-state.sync-error { color: var(--danger); border-color: #ead0ca; background: #fbefed; }
.storage-state.sync-error .state-dot { background: var(--danger); box-shadow: 0 0 0 4px #f7deda; }
.floating-add { display: none; }
.bottom-nav { position: fixed; left: 50%; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5,1fr); width: min(100%, 820px); padding: 8px 8px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid color-mix(in srgb, var(--line) 76%, transparent); background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(18px) saturate(1.2); transform: translateX(-50%); }
.bottom-nav button { display: grid; justify-items: center; gap: 2px; padding: 5px; border: 0; background: transparent; color: #97958d; font-size: 10px; font-weight: 650; cursor: pointer; }
.bottom-nav button span { font-size: 18px; line-height: 1; }
.nav-icon { position: relative; display: inline-block; width: 19px; height: 19px; color: currentColor; }
.nav-icon-calendar { border: 2px solid currentColor; border-radius: 4px; }
.nav-icon-calendar::before { content: ""; position: absolute; left: -2px; right: -2px; top: 4px; border-top: 2px solid currentColor; }
.nav-icon-calendar::after { content: ""; position: absolute; left: 3px; top: -4px; width: 2px; height: 6px; background: currentColor; box-shadow: 9px 0 currentColor; border-radius: 2px; }
.nav-icon-note { border: 2px solid currentColor; border-radius: 3px; }
.nav-icon-note::before { content: ""; position: absolute; left: 4px; right: 3px; top: 3px; height: 2px; background: currentColor; box-shadow: 0 5px currentColor, 0 10px currentColor; }
.inline-ui-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bottom-nav .nav-calendar-icon { width: 19px; height: 19px; stroke-width: 2; }
.bottom-nav .nav-note-icon { width: 19px; height: 19px; stroke-width: 2; }
.bottom-nav .nav-home-icon { width: 19px; height: 19px; stroke-width: 2; }
.digest-copy-button { width: 30px; height: 30px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-subtle); color: var(--text-secondary); cursor: pointer; }
.digest-copy-button:hover { background: var(--bg-hover); color: var(--brand); }
.process-task-open { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; }
.bottom-nav button.active { color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 40; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 14px; border-radius: 11px; background: #242522; color: white; font-size: 12px; transition: .2s ease; }
.toast.visible { transform: translate(-50%, 0); opacity: 1; }

.overlay { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; min-height: 100dvh; max-height: 100dvh; overflow: hidden; padding: 24px; background: rgba(32, 33, 31, .3); backdrop-filter: blur(2px); opacity: 0; transition: .18s ease; }
.overlay.open { opacity: 1; }
.choice-sheet, .editor-sheet { width: min(100%, 540px); max-height: calc(100vh - 48px); overflow: hidden; background: var(--paper); border: 1px solid #d9d6ce; border-radius: 22px; box-shadow: 0 25px 70px rgba(22,22,20,.18); transform: translateY(22px); transition: .2s ease; }
.overlay.open .choice-sheet, .overlay.open .editor-sheet { transform: translateY(0); }
.sheet-grabber { width: 38px; height: 4px; margin: 10px auto 2px; border-radius: 3px; background: #d4d1c8; }
.sheet-title { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.sheet-title h3 { margin: 0; font-size: 15px; }
.sheet-title button { border: 0; background: transparent; color: var(--muted); font-size: 24px; cursor: pointer; }
.choice-list { max-height: min(480px, 70vh); overflow: auto; padding: 8px; }
.choice { display: flex; justify-content: space-between; width: 100%; padding: 13px 12px; border: 0; border-radius: 10px; background: transparent; text-align: left; font-size: 14px; cursor: pointer; }
.choice:hover { background: #f0eee8; }
.choice.selected { color: var(--accent); font-weight: 680; background: var(--accent-soft); }
.editor-overlay { padding: 18px; }
.editor-sheet { width: min(100%, 650px); }
.editor-sheet { display: flex; flex-direction: column; }
.editor-sheet > form { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; }
.editor-head { position: relative; flex: 0 0 auto; z-index: 3; display: grid; grid-template-columns: minmax(64px,1fr) auto minmax(64px,1fr); align-items: center; padding: max(14px, env(safe-area-inset-top)) 18px 14px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 96%, transparent); backdrop-filter: blur(16px); }
.editor-head strong { font-size: 14px; }
.editor-head button { padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 13px; cursor: pointer; }
.editor-head button:last-child { text-align: right; font-weight: 700; }
.editor-scroll { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; padding: 18px; -webkit-overflow-scrolling: touch; }
.task-editor-sheet, .task-editor-sheet .editor-scroll { touch-action: pan-y; overscroll-behavior-x: none; overflow-x: hidden; }
.overlay { overscroll-behavior: contain; touch-action: none; }
.editor-scroll, .choice-list { overscroll-behavior: contain; touch-action: pan-y; }
body.overlay-active { position: fixed; width: 100%; overflow: hidden; overscroll-behavior: none; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.income-operational-field[hidden] { display: none; }
.field > span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid #d8d5cc; border-radius: 11px; outline: none; background: white; color: var(--text); font-size: 14px; }
.field textarea { resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #8fa094; box-shadow: 0 0 0 3px var(--accent-soft); }
.main-field textarea { font-size: 17px; font-weight: 620; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.task-editor-pair { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; align-items: start; }
.task-editor-menu-actions { display: grid; gap: 8px; margin: 0; }
.task-submenu-link, .task-submenu-back { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg-subtle); color: var(--text-primary); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.task-submenu-link span { color: var(--text-muted); font-size: 20px; }
.task-submenu-back { justify-content: flex-start; width: auto; min-height: 40px; margin-bottom: 14px; border-color: transparent; background: transparent; color: var(--brand); font-weight: 650; }
.task-crm-section { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg-soft); }
.task-crm-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 28px; padding: 0; border: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: 14px; font-weight: 650; text-align: left; cursor: pointer; }
.task-crm-toggle span { color: var(--text-muted); font-size: 20px; transition: transform .18s ease; }
.task-crm-toggle[aria-expanded="true"] span { transform: rotate(180deg); }
.task-crm-fields { display: grid; gap: 12px; grid-template-columns: minmax(0,1fr); margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.task-crm-fields .field { margin: 0; }
.task-crm-fields .field input, .task-crm-fields .field select { background: var(--bg-surface); }
.task-crm-fields .link-tasks-button, .task-crm-fields .task-link-panel { grid-column: 1 / -1; }
.task-submenu-page[hidden], .task-editor-main[hidden], .task-crm-fields[hidden] { display: none !important; }
.task-editor-main { display: grid; gap: 16px; }
.task-editor-main > .field, .task-editor-main > .task-editor-pair, .task-editor-pair > .field { min-width: 0; margin: 0; }
.task-editor-main .field { gap: 7px; }
.task-editor-main .field input:not([type="checkbox"]), .task-editor-main .field select { min-height: 44px; }
.task-editor-main .field > span { font-size: 11px; line-height: 15px; }
.task-editor-main .status-toggle { min-height: 48px; margin: 0; }
.task-editor-main > .danger-button { margin-top: 4px; }
.task-datetime-control { position: relative; min-width: 0; height: 44px; border-radius: var(--radius-control); background: var(--bg-subtle); }
.task-datetime-control:focus-within { box-shadow: 0 0 0 2px var(--brand-soft); }
.task-datetime-control input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 44px; margin: 0; opacity: 0; cursor: pointer; font-size: 16px; }
.task-datetime-control [data-datetime-label] { display: block; overflow: hidden; padding: 0 26px 0 12px; color: var(--text-primary); font-size: 16px; line-height: 44px; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.task-datetime-control::after { position: absolute; top: 11px; right: 11px; color: var(--text-muted); content: "⌄"; pointer-events: none; }
.task-date-only { justify-self: start; padding: 0; border: 0; background: transparent; color: var(--brand); font: inherit; font-size: 11px; cursor: pointer; }
.task-date-only[hidden] { display: none; }
.status-toggle { display: flex; align-items: center; gap: 10px; padding: 12px; margin: 2px 0 18px; border-radius: 11px; background: #f0eee8; font-size: 13px; }
.status-toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.danger-button { width: 100%; padding: 12px; border: 0; border-radius: 11px; background: #f8eae7; color: var(--danger); font-size: 13px; font-weight: 650; cursor: pointer; }
.sync-sheet .editor-scroll { text-align: center; }
.sync-sheet .field { text-align: left; }
.sync-mark { display: grid; place-items: center; width: 52px; height: 52px; margin: 4px auto 14px; border-radius: 17px; background: var(--accent-soft); color: var(--accent); font-size: 27px; }
.sync-sheet h3 { margin: 0 0 8px; font-size: 18px; }
.sync-copy { max-width: 420px; margin: 0 auto 20px; color: var(--muted); font-size: 13px; line-height: 1.55; }

body[data-page="home"] .capture, body[data-page="home"] .capture-help, body[data-page="home"] .filters,
body[data-page="notes"] .capture, body[data-page="notes"] .capture-help, body[data-page="notes"] .filters,
body[data-page="calendar"] .capture, body[data-page="calendar"] .capture-help, body[data-page="calendar"] .filters,
body[data-page="beta"] .capture, body[data-page="beta"] .capture-help, body[data-page="beta"] .filters,
body[data-page="settings"] .capture, body[data-page="settings"] .capture-help, body[data-page="settings"] .filters { display: none; }
body[data-area="flow"] .capture, body[data-area="flow"] .capture-help, body[data-area="flow"] .filters, body[data-area="flow"] .bottom-nav, body[data-area="flow"] .floating-add { display: none; }
.primary-wide { width: 100%; margin: 14px 0 18px; padding: 13px; border: 0; border-radius: 13px; background: var(--accent); color: white; font-size: 13px; font-weight: 720; cursor: pointer; }
.document-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.document-card { min-height: 160px; padding: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #fffdf8; text-align: left; cursor: pointer; }
.document-card > strong { display: block; margin-bottom: 10px; font-size: 15px; }
.document-card small { display: block; margin-top: 12px; color: var(--muted); font-size: 10px; }
.markdown-preview { max-height: 95px; overflow: hidden; color: #64635d; font-family: ui-serif, Georgia, serif; font-size: 12px; line-height: 1.45; }
.markdown-preview p, .markdown-preview h2, .markdown-preview h3, .markdown-preview h4 { margin: 0 0 5px; font-size: inherit; }
.md-check { display: block; width: 100%; margin: 4px 0; padding: 3px 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.md-check.done { color: var(--text-muted); text-decoration: line-through; }
.document-title { width: 100%; padding: 6px 0 14px; border: 0; border-bottom: 1px solid var(--line); outline: none; background: transparent; font-size: 24px; font-weight: 750; }
.markdown-toolbar { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0; }
.markdown-toolbar button { flex: 0 0 auto; min-width: 36px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: white; font-weight: 700; }
.document-content { width: 100%; min-height: 52vh; padding: 0; border: 0; outline: 0; resize: none; background: transparent; color: var(--text); font-family: ui-serif, Georgia, serif; font-size: 17px; line-height: 1.6; }
.document-hint { margin: 10px 0 18px; color: var(--muted); font-size: 10px; }
.document-mode, .calendar-view-switch { display: grid; grid-template-columns: repeat(2,1fr); gap: 3px; margin: 12px 0; padding: 3px; border-radius: 12px; background: #ebe9e3; }
.document-mode button, .calendar-view-switch button { padding: 8px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 750; }
.document-mode button.active, .calendar-view-switch button.active { background: white; color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.calendar-view-switch { grid-template-columns: repeat(3,1fr); }
.document-live-preview { min-height: 52vh; max-height: none; padding: 12px 0; overflow: visible; color: var(--text); font-size: 16px; }
.document-live-preview h2 { margin: 18px 0 10px; font-size: 26px; }.document-live-preview h3 { margin: 16px 0 8px; font-size: 21px; }.document-live-preview h4 { margin: 14px 0 7px; font-size: 17px; }
.document-live-preview p { margin: 5px 0; }.md-space { height: 9px; }
.link-tasks-button { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--accent); font-weight: 750; }
.task-link-panel { margin-top: 8px; }.task-link-panel > input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; font-size: 13px; }
.task-page-shortcuts { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 8px; }.task-page-shortcuts .completed-shortcut { margin: 0; }
.beta-shortcut { padding: 0 14px; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--accent); font-weight: 750; }
.year-nav { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; margin: 8px 0 12px; text-align: center; }.year-nav button { height: 36px; border: 1px solid var(--line); border-radius: 10px; background: white; font-size: 20px; }
.year-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }.year-month { padding: 11px; border: 1px solid var(--line); border-radius: 14px; background: white; text-align: left; }.year-month > strong { display: block; margin-bottom: 7px; font-size: 11px; text-transform: capitalize; }.year-month > div { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }.year-month i { position: relative; display: grid; place-items: center; aspect-ratio: 1; font-size: 7px; font-style: normal; }.year-month i.busy::after { content:""; position:absolute; bottom:0; width:3px; height:3px; border-radius:50%; background:#d86f4d; }
.week-strip { display: grid; grid-template-columns: repeat(7,1fr); gap: 5px; margin: 12px 0 18px; }.week-strip button { display:grid; gap:4px; padding:8px 2px; border:0; border-radius:12px; background:transparent; color:var(--muted); }.week-strip button.active { background:var(--accent); color:white; }.week-strip small { font-size:8px; text-transform:uppercase; }.week-strip strong { font-size:13px; }
.day-timeline { border-top:1px solid var(--line); }.day-hour { display:grid; grid-template-columns:48px 1fr; min-height:58px; border-bottom:1px solid var(--line); }.day-hour > time { padding-top:8px; color:var(--muted); font-size:10px; }.day-hour .scheduled-task { padding:8px 0; }
.calendar-weekdays, .calendar-grid, .flow-calendar { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 5px; }
.calendar-nav { display: grid; grid-template-columns: 40px 1fr 40px; gap: 8px; margin: 8px 0 12px; }
.calendar-nav button { height: 36px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--accent); font-size: 12px; font-weight: 700; }
.calendar-nav button:first-child, .calendar-nav button:last-child { font-size: 21px; }
.calendar-weekdays { margin: 12px 0 7px; color: var(--muted); font-size: 9px; font-weight: 750; text-align: center; text-transform: uppercase; }
.calendar-day { display: grid; place-items: center; gap: 5px; min-height: 55px; padding: 7px 2px; border: 0; border-radius: 13px; background: transparent; cursor: pointer; }
.calendar-day span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 12px; }
.calendar-day.today span { color: var(--danger); font-weight: 800; }
.calendar-day.selected { background: var(--accent-soft); }
.calendar-day.selected span { background: var(--accent); color: white; }
.calendar-day i { width: calc(var(--load) * 5px); max-width: 20px; height: 3px; border-radius: 3px; background: #d58a55; }
.day-agenda { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.day-agenda h3, .flow-day-detail h3 { margin: 0 0 14px; font-size: 15px; text-transform: capitalize; }
.scheduled-task { display: grid; grid-template-columns: 48px 1fr; gap: 10px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid #ebe8e1; background: transparent; text-align: left; }
.scheduled-task time { color: var(--accent); font-size: 12px; font-weight: 750; }
.scheduled-task span { display: grid; gap: 3px; }
.scheduled-task small { color: var(--muted); }
.flow-toolbar { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 12px; margin: 12px 0 18px; }
.flow-toolbar > button { height: 38px; border: 1px solid var(--line); border-radius: 11px; background: white; font-size: 22px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 11px; background: #e9e7e1; }
.segmented button { padding: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; }
.segmented button.active { background: white; color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.flow-calendar { gap: 4px; }
.flow-day { display: grid; grid-template-rows: 16px 13px 20px 13px; min-height: 80px; padding: 5px 3px; border: 1px solid #e7e4dc; border-radius: 11px; background: white; text-align: center; cursor: pointer; }
.flow-day.selected { border-color: var(--accent); }
.flow-day b { font-size: 10px; }
.flow-day em { font-size: 8px; font-style: normal; white-space: nowrap; }
.flow-day strong { align-self: center; font-size: 9px; }
.income { color: #578263; } .outcome { color: #bd6559; }
.flow-add { position: fixed; right: max(20px, calc((100vw - 780px)/2)); bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 21; padding: 13px 17px; border: 0; border-radius: 14px; background: var(--accent); color: white; font-size: 13px; font-weight: 750; box-shadow: 0 10px 26px rgba(33,57,46,.25); }
.flow-day-detail { margin-top: 10px; }
.balance-card { display: grid; gap: 4px; margin-bottom: 20px; padding: 18px; border-radius: 17px; background: linear-gradient(145deg,#304a3f,#496557); color: white; }
.balance-card small { opacity: .7; }.balance-card strong { font-size: 25px; }
.flow-day-detail h4 { margin: 18px 0 6px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.flow-row { display: flex; justify-content: space-between; width: 100%; padding: 13px 2px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; }
.flow-row.income strong { color: #578263; }.flow-row.outcome strong { color: #bd6559; }
.flow-empty { color: var(--muted); font-size: 12px; }
.duration-field { grid-column: 1 / -1; }
.duration-field > div { display: grid; grid-template-columns: 1fr 1.35fr; gap: 8px; }
.task-schedule-pair .duration-field { grid-column: auto; }
.task-schedule-pair .duration-field > div { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.beta-intro { display: flex; gap: 13px; align-items: center; margin-bottom: 16px; padding: 16px; border-radius: 17px; background: linear-gradient(145deg, #e8ece7, #f1ece5); }
.beta-intro > span { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 14px; background: rgba(255,255,255,.68); color: var(--accent); font-size: 25px; font-weight: 700; }
.beta-intro strong { font-size: 15px; }
.beta-intro p { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.beta-list { display: grid; gap: 12px; }
.beta-card { padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper-strong); }
.beta-task-head { display: flex; justify-content: space-between; gap: 12px; }
.beta-task-head > div { display: grid; gap: 4px; }
.beta-task-head strong { font-size: 13.5px; line-height: 1.35; }
.beta-task-head small { color: var(--muted); font-size: 10.5px; }
.beta-task-head .beta-detail { margin-top: 3px; color: #77746c; line-height: 1.4; }
.beta-badge { flex: 0 0 auto; height: fit-content; padding: 4px 7px; border-radius: 999px; background: #eee8f3; color: #79688b; font-size: 9px; font-weight: 750; }
.beta-proposal { margin-top: 14px; padding-top: 13px; border-top: 1px solid #ebe8e1; }
.proposal-label { margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .03em; text-transform: uppercase; }
.duration-proposal { display: grid; grid-template-columns: 20px 1fr 1.25fr; align-items: center; gap: 8px; margin: 0 0 10px; }
.duration-proposal > span { color: var(--accent); font-size: 22px; }
.duration-proposal input, .duration-proposal select, .action-proposal { min-width: 0; height: 42px; padding: 0 10px; border: 1px solid #d8d5cc; border-radius: 11px; background: white; font-size: 13px; }
.action-proposal { width: 100%; margin-bottom: 10px; }
.beta-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.beta-actions button { height: 39px; border-radius: 11px; font-size: 12px; font-weight: 700; }
.beta-actions .secondary { border: 1px solid var(--line); background: transparent; color: var(--muted); }
.beta-actions .primary { border: 0; background: var(--accent); color: white; }
.beta-waiting { margin: 14px 0 0; color: var(--muted); text-align: center; font-size: 11px; }
.digest-intro { display: grid; gap: 4px; margin: 2px 0 18px; padding: 18px; border-radius: 18px; background: linear-gradient(145deg, #e5ece7, #f4f1e8); }
.digest-intro strong { font-size: 18px; }
.digest-intro span { color: var(--muted); font-size: 12px; text-transform: capitalize; }
.version-age { margin: 18px 2px 0; color: var(--muted); font-size: 10px; text-align: center; }
.digest-card, .settings-card { margin-bottom: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper-strong); }
body[data-page="home"] #canvas > .digest-card:first-child { margin-top: 28px; }
body[data-page="settings"] #canvas > .settings-card:first-child,
body[data-area="flow"] #canvas > *:first-child { margin-top: 28px; }
.digest-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.digest-heading-actions { display: inline-flex; align-items: center; gap: 8px; }
.digest-switch { min-height: 26px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-strong); color: var(--accent); font-size: 11px; font-weight: 700; cursor: pointer; }
.digest-switch:hover { background: var(--accent-soft); }
.digest-title h3, .settings-card h3 { margin: 0; font-size: 15px; }
.digest-title > span { display: grid; place-items: center; min-width: 25px; height: 25px; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 750; }
.digest-task { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid #ebe8e1; background: transparent; text-align: left; cursor: pointer; }
.digest-task span { font-size: 13px; }
.digest-task > span { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.digest-task small, .process-row small { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.discuss-list { margin: 4px 0 0; padding-left: 0; list-style: none; }
.discuss-list li { padding: 9px 0 9px 4px; border-top: 1px solid #ebe8e1; font-size: 13px; line-height: 1.4; }
.debt-add-card h3 { margin: 0 0 14px; font-size: 15px; }
.debt-add-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, .32fr) auto; gap: 8px; }
.debt-add-form input, .debt-add-form button { min-width: 0; height: 52px; padding: 0 14px; border: 1px solid #d8d5cc; border-radius: 14px; background: white; color: var(--text); font-size: 16px; }
.debt-add-form button { border-color: var(--accent); background: var(--accent); color: white; font-size: 14px; font-weight: 750; cursor: pointer; }
.expense-add-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(125px, .26fr) minmax(150px, .3fr) auto; gap: 8px; }
.expense-category-field { position: relative; min-width: 0; }
.expense-category-suggestions { display: none; position: absolute; z-index: 20; top: calc(100% + 5px); left: 0; right: 0; max-height: min(280px, 45vh); padding: 5px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-surface); box-shadow: 0 12px 28px rgba(22,35,29,.16); }
.expense-category-suggestions.open { display: grid; gap: 2px; }
.expense-category-suggestions button { width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text-primary); text-align: left; font-size: 14px; cursor: pointer; }
.expense-category-suggestions button:hover, .expense-category-suggestions button:focus { background: var(--bg-soft); outline: none; }
.expense-row { width: 100%; border: 0; text-align: left; cursor: pointer; }
.expense-edit-hint { display: block; margin-top: 3px; color: var(--text-muted); font-size: 11px; }
.cashflow-tab-wrap { position: relative; }
.cashflow-menu { display: none; position: absolute; z-index: 12; top: calc(100% + 5px); left: 0; min-width: 170px; padding: 5px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-surface); box-shadow: 0 12px 28px rgba(22,35,29,.16); }
.cashflow-menu.open { display: grid; gap: 2px; }
.cashflow-menu button { padding: 9px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--text-primary); text-align: left; font-size: 13px; }
.cashflow-menu button.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.balance-edit-button { display: grid; width: 100%; min-height: 104px; border: 0; text-align: left; cursor: pointer; }
.balance-edit-button small::after { content: "  ✎"; color: var(--brand); }
.reminders-field { display: grid; gap: 10px; margin-top: 16px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-control); }
.reminders-field legend { padding: 0 5px; color: var(--text-primary); font-size: 13px; font-weight: 600; }
.reminders-list { display: grid; gap: 8px; }
.reminder-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px; gap: 7px; }
.reminder-row input { min-width: 0; height: 38px; padding: 0 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-primary); }
.reminder-row button { border: 0; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: 19px; }
.field-note { color: var(--text-muted); font-size: 11px; line-height: 15px; }
.expense-add-form input, .expense-add-form button { min-width: 0; height: 52px; padding: 0 14px; border: 1px solid #d8d5cc; border-radius: 14px; background: white; color: var(--text); font-size: 16px; }
.expense-add-form button { border-color: var(--accent); background: var(--accent); color: white; font-size: 14px; font-weight: 750; cursor: pointer; }
.debt-list-card { margin-top: 22px; }
.debt-list { border-top: 1px solid #ebe8e1; }
.debt-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid #ebe8e1; }
.debt-row > div { display: grid; gap: 4px; }
.debt-row strong { font-size: 14px; }
.debt-row small { color: var(--muted); font-size: 10px; }
.debt-row > div:last-child { justify-items: end; }
.debt-row b { font-size: 17px; }
.debt-row button { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 750; cursor: pointer; }
.debt-repayment-copy { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.digest-empty, .settings-card > p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.process-row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid #ebe8e1; background: transparent; text-align: left; cursor: pointer; }
.process-row div { display: grid; gap: 2px; }
.process-row strong { font-size: 13px; }
.process-pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.type-list { display: grid; gap: 8px; margin: 14px 0; }
.type-setting { display: grid; grid-template-columns: 1fr 42px 28px; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; background: #f3f1eb; }
.type-setting button { border: 0; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
.type-setting input, .structure-row input, .add-direction-form input, .add-project-form input { min-width: 0; height: 38px; padding: 0 10px; border: 1px solid #d8d5cc; border-radius: 10px; background: white; color: var(--text); font-size: 13px; }
.type-setting input[type="color"] { width: 42px; padding: 4px; }
.add-type-form { display: grid; grid-template-columns: 1fr 44px auto; gap: 8px; }
.add-type-form input, .add-type-form button { min-width: 0; height: 42px; border: 1px solid #d8d5cc; border-radius: 11px; background: white; }
.add-type-form input[name="label"] { padding: 0 11px; font-size: 13px; }
.add-type-form input[type="color"] { padding: 5px; }
.add-type-form button { padding: 0 12px; border-color: var(--accent); background: var(--accent); color: white; font-size: 12px; font-weight: 700; }
.structure-list { display: grid; gap: 12px; margin-top: 14px; }
.project-setting { padding: 10px; border-radius: 14px; background: #f3f1eb; }
.structure-row { display: grid; grid-template-columns: 1fr 28px; align-items: center; gap: 6px; }
.structure-row > button { border: 0; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
.project-setting > .structure-row input { font-weight: 750; }
.direction-settings { display: grid; gap: 6px; margin: 7px 0 7px 14px; }
.direction-row input { height: 34px; color: #5f5e58; }
.add-direction-form { display: grid; grid-template-columns: 1fr 36px; gap: 6px; margin-left: 14px; }
.add-direction-form input { height: 34px; background: rgba(255,255,255,.72); }
.add-direction-form button { border: 0; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 18px; }
.add-project-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.add-project-form button { border: 0; border-radius: 10px; background: var(--accent); color: white; padding: 0 12px; font-size: 12px; font-weight: 700; }
.choice-group { padding: 14px 14px 5px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.relation-chip { width: fit-content; margin-top: 7px; padding: 5px 9px; border: 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 700; cursor: pointer; }
.deadline-short { padding: 3px 5px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-size: 11px; font-weight: 750; cursor: pointer; }
.deadline-short:hover, .deadline-short:focus-visible { background: var(--accent-soft); color: var(--accent); outline: none; }
.deadline-short.empty { color: #aaa79e; font-size: 14px; }
.due-picker-overlay { align-items: center; padding: 24px; }
.due-picker { display: flex; flex-direction: column; width: min(420px, 100%); max-height: min(520px, calc(100dvh - 48px)); overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--paper-strong); box-shadow: 0 18px 55px rgba(30,40,34,.18); }
.due-picker-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.due-picker-head button { border: 0; background: transparent; color: var(--accent); font-size: 13px; font-weight: 750; }
.due-picker-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 18px max(34px, calc(env(safe-area-inset-bottom) + 18px)); -webkit-overflow-scrolling: touch; }
.due-picker-body input[type="date"] { width: 100%; height: 52px; padding: 0 12px; border: 1px solid var(--line); border-radius: 13px; background: white; font-size: 18px; }
.clear-due { margin-top: 14px; padding: 10px 0; border: 0; background: transparent; color: var(--danger); font-size: 12px; font-weight: 700; }
.restore-task { width: fit-content; margin-top: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--accent); font-size: 10px; font-weight: 750; cursor: pointer; }
.completed-shortcut { width: 100%; margin: 0 0 8px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.55); color: var(--muted); font-size: 12px; font-weight: 700; text-align: left; cursor: pointer; }
.relations-field { display: grid; gap: 8px; margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.relations-field legend { padding: 0 6px; color: var(--muted); font-size: 11px; font-weight: 750; }
.relations-field label { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; line-height: 1.35; }
.relations-field input { margin-top: 2px; accent-color: var(--accent); }
.relations-field p { margin: 0; color: var(--muted); font-size: 12px; }
.profile-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.profile-form input, .profile-form button { min-width: 0; height: 42px; padding: 0 11px; border: 1px solid #d8d5cc; border-radius: 11px; background: white; color: var(--text); }
.profile-form button { border-color: var(--accent); background: var(--accent); color: white; font-weight: 700; cursor: pointer; }
.profile-form .secondary-card-button { border-color: var(--line); background: transparent; color: var(--accent); }
.business-card-preview { display: grid; gap: 7px; margin-top: 14px; padding: 22px; border-left: 6px solid var(--accent); border-radius: 14px; background: #f4f1e8; box-shadow: inset 0 0 0 1px var(--line); }
.business-card-preview small { color: var(--accent); font-weight: 750; }
.business-card-preview strong { margin-top: 12px; font-size: 22px; }
.business-card-preview span, .business-card-preview p { color: var(--muted); font-size: 12px; }
.business-card-preview p { margin: 10px 0 0; }

@media (max-width: 600px) {
  input, textarea, select { font-size: 16px !important; }
  body { background: var(--paper); }
  .app-shell { width: 100%; box-shadow: none; }
  .topbar { padding-left: 18px; padding-right: 18px; }
  .workspace { padding: 20px 18px 145px; }
  .area-switcher { font-size: 25px; }
  .area-meta { font-size: 10px; }
  .project-switcher { padding: 5px 8px; font-size: 10px; }
  .capture { margin-top: 16px; }
  .capture-help span { display: none; }
  .capture-help { justify-content: flex-end; }
  .task-row { padding: 17px 0; }
  .note-block { margin-left: -4px; margin-right: -4px; }
  .insert-between { height: 20px; margin-top: -10px; margin-bottom: -10px; opacity: .42; }
  .insert-between span { display: none; }
  .overlay { padding: 0; }
  .choice-sheet, .editor-sheet { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
  .editor-overlay { padding: 0; }
  .editor-head { padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: 12px; }
  .editor-scroll { max-height: none; padding-bottom: max(48px, calc(env(safe-area-inset-bottom) + 32px)); scroll-padding-bottom: max(48px, calc(env(safe-area-inset-bottom) + 32px)); }
  .due-picker-overlay { align-items: flex-end; padding: 0; }
  .due-picker { width: 100%; max-height: calc(100dvh - env(safe-area-inset-top)); }
  .due-picker { border-radius: 22px 22px 0 0; }
  .form-grid { grid-template-columns: 1fr; }
  .debt-add-form { grid-template-columns: 1fr 1fr; }
  .debt-add-form input:first-child { grid-column: 1 / -1; }
  .expense-add-form { grid-template-columns: 1fr 1fr; }
  .expense-add-form .expense-category-field { grid-column: 1 / -1; }
  .expense-add-form button { grid-column: 1 / -1; }
  .floating-add {
    display: grid; place-items: center; position: fixed; right: max(18px, env(safe-area-inset-right));
    bottom: max(78px, calc(env(safe-area-inset-bottom) + 66px)); z-index: 12; width: 52px; height: 52px;
    border: 0; border-radius: 17px; background: var(--accent); color: white; font-size: 28px;
    box-shadow: 0 10px 28px rgba(33, 57, 46, .3);
  }
  body[data-page="home"] .floating-add, body[data-page="notes"] .floating-add, body[data-page="calendar"] .floating-add, body[data-page="beta"] .floating-add, body[data-page="settings"] .floating-add { display: none; }
  .year-grid { grid-template-columns: repeat(2,1fr); gap: 7px; }
  .document-grid { grid-template-columns: 1fr; }
  .flow-calendar { gap: 2px; }
  .flow-day { min-height: 73px; border-radius: 9px; }
  .flow-add { right: 18px; }
  .add-type-form { grid-template-columns: 1fr 42px; }
  .add-type-form button { grid-column: 1 / -1; }
  .profile-form { grid-template-columns: 1fr; }
  .undo-button { padding: 0 8px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition-duration: .01ms !important; } }

/* Quiet Focus — semantic surfaces for Contour Beta */
:root {
  --bg-canvas: #F4F5F2;
  --bg-surface: #FFFFFF;
  --bg-subtle: #ECEFEA;
  --bg-soft: #F8F9F7;
  --bg-hover: #F0F3EF;
  --bg-selected: #E4EBE6;
  --text-primary: #202622;
  --text-secondary: #606A63;
  --text-muted: #858E88;
  --text-disabled: #AAB0AC;
  --brand: #315C4A;
  --brand-hover: #294D3F;
  --brand-active: #233F35;
  --brand-soft: #E4EBE6;
  --danger: #8B4949;
  --danger-soft: #F5E7E6;
  --warning: #806128;
  --warning-soft: #F5EEDA;
  --info: #46627E;
  --info-soft: #E9EFF5;
  --radius-sm: 8px;
  --radius-control: 9px;
  --radius-card: 12px;
  --radius-panel: 16px;
  --shadow-card: 0 1px 2px rgba(26,34,29,.04), 0 3px 10px rgba(26,34,29,.035);
  --shadow-floating: 0 8px 24px rgba(26,34,29,.10), 0 2px 6px rgba(26,34,29,.05);
  --bg: var(--bg-canvas);
  --paper: var(--bg-surface);
  --paper-strong: #fff;
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --line: transparent;
  --accent: var(--brand);
  --accent-soft: var(--brand-soft);
  --radius: var(--radius-card);
  font-family: Geist, Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html, body { background: var(--bg-canvas); }
body { background: var(--bg-canvas); color: var(--text-primary); }
button, input, textarea, select { font-family: inherit; }
.app-shell { width: min(100%, 1120px); background: var(--bg-canvas); box-shadow: none; }
.topbar { padding: max(16px, env(safe-area-inset-top)) 28px 14px; background: rgba(255,255,255,.88); border: 0; box-shadow: 0 2px 12px rgba(30,40,34,.035); backdrop-filter: blur(16px); }
.brand-row, .canvas-header { gap: 16px; }
.eyebrow { margin-bottom: 2px; color: var(--text-muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; }
.area-line { min-height: 32px; gap: 8px; }
.area-switcher { color: var(--text-primary); font-size: 25px; font-weight: 600; letter-spacing: -.035em; }
.area-chevron { color: var(--text-muted); font-size: 14px; }
.project-switcher { height: 32px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: var(--bg-subtle); color: var(--text-secondary); font-size: 12px; font-weight: 500; }.project-switcher[hidden] { display: none; }
.project-switcher:hover { background: #DDE3DF; color: var(--text-primary); }
.workspace-menu-heading { margin: 7px 9px 2px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.area-popover .workspace-suboption { padding-left: 22px; }
.status-area { display: flex; align-items: center; align-self: flex-end; gap: 8px; min-height: 32px; margin-bottom: 3px; }.area-meta { color: var(--text-secondary); font-size: 12px; font-weight: 500; white-space: nowrap; }
.area-meta small { color: var(--text-muted); font-size: 10px; }
.storage-state { display: grid; place-items: center; width: 24px; height: 24px; margin: 0; padding: 0; border: 0; border-radius: 999px; background: transparent; }
.state-dot { width: 9px; height: 9px; border-radius: 999px; background: #858E88; box-shadow: 0 0 0 3px rgba(133,142,136,.13); transition: background .16s ease, box-shadow .16s ease; }
.storage-state[data-sync-state="synced"] .state-dot { background: #4C7664; box-shadow: 0 0 0 3px rgba(76,118,100,.14); }.storage-state[data-sync-state="syncing"] .state-dot { background: #B88A31; box-shadow: 0 0 0 3px rgba(184,138,49,.15); animation: sync-pulse 1.2s ease-in-out infinite; }.storage-state[data-sync-state="error"] .state-dot { background: #8B4949; box-shadow: 0 0 0 3px rgba(139,73,73,.14); }.storage-state[data-sync-state="local"] .state-dot { background: #858E88; box-shadow: 0 0 0 3px rgba(133,142,136,.13); }
@keyframes sync-pulse { 50% { transform: scale(.78); opacity: .62; } }

.capture { gap: 8px; margin-top: 16px; padding: 4px 4px 4px 14px; border: 1px solid transparent; border-radius: var(--radius-control); background: var(--bg-subtle); box-shadow: none; }
.capture:focus-within { border-color: var(--brand); background: var(--bg-surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.capture input { font-size: 14px; }
.capture input::placeholder { color: var(--text-muted); }
.capture-submit { width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--brand); font-size: 18px; transition: background .12s cubic-bezier(.2,.8,.2,1), transform .12s cubic-bezier(.2,.8,.2,1); }
.capture-submit:hover { background: var(--brand-hover); }
.capture-submit:active { background: var(--brand-active); transform: translateY(1px); }
.capture-submit-red { background: #8B4949; }
.capture-submit-red:hover { background: #743B3B; }
.capture-help { margin: 6px 2px 10px; color: var(--text-muted); }
.capture-help button { color: var(--text-secondary); font-weight: 500; }
.filters { gap: 4px; padding: 4px; border-radius: 11px; background: var(--bg-subtle); }
.filter-chip { height: 32px; padding: 0 10px; border: 0; border-radius: 8px; color: var(--text-secondary); font-size: 12px; font-weight: 500; }
.filter-chip:hover { background: var(--bg-hover); color: var(--text-primary); }
.filter-chip.active { background: var(--bg-surface); color: var(--text-primary); box-shadow: 0 1px 4px rgba(30,40,34,.08); }
.filter-chip.status-open { background: var(--brand-soft); color: var(--brand); box-shadow: none; }
.filter-chip span { color: var(--text-muted); }

.workspace { padding: 28px 28px 128px; }
.canvas-header { min-height: 40px; margin-bottom: 16px; }
.canvas-header h2 { margin: 0 0 2px; color: var(--text-primary); font-size: 28px; font-weight: 600; line-height: 34px; letter-spacing: -.04em; }
.canvas-header p { color: var(--text-muted); font-size: 12px; font-weight: 500; }
.canvas { border: 0; }
.canvas-actions { gap: 6px; }
.undo-button, .view-toggle { height: 32px; min-height: 32px; border: 0; border-radius: var(--radius-sm); background: var(--bg-subtle); color: var(--text-secondary); font-size: 12px; font-weight: 500; }
.undo-button:hover:not(:disabled), .view-toggle:hover { background: #DDE3DF; color: var(--text-primary); }
.undo-button:disabled { background: transparent; color: var(--text-disabled); }
.icon-button { width: 32px; height: 32px; border-radius: var(--radius-sm); color: var(--text-secondary); }
.icon-button:hover { background: var(--bg-subtle); color: var(--text-primary); }

.task-row { margin-bottom: 8px; padding: 12px 14px; border: 0; border-radius: var(--radius-card); background: var(--bg-surface); box-shadow: var(--shadow-card); transition: box-shadow .12s cubic-bezier(.2,.8,.2,1), transform .12s cubic-bezier(.2,.8,.2,1); }
.task-row:hover { box-shadow: 0 3px 12px rgba(25,32,28,.07); transform: translateY(-1px); }
.check { width: 20px; height: 20px; border: 1.5px solid #A0A8A2; border-radius: 6px; background: #fff; }
.check:hover { border-color: var(--brand); background: #EEF3F0; }
.completed .check { border-color: var(--brand); background: var(--brand); }
.task-title { color: var(--text-primary); font-size: 15px; font-weight: 500; line-height: 21px; letter-spacing: 0; }
.task-trailing { gap: 4px; min-height: 20px; }
.task-trailing .quick-fire, .task-trailing .deadline-short { min-width: 22px; width: 22px; height: 22px; padding: 0; display: inline-grid; place-items: center; font-size: 11px; }
.task-trailing .quick-fire { font-size: 12px; }
.task-action-bottom .quick-fire { width: 21px; height: 21px; font-size: 14px; line-height: 1; transform: none; }
.task-action-cluster { position: absolute; top: 50%; right: 0; display: inline-flex; flex: 0 0 auto; flex-direction: column; align-items: stretch; gap: 1px; min-width: 46px; transform: translateY(-50%); }
.task-action-top, .task-action-bottom { display: inline-flex; align-items: center; gap: 2px; width: 46px; }
.task-action-top { justify-content: flex-end; }
.task-action-top .deadline-short { width: 46px; min-width: 46px; padding: 0; text-align: center; }
.task-action-bottom { justify-content: center; width: 46px; gap: 2px; }
.deadline-short { padding: 2px 5px; border-radius: 5px; color: var(--text-secondary); font-size: 12px; font-weight: 500; }
.deadline-short:hover, .deadline-short:focus-visible { background: var(--brand-soft); color: var(--brand); }
.deadline-short.urgent { color: var(--danger); }
.urgency-dot { width: 7px; height: 7px; box-shadow: none; }
.urgency-Критично { background: #8B4949; box-shadow: none; }.urgency-Высокая { background: #9A6A34; box-shadow: none; }.urgency-Обычная { background: #566F66; box-shadow: none; }.urgency-Низкая { background: #8A918D; box-shadow: none; }
.task-meta-row { display: flex; align-items: center; min-width: 0; margin-top: 4px; }
.task-type-quick { flex: 0 0 auto; display: grid; place-items: center; width: 21px; height: 21px; margin-right: 5px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--text-muted); cursor: pointer; }
.task-action-bottom .task-type-quick { margin-right: 0; }
.task-type-quick:hover, .task-type-quick:focus-visible { background: var(--brand-soft); color: var(--brand); outline: none; }
.task-type-quick .inline-ui-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.meta-line { margin-top: 5px; color: var(--text-muted); font-size: 12px; font-weight: 500; line-height: 16px; }
.meta-line span + span::before { color: #B2B8B3; }
.task-type { min-height: 0; padding: 3px 8px; color: color-mix(in srgb, var(--type-color) 75%, #303733); font-size: 12px; font-weight: 500; }
.task-detail { margin-top: 6px; color: var(--text-secondary); font-size: 14px; line-height: 21px; }
.task-detail:focus { background: var(--bg-soft); }
.task-comment-line { display: flex; align-items: center; gap: 7px; min-height: 22px; margin-top: 5px; }
.task-comment-add { display: grid; place-items: center; width: 21px; height: 21px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #9ba49e; font-size: 17px; line-height: 1; cursor: pointer; }
.task-comment-add:hover { background: var(--bg-soft); color: var(--brand); }
.task-comment-preview { min-width: 0; flex: 1 1 auto; max-width: none; padding: 0; overflow: hidden; border: 0; background: transparent; color: var(--text-secondary); font-size: 12px; line-height: 18px; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.task-comment-preview.placeholder { color: var(--text-muted); }
.comment-sheet { max-width: 520px; }.comment-task-name { margin: 0 0 16px; color: var(--text-secondary); font-size: 13px; line-height: 19px; }
.field select { -webkit-appearance: none; appearance: none; background-color: var(--bg-subtle); background-image: none; }
.task-comment-line { justify-content: flex-start; min-height: 18px; margin-top: 2px; }
.task-comment-add { width: 18px; height: 18px; font-size: 15px; }
.task-comment-add { margin-left: auto; }
.task-comment-preview { max-width: none; font-size: 11px; line-height: 16px; }
.note-block { margin: 12px 0; padding: 16px 44px 16px 16px; border: 0; border-radius: var(--radius-card); background: var(--bg-soft); }
.note-block.subtle { background: var(--bg-subtle); }
.note-block p, .note-editor { color: var(--text-secondary); font-family: inherit; font-size: 14px; line-height: 21px; }
.note-menu { color: var(--text-muted); }
.empty-state { padding: 56px 20px; }.empty-state div { border-radius: var(--radius-card); background: var(--brand-soft); }.empty-state h3 { font-size: 15px; font-weight: 600; }.empty-state p { color: var(--text-secondary); }
.type-picker-list { display: grid; gap: 8px; padding: 18px; }
.type-picker-option { display: flex; align-items: center; min-height: 44px; padding: 7px 10px; border: 0; border-radius: 10px; background: var(--bg-soft); text-align: left; cursor: pointer; }
.type-picker-option:hover, .type-picker-option.active { background: var(--brand-soft); }
.quick-add-body { display: grid; gap: 10px; padding: 18px; }
.quick-add-body input { width: 100%; min-height: 48px; box-sizing: border-box; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg-subtle); color: var(--text-primary); font: inherit; }

.digest-card, .settings-card { margin-bottom: 12px; padding: 16px; border: 0; border-radius: var(--radius-card); background: var(--bg-surface); box-shadow: var(--shadow-card); }
.home-quick-capture { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 4px 4px 4px 14px; border: 1px solid transparent; border-radius: var(--radius-control); background: var(--bg-subtle); }
.home-quick-capture:focus-within { border-color: var(--brand); background: var(--bg-surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.home-quick-capture input { flex: 1; min-width: 0; height: 40px; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: 14px; }
.home-quick-capture input::placeholder { color: var(--text-muted); }
.home-quick-capture .capture-submit { width: 40px; height: 40px; border-radius: var(--radius-sm); }
.home-expanded-add { width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); font-size: 20px; cursor: pointer; }
.home-expanded-add:hover { background: var(--bg-hover); color: var(--brand); }
body[data-page="home"] #canvas > .digest-card:first-child, body[data-page="settings"] #canvas > .settings-card:first-child, body[data-area="flow"] #canvas > *:first-child { margin-top: 0; }
.digest-title { margin-bottom: 10px; }.digest-title h3, .settings-card h3 { color: var(--text-primary); font-size: 18px; font-weight: 600; line-height: 24px; }.digest-title > span { min-width: 24px; height: 24px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 500; }
.digest-task, .process-row { border-top: 0; border-radius: var(--radius-sm); }.digest-task { padding: 10px 8px; }.digest-task:hover, .process-row:hover { background: var(--bg-hover); }.digest-task span, .process-row strong { font-size: 14px; font-weight: 500; }.digest-task small, .process-row small { color: var(--text-muted); font-size: 12px; }
.process-row { padding: 10px 8px; }.process-pulse { background: #4C7664; box-shadow: none; }.discuss-card { background: var(--bg-soft); }.discuss-list li { padding-left: 0; border-top: 1px solid #E6EAE6; font-size: 14px; }.digest-empty, .settings-card > p { color: var(--text-secondary); font-size: 12px; }

.document-card { min-height:116px; padding:16px; border:0; border-radius:var(--radius-card); background:var(--bg-surface); box-shadow:var(--shadow-card); display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-start; text-align:left; }.document-card:hover { box-shadow:0 3px 12px rgba(25,32,28,.07); }.document-card > strong { width:100%; color:var(--text-primary); font-size:15px; font-weight:600; line-height:1.25; }.document-preview-line { display:block; width:100%; margin-top:8px; overflow:hidden; color:var(--text-secondary); font-size:13px; line-height:18px; text-overflow:ellipsis; white-space:nowrap; }.markdown-preview { color:var(--text-secondary); font-family:inherit; }.document-card small { margin-top:auto; color:var(--text-muted); }.page-search { width:100%; box-sizing:border-box; min-height:44px; margin:0 0 14px; padding:0 14px; border:1px solid var(--line, #dfe3df); border-radius:var(--radius-control); background:var(--bg-surface); color:var(--text-primary); font:inherit; }.bulk-toolbar { display:flex; align-items:center; gap:8px; margin:0 0 14px; padding:8px 10px; border-radius:var(--radius-sm); background:var(--brand-soft); color:var(--brand); font-size:13px; font-weight:600; }.bulk-toolbar button { margin-left:auto; min-height:34px; padding:0 12px; border:0; border-radius:10px; background:var(--brand); color:#fff; font:inherit; }.bulk-toolbar button + button { margin-left:0; background:transparent; color:var(--brand); }.bulk-select { display:grid; place-items:center; width:25px; height:25px; padding:0; border:1px solid #b6cbbf; border-radius:8px; background:#fff; color:var(--brand); font-weight:700; }.bulk-select.active, .task-row.bulk-selected { background:var(--brand-soft); }
.document-card, .document-card > strong, .document-preview-line, .document-title, .document-content, .markdown-preview, .document-live-preview { font-family:-apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif; }
.calendar-nav button, .year-nav button, .flow-toolbar > button { border: 0; border-radius: var(--radius-sm); background: var(--bg-subtle); color: var(--text-secondary); }.calendar-nav button:hover, .year-nav button:hover, .flow-toolbar > button:hover { background: #DDE3DF; }.calendar-day { border-radius: var(--radius-sm); }.calendar-day.selected { background: var(--brand-soft); }.calendar-day.selected span { background: var(--brand); }.calendar-day i { background: #4C7664; }
.document-mode, .calendar-view-switch, .segmented { padding: 4px; border-radius: 11px; background: var(--bg-subtle); }.document-mode button, .calendar-view-switch button, .segmented button { border-radius: var(--radius-sm); font-weight: 500; }.document-mode button.active, .calendar-view-switch button.active, .segmented button.active { color: var(--text-primary); box-shadow: 0 1px 4px rgba(30,40,34,.08); }.flow-day { position: relative; border: 0; border-radius: var(--radius-sm); box-shadow: var(--shadow-card); }.flow-day.selected { background: var(--brand-soft); }.flow-day.today:not(.selected) { background: #E4EBE6; box-shadow: inset 0 0 0 1.5px var(--brand), var(--shadow-card); }.flow-day.today b { color: var(--brand); font-weight: 700; }.flow-day.today::after { content: ""; position: absolute; top: 7px; right: 7px; width: 5px; height: 5px; border-radius: 999px; background: var(--brand); }.flow-day.today.selected { box-shadow: inset 0 0 0 1.5px #4C7664, var(--shadow-card); }.balance-card { border-radius: var(--radius-panel); background: var(--brand); }.flow-add { border-radius: var(--radius-control); background: var(--brand); box-shadow: var(--shadow-floating); }
.flow-sections { display: flex; width: min(100%, 340px); max-width: 100%; }.flow-sections button { flex: 1 1 0; min-width: 0; white-space: nowrap; }
body[data-area="flow"] #resultCount { display: none; }
body[data-area="flow"] .workspace { padding-bottom: calc(190px + env(safe-area-inset-bottom)); }
.regular-income-form-actions, .regular-income-row > .regular-income-actions { display: flex; align-items: center; gap: 8px; }
.regular-income-form-actions { grid-column: 1 / -1; }
.regular-income-row .regular-income-actions button:not([data-delete-regular-income]) { width: auto; height: 34px; padding: 0 9px; border: 0; border-radius: 9px; background: var(--bg-subtle); color: var(--text-secondary); font-size: 12px; }
.regular-income-form-actions [data-save-regular-income] { flex: 1; }
.regular-income-form-actions .secondary { padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--text-secondary); }
.flow-day { grid-template-rows: 20px 13px 20px 13px; }.flow-day b { display: grid; place-items: center; justify-self: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--bg-subtle); color: var(--text-secondary); font-size: 10px; font-weight: 600; line-height: 1; }.flow-day.selected b { background: var(--brand); color: #fff; }.flow-day.today b { background: #fff; color: var(--brand); box-shadow: inset 0 0 0 1px #C2D5CA; }
.expense-tools { display: flex; gap: 6px; margin: -2px 0 14px; }.expense-tools button { flex: 1 1 0; min-height: 36px; border: 0; border-radius: var(--radius-sm); background: var(--bg-subtle); color: var(--text-secondary); font-size: 12px; font-weight: 500; }.expense-tools button.active { background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 1px #C2D5CA; }.expense-hint { margin: 10px 0 0; color: var(--text-muted); font-size: 12px; line-height: 16px; }.expense-stats-card, .expense-categories-card { margin-top: 2px; }.expense-periods { grid-template-columns: repeat(3, 1fr); margin: 14px 0 6px; }.expense-period-caption { margin: 0 0 18px; color: var(--text-muted); font-size: 12px; }.expense-chart { display: grid; grid-template-columns: minmax(116px, .8fr) minmax(0, 1.2fr); align-items: center; gap: 18px; }.expense-pie { display: grid; place-items: center; width: min(100%, 150px); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; background: var(--pie); }.expense-pie::before { content: ""; grid-area: 1 / 1; width: 62%; aspect-ratio: 1; border-radius: 50%; background: var(--bg-surface); }.expense-pie span { z-index: 1; grid-area: 1 / 1; max-width: 72px; color: var(--text-primary); font-size: 12px; font-weight: 600; line-height: 15px; text-align: center; }.expense-legend { display: grid; gap: 8px; }.expense-legend div { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 3px 8px; align-items: center; }.expense-legend i { grid-row: span 2; width: 8px; height: 8px; border-radius: 999px; background: var(--category-color); }.expense-legend span { overflow: hidden; color: var(--text-primary); font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }.expense-legend b { color: var(--text-muted); font-size: 11px; font-weight: 500; }.expense-category-list { display: grid; gap: 7px; margin: 14px 0; }.expense-category-list > div { display: grid; grid-template-columns: 1fr 36px; gap: 8px; }.expense-category-list input, .add-expense-category-form input { min-width: 0; height: 40px; padding: 0 11px; border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--bg-soft); color: var(--text-primary); font-size: 14px; }.expense-category-list input:focus, .add-expense-category-form input:focus { outline: none; border-color: var(--brand); background: var(--bg-surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }.expense-category-list button { border: 0; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: 20px; }.add-expense-category-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }.add-expense-category-form button { min-width: 88px; border: 0; border-radius: var(--radius-control); background: var(--brand); color: #fff; font-size: 13px; font-weight: 500; }
.notes-add-actions { display: flex; gap: 8px; margin-bottom: 14px; }.notes-add-actions .primary-wide { flex: 1; margin: 0; }.notes-add-actions .secondary-card-button { flex: 0 0 auto; min-height: 42px; padding: 0 14px; }.table-editor { display: grid; gap: 6px; margin: 10px 0 12px; overflow-x: auto; }.table-editor-head, .table-editor-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) minmax(175px, .8fr) 32px; gap: 6px; align-items: center; min-width: 560px; }.table-editor-head { color: var(--text-muted); font-size: 11px; }.table-editor-row input { min-width: 0; height: 40px; padding: 0 9px; border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--bg-subtle); color: var(--text-primary); font-size: 12px; }.table-editor-row input:focus { outline: none; border-color: var(--brand); background: var(--bg-surface); }.table-editor-row button { height: 34px; border: 0; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: 19px; }.table-editor + .secondary-card-button { width: 100%; }
.overdue-select-list { display: grid; gap: 8px; }.digest-select-task { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-top: 8px; padding: 11px 10px; border: 1px solid #e1e6e1; border-radius: var(--radius-sm); background: var(--bg-subtle); box-shadow: 0 1px 2px rgba(24, 40, 31, .03); cursor: pointer; }.digest-select-task:first-of-type { margin-top: 0; }.digest-select-task input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }.digest-select-task span { min-width: 0; font-size: 13px; }.digest-select-task small { color: var(--text-muted); font-size: 10px; }.overdue-transfer-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }.digest-switch:disabled { opacity: .45; cursor: default; }
.note-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }.note-tools .link-tasks-button { flex: 1 1 180px; }
.expense-range-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 8px; }.expense-range-fields label { display: grid; gap: 4px; color: var(--text-muted); font-size: 11px; }.expense-range-fields input { width: 100%; min-width: 0; height: 38px; padding: 0 9px; border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--bg-subtle); color: var(--text-primary); font-size: 12px; }.expense-range-fields input:focus { outline: none; border-color: var(--brand); background: var(--bg-surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }

.bottom-nav { width: min(100%, 1120px); padding: 8px 8px max(8px, env(safe-area-inset-bottom)); border: 0; background: rgba(255,255,255,.92); box-shadow: 0 -2px 12px rgba(30,40,34,.035); backdrop-filter: blur(16px); }.bottom-nav button { min-height: 46px; border-radius: var(--radius-sm); color: var(--text-muted); font-weight: 500; }.bottom-nav button.active { background: var(--brand-soft); color: var(--brand); }.bottom-nav button span { font-size: 18px; }
.scroll-jump { border: 0; border-radius: var(--radius-control); background: var(--bg-surface); box-shadow: var(--shadow-floating); color: var(--brand); }.floating-add { border-radius: var(--radius-control); background: var(--brand); box-shadow: var(--shadow-floating); }

.area-popover, .choice-sheet, .editor-sheet { border: 0; border-radius: var(--radius-panel); background: var(--bg-surface); box-shadow: var(--shadow-floating); }.area-popover button.active, .choice.selected { background: var(--brand-soft); color: var(--brand); }.area-popover button:hover, .choice:hover { background: var(--bg-hover); }.sheet-title, .editor-head { border-bottom: 0; background: var(--bg-surface); }.field > span { color: var(--text-secondary); font-weight: 500; letter-spacing: 0; }.field input, .field select, .field textarea, .task-link-panel > input { border: 1px solid transparent; border-radius: var(--radius-control); background: var(--bg-subtle); }.field input:focus, .field select:focus, .field textarea:focus, .task-link-panel > input:focus { border-color: var(--brand); background: var(--bg-surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }.status-toggle { border-radius: var(--radius-control); background: var(--bg-soft); }.primary-wide, .add-type-form button, .add-project-form button, .profile-form button { border-radius: var(--radius-control); background: var(--brand); }.link-tasks-button { border: 0; border-radius: var(--radius-control); background: var(--bg-subtle); color: var(--text-secondary); }.danger-button { border-radius: var(--radius-control); background: var(--danger-soft); color: var(--danger); }
.project-popover { min-width: 180px; }
.multi-choice { align-items: center; gap: 10px; }.multi-choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }.multi-choice i { margin-left: auto; color: transparent; font-style: normal; }.multi-choice input:checked ~ i { color: var(--brand); }.choice-empty { margin: 14px; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; border-top: 1px solid #E6EAE6; }.sheet-actions button { height: 40px; border: 0; border-radius: var(--radius-control); font-size: 14px; font-weight: 500; }.sheet-actions .secondary { background: var(--bg-subtle); color: var(--text-secondary); }.sheet-actions .primary { background: var(--brand); color: #fff; }
.person-list { display: grid; gap: 6px; margin: 14px 0; }.person-setting { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 0 10px; border-radius: var(--radius-sm); background: var(--bg-soft); color: var(--text-primary); font-size: 14px; }.person-setting button { width: 30px; height: 30px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); font-size: 20px; cursor: pointer; }.person-setting button:hover { background: var(--danger-soft); color: var(--danger); }.people-empty { margin: 12px 0; color: var(--text-muted); font-size: 13px; }.add-person-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }.add-person-form input, .add-person-form button { min-width: 0; height: 40px; border: 0; border-radius: var(--radius-control); }.add-person-form input { padding: 0 12px; background: var(--bg-subtle); color: var(--text-primary); }.add-person-form button { padding: 0 14px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 500; }

.digest-heading-actions > span { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 500; }
.digest-calendar-button, .digest-transfer-cancel { width: 30px; height: 30px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-subtle); color: var(--text-secondary); font-size: 18px; line-height: 1; cursor: pointer; }
.digest-add-button { width: 30px; height: 30px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-subtle); color: var(--brand); font-size: 19px; line-height: 1; cursor: pointer; }
.digest-add-button:hover { background: var(--brand-soft); }
.digest-calendar-button:hover, .digest-transfer-cancel:hover { background: var(--bg-hover); color: var(--brand); }
.digest-task-row { display: flex; align-items: center; gap: 6px; border-top: 1px solid #E6EAE6; }
.digest-task-row .digest-task { flex: 1; min-width: 0; }
.digest-task-comment { display: block; max-width: 100%; overflow: hidden; color: var(--text-muted); font-size: .9em; font-weight: 400; line-height: 17px; text-overflow: ellipsis; white-space: nowrap; }
.discuss-task-open .digest-task-comment { max-width: 100%; }
.digest-task-trailing { display: inline-flex; flex: 0 0 50px; flex-direction: column; align-items: stretch; gap: 1px; }
.digest-action-bottom { display: grid; grid-template-columns: 24px 24px; align-items: center; column-gap: 2px; width: 50px; }
.digest-type { display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--text-muted); cursor: pointer; }
.digest-type .inline-ui-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.digest-action-top { display: grid; grid-template-columns: 24px 24px; align-items: center; column-gap: 2px; width: 50px; }
.digest-fire, .digest-comment-add, .digest-due { display: inline-grid; place-items: center; width: 24px; min-width: 24px; height: 24px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #9aa49e; font-size: 13px; line-height: 1; cursor: pointer; }
.digest-fire { filter: grayscale(1); opacity: .5; font-size: 12px; }
.digest-fire.active { filter: none; opacity: 1; background: transparent; }
.digest-fire:hover, .digest-comment-add:hover, .digest-due:hover { background: var(--bg-hover); color: var(--brand); }
.digest-due { width: 24px; min-width: 24px; color: var(--text-muted); }
.digest-due .inline-ui-icon { width: 16px; height: 16px; }
.digest-due.urgent { color: var(--danger); }
.discuss-list li .digest-task-trailing { margin-left: auto; }
.digest-check { width: 22px; height: 22px; flex: 0 0 22px; margin-left: 4px; padding: 0; border: 1.5px solid #AAB5AF; border-radius: 50%; background: transparent; cursor: pointer; }
.digest-check:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.digest-transfer-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.discuss-list li { display: flex; align-items: center; gap: 6px; }
.discuss-list li .digest-check { margin-left: 0; }
.discuss-task-open { flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; }

@media (max-width: 600px) {
  .topbar { padding-left: 16px; padding-right: 16px; }.workspace { padding: 20px 16px 132px; }.area-switcher { font-size: 23px; }.storage-state { display: grid; }.status-area { gap: 5px; }.area-meta { font-size: 10px; }.canvas-header h2 { font-size: 24px; line-height: 30px; }.task-row { padding: 12px; }.task-title { font-size: 14px; }.task-trailing { gap: 4px; }.digest-card, .settings-card { padding: 14px; }.digest-title h3, .settings-card h3 { font-size: 17px; }.bottom-nav { padding-left: 6px; padding-right: 6px; }.bottom-nav button { font-size: 10px; }.document-grid { gap: 8px; }.choice-sheet, .editor-sheet { border-radius: 16px 16px 0 0; }
}


/* New relation controls, compact cancel action, and build metadata */
.cancel-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; font-size: 21px; font-weight: 400; line-height: 1; }
.editor-head button:first-child .cancel-icon { color: var(--muted); }
.process-row-wrap { display: flex; align-items: stretch; gap: 8px; }
.process-row-wrap .process-row { flex: 1 1 auto; }
.control-links-button { flex: 0 0 34px; margin-left: 0; border: 0; border-radius: 10px; background: var(--accent-soft); color: var(--accent); cursor: pointer; font-size: 17px; }
.app-version-card .app-version-value { margin-top: 8px; color: var(--accent); font-size: 22px; font-weight: 750; letter-spacing: .02em; }
.app-version-card p { margin: 6px 0 0; color: var(--muted); }

/* Personal CRM */
.nav-crm-icon { width: 21px; height: 21px; }
.crm-toolbar { display: grid; gap: 10px; margin-bottom: 14px; }
.crm-filter-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px; }
.crm-filter-row select, .crm-toolbar .page-search { min-width: 0; }
.crm-new-button { white-space: nowrap; }
.crm-client-card { display: grid; gap: 10px; padding: 16px; margin-bottom: 10px; border: 1px solid var(--line, #e6e6e1); border-radius: 18px; background: var(--card, #fff); box-shadow: 0 8px 24px rgba(42, 45, 40, .06); }
.crm-card-head, .crm-section-head, .crm-card-footer, .crm-history-row, .crm-contact-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.crm-client-open { border: 0; padding: 0; background: transparent; color: var(--ink, #272822); text-align: left; font: inherit; cursor: pointer; }
.crm-client-open strong { font-size: 1.05rem; }
.crm-status { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; background: #eef1e6; color: #536348; font-size: .75rem; white-space: nowrap; }
.crm-card-meta, .crm-card-footer, .crm-muted { color: var(--muted, #777b72); font-size: .82rem; }
.crm-card-next { display: grid; gap: 4px; }
.crm-card-next small { color: var(--muted, #777b72); font-size: .75rem; }
.crm-card-next button, .crm-task-row { display: flex; justify-content: space-between; gap: 12px; width: 100%; border: 0; padding: 0; background: transparent; color: var(--ink, #272822); text-align: left; cursor: pointer; }
.crm-card-next button span, .crm-task-row small { color: var(--muted, #777b72); white-space: nowrap; }
.crm-card-footer { padding-top: 8px; border-top: 1px solid var(--line, #e6e6e1); }
.crm-editor-sheet { max-height: min(92vh, 900px); }
.crm-card-sections { display: grid; gap: 16px; padding: 0 20px 20px; overflow: auto; }
.crm-card-sections section { display: grid; gap: 9px; }
.crm-section-head h3 { margin: 0; font-size: .98rem; }
.crm-directions-field { display: grid; gap: 8px; margin: 12px 0; padding: 12px; border: 1px solid var(--line, #e6e6e1); border-radius: 14px; }
.crm-directions-field legend { padding: 0 5px; color: var(--muted, #777b72); font-size: .8rem; }
.crm-check { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.crm-task-row { align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line, #e6e6e1); }
.crm-task-row span { overflow: hidden; text-overflow: ellipsis; }
.crm-history-row, .crm-contact-row { padding: 10px 0; border-bottom: 1px solid var(--line, #e6e6e1); }
.crm-history-row > div:first-child, .crm-contact-row > div:first-child { min-width: 0; display: grid; gap: 3px; }
.crm-history-row strong, .crm-contact-row strong { font-size: .88rem; }
.crm-history-row span, .crm-contact-row span, .crm-contact-row small { color: var(--muted, #777b72); font-size: .78rem; }
.crm-history-row p, .crm-contact-row p { margin: 2px 0 0; font-size: .88rem; white-space: pre-wrap; }
.crm-inline-form { display: grid; grid-template-columns: 130px 170px minmax(120px, 1fr) auto; gap: 7px; }
.crm-inline-form input, .crm-inline-form select { min-width: 0; }
@media (max-width: 720px) {
  .crm-filter-row { grid-template-columns: 1fr 1fr; }
  .crm-new-button { grid-column: 1 / -1; }
  .crm-card-footer { display: grid; gap: 4px; }
  .crm-card-next button { display: grid; gap: 3px; }
  .crm-card-next button span { white-space: normal; }
  .crm-inline-form { grid-template-columns: 1fr 1fr; }
  .crm-inline-form input[name="text"], .crm-inline-form button { grid-column: 1 / -1; }
  .crm-card-sections { padding-left: 14px; padding-right: 14px; }
}

/* UI refinements: collapsible digests, goals and unified page tools */
.page-tools-host { display: grid; gap: 8px; margin: 0 0 14px; }
.page-tools-host .capture { margin-top: 0; }
.page-tools-host .capture-help { margin-bottom: 0; }
.page-tools-host .filters { margin: 0; }
.task-select-button { display: inline-grid; place-items: center; width: 44px; min-width: 44px; padding: 0; }
.task-select-button .inline-ui-icon { width: 17px; height: 17px; }
.task-action-bottom { gap: 4px; }
.quick-fire, .task-type-quick { width: 22px; height: 22px; }
.quick-fire { font-size: 11px; }
.task-type-quick .inline-ui-icon { width: 14px; height: 14px; }
.digest-count-toggle { display: inline-grid; place-items: center; width: 28px; min-width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: var(--brand); color: #fff; font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.digest-collapsed .digest-count-toggle { background: #a9b0aa; }
.digest-collapsed .digest-title { margin-bottom: 0; }
.digest-collapsed .digest-heading-actions > :not(.digest-count-toggle) { display: none; }
.digest-collapsed .digest-title h3 { color: var(--text-primary); }

.digest-card { background: var(--digest-background, var(--bg-surface)); color: var(--digest-color, var(--text-primary)); }
.digest-card .digest-task-meta { display: block; color: var(--text-secondary); font-size: 11px; margin-top: 2px; }
.digest-items { margin: 0; padding: 0; }
.digest-layout-numbered, .digest-layout-bulleted { padding-left: 28px; }
.digest-layout-numbered .digest-task-row, .digest-layout-bulleted .digest-task-row { padding-left: 2px; }
.settings-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.settings-section-head p { margin: 8px 0 0; color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.digest-settings-list { display: grid; gap: 8px; margin-top: 14px; }
.digest-setting-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); }
.digest-setting-row.dragging { opacity: .5; }
.digest-setting-name { display: grid; gap: 3px; flex: 1; border: 0; background: transparent; text-align: left; color: var(--text-primary); cursor: pointer; }
.digest-setting-name small, .digest-drag-handle, .digest-setting-field small { color: var(--text-secondary); font-size: 11px; }
.digest-drag-handle { padding: 4px 6px; cursor: grab; font-size: 18px; }
.digest-editor-sheet { max-width: 720px; }
.digest-editor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.digest-setting-field select { min-height: 42px; }
.digest-options { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 14px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.digest-options legend { padding: 0 6px; color: var(--text-secondary); font-size: 12px; }
.digest-options label { font-size: 13px; }
@media (max-width: 640px) { .digest-editor-grid { grid-template-columns: 1fr; } .settings-section-head { align-items: center; } }
.chain-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.notes-mode-switch { margin-bottom: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.notes-mode-switch button { flex: 1; min-height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--text-muted); font: inherit; font-weight: 700; cursor: pointer; }
.notes-mode-switch button.active { background: var(--brand); color: #fff; }
.goal-card { min-height: 132px; }
.goal-progress-track { display: block; height: 9px; margin: 10px 0 6px; overflow: hidden; border-radius: 999px; background: #e7ebe5; }
.goal-progress-bar { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #91b7a0 0%, #6f9e8c 50%, #c6ae71 100%); transition: width .2s ease; }
.goal-progress-label { display: block; color: var(--text-muted); font-size: 11px; font-weight: 650; }
.crm-toolbar { display: grid; gap: 0; }
.crm-toolbar .page-tools-host { margin: 0; }
.crm-filter-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px; align-items: center; }
.crm-filter-row select { width: 100%; min-height: 42px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: 13px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8b978f 50%), linear-gradient(135deg, #8b978f 50%, transparent 50%); background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.crm-filter-row select:focus { border-color: var(--brand); outline: 0; box-shadow: 0 0 0 3px var(--brand-soft); }
.document-sheet .note-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.document-sheet .note-tools .link-tasks-button { min-width: 0; }
@media (max-width:720px) { .crm-filter-row { grid-template-columns: 1fr 1fr; } .crm-filter-row .crm-new-button { grid-column: 1 / -1; } .document-sheet .note-tools { grid-template-columns: 1fr; } .page-tools-host .filters { overflow-x: auto; flex-wrap: nowrap; } }

/* Follow-up layout fixes */
body[data-page="tasks"] .topbar > #captureForm,
body[data-page="tasks"] .topbar > .capture-help,
body[data-page="crm"] .topbar > #captureForm,
body[data-page="crm"] .topbar > .capture-help { display: none; }
.page-capture {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 4px 4px 4px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--bg-subtle);
  box-shadow: none;
}
.page-capture:focus-within {
  border-color: var(--brand);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}
.page-capture input {
  flex: 1;
  min-width: 0;
  width: auto;
  height: 40px;
  font-size: 14px;
}
.page-capture .capture-submit { width: 40px; height: 40px; border-radius: var(--radius-sm); }
.page-capture .home-expanded-add { flex: 0 0 32px; }
.page-capture-help { margin: 0; }
.task-page-shortcuts { grid-template-columns: auto auto; justify-content: start; }
.task-page-shortcuts .beta-shortcut { width: auto; min-width: 0; }
.crm-new-button { min-height: 42px; padding: 0 16px; border: 0; border-radius: var(--radius-control); background: linear-gradient(135deg, var(--brand), #739883); color: #fff; font: inherit; font-size: 13px; font-weight: 750; box-shadow: 0 7px 18px rgba(83, 119, 95, .18); white-space: nowrap; cursor: pointer; }
.crm-new-button:hover, .crm-new-button:focus-visible { filter: brightness(1.04); outline: 0; box-shadow: 0 0 0 3px var(--brand-soft), 0 8px 20px rgba(83, 119, 95, .2); }
.chain-icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.undo-button { display: inline-grid; place-items: center; width: 36px; min-width: 36px; height: 36px; padding: 0; border-radius: 11px; }
.undo-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.15; stroke-linecap: round; stroke-linejoin: round; }


/* Expense daily average and solid chain icon */
.expense-daily-average {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -8px 0 18px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--text-secondary);
  font-size: 13px;
}
.expense-daily-average strong {
  color: var(--brand);
  font-size: 15px;
  font-weight: 750;
  white-space: nowrap;
}
.chain-icon,
.task-type-quick .chain-icon,
.digest-type .chain-icon {
  fill: currentColor;
  stroke: none;
  stroke-width: 0;
}


/* Regression fixes: relation controls, responsive expense forms and shared quick add. */
.process-row-wrap { display: flex; align-items: center; gap: 10px; }
.control-links-button { flex: 0 0 30px; width: 30px; height: 30px; margin: 0; padding: 0; display: inline-grid; place-items: center; border: 0; border-radius: var(--radius-sm); background: var(--bg-subtle); color: var(--text-secondary); }
.control-links-button:hover { background: var(--brand-soft); color: var(--brand); }
.control-links-button .inline-ui-icon { width: 16px; height: 16px; }
.crm-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.crm-toolbar .page-tools-host { grid-column: 1 / -1; }
.crm-new-client-button, .crm-new-project-button { min-height: 42px; white-space: nowrap; }
.project-entity-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.project-entity-row:first-child { border-top: 0; }
.project-entity-row > div { min-width: 0; display: grid; gap: 3px; }
.project-entity-row small { color: var(--text-muted); font-size: 11px; }
.project-entity-row button { min-height: 32px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: var(--bg-subtle); color: var(--text-secondary); font-size: 11px; }
@media (max-width: 700px) {
  .crm-toolbar { grid-template-columns: 1fr; }
  .crm-new-client-button, .crm-new-project-button { width: 100%; }
  .expense-add-form { grid-template-columns: 1fr 1fr; }
  .expense-add-form input, .expense-add-form select, .expense-add-form button { min-width: 0; width: 100%; }
}
@media (min-width: 701px) {
  .expense-add-form { grid-template-columns: minmax(0, 1.4fr) minmax(170px, .6fr) minmax(150px, .5fr) auto; align-items: stretch; }
  .expense-add-form input, .expense-add-form select, .expense-add-form button { min-width: 0; }
  .floating-add { display: grid; place-items: center; position: fixed; right: 28px; bottom: 88px; z-index: 12; width: 46px; height: 46px; border: 0; border-radius: var(--radius-control); background: var(--brand); color: #fff; font-size: 24px; box-shadow: var(--shadow-floating); cursor: pointer; }
}
@media (max-width: 700px) {
  body[data-area="flow"] .floating-add { display: none; }
  body:not([data-area="flow"]) .floating-add { display: grid; }
}


/* Regression fixes: stable control-link geometry, CRM controls, expenses and repeats */
.process-row-wrap { align-items: center; gap: 10px; }
.control-links-button { display: grid; place-items: center; align-self: center; flex: 0 0 40px; width: 40px; height: 40px; min-height: 40px; padding: 0; line-height: 0; }
.control-links-button svg { display: block; width: 20px; height: 20px; margin: 0; }
.expense-add-form input, .expense-add-form select, .expense-add-form button { box-sizing: border-box; min-width: 0; width: 100%; }
.expense-add-form input[type="date"] { min-width: 0; max-width: 100%; }
.expense-date-field { display: block; min-width: 0; max-width: 100%; overflow: hidden; border-radius: 14px; }
.expense-date-field input[type="date"] { display: block; min-inline-size: 0; max-inline-size: 100%; inline-size: 100%; }
.expense-amount-field { display: grid; min-width: 0; gap: 6px; }
.expense-amount-field small { min-height: 14px; color: var(--text-muted); font-size: 10px; line-height: 14px; }
.expense-amount-field small.error { color: var(--danger); }
.expense-calculator-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.expense-calculator-actions button { min-height: 38px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg-subtle); color: var(--brand); font-size: 20px; font-weight: 650; line-height: 1; box-shadow: none; }
.expense-calculator-actions button:hover, .expense-calculator-actions button:focus-visible { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); outline: 0; }
.repeat-field { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-control); }
.repeat-field legend { padding: 0 5px; color: var(--text-primary); font-size: 13px; font-weight: 600; }
.repeat-custom-fields { display: grid; gap: 6px; }
.general-balance-expression { display: grid; gap: 7px; }
.general-balance-expression strong { white-space: nowrap; overflow-x: auto; font-variant-numeric: tabular-nums; }
.general-balance-expression > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; color: var(--muted); font-size: 10px; }
.crm-toolbar-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, auto) minmax(170px, auto); gap: 8px; align-items: center; }
.crm-toolbar-top select { min-width: 0; height: 42px; }
.crm-project-details { display: grid; gap: 3px; padding-top: 8px; border-top: 1px solid var(--line); }
.crm-project-details small { color: var(--muted); font-size: 11px; }
.crm-project-details span { overflow-wrap: anywhere; }
.crm-project-details ul { display: grid; gap: 4px; margin: 0; padding-left: 18px; font-size: 12px; }
.crm-project-details a { color: var(--brand); overflow-wrap: anywhere; }
.crm-project-card { cursor: pointer; }
.project-materials-field { display: grid; gap: 8px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-control); }
.project-materials-field legend { padding: 0 5px; color: var(--text-primary); font-size: 13px; font-weight: 600; }
.project-material-row { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 8px; }
.project-material-row input { min-width: 0; }
.crm-spaces-field { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.crm-space-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.repeat-day-grid { display: grid; grid-template-columns: repeat(7, minmax(32px, 1fr)); gap: 5px; }
.repeat-day { display: grid; place-items: center; gap: 3px; padding: 7px 3px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 11px; }
.repeat-day:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.repeat-day input { margin: 0; }
.project-switcher { max-width: min(48vw, 260px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.area-line { flex-wrap: nowrap; min-width: 0; }
.area-switcher { flex: 0 0 auto; }
@media (max-width: 640px) {
  .crm-toolbar-top { grid-template-columns: 1fr 1fr; }
  .crm-toolbar-top .page-search { grid-column: 1 / -1; }
  .crm-toolbar-top select { width: 100%; }
  .expense-add-form { grid-template-columns: 1fr; }
  .expense-add-form input[type="date"], .expense-date-field { width: 100%; max-width: 100%; }
  .repeat-day-grid { gap: 3px; }
  .repeat-day { font-size: 10px; padding-inline: 1px; }
  .general-balance-expression > div { gap: 4px; font-size: 9px; }
  .project-material-row { grid-template-columns: 1fr; }
}

.floating-add[hidden] { display: none !important; }
.floating-add:not([hidden]) { display: grid; place-items: center; }
.digest-calendar-button:disabled { opacity: .4; cursor: default; }

/* Compact calculator controls and a bounded date field. */
.expense-single-form { grid-template-columns: minmax(0, 1fr); }
.expense-single-form > .expense-category-field,
.expense-single-form > .expense-operator-date-row,
.expense-single-form > input[name="comment"],
.expense-single-form > button[type="submit"] { min-width: 0; width: 100%; }
.expense-operator-date-row { display: flex; flex-wrap: nowrap; gap: 8px; min-width: 0; width: 100%; max-width: 100%; align-items: stretch; }
.expense-calculator-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.expense-calculator-actions button { flex: 0 0 52px; width: 52px; min-width: 52px; height: 52px; min-height: 52px; padding: 0; border-radius: 13px; font-size: 22px; }
.expense-date-field { display: block; flex: 1 1 auto; width: auto; min-width: 0; max-width: 100%; height: 52px; overflow: hidden; }
.expense-date-field input[type="date"] { display: block; box-sizing: border-box; width: 100%; height: 52px; min-height: 52px; min-width: 0; max-width: 100%; min-inline-size: 0; inline-size: 100%; padding: 0 10px; border-radius: 13px; font-size: 16px; line-height: 52px; text-align: center; -webkit-appearance: none; appearance: none; }
.expense-date-field input[type="date"]::-webkit-date-and-time-value { min-height: 0; margin: 0; text-align: center; }
.expense-date-field input[type="date"]::-webkit-datetime-edit { display: block; padding: 0; text-align: center; }
.expense-bucket-choice { display: inline-flex; justify-self: start; flex-wrap: wrap; gap: 6px; max-width: 100%; }
.expense-bucket-choice label { position: relative; display: inline-flex; cursor: pointer; }
.expense-add-form .expense-bucket-choice input[type="radio"] { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; }
.expense-bucket-choice span { display: inline-flex; align-items: center; min-height: 32px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-subtle); color: var(--text-secondary); font-size: 12px; font-weight: 600; white-space: nowrap; }
.expense-bucket-choice input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.expense-bucket-choice input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.general-balance-expression { min-width: 0; }
.general-balance-expression > strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.general-balance-expression > div { grid-template-columns: max-content max-content 1fr; justify-content: start; }
.general-balance-expression > div span:nth-child(3) { justify-self: end; }
.general-balance-expression .general-balance-total { margin-top: -2px; font-size: 22px; }

/* CRM and tables use Contour controls rather than native-system styling. */
.crm-toolbar { display: grid; gap: 12px; margin-bottom: 14px; }
.crm-toolbar-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.crm-control-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .78fr); gap: 8px; }
.crm-view-switch, .crm-sort-switch { grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; }
.crm-view-switch button, .crm-sort-switch button { min-width: 0; min-height: 38px; padding: 7px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.crm-create-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.crm-action-button { min-width: 0; min-height: 42px; padding: 0 14px; border: 0; border-radius: var(--radius-control); background: var(--brand); color: #fff; font: inherit; font-size: 13px; font-weight: 650; text-align: center; box-shadow: 0 5px 14px rgba(53,79,67,.14); cursor: pointer; }
.crm-action-button:hover, .crm-action-button:focus-visible { background: var(--accent); outline: 0; box-shadow: 0 0 0 3px var(--brand-soft), 0 5px 14px rgba(53,79,67,.16); }
.table-editor { gap: 8px; padding: 10px; overflow: visible; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--bg-surface); }
.table-editor-head, .table-editor-row { grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) minmax(175px, .8fr) 34px; gap: 8px; min-width: 0; }
.table-editor-head { padding: 0 4px; color: var(--text-secondary); font-weight: 600; }
.table-editor-row { padding: 8px; border-radius: var(--radius-sm); background: var(--bg-soft); }
.table-editor-row label { display: grid; gap: 4px; min-width: 0; }
.table-editor-row label > span { display: none; color: var(--text-secondary); font-size: 10px; font-weight: 600; }
.table-editor-row input { height: 40px; border: 1px solid transparent; border-radius: var(--radius-control); background: var(--bg-surface); }
.table-editor-row button { align-self: end; height: 40px; border-radius: var(--radius-control); }
@media (max-width: 640px) {
  .crm-control-row, .crm-create-actions { grid-template-columns: 1fr; }
  .crm-view-switch button, .crm-sort-switch button { font-size: 12px; }
  .table-editor { padding: 8px; }
  .table-editor-head { display: none; }
  .table-editor-row { grid-template-columns: minmax(0, 1fr) 40px; gap: 8px; }
  .table-editor-row label { grid-column: 1 / -1; }
  .table-editor-row label > span { display: block; }
  .table-editor-row button { grid-column: 2; grid-row: 3; }
  .table-editor-row .table-reminder { grid-column: 1; grid-row: 3; }
}


/* Expense day navigation */
.expense-day-header { align-items: center; gap: 10px; }
.expense-day-nav { display: flex; align-items: center; gap: 8px; min-width: 0; }
.expense-day-nav > div { display: grid; gap: 2px; min-width: 0; }
.expense-day-nav h3 { margin: 0; }
.expense-day-nav small { color: var(--muted); font-size: 10px; line-height: 1.2; text-transform: capitalize; white-space: nowrap; }
.expense-day-arrow { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-strong); color: var(--accent); font-size: 20px; line-height: 1; cursor: pointer; }
.expense-day-arrow:hover, .expense-day-arrow:focus-visible { background: var(--accent-soft); outline: none; }


/* CRM record pages */
.crm-record { display: grid; gap: 18px; }
.crm-record-nav { display:flex; align-items:center; gap:10px; color:var(--muted); font-size:14px; }
.crm-record-nav button { border:0; background:transparent; padding:5px 0; color:var(--accent); font-weight:700; }
.crm-record-layout { display:grid; grid-template-columns:minmax(300px, .82fr) minmax(0, 1.18fr); gap:20px; align-items:start; }
.crm-record-side, .crm-record-work { background:var(--paper-strong); border:1px solid rgba(40,44,38,.08); border-radius:var(--radius); box-shadow:0 10px 26px rgba(38,37,32,.05); }
.crm-record-side { position:sticky; top:118px; padding:22px; display:grid; gap:18px; }
.crm-record-work { padding:22px; min-width:0; }
.crm-record-title span, .crm-record-work-head span, .crm-inline-field > span, .crm-static-field > span { display:block; color:var(--muted); font-size:12px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
.crm-record-title h2, .crm-record-work-head h2 { margin:4px 0 0; font-size:clamp(25px,3vw,34px); line-height:1.08; }
.crm-inline-field { display:grid; gap:6px; }
.crm-inline-field input, .crm-inline-field select, .crm-inline-field textarea { width:100%; border:1px solid var(--line); border-radius:12px; background:var(--paper); padding:10px 12px; color:var(--text); }
.crm-inline-field textarea { resize:vertical; min-height:76px; }
.crm-static-field { display:grid; gap:5px; }
.crm-static-field strong { font-weight:600; }
.crm-record-section { display:grid; gap:10px; border-top:1px solid var(--line); padding-top:16px; }
.crm-record-section-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.crm-record-section h3 { margin:0; font-size:17px; }
.crm-link-card { display:flex; justify-content:space-between; gap:12px; padding:12px 0; border-bottom:1px solid rgba(40,44,38,.08); }
.crm-link-card:last-child { border-bottom:0; }
.crm-link-card p { margin:6px 0 3px; white-space:pre-wrap; font-size:14px; }
.crm-link-card small { color:var(--muted); }
.crm-record-link { border:0; background:none; padding:0; color:var(--accent); font-weight:750; text-align:left; }
.crm-link-actions { display:flex; flex-wrap:wrap; align-content:flex-start; justify-content:flex-end; gap:6px; }
.crm-link-actions button, .crm-activity-actions button { border:0; border-radius:9px; background:var(--accent-soft); padding:6px 8px; color:var(--accent); font-size:12px; }
.crm-link-actions button:last-child { background:#f4e5e2; color:var(--danger); }
.crm-related-task, .crm-related-project { width:100%; border:1px solid var(--line); border-radius:11px; background:var(--paper); padding:10px 11px; display:flex; align-items:center; justify-content:space-between; gap:10px; text-align:left; }
.crm-related-task small, .crm-related-project span { color:var(--muted); white-space:nowrap; }
.crm-material-list { margin:0; padding-left:20px; display:grid; gap:7px; }
.crm-material-list a { color:var(--accent); }
.crm-record-work { display:grid; align-content:start; gap:16px; min-height:520px; }
.crm-comment-form { display:grid; gap:10px; }
.crm-comment-form textarea { width:100%; resize:vertical; min-height:92px; border:1px solid var(--line); border-radius:14px; padding:12px; background:var(--paper); }
.crm-comment-form .primary { justify-self:end; }
.crm-timeline { display:grid; gap:10px; }
.crm-activity { padding:14px; border-radius:14px; background:var(--paper); border:1px solid rgba(40,44,38,.08); }
.crm-activity.is-comment { background:#f7faf7; }
.crm-activity-meta { display:flex; flex-wrap:wrap; gap:8px; align-items:baseline; }
.crm-activity-meta span { color:var(--muted); font-size:12px; }
.crm-activity p { margin:8px 0 0; white-space:pre-wrap; line-height:1.45; }
.crm-activity-actions { display:flex; gap:7px; margin-top:10px; }
.crm-empty-timeline { padding:26px 4px; color:var(--muted); }
.crm-empty-timeline p { margin:5px 0 0; }
.crm-contact-summary p { margin:0 0 10px; }
.crm-contact-summary p:last-child { margin-bottom:0; }
.crm-small-dialog { width:min(94vw,520px); }
@media (max-width: 720px) {
  .crm-record-layout { grid-template-columns:minmax(0,1fr); gap:14px; }
  .crm-record-side { position:static; padding:17px; }
  .crm-record-work { padding:17px; min-height:0; }
  .crm-record-title h2, .crm-record-work-head h2 { font-size:27px; }
  .crm-link-card { flex-direction:column; }
  .crm-link-actions { justify-content:flex-start; }
  .crm-comment-form .primary { width:100%; justify-self:stretch; }
}

/* Expense average category selection */
.expense-average-category-picker { display:grid; gap:9px; margin:14px 0; }
.expense-average-category-picker > strong { font-size:13px; }
.expense-average-category-picker > div { display:flex; flex-wrap:wrap; gap:7px; }
.expense-average-category-picker label { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line); border-radius:999px; background:var(--paper); padding:7px 10px; font-size:13px; }
.expense-average-category-picker input { accent-color:var(--accent); margin:0; }

/* Monthly income planner and savings forecast */
.savings-forecast-card, .regular-income-card { display:grid; gap:14px; margin-top:16px; }
.savings-forecast-form { display:flex; align-items:end; gap:10px; }
.savings-forecast-form label, .regular-income-form > label:not(.regular-income-weekday) { display:grid; gap:6px; color:var(--muted); font-size:13px; }
.savings-forecast-form input, .regular-income-form input:not([type="checkbox"]), .regular-income-form select { min-width:0; width:100%; border:1px solid var(--line); border-radius:12px; background:var(--paper); color:var(--text); padding:11px 12px; }
.savings-forecast-form button, .regular-income-form > button { min-height:42px; border:0; border-radius:12px; background:var(--accent); color:#fff; padding:10px 16px; font-weight:700; }
.savings-forecast-result { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px; border-radius:14px; background:var(--accent-soft); }
.savings-forecast-result span { color:var(--muted); }
.savings-forecast-result strong { font-size:clamp(20px,4vw,28px); }
.regular-income-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.regular-income-form > button { grid-column:1/-1; }
.regular-income-weekday { grid-column:1/-1; display:flex; align-items:flex-start; gap:8px; color:var(--text); font-size:13px; line-height:1.4; }
.regular-income-weekday input { flex:0 0 auto; margin:2px 0 0; accent-color:var(--accent); }
.regular-income-list { display:grid; gap:0; }
.regular-income-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-top:1px solid var(--line); }
.regular-income-row > div { display:grid; gap:4px; min-width:0; }
.regular-income-row small { color:var(--muted); }
.regular-income-row button { flex:0 0 auto; border:0; border-radius:9px; background:#f4e5e2; color:var(--danger); width:34px; height:34px; font-size:20px; }
@media (max-width: 600px) {
  .savings-forecast-form { align-items:stretch; flex-direction:column; }
  .savings-forecast-form button { width:100%; }
  .regular-income-form { grid-template-columns:minmax(0,1fr); }
  .regular-income-form > button, .regular-income-weekday { grid-column:auto; }
  .savings-forecast-result { align-items:flex-start; flex-direction:column; }
}

/* Compact category selector and aligned settings quick-add row */
.expense-average-configure {
  display: inline-flex; align-items: center; min-height: 34px; margin: -9px 0 14px;
  padding: 0; border: 0; background: transparent; color: var(--accent);
  font-size: 13px; font-weight: 700; text-align: left; cursor: pointer;
}
.expense-average-category-picker {
  display: grid; gap: 10px; margin: 0 0 14px; padding: 12px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--paper);
}
.expense-average-category-picker > div {
  display: grid; grid-template-columns: minmax(0,1fr); gap: 0;
  max-height: min(48vh, 380px); overflow-y: auto;
}
.expense-average-category-picker label {
  display: flex; align-items: center; gap: 10px; min-height: 42px;
  padding: 8px 2px; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; background: transparent;
}
.expense-average-category-picker label:last-child { border-bottom: 0; }
.expense-average-category-picker input { width: 18px; height: 18px; flex: 0 0 auto; }
.expense-average-category-picker > button[data-average-save] {
  min-height: 40px; border: 0; border-radius: 11px;
  background: var(--accent); color: #fff; padding: 9px 14px; font-weight: 700;
}
.expense-daily-average { margin-bottom: 10px; }
.quick-add-setting-name { width: 100%; padding: 0; font: inherit; opacity: 1; cursor: default; }
.settings-section-head { flex-wrap: wrap; }
.savings-forecast-card .digest-title { gap: 8px; }
.savings-forecast-card .digest-title > span { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 420px) {
  .savings-forecast-card .digest-title { flex-wrap: wrap; align-items: flex-start; }
  .savings-forecast-card .digest-title > span { margin-left: 0; }
}


/* Fixed navigation follows the visible viewport, including the iOS keyboard. */
:root { --contour-keyboard-offset: 0px; --contour-control-size: 46px; }
.bottom-nav {
  bottom: var(--contour-keyboard-offset);
  transform: translate3d(-50%, 0, 0);
  will-change: transform, bottom;
}
.page-scroll-controls {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(var(--contour-keyboard-offset) + env(safe-area-inset-bottom) + 78px);
  z-index: 12;
  display: flex;
  gap: 8px;
}
.page-scroll-controls[hidden] { display: none !important; }
.page-scroll-controls button,
.floating-add {
  width: var(--contour-control-size);
  height: var(--contour-control-size);
  min-height: var(--contour-control-size);
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  box-shadow: var(--shadow-floating);
}
.page-scroll-controls button {
  display: grid;
  place-items: center;
  background: var(--bg-surface);
  color: var(--brand);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}
.floating-add {
  right: calc(max(18px, env(safe-area-inset-right)) + 27px);
  bottom: calc(var(--contour-keyboard-offset) + env(safe-area-inset-bottom) + 132px);
  font-size: 24px;
  line-height: 1;
  will-change: transform, bottom;
}
body:not([data-area="flow"]) .workspace {
  padding-bottom: calc(220px + env(safe-area-inset-bottom));
}
.flow-add {
  bottom: calc(var(--contour-keyboard-offset) + env(safe-area-inset-bottom) + 78px);
  will-change: transform, bottom;
}
@media (max-width: 600px) {
  .page-scroll-controls {
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(var(--contour-keyboard-offset) + env(safe-area-inset-bottom) + 76px);
  }
  .floating-add {
    right: calc(max(14px, env(safe-area-inset-right)) + 27px);
    bottom: calc(var(--contour-keyboard-offset) + env(safe-area-inset-bottom) + 130px);
  }
  .flow-add {
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(var(--contour-keyboard-offset) + env(safe-area-inset-bottom) + 76px);
  }
}


/* Compact floating navigation: one contextual page arrow and one add action. */
:root { --contour-control-size: 40px; }
.bottom-nav {
  width: min(calc(100% - 24px), 760px);
  bottom: calc(var(--contour-keyboard-offset) + env(safe-area-inset-bottom) + 12px);
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 23px;
  background: color-mix(in srgb, var(--paper-strong) 92%, transparent);
  box-shadow: 0 12px 32px rgba(31, 37, 33, .16), 0 2px 7px rgba(31, 37, 33, .07);
  backdrop-filter: blur(20px) saturate(1.15);
}
.bottom-nav button {
  min-height: 47px;
  padding: 6px 5px;
  border-radius: 16px;
}
.bottom-nav button.active {
  background: color-mix(in srgb, var(--accent-soft) 84%, white);
}
.scroll-jump {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(var(--contour-keyboard-offset) + env(safe-area-inset-bottom) + 90px);
  z-index: 12;
  display: grid;
  place-items: center;
  width: var(--contour-control-size);
  height: var(--contour-control-size);
  min-height: var(--contour-control-size);
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: var(--bg-surface);
  color: var(--brand);
  box-shadow: var(--shadow-floating);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.scroll-jump[hidden] { display: none !important; }
.floating-add {
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(var(--contour-keyboard-offset) + env(safe-area-inset-bottom) + 138px);
  font-size: 21px;
}
body:not([data-area="flow"]) .workspace {
  padding-bottom: calc(210px + env(safe-area-inset-bottom));
}
.flow-add {
  bottom: calc(var(--contour-keyboard-offset) + env(safe-area-inset-bottom) + 92px);
}
.toast {
  bottom: calc(var(--contour-keyboard-offset) + env(safe-area-inset-bottom) + 96px);
}
@media (max-width: 600px) {
  .bottom-nav {
    width: min(calc(100% - 20px), 760px);
    border-radius: 21px;
  }
  .scroll-jump {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(var(--contour-keyboard-offset) + env(safe-area-inset-bottom) + 88px);
  }
  .floating-add {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(var(--contour-keyboard-offset) + env(safe-area-inset-bottom) + 134px);
  }
  .flow-add {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(var(--contour-keyboard-offset) + env(safe-area-inset-bottom) + 90px);
  }
}


/* Income planning actions stay inside each row on narrow screens. */
.regular-income-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: initial;
  column-gap: 10px;
}
.regular-income-row > :first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.regular-income-row .regular-income-actions {
  display: flex;
  flex: 0 0 auto;
  width: max-content;
  gap: 6px;
}
.regular-income-row .regular-income-actions button:not([data-delete-regular-income]) {
  min-width: 94px;
  height: 38px;
  padding: 0 10px;
  white-space: nowrap;
}
.regular-income-row .regular-income-actions [data-delete-regular-income] {
  width: 38px;
  height: 38px;
  line-height: 1;
}
body[data-area="flow"] .workspace {
  padding-bottom: calc(230px + env(safe-area-inset-bottom));
}
.flow-add {
  position: fixed !important;
  right: max(14px, env(safe-area-inset-right)) !important;
  bottom: calc(var(--contour-keyboard-offset) + env(safe-area-inset-bottom) + 90px) !important;
  left: auto !important;
  top: auto !important;
  margin: 0 !important;
  transform: none !important;
  z-index: 22;
}
@media (max-width: 600px) {
  .regular-income-row {
    column-gap: 8px;
    padding: 14px 0;
  }
  .regular-income-row .regular-income-actions button:not([data-delete-regular-income]) {
    min-width: 88px;
    height: 40px;
    padding: 0 8px;
    font-size: 11px;
  }
  .regular-income-row .regular-income-actions [data-delete-regular-income] {
    width: 40px;
    height: 40px;
  }
  .flow-add {
    right: max(12px, env(safe-area-inset-right)) !important;
    bottom: calc(var(--contour-keyboard-offset) + env(safe-area-inset-bottom) + 88px) !important;
  }
}


/* Cash Flow has no bottom navigation, so keep its action at the real viewport edge. */
body[data-area="flow"] .flow-add {
  bottom: calc(var(--contour-keyboard-offset) + env(safe-area-inset-bottom) + 14px) !important;
}


/* The Cash Flow add action uses the same compact floating-control footprint. */
body[data-area="flow"] .flow-add {
  width: var(--contour-control-size);
  height: var(--contour-control-size);
  min-width: var(--contour-control-size);
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
}


/* Contour primary action — never inherit browser or iOS button chrome. */
.regular-income-form-actions [data-save-regular-income] {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-sm);
  appearance: none;
  -webkit-appearance: none;
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-floating);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.01em;
  cursor: pointer;
}
.regular-income-form-actions [data-save-regular-income]:hover { background: var(--brand-hover); }
.regular-income-form-actions [data-save-regular-income]:active { transform: translateY(1px); box-shadow: none; }
.regular-income-form-actions [data-save-regular-income]:disabled { opacity: .56; cursor: default; transform: none; }

/* Keep the floating rounded navigation close to the safe edge. */
.bottom-nav {
  bottom: calc(var(--contour-keyboard-offset) + env(safe-area-inset-bottom));
}
@media (min-width: 721px) {
  .bottom-nav { bottom: calc(var(--contour-keyboard-offset) + 12px); }
}


/* Compact Cash Flow planning controls. */
.savings-forecast-card {
  gap: 10px;
  margin-top: 12px;
}
.savings-forecast-card .digest-title h3 {
  font-size: 16px;
}
.savings-forecast-form {
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
.savings-forecast-date-control {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--bg-subtle);
}
.savings-forecast-date-control input {
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: inherit;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
}
.savings-forecast-date-control:focus-within {
  border-color: var(--brand);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}
.savings-forecast-form .forecast-submit {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-control);
  background: var(--brand);
  color: #fff;
  box-shadow: none;
  font-size: 12px;
}
.savings-forecast-result {
  padding: 10px 12px;
  border-radius: var(--radius-control);
}
.savings-forecast-result strong {
  font-size: 20px;
}

.regular-income-form {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.regular-income-text,
.regular-income-form > select {
  min-height: 42px;
  border: 1px solid transparent !important;
  border-radius: var(--radius-control) !important;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-subtle) !important;
  color: var(--text-primary);
  box-shadow: none;
}
.regular-income-text:focus,
.regular-income-form > select:focus {
  border-color: var(--brand) !important;
  background: var(--bg-surface) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}
.regular-income-schedule-fields {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 8px;
}
.regular-income-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px 10px 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}
.regular-income-field:focus-within {
  border-color: var(--brand);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}
.regular-income-field input {
  width: 100%;
  min-height: 20px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  appearance: none;
  -webkit-appearance: none;
  background: transparent !important;
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
}
.regular-income-review {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  margin-top: 2px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--bg-subtle);
  color: var(--brand);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.regular-income-review b {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--brand-soft);
  font-size: 11px;
}
.planned-income-sheet .sheet-title {
  padding-bottom: 10px;
}
.planned-income-list {
  display: grid;
  gap: 6px;
  padding: 10px;
}
.planned-income-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
}
.planned-income-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 58px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--bg-soft);
  color: var(--text-primary);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.planned-income-open > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.planned-income-open strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.planned-income-open small {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 14px;
}
.planned-income-open i {
  color: var(--brand);
  font-size: 20px;
  font-style: normal;
}
.planned-income-delete {
  align-self: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
@media (max-width: 600px) {
  .savings-forecast-form {
    flex-direction: row;
    align-items: center;
  }
  .savings-forecast-date-control {
    flex: 1 1 auto;
  }
  .savings-forecast-form .forecast-submit {
    width: auto;
  }
  .regular-income-schedule-fields {
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  }
}

/* Stable scroll gutters prevent horizontal jumps when overlays lock page scrolling. */
html { scrollbar-gutter: stable; }
body, .editor-scroll, .choice-list, .due-picker-body, .type-picker-list, .settings-reorder-list {
  scrollbar-gutter: stable;
}
body { overflow-x: clip; }
body, html, .editor-scroll, .choice-list, .due-picker-body, .type-picker-list {
  scrollbar-width: none;
}
body::-webkit-scrollbar, html::-webkit-scrollbar, .editor-scroll::-webkit-scrollbar,
.choice-list::-webkit-scrollbar, .due-picker-body::-webkit-scrollbar, .type-picker-list::-webkit-scrollbar {
  display: none;
}
@media (min-width: 721px) {
  .bottom-nav { bottom: 12px; border:1px solid var(--line); border-radius:23px; }
}
.settings-index-group, .settings-account-card, .settings-card.account-placeholder {
  border:1px solid var(--line); border-radius:var(--radius-panel,17px); background:var(--bg-surface,#fff); box-shadow:var(--shadow-card,none);
}
.settings-index-group { margin:0 0 16px; padding:8px 14px; }
.settings-index-group h3 { margin:9px 4px 6px; color:var(--text-muted); font-size:12px; font-weight:700; letter-spacing:.02em; }
.settings-index-row, .settings-account-card { display:flex; align-items:center; gap:13px; width:100%; min-height:54px; padding:8px 4px; border:0; border-bottom:1px solid var(--line); background:transparent; color:var(--text-primary); font:inherit; font-size:14px; text-align:left; cursor:pointer; }
.settings-index-row:last-child { border-bottom:0; }
.settings-account-card { min-height:68px; margin:0 0 16px; padding:12px 16px; text-align:left; cursor:pointer; }
.settings-account-card > div { display:grid; gap:4px; flex:1; }
.settings-account-card strong { font-size:15px; }
.settings-account-card small { color:var(--text-muted); font-size:12px; }
.settings-row-icon, .settings-row-chevron { display:grid; place-items:center; flex:0 0 28px; color:var(--brand); }
.settings-row-chevron { flex-basis:20px; color:var(--text-muted); }
.settings-icon-svg { width:20px; height:20px; }
.settings-panel-head { display:flex; align-items:center; gap:10px; margin:0 0 16px; }
.settings-panel-head button { display:inline-flex; align-items:center; gap:6px; min-height:42px; padding:6px 8px; border:0; border-radius:var(--radius-control); background:var(--brand-soft); color:var(--brand); font:inherit; font-weight:650; cursor:pointer; }
.settings-panel-head button svg { width:18px; height:18px; }
.settings-panel-head h3 { margin:0 0 0 auto; font-size:17px; }
.settings-panel-head::after { content:""; flex:1; }
.settings-index-group button:active, .settings-account-card:active { background:var(--bg-subtle); }
.settings-card[hidden] { display:none!important; }
.account-placeholder { padding:0 16px; }
.account-placeholder > div { display:grid; gap:4px; min-height:60px; align-content:center; border-bottom:1px solid var(--line); }
.account-placeholder > div span { color:var(--text-muted); font-size:12px; }
.account-signout { width:100%; min-height:52px; margin-top:6px; border:0; background:transparent; color:var(--danger); font:inherit; text-align:left; }
.settings-reorder-list { display:grid; gap:4px; }
.settings-reorder-list > div { display:flex; align-items:center; gap:12px; min-height:48px; padding:8px; border-bottom:1px solid var(--line); color:var(--text-primary); cursor:grab; }
.settings-reorder-list > div svg { width:18px; height:18px; color:var(--text-muted); }
.settings-reorder-list > div > span { flex:1; }
.settings-reorder-list > div.dragging { opacity:.55; }
.settings-reorder-list label { display:inline-flex; align-items:center; gap:5px; color:var(--text-muted); font-size:11px; }
.space-visibility-row { display:inline-flex; align-items:center; gap:8px; padding:8px 2px; color:var(--text-muted); font-size:12px; }
.space-visibility-row input { width:18px; height:18px; accent-color:var(--brand); }
.storage-state { display:grid; place-items:center; width:40px; height:40px; padding:0; border:1px solid var(--line); border-radius:50%; background:var(--bg-surface); color:var(--brand); cursor:pointer; }
.sync-gear-icon { width:20px; height:20px; }
.storage-state[data-sync-state="syncing"] { color:#b9781b; }
.storage-state[data-sync-state="error"] { color:var(--danger); }
.storage-state[data-sync-state="local"] { color:var(--text-muted); }
.storage-state[data-sync-state="syncing"] .sync-gear-icon { animation:contour-gear-spin 1.8s linear infinite; }
@keyframes contour-gear-spin { to { transform:rotate(360deg); } }
.developer-meta { margin:0 0 4px 2px; color:var(--text-muted); font-size:10px; line-height:1.2; }
.developer-meta[hidden] { display:none; }
.sync-settings-panel h3:not(:first-child) { margin-top:22px; }
.sync-settings-panel .secondary-card-button { width:100%; margin:4px 0; text-align:left; }
@media (prefers-reduced-motion: reduce) { .sync-gear-icon { animation:none!important; } }

/* Contour controls and settings details */
select {
  min-height: 42px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--line, #dfe3df);
  border-radius: var(--radius-control, 12px);
  background-color: var(--bg-subtle, #f2f4f1);
  background-image: linear-gradient(45deg, transparent 50%, #75847b 50%), linear-gradient(135deg, #75847b 50%, transparent 50%);
  background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: var(--text-primary, #26332b);
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}
select option { background: var(--bg-surface, #fff); color: var(--text-primary, #26332b); }
select:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand, #4c7664) 60%, transparent);
  outline-offset: 2px;
}
button { -webkit-tap-highlight-color: transparent; }
.settings-panel-head + .settings-card > h3:first-child { display: none; }
.settings-panel-head { justify-content: flex-start; }
.settings-panel-head::after { display: none; }
.structure-space-order { margin: 0 0 14px; padding: 0; background: transparent; }
.structure-space-order > div { cursor: default; }
.structure-space-order > div > span:first-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-size: 14px; font-weight: 600; }
.reorder-controls { display: inline-flex; gap: 4px; }
.reorder-controls button { width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--bg-surface); color: var(--brand); font: inherit; font-size: 17px; cursor: pointer; }
.reorder-controls button:disabled { opacity: .35; cursor: default; }
.structure-collapse-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 42px; margin: 6px 0; padding: 0 10px; border: 0; border-radius: var(--radius-control); background: var(--bg-subtle); color: var(--text-secondary); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.structure-collapse-toggle > span:last-child { color: var(--brand); font-size: 18px; }
.structure-settings [hidden] { display: none !important; }
.status-area { align-self: center; margin: 0; }
.area-meta { text-align: center; }
body[data-page="settings"] .storage-state { background: #e4e7e5; box-shadow: 0 0 0 3px rgba(99, 110, 103, .08); }
body[data-page="settings"] #undoButton { display: none; }
@media (max-width: 720px) {
  .due-picker-head { display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
  .due-picker-head strong { margin-right: auto; }
  .status-area { gap: 5px; }
}

/* Contour button system, stable shell anchors and compact settings controls. */
.secondary-card-button,
.sync-settings-panel [data-settings-sync],
.sync-settings-panel [data-settings-sync-key],
.sync-settings-panel [data-settings-copy-link],
.notification-settings [data-push-toggle],
.digest-settings [data-digest-reorder-toggle],
.notes-add-actions [data-new-table],
.add-expense-category-form button,
.add-type-form button,
.add-project-form button,
.account-signout {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-strong);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: 0 2px 6px rgba(31, 37, 33, .045);
  cursor: pointer;
  transition: background-color .14s ease, border-color .14s ease, transform .12s ease;
}
.secondary-card-button:hover,
.notes-add-actions [data-new-table]:hover,
.sync-settings-panel .secondary-card-button:hover { border-color: #b9c7bf; background: var(--accent-soft); }
.secondary-card-button:active,
.notes-add-actions [data-new-table]:active,
.notification-settings [data-push-toggle]:active,
.digest-settings [data-digest-reorder-toggle]:active { transform: scale(.98); }
.sync-settings-panel .secondary-card-button { width: 100%; margin: 4px 0; text-align: left; }
.notes-add-actions [data-new-table] { flex: 0 0 auto; min-height: 44px; }
.notification-settings [data-push-toggle] { width: 100%; }
.account-signout { border-color: transparent; background: transparent; color: var(--danger); box-shadow: none; text-align: left; }
.brand-row { align-items: flex-end; }
.brand-area { min-width: 0; flex: 1 1 auto; }
.status-area { align-self: flex-end; flex: 0 0 auto; margin: 0 0 -2px; }
.storage-state { position: relative; width: 36px; height: 36px; flex: 0 0 36px; border: 0; background: transparent; }
.storage-state::before { position: absolute; inset: 4px; border-radius: 50%; background: transparent; content: ""; transition: background-color .14s ease; }
.storage-state .sync-gear-icon { display: block; position: relative; z-index: 1; width: 20px; height: 20px; transform-box: view-box; transform-origin: 50% 50%; }
body[data-page="settings"] .storage-state::before { background: #e7e9e7; }
body[data-page="settings"] .storage-state { background: transparent; box-shadow: none; }
.bottom-nav {
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  width: min(calc(100% - 24px), 760px);
  margin-inline: auto;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 23px;
  transform: none;
  will-change: auto;
}
.settings-order-link,
.structure-order-link { display: inline-flex; min-height: 40px; align-items: center; margin: 0 0 8px; padding: 0 4px; border: 0; border-radius: 9px; background: transparent; color: var(--accent); font: inherit; font-size: 14px; font-weight: 700; appearance: none; -webkit-appearance: none; cursor: pointer; }
.settings-order-link:hover,
.structure-order-link:hover { background: var(--accent-soft); }
.settings-order-link:active,
.structure-order-link:active { transform: scale(.98); }
.digest-setting-name { min-height: 40px; padding: 5px 2px; border: 0; border-radius: 8px; background: transparent; color: var(--text-primary); font: inherit; font-size: 13px; font-weight: 600; line-height: 1.35; text-align: left; appearance: none; -webkit-appearance: none; }
.digest-setting-name:not(:disabled):hover { background: var(--accent-soft); }
.digest-setting-name:disabled { opacity: 1; color: var(--text-secondary); cursor: default; }
.structure-settings > .structure-list { margin-top: 0; }
.structure-order-panel .structure-space-order { display: grid; margin: 0; }
.structure-space-order > div { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.structure-space-order > div:last-child { border-bottom: 0; }
.structure-space-order .reorder-controls { flex: 0 0 auto; gap: 8px; }
.structure-space-order .reorder-controls button { width: 40px; height: 40px; background: var(--bg-subtle); }
.task-edit-button { display: inline-grid; place-items: center; width: 36px; min-width: 36px; height: 36px; padding: 0; border: 0; border-radius: 11px; background: var(--bg-subtle); color: var(--text-secondary); cursor: pointer; }
.task-edit-button .inline-ui-icon { width: 19px; height: 19px; }
.task-edit-button:hover { background: #DDE3DF; color: var(--text-primary); }
.task-edit-button:disabled { background: transparent; color: var(--text-disabled); cursor: default; }
.task-edit-button:active { transform: scale(.97); }
.task-edit-button[hidden] { display: none; }
.document-sheet .note-tools { gap: 10px; margin-top: 12px; }
.document-sheet .danger-button { margin-top: 14px; }
.markdown-toolbar { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0 8px; }
.markdown-toolbar button { display: inline-grid; place-items: center; min-width: 36px; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-subtle); color: var(--text-secondary); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.markdown-toolbar button:hover { background: var(--brand-soft); color: var(--brand); }
.rich-document-content { min-height: 48vh; padding: 12px 2px; outline: 0; color: var(--text-primary); font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.rich-document-content:empty::before { content: attr(data-placeholder); color: var(--text-muted); pointer-events: none; }
.rich-document-content p, .rich-document-content h2, .rich-document-content h3, .rich-document-content h4, .rich-document-content blockquote { margin: 0 0 8px; }
.rich-document-content h2 { font-size: 21px; line-height: 1.3; }
.rich-document-content h3 { font-size: 18px; line-height: 1.35; }
.rich-document-content h4 { font-size: 16px; line-height: 1.4; }
.rich-document-content blockquote { padding-left: 12px; border-left: 3px solid var(--brand-soft); color: var(--text-secondary); }

/* Notes and task groups */
.goal-progress-bar { background: linear-gradient(90deg, color-mix(in srgb, var(--brand) var(--goal-mix, 24%), var(--brand-soft)), var(--brand)); }
.rich-document-content { line-height: 1.35; }
.rich-document-content p, .rich-document-content h2, .rich-document-content h3, .rich-document-content h4, .rich-document-content blockquote { margin-bottom: 5px; }
.regular-income-field input[type="date"] { text-align: left; text-align-last: left; }
.regular-income-field input[type="date"]::-webkit-date-and-time-value { text-align: left; margin-left: 0; }
.note-tasks-section { display: grid; gap: 9px; margin-top: 14px; }
.note-tasks-section h3 { margin: 0; color: var(--text-secondary); font-size: 13px; font-weight: 650; }
.note-task-list { display: grid; gap: 7px; }
.note-task-card { display: grid; gap: 4px; width: 100%; padding: 11px 13px; border: 0; border-radius: var(--radius-control); background: var(--bg-subtle); color: var(--text-primary); text-align: left; font: inherit; cursor: pointer; }
.note-task-card > span { font-size: 14px; font-weight: 600; }
.note-task-card small, .note-task-empty { margin: 0; color: var(--text-muted); font-size: 12px; }
.note-task-picker { display: grid; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg-surface); }
.note-task-picker[hidden] { display: none; }
.document-sheet .note-tools [data-task-relation-panel] { grid-column: 1 / -1; }
.note-task-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.note-task-filters label { display: grid; gap: 4px; color: var(--text-muted); font-size: 11px; }
.note-task-filters select { min-width: 0; height: 38px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-subtle); color: var(--text-primary); font: inherit; font-size: 12px; }
.note-task-picker [data-task-choice] { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 9px; background: var(--bg-subtle); color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; }
.note-task-picker [data-task-choice][hidden] { display: none; }
.note-embedded-task { display: flex; align-items: center; gap: 10px; min-height: 42px; margin: 4px 0; padding: 6px 8px; border-radius: var(--radius-control); background: var(--bg-subtle); }
.note-embedded-check { display: grid; place-items: center; flex: 0 0 23px; width: 23px; height: 23px; padding: 0; border: 1.5px solid var(--brand); border-radius: 50%; background: transparent; color: white; font-size: 15px; cursor: pointer; }
.note-embedded-task.done .note-embedded-check { background: var(--brand); }
.note-embedded-title { flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; }
.note-embedded-task.done .note-embedded-title { color: var(--text-muted); text-decoration: line-through; }
.framework-reminder-field { display: grid; gap: 6px; margin-top: 12px; color: var(--text-secondary); font-size: 12px; font-weight: 600; }
.framework-reminder-field input { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg-subtle); color: var(--text-primary); font: inherit; }
.framework-reminder { display: block; margin-top: 8px; color: var(--brand); font-size: 11px; }
.task-note-action { margin-top: 4px; }

.note-check-row { display: flex; align-items: baseline; gap: 8px; margin: 3px 0; }
.note-check-row.done > span { color: var(--text-muted); text-decoration: line-through; }
.rich-document-content .md-check { flex: 0 0 24px; width: 24px; height: 28px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--brand); font: inherit; text-align: center; cursor: pointer; }
.canvas-actions { gap: 6px; }
@media (max-width: 420px) { .editor-scroll { padding-inline: 14px; }.task-editor-pair { gap: 10px; }.task-editor-pair .field input,.task-editor-pair .field select { padding-inline: 9px; font-size: 13px; }.task-editor-pair .task-datetime-control input { font-size: 16px; } }
.digest-setting-row { display: flex; align-items: center; gap: 8px; }
.digest-setting-row .digest-setting-name { flex: 1; min-width: 0; }
.digest-setting-row .reorder-controls { flex: 0 0 auto; }
.type-setting { grid-template-columns: minmax(0, 1fr) 42px auto 28px; }
.type-reorder-controls button { width: 30px; height: 32px; font-size: 15px; }
.expense-sort-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 4px 0 14px; color: var(--text-secondary, var(--muted)); font-size: 13px; font-weight: 600; }
.expense-sort-row select { min-height: 36px; width: auto; min-width: 135px; padding: 0 30px 0 10px; border-radius: 10px; font-size: 12px; background-position: calc(100% - 14px) 15px, calc(100% - 9px) 15px; }
.notification-sound-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 54px; margin-top: 14px; padding: 0 2px; border-top: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; }
.notification-sound-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.notification-sound-row i { position: relative; width: 42px; height: 25px; flex: 0 0 42px; border-radius: 999px; background: #d6d9d6; transition: background-color .16s ease; }
.notification-sound-row i::after { position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); content: ""; transition: transform .16s ease; }
.notification-sound-row input:checked + i { background: var(--accent); }
.notification-sound-row input:checked + i::after { transform: translateX(17px); }
.notification-sound-row input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 720px) {
  .brand-row { align-items: flex-end; }
  .status-area { align-self: flex-end; margin: 0 0 -2px; }
  .project-switcher { min-width: 0; }
  .bottom-nav { width: min(calc(100% - 20px), 760px); border-radius: 21px; }
}


/* Selectable appearance palettes: original remains the default Contour theme. */
:root[data-theme="blue"] {
  --bg-canvas: #F6F7F3;
  --bg-surface: #FFFFFF;
  --bg-subtle: #EEF2F0;
  --bg-soft: #F6F8F6;
  --bg-hover: #EEF2F0;
  --bg-selected: #E8EFFA;
  --text-primary: #18242B;
  --text-secondary: #5D6B70;
  --text-muted: #5D6B70;
  --text-disabled: #7B8589;
  --line: #D9E0DE;
  --brand: #3F6FC6;
  --brand-hover: #315CAB;
  --brand-active: #294F96;
  --brand-soft: #E8EFFA;
  --danger: #B44949;
  --danger-soft: #F8EAEA;
  --warning: #9B681F;
  --warning-soft: #F7EADF;
  --info: #315CAB;
  --info-soft: #E8EFFA;
  --bg: var(--bg-canvas);
  --paper: var(--bg-surface);
  --paper-strong: #FFFFFF;
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --accent: var(--brand);
  --accent-soft: var(--brand-soft);
}

:root[data-theme="monochrome"] {
  --bg-canvas: #F7F7F8;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F0F0F0;
  --bg-soft: #F7F7F7;
  --bg-hover: #EEEEEE;
  --bg-selected: #E8E8E8;
  --text-primary: #1F1F1F;
  --text-secondary: #676767;
  --text-muted: #676767;
  --text-disabled: #767676;
  --line: #E5E5E5;
  --brand: #212121;
  --brand-hover: #111111;
  --brand-active: #000000;
  --brand-soft: #ECECEC;
  --info: #333333;
  --info-soft: #F0F0F0;
  --bg: var(--bg-canvas);
  --paper: var(--bg-surface);
  --paper-strong: #FFFFFF;
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --accent: var(--brand);
  --accent-soft: var(--brand-soft);
}

.theme-options { display: grid; gap: 8px; }
.theme-option { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg-surface); color: var(--text-primary); cursor: pointer; }
.theme-option:hover { background: var(--bg-hover); }
.theme-option input { appearance: none; width: 18px; height: 18px; flex: 0 0 18px; margin: 0; border: 2px solid var(--text-muted); border-radius: 50%; background: var(--bg-surface); cursor: pointer; }
.theme-option input:checked { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 4px var(--bg-surface); }
.theme-option input:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.theme-option-content { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; width: 100%; font-size: 13px; font-weight: 620; }
.theme-preview { display: inline-flex; flex: 0 0 auto; gap: 3px; }
.theme-preview i { width: 12px; height: 12px; border: 1px solid rgba(24,36,43,.12); border-radius: 4px; }
.theme-preview-original i:nth-child(1) { background: #eeece6; }
.theme-preview-original i:nth-child(2) { background: #fbfaf7; }
.theme-preview-original i:nth-child(3) { background: #315c4a; }
.theme-preview-original i:nth-child(4) { background: #20211f; }
.theme-preview-blue i:nth-child(1) { background: #f6f7f3; }
.theme-preview-blue i:nth-child(2) { background: #ffffff; }
.theme-preview-blue i:nth-child(3) { background: #3f6fc6; }
.theme-preview-blue i:nth-child(4) { background: #18242b; }
.theme-preview-monochrome i:nth-child(1) { background: #f7f7f8; }
.theme-preview-monochrome i:nth-child(2) { background: #ffffff; }
.theme-preview-monochrome i:nth-child(3) { background: #212121; }
.theme-preview-monochrome i:nth-child(4) { background: #1f1f1f; }
:root[data-theme="blue"] .capture:focus-within,
:root[data-theme="blue"] .home-quick-capture:focus-within,
:root[data-theme="blue"] .expense-range-fields input:focus,
:root[data-theme="blue"] .field input:focus,
:root[data-theme="blue"] .field select:focus,
:root[data-theme="blue"] .field textarea:focus,
:root[data-theme="blue"] .page-capture:focus-within,
:root[data-theme="blue"] .savings-forecast-date-control:focus-within,
:root[data-theme="blue"] .regular-income-text:focus,
:root[data-theme="blue"] .regular-income-form > select:focus,
:root[data-theme="blue"] .regular-income-field:focus-within,
:root[data-theme="monochrome"] .capture:focus-within,
:root[data-theme="monochrome"] .home-quick-capture:focus-within,
:root[data-theme="monochrome"] .expense-range-fields input:focus,
:root[data-theme="monochrome"] .field input:focus,
:root[data-theme="monochrome"] .field select:focus,
:root[data-theme="monochrome"] .field textarea:focus,
:root[data-theme="monochrome"] .page-capture:focus-within,
:root[data-theme="monochrome"] .savings-forecast-date-control:focus-within,
:root[data-theme="monochrome"] .regular-income-text:focus,
:root[data-theme="monochrome"] .regular-income-form > select:focus,
:root[data-theme="monochrome"] .regular-income-field:focus-within { border-color: var(--brand) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent) !important; }

:root[data-theme="blue"] .flow-day.today:not(.selected),
:root[data-theme="monochrome"] .flow-day.today:not(.selected) {
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1.5px var(--brand), var(--shadow-card);
}
:root[data-theme="monochrome"] .task-type {
  background: var(--bg-subtle) !important;
  color: var(--text-secondary) !important;
}
:root[data-theme="monochrome"] .urgency-dot,
:root[data-theme="monochrome"] .urgency-Критично,
:root[data-theme="monochrome"] .urgency-Высокая,
:root[data-theme="monochrome"] .urgency-Обычная,
:root[data-theme="monochrome"] .urgency-Низкая {
  background: #767676;
  box-shadow: none;
}

/* Calendar editor, recurring events, reminders and day zoom. */
.area-popover:not(.project-popover), .project-popover { row-gap: 6px; }
.calendar-event { box-shadow: inset 3px 0 0 var(--calendar-event-color, #4B7A62); }
.calendar-source-bar { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; margin: 0 0 12px; }
.calendar-source-settings, .calendar-source-refresh { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 12px; border: 0; border-radius: var(--radius-control); background: var(--bg-subtle); color: var(--text-primary); font: inherit; font-size: 13px; cursor: pointer; }
.calendar-source-settings span { min-width: 0; overflow-wrap: anywhere; }
.calendar-source-settings svg { flex: 0 0 20px; width: 20px; height: 20px; }
.calendar-source-refresh { justify-content: center; padding: 0; font-size: 23px; }
.calendar-source-bar > small { grid-column: 1 / -1; min-width: 0; color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }
.calendar-source-refresh:disabled { opacity: .45; cursor: default; }
.calendar-settings { display: grid; gap: 12px; min-width: 0; }
.calendar-settings .settings-card { margin: 0; min-width: 0; }
.calendar-provider-connect > div { display: grid; gap: 8px; margin-top: 12px; }
.calendar-settings > .secondary-card-button { width: 100%; }
.calendar-account-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.calendar-account-heading > div { flex: 1; min-width: 0; display: grid; gap: 5px; overflow-wrap: anywhere; }
.calendar-account-heading > div > span { font-size: 13px; color: var(--text-secondary); }
.calendar-account-heading small { font-size: 12px; color: var(--text-muted); }
.calendar-account-heading > button { flex: 0 0 44px; }
.calendar-collection { display: flex; align-items: center; gap: 10px; min-height: 48px; min-width: 0; padding: 8px 0; cursor: pointer; }
.calendar-collection + .calendar-collection { border-top: 1px solid var(--line); }
.calendar-collection input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: 0 0 20px; width: 20px; height: 20px; margin: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-subtle); cursor: pointer; }
.calendar-collection input:checked { border-color: var(--brand); background: var(--brand); }
.calendar-collection input:checked::after { content: "✓"; display: block; color: white; text-align: center; font-size: 14px; line-height: 18px; }
.calendar-collection input:disabled { opacity: .45; }
.calendar-collection > span:last-child { flex: 1; min-width: 0; display: grid; gap: 4px; }
.calendar-collection strong { color: var(--text-primary); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.calendar-collection small { color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }
.calendar-collection-color { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--calendar-event-color); }
.calendar-account .danger-button { width: 100%; margin-top: 12px; }
.calendar-inline-error { margin: 12px 0; color: var(--danger); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.calendar-stale { color: var(--text-secondary) !important; }
.calendar-connection-note, .calendar-end-hint { font-size: 12px; line-height: 1.5; color: var(--text-secondary); }
.calendar-connection-note a { color: var(--brand); text-decoration: underline; }
.calendar-picker-field { position: relative; }
.calendar-picker-field > input[type="hidden"] { display: none; }
.calendar-picker-trigger { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 11px 12px; border: 1px solid transparent; border-radius: var(--radius-control); background: var(--bg-subtle); color: var(--text-primary); text-align: left; font: inherit; font-size: 14px; cursor: pointer; }
.calendar-picker-trigger > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.calendar-picker-trigger i { flex: 0 0 auto; font-style: normal; }
.calendar-picker-trigger:disabled { cursor: default; opacity: .8; }
.calendar-picker-options { display: grid; gap: 4px; max-height: 240px; overflow-y: auto; padding: 6px; border-radius: var(--radius-control); background: var(--bg-subtle); margin-top: 6px; }
.calendar-picker-options button { min-height: 44px; min-width: 0; padding: 10px; border: 0; border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-primary); text-align: left; font: inherit; font-size: 13px; overflow-wrap: anywhere; cursor: pointer; }
.calendar-picker-options button[aria-selected="true"] { background: var(--brand-soft); color: var(--brand); }
.calendar-event-editor [hidden], .calendar-settings [hidden] { display: none !important; }
.calendar-event-editor .field, .calendar-event-editor [data-calendar-picker], .calendar-event-editor [data-space-picker] { min-width: 0; }
.calendar-event-editor .editor-head strong { min-width: 0; font-size: 15px; }
.calendar-event-editor .editor-head > button { flex: 0 0 auto; }
.calendar-all-day-band { margin-bottom: 12px; display: grid; gap: 8px; }
.calendar-event > time { max-width: 66px; overflow-wrap: anywhere; }
.calendar-event > span { min-width: 0; overflow-wrap: anywhere; }
.calendar-event-editor input[type="date"] { box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; font-size: 16px; -webkit-appearance: none; appearance: none; }
.calendar-source-settings:focus-visible, .calendar-source-refresh:focus-visible, .calendar-picker-trigger:focus-visible, .calendar-picker-options button:focus-visible, .calendar-collection input:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
@media (min-width: 600px) { .calendar-provider-connect > div { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .calendar-event-form-grid { grid-template-columns: minmax(0, 1fr); } .calendar-event-editor .editor-head { gap: 8px; } }
.calendar-event-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.calendar-event-datetime { grid-column: 1 / -1; }
.calendar-event-editor .editor-scroll,
.calendar-event-editor .field,
.calendar-event-editor .form-grid { min-width: 0; }
.calendar-event-editor .field input,
.calendar-event-editor .field select { box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; }
.calendar-event-editor input[type="datetime-local"] { text-align: left; text-align-last: left; font-size: 16px; }
.calendar-event-editor input[type="datetime-local"]::-webkit-date-and-time-value { text-align: left; margin-left: 0; }
.calendar-event-editor input[type="datetime-local"]::-webkit-datetime-edit { padding: 0; text-align: left; }
.calendar-event-repeat, .calendar-reminders, .calendar-color-field { min-width: 0; margin: 14px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-control); }
.calendar-reminders legend, .calendar-color-field legend { padding: 0 5px; color: var(--text-primary); font-size: 13px; font-weight: 600; }
.calendar-reminder-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.calendar-reminder-option { display: flex; align-items: center; gap: 7px; min-width: 0; min-height: 36px; padding: 0 9px; border-radius: 9px; background: var(--bg-subtle); color: var(--text-secondary); font-size: 12px; }
.calendar-reminder-option input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.calendar-reminder-option input[type="checkbox"] { appearance: none; -webkit-appearance: none; border: 1px solid var(--line); border-radius: 4px; background: var(--bg-surface); }
.calendar-reminder-option input:checked { border-color: var(--brand); background: var(--brand); }
.calendar-reminder-option input:checked::after { content: "✓"; display: block; color: white; text-align: center; font-size: 11px; line-height: 14px; }
.calendar-reminders > small { display: block; margin-top: 8px; color: var(--text-muted); font-size: 10px; line-height: 1.4; }
.calendar-color-options { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.calendar-color-option { display: grid; justify-items: center; gap: 5px; min-width: 0; padding: 7px 2px; border-radius: 9px; color: var(--text-muted); font-size: 9px; text-align: center; cursor: pointer; }
.calendar-color-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.calendar-color-option span { display: block; width: 22px; height: 22px; border: 2px solid var(--bg-surface); border-radius: 50%; background: var(--calendar-event-color); box-shadow: 0 0 0 1px var(--line); }
.calendar-color-option input:checked + span { box-shadow: 0 0 0 2px var(--calendar-event-color); }
.calendar-color-option input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 3px; }
.calendar-zoom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; color: var(--text-muted); font-size: 11px; }
.calendar-zoom > div { display: flex; gap: 6px; }
.calendar-zoom button { width: 36px; height: 34px; border: 0; border-radius: 10px; background: var(--bg-subtle); color: var(--brand); font-size: 18px; }
.calendar-zoom button:disabled { opacity: .4; }
.day-hour { min-height: var(--calendar-hour-height, 58px); }
@media (max-width: 600px) {
  .calendar-event-form-grid { grid-template-columns: minmax(0, 1fr); }
  .calendar-event-datetime { grid-column: auto; }
  .calendar-color-options { gap: 2px; }
  .calendar-color-option { font-size: 8px; }
}
