/* TapShop — Component library
 * Buttons, inputs, cards, chips, lists, nav, overlays, frames. */

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-2);
  height: 44px; padding: 0 18px;
  border-radius: var(--r-md);
  font-size: var(--fs-body); font-weight: var(--fw-medium);
  line-height: 1;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  white-space: nowrap;
  user-select: none;
}
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn svg { width: 18px; height: 18px; }

.btn-primary { background: var(--brand-primary); color: var(--text-on-brand); }
.btn-primary:hover { background: var(--brand-primary-hover); }
.btn-primary:active { background: var(--brand-primary-press); }
.btn-primary[disabled] { background: var(--border-strong); color: #fff; cursor: not-allowed; }

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.btn-secondary:hover { background: var(--brand-tint); }
.btn-secondary:active { background: var(--brand-tint-strong); }

.btn-ghost  { background: transparent; color: var(--text-primary); }
.btn-ghost:hover { background: var(--brand-tint); }

.btn-warm {
  background: var(--accent-warm); color: #2A1604;
}
.btn-warm:hover { background: #EF9943; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #C03A3A; }

.btn-lg { height: 52px; padding: 0 22px; font-size: 16px; border-radius: var(--r-md); }
.btn-sm { height: 32px; padding: 0 12px; font-size: var(--fs-small); border-radius: 8px; }
.btn-xs { height: 26px; padding: 0 10px; font-size: var(--fs-micro); border-radius: 6px; }
.btn-icon { width: 40px; padding: 0; }
.btn-block { width: 100%; }

.btn-loading { position: relative; color: transparent !important; }
.btn-loading::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Inputs ──────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: var(--fs-small); color: var(--text-secondary); font-weight: var(--fw-medium);
}
.field-hint {
  font-size: var(--fs-micro); color: var(--text-tertiary);
}
.field-error {
  font-size: var(--fs-micro); color: var(--danger); display: inline-flex; align-items: center; gap: 4px;
}

.input, .textarea, .select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-size: var(--fs-body);
  color: var(--text-primary);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--text-placeholder); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--brand-primary); box-shadow: var(--shadow-focus); }
.input[data-error="true"], .textarea[data-error="true"] { border-color: var(--danger); }
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: var(--lh-snug); }
.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A6280' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.input-affix {
  display: flex; align-items: center; gap: 0;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  height: 44px; padding: 0 14px;
}
.input-affix:focus-within { border-color: var(--brand-primary); box-shadow: var(--shadow-focus); }
.input-affix > input { border: 0; outline: 0; background: transparent; flex: 1; height: 100%; min-width: 0; padding: 0; }
.input-affix .affix { color: var(--text-tertiary); font-size: var(--fs-body); }

/* Photo upload */
.upload {
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px;
  border-radius: var(--r-lg);
  border: 1.5px dashed var(--border-strong);
  background: var(--surface-sunken);
  color: var(--text-secondary);
  padding: 24px;
  cursor: pointer;
}
.upload:hover { border-color: var(--brand-primary); color: var(--brand-primary); background: var(--brand-tint); }

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.card-flush { padding: 0; overflow: hidden; }
.card-section { padding: var(--s-5); }
.card-section + .card-section { border-top: 1px solid var(--divider); }
.card-tint { background: var(--brand-tint); border-color: transparent; }
.card-warm { background: var(--accent-warm-bg); border-color: var(--accent-warm-border); }
.card-success { background: var(--success-bg); border-color: var(--success-border); }
.card-warning { background: var(--warning-bg); border-color: var(--warning-border); }
.card-danger { background: var(--danger-bg); border-color: var(--danger-border); }

.card-title { font-size: var(--fs-h3); font-weight: var(--fw-semibold); margin: 0; }

/* ── Chips / badges ──────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-micro); font-weight: var(--fw-medium);
  background: var(--brand-tint);
  color: var(--text-primary);
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1;
}
.chip-dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8;
}
.chip-success { background: var(--success-bg); color: var(--success-ink); }
.chip-warning { background: var(--warning-bg); color: var(--warning-ink); }
.chip-danger  { background: var(--danger-bg);  color: var(--danger-ink); }
.chip-info    { background: var(--info-bg);    color: var(--info-ink); }
.chip-warm    { background: var(--accent-warm-bg); color: var(--accent-warm-ink); }
.chip-neutral { background: var(--surface-sunken); color: var(--text-secondary); border-color: var(--border); }
.chip-solid-navy { background: var(--brand-primary); color: #fff; }
.chip-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-secondary); }
.chip-lg { height: 30px; padding: 0 12px; font-size: var(--fs-small); }

/* ── Avatar ──────────────────────────────────────────── */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-tint-strong); color: var(--brand-primary);
  font-weight: var(--fw-semibold); font-size: var(--fs-small);
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar-sm { width: 28px; height: 28px; font-size: var(--fs-micro); }
.avatar-lg { width: 48px; height: 48px; font-size: var(--fs-h3); }
.avatar-xl { width: 64px; height: 64px; font-size: var(--fs-h2); }
.avatar-warm  { background: var(--accent-warm-bg); color: var(--accent-warm-ink); }
.avatar-success { background: var(--success-bg); color: var(--success-ink); }

/* repeat indicator dot (loyalty) */
.dot-repeat {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-warm); display: inline-block;
  box-shadow: 0 0 0 2px var(--accent-warm-bg);
}

/* ── List rows ───────────────────────────────────────── */
.list { display: flex; flex-direction: column; }
.list .row-item {
  display: flex; align-items: center; gap: var(--s-4);
  padding: 14px var(--s-5);
  border-bottom: 1px solid var(--divider);
  transition: background var(--t-fast);
  cursor: pointer;
}
.list .row-item:last-child { border-bottom: 0; }
.list .row-item:hover { background: var(--surface-sunken); }
.list .row-item.active { background: var(--brand-tint); }

/* ── Money / metric blocks ───────────────────────────── */
.metric { display: flex; flex-direction: column; gap: 4px; }
.metric-label { font-size: var(--fs-small); color: var(--text-secondary); }
.metric-value { font-family: var(--font-num); font-size: 24px; font-weight: 500; letter-spacing: -0.01em; }
.metric-delta { font-size: var(--fs-micro); color: var(--success-ink); }
.metric-delta.negative { color: var(--danger-ink); }

.amount {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
}
.amount-xl { font-size: 36px; font-weight: 500; }
.amount-lg { font-size: 28px; font-weight: 500; }
.amount-md { font-size: 20px; font-weight: 500; }

/* ── Frames (device shells for the design files) ─── */
.frame-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-12);
  padding: var(--s-10) var(--s-8) var(--s-16);
  max-width: 1680px;
  margin: 0 auto;
}
@media (min-width: 1200px) {
  .frame-stack { grid-template-columns: minmax(0, 1fr) 420px; align-items: start; }
  .frame-stack.frame-stack-mobile-only { grid-template-columns: 420px; justify-content: center; }
  .frame-stack.frame-stack-desktop-only { grid-template-columns: 1fr; }
}

.frame {
  display: flex; flex-direction: column; gap: var(--s-3);
}
.frame-label {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: var(--fs-micro);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: var(--fw-medium);
}
.frame-label .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text-tertiary); }

.frame-desktop {
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  border: 1px solid var(--border);
}
.frame-desktop .browser-chrome {
  height: 36px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px;
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--divider);
}
.frame-desktop .browser-chrome .dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.frame-desktop .browser-chrome .dot.r { background: #FE5F57; }
.frame-desktop .browser-chrome .dot.y { background: #FEBC2E; }
.frame-desktop .browser-chrome .dot.g { background: #28C840; }
.frame-desktop .browser-chrome .url {
  margin-left: 16px;
  flex: 1;
  height: 22px;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 10px;
  color: var(--text-tertiary);
  font-size: var(--fs-micro);
  font-family: var(--font-num);
  max-width: 360px;
}

.frame-mobile {
  width: 390px;
  border-radius: 44px;
  background: var(--bezel);
  padding: 12px;
  box-shadow: var(--shadow-3);
  margin: 0 auto;
}
.frame-mobile .mobile-screen {
  border-radius: 34px;
  overflow: hidden;
  background: var(--surface);
  position: relative;
  width: 100%;
  height: 780px;
}
.mobile-statusbar {
  height: 44px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  font-size: 14px; font-weight: 600;
  color: var(--text-primary);
  position: relative;
  z-index: 5;
}
.mobile-statusbar.on-dark { color: #fff; }
.mobile-notch {
  position: absolute; left: 50%; top: 8px; transform: translateX(-50%);
  width: 112px; height: 30px; border-radius: 20px;
  background: var(--bezel);
  z-index: 6;
}

.tg-header {
  height: 56px;
  display: flex; align-items: center; gap: var(--s-3);
  padding: 0 var(--s-4);
  background: #517DA2;
  color: #fff;
  font-weight: 500;
  position: relative;
  z-index: 5;
}
.tg-header .tg-close { font-size: 24px; line-height: 1; }

/* ── Side nav (desktop) ──────────────────────────────── */
.app-shell { display: grid; grid-template-columns: var(--nav-side-w) 1fr; min-height: 100%; background: var(--surface-app); }
.side-nav {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: var(--s-5) var(--s-3);
  display: flex; flex-direction: column; gap: var(--s-1);
  position: sticky; top: 0; height: 100%;
}
.side-nav .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px var(--s-3) 22px;
}
.side-nav .brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--brand-primary);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; letter-spacing: -0.02em; font-size: 16px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px var(--s-3);
  border-radius: 8px;
  font-size: var(--fs-body);
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: var(--fw-medium);
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-item:hover { background: var(--surface-sunken); color: var(--text-primary); }
.nav-item.active { background: var(--brand-tint); color: var(--brand-primary); }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.9; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--brand-primary); color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 999px;
  line-height: 1.4;
}
.nav-item.active .nav-badge { background: var(--brand-primary); }
.nav-item .nav-badge.warm { background: var(--accent-warm); color: #2A1604; }

.side-nav .nav-section {
  font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-tertiary); padding: var(--s-4) var(--s-3) 6px; font-weight: var(--fw-medium);
}
.side-nav .nav-footer {
  margin-top: auto;
  padding-top: var(--s-3);
  border-top: 1px solid var(--divider);
}

/* ── Topbar / page-header ───────────────────────────── */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--s-6);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 4;
}
.topbar .topbar-title { font-size: var(--fs-h1); font-weight: var(--fw-semibold); }
.searchbox {
  height: 38px; padding: 0 12px 0 38px;
  background: var(--surface-sunken);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  width: 320px;
  font-size: var(--fs-small);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A91A8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='M21 21l-4.3-4.3'/></svg>");
  background-repeat: no-repeat; background-position: 12px center;
}
.searchbox:focus { outline: none; background-color: var(--surface); border-color: var(--brand-primary); box-shadow: var(--shadow-focus); }

/* ── Mobile tab bar ──────────────────────────────────── */
.tabbar {
  height: var(--tabbar-h);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
}
.tabbar .tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10px; color: var(--text-tertiary); font-weight: var(--fw-medium);
}
.tabbar .tab svg { width: 22px; height: 22px; }
.tabbar .tab.active { color: var(--brand-primary); }
.tabbar .tab.create {
  background: var(--brand-primary); color: #fff; border-radius: var(--r-md); margin: 8px 6px;
}
.tabbar .tab.create svg { stroke: #fff; }

/* mobile top header */
.m-header {
  height: 52px;
  display: flex; align-items: center; gap: var(--s-3);
  padding: 0 var(--s-4);
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
}
.m-header .title { font-size: var(--fs-h2); font-weight: var(--fw-semibold); flex: 1; }
.m-header .back { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; margin-left: -8px; }

/* sticky bottom CTA on mobile */
.sticky-cta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: var(--s-3) var(--s-4) calc(var(--s-3) + var(--safe-bottom));
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, var(--surface) 30%);
}

/* ── Overlays ────────────────────────────────────────── */
.toast {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--bezel);
  color: #fff;
  border-radius: var(--r-md);
  font-size: var(--fs-small);
  box-shadow: var(--shadow-3);
}
.toast-success { background: #0F5D3A; }
.toast-danger  { background: #6E1B1B; }

.snackbar {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 12px var(--s-4);
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
}

.modal-backdrop {
  position: absolute; inset: 0;
  background: var(--overlay);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-5);
}
.modal {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: var(--s-6);
}

.bottom-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: var(--s-5) var(--s-4) calc(var(--s-5) + var(--safe-bottom));
  box-shadow: 0 -8px 24px rgba(20,48,47,0.12);
}
.bottom-sheet::before {
  content: ''; display: block; width: 36px; height: 4px; border-radius: 2px;
  background: var(--border-strong); margin: -8px auto 16px;
}

/* ── Stepper / progress ──────────────────────────────── */
.progress-track {
  height: 4px; background: var(--brand-tint-strong); border-radius: 2px; overflow: hidden;
}
.progress-fill { height: 100%; background: var(--brand-primary); border-radius: 2px; transition: width var(--t-med) var(--ease); }

.stepper { display: flex; align-items: center; gap: var(--s-2); }
.stepper .step {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-small); color: var(--text-tertiary); font-weight: var(--fw-medium);
}
.stepper .step .num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-sunken);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-family: var(--font-sans); font-weight: 600;
  border: 1px solid var(--border-strong);
}
.stepper .step.done .num { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.stepper .step.active { color: var(--brand-primary); }
.stepper .step.active .num { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.stepper .sep { width: 24px; height: 1px; background: var(--border-strong); }

/* ── Skeleton ────────────────────────────────────────── */
.skel { background: linear-gradient(90deg, var(--surface-sunken), var(--brand-tint), var(--surface-sunken));
  background-size: 200% 100%;
  animation: skel 1.4s ease-in-out infinite;
  border-radius: 6px; }
@keyframes skel { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ── Product image placeholder (striped svg) ─────────── */
.ph-img {
  background-color: var(--brand-tint);
  background-image: repeating-linear-gradient(
    -45deg,
    var(--brand-tint) 0,
    var(--brand-tint) 10px,
    var(--brand-tint-strong) 10px,
    var(--brand-tint-strong) 20px
  );
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary);
  font-family: var(--font-num); font-size: var(--fs-micro);
  border-radius: var(--r-md);
  text-transform: lowercase;
  letter-spacing: 0.04em;
  position: relative;
  overflow: hidden;
}
.ph-img.warm {
  background-color: var(--accent-warm-bg);
  background-image: repeating-linear-gradient(
    -45deg,
    var(--accent-warm-bg) 0,
    var(--accent-warm-bg) 10px,
    #F8DCB7 10px,
    #F8DCB7 20px
  );
  color: var(--accent-warm-ink);
}

/* ── Trust badge (the visual core of the product) ── */
.trust-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--success-bg);
  color: var(--success-ink);
  border: 1px solid var(--success-border);
  border-radius: var(--r-md);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
}
.trust-badge svg { width: 16px; height: 16px; }

/* ── Empty states ────────────────────────────────────── */
.empty {
  text-align: center;
  padding: var(--s-10) var(--s-6);
  display: flex; flex-direction: column; align-items: center; gap: var(--s-3);
}
.empty-art {
  width: 96px; height: 96px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--brand-tint);
  color: var(--brand-primary);
  margin-bottom: var(--s-2);
}
.empty-art svg { width: 36px; height: 36px; }
.empty .empty-title { font-size: var(--fs-h3); font-weight: var(--fw-semibold); }
.empty .empty-text { color: var(--text-secondary); max-width: 320px; }

/* ── Tables ──────────────────────────────────────────── */
.table {
  width: 100%; border-collapse: collapse; font-size: var(--fs-small);
}
.table th {
  text-align: left;
  font-weight: var(--fw-medium);
  color: var(--text-tertiary);
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px var(--s-4);
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 14px var(--s-4);
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--surface-sunken); }
.table tr.selected td { background: var(--brand-tint); }

/* ── Tabs / segmented ────────────────────────────────── */
.tabs {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--surface-sunken);
  border-radius: var(--r-md);
  padding: 3px;
}
.tabs .tab-btn {
  height: 32px; padding: 0 12px;
  font-size: var(--fs-small); font-weight: var(--fw-medium);
  border-radius: 7px;
  color: var(--text-secondary);
  display: inline-flex; align-items: center; gap: 6px;
}
.tabs .tab-btn.active { background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow-1); }
.tabs .tab-btn .count {
  font-family: var(--font-num); font-size: 11px;
  background: var(--surface); color: var(--text-tertiary);
  padding: 1px 6px; border-radius: 999px; border: 1px solid var(--border);
}
.tabs .tab-btn.active .count { background: var(--brand-tint); color: var(--brand-primary); border-color: transparent; }

.tabs-underline { display: flex; gap: var(--s-5); border-bottom: 1px solid var(--border); }
.tabs-underline .t {
  height: 42px; display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--text-secondary);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  cursor: pointer;
}
.tabs-underline .t.active { color: var(--brand-primary); border-bottom-color: var(--brand-primary); }

/* ── Status timeline ─────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline .tl-step {
  display: grid; grid-template-columns: 24px 1fr; gap: var(--s-3);
  padding: 12px 0;
  position: relative;
}
.timeline .tl-step::before {
  content: ''; position: absolute; left: 11px; top: 0; bottom: 0; width: 2px;
  background: var(--border);
}
.timeline .tl-step:first-child::before { top: 50%; }
.timeline .tl-step:last-child::before  { bottom: 50%; }
.timeline .tl-dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
  flex-shrink: 0;
  color: var(--text-tertiary);
}
.timeline .tl-step.done .tl-dot { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.timeline .tl-step.done .tl-dot svg { width: 12px; height: 12px; }
.timeline .tl-step.active .tl-dot { border-color: var(--brand-primary); background: var(--brand-primary); color: #fff; box-shadow: 0 0 0 4px var(--brand-tint); }
.timeline .tl-step.active .tl-dot::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.timeline .tl-body { display: flex; flex-direction: column; gap: 2px; padding-bottom: 4px; }
.timeline .tl-title { font-size: var(--fs-body); font-weight: var(--fw-medium); }
.timeline .tl-step:not(.active):not(.done) .tl-title { color: var(--text-tertiary); }
.timeline .tl-meta  { font-size: var(--fs-micro); color: var(--text-tertiary); font-family: var(--font-num); }

/* ── Switch ──────────────────────────────────────────── */
.switch { position: relative; display: inline-block; width: 40px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: background var(--t-fast);
}
.switch .thumb {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: left var(--t-fast);
}
.switch input:checked + .track { background: var(--brand-primary); }
.switch input:checked + .track + .thumb { left: 19px; }

/* ── Banner ──────────────────────────────────────────── */
.banner {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--info-border);
  background: var(--info-bg);
  color: var(--info-ink);
  font-size: var(--fs-small);
}
.banner svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.banner.warm { background: var(--accent-warm-bg); border-color: var(--accent-warm-border); color: var(--accent-warm-ink); }
.banner.success { background: var(--success-bg); border-color: var(--success-border); color: var(--success-ink); }
.banner.warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-ink); }
.banner.danger  { background: var(--danger-bg);  border-color: var(--danger-border);  color: var(--danger-ink); }
