/* Contact Finder dashboard. The voice is airmail: blue-black ink on envelope paper, one airmail
   blue accent, and postal marks (stamps, the cancelled stamp sheet, the postmark) only where they
   carry data. Archivo carries the type; its narrow widths set titles and figures like labels. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("fonts/archivo-latin-ext.woff2?v=25") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("fonts/archivo-latin.woff2?v=25") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Tokens: light; dark follows the device unless a theme is chosen ---- */
:root {
  color-scheme: light;
  --paper: #eaeef6;
  --card: #ffffff;
  --card-2: #f3f5fa;
  --ink: #0f1529;
  --ink-2: #414b63;
  --muted: #5b6580;
  --line: #dbe1ec;
  --axis: #c0c8d8;
  --accent: #2347c6;
  --accent-ink: #ffffff;
  --accent-soft: #e1e8fb;
  --air-red: #c8323d;
  --air-blue: #2347c6;
  --danger: #b4232f;
  --good-ink: #0a6b2e;
  --good-mark: #0ca30c;
  --good-soft: #e0f2e4;
  --warn-ink: #855000;
  --warn-mark: #fab219;
  --warn-soft: #fbefd2;
  --bad-ink: #b4232f;
  --bad-mark: #d03b3b;
  --bad-soft: #fae3e4;
  --stamp-paper: #f3ecda;
  --stamp-ink: #1f2c55;
  --shadow: 0 1px 2px rgb(15 21 41 / 0.04), 0 3px 10px rgb(15 21 41 / 0.04);
  --shadow-pop: 0 14px 36px rgb(15 21 41 / 0.18);
  --radius: 14px;
  --tabbar: 64px;
  --sans: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0a0f1e;
    --card: #11182c;
    --card-2: #182038;
    --ink: #e6eaf5;
    --ink-2: #b3bcd2;
    --muted: #8a94b0;
    --line: #232c47;
    --axis: #36415f;
    --accent: #8ba3ff;
    --accent-ink: #0a0f1e;
    --accent-soft: #1a2550;
    --air-red: #ff6b74;
    --air-blue: #7f99ff;
    --danger: #ff8a8f;
    --good-ink: #62d27d;
    --good-soft: #12291c;
    --warn-ink: #f2b84b;
    --warn-soft: #2d2412;
    --bad-ink: #ff8a8f;
    --bad-soft: #33181d;
    --stamp-paper: #283152;
    --stamp-ink: #c9d4f2;
    --shadow: none;
    --shadow-pop: 0 18px 44px rgb(0 0 0 / 0.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0a0f1e;
  --card: #11182c;
  --card-2: #182038;
  --ink: #e6eaf5;
  --ink-2: #b3bcd2;
  --muted: #8a94b0;
  --line: #232c47;
  --axis: #36415f;
  --accent: #8ba3ff;
  --accent-ink: #0a0f1e;
  --accent-soft: #1a2550;
  --air-red: #ff6b74;
  --air-blue: #7f99ff;
  --danger: #ff8a8f;
  --good-ink: #62d27d;
  --good-soft: #12291c;
  --warn-ink: #f2b84b;
  --warn-soft: #2d2412;
  --bad-ink: #ff8a8f;
  --bad-soft: #33181d;
  --stamp-paper: #283152;
  --stamp-ink: #c9d4f2;
  --shadow: none;
  --shadow-pop: 0 18px 44px rgb(0 0 0 / 0.55);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
strong { font-weight: 650; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.main:focus { outline: none; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; z-index: 60; top: 8px; left: 8px; padding: 10px 14px; border-radius: 10px;
  background: var(--ink); color: var(--card); font-weight: 600; text-decoration: none;
  transform: translateY(-160%);
}
.skip:focus { transform: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 0.9em; }
.block { display: block; }
.break { word-break: break-all; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ---- Shell: top bar and bottom tabs on phones and tablets, a sidebar from 1024px ---- */
.sidebar { display: none; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0;
  text-decoration: none; font-weight: 720; font-stretch: 90%; font-size: 16px; letter-spacing: -0.005em;
}
.brand-mark {
  position: relative; display: inline-block; flex: none;
  width: 26px; height: 18px; border-radius: 3px;
  background: repeating-linear-gradient(-45deg, var(--air-red) 0 4px, var(--card) 4px 6px, var(--air-blue) 6px 10px, var(--card) 10px 12px);
}
.brand-mark::after { content: ""; position: absolute; inset: 3px; border-radius: 1px; background: var(--card); }
.brand-mark-large { display: block; width: 68px; height: 48px; margin: 0 auto 18px; border-radius: 6px; }
.brand-mark-large::after { inset: 7px; border-radius: 2px; }
.state {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; line-height: 1.3;
  background: var(--good-soft); color: var(--good-ink);
}
.state-paused { background: var(--warn-soft); color: var(--warn-ink); }
.state-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px 16px;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-side { display: flex; align-items: center; gap: 4px; }
.icon-button {
  display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-button:hover { background: var(--card-2); color: var(--ink); }
.icon-button .icon { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

.tabbar {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px;
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line);
}
.tab-link {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0;
  padding: 7px 2px 5px; border-radius: 10px; list-style: none; cursor: pointer;
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.tab-link::-webkit-details-marker { display: none; }
.tab-link .icon { width: 22px; height: 22px; }
.tab-link[aria-current="page"], .more[open] > .tab-link { color: var(--accent); }
.count {
  min-width: 19px; height: 19px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 700; line-height: 19px; text-align: center; font-variant-numeric: tabular-nums;
}
.tab-link .count { position: absolute; top: 1px; left: calc(50% + 6px); }
.more-sheet {
  position: absolute; left: 8px; right: 8px; bottom: calc(100% + 8px);
  display: grid; gap: 10px; padding: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-pop);
}
.more-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.more-link {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px;
  border-radius: 12px; background: var(--card-2); text-decoration: none; font-weight: 600;
}
.more-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.more-heading { margin: 4px 4px -4px; font: 600 10.5px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.main {
  width: 100%; max-width: 1280px; margin: 0 auto;
  padding: 18px 16px calc(var(--tabbar) + 28px + env(safe-area-inset-bottom));
}

@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
  .topbar, .tabbar { display: none; }
  .sidebar {
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column; align-items: stretch; gap: 14px;
    padding: 22px 14px 16px;
    background: var(--card); border-right: 1px solid var(--line);
  }
  .sidebar > .brand { padding: 0 8px; }
  .sidebar > .state { align-self: flex-start; margin: -2px 8px 4px; }
  .main { margin: 0; padding: 32px 40px 64px; }
}
.side-nav { display: grid; }
.side-group { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side-heading {
  margin: 16px 10px 6px;
  font: 600 10.5px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.side-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px;
  color: var(--ink-2); text-decoration: none; font-size: 14.5px; font-weight: 550;
}
.side-link:hover { background: var(--card-2); color: var(--ink); }
.side-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.side-link .count { margin-left: auto; }
.side-foot { margin-top: auto; display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.account { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding-left: 10px; }
.account-mail { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--muted); }
.account .icon-button { width: 34px; height: 34px; }
.account .icon-button .icon { width: 17px; height: 17px; }

/* ---- Segmented controls: the theme picker and range filters ---- */
.segmented {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--card-2);
}
.segmented > button, .segmented > a {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 1 1 0;
  min-height: 34px; padding: 6px 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 600; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
}
.segmented > button:hover, .segmented > a:hover { color: var(--ink); }
.segmented > [aria-pressed="true"], .segmented > [aria-current] {
  background: var(--card); color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgb(15 21 41 / 0.1);
}
.segmented .icon { width: 16px; height: 16px; }
.theme-switch { margin: 0; }
.theme-switch .segmented { display: flex; width: 100%; }
.theme-switch .segmented > button { padding: 6px 6px; }

/* ---- Page furniture ---- */
.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px;
  margin: 2px 0 20px;
}
.page-head-tight { margin-bottom: 14px; }
.page-head h1 {
  margin-top: 4px; font-size: 32px; line-height: 1.04; font-weight: 760; font-stretch: 82%;
  letter-spacing: -0.012em; overflow-wrap: anywhere;
}
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 1024px) { .page-head h1 { font-size: 38px; } }
.eyebrow {
  font: 600 11px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.card {
  container-type: inline-size;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); min-width: 0;
}
.card > h2, .card-head h2 { font-size: 16.5px; line-height: 1.25; font-weight: 680; font-stretch: 92%; letter-spacing: -0.005em; }
.card > h2 { margin-bottom: 12px; }
.card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px 14px; margin-bottom: 16px; }
.card-head > div { display: grid; gap: 2px; }
.card > p + p { margin-top: 6px; }
.main > .card + .card, .main > .card + .stack-section { margin-top: 16px; }

.flash {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0 0 16px; padding: 12px 14px; border-radius: 12px;
  font-weight: 550;
}
.flash .icon { margin-top: 1px; }
.flash-ok { background: var(--good-soft); color: var(--good-ink); }
.flash-warn { background: var(--warn-soft); color: var(--warn-ink); }
.flash-error { background: var(--bad-soft); color: var(--bad-ink); }
.alerts { display: grid; gap: 8px; margin: -4px 0 16px; }
.alert {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px;
  padding: 10px 10px 10px 14px; border-radius: 12px;
  background: var(--warn-soft); color: var(--warn-ink); font-weight: 550;
}
.alert > p { flex: 1 1 260px; display: flex; align-items: flex-start; gap: 9px; }
.alert > p .icon { margin-top: 2px; }
.alert-error { background: var(--bad-soft); color: var(--bad-ink); }
.alert .button { min-height: 36px; padding: 6px 12px; border-color: transparent; }
.notice { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); text-align: left; }
.notice p + p { margin-top: 6px; }
.notice code { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 16px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink);
  font-size: 14px; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s, border-color 0.15s;
}
.button:hover { background: var(--card-2); border-color: var(--axis); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.button.danger { color: var(--danger); }
.button.danger:hover { background: var(--bad-soft); border-color: transparent; }
.button[disabled] { opacity: 0.5; cursor: not-allowed; }
.button-wide { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.inline-form { display: inline-flex; margin: 0; }
.card > .inline-form, .card > .button { margin-top: 12px; }
.status-strip > .inline-form, .status-strip > .button { margin-top: 0; }
.link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
.link .icon { width: 15px; height: 15px; }
.icon-link {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  color: var(--ink-2); text-decoration: none;
}
.icon-link:hover { background: var(--card-2); color: var(--accent); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--ink-2);
  font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.badge .icon { width: 13px; height: 13px; }
.badge-sent, .badge-reply, .badge-tone-good { background: var(--good-soft); color: var(--good-ink); border-color: transparent; }
.badge-sending, .badge-send_unknown, .badge-warn, .badge-tone-warn { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }
.badge-bounce, .badge-tone-bad { background: var(--bad-soft); color: var(--bad-ink); border-color: transparent; }
.badge-draft, .badge-job { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-rejected, .badge-tone-none { background: transparent; color: var(--muted); }

.empty {
  padding: 44px 18px; border: 1px dashed var(--axis); border-radius: var(--radius);
  background: var(--card); color: var(--ink-2); text-align: center;
}
.empty p { margin-bottom: 14px; }

.pulse {
  display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 50%;
  background: var(--good-mark); vertical-align: middle;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }

/* ---- Toolbars and filters ---- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.search {
  flex: 1 1 240px; display: flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 0 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; color: var(--muted);
}
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.search input {
  flex: 1; min-width: 0; padding: 10px 0; border: 0; outline: 0;
  background: transparent; color: var(--ink);
}
.select select {
  min-height: 42px; max-width: 100%; padding: 0 34px 0 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%237a8496' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
  color: var(--ink); -webkit-appearance: none; appearance: none;
}
.check {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink-2);
  font-size: 14px; font-weight: 550; cursor: pointer;
}
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.tabs { display: flex; gap: 6px; margin: 0 0 14px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; }
@media (min-width: 760px) { .tabs { flex-wrap: wrap; overflow: visible; } }
.tab {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-2); text-decoration: none; font-size: 13.5px; font-weight: 600;
}
.tab:hover { border-color: var(--axis); color: var(--ink); }
.tab[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--card); }
.tab-count { font-weight: 500; opacity: 0.72; font-variant-numeric: tabular-nums; }
.status-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.status-strip p { flex: 1 1 260px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 18px 0 4px; }
.range { margin-bottom: 18px; }

/* ---- Overview ---- */
.overview { display: grid; gap: 16px; }
@media (min-width: 760px) {
  .overview { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .overview > * { grid-column: span 6; }
  .overview > .queue-card, .overview > .postage, .overview > .kpis, .overview > .chart-card { grid-column: 1 / -1; }
}
@media (min-width: 1180px) {
  .overview > .queue-card { grid-column: span 7; }
  .overview > .postage { grid-column: span 5; }
  .overview > .chart-card { grid-column: span 8; }
  .overview > .funnel-card { grid-column: span 4; }
  .overview > .feed-card { grid-column: span 7; }
  .overview > .system { grid-column: span 5; }
}
.queue-card { display: grid; gap: 22px; align-content: start; }
@container (min-width: 600px) {
  .queue-card > .queue-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }
}
.queue-split { display: grid; gap: 22px; }
.hero-figure {
  margin: 8px 0 8px; font-size: 80px; line-height: 0.88; font-weight: 720; font-stretch: 78%; letter-spacing: -0.02em;
}
.hero-note { color: var(--ink-2); max-width: 36ch; }
.queue-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; padding: 0 8px; }
.queue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.queue-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 6px 8px; border-radius: 10px; text-decoration: none;
}
.queue-row:hover { background: var(--card-2); }
.queue-main { display: grid; min-width: 0; }
.queue-name, .queue-role { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-name { font-weight: 650; }
.queue-role { font-size: 13px; color: var(--muted); }

.postage { display: grid; gap: 16px; align-content: start; }
.postage-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 16px; }
.postage-value { margin-top: 6px; font-size: 44px; line-height: 0.95; font-weight: 720; font-stretch: 80%; letter-spacing: -0.015em; }
.postage-value span { font-size: 19px; font-weight: 500; font-stretch: 100%; letter-spacing: 0; color: var(--muted); }
/* One stamp per allowed email; used ones are perforated and cancelled, the rest are empty places. */
.stamp-sheet { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 7px; max-width: 440px; }
.sheet-stamp { position: relative; aspect-ratio: 5 / 6; border: 1.5px dashed var(--axis); border-radius: 3px; }
.sheet-stamp.is-used {
  border: 0; border-radius: 0;
  background: radial-gradient(circle at center, var(--card) 1.5px, transparent 1.9px) -2.5px -2.5px / 5px 5px, var(--stamp-paper);
}
.sheet-stamp.is-used::before {
  content: ""; position: absolute; inset: 3px;
  border: 1px solid color-mix(in srgb, var(--air-blue) 45%, transparent); background: var(--accent-soft);
}
.sheet-stamp.is-used::after {
  content: ""; position: absolute; inset: 0; background: var(--stamp-ink); opacity: 0.55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 36' preserveAspectRatio='none'%3E%3Cpath d='M-2 13c4-3 8-3 12 0s8 3 12 0 8-3 12 0M-2 19c4-3 8-3 12 0s8 3 12 0 8-3 12 0M-2 25c4-3 8-3 12 0s8 3 12 0 8-3 12 0' fill='none' stroke='black' stroke-width='1.3'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 36' preserveAspectRatio='none'%3E%3Cpath d='M-2 13c4-3 8-3 12 0s8 3 12 0 8-3 12 0M-2 19c4-3 8-3 12 0s8 3 12 0 8-3 12 0M-2 25c4-3 8-3 12 0s8 3 12 0 8-3 12 0' fill='none' stroke='black' stroke-width='1.3'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* A full sheet (the production limit is 100): twenty to a row, finer perforation, two cancel lines. */
.stamp-sheet.is-dense { grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 4px; max-width: 560px; }
.stamp-sheet.is-dense .sheet-stamp { border-width: 1px; border-radius: 2px; }
.stamp-sheet.is-dense .sheet-stamp.is-used {
  background: radial-gradient(circle at center, var(--card) 0.9px, transparent 1.2px) -1.5px -1.5px / 3px 3px, var(--stamp-paper);
}
.stamp-sheet.is-dense .sheet-stamp.is-used::before { inset: 2px; }
.stamp-sheet.is-dense .sheet-stamp.is-used::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 24' preserveAspectRatio='none'%3E%3Cpath d='M-2 9.5c3-2.4 5.5-2.4 8.5 0s5.5 2.4 8.5 0 5.5-2.4 8.5 0M-2 15.5c3-2.4 5.5-2.4 8.5 0s5.5 2.4 8.5 0 5.5-2.4 8.5 0' fill='none' stroke='black' stroke-width='1.8'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 24' preserveAspectRatio='none'%3E%3Cpath d='M-2 9.5c3-2.4 5.5-2.4 8.5 0s5.5 2.4 8.5 0 5.5-2.4 8.5 0M-2 15.5c3-2.4 5.5-2.4 8.5 0s5.5 2.4 8.5 0 5.5-2.4 8.5 0' fill='none' stroke='black' stroke-width='1.8'/%3E%3C/svg%3E");
}
@media (max-width: 480px) { .stamp-sheet.is-dense { gap: 3px; } }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kpis > :first-child { grid-column: 1 / -1; }
@media (min-width: 760px) {
  .kpis { grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); }
  .kpis > :first-child { grid-column: auto; }
}
.tile {
  display: grid; align-content: start; gap: 4px; min-width: 0;
  padding: 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); box-shadow: var(--shadow); text-decoration: none;
}
.tile-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 550; color: var(--ink-2); }
.tile-label .icon { width: 15px; height: 15px; }
.tile-value { font-size: 34px; line-height: 1.02; font-weight: 720; font-stretch: 82%; letter-spacing: -0.01em; }
.tile-value small { font-size: 17px; font-weight: 500; font-stretch: 100%; letter-spacing: 0; color: var(--muted); }
.tile-sub { font-size: 12.5px; color: var(--muted); }
.tile-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-width: 0; }
.spark { display: block; flex: 0 1 104px; min-width: 56px; height: auto; margin-bottom: 5px; overflow: visible; }
.spark polyline { fill: none; stroke: var(--axis); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark circle { fill: var(--accent); stroke: var(--card); stroke-width: 2; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 9px 2px; border-top: 1px solid var(--line); text-decoration: none;
}
.feed > li:first-child .feed-row { border-top: 0; padding-top: 0; }
.feed-row:hover strong { color: var(--accent); }
.feed-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--card-2); color: var(--ink-2); }
.feed-icon .icon { width: 16px; height: 16px; }
.feed-sent { background: var(--accent-soft); color: var(--accent); }
.feed-reply { background: var(--good-soft); color: var(--good-ink); }
.feed-bounce { background: var(--bad-soft); color: var(--bad-ink); }
.feed-main { display: grid; min-width: 0; }
.feed-main strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-time { white-space: nowrap; }

.status-list { list-style: none; margin: 0; padding: 0; }
.status-row { display: grid; grid-template-columns: 9px minmax(0, 1fr); gap: 2px 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.status-row:first-child { border-top: 0; padding-top: 0; }
.status-row strong { font-weight: 620; }
.status-row .muted { grid-column: 2; }
.status-dot { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--good-mark); }
.status-dot.is-warn { background: var(--warn-mark); }
.status-dot.is-bad { background: var(--bad-mark); }
.status-dot.is-idle { background: var(--axis); }
.status-dot.is-running { animation: pulse 1.6s ease-in-out infinite; }

/* ---- Charts: HTML marks sized by .p-N classes (the CSP allows no inline styles) ---- */
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; font-size: 12.5px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 10px; height: 10px; flex: none; border-radius: 3px; background: var(--accent); }
.swatch-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good-mark); }
.cols { margin: 0; padding-left: 36px; }
.cols-frame { position: relative; }
.cols-tick {
  position: absolute; right: calc(100% + 8px); white-space: nowrap;
  font-size: 11px; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums;
}
.t-top { top: 0; transform: translateY(-50%); }
.t-mid { top: 50%; transform: translateY(-50%); }
.t-zero { bottom: 0; transform: translateY(50%); }
.cols-plot {
  display: flex; align-items: flex-end; gap: 2px; height: 168px;
  border-bottom: 1px solid var(--axis);
  background:
    linear-gradient(var(--line), var(--line)) 0 0 / 100% 1px no-repeat,
    linear-gradient(var(--line), var(--line)) 0 50% / 100% 1px no-repeat;
}
.col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.col-bar { display: block; width: 100%; max-width: 24px; height: var(--p); border-radius: 4px 4px 0 0; background: var(--accent); }
.col:hover .col-bar, .col:focus-visible .col-bar { background: color-mix(in srgb, var(--accent) 72%, var(--card)); }
.col:focus-visible { outline-offset: 0; }
.rug { display: flex; gap: 2px; height: 10px; margin-top: 7px; }
.rug span { flex: 1 1 0; min-width: 0; display: flex; justify-content: center; }
.rug i { width: 8px; height: 8px; border-radius: 50%; background: var(--good-mark); }
.cols-x { display: flex; justify-content: space-between; margin-top: 7px; font-size: 11.5px; color: var(--muted); }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; }
.hbar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "track track";
  gap: 6px 12px; align-items: center; border-radius: 6px;
}
.hbar-label { grid-area: label; font-size: 13.5px; color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.hbar-value { grid-area: value; display: inline-flex; align-items: baseline; justify-content: flex-end; gap: 8px; font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar-sub { font-size: 12px; font-weight: 500; color: var(--muted); }
.hbar-track { grid-area: track; display: block; height: 10px; }
.hbar-fill { display: block; width: var(--p); height: 100%; border-radius: 0 4px 4px 0; background: var(--accent); }
.hbar:hover .hbar-fill, .hbar:focus-visible .hbar-fill { filter: brightness(1.12); }
@container (min-width: 520px) {
  .hbar { grid-template-columns: minmax(120px, 34%) minmax(0, 1fr) 92px; grid-template-areas: "label track value"; }
}
/* Ordered stages: one hue from light to full, each step still clear of the surface. */
.ramp-1 { background: color-mix(in oklab, var(--accent) 42%, var(--card)); }
.ramp-2 { background: color-mix(in oklab, var(--accent) 56%, var(--card)); }
.ramp-3 { background: color-mix(in oklab, var(--accent) 70%, var(--card)); }
.ramp-4 { background: color-mix(in oklab, var(--accent) 85%, var(--card)); }
.ramp-5 { background: var(--accent); }
.stack-figure { margin: 0; }
.stack { display: flex; gap: 2px; height: 18px; border-radius: 5px; overflow: hidden; }
.stack-part { flex: 0 1 var(--p); min-width: 4px; }
.stack-part:hover, .stack-part:focus-visible { filter: brightness(1.12); }
.tone-reply { background: var(--good-mark); }
.tone-auto { background: var(--muted); }
.tone-bounce { background: var(--bad-mark); }
.tone-none { background: var(--axis); }
.legend-stack { margin-top: 14px; gap: 8px 22px; font-size: 13px; }
.legend-stack strong { font-variant-numeric: tabular-nums; }
.heat { margin: 0; }
.heat-grid { display: grid; grid-template-columns: 34px repeat(8, minmax(0, 1fr)); gap: 4px; max-width: 760px; }
.heat-hour { font-size: 11px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.heat-day { align-self: center; font-size: 12px; color: var(--ink-2); }
.heat-cell { height: 26px; border-radius: 5px; background: var(--card-2); }
.heat-cell.lv-0 { box-shadow: inset 0 0 0 1px var(--line); }
.lv-1 { background: color-mix(in oklab, var(--accent) 28%, var(--card)); }
.lv-2 { background: color-mix(in oklab, var(--accent) 50%, var(--card)); }
.lv-3 { background: color-mix(in oklab, var(--accent) 74%, var(--card)); }
.lv-4 { background: var(--accent); }
.heat-scale { display: flex; align-items: center; gap: 4px; margin-top: 12px; }
.heat-scale i { width: 16px; height: 10px; border-radius: 3px; }
.heat-scale span:first-child { margin-right: 4px; }
.heat-scale span:last-child { margin-left: 4px; }
.table-view { margin-top: 14px; }
.table-view summary { width: fit-content; color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; }
.table-view table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 13px; }
.table-view th, .table-view td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.table-view th { color: var(--muted); font-weight: 600; }
.table-view .num { text-align: right; }
.tip {
  position: fixed; z-index: 50; pointer-events: none;
  padding: 7px 10px; border-radius: 8px;
  background: var(--ink); color: var(--card);
  font-size: 12.5px; line-height: 1.35; white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px));
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.2);
}
.tip strong { display: block; font-size: 14px; }

/* ---- Insights ---- */
.insights { display: grid; gap: 16px; margin-top: 16px; }
@media (min-width: 900px) {
  .insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insights > .span-full { grid-column: 1 / -1; }
}
.kpis-wide > :first-child { grid-column: auto; }

/* ---- Letters: list rows ---- */
.letters { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.letter-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; align-items: start;
  padding: 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); text-decoration: none; box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.letter-row:hover { border-color: var(--axis); }
.letter-row:hover .letter-row-title { color: var(--accent); }
.letter-row > .stamp { grid-row: span 2; }
.letter-row-main { display: grid; gap: 1px; min-width: 0; }
.letter-row-title { font-size: 16.5px; font-weight: 680; font-stretch: 94%; letter-spacing: -0.005em; }
.letter-row-main .mono { overflow-wrap: anywhere; }
.letter-row-why {
  margin-top: 4px; color: var(--ink-2); font-size: 13.5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.letter-row-meta { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
@media (min-width: 760px) {
  .letter-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .letter-row-meta { grid-column: 3; grid-row: 1; flex-direction: column; align-items: flex-end; }
}
.summary-line { margin: -6px 0 14px; color: var(--muted); font-size: 13px; }

/* ---- The stamp: perforated edge from 8px tiles whose dots sit on the border ---- */
.stamp {
  display: inline-grid; flex: none; width: 72px; height: 88px; padding: 5px;
  background: radial-gradient(circle at center, var(--card) 2.5px, transparent 3px) -4px -4px / 8px 8px, var(--stamp-paper);
}
.stamp-face {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1px solid color-mix(in srgb, var(--air-blue) 40%, transparent);
  background: var(--accent-soft); color: var(--air-blue);
}
.stamp-value { font-size: 28px; font-weight: 760; font-stretch: 84%; line-height: 1; letter-spacing: -0.02em; }
.stamp-label { font: 600 8px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.stamp-small { width: 40px; height: 48px; padding: 4px; }
.stamp-small .stamp-value { font-size: 16px; }

/* ---- The letter: airmail envelope edge, typed body ---- */
.contact-layout { display: grid; gap: 16px; }
.envelope {
  padding: 6px; border-radius: 16px; box-shadow: var(--shadow); min-width: 0;
  background: repeating-linear-gradient(-45deg, var(--air-red) 0 13px, var(--card) 13px 19px, var(--air-blue) 19px 32px, var(--card) 32px 38px);
}
.letter { position: relative; overflow: hidden; border-radius: 11px; background: var(--card); }
.letter-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
  padding: 18px 18px 16px; border-bottom: 1px solid var(--line);
}
.letter-fields { display: grid; gap: 7px; margin: 0; min-width: 0; }
.letter-fields div { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.letter-fields dt { font: 600 10.5px/1.6 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.letter-fields dd { margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.letter-stamp { position: relative; flex: none; display: flex; justify-content: flex-end; }
/* Sent: the dated ring sits left of the stamp and the wavy cancel lines cross it. */
.letter-stamp.is-sent { width: 167px; }
.letter-stamp.is-sent .stamp { opacity: 0.6; }
.postmark {
  position: absolute; top: -6px; left: 0; width: 176px; height: auto;
  color: var(--stamp-ink); opacity: 0.85; transform: rotate(-6deg); transform-origin: 30% 50%; pointer-events: none;
}
.pm-ring { fill: none; stroke: currentColor; stroke-width: 2.4; }
.pm-thin { stroke-width: 1.2; }
.pm-arc { font: 700 10px var(--mono); letter-spacing: 2.4px; fill: currentColor; }
.pm-date { font: 700 14px var(--mono); fill: currentColor; }
.pm-time { font: 600 10.5px var(--mono); fill: currentColor; }
.pm-wave { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.letter-body {
  margin: 0; padding: 20px 18px 24px;
  font: 13.5px/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4;
}
.decision { display: grid; gap: 10px; }
.decision-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.decision-send { display: flex; grid-column: 1 / -1; }
.decision-buttons .button { width: 100%; }
.decision-note { line-height: 1.45; }
.decision-done h2 { margin-bottom: 8px; }
.edit-card { display: none; }
.edit-card:target, .edit-card.is-open { display: block; scroll-margin-top: 80px; }
.edit-form { display: grid; gap: 12px; }
.edit-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.edit-form input, .edit-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); font: 13.5px/1.6 var(--mono);
}
.edit-form textarea { resize: vertical; min-height: 260px; }
.edit-form .button { justify-self: start; }
.contact-side { display: grid; gap: 16px; align-content: start; min-width: 0; }
.crumbs { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.crumbs-pager { display: flex; align-items: center; gap: 2px; }
.keys { display: none; }
@media (hover: hover) and (min-width: 1024px) { .keys { display: inline; } }
kbd {
  display: inline-block; min-width: 20px; padding: 1px 5px; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; background: var(--card); font: 600 11px/1.4 var(--mono); text-align: center; color: var(--ink-2);
}
.facts { display: grid; gap: 12px; margin: 0; }
.facts div { display: grid; gap: 2px; }
.facts dt { font: 600 10.5px/1.6 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }

@media (max-width: 1099px) {
  /* While reading a letter on a phone, the decision stays in reach above the tab bar. */
  .decision:not(.decision-done) {
    position: sticky; z-index: 10;
    bottom: calc(var(--tabbar) + 10px + env(safe-area-inset-bottom));
    padding: 12px; box-shadow: var(--shadow-pop);
  }
  .decision .decision-note { display: none; }
}
@media (min-width: 1024px) and (max-width: 1099px) {
  .decision:not(.decision-done) { bottom: 16px; }
}
@media (min-width: 1100px) {
  .contact-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-areas: "letter decision" "letter side" "edit side";
    align-items: start;
  }
  .envelope { grid-area: letter; }
  .decision { grid-area: decision; }
  .edit-card { grid-area: edit; }
  .contact-side { grid-area: side; }
}
@media (max-width: 520px) {
  .letter-head { padding: 14px 14px 12px; }
  .letter-body { padding: 16px 14px 20px; font-size: 13px; }
  .letter-fields div { grid-template-columns: 1fr; gap: 0; }
  .stamp:not(.stamp-small) { width: 56px; height: 64px; }
  .stamp:not(.stamp-small) .stamp-value { font-size: 21px; }
  .stamp:not(.stamp-small) .stamp-label { font-size: 6.5px; }
  .letter-stamp.is-sent { width: 120px; }
  .postmark { width: 120px; top: -2px; }
}

/* ---- Record tables: rows become cards on phones ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.records { width: 100%; border-collapse: collapse; font-size: 14px; }
.records th {
  padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap;
  font: 600 10.5px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.records td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.records tbody tr:hover { background: var(--card-2); }
.records tr:last-child td { border-bottom: 0; }
.record-link { display: grid; gap: 1px; text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.record-link:hover strong { color: var(--accent); }
.record-link > .badge { justify-self: start; }
.record-name { display: grid; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.record-name .link { font-weight: 500; }
.score { font-weight: 650; font-variant-numeric: tabular-nums; }
@media (max-width: 680px) {
  .records thead { display: none; }
  .records tr { display: grid; grid-template-columns: auto auto 1fr; gap: 6px 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .records tr:last-child { border-bottom: 0; }
  .records td { padding: 0; border: 0; }
  .records td:first-child { grid-column: 1 / -1; }
  .records td:last-child { text-align: right; }
  .records .hide-phone { display: none; }
}

/* ---- Sources ---- */
.sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.source-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.source-head strong { font-size: 15px; }
.source-numbers { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; color: var(--ink-2); }
.source-numbers strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.sources .source > .muted { margin-top: 4px; }
.meter { display: block; height: 10px; border-radius: 5px; background: color-mix(in oklab, var(--accent) 18%, var(--card)); overflow: hidden; }
.meter-thin { height: 6px; border-radius: 3px; }
.meter-fill { display: block; width: var(--p); height: 100%; border-radius: inherit; background: var(--accent); }

/* ---- Settings ---- */
.settings { display: grid; gap: 16px; }
@media (min-width: 900px) { .settings { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.checks { list-style: none; display: grid; gap: 6px; margin: 12px 0; padding: 0; }
.checks li { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.checks .ok { color: var(--good-ink); }
.checks .missing { color: var(--warn-ink); }
.settings .theme-switch { max-width: 360px; margin-top: 14px; }
.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; padding-top: 2px; }
.list-main { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.list-main .badge { justify-self: start; }
.list-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; text-align: right; }
.list-cards .list-row { margin-bottom: 8px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }

/* ---- Sign-in ---- */
.bare { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.login { display: flex; justify-content: center; width: 100%; }
.login-card {
  width: min(420px, 100%); padding: 32px 26px; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
}
.login-card h1 { margin-bottom: 8px; font-size: 30px; line-height: 1.05; font-weight: 760; font-stretch: 82%; letter-spacing: -0.012em; }
.login-lead { margin-bottom: 22px; color: var(--ink-2); }
.login-card .flash { text-align: left; }

@media (prefers-reduced-motion: reduce) {
  .pulse, .status-dot.is-running { animation: none; }
  .button, .letter-row { transition: none; }
}
@media (forced-colors: active) {
  .col-bar, .hbar-fill, .meter-fill, .stack-part, .heat-cell, .rug i { background: CanvasText; }
  .heat-cell.lv-0 { background: Canvas; }
}

/* Percent of a chart axis or meter, generated: .p-0 … .p-100 */
.p-0 { --p: 0%; }
.p-1 { --p: 1%; }
.p-2 { --p: 2%; }
.p-3 { --p: 3%; }
.p-4 { --p: 4%; }
.p-5 { --p: 5%; }
.p-6 { --p: 6%; }
.p-7 { --p: 7%; }
.p-8 { --p: 8%; }
.p-9 { --p: 9%; }
.p-10 { --p: 10%; }
.p-11 { --p: 11%; }
.p-12 { --p: 12%; }
.p-13 { --p: 13%; }
.p-14 { --p: 14%; }
.p-15 { --p: 15%; }
.p-16 { --p: 16%; }
.p-17 { --p: 17%; }
.p-18 { --p: 18%; }
.p-19 { --p: 19%; }
.p-20 { --p: 20%; }
.p-21 { --p: 21%; }
.p-22 { --p: 22%; }
.p-23 { --p: 23%; }
.p-24 { --p: 24%; }
.p-25 { --p: 25%; }
.p-26 { --p: 26%; }
.p-27 { --p: 27%; }
.p-28 { --p: 28%; }
.p-29 { --p: 29%; }
.p-30 { --p: 30%; }
.p-31 { --p: 31%; }
.p-32 { --p: 32%; }
.p-33 { --p: 33%; }
.p-34 { --p: 34%; }
.p-35 { --p: 35%; }
.p-36 { --p: 36%; }
.p-37 { --p: 37%; }
.p-38 { --p: 38%; }
.p-39 { --p: 39%; }
.p-40 { --p: 40%; }
.p-41 { --p: 41%; }
.p-42 { --p: 42%; }
.p-43 { --p: 43%; }
.p-44 { --p: 44%; }
.p-45 { --p: 45%; }
.p-46 { --p: 46%; }
.p-47 { --p: 47%; }
.p-48 { --p: 48%; }
.p-49 { --p: 49%; }
.p-50 { --p: 50%; }
.p-51 { --p: 51%; }
.p-52 { --p: 52%; }
.p-53 { --p: 53%; }
.p-54 { --p: 54%; }
.p-55 { --p: 55%; }
.p-56 { --p: 56%; }
.p-57 { --p: 57%; }
.p-58 { --p: 58%; }
.p-59 { --p: 59%; }
.p-60 { --p: 60%; }
.p-61 { --p: 61%; }
.p-62 { --p: 62%; }
.p-63 { --p: 63%; }
.p-64 { --p: 64%; }
.p-65 { --p: 65%; }
.p-66 { --p: 66%; }
.p-67 { --p: 67%; }
.p-68 { --p: 68%; }
.p-69 { --p: 69%; }
.p-70 { --p: 70%; }
.p-71 { --p: 71%; }
.p-72 { --p: 72%; }
.p-73 { --p: 73%; }
.p-74 { --p: 74%; }
.p-75 { --p: 75%; }
.p-76 { --p: 76%; }
.p-77 { --p: 77%; }
.p-78 { --p: 78%; }
.p-79 { --p: 79%; }
.p-80 { --p: 80%; }
.p-81 { --p: 81%; }
.p-82 { --p: 82%; }
.p-83 { --p: 83%; }
.p-84 { --p: 84%; }
.p-85 { --p: 85%; }
.p-86 { --p: 86%; }
.p-87 { --p: 87%; }
.p-88 { --p: 88%; }
.p-89 { --p: 89%; }
.p-90 { --p: 90%; }
.p-91 { --p: 91%; }
.p-92 { --p: 92%; }
.p-93 { --p: 93%; }
.p-94 { --p: 94%; }
.p-95 { --p: 95%; }
.p-96 { --p: 96%; }
.p-97 { --p: 97%; }
.p-98 { --p: 98%; }
.p-99 { --p: 99%; }
.p-100 { --p: 100%; }
