/* YCE Recon UI — uses tokens.css only. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs-base); line-height: 1.5; color: var(--text);
  background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
a { color: inherit; text-decoration: none; }
a.link, .prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.015em; line-height: 1.2; }
h1 { font-size: var(--fs-2xl); letter-spacing: -0.025em; }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-base); }
p { margin: 0; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.nowrap { white-space: nowrap; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* ---------------- shell: team (dark rail) ---------------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; background: linear-gradient(90deg, var(--rail-bg) 232px, transparent 232px); }
.rail {
  position: sticky; top: 0; height: 100vh; background: var(--rail-bg); color: var(--rail-text);
  display: flex; flex-direction: column; padding: var(--s-4) var(--s-3); gap: var(--s-1);
}
.brand { display: flex; align-items: center; gap: 10px; padding: var(--s-2) var(--s-2) var(--s-5); color: #fff; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--gray-900);
  background: linear-gradient(135deg, var(--gold-300), var(--gold-400) 55%, var(--gold-600));
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 6px 18px -6px rgba(240,180,41,0.55); font-weight: 800; font-size: 13px; letter-spacing: -0.02em;
}
.brand-name { font-weight: 700; letter-spacing: -0.01em; font-size: var(--fs-md); }
.brand-sub { font-size: 11px; color: #8E8E93; letter-spacing: 0.04em; text-transform: uppercase; }
.rail-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #6E6E73; padding: var(--s-4) var(--s-3) var(--s-1); }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-md); font-size: var(--fs-md);
  font-weight: 500; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); position: relative; min-height: 38px;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-item.active { background: var(--rail-active); color: #fff; }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.nav-item.active .icon { color: var(--accent); }
.nav-count { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: var(--r-pill); background: rgba(240,180,41,0.16); color: var(--gold-300); }
.rail-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,0.06); padding-top: var(--s-3); display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 12px; flex: none; }
.rail-foot .who { min-width: 0; flex: 1; }
.rail-foot .who b { display: block; color: #fff; font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-foot .who span { font-size: 11px; color: #8E8E93; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-md); border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: rgba(127,127,127,0.14); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s-4);
  padding: 14px var(--s-8); background: var(--glass); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent; transition: border-color var(--t-med);
}
.topbar.scrolled { border-bottom-color: var(--border); }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-2); min-width: 0; }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--text-3); }
.topbar .spacer { flex: 1; }
.content { padding: var(--s-6) var(--s-8) var(--s-10); max-width: 1480px; width: 100%; }

/* ---------------- shell: seller (top nav) ---------------- */
.s-header {
  position: sticky; top: 0; z-index: 20; background: var(--glass); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.s-header-in { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: var(--s-6); padding: 12px var(--s-6); }
.s-header .brand { padding: 0; color: var(--text); }
.s-header .brand-sub { color: var(--text-3); }
.s-nav { display: flex; gap: 2px; }
.s-nav a { padding: 7px 12px; border-radius: var(--r-pill); font-size: var(--fs-md); font-weight: 500; color: var(--text-2); transition: background var(--t-fast), color var(--t-fast); }
.s-nav a:hover { color: var(--text); background: var(--surface-sunken); }
.s-nav a.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--border); }
.s-content { max-width: 1200px; margin: 0 auto; padding: var(--s-8) var(--s-6) 64px; }

/* ---------------- page header ---------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-6); flex-wrap: wrap; }
.page-head .eyebrow { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.page-head p { color: var(--text-2); margin-top: 6px; max-width: 70ch; }
.actions { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--btn-h); padding: 0 14px;
  border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: 550 var(--fs-md)/1 var(--font); cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-1);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast), transform var(--t-fast) var(--ease), box-shadow var(--t-fast);
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--btn-primary-bg); border-color: transparent; color: var(--btn-primary-text); box-shadow: 0 1px 0 rgba(255,255,255,0.35) inset, 0 6px 16px -8px rgba(240,180,41,0.8); }
.btn-primary:hover { background: var(--btn-primary-bg-hover); border-color: transparent; }
.btn-dark { background: var(--text); color: var(--surface); border-color: transparent; }
.btn-dark:hover { background: var(--gray-700); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-sunken); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn-lg { height: 46px; padding: 0 20px; font-size: var(--fs-base); border-radius: var(--r-lg); }
.btn[disabled], .btn.disabled { opacity: 0.45; pointer-events: none; }
.btn-danger { color: var(--bad); }

/* ---------------- cards & grid ---------------- */
.card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card-pad { padding: var(--s-5); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: var(--fs-base); }
.card-head .sub { font-size: var(--fs-sm); color: var(--text-2); }
.card-body { padding: var(--s-4) var(--s-5); }
.grid { display: grid; gap: var(--s-4); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.row { display: flex; align-items: center; gap: var(--s-3); }
.between { justify-content: space-between; }
.mt-2 { margin-top: var(--s-2); } .mt-4 { margin-top: var(--s-4); } .mt-6 { margin-top: var(--s-6); } .mb-4 { margin-bottom: var(--s-4); }

/* ---------------- KPI tiles ---------------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s-3); margin-bottom: var(--s-4); }
.kpi { padding: var(--s-4) var(--s-5); position: relative; overflow: hidden; }
.kpi .label { font-size: var(--fs-sm); color: var(--text-2); display: flex; align-items: center; gap: 6px; font-weight: 500; }
.kpi .value { font-size: var(--fs-2xl); font-weight: 680; letter-spacing: -0.03em; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .foot { margin-top: 6px; font-size: var(--fs-sm); color: var(--text-2); }
.kpi.hero { background: var(--kpi-hero-bg); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.kpi.hero .value { font-size: var(--fs-3xl); }
.kpi .meter { height: 4px; border-radius: 4px; background: var(--chart-track); margin-top: 10px; overflow: hidden; }
.kpi .meter i { display: block; height: 100%; background: var(--chart-bar); border-radius: 4px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: var(--fs-xs); padding: 1px 6px; border-radius: var(--r-pill); }
.delta.up { color: var(--good); background: var(--good-bg); } .delta.down { color: var(--bad); background: var(--bad-bg); }

/* ---------------- chips / badges ---------------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; background: var(--chip-bg); color: var(--text-2); white-space: nowrap; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-good { background: var(--good-bg); color: var(--good); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-bad { background: var(--bad-bg); color: var(--bad); }
.chip-info { background: var(--info-bg); color: var(--info); }
.chip-gold { background: var(--accent-soft); color: var(--accent-text); }
.chip-info .dot.pulse, .pulse { animation: pulse 1.4s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.mp { display: inline-flex; align-items: center; gap: 7px; font-weight: 550; white-space: nowrap; }
.mp i { width: 8px; height: 8px; border-radius: 3px; flex: none; }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-md); }
.t th { position: sticky; top: 0; background: var(--table-head); text-align: left; font-weight: 600; font-size: var(--fs-xs); color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tbody tr { transition: background var(--t-fast); }
.t tbody tr:hover { background: var(--table-row-hover); }
.t tbody tr:last-child td { border-bottom: 0; }
.t tr.total td { font-weight: 650; background: var(--surface-2); }
.t .rowlink { font-weight: 550; }
.t .rowlink:hover { color: var(--accent-text); }
.t td.reason { color: var(--text-2); font-size: var(--fs-sm); max-width: 520px; }
.t-compact td { padding: 7px 12px; }

/* ---------------- forms ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label-text { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.field .help { font-size: var(--fs-xs); color: var(--text-2); }
.field .err { font-size: var(--fs-xs); color: var(--bad); font-weight: 500; }
.input, select.input, textarea.input {
  height: 40px; padding: 0 12px; border-radius: var(--r-md); border: 1px solid var(--input-border); background: var(--input-bg);
  color: var(--text); font: 400 var(--fs-base) var(--font); width: 100%; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
textarea.input { height: auto; padding: 10px 12px; min-height: 88px; resize: vertical; }
.input:focus { outline: none; border-color: var(--gold-600); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }
.input.invalid { border-color: var(--bad); }
.input-sm { height: 32px; font-size: var(--fs-sm); padding: 0 8px; border-radius: var(--r-sm); }
.filters { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; margin-bottom: var(--s-4); }
.filters .input { width: auto; min-width: 150px; height: 34px; font-size: var(--fs-sm); }
.seg { display: inline-flex; padding: 3px; border-radius: var(--r-md); background: var(--surface-sunken); gap: 2px; }
.seg a { padding: 5px 12px; border-radius: 8px; font-size: var(--fs-sm); font-weight: 550; color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; }
.seg a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.seg a .n { font-size: 11px; color: var(--text-3); }

/* mp picker (radio cards) */
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-2); }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick label { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-md); cursor: pointer; background: var(--surface); font-weight: 550; transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast); min-height: 48px; }
.pick label:hover { border-color: var(--text-3); }
.pick input:checked + label { border-color: var(--gold-600); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); background: var(--accent-soft); }
.pick input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }
.pick .swatch { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; }

/* ---------------- dropzone ---------------- */
.drop {
  position: relative; border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); padding: var(--s-8) var(--s-6);
  text-align: center; background: var(--surface-2); transition: border-color var(--t-med) var(--ease), background var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.drop.over { border-color: var(--gold-600); background: var(--accent-soft); transform: scale(1.005); }
.drop .drop-icon { width: 48px; height: 48px; margin: 0 auto var(--s-3); border-radius: 14px; display: grid; place-items: center; background: var(--surface); color: var(--accent-text); box-shadow: var(--shadow-2); }
.drop h3 { font-size: var(--fs-lg); }
.drop p { color: var(--text-2); font-size: var(--fs-sm); margin-top: 4px; }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .btn { position: relative; z-index: 1; pointer-events: none; margin-top: var(--s-3); }
.uploading { display: none; margin-top: var(--s-3); }
.htmx-request .uploading, .uploading.htmx-request { display: block; }
.bar-indet { height: 4px; border-radius: 4px; background: var(--chart-track); overflow: hidden; position: relative; }
.bar-indet::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--accent); border-radius: 4px; animation: indet 1.1s var(--ease) infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

.file-list { display: flex; flex-direction: column; }
.file { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.file:last-child { border-bottom: 0; }
.file .ficon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--good-bg); color: var(--good); }
.file .ficon.unk { background: var(--warn-bg); color: var(--warn); }
.file .fname { font-weight: 550; font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .fmeta { font-size: var(--fs-xs); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* checklist of required reports */
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); }
.checklist .tick { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-sunken); color: var(--text-3); }
.checklist .tick.on { background: var(--good-bg); color: var(--good); }

/* ---------------- stepper ---------------- */
.steps { list-style: none; padding: 0; margin-top: 0; display: flex; gap: var(--s-2); margin-bottom: var(--s-6); counter-reset: st; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); font-weight: 550; color: var(--text-3); }
.step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--border-strong); font-size: 12px; font-weight: 700; }
.step.on { color: var(--text); } .step.on .n { border-color: var(--gold-600); background: var(--accent); color: var(--on-accent); }
.step.done { color: var(--text-2); } .step.done .n { border-color: var(--good); background: var(--good); color: #fff; }
.step-line { flex: 0 0 36px; height: 1.5px; background: var(--border-strong); align-self: center; }

/* ---------------- progress ---------------- */
.progress-card { padding: var(--s-8); text-align: center; }
.ring { width: 88px; height: 88px; margin: 0 auto var(--s-4); }
.ring circle { fill: none; stroke-width: 7; }
.ring .track { stroke: var(--chart-track); }
.ring .val { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 600ms var(--ease); transform: rotate(-90deg); transform-origin: 50% 50%; }
.ring text { font: 700 18px var(--font); fill: var(--text); font-variant-numeric: tabular-nums; }

/* ---------------- alerts ---------------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); font-size: var(--fs-md); border: 1px solid transparent; }
.alert-warn { background: var(--warn-bg); color: var(--text); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert-warn .icon { color: var(--warn); }
.alert-bad { background: var(--bad-bg); color: var(--text); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.alert-bad .icon { color: var(--bad); }
.alert-good { background: var(--good-bg); color: var(--text); }
.alert-good .icon { color: var(--good); }
.alert-info { background: var(--info-bg); color: var(--text); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------------- charts ---------------- */
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 34%) 1fr auto; gap: 12px; align-items: center; font-size: var(--fs-sm); position: relative; }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.hbar .track { height: 10px; background: var(--chart-track); border-radius: 4px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--chart-bar); transform-origin: left; animation: grow 700ms var(--ease) both; }
.hbar .fill.neg { background: var(--chart-neg); }
.hbar .fill.credit { background: var(--chart-bar-2); }
.hbar .val { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 84px; text-align: right; }
.hbar .val small { font-weight: 500; color: var(--text-2); margin-left: 6px; }
@keyframes grow { from { transform: scaleX(0); } }

.wf { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 10px; align-items: end; height: 220px; padding-top: 22px; position: relative; }
.wf .col { position: relative; height: 100%; }
.wf .seg { position: absolute; left: 10%; right: 10%; border-radius: 4px; background: var(--chart-neg); transition: filter var(--t-fast); animation: rise 700ms var(--ease) both; transform-origin: bottom; }
.wf .seg.total { background: var(--chart-bar); }
.wf .seg.pos { background: var(--good); }
.wf .col:hover .seg { filter: brightness(1.08); }
.wf .amt { position: absolute; left: 0; right: 0; font-size: var(--fs-xs); font-weight: 650; text-align: center; font-variant-numeric: tabular-nums; }
.wf-labels { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 10px; margin-top: 8px; border-top: 1px solid var(--border); padding-top: 8px; }
.wf-labels span { font-size: var(--fs-xs); color: var(--text-2); text-align: center; line-height: 1.3; }
@keyframes rise { from { transform: scaleY(0); } }

/* tooltip */
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 30;
  background: var(--gray-900); color: #fff; font-size: var(--fs-xs); font-weight: 500; padding: 6px 9px; border-radius: 8px; white-space: nowrap;
  box-shadow: var(--shadow-2); pointer-events: none;
}

/* client × month matrix */
.matrix td.cell { text-align: center; padding: 6px; }
.cell-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; height: 30px; padding: 0 9px; border-radius: var(--r-sm); font-size: var(--fs-xs); font-weight: 600; border: 1px solid var(--border); background: var(--surface); }
.cell-link:hover { border-color: var(--text-3); }
.cell-empty { color: var(--text-3); font-size: var(--fs-xs); }

/* ---------------- lists ---------------- */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px var(--s-5); border-bottom: 1px solid var(--border); transition: background var(--t-fast); }
.li:last-child { border-bottom: 0; }
a.li:hover { background: var(--table-row-hover); }
.li .grow { flex: 1; min-width: 0; }
.li .title { font-weight: 550; font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .meta { font-size: var(--fs-xs); color: var(--text-2); }

.empty { text-align: center; padding: var(--s-10) var(--s-6); }
.empty .e-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto var(--s-3); background: var(--accent-soft); color: var(--accent-text); }
.empty h3 { font-size: var(--fs-lg); }
.empty p { color: var(--text-2); margin: 6px auto var(--s-4); max-width: 46ch; font-size: var(--fs-md); }

details.disclose { border-top: 1px solid var(--border); }
details.disclose summary { cursor: pointer; padding: 12px var(--s-5); font-weight: 600; font-size: var(--fs-md); list-style: none; display: flex; align-items: center; gap: 8px; }
details.disclose summary::-webkit-details-marker { display: none; }
details.disclose summary .chev { transition: transform var(--t-med) var(--ease); margin-left: auto; color: var(--text-3); }
details.disclose[open] summary .chev { transform: rotate(90deg); }
details.disclose .inner { padding: 0 var(--s-5) var(--s-4); }

/* gate (download behind a tick) */
.gate { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); font-size: var(--fs-sm); cursor: pointer; }
.gate input { width: 18px; height: 18px; accent-color: var(--gold-600); margin-top: 1px; }

/* ---------------- auth ---------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art {
  background: radial-gradient(90% 70% at 20% 10%, rgba(240,180,41,0.30), transparent 60%), radial-gradient(70% 60% at 90% 90%, rgba(240,180,41,0.14), transparent 60%), var(--gray-950);
  color: #EDEDF0; padding: 48px 56px; display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.auth-art::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(80% 70% at 30% 30%, #000 30%, transparent 80%); pointer-events: none; }
.auth-art .brand { color: #fff; padding: 0; position: relative; z-index: 1; }
.auth-art h1 { font-size: 2.6rem; line-height: 1.08; letter-spacing: -0.035em; margin-top: auto; max-width: 15ch; position: relative; z-index: 1; color: #fff; }
.auth-art h1 em { font-style: normal; color: var(--gold-300); }
.auth-art p { color: #A1A1A6; margin-top: 14px; max-width: 46ch; position: relative; z-index: 1; }
.auth-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 36px; position: relative; z-index: 1; }
.auth-points div { border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.03); border-radius: var(--r-md); padding: 12px; font-size: var(--fs-sm); color: #C7C7CC; backdrop-filter: blur(6px); }
.auth-points b { display: block; color: #fff; font-size: var(--fs-lg); letter-spacing: -0.02em; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: var(--fs-2xl); letter-spacing: -0.025em; }
.auth-card form { display: flex; flex-direction: column; gap: var(--s-4); margin-top: var(--s-6); }

/* ---------------- responsive ---------------- */
@media (max-width: 1100px) { .g-main, .g-3 { grid-template-columns: 1fr; } .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: var(--s-2); }
  .rail .rail-label, .rail-foot .who { display: none; }
  .brand { padding: var(--s-2); }
  .content, .topbar { padding-left: var(--s-4); padding-right: var(--s-4); }
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
  .g-2 { grid-template-columns: 1fr; }
  .s-header-in { flex-wrap: wrap; gap: var(--s-2); }
}
@media (max-width: 560px) { .g-4 { grid-template-columns: 1fr; } .kpi .value, .kpi.hero .value { font-size: var(--fs-xl); } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
@media (prefers-reduced-transparency: reduce) { .topbar, .s-header { background: var(--bg); backdrop-filter: none; } }

/* ---------------- rate cards ---------------- */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--accent); color: #1D1D1F; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
a.alert-link { text-decoration: none; align-items: center; transition: border-color var(--t-fast), transform var(--t-fast); }
a.alert-link > div { flex: 1; }
a.alert-link:hover { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.li-on { background: var(--accent-soft); }
.t.rules td { padding: 5px 6px; }
.t.rules .input-sm { height: 30px; }
.t.rules select.input-sm { padding-right: 22px; }
.input.num { text-align: right; }
.pick label { flex-wrap: wrap; }
.pick .soon { flex-basis: 100%; padding-left: 38px; margin-top: -6px; font-size: 11px; font-weight: 500; color: var(--text-3); }

/* ---------------- trends, returns ---------------- */
.delta { font-weight: 650; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.delta.good { color: var(--good); } .delta.bad { color: var(--bad); }
.kpi-spark { position: absolute; right: var(--s-4); top: var(--s-4); }
.spark polyline { stroke: var(--chart-bar); } .spark circle { fill: var(--chart-bar); }
.kpi.hero .spark polyline { stroke: var(--accent-text); } .kpi.hero .spark circle { fill: var(--accent-text); }
.card-link { display: block; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.card-link:hover { border-color: var(--text-3); box-shadow: var(--shadow-2); }
.e-icon-sm { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.rt-form .input-sm { height: 30px; }
.alert-dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.alert-dot.bad { background: var(--bad-bg); color: var(--bad); }
.alert-dot.warn { background: var(--warn-bg); color: var(--warn); }
.alert-dot.info { background: var(--info-bg); color: var(--info); }
.sku-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.sku-col { padding: var(--s-4) var(--s-5); border-right: 1px solid var(--border); min-width: 0; }
.sku-col:last-child { border-right: 0; }
.sku-col h3 { font-size: var(--fs-md); }
.mb-2 { margin-bottom: var(--s-2); }
.sku-list { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.sku-list li { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); counter-increment: s; }
.sku-list li:last-child { border-bottom: 0; }
.sku-list li::before { content: counter(s); color: var(--text-3); font-size: 11px; width: 14px; font-variant-numeric: tabular-nums; }
.sku-list .sku { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
@media (max-width: 760px) { .sku-cols { grid-template-columns: 1fr; } .sku-col { border-right: 0; border-bottom: 1px solid var(--border); } }
.col-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px 12px; }
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] .chev { transform: rotate(90deg); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 300px; padding: 6px; display: flex; flex-direction: column; box-shadow: var(--shadow-3, 0 12px 32px rgba(0,0,0,.18)); }
.menu-pop a { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 550; }
.menu-pop a:hover { background: var(--surface-sunken); }
.thumb { flex: none; border-radius: 7px; object-fit: cover; background: var(--surface-sunken); border: 1px solid var(--border); }
.thumb-ph { display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; letter-spacing: .02em; color: var(--text-3);
  background: repeating-linear-gradient(135deg, var(--surface-sunken) 0 6px, var(--surface-2) 6px 12px); }
.sku-list li .thumb { align-self: center; }
.cost-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.input-pre { position: relative; }
.input-pre > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: var(--fs-sm); }
.input-pre > .input { padding-left: 26px; text-align: right; font-variant-numeric: tabular-nums; }
.t.pl td { padding: 8px 4px; }
.t.pl tr.total td { background: transparent; border-top: 1px solid var(--border-strong); }
.temp-pw { display: inline-block; margin: 4px 0; padding: 4px 10px; border-radius: 8px; background: var(--surface); border: 1px dashed var(--border-strong); font-size: var(--fs-md); font-weight: 650; letter-spacing: .02em; }
.s-nav { overflow-x: auto; scrollbar-width: none; }
.s-nav a { white-space: nowrap; }
.preview-bar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 10px; justify-content: center; flex-wrap: wrap;
  padding: 8px 16px; background: #1D1D1F; color: #fff; font-size: var(--fs-sm); }
.preview-bar b { color: var(--gold-400, #F0B429); }
.preview-bar .btn { height: 28px; }

/* ---------------- phone layout (from the 21-Nov audit) ---------------- */
.grid > * { min-width: 0; }
.card-head { flex-wrap: wrap; }
.card-head .row, .page-head .row { flex-wrap: wrap; }
.cost-grid { grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a { white-space: nowrap; flex: none; }
@media (max-width: 860px) {
  /* team menu: one scrolling row instead of four wrapped rows */
  .rail { flex-wrap: nowrap; align-items: center; overflow-x: auto; gap: 2px; scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
  .rail .brand { padding: 4px 6px 4px 2px; flex: none; }
  .rail .brand > span:last-child { display: none; }
  .rail .nav-item { flex: none; padding: 8px 10px; }
  .rail .nav-item.active::before { display: none; }
  .rail .rail-label, .rail .rail-label + .nav-item { display: none; }
  .rail-foot { margin: 0 0 0 auto; border: 0; padding: 0 0 0 6px; flex: none; }
  .li { flex-wrap: wrap; }
  .li .grow { flex-basis: 60%; }
  .filters { flex-wrap: wrap; }
  .filters .input { min-width: 0; flex: 1 1 140px; }
}
.shell > .main, .s-content, .content { min-width: 0; }   /* let wide tables scroll inside their box, not the page */
.table-wrap { position: relative; }        /* keep visually-hidden labels inside the scroll box (they widened the page) */
details.disclose .disclose-body, details.disclose > div { overflow-x: auto; }

/* ---------------- design pass (21-Nov, frontend-design review) ----------------
   Sentence case instead of tracked ALL CAPS labels; one bold element per page (the headline tile);
   flatter secondary cards so hierarchy comes from content, not identical shadows; money set so the digits lead. */
.page-head .eyebrow { text-transform: none; letter-spacing: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.t th { text-transform: none; letter-spacing: 0; font-size: var(--fs-sm); }
.rail-label, .brand-sub { text-transform: none; letter-spacing: 0; }
.card { box-shadow: none; }
.kpi.hero { box-shadow: 0 10px 28px -14px color-mix(in srgb, var(--accent) 55%, transparent), 0 1px 2px rgba(17, 17, 19, 0.05); }
dialog.card, .menu-pop { box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.08); }
.kpi .value .cur { font-weight: 500; color: var(--text-2); margin-right: 1px; }
.kpi .value .unit { font-weight: 500; color: var(--text-2); font-size: 0.62em; letter-spacing: 0; }
.kpi .value.bad .cur, .kpi .value.bad .unit, .kpi .value.warn .cur, .kpi .value.warn .unit { color: inherit; opacity: 0.75; }
.kpi.hero .value { letter-spacing: -0.035em; }
.t th.chk, .t td.chk { width: 36px; padding-right: 0; }
.chk input { width: 16px; height: 16px; accent-color: var(--gold-600); cursor: pointer; }
.bulkbar { position: sticky; top: 64px; z-index: 20; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: var(--s-3);
  padding: 10px 14px; border-radius: var(--r-md); background: var(--rail-bg); color: #fff; box-shadow: 0 12px 30px -12px rgba(0,0,0,.45); }
.bulkbar[hidden] { display: none; }
.bulkbar .btn-ghost { color: #fff; }
