/* PhD Command Centre — calm, professional, light & dark */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede7;
  --border: #dedad1;
  --text: #1f2328;
  --muted: #61656b;
  --faint: #8a8d92;
  --accent: #2f6b6e;
  --accent-ink: #ffffff;
  --accent-soft: #e2eeee;
  --warn: #9a5b00;
  --warn-soft: #fbf0dc;
  --danger: #a33a32;
  --danger-soft: #f8e4e1;
  --ok: #2e7044;
  --ok-soft: #e1f0e5;
  --ai: #6b4fa0;
  --ai-soft: #efe9f8;
  --shadow: 0 1px 2px rgba(20, 20, 20, .05), 0 4px 16px rgba(20, 20, 20, .05);
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16191d; --surface: #1e2227; --surface-2: #262b31; --border: #343a42;
    --text: #e6e4df; --muted: #a3a7ad; --faint: #7d828a;
    --accent: #6fb3b5; --accent-ink: #0f1a1b; --accent-soft: #1f3536;
    --warn: #e0a54a; --warn-soft: #3a2e1b; --danger: #e48a80; --danger-soft: #3b2220;
    --ok: #7cc493; --ok-soft: #1f3326; --ai: #b9a2e6; --ai-soft: #2c2540;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16191d; --surface: #1e2227; --surface-2: #262b31; --border: #343a42;
  --text: #e6e4df; --muted: #a3a7ad; --faint: #7d828a;
  --accent: #6fb3b5; --accent-ink: #0f1a1b; --accent-soft: #1f3536;
  --warn: #e0a54a; --warn-soft: #3a2e1b; --danger: #e48a80; --danger-soft: #3b2220;
  --ok: #7cc493; --ok-soft: #1f3326; --ai: #b9a2e6; --ai-soft: #2c2540;
  --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; font-family: var(--font); }
p { margin: 0 0 .75rem; }
kbd { font: 11px var(--mono); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; color: var(--muted); background: var(--surface); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Layout */
.app { display: grid; grid-template-columns: 210px 1fr; grid-template-rows: auto 1fr; min-height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--serif); font-weight: 600; font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); position: relative; flex: none; }
.brand-mark::after { content: ""; position: absolute; inset: 8px 6px; border-top: 3px solid var(--accent-ink); border-bottom: 3px solid var(--accent-ink); opacity: .9; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.save-status { font-size: 12px; color: var(--muted); white-space: nowrap; }
.save-status.warn { color: var(--warn); }
.sidebar { padding: 16px 10px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; position: sticky; top: 53px; height: calc(100vh - 53px); overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text); font-size: 14px; }
.nav-item:hover { background: var(--surface-2); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item .ico { width: 18px; text-align: center; opacity: .8; }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 14px 10px 4px; }
.nav-item.soon { color: var(--faint); pointer-events: none; font-size: 13px; }
.nav-item.soon small { margin-left: auto; font-size: 10px; }
.view { padding: 24px 28px 80px; min-width: 0; max-width: 1280px; outline: none; }

/* Buttons & inputs */
.btn { font: inherit; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.icon { padding: 6px 9px; min-width: 34px; justify-content: center; }
.btn.small { padding: 3px 8px; font-size: 12.5px; }
.btn.danger { color: var(--danger); }
.btn.ai { color: var(--ai); border-color: var(--ai-soft); background: var(--ai-soft); }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; width: 100%; }
textarea { resize: vertical; min-height: 70px; line-height: 1.45; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
label.field > span { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; } .span-all { grid-column: 1 / -1; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; }

/* Cards */
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); margin: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.card h2 .count { font-family: var(--font); font-size: 12px; color: var(--muted); font-weight: 500; }
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
.stat { font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1.1; }
.stat small { font-size: 1rem; color: var(--muted); font-weight: 400; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.list > li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.empty { color: var(--faint); font-size: 13.5px; padding: 6px 0; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; border: 1px solid transparent; }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.ai { background: var(--ai-soft); color: var(--ai); }
button.pill { cursor: pointer; font: inherit; font-size: 11.5px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 12.5px; padding: 2px 10px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip .n { color: var(--faint); margin-left: 4px; }
.banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius); background: var(--warn-soft); color: var(--text); margin-bottom: 16px; border: 1px solid var(--border); }
.banner.info { background: var(--accent-soft); }
.star { background: none; border: 0; cursor: pointer; font-size: 17px; color: var(--faint); padding: 0 2px; line-height: 1; }
.star.on { color: #c58a00; }
.check { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.done-text { text-decoration: line-through; color: var(--faint); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; font-size: 14px; white-space: nowrap; background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; font-family: inherit; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface-2); position: sticky; top: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
td.title-cell { min-width: 220px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.filters select, .filters input { width: auto; min-width: 120px; }
.filters input[type="search"] { min-width: 200px; flex: 1; max-width: 340px; }

/* Pass stepper */
.passes { display: inline-flex; gap: 3px; align-items: center; }
.pass { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border); font-size: 11px; display: inline-grid; place-items: center; color: var(--faint); background: var(--surface); font-family: var(--font); }
button.pass { cursor: pointer; padding: 0; }
.pass.done { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pass.target { border-style: dashed; border-color: var(--accent); color: var(--accent); }
.pass.off { opacity: .35; }
.prio { letter-spacing: 1px; color: var(--accent); font-size: 12px; white-space: nowrap; }
.prio .o { color: var(--border); }

/* Matrix */
.matrix td, .matrix th { min-width: 160px; max-width: 260px; }
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 170px; }
.matrix th:first-child { background: var(--surface-2); z-index: 2; }
.matrix td.cell { cursor: pointer; font-size: 12.5px; color: var(--text); }
.matrix td.cell:hover { background: var(--accent-soft); }
.matrix td.cell.emptycell { color: var(--faint); }
.matrix tr.gaps td { background: var(--surface-2); font-size: 12px; }
.th-theme { display: flex; gap: 4px; align-items: flex-start; justify-content: space-between; text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--text); }
.th-theme .kind { font-size: 10px; color: var(--muted); text-transform: uppercase; display: block; }

/* Source detail */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.section { margin-bottom: 16px; }
.section > h2 { font-size: 1.02rem; margin-bottom: 12px; }
.apa-preview { font-family: var(--serif); font-size: 15px; padding: 12px 14px; background: var(--surface-2); border-radius: 8px; padding-left: 2.2em; text-indent: -1.5em; line-height: 1.6; overflow-wrap: anywhere; }
.aside-sticky { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 14px; }
.ai-badge { display: inline-flex; gap: 4px; align-items: center; font-size: 11px; color: var(--ai); background: var(--ai-soft); border-radius: 99px; padding: 0 4px 0 8px; font-weight: 600; }
.ai-badge button { font: inherit; font-size: 11px; border: 0; background: var(--surface); color: var(--ai); border-radius: 99px; padding: 0 7px; cursor: pointer; }
.is-ai input, .is-ai textarea, .is-ai select { border-color: var(--ai); background: color-mix(in srgb, var(--ai-soft) 50%, var(--surface)); }
.quote-row { display: grid; grid-template-columns: 1fr 90px auto; gap: 8px; margin-bottom: 8px; align-items: start; }
.quote-row textarea { min-height: 54px; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 18, 22, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(0,0,0,.25); border: 1px solid var(--border); }
.modal.wide { max-width: 820px; }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.search-results { max-height: 55vh; overflow-y: auto; margin: 0 -18px; }
.search-results a { display: block; padding: 8px 18px; color: var(--text); border-top: 1px solid var(--border); }
.search-results a:hover, .search-results a.sel { background: var(--accent-soft); text-decoration: none; }
.search-results .kind { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.prompt-box { font: 12.5px/1.5 var(--mono); min-height: 160px; }

/* Toast */
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 8px 16px; border-radius: 8px; font-size: 14px; box-shadow: var(--shadow); }

/* Project cards */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.proj-card h3 { font-family: var(--serif); font-size: 1.05rem; margin-bottom: 4px; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 4px 10px; font-size: 13px; margin-top: 8px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.timeline-year { font-family: var(--serif); font-size: 1.3rem; margin: 18px 0 6px; color: var(--accent); }

/* Responsive */
@media (max-width: 1000px) {
  .detail { grid-template-columns: 1fr; }
  .aside-sticky { position: static; }
  .c4, .c5, .c6, .c7, .c8 { grid-column: span 12; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .topbar { padding: 8px 16px; gap: 6px; }
  .brand-name, .hide-sm, .save-status { display: none; }
  .sidebar { position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: auto; flex-direction: row; justify-content: space-around; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); background: var(--surface); border-right: 0; border-top: 1px solid var(--border); z-index: 30; overflow: visible; }
  .nav-item { flex-direction: column; gap: 0; font-size: 11px; padding: 4px 8px; }
  .nav-item .ico { font-size: 17px; }
  .nav-sep, .nav-item.soon, .nav-item.desk { display: none; }
  .view { padding: 16px 16px 90px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .hide-mobile { display: none; }
  .filters select, .filters input { min-width: 0; flex: 1 1 140px; }
  .quote-row { grid-template-columns: 1fr 70px; }
  .quote-row .btn { grid-column: span 2; justify-self: end; }
  h1 { font-size: 1.35rem; }
}
@media print { .topbar, .sidebar { display: none; } .app { display: block; } }

/* ---------- Stage 2: journal, linked notes, argument map ---------- */
.show-mobile { display: none; }
.nav-item .short { display: none; }
.journal { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
.journal-list { min-width: 0; }
.journal-editor { min-width: 0; position: sticky; top: 72px; }
.feed { display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 300px); overflow-y: auto; padding-right: 4px; }
.feed-date { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); padding: 10px 4px 4px; }
.feed-item { display: flex; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); border: 1px solid transparent; }
.feed-item:hover { background: var(--surface); border-color: var(--border); text-decoration: none; }
.feed-item.sel { background: var(--accent-soft); border-color: var(--accent); }
.feed-item .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.feed-item .fs { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kind-ico { width: 24px; height: 24px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 13px; flex: none; background: var(--surface-2); color: var(--muted); }
.k-idea { background: var(--accent-soft); color: var(--accent); }
.k-decision { background: var(--warn-soft); color: var(--warn); }
.k-reflexive { background: var(--ai-soft); color: var(--ai); }
.k-feedback { background: var(--ok-soft); color: var(--ok); }
.k-inbox { background: var(--danger-soft); color: var(--danger); }
.note-title { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 4px 0; background: transparent; }
.note-title:focus { outline: none; border-bottom-color: var(--accent); }
.note-body { min-height: 220px; font-size: 15px; line-height: 1.6; }
.note-preview { font-size: 15px; line-height: 1.65; padding: 4px 2px; min-height: 120px; }
.note-preview h3, .note-preview h4, .note-preview h5 { font-family: var(--serif); margin: 12px 0 4px; }
.note-preview blockquote { border-left: 3px solid var(--border); margin: 6px 0; padding-left: 12px; color: var(--muted); }
.note-preview ul { margin: 4px 0 10px; padding-left: 22px; }
a.wikilink { background: var(--accent-soft); padding: 0 4px; border-radius: 4px; }
a.wikilink.missing { background: none; border-bottom: 1px dashed var(--muted); color: var(--muted); border-radius: 0; }
.ac-box { position: relative; z-index: 5; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); margin-top: 4px; max-height: 260px; overflow-y: auto; }
.ac-box button { display: flex; gap: 6px; align-items: center; width: 100%; text-align: left; font: inherit; font-size: 13.5px; padding: 6px 10px; background: none; border: 0; color: var(--text); cursor: pointer; }
.ac-box button.sel, .ac-box button:hover { background: var(--accent-soft); }
.links-panel h3 { margin-bottom: 4px; }
.tree { padding: 6px 0; }
.tree-row { display: flex; gap: 8px; align-items: flex-start; padding: 7px 12px; color: var(--text); font-size: 14px; border-left: 3px solid transparent; }
.tree-row:hover { background: var(--surface-2); text-decoration: none; }
.tree-row.sel { background: var(--accent-soft); border-left-color: var(--accent); }
.tree-row .grow { flex: 1; min-width: 0; }
.tree-row.t-rebuttal { font-style: italic; }
.sdot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; margin-top: 6px; }
.pill .sdot, .filters .sdot, .list .sdot { margin-top: 0; vertical-align: middle; }
.s-strong { background: var(--ok); } .s-thin { background: var(--warn); } .s-missing { background: transparent; border: 2px solid var(--danger); }
.pill.ct-claim { background: var(--accent-soft); color: var(--accent); }
.pill.ct-assumption { background: var(--ai-soft); color: var(--ai); }
.pill.ct-rebuttal { background: var(--danger-soft); color: var(--danger); }
.ev-row { display: flex; gap: 8px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); }
.ev-row .grow { flex: 1; min-width: 0; }
.reasons { margin: 0 0 10px; padding: 8px 12px 8px 26px; background: var(--warn-soft); border-radius: 8px; }
@media (max-width: 1000px) {
  .journal { grid-template-columns: 1fr; }
  .journal-editor { position: static; }
  .journal.has-sel .journal-list { display: none; }
  .journal:not(.has-sel) .journal-editor { display: none; }
  .show-mobile { display: inline-flex; }
  .feed { max-height: none; }
}
@media (max-width: 760px) {
  .nav-item .long { display: none; }
  .nav-item .short { display: inline; }
  .nav-item { padding: 4px 4px; }
}

/* ---------- Stage 3: kanban, roadmap timeline, writing ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kcol { background: var(--surface-2); border-radius: var(--radius); padding: 8px; min-height: 120px; display: flex; flex-direction: column; gap: 8px; border: 2px dashed transparent; }
.kcol.over { border-color: var(--accent); background: var(--accent-soft); }
.kcol-head { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 2px 4px; }
.kcol-head .count { color: var(--faint); margin-left: 4px; }
.kcard { padding: 10px 12px; cursor: grab; }
.kcard.dragging { opacity: .5; }
.kcard h3 { font-size: .95rem; }
.kcard .kv { grid-template-columns: 80px 1fr; font-size: 12px; }
.touch-only { display: none; margin-top: 8px; font-size: 12.5px; }
@media (hover: none) { .touch-only { display: block; } }
.gantt-wrap { padding: 4px 0; }
.gantt { position: relative; font-size: 12.5px; }
.grow-row { display: grid; grid-template-columns: 220px 1fr; align-items: center; min-height: 26px; }
.glabel { padding: 2px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.gtrack { position: relative; height: 26px; border-left: 1px solid var(--border); }
.ghead .gtrack { height: 28px; border-bottom: 1px solid var(--border); }
.gtick { position: absolute; top: 0; height: 100%; border-left: 1px solid var(--border); padding: 5px 4px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.gproj { font-weight: 600; padding: 10px 10px 2px; font-family: var(--serif); border-top: 1px solid var(--border); }
.gtoday { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); opacity: .5; z-index: 1; }
.gbar { position: absolute; top: 6px; height: 14px; border-radius: 4px; overflow: hidden; background: color-mix(in srgb, var(--accent) 35%, var(--surface)); }
.gbar i { display: block; height: 100%; background: var(--accent); }
.gbar.s-risk { background: color-mix(in srgb, var(--warn) 35%, var(--surface)); } .gbar.s-risk i { background: var(--warn); }
.gbar.s-late { background: color-mix(in srgb, var(--danger) 35%, var(--surface)); } .gbar.s-late i { background: var(--danger); }
.gbar.s-done { background: var(--ok); } .gbar.s-done i { background: var(--ok); }
.gdia { position: absolute; top: 3px; transform: translateX(-50%); font-size: 14px; color: var(--accent); z-index: 2; }
.gdia.s-late { color: var(--danger); } .gdia.s-risk { color: var(--warn); } .gdia.s-done { color: var(--ok); }
.gbar-key { display: inline-block; width: 14px; height: 8px; border-radius: 3px; margin: 0 2px 0 8px; background: var(--accent); }
.gbar-key.s-risk { background: var(--warn); } .gbar-key.s-late { background: var(--danger); } .gbar-key.s-done { background: var(--ok); }
.heatmap { display: grid; grid-template-columns: repeat(15, 1fr); grid-template-rows: repeat(7, 1fr); gap: 3px; max-width: 320px; }
.hm { display: inline-block; aspect-ratio: 1; min-width: 10px; border-radius: 2px; background: var(--surface-2); }
.row .hm { width: 11px; }
.hm.l1 { background: color-mix(in srgb, var(--ok) 30%, var(--surface)); }
.hm.l2 { background: color-mix(in srgb, var(--ok) 55%, var(--surface)); }
.hm.l3 { background: color-mix(in srgb, var(--ok) 80%, var(--surface)); }
.hm.l4 { background: var(--ok); }
.hm.lf { background: transparent; }
@media (max-width: 760px) { .grow-row { grid-template-columns: 140px 1fr; } .kcol.kempty { display: none; } .kanban { grid-auto-columns: 82%; } }
