/* Layout: single-screen shell — toolbar / tabs / work area (table | chart) / status bar; details in a side panel. */
@font-face { font-family: "Plex Sans"; font-weight: 400; font-display: swap; src: url("fonts/IBMPlexSans-Regular-Latin1.woff2") format("woff2"); }
@font-face { font-family: "Plex Sans"; font-weight: 600; font-display: swap; src: url("fonts/IBMPlexSans-SemiBold-Latin1.woff2") format("woff2"); }
@font-face { font-family: "Plex Condensed"; font-weight: 400; font-display: swap; src: url("fonts/IBMPlexSansCondensed-Regular-Latin1.woff2") format("woff2"); }
@font-face { font-family: "Plex Condensed"; font-weight: 600; font-display: swap; src: url("fonts/IBMPlexSansCondensed-SemiBold-Latin1.woff2") format("woff2"); }

:root {
  --font-ui: "Plex Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-data: "Plex Condensed", "Arial Narrow", "Segoe UI", system-ui, sans-serif;

  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --surface-3: #e4e8ee;
  --line: #dfe3ea;
  --line-strong: #c4ccd8;
  --fg: #19202c;
  --fg-2: #4f5a6c;
  --fg-3: #858fa0;
  --brand: #1f6f43;
  --brand-soft: #a7f3c9;
  --brand-ink: #ffffff;
  --focus: #2a8a57;
  --sel: rgba(42, 99, 214, .11);
  --sel-strong: rgba(42, 99, 214, .2);

  --bar: #4a7fd4;
  --bar-edge: #2f5ea8;
  --bar-prog: #1d3b72;
  --crit: #d9483f;
  --crit-edge: #a8302a;
  --crit-prog: #6f1913;
  --summary: #2b313c;
  --milestone: #2b313c;
  --baseline: #aab1bc;
  --link: #6b7587;
  --today: #e08a00;
  --deadline: #1e9e5a;
  --nonwork: #eef0f4;
  --gridline: #eceff3;
  --gridline-strong: #d9dee6;
  --inactive: #c3c8d0;
  --note: #e0a100;

  --shadow: 0 10px 30px rgba(20, 30, 50, .14), 0 2px 6px rgba(20, 30, 50, .08);
  --row: 26px;
  --radius: 7px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11151c; --surface: #171c25; --surface-2: #1d2330; --surface-3: #262d3b;
    --line: #283041; --line-strong: #39435a; --fg: #e3e8f0; --fg-2: #a4aec0; --fg-3: #6f7a8d;
    --brand: #2a8a57; --brand-soft: #a7f3c9; --brand-ink: #ffffff; --focus: #5fd39a;
    --sel: rgba(110, 160, 245, .14); --sel-strong: rgba(110, 160, 245, .24);
    --bar: #4f86e0; --bar-edge: #86acee; --bar-prog: #d3e2fb;
    --crit: #e2625a; --crit-edge: #f19a93; --crit-prog: #ffe0dc;
    --summary: #cdd5e1; --milestone: #dfe5ee; --baseline: #586276; --link: #8995a9;
    --today: #f2a33a; --deadline: #43c483; --nonwork: #141921; --gridline: #1f2532; --gridline-strong: #2b3343;
    --inactive: #4a5263; --note: #f0b429;
    --shadow: 0 12px 34px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11151c; --surface: #171c25; --surface-2: #1d2330; --surface-3: #262d3b;
  --line: #283041; --line-strong: #39435a; --fg: #e3e8f0; --fg-2: #a4aec0; --fg-3: #6f7a8d;
  --brand: #2a8a57; --brand-soft: #a7f3c9; --brand-ink: #ffffff; --focus: #5fd39a;
  --sel: rgba(110, 160, 245, .14); --sel-strong: rgba(110, 160, 245, .24);
  --bar: #4f86e0; --bar-edge: #86acee; --bar-prog: #d3e2fb;
  --crit: #e2625a; --crit-edge: #f19a93; --crit-prog: #ffe0dc;
  --summary: #cdd5e1; --milestone: #dfe5ee; --baseline: #586276; --link: #8995a9;
  --today: #f2a33a; --deadline: #43c483; --nonwork: #141921; --gridline: #1f2532; --gridline-strong: #2b3343;
  --inactive: #4a5263; --note: #f0b429;
  --shadow: 0 12px 34px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
a { color: var(--brand); }
:root[data-theme="dark"] a { color: var(--focus); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) a { color: var(--focus); } }

.app {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar { grid-row: 1; }
.tabs { grid-row: 2; }
.main { grid-row: 3; }
.status { grid-row: 4; }
body:not(.has-project) .needs-project { display: none !important; }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-name { font-weight: 600; font-size: 14px; letter-spacing: .01em; }
.doc-name { font-size: 12.5px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34ch; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1 1 auto; justify-content: flex-end; }
.group { display: flex; align-items: center; gap: 4px; padding-left: 10px; border-left: 1px solid var(--line); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 11px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--fg);
  cursor: pointer; white-space: nowrap; font-size: 13.5px;
  transition: background-color .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { background: var(--surface-3); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.icon { padding: 0; width: 32px; justify-content: center; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.lg { height: 40px; padding: 0 18px; font-size: 14.5px; }
.btn.toggle[aria-pressed="true"] { background: var(--sel); border-color: var(--bar-edge); color: var(--fg); }
.btn.toggle[aria-pressed="true"]::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--crit); }
#tglBaseline[aria-pressed="true"]::before { background: var(--baseline); border-radius: 1px; height: 4px; width: 10px; }

.select {
  height: 32px; padding: 0 28px 0 10px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--surface);
  appearance: none; cursor: pointer; font-size: 13.5px;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-2) 50%), linear-gradient(135deg, var(--fg-2) 50%, transparent 50%);
  background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.search {
  display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface);
  min-width: 150px; flex: 0 1 240px;
}
.search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus) 25%, transparent); }
.search svg { width: 16px; height: 16px; color: var(--fg-3); flex: none; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; min-width: 0; font-size: 13.5px; }

.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50;
  min-width: 290px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.menu > button, .menu-check {
  display: flex; align-items: center; gap: 8px; text-align: left;
  border: 0; background: none; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px;
}
.menu > button:hover, .menu-check:hover { background: var(--surface-2); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.menu-check input { accent-color: var(--brand); width: 15px; height: 15px; margin: 0; }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 10px; font-size: 13.5px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; }
.seg button { border: 0; background: none; padding: 4px 10px; cursor: pointer; font-size: 12.5px; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-pressed="true"] { background: var(--sel-strong); font-weight: 600; }

/* ---- tabs ---- */
.tabs {
  display: flex; gap: 2px; padding: 0 16px; background: var(--surface);
  border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none;
}
.tabs button {
  border: 0; background: none; padding: 9px 12px 8px; cursor: pointer; white-space: nowrap;
  color: var(--fg-2); font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { color: var(--fg); }
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--brand); font-weight: 600; }
.count { font-family: var(--font-data); color: var(--fg-3); font-weight: 400; margin-left: 2px; font-variant-numeric: tabular-nums; }

/* ---- main area ---- */
.main { position: relative; min-height: 0; overflow: hidden; }
.view { position: absolute; inset: 0; }

/* initial state */
.welcome { position: absolute; inset: 0; overflow: auto; display: grid; place-items: center; padding: 24px 16px; }
.drop {
  width: min(620px, 100%);
  border: 1.5px dashed var(--line-strong); border-radius: 16px; background: var(--surface);
  padding: 34px 32px 28px; text-align: center;
  transition: border-color .15s, background-color .15s;
}
.drop.over, body.dragging .drop { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.drop-art { width: 220px; max-width: 100%; height: auto; margin: 0 auto 18px; display: block; }
.drop-grid path { stroke: var(--gridline-strong); stroke-width: 1; fill: none; }
.drop-bar { fill: var(--bar); }
.drop-bar.crit { fill: var(--crit); }
.drop-link { stroke: var(--link); stroke-width: 1.4; fill: none; }
.drop-ms { fill: var(--milestone); }
.drop h1 { font-size: 22px; line-height: 1.25; margin: 0 0 8px; font-weight: 600; text-wrap: balance; letter-spacing: -.005em; }
.drop .lead { margin: 0 auto 20px; color: var(--fg-2); max-width: 46ch; text-wrap: pretty; }
.drop-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.formats {
  margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; font-size: 12.5px;
}
.formats dt { font-weight: 600; color: var(--fg); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; margin-bottom: 2px; }
.formats dd { margin: 0; color: var(--fg-2); }

/* Gantt */
.view-gantt { display: flex; }
.grid-pane { flex: 0 0 auto; width: 46%; min-width: 120px; max-width: calc(100% - 140px); background: var(--surface); position: relative; }
.grid-scroll { position: absolute; inset: 0; overflow-x: auto; overflow-y: hidden; display: flex; flex-direction: column; }
.grid-head, .grid-body { min-width: max-content; }
.grid-head {
  flex: none; display: flex; height: 48px; position: sticky; top: 0; z-index: 2;
  background: var(--surface-2); border-bottom: 1px solid var(--line-strong);
}
.gh {
  position: relative; display: flex; align-items: flex-end; padding: 0 8px 7px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-2);
  border-right: 1px solid var(--line); white-space: nowrap; overflow: hidden; user-select: none; flex: none;
}
.gh.r { justify-content: flex-end; }
.gh .rz { position: absolute; right: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 1; }
.grid-body { position: relative; flex: 1 1 auto; overflow: hidden; outline: none; font-family: var(--font-data); font-size: 13.5px; }
.gr {
  position: absolute; left: 0; height: var(--row); display: flex; align-items: stretch;
  border-bottom: 1px solid var(--gridline); cursor: default; min-width: 100%;
}
.gr.sel { background: var(--sel-strong); }
.gr.sum { font-weight: 600; }
.gr.inactive { color: var(--fg-3); text-decoration: line-through; }
.gc {
  flex: none; padding: 0 8px; display: flex; align-items: center; overflow: hidden; white-space: nowrap;
  border-right: 1px solid var(--gridline); font-variant-numeric: tabular-nums;
}
.gc span.t { overflow: hidden; text-overflow: ellipsis; }
.gc.r { justify-content: flex-end; }
.gc.id { color: var(--fg-3); }
.gc.name { gap: 4px; }
.tw { width: 16px; height: 16px; flex: none; display: grid; place-items: center; border-radius: 4px; cursor: pointer; color: var(--fg-2); }
.tw:hover { background: var(--surface-3); color: var(--fg); }
.tw svg { width: 10px; height: 10px; transition: transform .12s; }
.tw.closed svg { transform: rotate(-90deg); }
.tw.leaf { cursor: default; }
.tw.leaf:hover { background: none; }
.ms-dot { width: 7px; height: 7px; background: var(--fg-3); transform: rotate(45deg); }
.note-dot { width: 8px; height: 10px; flex: none; margin-left: auto; border-radius: 1px; background: var(--note); opacity: .9; }
.crit-mark { width: 3px; align-self: stretch; margin: 5px 0; border-radius: 2px; background: var(--crit); flex: none; }
mark { background: color-mix(in srgb, var(--today) 35%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }

.splitter { flex: 0 0 6px; cursor: col-resize; background: var(--surface-2); border-left: 1px solid var(--line); border-right: 1px solid var(--line-strong); touch-action: none; }
.splitter:hover, .splitter.active { background: color-mix(in srgb, var(--brand) 30%, var(--surface-2)); }

.chart-pane { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; background: var(--surface); }
.chart-head { flex: none; height: 48px; width: 100%; display: block; border-bottom: 1px solid var(--line-strong); }
.chart-area { position: relative; flex: 1 1 auto; min-height: 0; }
.chart-canvas { position: absolute; left: 0; top: 0; display: block; pointer-events: none; }
.chart-scroll { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; }
.chart-scroll.panning { cursor: grabbing; }
.chart-sizer { width: 1px; height: 1px; }

.tooltip {
  position: fixed; z-index: 60; pointer-events: none; max-width: 340px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow);
  padding: 9px 11px; font-size: 12.5px; line-height: 1.45;
}
.tooltip b { font-size: 13px; display: block; margin-bottom: 3px; }
.tooltip .k { color: var(--fg-3); }
.tooltip .crit { color: var(--crit); font-weight: 600; }
.tooltip .row { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; }

/* resource / assignment tables */
.view-table { overflow: hidden; }
.table-scroll { position: absolute; inset: 0; overflow: auto; }
table.data { border-collapse: separate; border-spacing: 0; min-width: 100%; font-family: var(--font-data); font-size: 13.5px; font-variant-numeric: tabular-nums; }
table.data th {
  position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; white-space: nowrap;
  font-family: var(--font-ui); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--fg-2);
  padding: 10px 12px 8px; border-bottom: 1px solid var(--line-strong); cursor: pointer; user-select: none;
}
table.data th:hover { color: var(--fg); }
table.data th[aria-sort]::after { content: " ▲"; font-size: 9px; }
table.data th[aria-sort="descending"]::after { content: " ▼"; }
table.data td { padding: 0 12px; height: 30px; border-bottom: 1px solid var(--gridline); white-space: nowrap; background: var(--surface); }
table.data td.wrap { white-space: normal; min-width: 220px; max-width: 420px; padding-block: 5px; }
table.data .r { text-align: right; }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: var(--sel); }
.empty-note { padding: 32px 16px; color: var(--fg-2); }

/* project information */
.view-info { overflow: auto; }
.info { max-width: 980px; margin: 0 auto; padding: 24px 16px 40px; }
.info h2 { font-size: 20px; margin: 0 0 4px; font-weight: 600; text-wrap: balance; }
.info .sub { color: var(--fg-2); margin: 0 0 20px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.kpi .l { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); font-weight: 600; }
.kpi .v { font-family: var(--font-data); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .bar { height: 5px; background: var(--surface-3); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.kpi .bar i { display: block; height: 100%; background: var(--brand); }
.props { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.props dt, .props dd { margin: 0; padding: 9px 14px; border-bottom: 1px solid var(--gridline); }
.props dt { color: var(--fg-2); font-size: 13px; }
.props dd { font-family: var(--font-data); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; white-space: pre-line; }
.props dt:nth-last-of-type(1), .props dd:last-of-type { border-bottom: 0; }

/* details panel */
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); z-index: 20;
  background: var(--surface); border-left: 1px solid var(--line-strong); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  animation: slide .16s ease-out;
}
@keyframes slide { from { transform: translateX(16px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 2px 0 0; font-size: 17px; line-height: 1.3; font-weight: 600; text-wrap: balance; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-3); font-weight: 600; }
.drawer-body { overflow: auto; padding: 4px 16px 24px; }
.drawer-body h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-2); margin: 18px 0 6px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 2px; }
.chip { font-size: 12px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--fg-2); background: var(--surface-2); }
.chip.crit { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 45%, transparent); background: color-mix(in srgb, var(--crit) 9%, transparent); font-weight: 600; }
.chip.ok { color: var(--deadline); border-color: color-mix(in srgb, var(--deadline) 45%, transparent); background: color-mix(in srgb, var(--deadline) 9%, transparent); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 0; font-size: 13.5px; }
.kv dt { color: var(--fg-2); padding: 5px 0; border-bottom: 1px solid var(--gridline); }
.kv dd { margin: 0; padding: 5px 0; border-bottom: 1px solid var(--gridline); font-family: var(--font-data); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.progress { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; margin: 8px 0 4px; }
.progress i { display: block; height: 100%; background: var(--bar); }
.linklist { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.linklist li { display: flex; gap: 8px; align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--gridline); }
.linklist .lid { font-family: var(--font-data); color: var(--fg-3); min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums; }
.linklist button { border: 0; background: none; padding: 0; color: var(--fg); text-align: left; cursor: pointer; flex: 1; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.linklist button:hover { text-decoration-color: currentColor; }
.linklist .ltype { font-family: var(--font-data); color: var(--fg-2); font-size: 12.5px; white-space: nowrap; }
.notes { white-space: pre-wrap; font-size: 13.5px; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin: 0; overflow-wrap: anywhere; }

/* progress */
.busy { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(2px); padding: 16px; }
.busy-card { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); padding: 18px 22px; max-width: 460px; }
.busy-title { font-weight: 600; }
.busy-sub { color: var(--fg-2); font-size: 13px; margin-top: 2px; }
.spinner { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* status bar */
.status {
  display: flex; gap: 6px 22px; flex-wrap: wrap; align-items: center;
  padding: 5px 16px calc(5px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line);
  font-family: var(--font-data); font-size: 12.5px; color: var(--fg-2); font-variant-numeric: tabular-nums;
  min-height: 28px;
}
.status span:empty { display: none; }
#stFile { color: var(--fg); max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toast {
  position: fixed; left: 50%; bottom: calc(44px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 80;
  width: max-content; max-width: min(560px, calc(100% - 32px));
  background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 9px; box-shadow: var(--shadow); font-size: 13.5px;
}
.toast.err { background: var(--crit); color: #fff; }

.dialog { border: 1px solid var(--line-strong); border-radius: 14px; padding: 0; background: var(--surface); color: var(--fg); box-shadow: var(--shadow); width: min(560px, calc(100% - 32px)); }
.dialog::backdrop { background: rgba(10, 14, 20, .45); }
.dialog form { padding: 22px 24px 18px; }
.dialog h2 { margin: 0 0 6px; font-size: 19px; }
.dialog h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-2); margin: 18px 0 6px; }
.dialog p { margin: 0 0 10px; color: var(--fg-2); }
.about-list { padding-left: 18px; margin: 0; color: var(--fg-2); font-size: 13.5px; display: grid; gap: 6px; }
.keys { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.keys td { padding: 5px 0; border-bottom: 1px solid var(--gridline); }
.keys td:first-child { width: 48%; color: var(--fg-2); }
kbd { font-family: var(--font-data); font-size: 12px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface-2); }
.dialog .fine { font-size: 12.5px; margin: 14px 0 0; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 16px; }

@media (max-width: 860px) {
  .hide-sm { display: none !important; }
  .topbar { gap: 8px 12px; padding: 8px 12px; }
  .toolbar { justify-content: flex-start; gap: 6px; }
  .group { padding-left: 6px; }
  .search { flex: 1 1 100%; order: 10; }
  .doc-name { max-width: 24ch; }
  .tabs { padding: 0 8px; }
  .status { padding-inline: 12px; }
  #stDates, #stFormat { display: none; }
  .drawer { width: 100%; }
  .formats { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
