/* ============================================================================
   Scientific Visual — Customer Results
   Single stylesheet. All tokens on :root; no hard-coded colour, radius or font
   stack appears below the token block.
   ========================================================================== */

/* ----------------------------------------------------------------- tokens */
:root,
[data-theme="dark"] {
  --bg: #0c0e11;
  --surface: #14171b;
  --surface-2: #191d22;
  --surface-3: #21262c;
  --border: #262c33;
  --border-strong: #38414a;

  --text: #eef1f4;
  --text-muted: #98a2ad;
  --text-faint: #67717c;

  --accent: #4d94ff;
  --accent-quiet: rgba(77, 148, 255, 0.13);
  --accent-hover: #6ba6ff;

  --core: #35d07f;
  --core-quiet: rgba(53, 208, 127, 0.14);

  --warn: #e0a33e;
  --alert: #e1614f;

  --grid-line: rgba(255, 255, 255, 0.035);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.28);
}

[data-theme="light"] {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --surface-3: #eef0f3;
  --border: #dfe3e8;
  --border-strong: #c3cad2;

  --text: #14181d;
  --text-muted: #5b6672;
  --text-faint: #8a949f;

  --accent: #1e63d0;
  --accent-quiet: rgba(30, 99, 208, 0.09);
  --accent-hover: #164da6;

  --core: #12864f;
  --core-quiet: rgba(18, 134, 79, 0.11);

  --warn: #a1660b;
  --alert: #b83a2b;

  --grid-line: rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 2px rgba(16, 24, 32, 0.06), 0 8px 24px rgba(16, 24, 32, 0.07);
}

:root {
  --font-body: "Satoshi", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* The 3D stage is hard dark in both themes, matching the trading platform. */
  --stage-bg: #0e1116;
  --stage-chip: rgba(20, 24, 29, 0.84);
  --stage-panel: rgba(20, 24, 29, 0.92);
  --stage-border: #2b333c;
  --stage-text: #b7c1cc;
  --stage-faint: #7c8794;
  --stage-grid: rgba(255, 255, 255, 0.035);

  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.84rem + 0.2vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.5vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --radius: 4px;
  --radius-lg: 8px;
  --header-h: 60px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --maxw: 1560px;
}

/* ----------------------------------------------------------------- base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.55;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
p {
  margin: 0;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.mono {
  font-family: var(--font-mono);
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ----------------------------------------------------------------- header */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: 0 var(--space-6);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
}
.brand:hover {
  color: var(--text);
}
.brand svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex: none;
}
.brand__sub {
  color: var(--text-faint);
  font-weight: 450;
  padding-left: var(--space-3);
  margin-left: var(--space-1);
  border-left: 1px solid var(--border-strong);
}

.masthead__spacer {
  flex: 1 1 auto;
}

.client-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}
.client-badge b {
  color: var(--text);
  font-weight: 550;
}
.client-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--core);
  flex: none;
}

.iconbtn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    color 0.15s var(--ease),
    border-color 0.15s var(--ease),
    background 0.15s var(--ease);
}
.iconbtn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.iconbtn svg {
  width: 17px;
  height: 17px;
}

/* ----------------------------------------------------------------- layout */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6) var(--space-16);
}

.crumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-faint);
  margin-bottom: var(--space-5);
}
.crumbs a {
  color: var(--text-muted);
}
.crumbs a:hover {
  color: var(--text);
}
.crumbs span[aria-hidden] {
  color: var(--text-faint);
}

.pagehead {
  margin-bottom: var(--space-8);
}
.pagehead h1 {
  font-size: var(--text-xl);
}
.pagehead p {
  color: var(--text-muted);
  margin-top: var(--space-2);
  max-width: 68ch;
}

.eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-3);
}

/* ----------------------------------------------------------------- cards */
.grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
}
/* Five samples read better as 3 + 2 than as 4 + 1. */
@media (min-width: 1040px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    border-color 0.18s var(--ease),
    transform 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card:hover .card__title {
  color: var(--accent);
}

.card__thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;

  background: var(--stage-bg);
  background-image: linear-gradient(var(--stage-grid) 1px, transparent 1px), linear-gradient(90deg, var(--stage-grid) 1px, transparent 1px);
  background-size: 32px 32px;

  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.card__thumb img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.card__thumb canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.thumb-skeleton {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-faint);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
}
.thumb-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--surface-3) 60%, transparent) 50%, transparent 80%);
  background-size: 220% 100%;
  animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}

.card__body {
  padding: var(--space-4) var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}

.card__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}
.card__title {
  font-size: var(--text-base);
  font-weight: 580;
  letter-spacing: -0.01em;
  transition: color 0.18s var(--ease);
}
.card__ref {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-faint);
  white-space: nowrap;
}

.card__note {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.card__dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
}
.card__dl dt {
  color: var(--text-faint);
}
.card__dl dd {
  margin: 0;
  text-align: right;
  font-family: var(--font-mono);
  color: var(--text);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-1);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 2px var(--space-2);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}
.chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 1px var(--space-2);
  font-size: var(--text-xs);
  font-weight: 550;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
}
.tag--ok {
  color: var(--core);
  background: var(--core-quiet);
  border-color: color-mix(in srgb, var(--core) 32%, transparent);
}
.tag--data {
  color: var(--accent);
  background: var(--accent-quiet);
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
}

/* ----------------------------------------------------------------- detail */
.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(370px, 0.78fr);
  gap: var(--space-6);
  align-items: start;
}

.stage {
  position: sticky;
  top: calc(var(--header-h) + var(--space-4));
  height: calc(100svh - var(--header-h) - 6.75rem);
  min-height: 520px;
  background: var(--stage-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.stage__canvas {
  position: absolute;
  inset: 0;
}
.stage__canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.stage__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(var(--stage-grid) 1px, transparent 1px), linear-gradient(90deg, var(--stage-grid) 1px, transparent 1px);
  background-size: 40px 40px;
}

.stage__hud {
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--stage-faint);
  pointer-events: none;
  z-index: 2;
}

.stage__legend {
  position: absolute;
  left: var(--space-4);
  bottom: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  max-width: min(520px, calc(100% - 190px));
  padding: var(--space-2) var(--space-3);
  background: var(--stage-chip);
  backdrop-filter: blur(8px);
  border: 1px solid var(--stage-border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--stage-text);
  z-index: 2;
}
.stage__legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.stage__legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: none;
}

.stage__tools {
  position: absolute;
  right: var(--space-4);
  top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.stage__tools .iconbtn {
  background: var(--stage-chip);
  border-color: var(--stage-border);
  color: var(--stage-text);
  backdrop-filter: blur(8px);
}
.stage__tools .iconbtn:hover {
  color: #fff;
  border-color: #46515d;
  background: rgba(30, 36, 43, 0.92);
}
.stage__tools .iconbtn[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(77, 148, 255, 0.18);
}

.stage__scale {
  position: absolute;
  right: var(--space-4);
  bottom: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--stage-faint);
  pointer-events: none;
  z-index: 2;
}
.stage__scale b {
  display: block;
  height: 5px;
  border: 1px solid var(--stage-faint);
  border-top: 0;
}
@media (max-width: 720px) {
  .stage__scale {
    display: none;
  }
  .stage__legend {
    max-width: calc(100% - 2 * var(--space-4));
  }
}

.stage__loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  background: var(--stage-bg);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--stage-text);
  z-index: 5;
  transition: opacity 0.35s var(--ease);
}
.stage__loading.hidden {
  opacity: 0;
  pointer-events: none;
}
.bar {
  width: 190px;
  height: 3px;
  margin-top: var(--space-3);
  background: #232a32;
  border-radius: 2px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.25s var(--ease);
}

/* ----------------------------------------------------------------- panels */
.rail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.panel__head h2 {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.085em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.panel__head .count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-faint);
}
.panel__body {
  padding: var(--space-4);
}
.panel__hint {
  font-size: var(--text-xs);
  color: var(--text-faint);
  padding: 0 var(--space-4) var(--space-4);
  margin-top: calc(-1 * var(--space-1));
}

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2) var(--space-4);
  margin: 0;
}
.kv dt {
  color: var(--text-muted);
  font-size: var(--text-xs);
}
.kv dd {
  margin: 0;
  text-align: right;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text);
}

/* ------------------------------------------------------- layer controls */
.layer {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
}
.layer:first-child {
  padding-top: 0;
  border-top: 0;
}
.layer:last-child {
  padding-bottom: 0;
}

.layer__top {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.swatch {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background-color: var(--surface-3);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.swatch--dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
}

.layer__name {
  flex: 1;
  min-width: 0;
  font-size: var(--text-xs);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.layer__pct {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-faint);
  width: 4ch;
  text-align: right;
  flex: none;
}

/* switch */
.switch {
  position: relative;
  flex: none;
  width: 34px;
  height: 19px;
  padding: 0;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.16s var(--ease),
    border-color 0.16s var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--text-faint);
  transition:
    transform 0.16s var(--ease),
    background 0.16s var(--ease);
}
.switch[aria-pressed="true"] {
  background: var(--accent-quiet);
  border-color: var(--accent);
}
.switch[aria-pressed="true"]::after {
  transform: translateX(15px);
  background: var(--accent);
}

/* range */
.layer__range {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
  padding-left: calc(26px + var(--space-3));
}
.layer.is-off .layer__range {
  opacity: 0.38;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 18px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--fill, 50%), var(--surface-3) var(--fill, 50%));
}
input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 2px;
  background: var(--surface-3);
}
input[type="range"]::-moz-range-progress {
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border-strong);
}
input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border-strong);
}
input[type="range"]:disabled {
  cursor: not-allowed;
}

.btn-row {
  display: flex;
  gap: var(--space-2);
}
.btn {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    color 0.15s var(--ease),
    border-color 0.15s var(--ease);
}
.btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.empty {
  color: var(--text-faint);
  font-size: var(--text-xs);
  font-style: italic;
}

/* ----------------------------------------------------------------- footer */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--space-6);
  color: var(--text-faint);
  font-size: var(--text-xs);
}
.footer__in {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
}

/* ----------------------------------------------------------------- toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-6);
  transform: translate(-50%, 16px);
  padding: var(--space-3) var(--space-5);
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: var(--text-xs);
  opacity: 0;
  pointer-events: none;
  z-index: 90;
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ----------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .detail {
    grid-template-columns: minmax(0, 1fr);
  }
  .stage {
    position: relative;
    top: 0;
    height: 62vh;
    min-height: 420px;
  }
}

@media (max-width: 900px) {
  .page {
    padding: var(--space-6) var(--space-4) var(--space-12);
  }
  .masthead {
    padding: 0 var(--space-4);
    gap: var(--space-3);
  }
  .brand__sub {
    display: none;
  }
  .client-badge {
    display: none;
  }
}

@media (max-width: 720px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .stage {
    height: 56vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ------------------------------------------------------------ signed-in user
   Sits between the delivery badge and the theme toggle in the masthead. The
   text collapses before the avatar does, so the identity and the sign-out
   control survive down to the narrowest phone. */
.who {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding-left: var(--space-4);
  border-left: 1px solid var(--border);
  min-width: 0;
}
.who[hidden] {
  display: none;
}

.who__av {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-quiet);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.who__txt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.25;
}
.who__txt b {
  font-size: var(--text-xs);
  font-weight: 560;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 17ch;
}
.who__txt small {
  font-size: 11px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 17ch;
}

.who__role {
  padding: 1px var(--space-2);
  flex: none;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 32%, transparent);
  border-radius: 999px;
}

/* --------------------------------------------------------------- home extras */
.pagehead__count {
  margin: calc(-1 * var(--space-4)) 0 var(--space-4);
}
.pagehead__count .count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-faint);
}

.chip__n {
  font-weight: 400;
  color: var(--text-faint);
}

/* --------------------------------------------------------------- sign-in page */
body.is-auth {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}
body.is-auth .footer {
  margin-top: auto;
}

.auth {
  flex: 1;
  display: grid;
  place-items: center;
  padding: var(--space-10) var(--space-4) var(--space-16);
}

.auth__card {
  width: 100%;
  max-width: 396px;
  padding: var(--space-8);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.auth__card h1 {
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
}
.auth__lede {
  color: var(--text-muted);
  font-size: var(--text-xs);
  margin-top: var(--space-2);
}

.auth__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.field > span {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.field input {
  width: 100%;
  padding: var(--space-3);
  font-family: inherit;
  font-size: var(--text-sm);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition:
    border-color 0.15s var(--ease),
    background 0.15s var(--ease);
}
.field input::placeholder {
  color: var(--text-faint);
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-3);
}

.btn--primary {
  padding: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 550;
  color: #fff;
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 70%, #000);
}
.btn--primary:hover {
  color: #fff;
  background: color-mix(in srgb, var(--accent) 88%, #fff);
}
.btn--primary:disabled {
  opacity: 0.62;
  cursor: progress;
}

.auth__error {
  padding: var(--space-3);
  font-size: var(--text-xs);
  color: var(--alert);
  background: color-mix(in srgb, var(--alert) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--alert) 34%, transparent);
  border-radius: var(--radius);
}
.auth__error[hidden] {
  display: none;
}

.auth__foot {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-faint);
}

/* --------------------------------------------------- signed-in block, narrow */
@media (max-width: 900px) {
  .who {
    padding-left: var(--space-3);
  }
  .who__txt {
    display: none;
  }
  .who__role {
    display: none;
  }
}
@media (max-width: 420px) {
  .auth__card {
    padding: var(--space-6);
  }
}
