/* POS Reconciliation, a Fayda Labs product. Brand: Ink #0E1A24, Amber #F2A93B (one highlight at a
   time), Chalk #F5F3EE, Slate #5B6B78; Space Grotesk for headings and figures, JetBrains Mono for
   IDs and labels, IBM Plex Sans for reading. Quiet borders, tabular numbers. Light is the default; dark follows the computer unless the person picks one
   with the theme switch (data-theme on <html>). */

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/plex-sans-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/plex-sans-500.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/plex-sans-600.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/plex-sans-700.woff2) format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/space-grotesk-400.woff2) format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/space-grotesk-500.woff2) format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/space-grotesk-600.woff2) format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/space-grotesk-700.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/jetbrains-mono-400.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/jetbrains-mono-500.woff2) format("woff2"); }

/* ---------- tokens ---------- */
:root {
  --bg: #f5f3ee;
  --card: #ffffff;
  --raised: #ffffff;
  --ink: #0e1a24;
  --ink-2: #2b3a46;
  --muted: #5b6b78;
  --line: #e6e2d9;
  --line-strong: #cfc9bd;
  --chip: #eeeae2;
  --head-bg: #f9f7f3;
  --primary: #0e1a24;
  --primary-hover: #1c2c3a;
  --primary-ink: #f5f3ee;
  --accent: #9a5f0a;
  --amber: #f2a93b;
  --gold: #9a5f0a;
  --nav-active-bg: #0e1a24;
  --nav-active-ink: #f5f3ee;
  --ok: #1b6e3a;   --ok-bg: #e4f3e8;
  --bad: #b3261e;  --bad-bg: #fbe9e7;
  --warn: #8a5300; --warn-bg: #fdf1dc;
  --info: #2b5e8f; --info-bg: #e6eff8;
  --focus: #f2a93b;
  --shadow-sm: 0 1px 2px rgb(14 26 36 / .06);
  --shadow-md: 0 1px 3px rgb(14 26 36 / .06), 0 6px 16px -6px rgb(14 26 36 / .10);
  --shadow-lg: 0 12px 32px -8px rgb(14 26 36 / .25);
  --tooltip-bg: #0e1a24;
  --tooltip-ink: #f5f3ee;
  --logo-light: block;
  --logo-dark: none;
  --radius: 12px;
  --radius-sm: 8px;
  --side-w: 248px;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --c1: #0e1a24; --c2: #f2a93b; --c3: #2a7f8f; --c4: #c0392b; --c5: #6b5ca5; --c6: #5b6b78; --c7: #7a9a2e; --c8: #b89b6a;
  color-scheme: light;
}

/* Dark: tonal navy, not inverted black. Same tokens, set twice: once when the person picks dark,
   once when they follow a computer that is in dark mode. */
:root[data-theme="dark"] {
  --bg: #0b141c;
  --card: #122029;
  --raised: #182a35;
  --ink: #f5f3ee;
  --ink-2: #d6d2c9;
  --muted: #9aa8b4;
  --line: #22343f;
  --line-strong: #324654;
  --chip: #1a2b36;
  --head-bg: #0f1c25;
  --primary: #f2a93b;
  --primary-hover: #f6b95d;
  --primary-ink: #0e1a24;
  --accent: #f2a93b;
  --amber: #f2a93b;
  --gold: #f2a93b;
  --nav-active-bg: #1a2b36;
  --nav-active-ink: #f5f3ee;
  --ok: #5fd38d;   --ok-bg: #0f2b1d;
  --bad: #ff8a80;  --bad-bg: #3a1718;
  --warn: #f5c062; --warn-bg: #33260e;
  --info: #8cb4ff; --info-bg: #15264a;
  --focus: #f2a93b;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .3);
  --shadow-md: 0 1px 3px rgb(0 0 0 / .35), 0 8px 20px -8px rgb(0 0 0 / .45);
  --shadow-lg: 0 16px 40px -10px rgb(0 0 0 / .6);
  --tooltip-bg: #f5f3ee;
  --tooltip-ink: #0e1a24;
  --logo-light: none;
  --logo-dark: block;
  --c1: #f2a93b; --c2: #7cc4d4; --c3: #5fd38d; --c4: #ff8a80; --c5: #b7a6e8; --c6: #9aa8b4; --c7: #c9d86a; --c8: #e0c9a0;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
  --bg: #0b141c;
  --card: #122029;
  --raised: #182a35;
  --ink: #f5f3ee;
  --ink-2: #d6d2c9;
  --muted: #9aa8b4;
  --line: #22343f;
  --line-strong: #324654;
  --chip: #1a2b36;
  --head-bg: #0f1c25;
  --primary: #f2a93b;
  --primary-hover: #f6b95d;
  --primary-ink: #0e1a24;
  --accent: #f2a93b;
  --amber: #f2a93b;
  --gold: #f2a93b;
  --nav-active-bg: #1a2b36;
  --nav-active-ink: #f5f3ee;
  --ok: #5fd38d;   --ok-bg: #0f2b1d;
  --bad: #ff8a80;  --bad-bg: #3a1718;
  --warn: #f5c062; --warn-bg: #33260e;
  --info: #8cb4ff; --info-bg: #15264a;
  --focus: #f2a93b;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .3);
  --shadow-md: 0 1px 3px rgb(0 0 0 / .35), 0 8px 20px -8px rgb(0 0 0 / .45);
  --shadow-lg: 0 16px 40px -10px rgb(0 0 0 / .6);
  --tooltip-bg: #f5f3ee;
  --tooltip-ink: #0e1a24;
  --logo-light: none;
  --logo-dark: block;
  --c1: #f2a93b; --c2: #7cc4d4; --c3: #5fd38d; --c4: #ff8a80; --c5: #b7a6e8; --c6: #9aa8b4; --c7: #c9d86a; --c8: #e0c9a0;
  color-scheme: dark;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; text-decoration-color: var(--amber); }
a:hover { text-decoration: underline; }
h1, h2, h3, .kpi .value, .product-name { font-family: "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif; }
h1 { font-size: 1.55rem; line-height: 1.2; font-weight: 700; margin: 0 0 .3rem; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; line-height: 1.35; font-weight: 600; margin: 0; letter-spacing: -.01em; }
h3 { font-size: .95rem; font-weight: 600; margin: 0 0 .4rem; }
p { margin: .25rem 0; }
small, .muted { color: var(--muted); }
strong { font-weight: 600; }
.mono { font-family: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .88em; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 30%, transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { flex: none; display: block; }
::selection { background: color-mix(in srgb, var(--amber) 35%, transparent); }

/* ---------- app shell: sidebar on wide screens, a top bar on phones ---------- */
.shell { min-height: 100vh; min-height: 100dvh; }
.side {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand foot" "nav nav";
  align-items: center; gap: .5rem .75rem; padding: .6rem .75rem .5rem;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { grid-area: brand; display: flex; align-items: center; gap: .75rem; min-width: 0; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .logo { height: 26px; width: auto; flex: none; }
.logo-light { display: var(--logo-light); }
.logo-dark { display: var(--logo-dark); }
.brand .product { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; padding-left: .75rem; border-left: 1px solid var(--line-strong); }
.brand strong { font-family: "Space Grotesk", sans-serif; font-size: .92rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.made-by { display: none; margin: .75rem 0 0; color: var(--muted); font-size: .72rem; }
.made-by a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: 3px; }
.signin-logo { margin: 0 0 .75rem; }
.signin-logo img { height: 64px; width: auto; }
.product-name { font-size: 1.05rem; font-weight: 600; margin: 0; }

.side nav { grid-area: nav; display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; margin: 0 -.75rem; padding: 0 .75rem; }
.side nav::-webkit-scrollbar { display: none; }
.side nav a {
  display: flex; align-items: center; gap: .5rem; padding: .45rem .7rem; min-height: 2.5rem;
  border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; font-size: .9rem; white-space: nowrap;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.side nav a:hover { background: var(--chip); color: var(--ink); text-decoration: none; }
.side nav a[aria-current] { background: var(--nav-active-bg); color: var(--nav-active-ink); font-weight: 600; }
.side nav a[aria-current] .icon { color: var(--amber); }

.side-foot { grid-area: foot; display: flex; align-items: center; gap: .5rem; }
.me { display: flex; align-items: center; gap: .25rem; min-width: 0; }
.who { display: flex; align-items: center; gap: .55rem; min-width: 0; color: var(--ink); padding: .25rem; border-radius: var(--radius-sm); }
.who:hover { background: var(--chip); text-decoration: none; }
.avatar { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 6px; flex: none; background: var(--amber); color: #0e1a24; font-family: "Space Grotesk", sans-serif; font-size: .78rem; font-weight: 700; letter-spacing: .02em; }
.who-text { display: none; flex-direction: column; min-width: 0; line-height: 1.25; font-size: .88rem; font-weight: 500; }
.who-text small { font-size: .75rem; font-weight: 400; }
.me form { margin: 0; }

.icon-button {
  display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; min-height: 0; padding: 0;
  border: 0; background: transparent; color: var(--muted); border-radius: var(--radius-sm);
}
.icon-button:hover { background: var(--chip); color: var(--ink); }

/* theme switch: three small segments */
.theme-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--chip); border: 1px solid var(--line); }
.theme-switch button {
  display: grid; place-items: center; width: 2rem; height: 2rem; min-height: 0; padding: 0;
  border: 0; border-radius: 7px; background: transparent; color: var(--muted);
}
.theme-switch button:hover { background: transparent; color: var(--ink); }
.theme-switch button[aria-pressed="true"],
:root:not([data-theme]) .theme-switch button[data-theme-set="system"]:not([aria-pressed]),
:root[data-theme="light"] .theme-switch button[data-theme-set="light"]:not([aria-pressed]),
:root[data-theme="dark"] .theme-switch button[data-theme-set="dark"]:not([aria-pressed]) {
  background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm);
}
.corner { position: fixed; top: .75rem; right: .75rem; z-index: 5; }
.card.narrow { text-align: left; }

main { margin: 0 auto; padding: 1.25rem 1rem 3rem; min-width: 0; }
main.plain { padding-top: 3.5rem; }
@media (min-width: 700px) { main { padding: 1.75rem 1.75rem 3rem; } }

@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .side {
    height: 100vh; height: 100dvh; display: flex; flex-direction: column; align-items: stretch; gap: 0;
    padding: 1.1rem .85rem 1rem; border-bottom: 0; border-right: 1px solid var(--line); overflow-y: auto;
  }
  .brand { padding: 0 .4rem 1.1rem; margin-bottom: .6rem; border-bottom: 1px solid var(--line); }
  .side nav { flex-direction: column; gap: .15rem; margin: 0; padding: 0; overflow: visible; flex: 1; }
  .side nav a { padding: .5rem .7rem; }
  .side nav a[aria-current] { box-shadow: inset 3px 0 0 var(--amber); }
  .brand { flex-direction: column; align-items: flex-start; gap: .6rem; }
  .brand .logo { height: 28px; }
  .brand .product { padding-left: 0; border-left: 0; }
  .made-by { display: block; }
  .side-foot { flex-direction: column; align-items: stretch; gap: .75rem; padding-top: 1rem; border-top: 1px solid var(--line); }
  .theme-switch { align-self: flex-start; }
  .me { justify-content: space-between; }
  .who { flex: 1; }
  .who-text { display: flex; }
  /* The content uses the whole screen: on a 27-inch monitor the tables get the room they need. */
  main { padding: 2rem 2.25rem 3.5rem; margin: 0; max-width: none; }
}

/* ---------- page head ---------- */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.head p { color: var(--muted); max-width: 90ch; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.25rem; box-shadow: var(--shadow-sm); min-width: 0; }
.card > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.card > header p { color: var(--muted); font-size: .85rem; }
.card .body { padding: 1.1rem; }
.card .body.empty { padding: 2.5rem 1.1rem; text-align: center; }
.card .body.empty p + p { margin-top: .35rem; }
.card.narrow { max-width: 440px; margin: 3rem auto; padding: 1.75rem; box-shadow: var(--shadow-md); }
.card.warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); box-shadow: inset 3px 0 0 var(--warn), var(--shadow-sm); }
.card > .scroll:last-child, .card > table:last-child { border-radius: 0 0 var(--radius) var(--radius); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .7rem .9rem; }
.toolbar .grow { flex: 1; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; } }
@media (min-width: 1800px) {
  main { padding: 2.25rem 3rem 4rem; }
  .kpis { gap: 1.25rem; }
  .kpi .value { font-size: 1.65rem; }
  table { font-size: .95rem; }
  th, td { padding: .7rem 1rem; }
  :root { --side-w: 272px; }
}
.kpi { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .95rem 1.1rem; min-width: 0; box-shadow: var(--shadow-sm); }
.kpi .label { color: var(--muted); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .7rem; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.kpi .value { margin-top: .2rem; font-size: clamp(1.15rem, 4.2vw, 1.45rem); line-height: 1.25; font-weight: 600; letter-spacing: -.015em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi .value.bad { color: var(--bad); }
.kpi .hint { color: var(--muted); font-size: .8rem; margin-top: .15rem; }

/* ---------- tables ---------- */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
th, td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 500; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; background: var(--head-bg); }
th.num { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .12s var(--ease); }
tbody tr:hover td { background: color-mix(in srgb, var(--chip) 70%, transparent); }
tr.dim td { color: var(--muted); }
tr.alarm td { background: color-mix(in srgb, var(--bad-bg) 70%, transparent); }
.sub { display: block; color: var(--muted); font-size: .8rem; }
tfoot td { font-weight: 600; border-top: 1px solid var(--line-strong); border-bottom: 0; background: var(--head-bg); }

/* ---------- status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .12rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 600; line-height: 1.5; white-space: nowrap; background: var(--chip); color: var(--muted); }
.pill::before { content: ""; width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.info { background: var(--info-bg); color: var(--info); }
a.pill { transition: filter .15s var(--ease); }
a.pill:hover { text-decoration: none; filter: brightness(.96); }
.bad-text { color: var(--bad); }
.warn-text { color: var(--warn); }

.flash { padding: .75rem 1rem; border-radius: var(--radius-sm); margin: 0 0 1.1rem; border: 1px solid transparent; font-weight: 500; }
.flash.ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.flash.error { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.notice { display: block; padding: .75rem 1rem; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn); margin-bottom: 1.1rem; border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent); }
.notice.info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }

/* ---------- forms ---------- */
label { display: block; font-size: .84rem; font-weight: 500; color: var(--ink-2); margin-bottom: .3rem; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: .45rem .65rem; min-height: 2.4rem; max-width: 100%;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--muted) 60%, var(--line-strong)); }
input[type=checkbox], input[type=radio] { min-height: 0; width: 1.05rem; height: 1.05rem; accent-color: var(--primary); vertical-align: -.15em; }
input[type=file] { padding: .35rem; cursor: pointer; }
input[type=file]::file-selector-button { font: inherit; font-weight: 500; font-size: .85rem; margin-right: .6rem; padding: .3rem .75rem; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--chip); color: var(--ink); cursor: pointer; }
input.amount { width: 8.5rem; text-align: right; font-variant-numeric: tabular-nums; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent); }
input[aria-invalid=true] { border-color: var(--bad); }
textarea { font: inherit; }
.field { margin-bottom: .95rem; }
.field .help { color: var(--muted); font-size: .8rem; margin-top: .25rem; }
.row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .65rem; }
.row > [hidden] { display: none; }
.row label { white-space: nowrap; }
.stack > * + * { margin-top: .75rem; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 500; font-size: .88rem; border-radius: var(--radius-sm); padding: .45rem .95rem; min-height: 2.4rem;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease);
}
button:hover, .button:hover { background: var(--chip); text-decoration: none; }
button:active, .button:active { transform: translateY(1px); }
button.primary, .button.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
button.primary:hover, .button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button.danger { color: var(--bad); }
button.danger:hover { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 35%, var(--line-strong)); }
button.small, .button.small { padding: .2rem .65rem; min-height: 2rem; font-size: .82rem; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; min-height: 0; font-weight: 500; box-shadow: none; }
button.link:hover { text-decoration: underline; background: none; }
button.icon-button, .theme-switch button { box-shadow: none; }
button:disabled, button:disabled:hover { opacity: .5; cursor: not-allowed; transform: none; }
form.inline { display: inline; }
@media (pointer: coarse) {
  input, select, button, .button { min-height: 2.75rem; font-size: 16px; }
  button.small, .button.small { min-height: 2.5rem; }
  .theme-switch button { width: 2.5rem; height: 2.5rem; min-height: 0; }
}

/* ---------- bits ---------- */
.dates { display: flex; align-items: center; gap: .35rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: .7rem 1.1rem; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem 1.25rem; padding: 1.1rem; margin: 0; }
.facts dt { color: var(--muted); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.facts dd { margin: .1rem 0 0; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
details > summary { cursor: pointer; font-weight: 600; }
.errors { max-height: 16rem; overflow-y: auto; margin: 0; padding: .5rem 1rem .5rem 2rem; font-size: .88rem; }
.secret { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; font-size: 1.05rem; padding: .55rem .8rem; background: var(--chip); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); display: inline-block; user-select: all; }

/* ---------- dashboard ---------- */
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1.25rem; }
@media (min-width: 900px) { .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid2 .wide { grid-column: 1 / -1; } }
.chart-box { position: relative; width: 100%; }

/* ---------- terminal actions popover ---------- */
details.actions { display: inline-block; position: relative; }
details.actions > summary { list-style: none; }
details.actions > summary::-webkit-details-marker { display: none; }
.popover-form { width: min(30rem, 80vw); margin-top: .4rem; padding: 1.1rem; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); white-space: normal; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  button:active, .button:active { transform: none; }
}
@media print {
  .side, .corner, .toolbar button { display: none !important; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
}
