:root {
  color-scheme: light;
  --bg: #dcebfb; --surface-1: rgba(255,255,255,.8); --surface-2: rgba(24,72,140,.07); --solid: #f6faff; --field: #ffffff; --line: rgba(22,60,110,.14); --line-strong: rgba(22,60,110,.3);
  --text-primary: #142033; --text-secondary: #46566c; --text-muted: #64748b;
  --series-1: #1a78f2; --series-2: #e0762b; --series-3: #0f9d58; --series-4: #c98500; --on-brand: #fff;
  --good: #0f9d58; --warn: #a86f00; --critical: #d63a31;
  --radius: 16px; --radius-sm: 11px;
  --glass: rgba(255,255,255,.58); --float: rgba(248,251,255,.86); --glass-blur: blur(26px) saturate(180%);
  --glass-edge: inset 0 1px 0 rgba(255,255,255,.85), inset 0 0 0 1px rgba(255,255,255,.45);
  --shadow-card: 0 1px 1px rgba(16,52,104,.05), 0 10px 28px -14px rgba(16,52,104,.22);
  --shadow-pop: 0 2px 6px rgba(16,52,104,.08), 0 28px 60px -20px rgba(16,52,104,.38);
  --btn-gloss: linear-gradient(to bottom, rgba(255,255,255,.34) 0, rgba(255,255,255,.1) 16px, rgba(255,255,255,0) 17px, rgba(0,20,60,.06) 100%);
  --btn-sheen: inset 0 1px 0 rgba(255,255,255,.5), inset 0 -1px 0 rgba(0,20,60,.12); --btn-lift: 0 1px 1px rgba(16,52,104,.14), 0 4px 12px -2px rgba(16,52,104,.2);
  --scrim: rgba(18,52,100,.32);
  --ground: linear-gradient(180deg, rgba(232,243,254,.38) 0, rgba(236,245,254,.7) 34%, rgba(242,248,254,.86) 100%), url("/art/sky.jpg") center top / cover no-repeat, linear-gradient(180deg, #2f8bec 0, #7dbdf8 44%, #d9ebfc 100%);
}
/* Night swaps the materials only; every rule below reads tokens. */
html.dark {
  color-scheme: dark;
  --bg: #070d19; --surface-1: rgba(22,32,53,.82); --surface-2: rgba(255,255,255,.07); --solid: #111a2c; --field: #16213a; --line: rgba(160,190,235,.16); --line-strong: rgba(160,190,235,.34);
  --text-primary: #eef3fb; --text-secondary: #a9b6cb; --text-muted: #8392aa;
  --series-1: #4a9bff; --series-2: #f08a45; --series-3: #34c98a; --series-4: #f2c14e; --on-brand: #06122a;
  --good: #34c98a; --warn: #f2c14e; --critical: #f4695c;
  --glass: rgba(10,17,32,.6); --float: rgba(16,24,42,.9);
  --glass-edge: inset 0 1px 0 rgba(255,255,255,.12), inset 0 0 0 1px rgba(255,255,255,.04);
  --shadow-card: 0 1px 2px rgba(0,0,0,.4), 0 12px 30px -16px rgba(0,0,0,.7); --shadow-pop: 0 2px 8px rgba(0,0,0,.4), 0 30px 64px -20px rgba(0,0,0,.85);
  --btn-gloss: linear-gradient(to bottom, rgba(255,255,255,.15) 0, rgba(255,255,255,.04) 16px, rgba(255,255,255,0) 17px, rgba(0,0,0,.16) 100%);
  --btn-sheen: inset 0 1px 0 rgba(255,255,255,.17), inset 0 -1px 0 rgba(0,0,0,.34); --btn-lift: 0 1px 1px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.34);
  --scrim: rgba(2,6,14,.6);
  --ground: linear-gradient(180deg, rgba(7,13,25,.5) 0, rgba(7,13,25,.72) 34%, rgba(7,13,25,.88) 100%), url("/art/night.jpg") center top / cover no-repeat, linear-gradient(180deg, #0a1730 0, #12244a 50%, #0a1120 100%);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; background: var(--ground); }
body { background: var(--bg); color: var(--text-primary); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif; -webkit-text-size-adjust: 100%; }
a { color: var(--series-1); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; } h2 { font-size: 15px; margin: 0 0 10px; } h3 { font-size: 13px; margin: 0 0 6px; color: var(--text-secondary); font-weight: 600; }
.muted { color: var(--text-muted); } .small { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .grow { flex: 1; } .spacer { flex: 1; }

.shell { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.side { background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge); border-right: 1px solid var(--line); padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand { font-weight: 700; font-size: 17px; padding: 4px 10px 14px; letter-spacing: .2px; } .brand span { color: var(--series-1); }
.side a.nav { display: flex; gap: 9px; align-items: center; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-secondary); }
.side a.nav:hover { background: var(--surface-2); text-decoration: none; } .side a.nav.on { background: var(--series-1); color: var(--on-brand); font-weight: 600; box-shadow: var(--btn-sheen), var(--btn-lift); }
.side .sect { margin: 14px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--text-muted); }
.side .who { margin-top: auto; padding: 10px; border-top: 1px solid var(--line); }
.main { padding: 22px 28px 60px; max-width: 1240px; width: 100%; }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }

.grid { display: grid; gap: 14px; } .g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; box-shadow: var(--glass-edge), var(--shadow-card); }
.card:has(> table) { overflow-x: auto; }
.card.click { cursor: pointer; } .card.click:hover { border-color: var(--line-strong); }
.stat .n { font-size: 28px; font-weight: 700; line-height: 1.1; } .stat .l { color: var(--text-secondary); font-size: 12px; margin-top: 2px; } .stat .s { color: var(--text-muted); font-size: 12px; }
.bar-track { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; } .bar-fill { height: 100%; background: var(--series-1); border-radius: 4px; }

button, .btn { font: inherit; border: 1px solid var(--line); background: var(--btn-gloss), var(--surface-1); color: var(--text-primary); border-radius: 99px; padding: 7px 14px; cursor: pointer; box-shadow: var(--btn-sheen); }
button:hover { border-color: var(--line-strong); } button.primary { background: var(--btn-gloss), var(--series-1); border-color: transparent; color: var(--on-brand); font-weight: 600; box-shadow: var(--btn-sheen), var(--btn-lift); } button.danger { color: var(--critical); }
button.ghost { background: transparent; box-shadow: none; } button.sm { padding: 3px 8px; font-size: 12px; } button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; color: var(--text-primary); background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--series-1); } textarea { min-height: 84px; resize: vertical; }
label { display: block; font-size: 12px; color: var(--text-secondary); margin: 0 0 4px; } .field { margin-bottom: 12px; } .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; } .filters > * { width: auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; padding: 2px; background: var(--surface-2); max-width: 100%; overflow-x: auto; } .seg button { border: 0; background: transparent; box-shadow: none; color: var(--text-secondary); white-space: nowrap; } .seg button.on { background: var(--solid); color: var(--text-primary); font-weight: 600; box-shadow: var(--btn-lift); }

table { width: 100%; border-collapse: collapse; } th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); font-weight: 600; padding: 6px 10px; border-bottom: 1px solid var(--line); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; } tr.click { cursor: pointer; } tr.click:hover td { background: var(--surface-2); } tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--line); white-space: nowrap; }
.pill.good { color: var(--good); } .pill.warn { color: var(--warn); } .pill.bad { color: var(--critical); } .pill.blue { color: var(--series-1); }
.pill.good, .pill.warn, .pill.bad, .pill.blue { border-color: color-mix(in srgb, currentColor 35%, transparent); background: color-mix(in srgb, currentColor 10%, transparent); }
.handle { font-weight: 600; } .kind-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }
.feed-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; } .feed-item:last-child { border-bottom: 0; } .feed-item:hover { background: var(--surface-2); margin: 0 -8px; padding: 9px 8px; border-radius: 6px; }
.feed-item .t { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.empty { color: var(--text-muted); padding: 18px 4px; text-align: center; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.pre { white-space: pre-wrap; word-break: break-word; }

.overlay { position: fixed; inset: 0; background: var(--scrim); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow: auto; z-index: 50; }
.modal { background: var(--float); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: 1px solid var(--line); border-radius: 20px; width: 100%; max-width: 600px; padding: 20px; box-shadow: var(--glass-edge), var(--shadow-pop); }
.modal.wide { max-width: 760px; } .modal h2 { font-size: 17px; margin-bottom: 14px; } .modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.choose { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .choose .card { cursor: pointer; } .choose .card:hover { border-color: var(--series-1); } .choose b { display: block; margin-bottom: 2px; }
.notice { --c: var(--warn); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 12%, var(--solid)); color: color-mix(in srgb, var(--c) 55%, var(--text-primary)); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.notice.bad { --c: var(--critical); } .notice.ok { --c: var(--good); }
.err { color: var(--critical); font-size: 13px; min-height: 18px; margin-top: 4px; }
.rev { border-left: 2px solid var(--line); padding: 2px 0 10px 12px; margin-left: 4px; } .rev b { font-weight: 600; }
.diff { font-size: 12.5px; color: var(--text-secondary); } .diff del { color: var(--critical); } .diff ins { color: var(--good); text-decoration: none; }

.chart svg { display: block; width: 100%; height: auto; overflow: visible; } .chart text { fill: var(--text-muted); font-size: 10.5px; }
.chart .bar { fill: var(--series-1); } .chart .bar.c2 { fill: var(--series-2); } .chart .bar.c3 { fill: var(--series-3); } .chart .hit { fill: transparent; } .chart .hit:hover + .bar, .chart g:hover .bar { filter: brightness(1.25); }
.chart .gridline { stroke: var(--line); stroke-width: 1; } .chart .marker { fill: var(--series-2); stroke: var(--solid); stroke-width: 2; cursor: pointer; } .chart .mline { stroke: var(--series-2); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.tip { position: fixed; z-index: 99; pointer-events: none; background: var(--solid); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 9px; font-size: 12px; max-width: 280px; box-shadow: var(--shadow-pop); }
.tip b { display: block; } .legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-secondary); margin-top: 6px; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.stage { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; } .stage-col { min-width: 0; } .stage-head { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.legend i.sw.c2 { background: var(--series-2); } .legend i.sw.c3 { background: var(--series-3); } .feat { margin-bottom: 8px; padding: 12px; }
.fu { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 8px; cursor: pointer; min-width: 0; } .fu:hover { border-color: var(--line-strong); } .fu .clip { max-width: 100%; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; } .login .card { width: 100%; max-width: 360px; padding: 26px; }
.steps { display: flex; gap: 6px; margin-bottom: 16px; } .steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-2); } .steps span.on { background: var(--series-1); }

.topbar { display: none; } .theme { padding: 5px 9px; line-height: 1; } .side .close { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .head > :first-child { flex: 1 1 100%; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-bottom: 1px solid var(--line); box-shadow: var(--glass-edge); }
  .topbar .brand { padding: 0; } .topbar .menu { padding: 6px 11px; font-size: 16px; line-height: 1; }
  .side { position: fixed; z-index: 45; top: 0; bottom: 0; left: 0; width: min(290px, 84vw); height: auto; background: var(--float); border-right: 1px solid var(--line); box-shadow: var(--shadow-pop); transform: translateX(-105%); transition: transform .22s ease; padding-top: max(16px, env(safe-area-inset-top)); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .side a.nav { padding: 11px 12px; font-size: 15px; } .side .close { display: block; position: absolute; top: max(12px, env(safe-area-inset-top)); right: 10px; }
  .shell.open .side { transform: none; } .shell.open::after { content: ''; position: fixed; inset: 0; z-index: 40; background: var(--scrim); }
  .main { padding: 14px 14px calc(70px + env(safe-area-inset-bottom)); } .head { gap: 8px; margin-bottom: 14px; } h1 { font-size: 19px; }
  .g2, .g3, .g4, .stage { grid-template-columns: 1fr 1fr !important; } .fields { grid-template-columns: 1fr; }
  .main .grid[style*="minmax(240px"] { grid-template-columns: 1fr !important; }
  .card:has(> table) table { min-width: 560px; } .clip { max-width: 56vw; }
  input, select, textarea { font-size: 16px; } button { min-height: 36px; } button.sm { min-height: 30px; }
  .filters > * { flex: 1 1 140px; } .filters > .seg { flex: 0 1 auto; }
}
@media (max-width: 560px) {
  .g2, .g3, .stage { grid-template-columns: 1fr !important; } .g4 { gap: 10px; } .card { padding: 13px; } .stat .n { font-size: 23px; } .choose { grid-template-columns: 1fr; }
  .overlay { padding: 0; align-items: flex-end; } .modal, .modal.wide { max-width: none; border-radius: 22px 22px 0 0; max-height: 92dvh; overflow: auto; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .modal .actions { position: sticky; bottom: -18px; margin: 8px -16px -18px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--solid); border-top: 1px solid var(--line); } .modal .actions button { flex: 1; }
  .feed-item { flex-wrap: wrap; } .legend { flex-wrap: wrap; gap: 6px 14px; }
}
.howto .step { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: color-mix(in srgb, var(--series-1) 18%, transparent); color: var(--series-1); }
.howto p { line-height: 1.5; }
.live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); margin-right: 8px; vertical-align: middle; } .live-dot.on { background: #22c55e; animation: live-pulse 1.6s ease-out infinite; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 100% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } }
@media (max-width: 760px) { .card:has(> table) table.fit { min-width: 0; } }
.speaker { padding: 8px 0; border-bottom: 1px solid var(--line); }
.speaker .row input { flex: 1; }
.speaker textarea { margin-top: 6px; width: 100%; }
.chart .baseline { fill: none; stroke: var(--text-secondary); stroke-width: 1.5; stroke-dasharray: 4 3; }
.sw.line { background: none !important; border-top: 2px dashed var(--text-secondary); height: 0 !important; }
tr.on td { background: color-mix(in srgb, var(--series-1) 8%, transparent); }
.subtabs { display: flex; gap: 4px; margin: -4px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 99px; color: var(--text-secondary); white-space: nowrap; font-size: 13.5px; }
.subtabs a:hover { background: var(--surface-2); text-decoration: none; } .subtabs a.on { background: var(--surface-2); color: var(--text-primary); font-weight: 600; box-shadow: var(--btn-lift); }
.subtabs .pill { padding: 0 6px; font-size: 11px; }
.side .bell { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; margin-top: 8px; }
.crumbs { margin-bottom: 6px; color: var(--text-muted); }
.feed-item.unread { background: color-mix(in srgb, var(--series-1) 8%, transparent); border-radius: var(--radius-sm); }
.overdue { color: var(--bad); font-weight: 600; }
.click { cursor: pointer; } .nowrap { white-space: nowrap; } .pre { white-space: pre-wrap; word-break: break-word; }
.clip2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card.inner { padding: 10px 12px; box-shadow: none; }
.ws-head { display: flex; align-items: center; margin: 4px 0 10px; font-size: 15px; }
.kindbox { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; margin: 8px 0; } .kindbox summary, details summary { cursor: pointer; font-weight: 600; margin: 4px 0; }
label.check { display: flex; gap: 6px; align-items: center; margin: 6px 0; } label.check input { width: auto; }
.kanban { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.kanban .col { background: var(--surface-2); border-radius: var(--radius); padding: 8px; min-height: 200px; scroll-snap-align: start; border: 2px dashed transparent; }
.kanban .col.over { border-color: var(--series-1); } .col-head { margin: 2px 4px 8px; }
.kcard { background: var(--solid); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 10px; margin-bottom: 8px; cursor: pointer; box-shadow: var(--btn-lift); } .kcard.late { border-left: 3px solid var(--bad); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 11px; text-transform: uppercase; color: var(--text-muted); padding: 4px; }
.cal-day { min-height: 96px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 4px; overflow: hidden; } .cal-day.out { opacity: .45; } .cal-day.today { outline: 2px solid var(--series-1); }
.cal-n { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.cal-item { display: block; font-size: 11.5px; padding: 1px 5px; margin-bottom: 2px; border-radius: 4px; background: var(--solid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.cal-item.done { text-decoration: line-through; opacity: .6; } .cal-item.late { color: var(--bad); } .cal-item.ms { background: color-mix(in srgb, var(--series-1) 16%, transparent); } .cal-item.rel { background: color-mix(in srgb, #22c55e 16%, transparent); }
.tl { overflow-x: auto; } .tl > * { min-width: 640px; }
.tl-axis { position: relative; height: 22px; margin-left: 160px; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--text-muted); } .tl-axis span { position: absolute; transform: translateX(-50%); } .tl-now { color: var(--series-1); font-weight: 600; }
.tl-lane { display: flex; align-items: center; height: 38px; border-bottom: 1px solid var(--line); }
.tl-name { flex: 0 0 160px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 8px; }
.tl-track { position: relative; flex: 1; height: 100%; } .tl-nowline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--series-1); opacity: .35; }
.tl-dot { position: absolute; top: 50%; width: 13px; height: 13px; transform: translate(-50%, -50%) rotate(45deg); border: 2px solid var(--series-1); background: var(--solid); } .tl-dot.done { background: var(--series-1); } .tl-dot.late { border-color: var(--bad); background: var(--bad); }
.tl-rel { position: absolute; top: 50%; transform: translate(-50%, -50%); font-size: 15px; text-decoration: none !important; }
.ready-bar { display: flex; gap: 3px; margin-top: 6px; flex-wrap: wrap; } .ready-bar span { font-size: 10.5px; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); color: var(--text-secondary); }
.ready-bar .seg-ready, .area-ready { --c: #22c55e; } .ready-bar .seg-at_risk, .area-at_risk { --c: #f59e0b; } .ready-bar .seg-blocked, .area-blocked { --c: var(--bad); }
.ready-bar span[class^="seg-"]:not(.seg-unknown) { background: color-mix(in srgb, var(--c) 20%, transparent); color: var(--text-primary); }
.card.area { border-top: 3px solid var(--c, var(--line)); }
.brief h3 { margin: 14px 0 4px; font-size: 14px; } .brief div { margin: 2px 0; line-height: 1.5; } a.ref { font-family: ui-monospace, monospace; font-size: 11.5px; padding: 0 4px; border-radius: 4px; background: var(--surface-2); }
.doc { line-height: 1.6; max-width: 760px; } .answer { line-height: 1.6; margin-bottom: 10px; }
.head .seg { flex: none; }
@media (max-width: 900px) {
  .subtabs { margin: -6px -14px 14px; padding: 0 14px 8px; }
  .kanban { grid-template-columns: repeat(6, 78vw); }
  .cal-day { min-height: 64px; } .cal-item { font-size: 10px; padding: 0 3px; }
  .tl-name { flex-basis: 110px; } .tl-axis { margin-left: 110px; }
  .row { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .cal { gap: 2px; } .cal-dow { font-size: 9.5px; padding: 2px; } .cal-day { min-height: 54px; padding: 2px; } .cal-item { font-size: 0; height: 6px; padding: 0; margin: 1px 0; } .cal-item.ms { background: var(--series-1); } .cal-item.rel { background: #22c55e; } .cal-item:not(.ms):not(.rel) { background: var(--text-muted); } .cal-item.late { background: var(--bad); }
  .modal select[multiple] { min-height: 120px; }
  .head > button, .head > a.btn { flex: 1 1 auto; }
}
.grid > *, .main { min-width: 0; } .kanban { max-width: 100%; }
.kcard select.move { display: none; margin-top: 8px; width: 100%; font-size: 13px; padding: 5px 8px; }
@media (hover: none), (max-width: 900px) { .kcard select.move { display: block; } }
.cal .cal-day { cursor: pointer; } .cal-day.sel { background: color-mix(in srgb, var(--series-1) 14%, var(--surface-2)); } .cal + .card { margin-top: 12px; }
@media (max-width: 560px) {
  .card:has(> table.stack) table.stack { min-width: 0; } table.stack thead { display: none; }
  table.stack tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.stack td { border: 0; padding: 0; } table.stack td:first-child { flex: 1 1 100%; } table.stack td:empty { display: none; }
  table.stack .clip { max-width: 80vw; }
  table.checks td:nth-child(4) { margin-left: auto; } table.checks select { width: auto; font-size: 14px; }
}
.actions-table select { min-width: 150px; }
@media (max-width: 560px) { .actions-table td:first-child { flex: 0 0 auto; } .actions-table td:nth-child(2) { flex: 1 1 70%; } .actions-table td:nth-child(n+3) { flex: 1 1 40%; } .actions-table select, .actions-table input { width: 100%; min-width: 0; } }
/* ---------- Docs & Sheets ---------- */
.frow { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); color: inherit; } .frow:last-child { border-bottom: 0; } .frow:hover { background: var(--surface-2); text-decoration: none; }
.frow .t { text-align: right; flex: 0 0 auto; max-width: 180px; } .frow.unseen b { color: var(--series-1); }
.ficon { flex: 0 0 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 16px; font-weight: 700; color: #fff; background: #3b82f6; } .ficon.sheet { background: #16a34a; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--series-1); display: inline-block; }
.livedot, .idledot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); } .idledot { background: var(--text-muted); box-shadow: none; }
.fhead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 6px 0; }
.fhead .back { font-size: 20px; padding: 0 4px; color: var(--text-secondary); }
.ftitle { font-size: 20px; font-weight: 650; border: 1px solid transparent; background: transparent; padding: 2px 6px; width: 100%; border-radius: 8px; color: inherit; } .ftitle:hover, .ftitle:focus { border-color: var(--line); background: var(--field); }
.fhead select.sm { width: auto; padding: 2px 6px; font-size: 12px; } .fmenu { width: 44px !important; }
.savestate.good { color: var(--good); } .savestate.bad { color: var(--critical); } .savestate.blue { color: var(--series-1); }
.presence { display: flex; } .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--series-2); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; margin-left: -6px; border: 2px solid var(--bg); }
.since { display: flex; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--series-1) 10%, var(--surface-1)); border: 1px solid color-mix(in srgb, var(--series-1) 35%, transparent); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 10px; } .since ul { margin: 4px 0 0; padding-left: 18px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px; background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-sm); position: sticky; top: 58px; z-index: 15; }
.tgroup { display: inline-flex; gap: 2px; padding-right: 6px; margin-right: 2px; border-right: 1px solid var(--line); align-items: center; }
.tbtn { min-width: 30px; height: 30px; padding: 0 7px; border-radius: 7px; background: transparent; border: 1px solid transparent; box-shadow: none; font-size: 13px; } .tbtn:hover, .tbtn.on { background: var(--surface-2); border-color: var(--line); }
.tbtn.b { font-weight: 800; } .tbtn.i { font-style: italic; } .tbtn.u { text-decoration: underline; }
.tsel { width: auto; height: 30px; padding: 0 6px; font-size: 13px; }
.swatch { width: 18px; height: 18px; min-width: 0; padding: 0; border-radius: 4px; border: 1px solid var(--line-strong); font-size: 11px; line-height: 1; }
.rich-body { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; margin-top: 12px; }
.outline { position: sticky; top: 110px; align-self: start; font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; max-height: 70vh; overflow: auto; } .outline a { cursor: pointer; color: var(--text-secondary); } .outline .o-h2 { padding-left: 10px; } .outline .o-h3 { padding-left: 20px; } .outline-t { font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 11px; margin-bottom: 4px; }
.paper-wrap { position: relative; }
.paper { background: var(--field); color: var(--text-primary); border: 1px solid var(--line); border-radius: 6px; max-width: 820px; margin: 0 auto; min-height: 70vh; padding: 56px 64px; font-size: 15.5px; line-height: 1.65; outline: none; box-shadow: 0 2px 14px rgba(0,0,0,.06); overflow-wrap: anywhere; }
.paper.ro { min-height: 0; padding: 24px; margin-top: 8px; max-height: 50vh; overflow: auto; }
.paper h1 { font-size: 28px; margin: .8em 0 .3em; } .paper h2 { font-size: 21px; margin: .9em 0 .3em; } .paper h3 { font-size: 17px; margin: .9em 0 .2em; } .paper p { margin: 0 0 .55em; }
.paper blockquote { border-left: 3px solid var(--series-1); margin: .6em 0; padding: 2px 14px; color: var(--text-secondary); } .paper pre { background: var(--surface-2); padding: 10px 12px; border-radius: 8px; font: 13px/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap; }
.paper table { border-collapse: collapse; width: 100%; margin: .6em 0; } .paper td, .paper th { border: 1px solid var(--line-strong); padding: 6px 8px; min-width: 40px; vertical-align: top; } .paper th { background: var(--surface-2); }
.paper img { max-width: 100%; border-radius: 6px; } .paper hr { border: 0; border-top: 1px solid var(--line-strong); margin: 1.2em 0; }
.paper ul.check { list-style: none; padding-left: 4px; } .paper ul.check li { position: relative; padding-left: 26px; } .paper ul.check li::before { content: ''; position: absolute; left: 0; top: .3em; width: 15px; height: 15px; border: 1.5px solid var(--line-strong); border-radius: 4px; cursor: pointer; }
.paper ul.check li[data-done="1"] { color: var(--text-muted); text-decoration: line-through; } .paper ul.check li[data-done="1"]::before { background: var(--series-1); border-color: var(--series-1); content: '✓'; color: #fff; font-size: 11px; line-height: 15px; text-align: center; }
.rich-foot { display: flex; justify-content: space-between; gap: 10px; max-width: 820px; margin: 8px auto 0; padding-left: 196px; }
.slash { position: absolute; z-index: 30; background: var(--solid); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 4px; min-width: 220px; max-height: 300px; overflow: auto; }
.slash-item { padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px; } .slash-item.on, .slash-item:hover { background: var(--series-1); color: var(--on-brand); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 200; display: flex; gap: 12px; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.3); transition: opacity .4s; font-size: 13.5px; max-width: 92vw; } .toast.gone { opacity: 0; } .toast button { color: #93c5fd; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(440px, 100vw); background: var(--solid); border-left: 1px solid var(--line-strong); z-index: 90; padding: 16px; overflow: auto; box-shadow: -10px 0 40px rgba(0,0,0,.15); }
.dayhead { font-weight: 700; font-size: 12px; text-transform: uppercase; color: var(--text-muted); margin: 14px 0 6px; }
.commit { border: 1px solid var(--line); border-left: 3px solid var(--series-1); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: var(--surface-1); } .commit.k-checkpoint { border-left-color: var(--good); } .commit.k-restore { border-left-color: var(--series-2); }
.commit ul { margin: 4px 0; padding-left: 18px; } .hash { font: 11.5px ui-monospace, Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; color: var(--text-secondary); }
.opensess { background: color-mix(in srgb, var(--good) 10%, transparent); border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.autos a { display: block; padding: 2px 0; }
.wdiff { white-space: pre-wrap; font-size: 14px; line-height: 1.6; max-height: 60vh; overflow: auto; padding: 12px; background: var(--field); border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; }
.wdiff ins, .cdiff .ins { background: color-mix(in srgb, var(--good) 22%, transparent); text-decoration: none; } .wdiff del, .cdiff .del { background: color-mix(in srgb, var(--critical) 20%, transparent); }
.tline { display: flex; gap: 10px; align-items: flex-start; padding: 9px 4px; border-bottom: 1px solid var(--line); color: inherit; } .tline:hover { background: var(--surface-2); text-decoration: none; } .tline ul { margin: 2px 0 0; padding-left: 18px; } .tlt { flex: 0 0 46px; padding-top: 6px; }
.lead { font-size: 16px; font-weight: 550; margin: 0 0 6px; }
/* sheet */
.sheet { display: flex; flex-direction: column; gap: 6px; }
.sbar { display: flex; align-items: center; gap: 6px; background: var(--surface-1); border: 1px solid var(--line); border-radius: 8px; padding: 3px 6px; }
.sname { font: 12px ui-monospace, Menlo, monospace; min-width: 70px; color: var(--text-secondary); } .fx { font-style: italic; color: var(--text-muted); padding: 0 4px; border-left: 1px solid var(--line); }
.sfbar { border: 0; background: transparent; font: 13px ui-monospace, Menlo, monospace; padding: 4px; flex: 1; }
.sgrid-wrap { position: relative; overflow: auto; max-height: calc(100vh - 250px); min-height: 300px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); }
.sgrid { outline: none; } .stable { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 13px; user-select: none; }
.stable th { position: sticky; background: var(--solid); color: var(--text-muted); font-weight: 500; font-size: 11.5px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); height: 24px; z-index: 2; }
.stable thead th { top: 0; } .stable th.rowh { left: 0; z-index: 1; text-align: center; } .stable th.corner { left: 0; z-index: 3; } .stable th.colh { cursor: pointer; position: sticky; } .stable th.colh::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 6px; cursor: col-resize; }
.stable th.addcol { width: 30px; cursor: pointer; color: var(--series-1); }
.stable td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); height: 24px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--field); cursor: cell; }
.stable td.num { text-align: right; font-variant-numeric: tabular-nums; } .stable td.err { color: var(--critical); } .stable td.b { font-weight: 700; } .stable td.i { font-style: italic; } .stable td.u { text-decoration: underline; }
.stable td.sel { background-image: linear-gradient(color-mix(in srgb, var(--series-1) 14%, transparent), color-mix(in srgb, var(--series-1) 14%, transparent)); } .stable td.cur { outline: 2px solid var(--series-1); outline-offset: -2px; }
.scell-input { position: absolute; z-index: 10; font: 13px -apple-system, sans-serif; padding: 3px 5px; border: 2px solid var(--series-1); border-radius: 0; resize: none; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.15); white-space: pre; }
.addrows { margin: 6px; }
.sfoot { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stabs { display: flex; gap: 2px; overflow-x: auto; } .stab { padding: 4px 12px; font-size: 12.5px; border-radius: 0 0 8px 8px; background: var(--surface-2); box-shadow: none; border: 1px solid var(--line); border-top: 0; } .stab.on { background: var(--field); font-weight: 600; color: var(--series-1); }
.shint { font-size: 12px; color: var(--text-secondary); }
@media (max-width: 800px) {
  .rich-body { grid-template-columns: 1fr; } .outline { display: none; } .rich-foot { padding-left: 0; }
  .paper { padding: 20px 16px; min-height: 60vh; font-size: 16px; border-radius: 0; margin: 0 -12px; }
  .fhead { flex-wrap: wrap; } .fhead .grow { flex-basis: calc(100% - 80px); } .toolbar { top: 0; overflow-x: auto; flex-wrap: nowrap; } .fpage .toolbar .tgroup { flex: 0 0 auto; }
  .frow .t { display: none; } .sgrid-wrap { max-height: calc(100vh - 220px); }
}
@media print { .side, .topbar, .toolbar, .fhead, .rich-foot, .outline, .subtabs { display: none !important; } .paper { border: 0; box-shadow: none; padding: 0; } }
.tgroup[hidden] { display: none; }
.toolbar select.tsel { width: auto; flex: 0 0 auto; padding: 0 6px; border-radius: 7px; }
.tbtn.color { position: relative; display: inline-grid; place-items: center; cursor: pointer; font-weight: 700; } .tbtn.color input { position: absolute; left: 4px; right: 4px; bottom: 3px; height: 4px; width: auto; padding: 0; border: 0; border-radius: 2px; opacity: 1; cursor: pointer; -webkit-appearance: none; appearance: none; }
.tbtn.color input::-webkit-color-swatch-wrapper { padding: 0; } .tbtn.color input::-webkit-color-swatch { border: 0; border-radius: 2px; }
.stable td { max-width: 0; }
