/* ERP Yeti design tokens. IBM Plex Sans and Mono, served from /fonts (the app's CSP allows no external resources), with the system fonts as fallback; tabular numerals for figures.
   Palette: cool grey neutrals, a dark sidebar and a teal accent, light and dark, text contrast >= 4.5:1. See design-system/ledger/MASTER.md. */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
:root {
  --bg: #f4f5f7; --panel: #ffffff; --ink: #14181f; --muted: #5b6472; --line: #e3e6eb; --line-soft: #eef0f3; --line-strong: #d3d8e0; --head-bg: #fafbfc;
  --accent: #0f766e; --accent-ink: #ffffff; --link: #0f766e; --focus: #0f766e;
  --ok: #14532d; --ok-bg: #ddf3e8; --warn: #6b4200; --warn-bg: #fcebc8; --bad: #8f1d1d; --bad-bg: #fbdddd; --info: #17407f; --info-bg: #dce8fb; --gray-bg: #eceef2; --gray: #3f4755;
  --good-text: #166b43; --bad-text: #b42318;
  --side-bg: #14181f; --side-ink: #c9cfd9; --side-hover: #1b2431; --side-on: #243142; --side-label: #8a93a3; --side-line: #263041; --side-icon-on: #5eead4;
  --radius: 10px; --radius-sm: 8px; --gap: 16px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font: 15px/1.45 var(--font);
}
/* Dark follows the system unless the person chose: data-theme="light" or "dark" on <html> (set from the Theme control, remembered in the browser). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117; --panel: #151b23; --ink: #e6eaf0; --muted: #9aa4b2; --line: #263041; --line-soft: #1e2733; --line-strong: #3a4558; --head-bg: #121821;
    --accent: #2dd4bf; --accent-ink: #0d1117; --link: #5eead4; --focus: #5eead4;
    --ok: #86efac; --ok-bg: #0f2e22; --warn: #fcd34d; --warn-bg: #2e2208; --bad: #fca5a5; --bad-bg: #3b1417; --info: #a5c4f5; --info-bg: #12254a; --gray-bg: #232c3a; --gray: #b6bfcc;
    --good-text: #86efac; --bad-text: #fca5a5;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117; --panel: #151b23; --ink: #e6eaf0; --muted: #9aa4b2; --line: #263041; --line-soft: #1e2733; --line-strong: #3a4558; --head-bg: #121821;
  --accent: #2dd4bf; --accent-ink: #0d1117; --link: #5eead4; --focus: #5eead4;
  --ok: #86efac; --ok-bg: #0f2e22; --warn: #fcd34d; --warn-bg: #2e2208; --bad: #fca5a5; --bad-bg: #3b1417; --info: #a5c4f5; --info-bg: #12254a; --gray-bg: #232c3a; --gray: #b6bfcc;
  --good-text: #86efac; --bad-text: #fca5a5;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--panel); padding: 8px; z-index: 50; }
a { color: var(--link); }
h1 { font-size: 1.65rem; font-weight: 600; letter-spacing: -.01em; margin: 0; } h2 { font-size: 1.05rem; font-weight: 600; margin: 24px 0 10px; } h3 { font-size: .95rem; font-weight: 600; margin: 14px 0 6px; }
h1.flush { margin: 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; } .mono { font-size: .88em; }
p.muted { margin: 4px 0 0; }

/* layout: dark sidebar, content on a light canvas */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side-bg); color: var(--side-ink); padding: 20px 12px; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 12px 16px; color: #fff; font-weight: 600; font-size: 1.1rem; letter-spacing: -.01em; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: #2dd4bf; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 16px 12px 6px; font-size: .69rem; letter-spacing: .08em; text-transform: uppercase; color: var(--side-label); font-weight: 500; }
.side nav a { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--side-ink); text-decoration: none; font-weight: 500; font-size: .93rem; transition: background-color .15s; }
.side nav a:hover { background: var(--side-hover); color: #fff; }
.side nav a[aria-current="page"] { background: var(--side-on); color: #fff; }
.side nav a[aria-current="page"] svg { stroke: var(--side-icon-on); }
.side svg { flex: none; }
.account { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--side-line); display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #2b3647; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 600; flex: none; }
.account-text { font-size: .82rem; line-height: 1.3; min-width: 0; flex: 1; } .account-text strong { display: block; color: #fff; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-text span { color: var(--side-label); }
.side .signout { background: transparent; border-color: #3a4558; color: var(--side-ink); padding: 4px 10px; min-height: 32px; font-size: .8rem; }
.side .signout:hover:not(:disabled) { border-color: #fff; color: #fff; }
main { padding: 28px 32px 56px; max-width: 1400px; min-width: 0; }
main:focus { outline: none; }
.pagehead { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.banner { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.banner.info { background: var(--info-bg); color: var(--info); }
.banner a { color: inherit; font-weight: 600; }
.banner-host { display: contents; }

/* cards and panels */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--gap); margin: 12px 0 6px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card .label { color: var(--muted); font-size: .84rem; } .card .value { font-family: var(--mono); font-size: 1.6rem; font-weight: 500; margin-top: 6px; font-variant-numeric: tabular-nums; }
.card .note { display: block; margin: 4px 0 0; padding: 0; border: 0; background: none; font-size: .82rem; color: var(--muted); }   /* not the boxed .note of the notifications list */
.card h2, .panel h2 { margin: 0 0 10px; }
.delta { font-size: .82rem; font-weight: 500; margin-top: 6px; } .delta.good { color: var(--good-text); } .delta.bad { color: var(--bad-text); } .delta span { color: var(--muted); font-weight: 400; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 12px 0; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.toolbar .grow { flex: 1; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 14px 0 12px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 9px 14px; color: var(--muted); white-space: nowrap; min-height: 0; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.split { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: flex-start; margin: 16px 0; } .split > .wide { flex: 2 1 520px; min-width: 0; } .split > .narrow { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.split .card, .split .panel { margin: 0; }
.cardhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; } .cardhead h2 { margin: 0; }
.legend { display: flex; gap: 16px; font-size: .78rem; color: var(--muted); }
.chart { width: 100%; height: auto; margin-top: 8px; display: block; } .chart .grid { stroke: var(--line); } .chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--mono); } .chart .axis-x { font-family: var(--font); }
.chart .area { fill: var(--accent); fill-opacity: .12; } .chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; } .chart .dot { fill: var(--accent); }
.listrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: .93rem; } .listrow:first-of-type { border-top: 0; }
.listrow small { display: block; color: var(--muted); font-size: .8rem; } .listrow .right strong { color: var(--bad-text); font-weight: 500; }
.bar-row { margin-bottom: 14px; } .bar-row .bar-label { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: .93rem; }
.bar { height: 8px; border-radius: 4px; background: var(--gray-bg); } .bar > span { display: block; height: 8px; border-radius: 4px; background: var(--accent); }
.bar.amber > span { background: #b7791f; } .bar.blue > span { background: #2f6fd1; } .bar.red > span { background: #c23b2e; }
a.card.kpi { display: block; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; } a.card.kpi:hover { border-color: var(--accent); box-shadow: 0 1px 4px rgba(20, 24, 31, .08); }
.kpi .more { display: inline-block; margin-top: 10px; font-size: .82rem; font-weight: 500; color: var(--accent); }
.scope { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin: 10px 0 0; } .scope .scopenote { margin: 0 0 10px; font-size: .82rem; color: var(--muted); }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: .78rem; font-weight: 500; color: var(--muted); } .fld select { min-width: 180px; }
.group-label { font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 16px 0 8px; } .group-label.first { margin-top: 0; }
.chart .prior { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 5 4; } .chart .endlabel { fill: var(--accent); font: 600 12px var(--mono); }
.chart .pt { fill: transparent; cursor: pointer; } .chart .pt:hover, .chart .pt:focus-visible { fill: var(--accent); fill-opacity: .18; stroke: var(--accent); stroke-width: 1.5; }
.legend .key { display: inline-flex; align-items: center; gap: 6px; } .legend .sw { display: inline-block; width: 14px; height: 3px; background: var(--accent); } .legend .sw.dash { height: 0; background: none; border-top: 2px dashed var(--muted); }
.late-note { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: -4px 0 14px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--bad-bg); color: var(--bad); font-size: .85rem; text-decoration: none; }
.listrow a.plain { color: inherit; text-decoration: none; } .listrow a.plain:hover { text-decoration: underline; } .listrow .btn, .cardhead .btn { text-decoration: none; }

/* controls */
button, .btn { font: inherit; font-weight: 500; font-size: .93rem; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); padding: 0 16px; min-height: 40px; border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, background-color .15s; }
button:hover:not(:disabled) { border-color: var(--ink); }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.primary:hover:not(:disabled), a.btn.primary:hover { filter: brightness(.93); border-color: var(--accent); }
button.danger { color: var(--bad-text); border-color: var(--bad-text); }
button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* a field's ring sits on its edge and the label above keeps a gap wider than the ring, so the ring never covers the label */
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }
label { display: block; font-size: .85rem; color: var(--muted); margin: 10px 0 6px; }
input, select, textarea { font: inherit; width: 100%; min-height: 40px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--panel); color: var(--ink); }
input[type="checkbox"] { width: auto; min-height: 0; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--bad-text); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 14px; }
.errsummary { margin: 8px 0 4px; padding: 10px 12px; border: 1px solid var(--bad-text); background: var(--bad-bg); color: var(--bad); border-radius: var(--radius-sm); }
.errsummary:focus { outline: 3px solid var(--focus); }
.errsummary strong { display: block; }

/* tables: numeric columns right-aligned in the mono face, horizontal scroll on narrow screens */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { background: var(--head-bg); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 500; white-space: nowrap; }
tr:last-child td { border-bottom: 0; } td.num, th.num { text-align: right; } td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
tbody tr.click { cursor: pointer; } tbody tr.click:hover { background: var(--head-bg); }
tfoot td { font-weight: 600; background: var(--head-bg); }
.lines td { padding: 4px 6px; } .lines input, .lines select { min-height: 36px; padding: 4px 8px; }
.empty { padding: 20px; text-align: center; color: var(--muted); }
.indent-1, .indent-2, .indent-3, .indent-4, .indent-5 { display: inline-block; } .indent-1 { padding-left: 0; } .indent-2 { padding-left: 18px; } .indent-3 { padding-left: 36px; } .indent-4 { padding-left: 54px; } .indent-5 { padding-left: 72px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 500; line-height: 18px; background: var(--gray-bg); color: var(--gray); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--info-bg); color: var(--info); }

/* dialogs and toasts */
dialog { border: 1px solid var(--line-strong); border-radius: 12px; padding: 0; background: var(--panel); color: var(--ink); width: min(900px, 96vw); box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(13, 17, 23, .6); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dlg-body { padding: 8px 18px 16px; max-height: 74vh; overflow: auto; } .dlg-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: min(420px, 90vw); }
.toast { background: var(--panel); border: 1px solid var(--line-strong); border-left: 4px solid var(--info-bg); border-radius: var(--radius-sm); padding: 10px 14px; box-shadow: 0 4px 16px rgba(0, 0, 0, .2); }
.toast.bad { border-left-color: var(--bad-text); } .toast.ok { border-left-color: var(--accent); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 16px; margin: 8px 0; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
/* sign-in: dark brand panel and a form panel */
.auth { display: flex; flex-wrap: wrap; min-height: 100vh; }
.auth-brand { flex: 1 1 420px; min-width: 0; background: var(--side-bg); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.auth-brand .brand { padding: 0; font-size: 1.25rem; } .auth-brand .brand-mark { width: 32px; height: 32px; border-radius: 8px; }
.auth-pitch { max-width: 440px; } .auth-pitch h2 { margin: 0 0 16px; font-size: 2.25rem; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; }
.auth-pitch p { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--side-ink); } .auth-foot { font-size: .82rem; color: var(--side-label); }
.auth-main { flex: 1 1 480px; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--panel); }
.auth-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; } .auth-form label { margin: 0 0 6px; }
.auth-title { font-size: 1.75rem; } .auth-form .banner { margin: 0; }
.auth-form input:not([type="checkbox"]) { min-height: 48px; border-color: #b9c0cb; } .auth-form button.wide { width: 100%; min-height: 48px; font-size: 1rem; }
 .pw-wrap { position: relative; } .pw-wrap input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 32px; padding: 0 10px; border: 0; background: transparent; color: var(--link); font-weight: 500; }
.pw-toggle:hover:not(:disabled) { border: 0; text-decoration: underline; }
.auth-points { margin: 20px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; color: var(--side-ink); counter-reset: step; }
.auth-points li { display: flex; gap: 12px; align-items: center; counter-increment: step; } .auth-points li::before { content: counter(step); width: 28px; height: 28px; border-radius: 50%; background: #2dd4bf; color: #14181f; font-weight: 600; font-size: .8rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 2px 0 12px; } .or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
button.google { width: 100%; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 1rem; }
.auth-alt { margin: 4px 0 0; text-align: center; color: var(--muted); font-size: .93rem; } .steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--ink); }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.account-btn { background: transparent; border: 0; padding: 0; text-align: left; color: inherit; min-height: 0; flex: 1; min-width: 0; cursor: pointer; } .account-btn:hover:not(:disabled) { border: 0; }
.check { display: flex; align-items: center; gap: 10px; font-size: .93rem; color: var(--ink); min-height: 40px; cursor: pointer; }
.auth-help { font-size: .86rem; line-height: 1.5; color: var(--muted); padding-top: 4px; } .auth-help code { font-family: var(--mono); font-size: .82rem; background: var(--gray-bg); padding: 1px 5px; border-radius: 4px; color: var(--ink); }
@media (max-width: 820px) { .auth-brand { padding: 28px 24px; gap: 24px; } .auth-pitch h2 { font-size: 1.6rem; } .auth-main { padding: 32px 20px; } }

/* touch screens: 44px targets */
@media (pointer: coarse) {
  button, .btn, input, select { min-height: 44px; } .side nav a { min-height: 44px; } .tabs button { padding: 12px 14px; } .lines input, .lines select { min-height: 44px; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); } .side { position: static; height: auto; padding: 12px; }   /* minmax(0, ...): a wide table scrolls inside its box instead of widening the whole page */
  .side nav { flex-direction: row; flex-wrap: wrap; gap: 4px; } .nav-label { display: none; } .account { margin-top: 12px; }
  main { padding: 18px 14px 48px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* theme control: three icons (match system, light, dark) */
.theme { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px; gap: 2px; background: var(--panel); }
.theme button { width: 30px; height: 28px; min-height: 28px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.theme button:hover { color: var(--ink); }
.theme button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.theme button:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.side-tools { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 0; }
.side .theme { border-color: #3a4558; background: transparent; }
.side .theme button { color: var(--side-ink); }
.side .theme button:hover { color: #fff; }
.side .theme button[aria-pressed="true"] { background: #2dd4bf; color: #0d1117; }
.icon-btn { width: 34px; height: 32px; min-height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--side-ink); cursor: pointer; }
.icon-btn:hover { background: var(--side-hover); color: #fff; }
.auth-theme { position: fixed; top: 14px; right: 14px; z-index: 5; }

/* permission matrix and platform console */
table.matrix { width: 100%; border-collapse: collapse; margin: 8px 0; } table.matrix th, table.matrix td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line-soft); }
table.matrix select { min-width: 140px; }
.platform-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 32px; background: var(--side-bg); color: #fff; }
.platform-bar strong { font-weight: 600; } .platform-bar .actions { display: flex; align-items: center; gap: 10px; }
.platform-main { padding: 24px 32px 56px; max-width: 1400px; }
.platform-main .tabs { flex-wrap: wrap; } .platform-main .cards { margin-top: 16px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } .platform-main .split { margin-top: 16px; }
.platform-main .toolbar > .fld, .platform-main .toolbar > div { margin: 0; }
@media (max-width: 820px) { .platform-bar { padding: 10px 14px; gap: 8px; } .platform-bar strong { font-size: .95rem; } .platform-main { padding: 16px 14px 48px; } }
.minibars { width: 100%; height: auto; display: block; margin-top: 8px; } .minibars rect.on { fill: var(--accent); } .minibars rect.off { fill: var(--line-strong); }
.minibars .axis { fill: var(--muted); font-size: 11px; font-family: var(--mono); } .minibars .axis-x { font-family: var(--font); }
.listrow .grow { flex: 1; } .listrow .badge { flex: none; }
.linkbtn { background: none; border: 0; padding: 0; min-height: 0; color: var(--link); font: inherit; font-weight: 500; text-align: left; cursor: pointer; text-decoration: underline; }
.secretbox { width: 100%; font-family: var(--mono); font-size: .9rem; resize: none; }
.setupkey { font-family: var(--mono); font-size: 1.15rem; letter-spacing: .08em; padding: 12px 14px; background: var(--gray-bg); border-radius: var(--radius-sm); word-break: break-all; }
.settings { max-width: 720px; } .toggle { margin: 12px 0; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; } .toggle input { width: auto; min-height: 0; } .toggle label { margin: 0; font-size: .95rem; color: var(--ink); } .toggle .muted { grid-column: 2; }

/* page engine */
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.dir-card { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); text-decoration: none; color: var(--ink); }
.dir-card:hover { border-color: var(--accent); } .dir-card:focus-visible { outline: 2px solid var(--focus); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.lane { background: var(--head-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.lane h3 { margin: 0 0 4px; }
.card-btn { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); color: var(--ink); cursor: pointer; }
.card-btn:hover { border-color: var(--accent); }
.toolbar select { width: auto; min-width: 150px; }

/* try-the-demo dialog */
dialog.demo-dlg { width: min(440px, calc(100vw - 32px)); padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog.demo-dlg::backdrop { background: rgba(8, 12, 18, .6); }
.demo-form { display: flex; flex-direction: column; gap: 14px; }
.demo-title { font-size: 1.35rem; font-weight: 600; margin: 0; }
.demo-form p { margin: 0; font-size: .9rem; line-height: 1.45; }
.demo-field { display: flex; flex-direction: column; gap: 6px; } .demo-field label { font-size: .85rem; font-weight: 500; }
.demo-field input { width: 100%; }
.demo-form .check { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.demo-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 6px; } .crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--link); text-decoration: underline; }
.dir-card.built { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.hub-built { margin-bottom: 18px; }
details.hub-group { margin: 14px 0; } details.hub-group > summary { cursor: pointer; font-weight: 600; font-size: 1.02rem; padding: 6px 0; } details.hub-group > .dir-grid { margin-top: 8px; }
.home-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin: 16px 0 8px; }
a.button { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--panel); color: var(--ink); text-decoration: none; font-weight: 500; }

/* views-tools */
.list-tools { gap: 8px; flex-wrap: wrap; } .list-tools select { width: auto; min-width: 150px; }
.vw-ctl { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); } .vw-ctl select { width: auto; min-width: 120px; }
.vw-chart { width: 100%; max-width: 760px; height: auto; display: block; }
.vw-gantt { max-width: none; }
.vw-lbl { fill: var(--ink); font-size: 12px; } .vw-val { fill: var(--muted); font-size: 11px; }
.vw-bar { fill: var(--accent); } .vw-bar.neg { fill: var(--bad-text); }
.vw-clickable { cursor: pointer; } .vw-clickable:focus-visible { outline: 2px solid var(--focus); }
.vw-grid { stroke: var(--line-soft); stroke-width: 1; }
.vw-piewrap { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; } .vw-pie { width: 240px; height: 240px; }
.vw-s { stroke: var(--panel); stroke-width: 1.5; }
.vw-s0 { fill: #0f766e; background: #0f766e; } .vw-s1 { fill: #2563eb; background: #2563eb; } .vw-s2 { fill: #d97706; background: #d97706; } .vw-s3 { fill: #9333ea; background: #9333ea; }
.vw-s4 { fill: #db2777; background: #db2777; } .vw-s5 { fill: #65a30d; background: #65a30d; } .vw-s6 { fill: #0891b2; background: #0891b2; } .vw-s7 { fill: #78716c; background: #78716c; }
.vw-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.vw-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.vw-pivot tfoot th, .vw-pivot tfoot td { border-top: 2px solid var(--line-strong); } .vw-pivot tbody th { text-align: left; font-weight: 600; }
.vw-cal-nav { align-items: center; gap: 12px; }
.vw-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--panel); }
.vw-dow { padding: 6px 8px; font-size: .78rem; color: var(--muted); background: var(--head-bg); border-bottom: 1px solid var(--line); }
.vw-day { min-height: 92px; padding: 4px 6px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.vw-day.out { background: var(--head-bg); color: var(--muted); } .vw-dn { font-size: .78rem; color: var(--muted); }
.vw-ev { text-align: left; font-size: .78rem; padding: 2px 6px; min-height: 0; border: 0; border-radius: 4px; background: var(--info-bg); color: var(--info); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-map { margin: 8px 0; padding-left: 18px; font-size: .9rem; }
.chatter-host { margin-top: 24px; }
.card-wrap { display: flex; flex-direction: column; gap: 4px; } .card-move { font-size: .8rem; padding: 2px 6px; min-height: 0; color: var(--muted); }
.card-btn.dragging { opacity: .5; } .lane.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }

/* collab */
.chatter { margin: 18px 0; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.chatter h2 { margin: 0 0 10px; font-size: 1.05rem; }
.chatter-new textarea { resize: vertical; }
.chatter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.chat-inline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; width: 100%; } .chat-inline input { flex: 1 1 200px; width: auto; }
.chat-approval { padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--line-strong); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); background: var(--head-bg); }
.chat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.chat-comment { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.chat-body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.chat-event { font-size: .88rem; color: var(--muted); padding-left: 4px; }
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.note { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; }
.note.unread { border-left: 4px solid var(--accent); }
.note-main { flex: 1 1 320px; min-width: 0; text-align: left; background: none; border: 0; padding: 0; color: inherit; font: inherit; overflow-wrap: anywhere; }
button.note-main { cursor: pointer; min-height: 0; } .note-actions { display: flex; gap: 8px; }
.collab-bell { position: relative; }
.collab-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bad-text); color: #fff; font-size: .68rem; line-height: 16px; text-align: center; }
.collab-badge[hidden] { display: none; }
dialog.palette { width: min(560px, 96vw); margin-top: 10vh; }
.pal-list { list-style: none; margin: 10px 0 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.pal-list li[role=option] { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.pal-list li[aria-selected=true], .pal-list li[role=option]:hover { background: var(--info-bg); }
.pal-head { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px 2px; } .pal-none { padding: 8px 10px; }
.disc { display: grid; grid-template-columns: 220px 1fr; gap: 16px; } .disc-side { display: flex; flex-direction: column; gap: 2px; }
.disc-side a { padding: 7px 10px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; } .disc-side a[aria-current=page] { background: var(--info-bg); font-weight: 600; }
.disc-main h2 { margin: 0 0 6px; }
@media (max-width: 720px) { .disc { grid-template-columns: 1fr; } }

/* form controls: one look for every dropdown and input. The arrow is drawn with theme colours (no native chevron jammed against the edge), controls share a height with buttons. */
select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px; text-overflow: ellipsis; line-height: 1.3;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(50% + 1px), calc(100% - 15px) calc(50% + 1px); background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
select[multiple] { background-image: none; padding-right: 12px; cursor: default; }
select option { background: var(--panel); color: var(--ink); }
input:hover:not(:disabled):not([type="checkbox"]):not([type="radio"]), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--focus); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:disabled, select:disabled, textarea:disabled { opacity: .6; cursor: not-allowed; background-color: var(--head-bg); }
/* a label and its control side by side, as in the graph and pivot settings: same height, aligned, equal-looking widths */
.vw-ctl { margin: 0; white-space: nowrap; gap: 8px; }
.vw-ctl select { width: 190px; min-width: 0; }
.toolbar { gap: 12px 16px; }
.toolbar select { min-width: 170px; }
@media (max-width: 720px) { .toolbar .vw-ctl { width: 100%; justify-content: space-between; } .toolbar .vw-ctl select, .toolbar select { flex: 1; max-width: none; } }

/* workspace switcher: the sidebar button and the list of workspaces (also used on the sign-in chooser) */
.ws-switch { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: calc(100% - 8px); margin: 0 4px 10px; padding: 8px 12px; background: var(--side-hover); border: 1px solid var(--side-line); border-radius: var(--radius-sm); color: var(--side-ink); text-align: left; cursor: pointer; min-height: 0; }
.ws-switch:hover:not(:disabled) { background: var(--side-on); color: #fff; }
.ws-switch span { display: flex; flex-direction: column; min-width: 0; } .ws-switch small { font-size: .69rem; letter-spacing: .08em; text-transform: uppercase; color: var(--side-label); }
.ws-switch strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.ws-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; padding: 10px 14px; text-align: left; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--ink); cursor: pointer; }
.ws-item:hover:not(:disabled) { border-color: var(--accent); }
.ws-item[aria-current="true"] { border-color: var(--accent); background: var(--head-bg); cursor: default; }
