/* SVAMI Product UI (W6) · S4 design language & tokens
   Surfaces A (Supplier Upload, always light), B (Group Console, dark default), C (SVAMI Ops Console, dark default). */

/* ---------- Tokens ---------- */
:root, [data-theme="light"] {
  --moon: #00ffba;
  --moon-ring: #00b383;
  --bg: #f7f7f5;
  --card: #ffffff;
  --raise: #efefeb;
  --hover: #fafaf8;
  --ink: #111111;
  --ink2: #3a3a3a;
  --sub: #686866;
  --mute: #9a9a9a;
  --line: #e3e3df;
  --line2: #efefeb;
  --stroke: #111111;
  --inv: #111111;
  --inv-ink: #ffffff;
  --focus: #111111;
  --alert: #b42318;
  --map-land: #e2e2de;
  --live-ring: #111111;
  --inv-sub: #a9a9a6;
  --scrim: rgba(17, 17, 17, 0.34);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 16px;
  --r-xl: 20px;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0b0b0b;
  --card: #141413;
  --raise: #1e1e1d;
  --hover: #1a1a19;
  --ink: #f2f2ef;
  --ink2: #c9c9c6;
  --sub: #8d8d8b;
  --mute: #6f6f6d;
  --line: #262624;
  --line2: #1e1e1d;
  --stroke: #f2f2ef;
  --inv: #f2f2ef;
  --inv-ink: #111111;
  --focus: #f2f2ef;
  --alert: #ff7a6e;
  --map-land: #2a2a28;
  --live-ring: #00b383;
  --inv-sub: #5e5e5c;
  --scrim: rgba(0, 0, 0, 0.65);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num, .tab-num { font-variant-numeric: tabular-nums; }
.sub { color: var(--sub); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
b, strong, .b { font-weight: 500; }
[hidden] { display: none !important; }

.boot-center {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

/* ---------- Type scale ---------- */
.t-display { font-size: 28px; font-weight: 500; letter-spacing: -0.025em; line-height: 1.15; }
.t-title { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.25; }
.t-head { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.t-body { font-size: 14px; }
.t-small { font-size: 12.5px; }
.t-label { font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sub); }
.t-num { font-size: 34px; font-weight: 500; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }

/* ---------- Brand logo (official SVAMI SVG lockups, never recoloured) ---------- */
.brand { display: inline-flex; align-items: center; padding: 4px 0; }
.brand-img { height: 22px; width: auto; display: block; }
.brand-img.sm { height: 20px; }
[data-theme="dark"] .light-only { display: none; }
[data-theme="light"] .dark-only, :root:not([data-theme="dark"]) .dark-only { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  background: var(--card);
  color: var(--ink);
  white-space: nowrap;
  transition: border-color 0.12s, background-color 0.12s;
}
.btn:hover:not([disabled]) { border-color: var(--sub); }
.btn.solid { background: var(--inv); color: var(--inv-ink); border-color: var(--inv); }
.btn.solid:hover:not([disabled]) { opacity: 0.9; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink2); }
.btn.ghost:hover:not([disabled]) { border-color: var(--line); color: var(--ink); }
.btn.lg { padding: 12px 20px; font-size: 14px; }
.btn.block { display: flex; width: 100%; }
.btn.sm { padding: 4px 11px; font-size: 12.5px; }
.btn[disabled], .btn.is-disabled {
  background: var(--raise);
  color: var(--sub);
  border-color: var(--line);
  cursor: not-allowed;
  opacity: 0.72;
}
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: var(--card);
  flex-wrap: wrap;
}
.seg button {
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--sub);
  font-weight: 500;
}
.seg button.on { background: var(--inv); color: var(--inv-ink); }

/* ---------- Chips & Tabs ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  background: var(--card);
  color: var(--ink2);
}
.chip:hover { border-color: var(--sub); }
.chip.on { background: var(--inv); color: var(--inv-ink); border-color: var(--inv); }
.chip .n { font-variant-numeric: tabular-nums; opacity: 0.85; }

.tabs {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  margin-top: 16px;
  overflow-x: auto;
}
.tabs button {
  padding: 10px 0;
  color: var(--sub);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  font-weight: 500;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-color: var(--ink); }

/* ---------- Monochrome-first status glyphs (shape + label) ---------- */
.g {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: relative;
  vertical-align: -1px;
}
.g.live { background: var(--moon); box-shadow: 0 0 0 1.5px var(--live-ring) inset; }
.g.half { border: 1.5px solid var(--stroke); background: linear-gradient(90deg, var(--stroke) 50%, transparent 50%); }
.g.pend { border: 1.5px solid var(--stroke); }
.g.scan { border: 1.5px dotted var(--stroke); }
.g.ret { border: 1.5px solid var(--stroke); }
.g.ret::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 50%;
  height: 1.5px;
  margin-top: -0.75px;
  background: var(--stroke);
}
.g.fail { border: 1.5px solid var(--stroke); border-radius: 2px; }
.g.fail::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 1px;
  bottom: 1px;
  background: linear-gradient(var(--stroke), var(--stroke)) center/1.5px 100% no-repeat;
}
.g.wd { border-radius: 0; }
.g.wd::before, .g.wd::after {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  top: 50%;
  height: 1.5px;
  margin-top: -0.75px;
  background: var(--stroke);
  transform: rotate(45deg);
}
.g.wd::after { transform: rotate(-45deg); }
.g.off { background: var(--line); }

.lc { display: inline-block; flex: none; width: 10px; height: 10px; position: relative; vertical-align: -1px; }
.lc.ok::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0;
  width: 4px;
  height: 7px;
  border-right: 1.5px solid var(--stroke);
  border-bottom: 1.5px solid var(--stroke);
  transform: rotate(45deg);
}
.lc.no { border: 1.5px solid var(--stroke); border-radius: 50%; }
.lc.no::after {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  top: 50%;
  height: 1.5px;
  margin-top: -0.75px;
  background: var(--stroke);
  transform: rotate(-45deg);
}

.st { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--sub);
  white-space: nowrap;
}
.tag.fast::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid var(--ink);
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
}
.badge {
  display: inline-block;
  font-size: 11.5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--raise);
  color: var(--ink2);
  font-variant-numeric: tabular-nums;
}

/* Overdue fast-lane alert (>24h ONLY, always with ! glyph) */
.over {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--alert);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.over::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--alert);
  color: var(--bg);
  font-size: 10px;
  font-weight: 600;
  flex: none;
}

/* ---------- Cards & Layout ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 18px 20px;
  min-width: 0;
}
.card > h2, .card-h {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sub);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  flex-wrap: wrap;
}
.card-h .btn, .card > h2 .btn, .card > h2 .btns, .card > h2 .chips { text-transform: none; letter-spacing: 0; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(4, minmax(0, 1fr)) 1.25fr; }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
.g-21 { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }

.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mt20 { margin-top: 20px; }
.mt24 { margin-top: 24px; }

.row { display: flex; gap: 10px; align-items: center; }
.row.sp { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 10px; }
.hr { height: 1px; background: var(--line); margin: 16px 0; }

.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 14px; font-size: 13px; }
.kv > span:nth-child(odd) { color: var(--sub); }
.kv > span:nth-child(even) { word-break: break-word; }

/* KPI */
.kpi .t-num { margin-top: 8px; }
.kpi .d { color: var(--sub); font-size: 12.5px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.kpi.live .t-num::after {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--moon);
  box-shadow: 0 0 0 1.5px var(--live-ring) inset;
  margin-left: 10px;
  vertical-align: 8px;
}
.kpi.inv { background: var(--inv); color: var(--inv-ink); border-color: var(--inv); }
.kpi.inv > h2, .kpi.inv .d { color: var(--inv-sub); }
.kpi.inv .split { display: flex; gap: 10px 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sub);
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 11px 10px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
tbody tr:hover { background: var(--hover); }
tbody tr.clickable { cursor: pointer; }
tr.sel { background: var(--hover); }
td .sub, td.sub { font-size: 12.5px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tfoot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--sub); font-size: 12.5px; flex-wrap: wrap; gap: 10px; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; font-size: 12.5px; color: var(--sub); }
.field > span:first-child { font-weight: 500; color: var(--ink2); }
.input, .select, textarea.input {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
}
.input::placeholder, textarea.input::placeholder { color: var(--sub); }
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--sub) 50%), linear-gradient(135deg, var(--sub) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}
.select.sm, .input.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.input.err, .select.err, textarea.input.err { border-color: var(--ink); border-width: 1.5px; }
.otp-input {
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: 0.35em;
  text-align: center;
  padding: 12px 14px;
}

.errmsg {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
}
.errmsg::before {
  content: "!";
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-size: 10.5px;
  font-weight: 600;
  margin-top: 1px;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
}
.check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--inv);
  cursor: pointer;
  flex: none;
}

.search { position: relative; display: block; }
.search .input { padding-left: 34px; }
.search::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -6px;
  border: 1.5px solid var(--sub);
  border-radius: 50%;
  pointer-events: none;
}
.search::after {
  content: "";
  position: absolute;
  left: 21px;
  top: 50%;
  width: 5px;
  height: 1.5px;
  margin-top: 3px;
  background: var(--sub);
  transform: rotate(45deg);
  pointer-events: none;
}

/* ---------- Banners, Empty, Progress, Toggle ---------- */
.banner {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 11px 14px;
  background: var(--card);
  font-size: 13px;
  flex-wrap: wrap;
}
.banner.strong { border-color: var(--stroke); }
.banner .grow { flex: 1; min-width: 180px; }

.empty {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 20px;
  gap: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--r-l);
}
.dotmotif {
  width: 88px;
  height: 52px;
  background-image: radial-gradient(circle, var(--sub) 1.3px, transparent 1.6px);
  background-size: 8px 8px;
  -webkit-mask: radial-gradient(ellipse at center, #000 30%, transparent 72%);
  mask: radial-gradient(ellipse at center, #000 30%, transparent 72%);
  opacity: 0.8;
}

.prog { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.prog span { display: block; height: 100%; background: var(--ink); transition: width 0.15s; }

.tg {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  flex: none;
  border: 1px solid var(--line);
  transition: background-color 0.15s;
}
.tg::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sub);
  transition: left 0.15s, background-color 0.15s;
}
.tg.on { background: var(--inv); border-color: var(--inv); }
.tg.on::after { left: 18px; background: var(--inv-ink); }

/* ---------- Modal & Toast ---------- */
.ovl {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--scrim);
  overflow: auto;
}
.modal {
  width: min(560px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 40px);
  overflow: auto;
}
.modal.wide { width: min(980px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.xbtn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  position: relative;
  flex: none;
}
.xbtn:hover { border-color: var(--sub); }
.xbtn::before, .xbtn::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 1.5px;
  margin-top: -0.75px;
  background: var(--ink);
  transform: rotate(45deg);
}
.xbtn::after { transform: rotate(-45deg); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--inv);
  color: var(--inv-ink);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  z-index: 80;
  box-shadow: var(--shadow);
  max-width: calc(100vw - 32px);
  text-align: center;
}

/* ---------- Steps & Drop zone ---------- */
.steps { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--sub); }
.steps span { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); }
.steps span.on { color: var(--ink); border-color: var(--ink); font-weight: 500; }
.steps span.done { color: var(--ink2); }
.steps span.done::before { content: "✓ "; }

.drop {
  border: 1.5px dashed var(--sub);
  border-radius: var(--r-l);
  padding: 28px 20px;
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
  color: var(--sub);
  cursor: pointer;
  background: var(--card);
  transition: border-color 0.12s, background-color 0.12s;
}
.drop:hover, .drop.dragover { border-color: var(--ink); background: var(--hover); }
.drop b { color: var(--ink); }

/* ---------- Console Sign-in ---------- */
.signin-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.signin-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.signin-bar {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px clamp(16px, 3vw, 32px);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  gap: 12px;
  flex-wrap: wrap;
}
.signin-body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}
.signin-card {
  width: min(400px, 100%);
  padding: 28px;
  box-shadow: var(--shadow);
}

/* ---------- Surface A · Supplier Upload Flow (Always Light, Mobile-first 375px–480px) ---------- */
.surface-a-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  justify-content: center;
}
.phone {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
@media (min-width: 540px) {
  .surface-a-page { padding: 28px 16px; background: #ecece8; }
  .phone {
    min-height: 700px;
    border-radius: 24px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    overflow: hidden;
  }
}
.a-hd {
  padding: 16px 16px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.a-hd .gname { font-weight: 500; font-size: 14px; line-height: 1.25; }
.a-hd .gsub { font-size: 12px; color: var(--sub); }
.a-hd .back {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--card);
}
.a-hd .back::before {
  content: "";
  width: 7px;
  height: 7px;
  border-left: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: rotate(45deg);
  margin-left: 3px;
}
.a-bd {
  padding: 20px 16px;
  display: grid;
  gap: 16px;
  align-content: start;
  flex: 1;
}
.a-ft {
  padding: 14px 16px 20px;
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  bottom: 0;
}
.stepn { font-size: 12px; color: var(--sub); display: flex; justify-content: space-between; }
.stepbar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.stepbar i { height: 3px; border-radius: 2px; background: var(--line); }
.stepbar i.on { background: var(--ink); }
.lead { color: var(--ink2); font-size: 14.5px; }
.why { font-size: 13px; color: var(--sub); }
.minor { font-size: 12px; color: var(--sub); text-align: center; }

.prop-list { display: grid; gap: 8px; max-height: 360px; overflow-y: auto; }
.prop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  align-items: center;
  text-align: left;
  width: 100%;
}
.prop:hover { border-color: var(--sub); }
.prop .m { font-size: 12.5px; color: var(--sub); }
.prop.on { border: 1.5px solid var(--ink); }
.radio { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--sub); grid-row: span 2; }
.prop.on .radio { border: 5px solid var(--ink); }

.file-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}
.file-card.bad { border: 1.5px solid var(--ink); }
.fh { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.ficon {
  width: 36px;
  height: 40px;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: grid;
  place-items: end center;
  padding-bottom: 5px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink2);
  background: var(--bg);
}
.fname { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmeta { font-size: 12px; color: var(--sub); }
.dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dates .full { grid-column: 1 / -1; }
.opt { font-weight: 400; color: var(--sub); }
.req { font-weight: 400; color: var(--ink2); }

.legal {
  border: 1.5px dashed var(--sub);
  border-radius: 12px;
  padding: 14px;
  font-size: 13px;
  color: var(--ink2);
  display: grid;
  gap: 8px;
  background: var(--card);
}
.summary { border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.summary .r {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--line2);
  font-size: 13px;
}
.summary .r:first-child { border-top: 0; }
.timeline { display: grid; gap: 0; }
.timeline .s {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 14px;
  position: relative;
}
.timeline .s::before {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 14px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.timeline .s:last-child::before { display: none; }
.timeline .g { margin-top: 4px; z-index: 1; }
.ref-code { font-family: var(--mono); font-size: 18px; letter-spacing: 0.04em; font-weight: 500; }
.dead {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 24px;
  gap: 14px;
  align-content: center;
}
.brandline { display: flex; justify-content: center; align-items: center; padding-top: 6px; }

/* ---------- Console Shell (Surfaces B & C) ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side {
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: var(--bg);
}
.side .brand { padding: 4px 8px; }
.org {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--card);
}
.org b { display: block; font-weight: 500; line-height: 1.3; }
.org span { color: var(--sub); font-size: 12.5px; display: block; margin-top: 2px; }
.org-switch {
  width: 100%;
  font-weight: 500;
  font-size: 13.5px;
  padding: 7px 28px 7px 10px;
  border-radius: 8px;
  background-color: var(--bg);
}
.org-switch + span { margin-top: 6px; }
.viewas-bar {
  margin-bottom: 16px;
}
.nav { display: grid; gap: 2px; }
.nav button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--ink2);
  text-align: left;
  width: 100%;
  font-weight: 500;
  font-size: 13.5px;
}
.nav button:hover { background: var(--raise); color: var(--ink); }
.nav button.on { background: var(--inv); color: var(--inv-ink); }
.nav button.on .badge { background: transparent; color: inherit; border: 1px solid currentColor; }
.side-foot {
  margin-top: auto;
  color: var(--sub);
  font-size: 12px;
  padding: 12px 8px 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
}
.side-foot .email-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { padding: 22px clamp(18px, 3vw, 38px) 64px; min-width: 0; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  min-height: 44px;
}
.top h1 { font-size: 25px; font-weight: 500; letter-spacing: -0.025em; }
.top .crumb { color: var(--sub); font-size: 12.5px; margin-bottom: 3px; display: flex; align-items: center; gap: 6px; }
.top .crumb button { color: var(--sub); text-decoration: underline; text-underline-offset: 2px; }
.top .crumb button:hover { color: var(--ink); }
.top .tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.view > .grid, .view > .card, .view > section, .view > .banner { margin-top: 18px; }

/* Split View & Inspector */
.split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.checkrow {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 12px 14px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  background: var(--card);
}
.checkrow.on { border-color: var(--stroke); }
.checkrow input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--inv); flex: none; cursor: pointer; }

.list { list-style: none; }
.list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line2);
  align-items: center;
}
.list li:first-child { border-top: 0; }
.list .t { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .m { color: var(--sub); font-size: 12.5px; }
.list .act { grid-row: span 2; }

.feed { list-style: none; display: grid; gap: 12px; }
.feed li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; font-size: 13px; }
.feed .g { margin-top: 4px; }
.feed .m { color: var(--sub); font-size: 12px; margin-top: 2px; }

.url-box {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 8px 8px 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--bg);
}
.url-box span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-box.dead { border-style: dashed; color: var(--sub); }

/* 30-day SVG activity chart */
.svg-chart { width: 100%; margin-top: 12px; }
.svg-chart svg { width: 100%; height: 120px; display: block; }
.chart-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--sub); margin-top: 6px; font-variant-numeric: tabular-nums; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--sub); text-transform: none; letter-spacing: 0; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-swatch { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.chart-swatch.invite { background: var(--ink); }
.chart-swatch.bulk { background: var(--sub); }

/* Console Overview visualizations (90-day progress chart + dot-matrix world coverage map) */
.viz { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
.viz-chart { position: relative; height: 250px; margin-top: 10px; }
.viz-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.viz-chart .vgrid line { stroke: var(--line2); }
.viz-chart .ax { fill: var(--sub); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-chart .dbar { fill: var(--sub); fill-opacity: 0.24; }
.viz-chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-chart .ln.up { stroke: var(--ink); }
.viz-chart .ln.live { stroke: var(--moon); }
.viz-chart .endlbl { font-size: 12px; fill: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.viz-chart .xh { stroke: var(--line); stroke-width: 1; opacity: 0; }
.viz-chart .hp { opacity: 0; stroke: var(--card); stroke-width: 2; }
.viz-chart .hu { fill: var(--ink); }
.viz-chart .hl { fill: var(--moon); }
.viz-chart.hover .xh, .viz-chart.hover .hp { opacity: 1; }
.ctip, .maptip {
  position: absolute;
  pointer-events: none;
  background: var(--inv);
  color: var(--inv-ink);
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 4;
  box-shadow: var(--shadow);
}
.ctip { top: 0; padding: 7px 10px; line-height: 1.5; transform: translate(-50%, -100%); font-variant-numeric: tabular-nums; }
.ctip.below { transform: translate(-50%, 0); }
.viz-chart.hover .ctip { opacity: 1; }
.ctip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.ctip .sw.up { background: var(--inv-ink); }
.ctip .sw.live { background: var(--moon); }
.ctip .sw.bar { border-radius: 2px; background: var(--inv-sub); }
.ctip .tip-sub, .maptip .tip-sub { color: var(--inv-sub); }

.map-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.map-bar .chips { gap: 5px; }
.map-bar .chip { padding: 3px 10px; font-size: 11.5px; }
.map-meta { font-size: 11.5px; color: var(--sub); font-variant-numeric: tabular-nums; white-space: nowrap; }
.viz-map { position: relative; margin-top: 8px; height: 250px; }
.viz-map canvas { display: block; width: 100%; height: 100%; }
.maptip { padding: 6px 10px; line-height: 1.45; transform: translate(-50%, calc(-100% - 10px)); }
.maptip.below { transform: translate(-50%, 12px); }
.maptip .mono { font-size: 11.5px; }
.maplegend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink2);
  font-size: 12px;
  font-weight: 400;
}
.maplegend > span { display: inline-flex; align-items: center; }
.maplegend b { font-weight: 500; font-variant-numeric: tabular-nums; margin-left: 4px; }
.mk { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; flex: none; }
.mk.live { background: var(--moon); box-shadow: 0 0 0 1px var(--live-ring) inset; }
.mk.rev { background: var(--ink); }
.mk.pend { background: var(--sub); opacity: 0.65; }
.mk.bar { border-radius: 2px; background: var(--sub); opacity: 0.45; }

.impact { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.impact .card { padding: 14px 16px; }
.impact .t-num { font-size: 26px; }

.metaline { display: flex; gap: 10px 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--sub); align-items: center; }

/* ---------- Surface D · Developer Console & Sign-In Surface Switch ---------- */
.signin-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  margin-top: 14px;
}
.signin-seg button {
  width: 100%;
  justify-content: center;
  text-align: center;
}
.dev-meter {
  height: 7px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin-top: 10px;
}
.dev-meter > span {
  display: block;
  height: 100%;
  background: var(--ink);
  border-radius: 999px;
  transition: width 0.2s ease;
}
.dev-conn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
}
.dev-conn-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  background: var(--sub);
}
.dev-conn-dot.live {
  background: var(--moon);
  box-shadow: 0 0 0 0 rgba(0, 255, 186, 0.55);
  animation: dev-pulse 2.2s infinite;
}
@keyframes dev-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 255, 186, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(0, 255, 186, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 255, 186, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .dev-conn-dot.live { animation: none; }
}
.dev-prompts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.dev-prompt-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 16px;
  background: var(--card);
}
.dev-prompt-card h3 {
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.dev-prompt-card .dev-code {
  flex: 1;
  max-height: 168px;
}
.dev-code {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 12px 14px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink2);
}
.dev-secret {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-m);
  padding: 10px 12px;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 12.5px;
}
.dev-secret code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  font-family: inherit;
}
.dev-activate {
  max-width: 520px;
}
.dev-doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* ---------- Ops Overview · Coverage by layer & Outside use (c-overview.png) ---------- */
.layer-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.layer-row {
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 13px 15px;
  background: var(--bg);
}
.layer-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
}
.layer-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin: 10px 0 9px;
}
.layer-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--ink);
  transition: width 0.25s ease;
}
.layer-bar.live > span {
  background: var(--moon);
}
.layer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
}
.layer-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.layer-meta b {
  color: var(--ink);
  font-weight: 500;
}
.layer-sw {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: none;
}
.layer-sw.on { background: var(--ink); }
.layer-sw.live { background: var(--moon); }
.layer-sw.off { border: 1px dashed var(--sub); background: transparent; }

.outside-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.outside-cell .t-num {
  font-size: 28px;
  margin-top: 6px;
}

/* ---------- Gift Codes Distribution Console (c-gift.png & Surface B) ---------- */
.gift-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.55fr);
  gap: 16px;
  align-items: start;
}
.gift-plan-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.gift-plan-pills .chip {
  padding: 5px 11px;
  font-size: 12px;
}
.gift-code-cell {
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}
.gift-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
  .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g5 > .kpi.inv { grid-column: span 2; }
  .g-12, .g-21, .g3, .split, .viz, .dev-prompts, .dev-doc-grid, .gift-layout { grid-template-columns: 1fr; }
  .hide-md { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
  }
  .nav { grid-auto-flow: column; overflow-x: auto; max-width: 100%; }
  .org:not(.has-switcher), .side-foot { display: none; }
  .org.has-switcher { padding: 4px 6px; border: 0; background: transparent; min-width: 180px; }
  .org.has-switcher span { display: none; }
  .g4, .g2, .impact, .outside-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .dates { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px minmax(0, 1fr); }
}
