/* Venuum Studio — one stylesheet.
   Monotone: zinc neutrals and ink. Colour appears only for state
   (over capacity, warnings, done) and for each person's own colour. */

@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-style: normal; font-display: swap; src: url(/fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Michroma'; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/michroma-latin-400-normal.woff2) format('woff2'); }

:root {
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f4f4f5;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;
  --fg: #18181b;
  --muted: #71717a;
  --faint: #a1a1aa;
  --ink: #18181b;
  --on-ink: #fafafa;
  --over: #b91c1c;
  --over-bg: #fee2e2;
  --warn: #a16207;
  --warn-bg: #fef3c7;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --focus: #2563eb;
  --scrim: rgba(9, 9, 11, .45);
  --shadow: 0 10px 30px rgba(9, 9, 11, .12), 0 2px 6px rgba(9, 9, 11, .06);
  --f-display: 'Michroma', 'Eurostile', 'Arial Narrow', sans-serif;
  --f-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --r: 6px;
  --r-lg: 10px;
  --rail: 224px;
  --tabbar: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e10; --surface: #18181b; --surface-2: #1d1d21; --surface-3: #232328; --line: #2a2a2f; --line-strong: #3f3f46;
    --fg: #f4f4f5; --muted: #a1a1aa; --faint: #71717a; --ink: #f4f4f5; --on-ink: #18181b;
    --over: #fca5a5; --over-bg: #3b1515; --warn: #fcd34d; --warn-bg: #36290c; --ok: #86efac; --ok-bg: #0f2e1a; --focus: #60a5fa;
    --scrim: rgba(0, 0, 0, .6); --shadow: 0 10px 30px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e10; --surface: #18181b; --surface-2: #1d1d21; --surface-3: #232328; --line: #2a2a2f; --line-strong: #3f3f46;
  --fg: #f4f4f5; --muted: #a1a1aa; --faint: #71717a; --ink: #f4f4f5; --on-ink: #18181b;
  --over: #fca5a5; --over-bg: #3b1515; --warn: #fcd34d; --warn-bg: #36290c; --ok: #86efac; --ok-bg: #0f2e1a; --focus: #60a5fa;
  --scrim: rgba(0, 0, 0, .6); --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---- Base ------------------------------------------------------------------ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 14px; line-height: 1.5; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spacer { flex: 1; }
h1 { font-family: var(--f-display); font-weight: 400; font-size: 20px; letter-spacing: .02em; margin: 0; text-wrap: balance; line-height: 1.3; }
h2 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; margin: 0; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; margin: 0; }
p { margin: 0; }
.prose { max-width: 68ch; }
.prose p + p { margin-top: 8px; }

/* ---- App shell ------------------------------------------------------------ */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); background: var(--surface); padding: 20px 12px 12px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.brand { color: var(--fg); padding: 0 8px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
.brand svg { height: 13px; width: auto; display: block; fill: currentColor; max-width: 150px; }
.brand span { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); padding: 12px 8px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; width: 100%; text-decoration: none; padding: 7px 8px; border-radius: var(--r); color: var(--muted); }
.nav a svg { width: 17px; height: 17px; flex: none; }
.nav a:hover { background: var(--surface-3); color: var(--fg); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--on-ink); }
.nav a .count { margin-left: auto; }
.count { font-family: var(--f-mono); font-size: 11px; padding: 0 6px; border-radius: 99px; background: var(--line); color: var(--fg); line-height: 18px; min-width: 18px; text-align: center; }
.nav a[aria-current="page"] .count { background: var(--on-ink); color: var(--ink); }
.count.alert { background: var(--over); color: #fff; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r); text-decoration: none; min-width: 0; }
.me:hover { background: var(--surface-3); }
.me .who { min-width: 0; }
.me .who div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.me small { display: block; color: var(--muted); font-size: 12px; line-height: 1.2; }

.topbar { display: none; }
main.page:focus { outline: none; }
main.page { padding-block: 28px 64px; padding-inline: clamp(16px, 3vw, 40px); min-width: 0; max-width: 1480px; width: 100%; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; }
.head .sub { color: var(--muted); margin-top: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.tabbar { display: none; }

/* ---- Avatars & presence ---------------------------------------------------- */
.avatar { position: relative; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; flex: none; letter-spacing: .02em; }
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.dot { position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--surface); }
.dot.online { background: var(--ok); } .dot.away { background: var(--warn); } .dot.offline { background: var(--faint); }
.presence { font-size: 12px; color: var(--muted); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* ---- Buttons ------------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r); padding: 7px 12px; cursor: pointer; text-decoration: none; white-space: nowrap; min-height: 34px; }
.btn:hover { border-color: var(--fg); }
.btn:disabled { opacity: .5; cursor: not-allowed; border-color: var(--line-strong); }
.btn.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn.primary:hover { opacity: .9; }
.btn.danger { color: var(--over); border-color: color-mix(in oklab, var(--over) 45%, var(--line-strong)); }
.btn.danger:hover { border-color: var(--over); }
.btn.danger.solid { background: var(--over); color: #fff; border-color: var(--over); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn.sm { padding: 3px 9px; font-size: 12.5px; min-height: 28px; }
.btn.icon { padding: 6px; min-width: 34px; }
.btn.icon.sm { padding: 4px; min-width: 28px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.linkish { border: 0; background: none; padding: 0; color: var(--muted); font-size: 12.5px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.linkish:hover { color: var(--fg); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; flex-wrap: wrap; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 5px 11px; cursor: pointer; color: var(--muted); min-height: 32px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.seg.sm button { padding: 3px 9px; font-size: 12.5px; min-height: 28px; }

/* ---- Forms ---------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .lab { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.field .help { font-size: 12px; color: var(--muted); }
.input, .field input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), .field select, .field textarea, select.input {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r); padding: 7px 9px; min-width: 0; min-height: 36px; }
.field textarea, textarea.input { min-height: 84px; resize: vertical; line-height: 1.45; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 3px color-mix(in oklab, var(--focus) 22%, transparent); }
.input.title { font-size: 17px; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0; padding: 6px 2px; background: transparent; }
.input.title:focus { box-shadow: none; border-bottom-color: var(--fg); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 30px; }
.check input { width: 17px; height: 17px; accent-color: var(--ink); flex: none; margin: 0; }
.check small { color: var(--muted); }
.error-text { color: var(--over); font-size: 12.5px; }
.sizes { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.custom { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.custom.active { border-color: var(--fg); }
.custom input, .field .custom input:not([type="checkbox"]):not([type="radio"]):not([type="color"]) { width: 56px; border: 0; border-radius: 0; padding: 4px 6px; background: transparent; font-family: var(--f-mono); text-align: right; min-height: 30px; box-shadow: none; }
.custom select, .field .custom select, .field .custom select:not([multiple]) { width: auto; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: transparent; padding: 4px 6px; min-height: 30px; box-shadow: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 99px; padding: 3px 10px 3px 4px; background: var(--surface); cursor: pointer; font-size: 13px; }
.chip[aria-pressed="true"] { border-color: var(--fg); background: var(--ink); color: var(--on-ink); }
.more-toggle { align-self: flex-start; }

/* ---- Tags ----------------------------------------------------------------- */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; line-height: 17px; }
.tag.ink { border-color: var(--fg); color: var(--fg); }
.tag.solid { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.tag.urgent { background: var(--over); border-color: var(--over); color: #fff; font-weight: 600; }
:root[data-theme="dark"] .tag.urgent { color: #18181b; }
.tag.warn { border-color: var(--warn); color: var(--warn); background: var(--warn-bg); }
.tag.over { border-color: var(--over); color: var(--over); background: var(--over-bg); }
.tag.ok { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.tag svg { width: 11px; height: 11px; }

/* ---- My work board ----------------------------------------------------------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.board-tabs { display: none; margin-bottom: 14px; }
.col-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 2px 8px; border-bottom: 2px solid var(--fg); margin-bottom: 10px; }
.col-head span { font-size: 12px; color: var(--muted); }
.col[data-col="done"] .col-head { border-bottom-color: var(--line-strong); }
.cards { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; cursor: pointer; text-align: left; width: 100%; }
.card:hover { border-color: var(--line-strong); box-shadow: 0 1px 0 var(--line); }
.col[data-col="now"] .card { border-color: var(--fg); }
.col[data-col="now"] .card.bg { border-style: dashed; }
.card.urgent { box-shadow: inset 3px 0 0 var(--over); }
.col[data-col="done"] .card { background: transparent; }
.col[data-col="done"] .card .title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.card .title { font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.card .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.meta { display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 12px; color: var(--muted); align-items: center; }
.meta b { color: var(--fg); font-weight: 500; }
.meta svg { width: 12px; height: 12px; vertical-align: -1px; }
.card .quick { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.progress { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--fg); }
.progress.over i { background: var(--over); }
.empty { font-size: 12.5px; color: var(--faint); border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 14px 12px; text-align: center; }
.empty-page { text-align: center; padding: 48px 16px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface); }
.empty-page h3 { color: var(--fg); margin-bottom: 6px; }

/* ---- Panels, lists, tables ---------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel.pad { padding: 16px; }
.section-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin: 28px 0 10px; }
.section-h:first-child { margin-top: 0; }
.section-h p { color: var(--muted); font-size: 12.5px; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
thead th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; background: var(--surface-2); white-space: nowrap; }
thead th.today { color: var(--fg); box-shadow: inset 0 -2px 0 var(--fg); }
th.c, td.c { text-align: center; }
th.r, td.r { text-align: right; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
tfoot td { background: var(--surface-2); font-size: 12.5px; }
td small, .cell-sub { display: block; color: var(--muted); font-size: 12px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .t { min-width: 0; }
.row .t > div { overflow-wrap: anywhere; }
.row .t small { color: var(--muted); font-size: 12px; display: block; }
.row .when { font-size: 12px; color: var(--muted); white-space: nowrap; text-align: right; }
.row.warn .t > div { color: var(--warn); }
button.row { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; }
button.row:hover { background: var(--surface-2); }
.two { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; }
.stat .v { font-family: var(--f-mono); font-size: 22px; font-weight: 500; line-height: 1.3; }
.stat .l { color: var(--muted); font-size: 12.5px; }
.stat .d { color: var(--muted); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.stat.alert .v { color: var(--over); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 16px; }

/* ---- Timesheet ------------------------------------------------------------------ */
.ts td.task { min-width: 220px; }
.ts td.cell { text-align: center; min-width: 78px; font-family: var(--f-mono); }
.ts th .dname { display: block; }
.ts th .dsub { display: block; font-size: 10px; letter-spacing: .04em; text-transform: none; color: var(--faint); }
.ts .dash { color: var(--faint); }
.hatch { background: repeating-linear-gradient(135deg, transparent 0 5px, var(--line) 5px 6px); }
.leave-pill { font-size: 12px; color: var(--muted); border-radius: 4px; padding: 3px 6px; display: inline-block; font-family: var(--f-body); }
.day-state { font-size: 11px; color: var(--muted); font-family: var(--f-body); }
.day-state.edited { color: var(--fg); font-weight: 500; }
.day-state.bad { color: var(--over); font-weight: 600; }
.day-state.blank { color: var(--warn); font-weight: 600; }
.ts-days { display: none; }
.day-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.day-card.today { border-color: var(--fg); }
.day-card .dh { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.entry { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.entry span:first-child { min-width: 0; overflow-wrap: anywhere; }
.editor-row { display: grid; grid-template-columns: minmax(0, 1fr) 84px auto; gap: 8px; align-items: center; }
.pct-input { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.pct-input input { width: 100%; border: 0; padding: 6px 4px 6px 8px; text-align: right; font-family: var(--f-mono); background: transparent; min-height: 34px; }
.pct-input span { padding: 0 8px 0 2px; color: var(--muted); }
.total-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.total-bar.bad { border-color: var(--over); color: var(--over); background: var(--over-bg); }

/* ---- Team capacity ------------------------------------------------------------------ */
.cap td.who { min-width: 190px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.cap th:first-child { position: sticky; left: 0; z-index: 2; }
.cap td.hc { padding: 4px; min-width: 64px; }
.who-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-cell .nm { font-weight: 500; }
.heat { display: flex; align-items: center; justify-content: center; gap: 4px; height: 38px; border-radius: 4px; font-family: var(--f-mono); font-size: 12.5px; cursor: default; }
.heat.over { background: var(--over-bg); color: var(--over); font-weight: 600; box-shadow: inset 0 0 0 1px var(--over); }
.heat.leave, .heat.holiday { color: var(--muted); font-family: var(--f-body); font-size: 12px; }
.heat.off { color: var(--faint); font-family: var(--f-body); font-size: 12px; background: var(--surface-2); }
.heat svg { width: 12px; height: 12px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend .sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -3px; margin-right: 5px; border: 1px solid var(--line-strong); }
.tip { position: fixed; pointer-events: none; z-index: 60; background: var(--ink); color: var(--on-ink); font-size: 12.5px; padding: 8px 10px; border-radius: var(--r); max-width: 300px; line-height: 1.45; box-shadow: var(--shadow); }
.tip b { font-weight: 600; }

/* ---- Projects & timeline ------------------------------------------------------------ */
.proj-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.proj { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-lg); padding: 14px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
.proj:hover { border-color: var(--line-strong); }
.proj .nm { font-weight: 600; font-size: 15px; }
.proj small { color: var(--muted); font-size: 12px; }
.tl { min-width: 760px; user-select: none; }
.tl-head, .tl-row { display: grid; grid-template-columns: 220px 1fr; }
.tl-head { border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tl-head .lbl { padding: 8px 12px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tl-scale { position: relative; height: 34px; overflow: hidden; }
.tl-scale span { position: absolute; top: 9px; font-size: 11px; color: var(--muted); transform: translateX(4px); white-space: nowrap; }
.tl-row { border-bottom: 1px solid var(--line); }
.tl-row:last-child { border-bottom: 0; }
.tl-name { padding: 8px 12px; font-size: 13px; min-width: 0; cursor: pointer; }
.tl-name div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-name small { display: block; color: var(--muted); font-size: 12px; }
.tl-track { position: relative; min-height: 46px; overflow: hidden; }
.tl-grid { position: absolute; inset: 0; pointer-events: none; }
.tl-grid i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl-grid b { position: absolute; top: 0; bottom: 0; background: var(--surface-2); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--fg); z-index: 2; pointer-events: none; }
.bar { position: absolute; top: 12px; height: 22px; border-radius: 4px; background: color-mix(in oklab, var(--ink) 70%, var(--surface)); color: var(--on-ink); font-size: 11.5px; padding: 3px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 1; }
.bar.drag { cursor: grab; touch-action: none; }
.bar.drag:active { cursor: grabbing; }
.bar.done { background: var(--line-strong); color: var(--muted); }
.bar.deliv { background: var(--ink); box-shadow: inset 0 0 0 2px var(--on-ink), 0 0 0 1px var(--ink); }
.bar.late { background: var(--over-bg); color: var(--over); box-shadow: inset 0 0 0 1px var(--over); }
.bar.risk { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); }
.bar .grip { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.bar .grip.l { left: 0; } .bar .grip.r { right: 0; }

/* ---- Calendar ------------------------------------------------------------------------- */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.month .dow { padding: 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.mday { min-height: 112px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; cursor: pointer; }
.mday:nth-child(7n) { border-right: 0; }
.mday.other { background: var(--surface-2); }
.mday.other .dn { color: var(--faint); }
.mday.weekend { background: var(--surface-2); }
.mday .dn { font-family: var(--f-mono); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 4px; }
.mday.today .dn b { background: var(--ink); color: var(--on-ink); border-radius: 99px; padding: 0 6px; }
.ev { display: block; width: 100%; text-align: left; border: 0; font-size: 11.5px; line-height: 1.35; padding: 2px 6px; border-radius: 4px; background: var(--surface-3); color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.ev.meeting { background: var(--ink); color: var(--on-ink); }
.ev.meeting.pending { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.ev.meeting.declined { background: transparent; color: var(--faint); text-decoration: line-through; box-shadow: inset 0 0 0 1px var(--line-strong); }
.ev.leave { background: repeating-linear-gradient(135deg, var(--surface-3) 0 5px, var(--line) 5px 6px); color: var(--muted); }
.ev.holiday { background: var(--warn-bg); color: var(--warn); }
.ev.personal { background: var(--surface-3); color: var(--muted); box-shadow: inset 2px 0 0 var(--faint); }
.ev.due { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px dashed var(--line-strong); border: 1px dashed var(--line-strong); }
.ev.due.late { color: var(--over); border-color: var(--over); }
.more-ev { font-size: 11px; color: var(--muted); padding-left: 6px; }
.agenda { display: none; }
.agenda .aday { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.agenda .aday:last-child { border-bottom: 0; }
.agenda .aday.today .ad { color: var(--fg); font-weight: 600; }
.agenda .ad { font-size: 12px; color: var(--muted); line-height: 1.3; }
.agenda .ad b { display: block; font-family: var(--f-mono); font-size: 18px; color: var(--fg); font-weight: 500; }
.agenda .aitems { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.agenda .ev { font-size: 13px; padding: 5px 8px; white-space: normal; }

/* ---- Reports -------------------------------------------------------------------------- */
.bars { display: flex; flex-direction: column; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 240px) minmax(0, 1fr) 110px; gap: 12px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.bar-row:last-child { border-bottom: 0; }
.bar-row .lbl { min-width: 0; overflow-wrap: anywhere; }
.bar-row .lbl small { display: block; color: var(--muted); font-size: 12px; }
.hbar { height: 14px; background: var(--surface-3); border-radius: 0 4px 4px 0; position: relative; }
.hbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--fg); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-row .v { text-align: right; font-family: var(--f-mono); font-size: 12.5px; }
.bar-row .v small { display: block; color: var(--muted); }
.kpi td { white-space: nowrap; }
.kpi .big { font-family: var(--f-mono); font-size: 15px; }
.kpi .detail td { background: var(--surface-2); white-space: normal; }

/* ---- Dialogs & sheets ----------------------------------------------------------------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; animation: fade .12s ease-out; }
.dialog { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); width: 100%; max-width: 560px; display: flex; flex-direction: column; max-height: calc(100vh - 8vh - 16px); animation: rise .14s ease-out; }
.dialog.wide { max-width: 760px; }
.dialog.narrow { max-width: 420px; }
.dialog-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 10px; }
.dialog-head h2 { font-family: var(--f-display); text-transform: none; font-weight: 400; letter-spacing: .02em; font-size: 16px; flex: 1; line-height: 1.35; }
.dialog-body { padding: 4px 18px 18px; overflow-y: auto; min-height: 0; }
.dialog-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.dialog-foot .left { margin-right: auto; }
.grabber { display: none; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }

.popover { position: fixed; z-index: 45; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); width: min(380px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 80px)); display: flex; flex-direction: column; overflow: hidden; }
.popover-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notes-list { overflow-y: auto; }
.note { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; }
.note:hover { background: var(--surface-2); }
.note.unread { background: color-mix(in oklab, var(--focus) 6%, var(--surface)); }
.note.unread .nt::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--focus); margin-right: 6px; vertical-align: 1px; }
.note small { display: block; color: var(--muted); font-size: 12px; }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 70; display: flex; flex-direction: column; gap: 8px; max-width: min(400px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--on-ink); padding: 10px 14px; border-radius: var(--r); box-shadow: var(--shadow); font-size: 13.5px; display: flex; gap: 12px; align-items: center; animation: rise .14s ease-out; }
.toast.error { background: var(--over); color: #fff; }
.toast button { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

.bell { position: relative; }
.bell .count { position: absolute; top: -3px; right: -3px; background: var(--over); color: #fff; font-size: 10px; line-height: 16px; min-width: 16px; padding: 0 4px; }

/* ---- Task detail ------------------------------------------------------------------------ */
.task-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.task-state { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kv { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv .k { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kv .v { overflow-wrap: anywhere; }
.checklist { display: flex; flex-direction: column; gap: 2px; }
.ci { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 0; }
.ci.done span { color: var(--muted); text-decoration: line-through; }
.ci .btn { opacity: 0; }
.ci:hover .btn, .ci:focus-within .btn { opacity: 1; }
.comments { display: flex; flex-direction: column; gap: 12px; }
.comment { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.comment .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment .by { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.comment .by b { color: var(--fg); font-weight: 500; }
.callout { border: 1px solid var(--line-strong); border-radius: var(--r); padding: 10px 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.callout.warn { border-color: var(--warn); background: var(--warn-bg); }
.callout.over { border-color: var(--over); background: var(--over-bg); }
.callout.ok { border-color: var(--ok); background: var(--ok-bg); }
.history { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
details summary { cursor: pointer; color: var(--muted); font-size: 12.5px; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: '▸ '; }
details[open] summary::before { content: '▾ '; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.copy-box { display: flex; gap: 6px; }
.copy-box input { flex: 1; min-width: 0; font-family: var(--f-mono); font-size: 12px; }

/* ---- Sign-in ----------------------------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 22px; }
.auth-card .brand svg { height: 16px; max-width: 190px; }
.auth-card .panel { padding: 22px; }
.auth-foot { text-align: center; font-size: 12px; color: var(--faint); }

/* ---- Tutorial ---------------------------------------------------------------------------- */
.tour-steps { display: flex; gap: 6px; }
.tour-steps i { width: 22px; height: 3px; border-radius: 2px; background: var(--line-strong); }
.tour-steps i.on { background: var(--fg); }
.tour-art { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); padding: 16px; display: flex; flex-direction: column; gap: 8px; margin: 12px 0 14px; }

/* ---- Admin ------------------------------------------------------------------------------- */
.subnav { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.subnav a { padding: 8px 12px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--fg); font-weight: 500; }
.week-edit { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-edit .wd { display: flex; flex-direction: column; gap: 4px; align-items: stretch; text-align: center; font-size: 12px; color: var(--muted); }
.week-edit select { padding: 5px 4px; }
.drop { border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); padding: 22px 16px; text-align: center; color: var(--muted); background: var(--surface-2); }
.drop.over { border-color: var(--fg); color: var(--fg); }
.meter { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--fg); transition: width .2s; }
.restore-note { font-size: 13px; }
.restore-note li + li { margin-top: 4px; }

/* ---- Phones -------------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; justify-content: space-between; gap: 12px;
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .topbar .brand svg { height: 12px; }
  main.page { padding-block: 18px calc(var(--tabbar) + env(safe-area-inset-bottom, 0px) + 28px); padding-inline: 16px; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--tabbar);
    font-size: 10.5px; color: var(--muted); text-decoration: none; background: none; border: 0; position: relative; }
  .tabbar svg { width: 21px; height: 21px; }
  .tabbar [aria-current="page"] { color: var(--fg); font-weight: 600; }
  .tabbar [aria-current="page"]::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; background: var(--fg); }
  .tabbar .count { position: absolute; top: 6px; left: calc(50% + 6px); font-size: 10px; line-height: 15px; min-width: 15px; padding: 0 4px; background: var(--over); color: #fff; }
  h1 { font-size: 18px; }
  .head { margin-bottom: 16px; }
  .head .actions .btn:not(.primary):not(.keep) { display: none; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .board-tabs { display: flex; }
  .board .col:not(.show) { display: none; }
  .board .col-head { display: none; }
  .row2, .row3, .task-grid { grid-template-columns: minmax(0, 1fr); }
  .ts-table { display: none; }
  .ts-days { display: flex; flex-direction: column; gap: 10px; }
  .month-wrap { display: none; }
  .agenda { display: block; }
  .bar-row { grid-template-columns: minmax(0, 1fr) 90px; }
  .bar-row .hbar { grid-column: 1 / -1; grid-row: 2; }
  .scrim { align-items: flex-end; padding: 0; }
  .dialog, .dialog.wide, .dialog.narrow { max-width: none; border-radius: 16px 16px 0 0; max-height: 92vh; border-bottom: 0; animation: up .2s ease-out;
    padding-bottom: env(safe-area-inset-bottom, 0px); }
  .grabber { display: block; width: 38px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 8px auto 0; }
  .dialog-foot .btn { flex: 1; }
  .dialog-foot .left { flex-basis: 100%; margin: 0; order: 9; }
  .popover { left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; width: 100%; border-radius: 16px 16px 0 0; max-height: 80vh !important; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .toasts { left: 16px; right: 16px; bottom: auto; top: calc(env(safe-area-inset-top, 0px) + 10px); }
  .cap td.who { min-width: 132px; max-width: 150px; }
  .cap td.who .cell-sub { display: none; }
  .cap td.hc { min-width: 56px; }
  table.stack-sm thead { display: none; }
  table.stack-sm, table.stack-sm tbody, table.stack-sm tr, table.stack-sm td { display: block; width: 100%; }
  table.stack-sm tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.stack-sm tbody tr:last-child { border-bottom: 0; }
  table.stack-sm td { border: 0; padding: 4px 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; text-align: right; white-space: normal; }
  table.stack-sm td::before { content: attr(data-label); font-family: var(--f-body); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: left; flex: none; }
  table.stack-sm td[data-label=""]::before { content: none; }
  table.stack-sm td:first-child { font-weight: 500; text-align: left; justify-content: flex-start; }
  table.stack-sm td:first-child::before { content: none; }
  table.stack-sm td > small { display: inline; margin-left: 6px; }
  table.stack-sm .actions { justify-content: flex-end; }
  .table-wrap:has(table.stack-sm) { overflow-x: visible; }
  .week-edit { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .input, .field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea { font-size: 16px; } /* no zoom on iOS */
  .ci .btn { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (forced-colors: active) { .heat.over, .bar.late, .tag.urgent { border: 2px solid CanvasText; } }

/* Show / hide password */
.pw-wrap { position: relative; display: block; min-width: 0; }
.pw-wrap > input { width: 100%; padding-right: 42px !important; }
.pw-eye { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 34px; height: 30px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; padding: 0; }
.pw-eye:hover { color: var(--fg); background: var(--hover, rgba(127,127,127,.12)); }
.pw-eye:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.pw-eye[aria-pressed="true"] { color: var(--fg); }

/* Files on tasks */
.dropzone { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 2px; align-items: center; border: 1.5px dashed var(--line-strong);
  border-radius: 10px; padding: 12px 14px; color: var(--fg); background: var(--surface-2); cursor: pointer; margin-top: 8px; }
.dropzone > svg { grid-row: span 2; color: var(--muted); }
.dropzone small { grid-column: 2; }
.dropzone.compact { padding: 8px 12px; }
.dropzone.compact small { display: none; }
.dropzone.compact > svg { grid-row: auto; }
.dropzone:hover, .dropzone.over { border-color: var(--fg); }
.dropzone:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.dropzone.busy { opacity: .6; pointer-events: none; }
.files { display: flex; flex-direction: column; gap: 6px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb { margin: 0; width: 112px; min-width: 0; }
.thumb-img { display: block; width: 112px; height: 84px; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-3); cursor: zoom-in; }
.thumb-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-img:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.thumb figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 4px; font-size: 12px; min-width: 0; }
.thumb figcaption .name { flex: 1 1 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.file-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); min-width: 0; flex-wrap: wrap; }
.file-row > svg { color: var(--muted); flex: none; }
.file-row .t { flex: 1 1 160px; min-width: 0; }
.file-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row.gone { background: transparent; border-style: dashed; }
.file-row.gone .name { color: var(--muted); text-decoration: line-through; }
.tag.tiny { font-size: 10px; padding: 0 6px; line-height: 15px; }
.pending-files { display: flex; flex-direction: column; gap: 6px; }
.pending-files:empty { display: none; }
.dialog.viewer { max-width: min(1100px, 96vw); }
.viewer-stage { display: grid; place-items: center; background: var(--surface-3); border-radius: 8px; min-height: 200px; }
.viewer-img { max-width: 100%; max-height: 72vh; object-fit: contain; display: block; }
.viewer-pdf { width: 100%; height: 74vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
