/* ───────────────────────────────────────────────────────────
   Project Dashboard — Woo Design Language, register: MIDNIGHT
   (deep navy, hairline Urbanist numerals, one yellow accent moment per screen)
   Dark is the default; light applies when the OS prefers light or when
   html[data-theme="light"] is set by the sidebar switch (see app.js).
   Every text pair is checked to hold 4.5:1 on --surface and --surface-2.
   ─────────────────────────────────────────────────────────── */
:root {
  /* Midnight, dark */
  --bg: #101b30;            /* page ground */
  --surface: #1b2a47;       /* cards, drawer, menus */
  --surface-2: #15223b;     /* wells, tracks, table heads */
  --surface-hover: #22345a; /* card / row hover */
  --deep: #0a1222;          /* sidebar, text on ink fills */
  --ink: #eef2f8;
  --ink-2: #d8e0ec;
  --muted: #a9b6cc;         /* secondary text only */
  --on-deep-muted: #93a2bb; /* secondary text on the sidebar */
  --line: #2a3b5c;          /* decorative hairlines */
  --line-strong: #6d7f9f;   /* borders that carry meaning */
  --wash: rgba(238, 242, 248, .06);        /* hover tint */
  --wash-strong: rgba(238, 242, 248, .09); /* selected tint */
  --scrim: rgba(4, 8, 18, .62);
  --accent: #f2e35c;        /* the ONE yellow moment (fills) */
  --accent-ink: #0a1222;    /* text on a yellow fill */
  --accent-text: #f2e35c;   /* yellow used as text on navy */
  --accent-soft: #3a3d2c;   /* tinted well for "needs you" chips */
  --mark: #f2e35c;          /* focus rings, hover underlines, nav dot */
  --heat-1: #2a3b5c; --heat-2: #4b6390; --heat-3: #93a8cc; --heat-4: var(--ink);

  /* semantic states */
  --danger: #ffb3a1;  --danger-soft: #4a2c35;
  --ok: #9fdcb4;      --ok-soft: #1d3d3a;
  --warn: #f4c46a;    --warn-soft: #3b372b;

  /* lifecycle palette (also used by the connection graph) */
  --s-building: var(--ink); --s-planning: #a9c8f0; --s-might-pursue: #a7dbd2; --s-idea: #b4c0d4;
  --s-on-hold: #e8c28f;  --s-finished: var(--ok); --s-graveyard: #d6bab5;
  --s-paused: var(--s-on-hold); --s-shipped: var(--s-finished); --s-archived: var(--s-graveyard);

  /* shape & type */
  --radius: 28px;
  --radius-sm: 14px;
  --shadow: none;           /* separate by colour and space, not shadow */
  --font-body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-head: Urbanist, Futura, "Century Gothic", sans-serif;
  --font-mono: "Martian Mono", "SF Mono", Menlo, Consolas, monospace;
  --max: 1240px;
  color-scheme: dark;
}
/* Midnight, light: same navy as ink, pale blue-grey ground, light sidebar */
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) {
  --bg: #eef2f8; --surface: #ffffff; --surface-2: #e6ebf3; --surface-hover: #f5f8fc; --deep: #f7f9fc;
    --ink: #13213d; --ink-2: #2a3a5c; --muted: #4f5d75; --on-deep-muted: #4f5d75;
    --line: #d3dbe8; --line-strong: #7d8aa3;
    --wash: rgba(19, 33, 61, .05); --wash-strong: rgba(19, 33, 61, .08); --scrim: rgba(19, 33, 61, .35);
    --accent-ink: #13213d; --accent-text: #6b5a00; --accent-soft: #faf1c2; --mark: #2d5a91;
    --heat-1: #cfd9ea; --heat-2: #8fa8d4; --heat-3: #4b6aa8;
    --danger: #a8321f; --danger-soft: #fbe5e0;
    --ok: #1d6e43; --ok-soft: #ddf1e4;
    --warn: #7f5600; --warn-soft: #f7ebcf;
    --s-planning: #2d5a91; --s-might-pursue: #1d6a62; --s-idea: #4f5d75; --s-on-hold: #835711; --s-graveyard: #8a4a43;
    color-scheme: light;
} }
:root[data-theme="light"] {
  --bg: #eef2f8; --surface: #ffffff; --surface-2: #e6ebf3; --surface-hover: #f5f8fc; --deep: #f7f9fc;
    --ink: #13213d; --ink-2: #2a3a5c; --muted: #4f5d75; --on-deep-muted: #4f5d75;
    --line: #d3dbe8; --line-strong: #7d8aa3;
    --wash: rgba(19, 33, 61, .05); --wash-strong: rgba(19, 33, 61, .08); --scrim: rgba(19, 33, 61, .35);
    --accent-ink: #13213d; --accent-text: #6b5a00; --accent-soft: #faf1c2; --mark: #2d5a91;
    --heat-1: #cfd9ea; --heat-2: #8fa8d4; --heat-3: #4b6aa8;
    --danger: #a8321f; --danger-soft: #fbe5e0;
    --ok: #1d6e43; --ok-soft: #ddf1e4;
    --warn: #7f5600; --warn-soft: #f7ebcf;
    --s-planning: #2d5a91; --s-might-pursue: #1d6a62; --s-idea: #4f5d75; --s-on-hold: #835711; --s-graveyard: #8a4a43;
    color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/24px var(--font-body); -webkit-font-smoothing: antialiased; min-height: 100vh; }
h1, h2, h3 { margin: 0; line-height: 1.1; }
h1 { font-family: var(--font-head); font-weight: 300; font-size: clamp(2.4rem, 4.6vw, 3.9rem); letter-spacing: -.035em; line-height: 1; }
h2 { font-family: var(--font-head); font-weight: 300; font-size: 1.65rem; letter-spacing: -.025em; }
h3 { font-family: var(--font-body); font-weight: 600; font-size: 1.05rem; letter-spacing: 0; }
p { margin: 0; }
a { color: var(--ink); text-decoration-color: var(--line-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--mark); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--mark); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono, .meta-mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: .02em; }
/* Woo "eyebrow": uppercase mono label, the one place tracking goes wide */
.eyebrow, .kpi .label, .card-head .sub, .lane-head .hint, .brief-h, .drawer section h4, .board-col h4, table.plist th, .ptask-group h5 {
  font-family: var(--font-mono); font-weight: 500; font-size: 11px; line-height: 16px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}

/* ── shell: sidebar + content ── */
body:has(> .site-header) { display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: 1fr auto; }
.site-header { grid-row: 1 / span 2; grid-column: 1; position: sticky; top: 0; height: 100vh; background: var(--deep); color: var(--ink); z-index: 30; }
.site-header .wrap { height: 100%; display: flex; flex-direction: column; gap: 32px; padding: 30px 18px 24px; max-width: none; }
main.wrap, .site-footer { grid-column: 2; }
.wrap { max-width: var(--max); width: 100%; margin: 0 auto; padding: 0 48px; }
main.wrap { padding-top: 40px; padding-bottom: 72px; }
.brand { display: block; color: var(--ink); text-decoration: none; font-family: var(--font-head); font-weight: 300; font-size: 1.6rem; letter-spacing: -.03em; line-height: 1.05; padding: 0 8px; }
.nav { display: grid; gap: 4px; }
.nav a { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--on-deep-muted); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--ink); background: var(--wash); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--wash-strong); }
.nav a[aria-current="page"]::after { content: ""; width: 6px; height: 6px; border-radius: 99px; background: var(--mark); }
.header-tools { margin-top: auto; display: grid; gap: 8px; padding: 0 8px; }
.header-tools .status { font: 400 11px/16px var(--font-mono); letter-spacing: .02em; color: var(--on-deep-muted); }
.header-tools .status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 99px; margin-right: 8px; vertical-align: 1px; background: var(--line-strong); }
.header-tools .status.up::before { background: var(--ok); }
.header-tools .status.down::before { background: var(--danger); }
.header-tools a { color: var(--on-deep-muted); font: 400 11px/16px var(--font-mono); }
@media (max-width: 900px) {
  body:has(> .site-header) { display: block; }
  .site-header { position: static; height: auto; }
  .site-header .wrap { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 20px; }
  .brand { font-size: 1.25rem; padding: 0; }
  .nav { display: flex; overflow-x: auto; scrollbar-width: none; }
  .nav a { min-height: 40px; white-space: nowrap; }
  .header-tools { display: none; }
  .wrap { padding: 0 20px; }
  main.wrap { padding-top: 26px; }
}

/* ── layout helpers ── */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 24px; margin-bottom: 30px; }
.page-head .lede { color: var(--muted); margin-top: 12px; max-width: 58ch; font-size: 17px; line-height: 28px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); } /* minmax stops wide children from stretching the page on phones */
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
@media (max-width: 1100px) { .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.cols-3, .grid.split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .grid.cols-2 { grid-template-columns: minmax(0, 1fr); } }

/* ── surfaces ── */
.card { background: var(--surface); border: 1px solid var(--card-edge, transparent); border-radius: var(--radius); padding: 26px 28px; min-width: 0; }
.card.flat { background: var(--surface-2); }
.card.cut { clip-path: polygon(0 0, calc(100% - 44px) 0, 100% 44px, 100% 100%, 0 100%); } /* Overcast: one cut corner */
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { font-size: 1.35rem; }
.callout { border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px 18px; display: flex; gap: 12px; align-items: flex-start; }
.callout.warn { border-color: var(--warn); background: var(--warn-soft); }
.callout.ok { border-color: var(--ok); background: var(--ok-soft); }
.callout .icon { font: 500 12px/24px var(--font-mono); color: var(--muted); }
code { font-family: var(--font-mono); font-size: .82em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }

/* ── buttons / inputs ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; font-weight: 600; font-size: .9rem; text-decoration: none; color: var(--ink); transition: background .15s, border-color .15s; }
.btn:hover { background: var(--wash); }
/* Overcast primary: slanted yellow — keep to one per screen */
.btn.primary { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 0; padding: 10px 26px; clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.sm { min-height: 32px; padding: 4px 12px; font-size: .8rem; }
.btn.primary.sm { padding: 6px 20px; }
.btn.icon { padding: 8px; width: 40px; height: 40px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
input[type="text"], input[type="date"], input[type="search"], input[type="url"], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 12px; padding: 9px 12px; width: 100%; min-height: 40px;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
textarea { resize: vertical; min-height: 74px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--mark); outline-offset: 1px; }
label.field { display: grid; gap: 6px; font: 500 11px/16px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
input[type="range"] { accent-color: var(--mark); width: 100%; }
select option { background: var(--surface); color: var(--ink); }

/* ── pills, tags, chips ── */
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 2px 10px; border-radius: 999px; font: 500 11px/18px var(--font-mono); letter-spacing: .04em; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.s-idea { color: var(--s-idea); } .pill.s-planning { color: var(--s-planning); } .pill.s-building { color: var(--s-building); }
.pill.s-paused { color: var(--s-paused); } .pill.s-shipped { color: var(--s-shipped); } .pill.s-archived { color: var(--s-archived); }
.pill.s-might-pursue { color: var(--s-might-pursue); } .pill.s-on-hold { color: var(--s-on-hold); }
.pill.s-finished { color: var(--s-finished); } .pill.s-graveyard { color: var(--s-graveyard); }
.pill.plain::before { display: none; }
.pill.high { color: var(--danger); background: var(--danger-soft); }
.pill.med { color: var(--warn); background: var(--warn-soft); }
.pill.low { color: var(--muted); }
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.bad { color: var(--danger); background: var(--danger-soft); }
.tag { display: inline-block; padding: 1px 10px; border-radius: 999px; font: 500 11px/20px var(--font-mono); letter-spacing: .03em; border: 1px solid var(--line-strong); color: var(--ink-2); }
.tag.link { text-decoration: none; }
.tag.link:hover { border-color: var(--mark); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; font-size: .86rem; font-weight: 500; color: var(--ink); }
.chip:hover { background: var(--wash); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--deep); border-color: var(--ink); }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-wait { display: inline-flex; gap: 6px; align-items: center; font: 500 11px/20px var(--font-mono); letter-spacing: .03em; padding: 1px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
.chip-me { display: inline-flex; gap: 6px; align-items: center; font: 500 11px/20px var(--font-mono); letter-spacing: .03em; padding: 1px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }

/* connection state dots */
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--s-idea); flex: none; }
.dot.live { background: var(--ok); } .dot.simulated { background: var(--warn); } .dot.planned { background: var(--s-planning); } .dot.blocked { background: var(--danger); }

/* ── progress ── */
.progress { height: 6px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.card.flat .progress { background: var(--surface); }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--ink); transition: width .4s ease; }
.progress.ok > i { background: var(--ok); }
.pbar { display: flex; align-items: center; gap: 12px; }
.pbar .progress { flex: 1; }
.pbar .pct { font: 400 12px var(--font-mono); min-width: 40px; text-align: right; color: var(--ink-2); }

/* ── KPI / big numbers (Overcast stat) ── */
.kpi { padding: 22px 26px; }
.kpi .value { font-family: var(--font-head); font-weight: 250; font-size: clamp(2.8rem, 4.4vw, 4rem); line-height: 1; letter-spacing: -.04em; margin-top: 12px; }
.kpi .hint { color: var(--muted); font: 400 12px/18px var(--font-mono); margin-top: 8px; }
.kpi.alert .value { color: var(--danger); }

/* ── Today ── */
.today-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 28px; align-items: end; margin-bottom: 26px; }
.today-head h1 { margin-top: 10px; }
.today-head .lede { margin-top: 14px; max-width: 60ch; font-size: 17px; line-height: 28px; color: var(--muted); }
@media (max-width: 760px) { .today-head { grid-template-columns: minmax(0, 1fr); } }
/* the due strip IS the screen's one yellow moment */
.duebar { display: grid; gap: 2px; border-radius: var(--radius-sm); overflow: hidden; }
.dueitem { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; padding: 16px 22px; background: var(--accent); color: var(--accent-ink); border: 0; width: 100%; text-align: left; font: inherit; cursor: pointer; }
.dueitem .when { font: 500 11px/16px var(--font-mono); letter-spacing: .16em; text-transform: uppercase; min-width: 96px; }
.dueitem b { font-size: 16px; font-weight: 600; }
.dueitem .proj { margin-left: auto; font: 400 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.dueitem.soon { background: var(--surface-2); color: var(--ink); }
.dueitem.soon .when { color: var(--accent-text); }
.later { padding: 10px 22px; background: var(--surface-2); font: 400 12px/18px var(--font-mono); color: var(--muted); }
.focus-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.focus-row:last-child { border-bottom: 0; }
.focus-row .t { font-weight: 600; font-size: 16px; line-height: 22px; }
.focus-row .why { font: 400 12px/18px var(--font-mono); color: var(--muted); margin-top: 4px; }
.focus-row.done .t { text-decoration: line-through; color: var(--muted); }
.focus-row .t, .focus-row .why, .witem span, .witem b { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 640px) { .focus-row { grid-template-columns: 26px minmax(0, 1fr); } .focus-row > :last-child { grid-column: 2; justify-self: start; } }
.wlist { display: grid; }
.witem { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; color: inherit; width: 100%; }
.witem:last-child { border-bottom: 0; }
.witem .m { font: 400 12px/18px var(--font-mono); color: var(--muted); }
.witem .m.warnline { color: var(--warn); }
.cproj { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(0, 2fr) minmax(90px, 160px) auto; gap: 18px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.cproj:last-of-type { border-bottom: 0; }
.cproj:hover b { text-decoration: underline; text-decoration-color: var(--mark); text-underline-offset: 4px; }
.cproj .nx { font: 400 12px/18px var(--font-mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cproj .flag { font: 500 11px var(--font-mono); color: var(--warn); white-space: nowrap; }
@media (max-width: 760px) { .cproj { grid-template-columns: minmax(0, 1fr) auto; } .cproj .nx, .cproj .progress { display: none; } }
.restbrief > summary { cursor: pointer; font: 500 11px/16px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 6px 0; }

/* ── legacy to-do rows (kept for any old view) ── */
.todo { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.todo:last-child { border-bottom: 0; }
.todo .title { font-weight: 500; }
.todo .meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; align-items: center; }
.check { appearance: none; width: 22px; height: 22px; border: 1.5px solid var(--line-strong); border-radius: 7px; display: grid; place-items: center; margin: 1px 0 0; cursor: pointer; background: transparent; flex: none; }
.check:hover { border-color: var(--mark); }
.check:checked { background: var(--ok); border-color: var(--ok); }
.check:checked::after { content: ""; width: 5px; height: 10px; border: solid var(--deep); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check.doing { border-color: var(--ink); background: linear-gradient(90deg, var(--ink) 50%, transparent 50%); }
.empty { text-align: center; color: var(--muted); padding: 34px 18px; }

/* ── board ── */
.board { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.board-col { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; min-height: 90px; }
.board-col h4 { margin: 0 0 10px; display: flex; justify-content: space-between; }
.board-item { background: var(--surface); border: 0; border-radius: 12px; padding: 10px 12px; font-size: .88rem; font-weight: 500; margin-bottom: 8px; width: 100%; text-align: left; display: block; color: var(--ink); }
.board-item .progress { margin-top: 8px; height: 4px; }

/* ── graph ── */
.graph-host { position: relative; background: var(--surface-2); border-radius: var(--radius); overflow: hidden; }
.graph-host svg { display: block; width: 100%; height: auto; touch-action: none; }
.g-link { stroke: var(--line); stroke-width: 1.5; fill: none; }
.g-link.relation { stroke: var(--muted); stroke-dasharray: 5 4; }
.g-link.service { stroke: var(--line-strong); }
.g-node { cursor: pointer; transition: opacity .15s; }
.g-node.dim, .g-link.dim { opacity: .14; }
.g-node text { fill: var(--ink); font: 600 12px var(--font-body); paint-order: stroke; stroke: var(--surface-2); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.g-node.tag text, .g-node.service text { font: 400 10px var(--font-mono); fill: var(--ink-2); }
.g-node.project circle { stroke: var(--surface-2); stroke-width: 3; }
.g-node.project.s-idea circle { fill: var(--s-idea); } .g-node.project.s-planning circle { fill: var(--s-planning); }
.g-node.project.s-building circle { fill: var(--s-building); } .g-node.project.s-paused circle { fill: var(--s-paused); }
.g-node.project.s-shipped circle { fill: var(--s-shipped); } .g-node.project.s-archived circle { fill: var(--s-archived); }
.g-node.project.s-might-pursue circle { fill: var(--s-might-pursue); } .g-node.project.s-on-hold circle { fill: var(--s-on-hold); }
.g-node.project.s-finished circle { fill: var(--s-finished); } .g-node.project.s-graveyard circle { fill: var(--s-graveyard); }
.g-node.project.s-on-hold, .g-node.project.s-finished { opacity: .7; }
.g-node.tag rect { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; }
.g-node.service rect { stroke-width: 2; fill: var(--surface-2); }
.g-node.service.live rect { stroke: var(--ok); } .g-node.service.simulated rect { stroke: var(--warn); }
.g-node.service.planned rect { stroke: var(--s-planning); } .g-node.service.blocked rect { stroke: var(--danger); } .g-node.service.unknown rect { stroke: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 12px 16px; font: 400 11px/16px var(--font-mono); color: var(--muted); border-top: 1px solid var(--line); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; display: inline-block; border-radius: 50%; }
.legend i.sq { border-radius: 3px; background: transparent; border: 2px solid var(--muted); }
.legend i.dia { border-radius: 3px; background: var(--surface); border: 1.5px solid var(--muted); transform: rotate(45deg) scale(.85); }

/* ── drawer ── */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--surface); z-index: 41; transform: translateX(105%); transition: transform .25s ease; overflow-y: auto; padding: 28px; display: grid; gap: 22px; align-content: start; visibility: hidden; }
.drawer.open { transform: none; visibility: visible; }
.drawer h2 { font-size: 2.1rem; }
.drawer section h4 { margin: 0 0 10px; }
.milestones { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.milestones li { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.milestones .m { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; margin-top: 3px; display: grid; place-items: center; font-size: 11px; color: var(--deep); }
.milestones .m.done { background: var(--ok); border-color: var(--ok); }
.list-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.conn-row { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.conn-row .dot { margin-top: 8px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .84rem; }
.meta-row b { color: var(--ink-2); font-weight: 600; }
.attention { display: flex; gap: 8px; align-items: flex-start; font-size: .84rem; color: var(--warn); }
.attention > span:first-child, .flagmark { font: 500 11px/20px var(--font-mono); }

/* ── timeline ── */
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 1px solid var(--line-strong); display: grid; gap: 14px; }
.timeline li { position: relative; font-size: .9rem; }
.timeline li::before { content: ""; position: absolute; left: -21px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.timeline time { display: block; color: var(--muted); font: 400 11px/16px var(--font-mono); margin-top: 2px; }

/* ── profile ── */
.profile-hero { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.avatar { width: 88px; height: 88px; border-radius: 28px; background: var(--surface-2); color: var(--ink); display: grid; place-items: center; font: 250 3rem var(--font-head); border: 1px solid var(--line-strong); }
.interest { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.interest:last-child { border-bottom: 0; }
.interest .name { font-weight: 600; }
.interest .note { color: var(--muted); font-size: .86rem; }
.meter { display: flex; gap: 4px; }
.meter i { flex: 1; height: 6px; border-radius: 4px; background: var(--bg); }
.meter i.on { background: var(--ink); }
.trend { font: 500 11px var(--font-mono); letter-spacing: .04em; white-space: nowrap; }
.trend.rising { color: var(--ok); } .trend.fading { color: var(--muted); } .trend.steady { color: var(--s-planning); }
.horizon { display: grid; gap: 10px; align-content: start; }
.direction { padding: 16px 18px; border-radius: var(--radius-sm); background: var(--surface-2); display: grid; gap: 6px; }
.direction .why { color: var(--muted); font-size: .88rem; }
.bullets { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.edit-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; }
.edit-grid { display: grid; gap: 10px; padding: 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.editing-banner { position: sticky; top: 12px; z-index: 20; }
.bar-row { display: grid; grid-template-columns: 160px 1fr 80px; gap: 12px; align-items: center; font-size: .88rem; margin: 9px 0; }
.bar-row .bar { height: 8px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; background: var(--ink); border-radius: 5px; }
/* activity heatmap: weeks as columns, days as rows */
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 22px); grid-auto-columns: 22px; gap: 5px; margin-top: 6px; overflow-x: auto; }
.heat i { width: 22px; height: 22px; border-radius: 5px; background: var(--bg); display: block; }
.heat i.l1, .heat-legend i.l1 { background: var(--heat-1); } .heat i.l2, .heat-legend i.l2 { background: var(--heat-2); }
.heat i.l3, .heat-legend i.l3 { background: var(--heat-3); } .heat i.l4, .heat-legend i.l4 { background: var(--heat-4); }
.heat i.future { background: transparent; outline: 1px dashed var(--line); outline-offset: -1px; }
.heat-legend { display: flex; gap: 6px; align-items: center; font: 400 11px var(--font-mono); color: var(--muted); }
.heat-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.heat-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.heat-days { display: grid; grid-template-rows: repeat(7, 22px); gap: 5px; margin-top: 6px; font: 400 10px/22px var(--font-mono); color: var(--muted); }
@media (max-width: 640px) { .profile-hero { grid-template-columns: 1fr; } .interest { grid-template-columns: 1fr; gap: 6px; } .bar-row { grid-template-columns: 100px 1fr 60px; } }

/* ── toast ── */
.toast-host { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; }
.toast { background: var(--ink); color: var(--deep); padding: 11px 20px; border-radius: 999px; font-size: .9rem; font-weight: 500; animation: pop .2s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }

/* ── footer ── */
.site-footer { padding: 22px 0 40px; color: var(--muted); font: 400 11px/18px var(--font-mono); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 20px; }
.site-footer a { color: var(--muted); }

/* skeleton */
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); min-height: 90px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── files tab ── */
.folder-card { padding: 0; overflow: hidden; }
.folder-card > summary, .folder-head { list-style: none; display: flex; gap: 14px; align-items: flex-start; padding: 18px 22px; cursor: pointer; }
.folder-card > summary::-webkit-details-marker, .sub-folder > summary::-webkit-details-marker { display: none; }
.folder-card[open] > summary { border-bottom: 1px solid var(--line); }
.folder-card > summary::after { content: "→"; color: var(--muted); margin-left: auto; transition: transform .15s; align-self: center; }
.folder-card[open] > summary::after { transform: rotate(90deg); }
.tree { padding: 10px 14px 16px; }
.tree-level { display: grid; gap: 1px; }
.sub-folder > .tree-level { margin-left: 18px; border-left: 1px solid var(--line); padding-left: 8px; }
.file-row { display: flex; gap: 12px; align-items: flex-start; padding: 7px 10px; border-radius: 10px; font-size: .9rem; }
.file-row:hover { background: var(--wash); }
.sub-folder > summary { list-style: none; cursor: pointer; }
.file-row.key { background: var(--surface-2); }
.file-row .ico { flex: none; min-width: 40px; text-align: center; font: 500 9px/20px var(--font-mono); letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 4px; margin-top: 1px; }
.grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.path { word-break: break-all; }
section > .file-row:first-child { padding-top: 10px; }
@media (max-width: 640px) { .file-row .btn { display: none; } }

/* ── brief (rest of the brief, past reports) ── */
.brief-headline { font: 300 1.5rem/1.3 var(--font-head); letter-spacing: -.02em; max-width: 60ch; }
.brief-h { margin: 0 0 8px; }
.brief-list { margin: 0; padding-left: 20px; display: grid; gap: 10px; }

/* ── projects page ── */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; min-height: 36px; padding: 6px 16px; border-radius: 999px; font-weight: 500; font-size: .88rem; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--deep); }
.lane { margin-top: 40px; }
.lane:first-of-type { margin-top: 8px; }
.lane-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.lane-head h2 { font-size: 1.6rem; }
.lane-head .count { font: 400 12px var(--font-mono); color: var(--muted); }
.pcard { display: grid; gap: 12px; padding: 24px 26px; cursor: pointer; transition: background .15s; text-align: left; }
.pcard:hover { background: var(--surface-hover); }
.pcard h3 { font-family: var(--font-head); font-weight: 300; font-size: 1.7rem; letter-spacing: -.025em; line-height: 1.05; }
.pcard .next { font-size: .9rem; color: var(--ink-2); }
.pcard .next b { font: 500 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.rows { display: grid; gap: 8px; }
.prow { display: grid; grid-template-columns: minmax(160px, 1.2fr) minmax(0, 2fr) 140px auto; gap: 16px; align-items: center; padding: 12px 18px; border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; text-align: left; }
.prow:hover { background: var(--surface); }
.prow .name { font-weight: 600; }
.prow .note { color: var(--muted); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow.dead .name { text-decoration: line-through; text-decoration-color: var(--s-graveyard); color: var(--muted); }
.prow.dead { background: transparent; border: 1px dashed var(--line); }
@media (max-width: 760px) { .prow { grid-template-columns: minmax(0, 1fr) auto; } .prow .note, .prow .pbar { display: none; } }
.reminders { display: grid; gap: 2px; margin-bottom: 18px; border-radius: var(--radius-sm); overflow: hidden; }
.reminder { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 13px 18px; border: 0; background: var(--surface-2); cursor: pointer; width: 100%; text-align: left; color: var(--ink); }
.reminder.overdue, .reminder.today { background: var(--accent); color: var(--accent-ink); }
.reminder .when { font: 500 11px/16px var(--font-mono); text-transform: uppercase; letter-spacing: .14em; min-width: 96px; }
.reminder .sub { font: 400 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; margin-left: auto; opacity: .85; }
table.plist { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-sm); overflow: hidden; font-size: .9rem; }
table.plist th { text-align: left; padding: 12px 14px; background: var(--surface-2); }
table.plist td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
table.plist tr.row-click { cursor: pointer; }
table.plist tr.row-click:hover td { background: var(--surface-hover); }
table.plist tr.lane-sep td { background: var(--bg); font: 500 11px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.table-wrap { overflow-x: auto; }

/* tasks inside the project panel */
.ptasks { display: grid; gap: 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.ptask { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ptask:last-child { border-bottom: 0; }
.ptask.done .t { text-decoration: line-through; color: var(--muted); }
.ptask .t { font-weight: 500; overflow-wrap: anywhere; }
.ptask .sub { color: var(--muted); font-size: .82rem; margin-top: 2px; overflow-wrap: anywhere; }
.ptask .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.ptask select { width: auto; min-height: 30px; padding: 2px 8px; font-size: .78rem; border-radius: 999px; }
.ptask-group h5 { margin: 16px 0 8px; display: flex; justify-content: space-between; }
.ptask-group > details > summary { cursor: pointer; font: 500 11px/16px var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; }
.add-task { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) 110px 140px auto; align-items: end; }
@media (max-width: 560px) { .add-task { grid-template-columns: 1fr 1fr; } }
.tombstone { border-left: 3px solid var(--s-graveyard); padding: 12px 16px; background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .9rem; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .toast-host, .btn { display: none !important; } body { background: #fff; color: #000; } }
