/* ───────────────────────────────────────────────────────────────────────────
   Syntax Bio design system

   From the logo: brand red #DE0F19 and ink #191E22 on white. The look is a
   laboratory record: white paper on a faint graph-paper ground, journal-style
   ruled tables, monospaced figures and codes, serif titles. Red is kept for
   the brand, the primary action and things that are late or at risk.
   ─────────────────────────────────────────────────────────────────────────── */

:root {
  --red: #de0f19;
  --red-ink: #b80d16;            /* red text on white (AA) */
  --red-tint: #fdeced;
  --ink: #191e22;

  --ground: #f3f4f5;
  --grid-line: rgba(25, 30, 34, .045);
  --paper: #ffffff;
  --paper-2: #f8f9f9;
  --rule: #e1e4e7;
  --rule-strong: #191e22;
  --field-border: #c3c9ce;

  --text: #22282d;
  --heading: #191e22;
  --muted: #5d666e;
  --faint: #8a939b;

  --ok: #1f7a4d;   --ok-tint: #e8f4ed;
  --warn: #9a5b00; --warn-tint: #fbf1e1;
  --risk: var(--red-ink); --risk-tint: var(--red-tint);
  --info: #2a5b86; --info-tint: #e8eff6;

  --side-bg: #191e22;
  --side-text: #c4cacf;
  --side-faint: #7c868e;
  --side-hover: #232a2f;

  --focus: 0 0 0 3px rgba(222, 15, 25, .22);
  --shadow: 0 1px 2px rgba(25, 30, 34, .06);

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;

  --side-w: 236px;
  --top-h: 52px;
  --r: 3px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --red-ink: #ff5a61;
  --red-tint: rgba(222, 15, 25, .16);
  --ground: #0f1214;
  --grid-line: rgba(255, 255, 255, .03);
  --paper: #171b1e;
  --paper-2: #1c2125;
  --rule: #2b3237;
  --rule-strong: #c9ced2;
  --field-border: #3a4248;
  --text: #dde1e4;
  --heading: #f2f4f5;
  --muted: #a3abb2;
  --faint: #7b848c;
  --ok: #5cc48e;   --ok-tint: rgba(92, 196, 142, .12);
  --warn: #e3a64a; --warn-tint: rgba(227, 166, 74, .12);
  --info: #86b4dd; --info-tint: rgba(134, 180, 221, .12);
  --side-bg: #0b0d0f;
  --side-hover: #161a1d;
  --shadow: none;
  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 400 14px/1.55 var(--sans); color: var(--text);
  background-color: var(--ground);
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
                    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--heading); text-decoration: underline; text-decoration-color: var(--field-border);
    text-underline-offset: 2px; }
a:hover { color: var(--red-ink); text-decoration-color: currentColor; }
h1, h2, h3, h4 { color: var(--heading); margin: 0; }
p { margin: 0 0 .8em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 2px; padding: 0 4px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 6px 10px; z-index: 40; }
.skip:focus { left: 8px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 2px; }

/* ── Shell ────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh;
         background: linear-gradient(to right, var(--side-bg) var(--side-w), transparent var(--side-w)); }
.side { background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column;
        position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 14px 16px; text-decoration: none;
              border-bottom: 1px solid rgba(255, 255, 255, .07); }
.side-brand:hover { color: inherit; }
.side-brand img { width: 38px; height: 38px; border-radius: 2px; background: #fff; flex: none; }
.wordmark { font: 600 15px/1.1 var(--sans); letter-spacing: .14em; color: #fff; }
.wordmark b { color: var(--red); font-weight: 600; }
.side-brand small { display: block; margin-top: 4px; font: 500 10px/1 var(--mono); letter-spacing: .08em;
                    text-transform: uppercase; color: var(--side-faint); }
.side-group { padding: 14px 0 4px; }
.side-label { padding: 0 18px 6px; font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
              color: var(--side-faint); }
.side-link { display: flex; align-items: center; gap: 10px; padding: 7px 18px 7px 15px; color: var(--side-text);
             text-decoration: none; font-size: 13.5px; border-left: 3px solid transparent; }
.side-link:hover { background: var(--side-hover); color: #fff; }
.side-link[aria-current="page"] { color: #fff; background: var(--side-hover); border-left-color: var(--red); }
.side-link .n { margin-left: auto; font: 500 11px/1 var(--mono); color: var(--side-faint); }
.side-link .n.alert { color: #fff; background: var(--red); padding: 3px 5px; border-radius: 2px; }
.side-soon { opacity: .4; pointer-events: none; }
.side-foot { margin-top: auto; padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 12.5px; }
.side-foot .who { color: #fff; font-weight: 500; }
.side-foot .role { font: 500 10px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--side-faint); }
.side-foot .row { display: flex; gap: 14px; margin-top: 10px; }
.side-foot button { background: none; border: 0; padding: 0; color: var(--side-text); font: inherit; cursor: pointer; }
.side-foot button:hover { color: #fff; text-decoration: underline; }

.top { height: var(--top-h); display: flex; align-items: center; gap: 16px; padding: 0 28px;
       background: var(--paper); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 5; }
.crumbs { font: 500 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
          white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--red-ink); }
.crumbs .sep { margin: 0 8px; color: var(--field-border); }
.crumbs .here { color: var(--heading); }
.top-meta { margin-left: auto; display: flex; align-items: center; gap: 14px; font: 500 11px/1 var(--mono);
            color: var(--faint); letter-spacing: .04em; white-space: nowrap; }
.conf { color: var(--red-ink); border: 1px solid currentColor; padding: 4px 7px 3px; border-radius: 2px;
        letter-spacing: .12em; text-transform: uppercase; font-size: 10px; }
.top .menu-btn { display: none; }

.main { padding: 28px 28px 64px; max-width: 1320px; }

/* ── Page header ──────────────────────────────────────────────────────── */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; padding-bottom: 16px;
             margin-bottom: 22px; border-bottom: 2px solid var(--rule-strong); }
.page-head > div:first-child { flex: 1 1 420px; min-width: 0; }
.eyebrow { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--red-ink);
           margin-bottom: 10px; }
.title { font: 600 30px/1.15 var(--serif); letter-spacing: -.01em; }
.lede { margin: 8px 0 0; color: var(--muted); max-width: 76ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Panels ───────────────────────────────────────────────────────────── */
.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.stack > * + * { margin-top: 20px; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--rule); }
.panel-head h2 { font: 600 11.5px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.panel-head .count { font: 500 11px/1 var(--mono); color: var(--faint); }
.panel-head .actions { margin-left: auto; display: flex; gap: 6px; }
.panel-body { padding: 16px 18px; }
.panel-body > :last-child { margin-bottom: 0; }
.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.grid-3 { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.section { margin-top: 20px; }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }

/* ── Readouts (KPIs) ──────────────────────────────────────────────────── */
.readouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
            background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); }
.readout { padding: 14px 18px 16px; border-left: 1px solid var(--rule); position: relative; min-width: 0; }
.readout:first-child { border-left: 0; }
.readout::before { content: ""; position: absolute; left: 18px; top: 0; width: 18px; height: 2px; background: var(--red); }
.readout-label { font: 500 10.5px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
                 margin-top: 4px; }
.readout-value { font: 500 26px/1.15 var(--mono); color: var(--heading); margin: 8px 0 4px; letter-spacing: -.02em;
                 font-variant-numeric: tabular-nums; }
.readout-value.risk { color: var(--red-ink); }
.readout-note { font-size: 12px; color: var(--muted); }
.readout-note a { color: inherit; }

/* ── Tables (journal style: heavy rules top and bottom, hairlines between) ─ */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data thead th { font: 600 10.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase;
                      color: var(--muted); text-align: left; padding: 9px 12px 8px; white-space: nowrap;
                      border-top: 1.5px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data tbody tr:last-child td { border-bottom: 1.5px solid var(--rule-strong); }
table.data tbody tr:hover td { background: var(--paper-2); }
table.data th.num, table.data .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .code { font-family: var(--mono); font-weight: 500; white-space: nowrap; }
table.data .date { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
table.data .actions { text-align: right; white-space: nowrap; width: 1%; }
table.data .actions form { display: inline; }
table.data tfoot td { font-family: var(--mono); font-weight: 600; padding: 9px 12px; }
.sub { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.panel > .table-wrap table.data thead th { border-top: 0; }
.panel > .table-wrap table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.empty { color: var(--faint); text-align: center; padding: 22px; font-style: italic; }
table.data.compact td { padding: 7px 12px; }
.caption { font: 500 11px/1.4 var(--mono); color: var(--faint); padding: 10px 18px 12px; border-top: 1px solid var(--rule); }

/* ── Chips ────────────────────────────────────────────────────────────── */
.chip { display: inline-block; font: 600 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
        padding: 4px 6px 3px; border: 1px solid var(--field-border); border-radius: 2px; color: var(--muted);
        white-space: nowrap; vertical-align: 1px; background: var(--paper); }
.chip.ok { color: var(--ok); border-color: currentColor; background: var(--ok-tint); }
.chip.warn { color: var(--warn); border-color: currentColor; background: var(--warn-tint); }
.chip.risk { color: var(--risk); border-color: currentColor; background: var(--risk-tint); }
.chip.info { color: var(--info); border-color: currentColor; background: var(--info-tint); }
.chip.ink { color: var(--paper); background: var(--heading); border-color: var(--heading); }
.chip.red { color: #fff; background: var(--red); border-color: var(--red); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; font: 500 13px/1 var(--sans); padding: 9px 14px;
       border-radius: var(--r); border: 1px solid var(--field-border); background: var(--paper); color: var(--heading);
       text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--heading); color: var(--heading); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: #c20d16; border-color: #c20d16; color: #fff; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn.quiet:hover { color: var(--heading); }
.btn.danger { color: var(--red-ink); border-color: transparent; background: transparent; }
.btn.danger:hover { border-color: currentColor; color: var(--red-ink); }
.btn.sm { padding: 5px 9px; font-size: 12px; }

/* ── Forms ────────────────────────────────────────────────────────────── */
.form-grid { display: grid; gap: 14px 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > label, .label { font: 600 10.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.field .req { color: var(--red-ink); }
.hint { font-size: 12px; color: var(--faint); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], input[type=url],
input:not([type]), select, textarea {
  font: 400 14px/1.4 var(--sans); color: var(--text); background: var(--paper); width: 100%;
  border: 1px solid var(--field-border); border-radius: var(--r); padding: 8px 10px; }
input[type=date] { font-family: var(--mono); font-size: 13px; min-width: 0; display: block; text-align: left; }
input[type=date]::-webkit-date-and-time-value { text-align: left; }   /* Safari centres it otherwise */
.form-grid > .field { min-width: 0; }                                 /* a date box can't push past its column */
.form-grid > .field-check { align-self: start; padding-top: 30px; }  /* level with the box beside it */
select[multiple] { min-height: 120px; }
textarea { min-height: 84px; resize: vertical; }
textarea.tall { min-height: 300px; font-family: var(--mono); font-size: 13px; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: var(--focus); }
input[type=file] { font: inherit; font-size: 13px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; }
.check input { margin-top: 3px; accent-color: var(--red); }
.form-foot { display: flex; gap: 8px; align-items: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--rule); }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.inline-form .field { flex: 1 1 160px; }

/* ── Filters ──────────────────────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 16px; }
.filters .label { margin-right: 4px; }
.filters + .filters { margin-top: -8px; }
.filter { font: 500 12px/1 var(--mono); padding: 6px 9px; border: 1px solid var(--rule); border-radius: 2px;
          background: var(--paper); color: var(--muted); text-decoration: none; }
.filter:hover { color: var(--heading); border-color: var(--field-border); }
.filter[aria-current="true"] { background: var(--heading); color: var(--paper); border-color: var(--heading); }
.filter .n { opacity: .6; margin-left: 4px; }
.search { display: flex; gap: 8px; margin-bottom: 14px; max-width: 560px; }

/* ── Notes (callouts) and toasts ──────────────────────────────────────── */
.note { padding: 10px 14px; border: 1px solid var(--rule); border-left: 3px solid var(--muted); background: var(--paper);
        border-radius: var(--r); font-size: 13.5px; }
.note.risk { border-left-color: var(--red); background: var(--risk-tint); }
.note.warn { border-left-color: var(--warn); background: var(--warn-tint); }
.note.ok, .note.success { border-left-color: var(--ok); background: var(--ok-tint); }
.note.info { border-left-color: var(--info); background: var(--info-tint); }
.note + .note { margin-top: 8px; }
.toasts { position: fixed; right: 20px; top: 64px; z-index: 20; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toasts .note { box-shadow: 0 6px 18px rgba(25, 30, 34, .12); }

/* ── Facts (key–value) ────────────────────────────────────────────────── */
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); margin: 0; font-size: 13px; }
dl.facts dt { font: 600 10.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
              padding: 9px 16px 8px 0; border-bottom: 1px solid var(--rule); }
dl.facts dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--rule); min-width: 0; overflow-wrap: anywhere; }
dl.facts dt:last-of-type, dl.facts dd:last-of-type { border-bottom: 0; }

/* ── Prose (knowledge base, long notes) ───────────────────────────────── */
.prose { font: 400 16px/1.65 var(--serif); color: var(--text); max-width: 72ch; }
.prose h3 { font: 600 19px/1.3 var(--serif); margin: 1.4em 0 .5em; }
.prose h4, .prose h5 { font: 600 12px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; margin: 1.4em 0 .5em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 .9em; }
.prose li { margin: .2em 0; }
.prose code { font-size: 13px; }
.prose > :first-child { margin-top: 0; }
.text-block { font-size: 13.5px; }
.text-block p:last-child, .text-block ul:last-child { margin-bottom: 0; }
.text-block ul, .text-block ol { padding-left: 1.2em; margin: 0 0 .6em; }
.summary { font: italic 400 17px/1.55 var(--serif); color: var(--muted); border-left: 2px solid var(--red);
           padding-left: 14px; margin: 0 0 22px; max-width: 72ch; }
.sources { font: 400 12.5px/1.6 var(--mono); color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }

/* Knowledge-base cards */
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 16px 14px;
        text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.card:hover { border-color: var(--heading); color: var(--text); }
.card h3 { font: 600 17px/1.3 var(--serif); }
.card p { margin: 0; font-size: 13px; color: var(--muted); }
.card .meta { margin-top: auto; padding-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
              font: 500 11px/1 var(--mono); color: var(--faint); }
.cat-head { font: 600 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
            margin: 26px 0 10px; display: flex; align-items: center; gap: 10px; }
.cat-head::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.cat-head:first-child { margin-top: 0; }

/* Order progress */
.steps { display: flex; margin: 0; padding: 0; list-style: none; }
.steps li { flex: 1; position: relative; padding-top: 20px; font: 500 10.5px/1.3 var(--mono); letter-spacing: .06em;
            text-transform: uppercase; color: var(--faint); }
.steps li::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 2px; background: var(--rule); }
.steps li::after { content: ""; position: absolute; top: 0; left: 0; width: 12px; height: 12px; border-radius: 50%;
                   background: var(--paper); border: 2px solid var(--field-border); }
.steps li.done { color: var(--muted); }
.steps li.done::before { background: var(--heading); }
.steps li.done::after { background: var(--heading); border-color: var(--heading); }
.steps li.now { color: var(--red-ink); font-weight: 600; }
.steps li.now::after { background: var(--red); border-color: var(--red); }
.steps li:last-child::before { right: auto; width: 12px; }

/* Dates and states */
.due-past { color: var(--red-ink); font-weight: 600; }
.due-soon { color: var(--warn); font-weight: 600; }
.over { color: var(--red-ink); font-weight: 600; }
.st-done, .st-passed, .st-paid { color: var(--ok); }
.st-blocked, .st-failed { color: var(--red-ink); font-weight: 600; }

/* ── Sign-in ──────────────────────────────────────────────────────────── */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.signin-box { width: 100%; max-width: 400px; background: var(--paper); border: 1px solid var(--rule);
              border-top: 3px solid var(--red); border-radius: var(--r); box-shadow: 0 10px 30px rgba(25, 30, 34, .08); }
.signin-logo { background: #fff; padding: 26px 40px 14px; border-bottom: 1px solid var(--rule); }
.signin-logo img { display: block; width: 100%; max-width: 230px; margin: 0 auto; height: auto; }
.signin-form { padding: 22px 28px 24px; display: flex; flex-direction: column; gap: 14px; }
.signin-form .btn { justify-content: center; padding: 11px; margin-top: 4px; }
.signin-foot { font: 500 10.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
               text-align: center; padding: 0 28px 20px; }

/* ── Responsive and print ─────────────────────────────────────────────── */
@media (max-width: 1100px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); transform: translateX(-100%); transition: transform .2s; z-index: 30; }
  body.nav-open .side { transform: none; }
  .top .menu-btn { display: inline-flex; }
  .top { padding: 0 16px; }
  .top-meta .date { display: none; }
  .main { padding: 20px 16px 48px; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .readout { border-left: 0; border-top: 1px solid var(--rule); }
  .readout:first-child { border-top: 0; }
  .title { font-size: 25px; }
}
@media print {
  body { background: #fff; }
  .side, .top, .page-actions, .actions, .btn, form { display: none !important; }
  .shell { display: block; }
  .panel { box-shadow: none; break-inside: avoid; }
}

/* Tables inside articles */
.prose .table-wrap { margin: 0 0 1.1em; }
.prose table.data { font-family: var(--sans); font-size: 13px; line-height: 1.45; }
.text-block .table-wrap { margin: 0 0 .8em; }

/* Sortable, filterable tables (budget) */
.grid-filter { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; padding-top: 10px; padding-bottom: 12px;
  border-bottom: 1px solid var(--rule); }
.grid-filter .field { margin: 0; min-width: 130px; }
.grid-filter .field input[type="search"] { min-width: 200px; }
.grid-filter .check { margin-bottom: 8px; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable::after { content: " ↕"; color: var(--faint); font-size: 10px; }
th.sortable[aria-sort="ascending"]::after { content: " ↑"; color: var(--red-ink); }
th.sortable[aria-sort="descending"]::after { content: " ↓"; color: var(--red-ink); }
th.sortable:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
.grid-filter .field select, .grid-filter .field input[type="date"] { width: auto; max-width: 230px; }

/* Gantt chart (work plan) */
.gantt { --label: 380px; font-size: 12.5px; min-width: 900px; }
.gantt-panel { overflow-x: auto; }
.g-head, .g-row { display: grid; grid-template-columns: var(--label) 1fr; }
.g-head { position: sticky; top: 0; background: var(--paper); border-bottom: 1px solid var(--rule-strong); z-index: 2; }
.g-head .g-label { padding: 8px 12px; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.g-track { position: relative; min-height: 26px; }
.g-head .g-track { height: 44px; }
.g-gatemark { position: absolute; bottom: 2px; transform: translateX(-6px); font: 600 10px var(--mono); color: var(--ink); white-space: nowrap; cursor: help; }
.g-month { position: absolute; top: 0; bottom: 0; padding: 6px 4px 0; font: 11px var(--mono); color: var(--muted);
  border-left: 1px solid var(--rule); white-space: nowrap; overflow: hidden; }
.g-month.g-year { border-left-color: var(--rule-strong); }
.g-body { position: relative; }
.g-grid { position: absolute; top: 0; bottom: 0; left: var(--label); right: 0; pointer-events: none; }
.g-line { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--rule); opacity: .7; }
.g-line.g-year { border-left-color: var(--field-border); }
.g-today { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--red); z-index: 1; }
.g-gate { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--ink); opacity: .45; }
.g-row { border-bottom: 1px solid var(--rule); }
.g-row:hover { background: var(--paper-2); }
.g-row .g-label { padding: 5px 12px; line-height: 16px; display: flex; gap: 6px; align-items: baseline; min-width: 0; white-space: nowrap; overflow: hidden; border-right: 1px solid var(--rule); }
.g-row .g-label .code { font: 11px var(--mono); color: var(--muted); flex: none; }
.g-row .g-label .g-name { overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; min-width: 0; }
.g-row .g-label .g-owner { flex: none; max-width: 38%; overflow: hidden; text-overflow: ellipsis; font-size: 11px; color: var(--faint); }
.g-phase { background: var(--paper-2); }
.g-phase .g-label { padding-top: 8px; padding-bottom: 8px; }
.g-bar { position: absolute; top: 7px; height: 13px; border-radius: 3px; }
.g-phase .g-bar { top: 11px; height: 8px; border-radius: 2px; background: var(--ink); }
.g-todo { background: #9aa3aa; }
.g-prog { background: var(--info); }
.g-done { background: var(--ok); }
.g-late { background: var(--red); }
.g-bar.g-ms { width: 12px !important; height: 12px; margin-left: -6px; transform: rotate(45deg); border-radius: 2px; top: 8px; }
.g-later .g-bar { opacity: .45; }
.g-later .g-label { color: var(--faint); }
.gantt-key { display: flex; gap: 6px 12px; align-items: center; flex-wrap: wrap; margin-left: auto; color: var(--muted); }
.gantt-key .k { display: inline-block; width: 14px; height: 8px; border-radius: 2px; margin-right: -6px; }
.k-done { background: var(--ok); } .k-prog { background: var(--info); } .k-todo { background: #9aa3aa; } .k-late { background: var(--red); }
.k-gate { margin-right: -6px; }
@media (max-width: 760px) { .gantt { --label: 180px; } }
@media print { .gantt-panel { overflow: visible; } .gantt { min-width: 0; } }
