/* Flow — one typeface (Geist), three sizes, monochrome. Light + dark. */
:root {
  --bg: #ffffff; --bg2: #f7f7f6; --bg3: #efefed; --ink: #161615; --ink2: #6a6a66; --ink3: #a6a6a2;
  --line: #e9e9e6; --line2: #dcdcd8; --chip: #f4f4f2; --accent: #161615; --sel: rgba(0,0,0,.07);
  --s1: 13px; --s2: 15px; --s3: 28px;
  --r: 10px; --font: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212; --bg2: #181818; --bg3: #222222; --ink: #ececea; --ink2: #9b9b97; --ink3: #5e5e5b;
    --line: #242424; --line2: #2f2f2f; --chip: #1d1d1d; --accent: #ececea; --sel: rgba(255,255,255,.08);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121212; --bg2: #181818; --bg3: #222222; --ink: #ececea; --ink2: #9b9b97; --ink3: #5e5e5b;
  --line: #242424; --line2: #2f2f2f; --chip: #1d1d1d; --accent: #ececea; --sel: rgba(255,255,255,.08);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--s2)/1.6 var(--font); letter-spacing: -.006em; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--sel); }
[hidden] { display: none !important; }

/* ── layout ─────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 18px 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 1px; background: var(--bg2); }
.brand { font-weight: 600; font-size: 16px; letter-spacing: -.02em; padding: 4px 10px 18px; text-align: left; display: flex; align-items: center; gap: 8px; }
.brand:hover { color: var(--ink2); }
.nav a, .nav button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px; border-radius: 7px; color: var(--ink2); text-align: left; font-size: 14px; }
.nav a:hover, .nav button:hover { background: var(--bg3); color: var(--ink); }
.nav a.on { background: var(--bg3); color: var(--ink); font-weight: 500; }
.nav .k { margin-left: auto; font-size: 11px; color: var(--ink3); font-family: var(--mono); }
.side .sub { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink3); padding: 18px 10px 6px; }
.side .grow { flex: 1; }
.main { min-width: 0; padding: 0 48px 120px; }
.wrap { max-width: 720px; margin: 0 auto; }
.wide { max-width: 1160px; margin: 0 auto; }

/* top bar: back / forward, actions right */
.topbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 2px; height: 52px; margin: 0 -48px 18px; padding: 0 40px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.topbar .ib { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--ink2); }
.topbar .ib:hover { background: var(--bg2); color: var(--ink); }
.topbar .ib:disabled { opacity: .35; cursor: default; background: none; }
.topbar .grow { flex: 1; }
.topbar .mob { display: none; }

.mbar { display: none; }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 0 18px 110px; }
  .topbar { margin: 0 -18px 12px; padding: env(safe-area-inset-top) 10px 0; height: calc(52px + env(safe-area-inset-top)); }
  .topbar .mob { display: inline-flex; }
  .mbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; justify-content: space-around; padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .mbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--ink3); min-width: 54px; }
  .mbar a.on { color: var(--ink); }
  .mbar svg { width: 20px; height: 20px; }
}

/* ── type ───────────────────────────────────────────── */
h1 { font-size: var(--s3); font-weight: 600; letter-spacing: -.028em; margin: 0; line-height: 1.2; }
h2 { font-size: var(--s2); font-weight: 600; margin: 34px 0 10px; letter-spacing: -.01em; }
.label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink3); font-weight: 500; }
.muted { color: var(--ink2); }
.faint { color: var(--ink3); }
.small { font-size: var(--s1); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt { margin-top: 20px; }
.sub-line { font-size: var(--s1); color: var(--ink3); margin-top: 6px; }

/* ── controls ───────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 8px; background: var(--bg); color: var(--ink); font-size: var(--s1); font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--bg2); }
.btn.solid { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn.solid:hover { opacity: .9; }
.btn.ghost { border-color: transparent; color: var(--ink2); background: none; }
.btn.ghost:hover { color: var(--ink); background: var(--bg2); }
.btn.on { background: var(--bg3); border-color: var(--line2); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; padding: 2px; gap: 2px; flex-wrap: wrap; background: var(--bg2); }
.seg button { height: 26px; padding: 0 10px; border-radius: 7px; font-size: var(--s1); color: var(--ink2); }
.seg button.on { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); outline: none; transition: border-color .12s; }
.input:focus { border-color: var(--line2); box-shadow: 0 0 0 3px var(--sel); }
.input:disabled { background: var(--bg2); }
.icon { width: 16px; height: 16px; flex: none; display: inline-flex; }

/* ── link chips: a quiet box, never blue/underlined ── */
.chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 0 7px; margin: 0 1px; border: 1px solid var(--line2); border-radius: 6px; background: var(--chip); color: var(--ink); line-height: 1.5; vertical-align: baseline; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .93em; font-weight: 450; }
.chip:hover { border-color: var(--ink3); }
.chip .ext { color: var(--ink3); font-size: .85em; }
.chip.missing { color: var(--ink2); border-style: dashed; }
.chip.agent { font-weight: 600; }
.tag { color: var(--ink3); }
code { font: .88em var(--mono); background: var(--bg2); border: 1px solid var(--line); padding: 0 4px; border-radius: 5px; }

/* ── lists / cards ──────────────────────────────────── */
.list { border-top: 1px solid var(--line); }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .1s; }
.item:hover { background: var(--bg2); }
.item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .m { font-size: var(--s1); color: var(--ink3); white-space: nowrap; }
.item .w { font-size: var(--s1); color: var(--ink2); white-space: normal; margin-top: 1px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink2); flex: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.card { border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; cursor: pointer; background: var(--bg); transition: border-color .12s, box-shadow .12s; }
.card:hover { border-color: var(--line2); box-shadow: var(--shadow); }
.card .t { font-weight: 600; letter-spacing: -.01em; }
.focus-box { border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; background: var(--bg2); }
.why { font-size: var(--s1); color: var(--ink2); display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 3px; }
.why .sep { color: var(--ink3); }
.empty { color: var(--ink3); padding: 14px 4px; font-size: var(--s1); }
.banner { border: 1px solid var(--line2); background: var(--bg2); border-radius: var(--r); padding: 10px 14px; font-size: var(--s1); margin: 10px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── page title ─────────────────────────────────────── */
.title-input { font-size: var(--s3); font-weight: 600; letter-spacing: -.028em; line-height: 1.2; border: 0; outline: none; width: 100%; background: transparent; padding: 0; }
.title-input::placeholder { color: var(--ink3); }

/* ── project page ───────────────────────────────────── */
.proj { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; max-width: 760px; margin: 0 auto; }
.proj.with-settings { grid-template-columns: minmax(0, 1fr) 280px; max-width: 1100px; }
.proj-head { display: flex; align-items: flex-start; gap: 12px; }
.proj-head .title-input { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line2); font-size: 12px; color: var(--ink2); }
.pill.now { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.meta-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-size: var(--s1); color: var(--ink3); }
.why-block { margin-top: 26px; }
.why-block .ed .blk .txt { font-size: 17px; line-height: 1.55; letter-spacing: -.012em; }
.where { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.where > div { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 8px; }
.where .arrow { display: none; }
@media (max-width: 640px) { .where { grid-template-columns: 1fr; } }

.tabs { display: flex; gap: 22px; margin-top: 34px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { position: relative; padding: 0 0 11px; font-size: 14px; color: var(--ink3); white-space: nowrap; font-weight: 500; }
.tabs button:hover { color: var(--ink2); }
.tabs button.on { color: var(--ink); }
.tabs button.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1.5px; background: var(--ink); border-radius: 2px; }
.tabs .n { font-size: 11px; color: var(--ink3); margin-left: 5px; font-weight: 400; }
.tab-body { padding-top: 18px; min-height: 200px; }
.tab-actions { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

.settings { border-left: 1px solid var(--line); padding-left: 24px; align-self: start; position: sticky; top: 64px; }
.settings .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.props { display: flex; flex-direction: column; gap: 10px; }
.props .k { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink3); margin-bottom: 2px; }
.props input, .props select, .props textarea { width: 100%; border: 1px solid transparent; background: transparent; padding: 4px 6px; margin-left: -6px; border-radius: 7px; outline: none; font-size: 14px; line-height: 1.45; }
.props textarea { resize: none; overflow: hidden; display: block; font-family: inherit; }
.props input:hover, .props select:hover, .props textarea:hover { background: var(--bg2); }
.props input:focus, .props select:focus, .props textarea:focus { border-color: var(--line2); background: var(--bg); }
.settings .edited { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink3); }
@media (max-width: 1180px) {
  .proj.with-settings { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
  .settings { position: fixed; top: 0; right: 0; bottom: 0; width: min(340px, 92vw); z-index: 40; overflow-y: auto; background: var(--bg); border-left: 1px solid var(--line2); padding: 18px 22px calc(90px + env(safe-area-inset-bottom)); box-shadow: -12px 0 40px rgba(0,0,0,.12); padding-top: calc(18px + env(safe-area-inset-top)); }
}

/* ── editor (outliner) ──────────────────────────────── */
.ed { outline: none; }
.blk { position: relative; display: flex; align-items: flex-start; min-height: 28px; }
.blk .gut { flex: none; width: 24px; height: 28px; display: flex; align-items: center; justify-content: center; color: var(--ink3); }
.blk .bul { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border-radius: 50%; cursor: pointer; }
.blk .bul::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--ink2); }
.blk .bul:hover { background: var(--bg3); }
.blk.collapsed .bul { background: var(--bg3); }
.blk .tog { position: absolute; top: 5px; width: 16px; height: 18px; color: var(--ink3); opacity: 0; font-size: 10px; }
.blk:hover .tog { opacity: 1; }
.blk .cb { width: 16px; height: 16px; border: 1.5px solid var(--line2); border-radius: 5px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .12s, border-color .12s; }
.blk .cb:hover { border-color: var(--ink3); }
.blk.checked .cb { background: var(--ink); border-color: var(--ink); }
.blk.checked .cb::after { content: ''; width: 7px; height: 4px; border: solid var(--bg); border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px,-1px); }
.blk.checked .txt { color: var(--ink3); text-decoration: line-through; text-decoration-color: var(--ink3); }
.blk .txt { flex: 1; min-width: 0; padding: 2px 0; outline: none; white-space: pre-wrap; word-break: break-word; min-height: 26px; }
.blk.p .gut, .blk.h .gut { display: none; }
.blk.h .txt { font-weight: 600; padding-top: 16px; letter-spacing: -.01em; }
.blk.h1 .txt { font-size: 22px; }
.blk.h2 .txt { font-size: 17px; }
.blk .txt:empty::before { content: attr(data-ph); color: var(--ink3); }
.blk.raw .txt { font: 13px/1.55 var(--mono); background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; white-space: pre; margin: 4px 0; }
.crumbs { font-size: var(--s1); color: var(--ink3); margin-bottom: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs button { color: var(--ink2); }
.crumbs button:hover { color: var(--ink); }
.suggest { position: fixed; z-index: 60; min-width: 240px; max-width: 340px; background: var(--bg); border: 1px solid var(--line2); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; }
.suggest div { padding: 6px 9px; border-radius: 7px; cursor: pointer; font-size: var(--s1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest div.on, .suggest div:hover { background: var(--bg3); }

/* ── search palette ─────────────────────────────────── */
.pal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.2); display: flex; align-items: flex-start; justify-content: center; padding: 16vh 16px 16px; }
.pal { width: 100%; max-width: 580px; background: var(--bg); border: 1px solid var(--line2); border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,.25); overflow: hidden; }
.pal input { width: 100%; border: 0; outline: none; padding: 17px 20px; font-size: 17px; background: transparent; border-bottom: 1px solid var(--line); }
.pal .res { max-height: 50vh; overflow: auto; padding: 6px; }
.pal .r { padding: 9px 14px; border-radius: 9px; cursor: pointer; }
.pal .r.on { background: var(--bg3); }
.pal .r .s { font-size: var(--s1); color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal .kind { font-size: 11px; color: var(--ink3); margin-left: 8px; }

/* ── today ──────────────────────────────────────────── */
.task { display: flex; align-items: flex-start; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.task .cb { margin-top: 4px; width: 16px; height: 16px; border: 1.5px solid var(--line2); border-radius: 5px; cursor: pointer; flex: none; }
.task .cb:hover { border-color: var(--ink3); }
.task.done .cb { background: var(--ink); border-color: var(--ink); }
.task .body { flex: 1; min-width: 0; }
.task.done .tx { color: var(--ink3); text-decoration: line-through; }
.task .acts { display: flex; gap: 2px; opacity: .5; }
.task:hover .acts { opacity: 1; }
.cap { font-size: var(--s1); color: var(--ink3); font-weight: 400; margin-left: 8px; }
.note { font-size: var(--s1); color: var(--ink2); padding: 8px 0; }

/* ── why overview ───────────────────────────────────── */
.why-hero { font-size: 26px; line-height: 1.35; letter-spacing: -.025em; font-weight: 500; margin: 8px 0 0; }
.why-area { padding: 26px 0; border-top: 1px solid var(--line); }
.why-area .big { font-size: 19px; line-height: 1.45; letter-spacing: -.015em; margin: 6px 0 12px; }
.why-proj { display: flex; gap: 14px; padding: 8px 0; cursor: pointer; }
.why-proj .pt { font-weight: 500; min-width: 160px; }
.why-proj .pw { color: var(--ink2); flex: 1; }
.why-proj:hover .pt { text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
@media (max-width: 640px) { .why-proj { flex-direction: column; gap: 0; } }

/* ── talk ───────────────────────────────────────────── */
.talk { display: flex; flex-direction: column; gap: 12px; }
.convs { display: flex; gap: 6px; flex-wrap: wrap; }
.msgs { display: flex; flex-direction: column; gap: 10px; padding: 6px 0; }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; }
.msg.me { align-self: flex-end; background: var(--ink); color: var(--bg); border-color: var(--ink); }
.msg.me .chip { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 35%, transparent); }
.msg .who { font-size: 11px; color: var(--ink3); margin-bottom: 2px; }
.msg.me .who { color: color-mix(in srgb, var(--bg) 55%, transparent); }
.msg.sys { align-self: center; background: none; border: 0; color: var(--ink3); font-size: var(--s1); }
.composer { display: flex; gap: 8px; align-items: flex-end; border: 1px solid var(--line2); border-radius: 14px; padding: 6px 6px 6px 14px; background: var(--bg); }
.composer textarea { flex: 1; border: 0; outline: none; resize: none; background: transparent; padding: 7px 0; max-height: 200px; line-height: 1.5; }

/* ── gantt ──────────────────────────────────────────── */
.gantt { border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
.g-inner { position: relative; min-width: 760px; }
.g-head { display: grid; position: sticky; top: 0; background: var(--bg); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--ink3); z-index: 2; }
.g-head div { padding: 7px 9px; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.g-lane { border-bottom: 1px solid var(--line); }
.g-lane:last-child { border-bottom: 0; }
.g-lane-t { font-size: 12px; font-weight: 600; padding: 9px 12px 2px; position: sticky; left: 0; display: inline-block; background: var(--bg); }
.g-rows { position: relative; }
.g-row { position: relative; height: 34px; }
.g-bar { position: absolute; top: 5px; height: 24px; border-radius: 7px; border: 1px solid var(--line2); background: var(--bg3); font-size: 12px; padding: 0 9px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; cursor: pointer; }
.g-bar:hover { border-color: var(--ink3); }
.g-bar.phase { background: transparent; border-style: dashed; color: var(--ink2); }
.g-bar.now { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.g-bar.done { color: var(--ink3); }
.g-grid { position: absolute; inset: 0; pointer-events: none; display: grid; }
.g-grid div { border-left: 1px solid var(--line); }
.g-now { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px solid var(--ink); z-index: 3; pointer-events: none; }
.g-now::before { content: 'now'; position: absolute; bottom: 2px; left: 4px; font-size: 10px; color: var(--ink); background: var(--bg); padding: 0 3px; }

.toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-size: var(--s1); padding: 9px 15px; border-radius: 10px; z-index: 70; box-shadow: var(--shadow); }

/* ── area: why + kanban board ───────────────────────── */
.proj-head .seg { align-self: center; }
.area-why { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-top: 10px; font-size: 16px; color: var(--ink2); }
.board { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; margin-top: 26px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 160px; display: flex; flex-direction: column; gap: 8px; transition: border-color .12s; }
.col.over { border-color: var(--ink3); }
.col-h { font-size: 13px; font-weight: 600; padding: 2px 4px 4px; display: flex; justify-content: space-between; }
.kcard { background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; cursor: grab; transition: box-shadow .12s, border-color .12s; }
.kcard:hover { border-color: var(--line2); box-shadow: var(--shadow); }
.kcard.drag { opacity: .4; }
.kcard .t { font-weight: 500; font-size: 14px; letter-spacing: -.01em; }
.kcard .w { font-size: 12.5px; color: var(--ink2); margin-top: 3px; line-height: 1.45; }
.kcard .na { font-size: 12.5px; color: var(--ink2); margin-top: 6px; }
.kcard .m { font-size: 11.5px; color: var(--ink3); margin-top: 6px; }
@media (max-width: 820px) { .board { grid-template-columns: repeat(5, 78vw); scroll-snap-type: x mandatory; } .col { scroll-snap-align: start; } }

/* ── today cards + picker ───────────────────────────── */
.tcards { display: flex; flex-direction: column; gap: 8px; }
.tcard { display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); transition: border-color .12s, box-shadow .12s; }
.tcard:hover { border-color: var(--line2); box-shadow: var(--shadow); }
.tcard .cb { margin-top: 4px; width: 17px; height: 17px; border: 1.5px solid var(--line2); border-radius: 5px; cursor: pointer; flex: none; }
.tcard .cb:hover { border-color: var(--ink3); }
.tcard.done .cb { background: var(--ink); border-color: var(--ink); }
.tcard.done .tx { color: var(--ink3); text-decoration: line-through; }
.tcard .body { flex: 1; min-width: 0; }
.tcard .tx { font-weight: 500; letter-spacing: -.01em; }
.tcard .acts { display: flex; gap: 2px; opacity: .5; }
.tcard:hover .acts { opacity: 1; }
.picker { position: relative; margin-top: 10px; }
.pick-res { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--bg); border: 1px solid var(--line2); border-radius: 12px; box-shadow: var(--shadow); padding: 5px; max-height: 50vh; overflow: auto; }
.pr { display: flex; gap: 12px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.pr.on, .pr:hover { background: var(--bg3); }
.pr .kind { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink3); width: 52px; flex: none; padding-top: 3px; }
.pr .pl { flex: 1; min-width: 0; }
.pr .ps { font-size: 12.5px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dialog { width: 100%; max-width: 420px; background: var(--bg); border: 1px solid var(--line2); border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,.25); padding: 18px; }
.dialog .dt { font-weight: 600; margin-bottom: 12px; letter-spacing: -.01em; }
.kcard .w, .item .w { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.item .w { -webkit-line-clamp: 1; }

/* ── goal strip: serves · KPI · win · kill ──────────── */
.goal { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 18px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; transition: border-color .12s; }
.goal:hover { border-color: var(--line2); }
.gc { padding: 11px 14px; min-width: 0; }
.gc + .gc { border-left: 1px solid var(--line); }
.gc .gv { font-size: 14px; font-weight: 500; line-height: 1.4; margin-top: 2px; overflow-wrap: anywhere; }
.gc.empty .gv { color: var(--ink3); font-weight: 400; }
.gc .gs { font-size: 12px; color: var(--ink3); margin-top: 3px; line-height: 1.35; }
.bar { display: block; height: 4px; background: var(--bg3); border-radius: 4px; margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 4px; }
.goal-empty { display: block; width: 100%; text-align: left; margin-top: 18px; padding: 12px 14px; border: 1px dashed var(--line2); border-radius: var(--r); color: var(--ink2); font-size: 14px; }
.goal-empty:hover { border-color: var(--ink3); color: var(--ink); }
.decide { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; padding: 10px 14px; border-radius: var(--r); background: var(--bg2); border: 1px solid var(--line2); font-size: 14px; }
.kcard .kpi { font-size: 12.5px; margin-top: 7px; font-weight: 500; }
.kcard .due { font-size: 12px; margin-top: 6px; color: var(--ink); font-weight: 600; }
@media (max-width: 700px) { .goal { grid-template-columns: 1fr 1fr; } .gc:nth-child(3) { border-left: 0; } .gc:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* ── finance ────────────────────────────────────────── */
.fin-stats { margin-top: 22px; }
.fin-v { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-top: 2px; }
.fin-chart { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 10px; }
.fin-svg { width: 100%; height: 180px; display: block; margin-top: 8px; }
.fin-svg rect { fill: var(--ink3); }
.fin-svg rect.ev { fill: var(--ink); }
.fin-svg rect.neg { fill: none; stroke: var(--ink); stroke-width: .3; stroke-dasharray: 1 .6; }
.fin-svg .zero { stroke: var(--line2); stroke-width: .4; vector-effect: non-scaling-stroke; }
.fin-axis { display: grid; grid-template-columns: repeat(18, 1fr); font-size: 11px; color: var(--ink3); }
.fin-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.fin-amt { font-variant-numeric: tabular-nums; font-weight: 500; }
.fin-amt.neg { color: var(--ink2); }
@media (max-width: 820px) { .fin-cols { grid-template-columns: 1fr; gap: 0; } .fin-stats { grid-template-columns: 1fr 1fr; } }
.fin-cols { margin-top: 18px; }
.fin-box { border: 1px solid var(--line); border-radius: var(--r); padding: 6px 6px 4px; }
.fin-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 10px 8px; font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px; flex-wrap: wrap; }
.frow { display: grid; grid-template-columns: minmax(0, 1fr) 130px 26px; align-items: center; gap: 4px; }
.frow.ex { grid-template-columns: 140px minmax(0, 1fr) 120px 26px; }
.fin-in { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 6px 8px; outline: none; font-size: 14px; }
.fin-in:hover { background: var(--bg2); }
.fin-in:focus { border-color: var(--line2); background: var(--bg); }
.fin-in.amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.fin-in.date { color: var(--ink2); font-size: 13px; }
.fin-x { color: var(--ink3); width: 26px; height: 26px; border-radius: 6px; opacity: 0; }
.frow:hover .fin-x, .fin-x:focus { opacity: 1; }
.fin-x:hover { background: var(--bg2); color: var(--ink); }
.fin-add { display: block; width: 100%; text-align: left; padding: 8px 10px; color: var(--ink3); font-size: 13px; border-radius: 7px; }
.fin-add:hover { color: var(--ink); background: var(--bg2); }
@media (max-width: 820px) {
  .fin-x { opacity: 1; }
  .frow.ex { grid-template-columns: 1fr 26px; grid-template-areas: "d x" "l l" "a a"; padding: 4px 0; border-bottom: 1px solid var(--line); }
  .frow.ex .date { grid-area: d; } .frow.ex .fin-x { grid-area: x; } .frow.ex .fin-in:not(.date):not(.amt) { grid-area: l; } .frow.ex .amt { grid-area: a; text-align: left; }
  .frow { grid-template-columns: minmax(0, 1fr) 110px 26px; }
}

/* ── settings: full-screen sheet ────────────────────── */
.sheet-bg { position: fixed; inset: 0; z-index: 80; background: var(--bg); overflow-y: auto; animation: sheetIn .16s ease-out; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sheet { max-width: 680px; margin: 0 auto; padding: 0 24px calc(60px + env(safe-area-inset-bottom)); }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: calc(18px + env(safe-area-inset-top)) 0 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.sheet-t { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-top: 2px; }
.sg { padding: 26px 0 6px; }
.sg h3 { font-size: 13px; font-weight: 600; margin: 0 0 14px; letter-spacing: -.005em; }
.sg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 14px; }
.sf { grid-column: 1 / -1; display: block; min-width: 0; }
.sf.half { grid-column: auto; }
.sf-k { font-size: 12px; color: var(--ink2); margin-bottom: 6px; font-weight: 500; }
.sf-in { width: 100%; min-height: 42px; padding: 10px 14px; border: 1px solid var(--line2); border-radius: 12px; background: var(--bg); outline: none; font-size: 15px; line-height: 1.45; resize: none; overflow: hidden; display: block; font-family: inherit; transition: border-color .12s, box-shadow .12s; }
.sf-in:hover { border-color: var(--ink3); }
.sf-in:focus { border-color: var(--ink2); box-shadow: 0 0 0 4px var(--sel); }
.sf-in::placeholder { color: var(--ink3); }
input.sf-in[type=date] { -webkit-appearance: none; appearance: none; }
.sheet-meta { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink3); }
@media (max-width: 560px) { .sg-grid { grid-template-columns: 1fr 1fr; } .sheet { padding: 0 18px calc(60px + env(safe-area-inset-bottom)); } }

/* ── dropdown ───────────────────────────────────────── */
.dd-wrap { position: relative; }
.dd { width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border: 1px solid var(--line2); border-radius: 12px; background: var(--bg); font-size: 15px; text-align: left; transition: border-color .12s, box-shadow .12s; }
.dd:hover { border-color: var(--ink3); }
.dd.open { border-color: var(--ink2); box-shadow: 0 0 0 4px var(--sel); }
.dd-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-c { color: var(--ink3); display: inline-flex; transition: transform .15s; }
.dd.open .dd-c { transform: rotate(180deg); }
.dd-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 90; background: var(--bg); border: 1px solid var(--line2); border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.16); padding: 6px; max-height: 300px; overflow-y: auto; min-width: 200px; animation: sheetIn .12s ease-out; }
.dd-i { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 9px; text-align: left; font-size: 14.5px; }
.dd-i:hover { background: var(--bg2); }
.dd-i.on { background: var(--bg3); font-weight: 500; }
.dd-i > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.dd-s { font-size: 12px; color: var(--ink3); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-k { color: var(--ink); font-size: 13px; }

/* ── plan cards: wider, with a time bar and a KPI bar ── */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.pcard { border: 1px solid var(--line2); border-radius: 14px; padding: 16px 18px 14px; cursor: pointer; background: linear-gradient(180deg, var(--bg2), var(--bg) 70%); transition: box-shadow .12s, border-color .12s; display: flex; flex-direction: column; gap: 8px; }
.pcard:hover { box-shadow: var(--shadow); border-color: var(--ink3); }
.pcard.closed { opacity: .55; }
.pc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pc-t { font-size: 17px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
.pc-area { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink3); white-space: nowrap; padding-top: 4px; }
.pc-why { font-size: 13.5px; color: var(--ink2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-row { display: grid; grid-template-columns: 38px 1fr; align-items: baseline; gap: 2px 8px; font-size: 13px; }
.pc-row .label { font-size: 10px; }
.pc-row .bar { grid-column: 2; margin-top: 4px; }
.pc-row .bar.t i { background: var(--ink3); }
.pc-v { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-foot { font-size: 12px; color: var(--ink3); border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; }
.pc-foot b { color: var(--ink); }
.choice { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── talk list + conversation ───────────────────────── */
.conv-title { width: 100%; border: 0; outline: none; background: transparent; font-size: 22px; font-weight: 600; letter-spacing: -.02em; padding: 2px 0; border-radius: 6px; }
.talk .conv-title { font-size: 17px; margin-top: 4px; }
.conv-title:hover { background: var(--bg2); }
.conv-title:focus { background: var(--bg2); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.tagp { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink3); }
.pick-list { margin-top: 10px; max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; }
.pick-list .pr { width: 100%; text-align: left; }
.item .icon { color: var(--ink2); }
.conv-acts { display: inline-flex; gap: 2px; flex: none; }
.btn.ib-s { width: 30px; padding: 0; justify-content: center; }
.item .conv-acts { opacity: 0; transition: opacity .12s; }
.item:hover .conv-acts { opacity: 1; }
@media (hover: none) { .item .conv-acts { opacity: 1; } }

/* ── richer text: headings, quote, divider, numbers, tables ── */
.blk.h1 .txt { font-size: 26px; letter-spacing: -.025em; line-height: 1.25; padding-top: 22px; }
.blk.h2 .txt, .blk.h3 .txt { font-size: 19px; letter-spacing: -.018em; line-height: 1.3; padding-top: 18px; }
.blk.h4 .txt { font-size: 15.5px; padding-top: 12px; }
.blk.quote .gut, .blk.hr .gut { display: none; }
.blk.quote .txt { border-left: 2.5px solid var(--ink); padding: 2px 0 2px 14px; margin: 4px 0; color: var(--ink2); font-size: 16px; }
.blk.hr { min-height: 22px; }
.blk.hr .txt { min-height: 22px; position: relative; color: transparent; caret-color: transparent; }
.blk.hr .txt::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line2); }
.blk .bul.num { width: auto; min-width: 20px; height: 20px; border-radius: 6px; font-size: 13.5px; color: var(--ink2); font-variant-numeric: tabular-nums; padding: 0 2px; }
.blk .bul.num::after { display: none; }
.blk.tbl .txt:not([data-raw]) { background: none; border: 0; padding: 0; white-space: normal; font: inherit; }
.md-table { border-collapse: collapse; width: 100%; margin: 6px 0; font-size: 14px; }
.md-table th, .md-table td { border: 1px solid var(--line2); padding: 7px 10px; text-align: left; vertical-align: top; }
.md-table th { background: var(--bg2); font-weight: 600; }
.blk .txt i { font-style: italic; }

/* "/" menu */
.suggest.slash { width: 270px; max-height: 360px; overflow-y: auto; padding: 5px; }
.suggest .sl { display: flex; align-items: center; gap: 10px; padding: 7px 9px; }
.sl-i { width: 26px; height: 26px; border: 1px solid var(--line2); border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--ink2); flex: none; background: var(--bg); }
.sl-h { margin-left: auto; font-size: 11.5px; color: var(--ink3); font-family: var(--mono); }

/* selection toolbar */
.seltb { position: fixed; z-index: 95; display: flex; gap: 2px; padding: 4px; background: var(--ink); color: var(--bg); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.seltb button { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 7px; color: var(--bg); font-size: 13px; font-weight: 500; }
.seltb button:hover { background: color-mix(in srgb, var(--bg) 18%, transparent); }
.seltb .b { font-weight: 800; } .seltb .i { font-style: italic; font-family: Georgia, serif; }

/* ── editable tables ────────────────────────────────── */
.blk.tbl .gut { display: none; }
.tbl-wrap { width: 100%; overflow-x: auto; margin: 6px 0; }
.md-table.edit .cell { outline: none; min-width: 90px; transition: background .1s; }
.md-table.edit .cell:focus { background: var(--bg2); box-shadow: inset 0 0 0 1.5px var(--ink3); }
.tbl-ctl { display: flex; gap: 4px; margin-top: 4px; opacity: 0; transition: opacity .12s; flex-wrap: wrap; }
.blk.tbl:hover .tbl-ctl, .blk.tbl:focus-within .tbl-ctl { opacity: 1; }
@media (hover: none) { .tbl-ctl { opacity: 1; } }
.tbl-ctl button { font-size: 12px; color: var(--ink3); padding: 3px 8px; border-radius: 6px; }
.tbl-ctl button:hover { background: var(--bg2); color: var(--ink); }
.seltb .sep { width: 1px; background: color-mix(in srgb, var(--bg) 25%, transparent); margin: 6px 3px; }
