/* ============================================================
   Vendor Console — Inglis Design System skin
   Light, white-space-driven, Inglis Blue hero. Built on the
   tokens in inglis-tokens.css (loaded first). Square corners,
   hairline borders, documentary restraint.
   ============================================================ */

:root {
  /* --- Compatibility aliases: map the old dashboard tokens onto
         Inglis semantic tokens so every component reads as light + blue. --- */
  --bg:            var(--bg-page);
  --bg-elev:       var(--light-grey);
  --card:          var(--white);
  --card-2:        var(--light-grey);
  --border:        var(--divider);
  --border-strong: var(--mid-grey);

  --ink:      var(--fg-1);
  --cream:    var(--fg-1);
  --ink-soft: var(--fg-2);
  --ink-mute: var(--fg-muted);
  --ink-dim:  var(--mid-grey);

  /* Inglis Blue does the brand work the gold used to do */
  --gold:   var(--inglis-blue);
  --gold-2: var(--inglis-blue-dark);
  --ribbon: var(--inglis-blue);

  --live: var(--positive);
  --warn: var(--race-gold);
  --info: var(--inglis-blue);

  --radius:    var(--radius-sm);
  --radius-sm: 2px;
  --radius-lg: 4px;

  --card-pad: 22px;
  --rail-w: 0px;
}

* { box-sizing: border-box; }

html, body, #root {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-page);
  color: var(--fg-1);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font-family: inherit; color: inherit; }

.display { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em; line-height: 1.06; }
.display-italic { font-family: var(--font-display); font-style: italic; font-weight: 400; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--inglis-blue);
  font-weight: 700;
}

/* ---- App shell: top header + content ----------------------- */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-page);
}

/* ---- Top header (white-on-blue, matches inglis.com.au) ----- */
.hdr {
  background: var(--inglis-blue);
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
  padding: 0 28px;
  flex: none;
}
.hdr-left { display: flex; align-items: center; gap: 34px; }
.hdr-logo { height: 28px; display: block; }
.hdr-nav { display: flex; gap: 4px; }
.hdr-nav button {
  display: flex; align-items: center; gap: 9px;
  color: #fff; opacity: 0.82;
  font-size: 14px; font-weight: 400;
  padding: 8px 16px;
  border-bottom: 2px solid transparent;
  transition: opacity .15s, border-color .15s;
}
.hdr-nav button svg { width: 18px; height: 18px; }
.hdr-nav button:hover { opacity: 1; }
.hdr-nav button.active { opacity: 1; font-weight: 700; border-bottom-color: #fff; }

.hdr-right { display: flex; align-items: center; gap: 18px; }
.hdr-user {
  width: 38px; height: 38px; border-radius: 50%;
  background: #fff; color: var(--inglis-blue);
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 16px; font-weight: 700;
}

.live-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 2px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700;
}
.live-pill .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: #fff;
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.5); }
  70% { box-shadow: 0 0 0 7px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}
.clock {
  font-family: var(--font-num); font-variant-numeric: tabular-nums;
  font-size: 17px; color: #fff; font-weight: 700;
  display: flex; align-items: baseline; gap: 7px;
}
.clock .meridian { font-size: 11px; opacity: 0.75; letter-spacing: 0.12em; font-weight: 400; }

/* ---- Sub-bar: page title + breadcrumb + actions ------------ */
.subbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 32px 18px;
  border-bottom: 1px solid var(--divider);
  background: var(--white);
  flex: none;
}
.subbar .title-block { display: flex; flex-direction: column; gap: 5px; }
.subbar .crumbs { display: flex; gap: 9px; align-items: center; color: var(--fg-muted); font-size: 12px; }
.subbar .crumbs .dot { width: 3px; height: 3px; background: currentColor; border-radius: 50%; opacity: .5; }
.subbar h1 {
  margin: 0;
  font-family: var(--font-display); font-weight: 400;
  font-size: 34px; line-height: 1.02; letter-spacing: -0.01em;
  color: var(--fg-1);
}

/* ---- Content scroll area ----------------------------------- */
.scroll {
  overflow-y: auto;
  padding: 28px 32px 64px;
  flex: 1;
  background: var(--bg-page);
}
.scroll::-webkit-scrollbar { width: 10px; }
.scroll::-webkit-scrollbar-thumb { background: var(--mid-grey); border-radius: 0; }
.scroll::-webkit-scrollbar-track { background: var(--light-grey); }

/* ---- Cards -------------------------------------------------- */
.card {
  background: var(--white);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  padding: var(--card-pad, 22px);
}
.card.flush { padding: 0; }
.card-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 16px;
}
.card-title h3 {
  margin: 0; font-family: var(--font-display); font-weight: 400;
  font-size: 24px; letter-spacing: -0.005em; color: var(--inglis-blue);
}
.card-title .more {
  font-size: 13px; font-weight: 700;
  color: var(--inglis-blue);
  display: inline-flex; gap: 6px; align-items: center;
}
.card-title .more:hover { text-decoration: underline; }

/* ---- Buttons ------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--fg-1);
  font-size: 14px; font-weight: 700;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--light-grey); }
.btn.primary, .btn.gold {
  background: var(--inglis-blue); color: #fff; border-color: var(--inglis-blue);
}
.btn.primary:hover, .btn.gold:hover { background: var(--inglis-blue-dark); border-color: var(--inglis-blue-dark); }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.ghost:hover { background: var(--light-grey); }
.btn.lg { padding: 15px 26px; font-size: 15px; }
.btn.sm { padding: 9px 15px; font-size: 13px; }
.btn:disabled { opacity: .45; pointer-events: none; }

/* ---- Misc --------------------------------------------------- */
.divider { height: 1px; background: var(--divider); margin: 16px 0; }
.row { display: flex; align-items: center; gap: 12px; }
.muted { color: var(--fg-muted); }
.soft { color: var(--fg-2); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 700; }
.mono { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* ---- Tags / badges ----------------------------------------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
  padding: 5px 11px; border-radius: 2px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  border: 1px solid var(--border);
  color: var(--fg-2); background: var(--white);
}
.tag.gold { color: var(--inglis-blue); border-color: transparent; background: var(--inglis-blue-tint); }
.tag.live { color: #fff; border-color: transparent; background: var(--positive); }
.tag.warn { color: #fff; border-color: transparent; background: var(--race-gold); }
.tag.ribbon { color: #fff; border-color: transparent; background: var(--inglis-blue); }

/* helper grids */
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ---- CCTV feed (video stays dark — a screen within the UI) -- */
.cctv {
  position: relative;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.015) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, #2b3a4d, #0c1219 85%);
  overflow: hidden;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
}
.cctv::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 22% 30%, rgba(255,255,255,0.05), transparent 32%),
    radial-gradient(circle at 80% 72%, rgba(255,255,255,0.035), transparent 32%);
  pointer-events: none;
}
.cctv .scanline {
  position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  animation: scan 6s linear infinite;
}
@keyframes scan { 0% { top: -2px; } 100% { top: 100%; } }
.cctv .hud {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 10px 12px;
  font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 10px;
  color: rgba(255,255,255,0.8);
  letter-spacing: 0.06em;
  pointer-events: none;
}
.cctv .hud .row { justify-content: space-between; display: flex; }
.cctv .hud .rec { color: #fff; display: flex; align-items: center; gap: 6px; }
.cctv .hud .rec .dot { width: 6px; height: 6px; border-radius: 50%; background: #ff5252; animation: pulse 1.6s infinite; }
.cctv .horse-silhouette { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0.5; }

/* Sparklines */
.spark { display: block; width: 100%; height: 36px; }

/* Section heading */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin: 0 0 20px;
}
.section-head h2 {
  margin: 0; font-family: var(--font-display); font-weight: 400;
  font-size: 30px; letter-spacing: -0.005em; color: var(--inglis-blue);
}

/* table */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 13px 16px;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-muted); font-weight: 700;
  border-bottom: 2px solid var(--inglis-blue);
}
.table td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--divider);
  font-size: 14.5px; color: var(--fg-2);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--light-grey); }
.table tr.click { cursor: pointer; }

/* big stat */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .v { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 38px; line-height: 1; color: var(--inglis-blue); }
.stat .v .delta { font-size: 13px; color: var(--positive); margin-left: 8px; font-weight: 700; }
.stat .v .delta.down { color: var(--negative); }
.stat .l { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-muted); font-weight: 700; }

/* horse card */
.horse-card {
  background: var(--white);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .18s, transform .18s;
}
.horse-card:hover { box-shadow: var(--shadow-md); }
.horse-card .photo {
  height: 160px;
  background: var(--inglis-blue-tint);
  position: relative;
  display: grid; place-items: center;
  border-bottom: 1px solid var(--divider);
}
.horse-card .photo .lot {
  position: absolute; top: 0; left: 0;
  font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--inglis-blue);
  padding: 4px 9px;
  color: #fff;
}
.horse-card .photo .pedigree-mark {
  font-family: var(--font-display); font-style: italic;
  font-size: 60px; color: rgba(56,88,167,0.22);
}
.horse-card .body { padding: 16px 18px; }
.horse-card .name { font-family: var(--font-display); font-size: 22px; line-height: 1.1; color: var(--fg-1); }
.horse-card .ped { font-size: 13px; color: var(--fg-muted); margin-top: 4px; }
.horse-card .mini { display: flex; gap: 20px; margin-top: 14px; }
.horse-card .mini .v { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; color: var(--inglis-blue); }
.horse-card .mini .l { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-muted); margin-top: 2px; font-weight: 700; }

/* Inspection steps */
.steps { display: flex; gap: 0; margin-bottom: 28px; }
.steps .step {
  flex: 1; padding: 14px 0;
  border-bottom: 2px solid var(--divider);
  color: var(--fg-muted);
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
}
.steps .step.active { border-bottom-color: var(--inglis-blue); color: var(--inglis-blue); }
.steps .step.done { border-bottom-color: var(--inglis-blue); color: var(--inglis-blue); }
.steps .step .n {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid currentColor;
  display: grid; place-items: center;
  font-family: var(--font-num); font-size: 12px;
}

/* Field */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--fg-1); }
.field input, .field textarea, .field select {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--inglis-blue);
  box-shadow: 0 0 0 3px var(--inglis-blue-tint);
}
.field textarea { min-height: 100px; resize: vertical; }

/* Score buttons */
.score-row { display: flex; gap: 6px; }
.score-btn {
  flex: 1; height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--fg-2);
  font-family: var(--font-num); font-weight: 700; font-size: 17px;
  transition: all .12s;
}
.score-btn:hover { border-color: var(--inglis-blue); color: var(--inglis-blue); }
.score-btn.sel { background: var(--inglis-blue); border-color: var(--inglis-blue); color: #fff; }

/* Channel chip */
.chan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.chan {
  padding: 14px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--white);
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  transition: border-color .15s, background .15s;
  text-align: left;
}
.chan:hover { border-color: var(--inglis-blue); }
.chan.sel { border-color: var(--inglis-blue); background: var(--inglis-blue-tint); }
.chan .num { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 22px; color: var(--inglis-blue); }
.chan .name { font-size: 12px; color: var(--fg-2); }

/* segmented */
.seg {
  display: inline-flex; padding: 3px; border-radius: var(--radius-sm);
  background: var(--light-grey); border: 1px solid var(--divider);
}
.seg button {
  padding: 8px 15px;
  font-size: 13px; font-weight: 700;
  color: var(--fg-muted); border-radius: 1px;
  transition: background .15s, color .15s;
}
.seg button.on { background: var(--inglis-blue); color: #fff; }

/* scroll-snap rail */
.h-rail { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.h-rail::-webkit-scrollbar { height: 6px; }
.h-rail::-webkit-scrollbar-thumb { background: var(--mid-grey); }
.h-rail > * { scroll-snap-align: start; flex: 0 0 auto; }

/* anim — dignified; transform-only so content is NEVER hidden by a stuck/throttled animation */
.fade-in { animation: fadeIn .22s ease both; opacity: 1; }
@keyframes fadeIn { from { transform: translateY(4px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none; } }

/* ---- Hero ---- */
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; align-items: stretch; }
.qstat { flex: 1; padding: 16px 20px; border-right: 1px solid var(--divider); min-width: 150px; }
.qstrip { flex-wrap: wrap; }
.qstrip .qstat:last-child { border-right: 0; }

/* ---- Weather strip ---- */
.wx { display: grid; grid-template-columns: repeat(5, 1fr); }
.wx-day { padding: 2px 18px; }
.wx-day:first-child { padding-left: 0; }
.wx-short { display: none; }
@media (max-width: 720px) {
  .wx { grid-template-columns: repeat(5, 1fr); }
  .wx-day { padding: 0 4px; text-align: center; }
  .wx-day:first-child { padding-left: 4px; }
  .wx-long { display: none; }
  .wx-short { display: inline; }
  .wx-day .eyebrow { font-size: 9.5px; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wx-ico { margin: 5px 0 3px !important; display: flex; justify-content: center; }
  .wx-ico svg { width: 20px !important; height: 20px !important; }
  .wx-temps { justify-content: center; gap: 4px !important; }
  .wx-max { font-size: 16px !important; }
  .wx-min { font-size: 12px !important; }
  .wx-text, .wx-meta { display: none; }
}

/* ---- Box snapshot (live-first: 5-min thumbnail, tap for live crop) ---- */
.boxsnap { position: relative; overflow: hidden; background: #14181f; border-radius: var(--radius-sm); }
.livechip { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; font-family: var(--font-num); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; color: #fff; background: rgba(200,16,46,0.92); border-radius: 2px; }
.livechip .pulse { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.6s infinite; }
.snapmeta { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 10px; letter-spacing: 0.05em; color: rgba(255,255,255,0.88); background: linear-gradient(transparent, rgba(0,0,0,0.62)); }

/* ---- Toolbar / search ---- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.searchbox { display: flex; align-items: center; gap: 10px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; width: 280px; max-width: 100%; }

/* ---- Live: lane switcher + player ---- */
.lane-switch { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.lane-switch button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 11px; color: var(--fg-muted); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; transition: border-color .15s, background .15s; }
.lane-switch button .display { color: var(--fg-1); }
.lane-switch button.on { border-color: var(--inglis-blue); background: var(--inglis-blue-tint); color: var(--inglis-blue); }
.lane-switch button.on .display { color: var(--inglis-blue); }
.player { position: relative; aspect-ratio: 16/7; background: #14181f; overflow: hidden; }
.player-hud { position: absolute; inset: 0; padding: 12px 16px; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 11px; color: rgba(255,255,255,0.85); letter-spacing: 0.06em; background: linear-gradient(rgba(0,0,0,0.4), transparent 30%); pointer-events: none; }

/* ---- Box map ---- */
.boxrow { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.box { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px 12px; min-height: 62px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); text-align: left; transition: border-color .15s, background .15s; }
.box .bid { font-size: 10px; letter-spacing: 0.1em; font-weight: 700; color: var(--fg-muted); }
.box .blot { font-family: var(--font-display); font-size: 17px; color: var(--fg-1); }
.box .bfree { font-size: 11px; color: var(--fg-muted); }
.box.occ { background: var(--inglis-blue-tint); border-color: var(--inglis-blue); }
.box.occ .bid { color: var(--inglis-blue); }
.box.picked { outline: 2px solid var(--inglis-blue); outline-offset: 1px; }
.box.target { border-style: dashed; border-color: var(--inglis-blue); }
.box.target .bfree { color: var(--inglis-blue); font-weight: 700; }
.box .bactions { display: flex; gap: 10px; font-size: 10.5px; font-weight: 700; color: var(--inglis-blue); }
.box .bactions span:hover { text-decoration: underline; }
.placerow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 0; border-top: 1px solid var(--divider); cursor: pointer; }
.placerow:first-of-type { border-top: 0; }
.placerow[data-picked] { background: var(--inglis-blue-tint); margin: 0 -10px; padding: 10px; width: calc(100% + 20px); }

/* ---- Inspections ---- */
.inspect-grid { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
.horse-card.pick { text-align: left; cursor: pointer; }
.horse-card.pick[data-on] { border-color: var(--inglis-blue); box-shadow: 0 0 0 1px var(--inglis-blue); }
.pickmark { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--inglis-blue); color: #fff; display: grid; place-items: center; }
.ta-menu { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; background: var(--white); border: 1px solid var(--border); border-top: 0; box-shadow: var(--shadow-md, 0 8px 20px rgba(33,52,95,0.12)); max-height: 260px; overflow-y: auto; }
.ta-menu button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; padding: 10px 14px; font-size: 14px; border-bottom: 1px solid var(--divider); }
.ta-menu button:last-child { border-bottom: 0; }
.ta-menu button:hover, .ta-menu button.hi { background: var(--inglis-blue-tint); }

/* ---- TV ---- */
.tvpick { padding: 14px 18px; cursor: pointer; min-width: 240px; text-align: left; }
.tvpick[data-on] { border-color: var(--inglis-blue); background: var(--inglis-blue-tint); }
.tvscreen { position: relative; border-radius: var(--radius-sm); border: 1px solid var(--border); aspect-ratio: 16/9; overflow: hidden; display: grid; place-items: center; }
.spinner { width: 26px; height: 26px; margin: 0 auto; border: 2.5px solid rgba(255,255,255,0.25); border-top-color: #fff; border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Admin access grid ---- */
.acc { width: 26px; height: 26px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--white); color: #fff; display: inline-grid; place-items: center; transition: all .12s; }
.acc.on { background: var(--inglis-blue); border-color: var(--inglis-blue); }
.acc:disabled { opacity: 0.6; }
.access-table th { padding: 13px 8px; }

/* ---- Mobile shell ---- */
.burger { color: #fff; padding: 8px; display: inline-flex; }
.tabbar { flex: none; display: flex; background: var(--white); border-top: 1px solid var(--divider); padding-bottom: env(safe-area-inset-bottom, 0); }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 8px; font-size: 10.5px; font-weight: 700; color: var(--fg-muted); border-top: 2px solid transparent; }
.tabbar button.active { color: var(--inglis-blue); border-top-color: var(--inglis-blue); }
.sheet-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(33,52,95,0.4); display: flex; align-items: flex-end; }
.sheet { width: 100%; background: var(--white); padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0)); animation: sheetUp .22s ease; }
@keyframes sheetUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 15px 4px; font-size: 15.5px; font-weight: 700; color: var(--fg-1); border-top: 1px solid var(--divider); }
.sheet-item.active { color: var(--inglis-blue); }

/* ---- Data-source banners (mock fixtures / unavailable modules) ---- */
.mockbar {
  flex: none;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 7px 32px;
  background: var(--race-gold);
  color: #fff;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.mockbar .mockbar-list { font-weight: 400; letter-spacing: 0.04em; text-transform: none; opacity: 0.95; }
.modulegate {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--light-grey);
  padding: 34px 30px;
  text-align: center;
}
.modulegate .display { font-size: 26px; color: var(--fg-1); }
.modulegate p { max-width: 460px; margin: 10px auto 0; color: var(--fg-muted); font-size: 13.5px; }
.modulegate .eyebrow { color: var(--fg-muted); }
.mocknote {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px; border-radius: 2px;
  background: var(--race-gold); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}

/* ---- Responsive ---- */
@media (max-width: 1000px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr 1fr; }
  .profile-cols { grid-template-columns: 1fr 1fr; }
  .profile-cols > .card { grid-column: span 2 !important; }
}
@media (max-width: 740px) {
  .hdr { height: 56px; padding: 0 16px; }
  .hdr-logo { height: 22px; }
  .mockbar { padding: 6px 16px; font-size: 10px; }
  .subbar { padding: 14px 18px 12px; }
  .subbar h1 { font-size: 26px; }
  .scroll { padding: 18px 16px 40px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .pickgrid { grid-template-columns: 1fr 1fr; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { border-left: 0 !important; border-top: 1px solid rgba(255,255,255,0.18); }
  .qstat { min-width: 40%; border-bottom: 1px solid var(--divider); }
  .lane-switch { grid-template-columns: repeat(3, 1fr); }
  .inspect-grid, .tv-grid, .admin-grid, .boxmap-grid { grid-template-columns: 1fr !important; }
  /* Grid and flex children default to min-width:auto, so a wide child (the
     inspection step rail) sizes the track past the viewport and gets clipped.
     Let these tracks shrink to the space actually available. */
  .inspect-grid > *, .tv-grid > *, .admin-grid > *, .boxmap-grid > * { min-width: 0; }
  .steps { max-width: 100% !important; }
  .steps .step { min-width: 0; }
  .hide-mobile { display: none !important; }
  .miniwrap { flex-wrap: wrap; gap: 14px !important; }
  .horse-card .mini { flex-wrap: wrap; gap: 12px; }
  .horse-card .mini .v { font-size: 16px; }
  .player { aspect-ratio: 16/10; }
  .table td, .table th { padding: 11px 10px; font-size: 13px; }
  .clock { font-size: 15px; }
}

/* ---- Design canvas (the five-frame overview) ---- */
.canvas-body { position: relative; margin: 0; background: #F2F4F8; min-width: 3340px; min-height: 1020px; }
.frame { position: absolute; background: #fff; box-shadow: 0 10px 30px rgba(33,52,95,0.18); border: 1px solid #d8dde8; }
.frame .label { position: absolute; top: -28px; left: 0; font: 700 12px/1 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #3858A7; }
.frame iframe { display: block; border: 0; width: 100%; height: 100%; }

/* ---- Boot states (before the bootstrap payload lands) ----
   The static bundle mounts before it has any data, so these two states are what
   a vendor sees while the host is answering, and if it never does. A failure is
   shown as a failure: never an empty dashboard that reads as "you have no lots". */
.boot-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; min-height: 60vh; padding: 40px 24px;
  font: 400 15px/1.6 var(--font-body, system-ui, sans-serif);
  color: var(--fg-2); text-align: center;
}
.boot-state h1 {
  margin: 0; font: 700 22px/1.25 var(--font-display, system-ui, sans-serif); color: var(--fg-1);
}
.boot-state p { margin: 0; max-width: 46ch; }
.boot-state--error h1 { color: var(--negative); }
.boot-state__detail {
  font: 400 12px/1.5 ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--fg-muted); word-break: break-word;
}
