/* Glossier Retail Tech Readiness
   Chart colour roles follow the data-viz status palette (fixed, never themed).
   Brand pink is chrome only — it never encodes data. */

:root {
  color-scheme: light;

  /* Surfaces & ink */
  --surface-1: #fdfcfb;
  --page: #f7f5f3;
  --sunken: #f2efec;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --muted: #898781;
  --grid: #e4e1dc;
  --baseline: #c8c4bd;
  --border: rgba(11, 11, 11, 0.1);
  --border-strong: rgba(11, 11, 11, 0.16);

  /* Brand chrome */
  --brand: #f7c2c0;
  --brand-ink: #b4635f;
  --brand-wash: #fdeeee;

  /* Status palette — fixed, always paired with an icon + label */
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --good-wash: #eaf6ea;
  --warning-wash: #fdf3e0;
  --serious-wash: #fceeE7;
  --critical-wash: #faeaea;

  --radius: 10px;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-1: #1a1a19;
    --page: #0d0d0d;
    --sunken: #232322;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.18);
    --brand: #f0a9a6;
    --brand-ink: #f0a9a6;
    --brand-wash: #2a1e1e;
    --good-wash: #142614;
    --warning-wash: #2b2415;
    --serious-wash: #2b1f19;
    --critical-wash: #2a1919;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1: #1a1a19;
  --page: #0d0d0d;
  --sunken: #232322;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --baseline: #383835;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --brand: #f0a9a6;
  --brand-ink: #f0a9a6;
  --brand-wash: #2a1e1e;
  --good-wash: #142614;
  --warning-wash: #2b2415;
  --serious-wash: #2b1f19;
  --critical-wash: #2a1919;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

button { font: inherit; color: inherit; }

/* ------------------------------------------------------------------- Layout */

.shell { max-width: 1180px; margin: 0 auto; padding: 0 24px 96px; }

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.masthead-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 15px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}

.wordmark .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  flex: none;
}

.wordmark .sub {
  letter-spacing: 0.1em;
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 12px;
}

nav.tabs { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }

nav.tabs a {
  text-decoration: none;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--text-secondary);
  border: 1px solid transparent;
  white-space: nowrap;
}

nav.tabs a:hover { background: var(--sunken); color: var(--text-primary); }

nav.tabs a[aria-current="page"] {
  background: var(--brand-wash);
  color: var(--brand-ink);
  border-color: color-mix(in srgb, var(--brand) 55%, transparent);
  font-weight: 550;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--text-secondary);
  flex: none;
}

.theme-toggle:hover { background: var(--sunken); color: var(--text-primary); }

/* --------------------------------------------------------------- Page header */

.page-head { padding: 40px 0 28px; }

.eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

h1 {
  font-size: clamp(28px, 4.6vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  font-weight: 600;
}

.lede { margin: 0; color: var(--text-secondary); max-width: 62ch; }

h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.section { margin-top: 40px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.section-note { font-size: 13px; color: var(--muted); margin: 0; }

/* --------------------------------------------------------------- Card & tile */

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}

/* 240px floor lands 4-up at the 1180px max width and a clean 2x2 when narrower,
   rather than a lopsided 3+1. */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.tile { display: flex; flex-direction: column; gap: 4px; }

.tile .label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.tile .value {
  font-size: 34px;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.tile .hero { font-size: 52px; }

.tile .foot { font-size: 12.5px; color: var(--text-secondary); }

/* ------------------------------------------------------------ Status marking */

/* Status is colour + icon + label, never colour alone. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 550;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.chip .glyph {
  font-size: 11px;
  line-height: 1;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  flex: none;
}

.chip[data-tone="good"] { background: var(--good-wash); color: var(--good); border-color: color-mix(in srgb, var(--good) 26%, transparent); }
.chip[data-tone="good"] .glyph { background: var(--good); }
.chip[data-tone="warning"] { background: var(--warning-wash); color: color-mix(in srgb, var(--warning) 72%, var(--text-primary)); border-color: color-mix(in srgb, var(--warning) 44%, transparent); }
.chip[data-tone="warning"] .glyph { background: var(--warning); color: #0b0b0b; }
.chip[data-tone="serious"] { background: var(--serious-wash); color: color-mix(in srgb, var(--serious) 76%, var(--text-primary)); border-color: color-mix(in srgb, var(--serious) 40%, transparent); }
.chip[data-tone="serious"] .glyph { background: var(--serious); }
.chip[data-tone="critical"] { background: var(--critical-wash); color: var(--critical); border-color: color-mix(in srgb, var(--critical) 30%, transparent); }
.chip[data-tone="critical"] .glyph { background: var(--critical); }

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
}

.swatch[data-tone="good"] { background: var(--good); }
.swatch[data-tone="warning"] { background: var(--warning); color: #0b0b0b; }
.swatch[data-tone="serious"] { background: var(--serious); }
.swatch[data-tone="critical"] { background: var(--critical); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.legend .item { display: inline-flex; align-items: center; gap: 7px; }
.legend .item .n { color: var(--muted); font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- Stacked bars */

.bars { display: flex; flex-direction: column; gap: 2px; }

.bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 250px) 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 7px 0;
}

.bar-row + .bar-row { border-top: 1px solid var(--grid); }

.bar-label {
  font-size: 13.5px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-label a { text-decoration: none; }
.bar-label a:hover { text-decoration: underline; }

.bar-label .meta { color: var(--muted); font-size: 12px; }

/* Grid + fr units so segment sizes are exact and the 2px surface gap between
   fills comes from `gap` rather than a border drawn around each mark. */
.bar-track {
  display: grid;
  gap: 2px;
  height: 14px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface-1);
  min-width: 0;
}

.bar-seg { height: 100%; min-width: 3px; cursor: default; }

.bar-seg[data-tone="good"] { background: var(--good); }
.bar-seg[data-tone="warning"] { background: var(--warning); }
.bar-seg[data-tone="serious"] { background: var(--serious); }
.bar-seg[data-tone="critical"] { background: var(--critical); }

.bar-value {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  min-width: 4.5em;
  text-align: right;
}

.bar-value strong { color: var(--text-primary); font-weight: 600; }

/* ------------------------------------------------------------- Store cards */

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

a.store-card {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.15s, transform 0.15s;
}

a.store-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.store-card .top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.store-card .name { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.store-card .region { font-size: 12px; color: var(--muted); }

.store-card .readiness {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: right;
  line-height: 1.1;
}

.store-card .readiness .cap { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 400; }

.store-card .go { font-size: 13px; color: var(--brand-ink); font-weight: 550; }

/* ------------------------------------------------------------------- Filters */

/* One filter row above everything it scopes. */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.filters input[type="search"],
.filters select {
  font: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-1);
  color: var(--text-primary);
  min-width: 0;
}

.filters input[type="search"] { flex: 1 1 220px; max-width: 340px; }

.filters .spacer { flex: 1 1 auto; }

.filters .count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.seg {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
}

.seg button {
  background: var(--surface-1);
  border: 0;
  padding: 8px 12px;
  font-size: 13.5px;
  cursor: pointer;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button:hover { background: var(--sunken); }
.seg button[aria-pressed="true"] { background: var(--sunken); color: var(--text-primary); font-weight: 550; }

/* --------------------------------------------------------------- Table view */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-1); }

table { border-collapse: collapse; width: 100%; font-size: 14px; }

thead th {
  text-align: left;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--grid);
  background: var(--surface-1);
  position: sticky;
  top: 0;
  white-space: nowrap;
}

thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--text-primary); }
thead th .arrow { color: var(--brand-ink); }

tbody td { padding: 11px 16px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--sunken); }

td.serial { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; letter-spacing: -0.01em; white-space: nowrap; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.dim { color: var(--muted); }

.flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--serious);
  border: 1px solid color-mix(in srgb, var(--serious) 40%, transparent);
  background: var(--serious-wash);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 8px;
  white-space: nowrap;
}

/* ------------------------------------------------------------------- Notices */

.notice {
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  background: var(--surface-1);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.notice h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.notice p { margin: 0; color: var(--text-secondary); font-size: 14px; }
.notice code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  background: var(--sunken);
  padding: 1px 5px;
  border-radius: 4px;
}

.notice-stack { display: grid; gap: 12px; }

.store-card .pending { font-size: 13.5px; color: var(--muted); }

.empty { text-align: center; padding: 56px 24px; color: var(--text-secondary); }
.empty-page { margin-top: 48px; }
.loading { padding-top: 48px; }
.empty .mark { font-size: 30px; opacity: 0.4; display: block; margin-bottom: 10px; }
.empty h3 { margin: 0 0 8px; font-size: 17px; color: var(--text-primary); font-weight: 600; }
.empty p { margin: 0 auto; max-width: 44ch; font-size: 14px; }

footer.foot {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ Tooltip */

#tip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  background: var(--text-primary);
  color: var(--page);
  font-size: 12.5px;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

#tip[data-show="1"] { opacity: 1; }

/* ------------------------------------------------------------------- Buttons */

.btn {
  font: inherit;
  font-size: 13.5px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface-1);
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { background: var(--sunken); }
.btn:disabled { opacity: 0.55; cursor: default; }

.btn.small { font-size: 12.5px; padding: 6px 11px; }
.btn.ghost { border-color: transparent; color: var(--text-secondary); }
.btn.ghost:hover { border-color: var(--border-strong); color: var(--text-primary); }

.btn.primary {
  background: var(--text-primary);
  color: var(--page);
  border-color: var(--text-primary);
}
.btn.primary:hover { opacity: 0.86; background: var(--text-primary); }

.btn.danger { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 40%, transparent); }
.btn.danger:hover { background: var(--critical-wash); }

/* ----------------------------------------------------------------- Admin bar */

.admin-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 20px;
}

.admin-tag {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-ink);
  background: var(--brand-wash);
  border: 1px solid color-mix(in srgb, var(--brand) 55%, transparent);
  border-radius: 999px;
  padding: 4px 10px;
}

/* ------------------------------------------------------------------ Bulk bar */

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--brand-wash);
  border: 1px solid color-mix(in srgb, var(--brand) 50%, transparent);
  font-size: 13.5px;
  font-weight: 550;
  color: var(--brand-ink);
}

.bulk-bar .spacer { flex: 1 1 auto; }

/* ------------------------------------------------------- Table interactivity */

tbody tr[data-id] { cursor: pointer; }
tbody tr.picked { background: var(--brand-wash); }
tbody tr.picked:hover { background: var(--brand-wash); }

th.pick, td.pick { width: 34px; padding-right: 0; }
th.tight, td.tight { width: 1%; text-align: right; }

td.notes-cell { max-width: 260px; }

.row-edit {
  font: inherit;
  font-size: 12.5px;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 9px;
  color: var(--text-secondary);
  cursor: pointer;
}

tbody tr:hover .row-edit { border-color: var(--border-strong); color: var(--text-primary); }

input[type="checkbox"] { accent-color: var(--brand-ink); width: 15px; height: 15px; cursor: pointer; }

/* -------------------------------------------------------------------- Toasts */

#toasts {
  position: fixed;
  z-index: 80;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}

.toast {
  background: var(--text-primary);
  color: var(--page);
  font-size: 13.5px;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s, transform 0.18s;
  max-width: 100%;
}

.toast[data-show="1"] { opacity: 1; transform: translateY(0); }
.toast[data-tone="success"] { background: var(--good); color: #fff; }
.toast[data-tone="error"] { background: var(--critical); color: #fff; }

/* --------------------------------------------------------------------- Modal */

body.modal-open { overflow: hidden; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(11, 11, 11, 0.45);
  display: grid;
  place-items: start center;
  padding: 40px 16px;
  overflow-y: auto;
}

.modal {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.modal.wide { max-width: 620px; }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--grid);
}

.modal-head h2 { font-size: 18px; letter-spacing: -0.015em; }
.modal-sub { margin: 4px 0 0; font-size: 13px; color: var(--text-secondary); }

.modal-x {
  background: none;
  border: 0;
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  flex: none;
}

.modal-x:hover { background: var(--sunken); color: var(--text-primary); }

.modal-body { padding: 18px 22px 20px; }

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--grid);
}

.modal-actions .spacer { flex: 1 1 auto; }

/* -------------------------------------------------------------------- Fields */

.field { display: block; margin-bottom: 14px; }

.field-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="file"],
.field select,
.field textarea {
  font: inherit;
  font-size: 14px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-1);
  color: var(--text-primary);
}

.field textarea { resize: vertical; min-height: 60px; }
.field textarea:disabled { background: var(--sunken); color: var(--text-secondary); cursor: not-allowed; }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 1px; }

.field-hint { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; }
.field-hint code { font-size: 11.5px; background: var(--sunken); padding: 1px 4px; border-radius: 4px; }

.meta-line { margin: 0 0 4px; }

fieldset.field { border: 0; padding: 0; margin-inline: 0; }

.radio-set .radio {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 13.5px;
  padding: 7px 0;
  cursor: pointer;
}

.radio-set .radio input { margin-top: 2px; accent-color: var(--brand-ink); flex: none; }
.radio-set .radio strong { font-weight: 600; }

.confirm-msg { margin: 0 0 16px; font-size: 14px; color: var(--text-secondary); line-height: 1.55; }
.confirm-msg strong { color: var(--text-primary); }

.inline-warn {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--serious);
  background: var(--serious-wash);
  border: 1px solid color-mix(in srgb, var(--serious) 34%, transparent);
  border-radius: 8px;
  padding: 9px 12px;
}

.import-preview {
  font-size: 12.5px;
  color: var(--text-secondary);
  background: var(--sunken);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.import-preview code { font-size: 11.5px; }
.import-preview strong { color: var(--text-primary); }
.preview-warn { color: var(--serious); font-weight: 550; }

/* Read-only field list, shown in place of inputs when not signed in. */
.kv-list { margin: 0 0 14px; display: grid; gap: 1px; }

.kv {
  display: grid;
  grid-template-columns: minmax(90px, 34%) 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--grid);
  font-size: 14px;
}

.kv dt {
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.kv dd { margin: 0; overflow-wrap: anywhere; }

.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;
}

/* The wordmark, four tabs, auth and theme buttons stop fitting on one line well
   before the phone breakpoint, so reflow the nav onto its own row early. */
@media (max-width: 860px) {
  .masthead-inner { padding: 12px 16px; row-gap: 10px; }
  .wordmark { order: 1; }
  .theme-toggle { order: 2; margin-left: auto; }
  #auth { order: 3; }
  nav.tabs { order: 4; margin-left: 0; width: 100%; }
}

@media (max-width: 620px) {
  .shell { padding: 0 16px 72px; }
  .bar-row { grid-template-columns: 1fr; gap: 6px; }
  .bar-value { text-align: left; }
  .modal-backdrop { padding: 16px 10px; }
  td.notes-cell { max-width: 180px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  a.store-card:hover { transform: none; }
}
