/* Taken: Notion-clean. System font, soft greys, hover fills instead of borders. */
:root {
  --bg: #ffffff;
  --side: #f7f7f5;
  --text: #37352f;
  --muted: #787774;
  --faint: #a5a49f;
  --hover: rgba(55, 53, 47, 0.06);
  --active: rgba(55, 53, 47, 0.09);
  --line: rgba(55, 53, 47, 0.09);
  --line-2: rgba(55, 53, 47, 0.16);
  --accent: #2383e2;
  --red: #d44c47;
  --pop: #ffffff;
  --shadow: 0 0 0 1px rgba(15, 15, 15, 0.05), 0 3px 6px rgba(15, 15, 15, 0.1), 0 9px 24px rgba(15, 15, 15, 0.2);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif;
  --side-w: 248px;
  --detail-w: 440px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191919;
    --side: #202020;
    --text: rgba(255, 255, 255, 0.81);
    --muted: rgba(255, 255, 255, 0.46);
    --faint: rgba(255, 255, 255, 0.3);
    --hover: rgba(255, 255, 255, 0.055);
    --active: rgba(255, 255, 255, 0.09);
    --line: rgba(255, 255, 255, 0.094);
    --line-2: rgba(255, 255, 255, 0.16);
    --pop: #252525;
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 3px 6px rgba(0, 0, 0, 0.3), 0 9px 24px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.icon { flex: none; display: block; }
.flip { transform: rotate(180deg); }
.rel { position: relative; }
code { font-size: 0.9em; background: var(--hover); padding: 1px 5px; border-radius: 4px; }
.boot { height: 100vh; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); font-size: 14px; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #0b6fd0; }
.btn-ghost { border-color: transparent; background: none; color: var(--muted); }
.btn-block { width: 100%; justify-content: center; height: 40px; }
.icon-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--muted); }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.link { border: 0; background: none; padding: 0; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field, .select { height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); font-size: 14px; }
.select { padding-right: 4px; max-width: 100%; }
.error { color: var(--red); font-size: 13px; margin-top: 8px; }

/* Layout */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar { width: var(--side-w); flex: none; display: flex; flex-direction: column; background: var(--side); border-right: 1px solid var(--line); }
.main { flex: 1; min-width: 0; overflow-y: auto; }
.topbar { display: none; }
.scrim { display: none; }

.side-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 8px 14px; }
.workspace { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.avatar { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 4px; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 600; }
.side-scroll { flex: 1; overflow-y: auto; padding: 4px 6px 12px; }
.side-bottom { padding: 6px; border-top: 1px solid var(--line); }
.nav-item { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 8px; border-radius: 5px; color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-item:hover { background: var(--hover); }
.nav-item.is-active { background: var(--active); color: var(--text); }
.nav-item .dot { width: 9px; height: 9px; border-radius: 3px; margin: 0 3.5px; flex: none; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: 12px; color: var(--faint); font-weight: 400; }
.side-group { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 2px; padding: 0 4px 0 8px; font-size: 12px; font-weight: 600; color: var(--faint); }
.nav-add { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--faint); opacity: 0; }
.nav-add.is-visible, .nav-item:hover .nav-add, .side-group:hover .nav-add { opacity: 1; }
.nav-add:hover { background: var(--active); color: var(--text); }
.nav-note { gap: 4px; }
.nav-toggle { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--faint); flex: none; }
.nav-toggle:hover { background: var(--active); }
.nav-toggle.is-leaf { pointer-events: none; }
.nav-emoji { font-size: 13px; line-height: 1; }
.side-empty, .side-more { display: block; width: 100%; padding: 4px 8px; border: 0; background: none; text-align: left; color: var(--faint); font-size: 13px; border-radius: 5px; }
.side-empty:hover, .side-more:hover { background: var(--hover); color: var(--muted); }

/* Views */
.view { max-width: 760px; margin: 0 auto; padding: 56px 48px 120px; }
.view.is-wide { max-width: none; padding-left: 40px; padding-right: 0; }
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.view.is-wide .view-head { padding-right: 40px; }
.view-title { font-size: 32px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
.view-sub { margin-top: 2px; color: var(--muted); font-size: 14px; }
.view-tools { display: flex; align-items: center; gap: 6px; padding-top: 6px; }
.project-title { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; }
.project-title .dot { width: 14px; height: 14px; border-radius: 4px; flex: none; margin-top: 14px; }
.title-edit { width: 100%; }
.autotext { display: block; width: 100%; resize: none; overflow: hidden; border: 0; outline: 0; background: none; padding: 0; margin: 0; }
.autotext::placeholder { color: var(--faint); }
.notice { margin-bottom: 16px; padding: 8px 12px; border-radius: 6px; background: var(--hover); color: var(--muted); font-size: 14px; }
.empty { padding: 24px 0; color: var(--faint); }
.seg { display: inline-flex; padding: 2px; border-radius: 7px; background: var(--hover); }
.seg button { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border: 0; border-radius: 5px; background: none; color: var(--muted); font-size: 13px; font-weight: 500; }
.seg button.is-on { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(15, 15, 15, 0.1); }

.group { margin-bottom: 28px; }
.group-title { display: flex; align-items: baseline; gap: 8px; padding-bottom: 6px; margin-bottom: 2px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.group-title span { font-weight: 400; color: var(--faint); font-size: 13px; }
.group-title.is-late { color: var(--red); }
.day-group { margin-bottom: 18px; }
.day-group.is-empty .add-row { opacity: 0; }
.day-group.is-empty:hover .add-row, .day-group.is-empty .quick { opacity: 1; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 600; }
.section-name-wrap { display: inline-flex; align-items: center; gap: 2px; position: relative; }
.section-name { cursor: text; }
.section-name-wrap .icon-btn { opacity: 0; width: 24px; height: 24px; }
.section-head:hover .icon-btn, .col-head:hover .icon-btn { opacity: 1; }
.section-input { width: 100%; max-width: 360px; height: 30px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); font-weight: 600; outline: 0; }
.section-new { margin-top: 20px; }

/* Task rows */
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: flex-start; gap: 10px; padding: 7px 8px 7px 4px; margin: 0 -8px 0 -4px; border-bottom: 1px solid var(--line); border-radius: 0; cursor: pointer; }
.task:hover { background: var(--hover); }
.task.is-open { background: var(--active); }
.task-main { flex: 1; min-width: 0; padding-top: 1px; }
.task-title { display: block; overflow-wrap: anywhere; }
.task.is-done .task-title { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--faint); }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 2px; }
.task.is-ghost { opacity: 0.35; }
.task.is-drag { background: var(--pop); box-shadow: var(--shadow); border-radius: 6px; }

.check { flex: none; display: grid; place-items: center; width: 18px; height: 18px; margin-top: 2px; padding: 0; border: 1.5px solid var(--faint); border-radius: 50%; background: none; color: transparent; transition: background 0.12s, border-color 0.12s; }
.check:hover { color: var(--muted); }
.check.p1 { border-color: #d44c47; background: rgba(212, 76, 71, 0.08); }
.check.p2 { border-color: #d9730d; background: rgba(217, 115, 13, 0.08); }
.check.p3 { border-color: #337ea9; background: rgba(51, 126, 169, 0.08); }
.check.is-done { background: var(--faint); border-color: var(--faint); color: var(--bg); }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 18px; color: var(--muted); white-space: nowrap; }
.chip-date.is-late { color: var(--red); }
.chip-date.is-today { color: #448361; }
.chip-label { --c: #787774; padding: 0 6px; border-radius: 4px; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.chip-project i { width: 7px; height: 7px; border-radius: 2px; }
.chip-btn { padding: 0; border: 0; background: none; }

.add-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0 4px; border: 0; background: none; color: var(--faint); font-size: 14px; text-align: left; border-radius: 5px; }
.add-row:hover { color: var(--muted); background: var(--hover); }
.add-row .icon { margin: 0 1px; }
.quick { margin: 6px 0 4px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); }
.quick-input { width: 100%; border: 0; outline: 0; background: none; padding: 4px 0; font-size: 15px; }
.quick-preview { display: flex; flex-wrap: wrap; gap: 6px 10px; padding: 2px 0 6px; }
.quick-actions { display: flex; justify-content: flex-end; gap: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.done-block { margin-top: 20px; }
.done-toggle { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; padding: 4px 6px; border: 0; border-radius: 5px; background: none; color: var(--faint); font-size: 13px; }
.done-toggle:hover { background: var(--hover); color: var(--muted); }

/* Board */
.board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding: 4px 40px 24px 0; min-height: 60vh; }
.col { flex: none; width: 272px; padding: 8px; border-radius: 8px; background: var(--hover); }
.col-new { background: none; }
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 8px; font-size: 14px; font-weight: 600; }
.col .tasks { min-height: 8px; }
.col .task { margin: 0 0 6px; padding: 8px 10px 8px 8px; border: 0; border-radius: 6px; background: var(--bg); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(15, 15, 15, 0.06); }
.col .task:hover { background: var(--bg); box-shadow: 0 0 0 1px var(--line-2), 0 2px 4px rgba(15, 15, 15, 0.08); }
.col .quick { margin-top: 0; }

/* Detail panel */
.detail { width: var(--detail-w); flex: none; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--bg); overflow: hidden; }
.detail-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 44px; padding: 0 10px 0 14px; border-bottom: 1px solid var(--line); }
.detail-actions { display: flex; gap: 2px; }
.crumb { display: inline-flex; align-items: center; gap: 4px; max-width: 280px; padding: 2px 6px; border: 0; border-radius: 5px; background: none; color: var(--muted); font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.crumb:hover { background: var(--hover); }
.detail-body { flex: 1; overflow-y: auto; padding: 22px 24px 48px; }
.detail-title { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.detail-title .check { width: 20px; height: 20px; margin-top: 6px; }
.title-input { font-size: 22px; line-height: 1.3; font-weight: 700; }
.title-input.is-done { color: var(--faint); text-decoration: line-through; }
.props { display: grid; gap: 2px; margin-bottom: 24px; }
.prop { display: grid; grid-template-columns: 120px 1fr; align-items: start; gap: 8px; min-height: 34px; }
.prop-label { display: flex; align-items: center; gap: 8px; height: 34px; color: var(--muted); font-size: 14px; }
.prop-value { min-width: 0; padding: 4px 0; }
.prop .select { border-color: transparent; background: none; margin-left: -8px; }
.prop .select:hover, .prop .select:focus { background: var(--hover); }
.date-row { display: flex; align-items: center; gap: 4px; margin-left: -8px; }
.date-row .select { margin-left: 0; }
.date-shortcuts { display: flex; flex-wrap: wrap; gap: 4px; margin-left: -8px; }
.ghost-value { height: 26px; padding: 0 8px; border: 0; border-radius: 5px; background: none; color: var(--faint); font-size: 14px; }
.ghost-value:hover { background: var(--hover); color: var(--muted); }
.prio { display: flex; flex-wrap: wrap; gap: 4px; margin-left: -4px; }
.prio-btn { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border: 0; border-radius: 5px; background: none; color: var(--c); font-size: 13px; font-weight: 500; opacity: 0.55; }
.prio-btn:hover { background: var(--hover); opacity: 1; }
.prio-btn.is-on { background: color-mix(in srgb, var(--c) 12%, transparent); opacity: 1; }
.label-picker { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.label-picker > .ghost-value { margin-left: -8px; }
.task-meta + .ghost-value { margin-left: 0; }
.subtasks, .detail-notes { margin-bottom: 24px; }
.subtasks h3, .detail-notes h3 { padding-bottom: 6px; margin-bottom: 2px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.subtasks .task { margin: 0; padding-left: 2px; }
.sub-input { width: 100%; height: 34px; border: 0; outline: 0; background: none; padding: 0 2px; color: var(--text); font-size: 14px; }
.sub-input::placeholder { color: var(--faint); }
.detail-foot { margin-top: 12px; }

/* Popovers and menus */
.popover { position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; min-width: 220px; max-height: 360px; overflow-y: auto; padding: 6px; border-radius: 8px; background: var(--pop); box-shadow: var(--shadow); }
.pop-right { left: auto; right: 0; }
.menu-title { padding: 4px 8px 6px; font-size: 12px; font-weight: 600; color: var(--faint); }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 30px; padding: 0 8px; border: 0; border-radius: 5px; background: none; text-align: left; font-size: 14px; }
.menu-item:hover { background: var(--hover); }
.menu-item.is-danger { color: var(--red); }
.pop-input { width: 100%; height: 32px; margin-bottom: 4px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); outline: 0; font-size: 14px; }
.mini-check { display: grid; place-items: center; width: 16px; height: 16px; border: 1.5px solid var(--line-2); border-radius: 4px; color: transparent; }
.mini-check.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.swatches { display: grid; grid-template-columns: repeat(9, 18px); gap: 6px; padding: 0 8px 8px; }
.swatch { width: 18px; height: 18px; padding: 0; border: 0; border-radius: 5px; }
.swatch.is-on { box-shadow: 0 0 0 2px var(--pop), 0 0 0 3.5px var(--text); }
.pop-icons { display: grid; grid-template-columns: repeat(8, 32px); gap: 2px; min-width: 0; }
.icon-choice { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 5px; background: none; font-size: 18px; }
.icon-choice:hover { background: var(--hover); }
.icon-choice.small { grid-column: span 2; width: auto; font-size: 13px; color: var(--muted); }

/* Rich text (Tiptap) */
.rich { position: relative; }
.rich .ProseMirror { outline: 0; min-height: 28px; font-size: 15px; line-height: 1.6; }
.note-editor .ProseMirror { min-height: 50vh; font-size: 16px; }
.ProseMirror > * + * { margin-top: 2px; }
.ProseMirror p { margin: 0; padding: 3px 0; }
.ProseMirror h1 { font-size: 1.875em; font-weight: 700; margin: 1em 0 2px; line-height: 1.3; }
.ProseMirror h2 { font-size: 1.5em; font-weight: 600; margin: 0.9em 0 1px; line-height: 1.3; }
.ProseMirror h3 { font-size: 1.25em; font-weight: 600; margin: 0.7em 0 1px; line-height: 1.3; }
.ProseMirror ul, .ProseMirror ol { margin: 0; padding-left: 1.6em; }
.ProseMirror li > p { padding: 2px 0; }
.ProseMirror ul[data-type="taskList"] { list-style: none; padding-left: 2px; }
.ProseMirror ul[data-type="taskList"] li { display: flex; align-items: flex-start; gap: 8px; }
.ProseMirror ul[data-type="taskList"] li > label { flex: none; margin-top: 6px; }
.ProseMirror ul[data-type="taskList"] li > label input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.ProseMirror ul[data-type="taskList"] li > div { flex: 1; min-width: 0; }
.ProseMirror ul[data-type="taskList"] li[data-checked="true"] > div { color: var(--faint); text-decoration: line-through; }
.ProseMirror blockquote { margin: 4px 0; padding: 0 0 0 14px; border-left: 3px solid var(--text); }
.ProseMirror pre { margin: 6px 0; padding: 16px 18px; border-radius: 6px; background: var(--hover); font: 13.5px/1.55 ui-monospace, "SF Mono", Menlo, monospace; overflow-x: auto; }
.ProseMirror code { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: #eb5757; background: rgba(135, 131, 120, 0.15); }
.ProseMirror pre code { color: inherit; background: none; padding: 0; }
.ProseMirror hr { border: 0; border-top: 1px solid var(--line-2); margin: 14px 0; }
.ProseMirror a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; }
.ProseMirror .is-empty::before, .ProseMirror p.is-editor-empty:first-child::before { content: attr(data-placeholder); float: left; height: 0; color: var(--faint); pointer-events: none; }
.slash { position: absolute; z-index: 60; width: 260px; max-height: 320px; overflow-y: auto; padding: 6px; border-radius: 8px; background: var(--pop); box-shadow: var(--shadow); }
.slash-title { padding: 4px 8px 6px; font-size: 12px; font-weight: 600; color: var(--faint); }
.slash-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 4px 8px; border: 0; border-radius: 5px; background: none; text-align: left; }
.slash-item.is-active { background: var(--hover); }
.slash-icon { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); font-size: 13px; font-weight: 600; color: var(--muted); flex: none; }
.slash-item strong { display: block; font-size: 14px; font-weight: 500; }
.slash-item small { display: block; font-size: 12px; color: var(--faint); }

/* Notes */
.note-view { max-width: 820px; }
.note-bar { display: flex; align-items: center; justify-content: space-between; margin: -28px 0 20px; min-height: 28px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); min-width: 0; overflow: hidden; white-space: nowrap; }
.crumbs a:hover { text-decoration: underline; }
.note-head { margin-bottom: 8px; }
.note-icon { display: block; min-height: 32px; padding: 0 4px; margin-left: -4px; border: 0; border-radius: 6px; background: none; font-size: 56px; line-height: 1.1; }
.note-icon:hover { background: var(--hover); }
.note-title { margin-top: 6px; font-size: 40px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
.subpages { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.subpage { display: flex; align-items: center; gap: 8px; padding: 4px 6px; margin-left: -6px; border-radius: 5px; color: var(--text); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.subpage:hover { background: var(--hover); }

/* Search */
.search-scrim { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(15, 15, 15, 0.4); }
.search { width: min(620px, 100%); max-height: 70vh; display: flex; flex-direction: column; border-radius: 12px; background: var(--pop); box-shadow: var(--shadow); overflow: hidden; }
.search-bar { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-bar input { flex: 1; height: 52px; border: 0; outline: 0; background: none; font-size: 17px; color: var(--text); }
.search-results { overflow-y: auto; padding: 6px; }
.search-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: 6px; background: none; text-align: left; color: var(--muted); }
.search-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.search-item span.is-done { color: var(--faint); text-decoration: line-through; }
.search-item small { font-size: 12px; color: var(--faint); }
.search-item.is-active { background: var(--hover); }
.search-empty { padding: 16px 10px; }

/* Settings */
.set { margin-bottom: 40px; }
.set h2 { padding-bottom: 8px; margin-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 600; }
.set .faint { margin-bottom: 12px; }
.set-sub { margin: 18px 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.set-list { list-style: none; margin: 0 0 14px; padding: 0; }
.set-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.set-list li > span { flex: 1; min-width: 0; }
.set-list strong { font-weight: 500; }
.set-list small { display: block; color: var(--faint); font-size: 12px; }
.set-list .field { flex: 1; }
.color-select { width: 92px; flex: none; font-weight: 600; }
.pairing { margin-bottom: 16px; padding: 14px 16px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pairing p { margin-bottom: 10px; }
.pairing .field { width: 120px; letter-spacing: 0.15em; }
.overlay { position: fixed; inset: 0; z-index: 90; background: var(--bg); }

/* Toast */
.toast { position: fixed; z-index: 70; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 8px; background: #2f2f2f; color: #fff; font-size: 14px; box-shadow: var(--shadow); white-space: nowrap; }
.toast button { border: 0; background: none; color: #7cb7f5; font-weight: 500; padding: 0; }
.offline { flex: 1; text-align: center; font-size: 12px; color: var(--red); }

/* Auth */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-box { width: min(360px, 100%); }
.auth-mark { width: 44px; height: 44px; margin-bottom: 20px; border-radius: 10px; background: var(--text); display: grid; place-items: center; }
.auth-mark span { width: 18px; height: 18px; border: 2.5px solid var(--bg); border-radius: 50%; position: relative; }
.auth-mark span::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid var(--bg); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.auth h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.auth-lede { color: var(--muted); margin-bottom: 20px; }
.auth-box > .btn-primary { margin-top: 16px; }
.auth-form { display: grid; gap: 10px; }
.auth-input { height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); outline: 0; font-size: 16px; letter-spacing: 0.04em; }
.auth-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.auth-error { margin-top: 12px; color: var(--red); font-size: 14px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.auth .btn-ghost { margin-top: 8px; }
.pair-code { margin: 8px 0 12px; font-size: 40px; font-weight: 700; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.auth-wait { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.recovery-code { margin: 4px 0 16px; padding: 14px; border-radius: 8px; background: var(--hover); font: 600 17px/1.4 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.04em; text-align: center; cursor: copy; user-select: all; }
.auth-check { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 14px; }

/* Phone and tablet */
@media (max-width: 1100px) {
  .detail { position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(var(--detail-w), 100%); box-shadow: var(--shadow); }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform 0.22s ease; padding-top: env(safe-area-inset-top); }
  .sidebar.is-open { transform: none; box-shadow: var(--shadow); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(15, 15, 15, 0.35); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
  .scrim.is-open { opacity: 1; pointer-events: auto; }
  .topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: calc(48px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 10px 0; background: var(--bg); }
  .topbar .icon-btn { width: 36px; height: 36px; }
  .view { padding: 8px 16px 120px; }
  .view.is-wide { padding-left: 16px; }
  .view.is-wide .view-head { padding-right: 16px; }
  .board { padding-right: 16px; }
  .view-title { font-size: 28px; }
  .view-head { flex-wrap: wrap; }
  .detail { width: 100%; padding-top: env(safe-area-inset-top); }
  .detail-body { padding: 18px 16px 48px; }
  .prop { grid-template-columns: 104px 1fr; }
  .note-bar { margin-top: 0; }
  .note-title { font-size: 32px; }
  .note-icon { font-size: 44px; }
  .task { padding-top: 9px; padding-bottom: 9px; }
  .nav-item { min-height: 36px; font-size: 15px; }
  .nav-add { opacity: 1; }
  .search-scrim { padding-top: calc(12px + env(safe-area-inset-top)); }
}

/* Voice */
.add-line { display: flex; align-items: center; gap: 4px; }
.add-line .add-row { flex: 1; }
.mic-wrap { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.mic { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 30px; height: 30px; padding: 0 7px; border: 0; border-radius: 6px; background: none; color: var(--faint); }
.mic:hover { background: var(--hover); color: var(--text); }
.mic-rec { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); padding: 0 10px; }
.mic-label { font-size: 13px; font-weight: 600; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.spinner { width: 14px; height: 14px; border: 2px solid var(--line-2); border-top-color: var(--text); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mic-error { position: absolute; z-index: 20; top: calc(100% + 4px); right: 0; padding: 4px 8px; border-radius: 6px; background: var(--pop); box-shadow: var(--shadow); color: var(--red); font-size: 12px; white-space: nowrap; }
.mic-left { margin-right: auto; }
.mic-left .mic-error { left: 0; right: auto; }
.rich-mic { position: absolute; top: -2px; right: -6px; }
.rich-mic .mic { opacity: 0.6; }
.rich:hover .rich-mic .mic, .rich-mic .mic-rec, .rich-mic .mic:disabled { opacity: 1; }
.note-editor .rich-mic { top: -48px; }
@media (max-width: 760px) { .rich-mic .mic { opacity: 1; } .mic { min-width: 36px; height: 36px; } }
