/* =========================================================================
   AllScale Storefront Dashboard — shared stylesheet
   Redesign 2026-04. Layered design system + product styles in one file
   so EJS templates can pull a single asset (no build step).

   Backwards-compat: old class names (.app-shell, .app-main, .nav-link,
   .pill-*, .btn-*, .table*, .empty, .flash, .toast, .row*) still resolve
   so pages we haven't redesigned yet keep working.
   ========================================================================= */

/* ---- Fonts -------------------------------------------------------------- */
@font-face {
  font-family: "Archivo";
  src: url("/static/allscale/fonts/Archivo-VariableFont.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("/static/allscale/fonts/Archivo-Italic-VariableFont.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* ---- Tokens ------------------------------------------------------------- */
:root {
  /* Brand greens */
  --as-green-900: #0C3124;
  --as-green-700: #048E44;
  --as-green-600: #009859;
  --as-green-500: #12D16B;
  --as-green-100: #E5EEEA;
  --as-green-75:  #E8F5EE;
  --as-green-50:  #F2F8F5;

  /* Neutrals */
  --as-paper:     #FFFFFF;
  --as-muted-500: #83968F;
  --as-muted-400: #777777;
  --as-muted-300: #DBDBDB;
  --as-muted-200: #E4E6E5;
  --as-muted-100: #F1F1F1;

  /* Accents */
  --as-red-600:    #FF383C;
  --as-red-500:    #DE5B52;
  --as-red-50:     #FDF4F2;
  --as-orange-500: #EC9418;
  --as-orange-50:  #FDF1E4;

  /* Semantic */
  --fg:            var(--as-green-900);
  --fg-2:          var(--as-muted-500);
  --fg-3:          #B6C3BE;
  --brand:         var(--as-green-600);
  --brand-strong:  var(--as-green-900);
  --brand-accent:  var(--as-green-500);
  --brand-on:      #FFFFFF;
  --success:       var(--as-green-600);
  --success-fg:    var(--as-green-700);
  --success-bg:    var(--as-green-50);
  --danger:        var(--as-red-500);
  --danger-bg:     var(--as-red-50);
  --warning:       var(--as-orange-500);
  --warning-bg:    var(--as-orange-50);
  --bg:            #FAFBFA;
  --bg-2:          var(--as-green-50);
  --surface:       var(--as-paper);
  --surface-soft:  var(--as-green-50);
  --border:        var(--as-green-100);
  --border-strong: var(--as-muted-200);
  --tg:            #2AABEE;
  --tg-deep:       #229ED9;

  --font-sans: "Archivo", "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Archivo", ui-monospace, SFMono-Regular, "JetBrains Mono", Consolas, monospace;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 16px 40px rgba(12,49,36,0.08);
}

/* ---- Base --------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; background: var(--bg); color: var(--fg); -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--brand); text-decoration: none; }
a:hover { opacity: 0.85; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
code { font-family: var(--font-mono); font-size: 0.92em; }

.muted { color: var(--fg-2); }
.muted-count { color: var(--fg-2); font-weight: 400; font-size: 0.85em; }
.mono { font-family: var(--font-mono); }
.as-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.t-num { font-variant-numeric: tabular-nums; font-weight: 500; }
.ta-right { text-align: right; }
.break-all { word-break: break-all; }
.spacer { flex: 1; }
.ml-auto { margin-left: auto; }

.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row.gap-sm { gap: 8px; }
.row.gap-md { gap: 16px; }
.row.wrap, .row-wrap { flex-wrap: wrap; }
.row.spread { justify-content: space-between; }
.row.baseline { align-items: baseline; }
.stack-sm > * + * { margin-top: 12px; }
.stack-md > * + * { margin-top: 20px; }
.stack-lg > * + * { margin-top: 32px; }

.eyebrow {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--fg-2); margin-bottom: 6px;
}

/* ---- App shell ---------------------------------------------------------- */
.app-shell { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.page-wrap { max-width: 1180px; margin: 0 auto; width: 100%; padding: 36px 40px 80px; }
.tab-content { max-width: 1180px; margin: 0 auto; width: 100%; padding: 28px 40px 80px; }

.page-head { margin-bottom: 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head-main { flex: 1; min-width: 0; }
.page-title { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.page-sub { font-size: 14px; color: var(--fg-2); margin-top: 6px; max-width: 60ch; }
.page-hint { margin: 6px 0 0; color: var(--fg-2); font-size: 14px; line-height: 1.5; max-width: 60ch; }

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--fg-2); font-size: 13px; font-weight: 500; margin-bottom: 10px;
}
.back-link:hover { color: var(--fg); opacity: 1; }

.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head-main { flex: 1; min-width: 0; }
.section-title { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.section-hint { margin: 4px 0 0; color: var(--fg-2); font-size: 13px; line-height: 1.5; max-width: 65ch; }
.section-action { flex-shrink: 0; }

/* ---- Sidebar ------------------------------------------------------------ */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 24px 16px;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 24px;
  border: 0;
}
.sidebar-brand img { height: 28px; display: block; }
.sidebar-brand .sub,
.sidebar-brand .subbrand { color: var(--fg-2); font-size: 14px; font-weight: 500; padding: 0; border: 0; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link, .nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; border-radius: 999px;
  font-weight: 500; font-size: 15px; letter-spacing: -0.01em;
  color: var(--fg); background: transparent; border: 0; cursor: pointer;
  text-align: left; width: 100%;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.nav-link:hover, .nav-item:hover { background: var(--as-green-50); color: var(--fg); opacity: 1; }
.nav-link.active, .nav-link.is-active, .nav-item.is-active {
  background: var(--as-green-50); color: var(--brand-strong);
}
.nav-icon {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-icon svg { width: 100%; height: 100%; }
.nav-badge {
  margin-left: auto;
  background: var(--as-orange-50); color: var(--as-orange-500);
  font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px;
}

.sidebar-foot {
  margin-top: auto; display: flex; flex-direction: column; gap: 8px;
  padding-top: 20px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--fg-2);
}
.lang-eyebrow {
  margin: 0 0 6px; display: flex; align-items: center; gap: 6px;
}
.lang-eyebrow-icon { width: 13px; height: 13px; }
.lang-select {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 14px; font-weight: 500; background: transparent; cursor: pointer;
  color: inherit;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}
.lang-select:hover { background: var(--as-green-50); }
.logout {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: var(--as-red-500); background: transparent; border: 0;
  font-weight: 500; font-size: 14px; cursor: pointer; border-radius: 999px;
  text-align: left;
}
.logout:hover { background: var(--as-green-50); }

/* Mobile drawer scrim */
.sidebar-scrim {
  display: none;
  position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 90;
}
body.has-open-sidebar .sidebar-scrim { display: block; }
/* When the mobile drawer is open, freeze the body so iOS Safari doesn't
   scroll the page behind the drawer. position:fixed is required (not just
   overflow:hidden) for iOS — the JS in foot.ejs preserves scroll position. */
body.has-open-sidebar {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  right: 0;
  overflow: hidden;
}

/* ---- Mobile app bar (only on bot pages / mobile views) ------------------ */
.appbar {
  display: none;
  position: sticky; top: 0; z-index: 30;
  background: rgba(250,251,250, 0.92);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  align-items: center; gap: 10px;
}
.appbar-brand { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar-brand .subbrand { color: var(--fg-2); font-weight: 500; }

/* ---- Bot header (sticky on bot-scoped pages) ---------------------------- */
.bot-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(250,251,250, 0.88);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border-bottom: 1px solid var(--border);
}
.bot-header-inner { max-width: 1180px; margin: 0 auto; padding: 18px 40px 0; }
.crumb {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--fg-2); font-size: 13px; font-weight: 500;
  background: transparent; border: 0; padding: 4px 0; cursor: pointer;
  text-decoration: none;
}
.crumb:hover { color: var(--fg); opacity: 1; }

.bot-id-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; margin-top: 6px;
}
.bot-id-left { display: flex; align-items: center; gap: 18px; min-width: 0; }
.bot-avatar {
  width: 60px; height: 60px; border-radius: 18px;
  background: linear-gradient(135deg, var(--as-green-500), var(--as-green-700));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 24px; letter-spacing: -0.02em;
  flex: 0 0 60px;
}
.bot-name-block { min-width: 0; }
.bot-name { font-size: 26px; font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; margin: 0 0 6px; }
.bot-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bot-handle { color: var(--fg-2); font-size: 14px; font-weight: 500; }
.bot-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.bot-more { position: relative; }
.bot-more > summary { list-style: none; cursor: pointer; }
.bot-more > summary::-webkit-details-marker { display: none; }

/* ---- Tabs (underline) --------------------------------------------------- */
.tabs { display: flex; gap: 4px; padding-top: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px 14px;
  background: transparent; border: 0; cursor: pointer;
  font-family: inherit; font-weight: 500; font-size: 14px;
  color: var(--fg-2); position: relative;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}
.tab:hover { color: var(--fg); opacity: 1; }
.tab.is-active, .tab[aria-current="page"] { color: var(--fg); border-bottom-color: var(--brand); }
.tab .icon { display: inline-flex; }
.tab-badge {
  background: var(--as-orange-50); color: var(--as-orange-500);
  font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px;
  min-width: 18px; text-align: center;
}

/* ---- Bottom tab bar (mobile only) -------------------------------------- */
.bottom-tabs {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: rgba(255,255,255, 0.96);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-top: 1px solid var(--border);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  justify-content: space-around;
}
.btab {
  position: relative;
  flex: 1; max-width: 96px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: transparent; border: 0; cursor: pointer;
  padding: 6px 4px; border-radius: 12px;
  font-family: inherit; font-size: 10px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--fg-2);
  text-decoration: none;
}
.btab .icon, .btab svg { width: 22px; height: 22px; }
.btab.is-active, .btab[aria-current="page"] { color: var(--brand-strong); }
.btab.is-active .icon, .btab[aria-current="page"] .icon,
.btab.is-active svg, .btab[aria-current="page"] svg { color: var(--brand); }
.btab-badge {
  position: absolute; top: 2px; right: 18px;
  background: var(--as-orange-500); color: white;
  font-size: 10px; font-weight: 700; line-height: 1;
  padding: 2px 5px; border-radius: 999px;
}

/* ---- Pills -------------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; letter-spacing: 0;
  white-space: nowrap; line-height: 1.4;
  text-decoration: none;
  border: 1px solid transparent;
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.pill-success { background: var(--as-green-50); color: var(--as-green-700); }
.pill-success .pill-dot { background: var(--as-green-500); }
.pill-warning { background: var(--as-orange-50); color: #8A6315; }
.pill-warning .pill-dot { background: var(--as-orange-500); }
.pill-danger  { background: var(--as-red-50);   color: var(--as-red-600); }
.pill-danger  .pill-dot { background: var(--as-red-500); }
.pill-neutral { background: var(--as-muted-100); color: var(--fg-2); }
.pill-neutral .pill-dot { background: var(--as-muted-400); }
.pill-tg { background: #EAF4FA; color: var(--tg-deep); }
.pill-tg .pill-dot { background: var(--tg); }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; font-size: 14px;
  border: 0; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-weight: 500; letter-spacing: -0.01em;
  text-decoration: none;
  transition: filter .15s ease, background .15s ease, transform .1s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:hover { filter: brightness(0.96); opacity: 1; }
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn[disabled], .btn.is-disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm, .btn--sm { padding: 8px 14px; font-size: 13px; }
.btn--md { padding: 11px 18px; font-size: 14px; }
.btn--lg { padding: 14px 22px; font-size: 15px; }
.btn-block { width: 100%; }

.btn-primary, .btn--primary { background: var(--brand); color: var(--brand-on); }
.btn-primary:hover, .btn--primary:hover { filter: brightness(0.95); }
.btn-ghost, .btn--ghost {
  background: var(--surface); color: var(--fg); border: 1px solid var(--border);
}
.btn-ghost:hover, .btn--ghost:hover { background: var(--as-green-50); border-color: var(--as-green-100); filter: none; }
.btn-tg { background: var(--tg); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn--quiet { background: transparent; color: var(--fg-2); }
.btn--quiet:hover { background: var(--as-green-50); color: var(--fg); }
.btn--danger-ghost { background: var(--surface); color: var(--as-red-500); border: 1px solid #f6dcd7; }
.btn--danger-ghost:hover { background: var(--as-red-50); border-color: #f6dcd7; filter: none; }
.btn-link, .link-btn {
  background: transparent; color: var(--brand);
  padding: 6px 10px; border-radius: 8px;
  font-family: inherit; font-weight: 500; font-size: 13px;
  border: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  text-decoration: none;
}
.btn-link:hover, .link-btn:hover { background: var(--as-green-50); opacity: 1; }

/* Loading state */
.btn[aria-busy="true"] {
  pointer-events: none;
  opacity: 0.75;
  cursor: wait;
}
.btn[aria-busy="true"]::before {
  content: "";
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: as-btn-spin 0.7s linear infinite;
  vertical-align: -1px;
}
@keyframes as-btn-spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: transparent; border: 0; cursor: pointer;
  border-radius: 999px; color: var(--fg-2);
  transition: background .15s ease, color .15s ease;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--as-green-50); color: var(--fg); }

/* ---- Cards -------------------------------------------------------------- */
.card, .as-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
}
.as-card-tight { padding: 16px; border-radius: 16px; }
.strip-card { display: flex; align-items: center; justify-content: space-between; }
.card-pad-28 { padding: 28px; }
.card-pad-20 { padding: 20px; }

/* ---- Fields & inputs ---------------------------------------------------- */
.field { display: block; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.field-label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--fg); margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.field-optional { color: var(--fg-2); font-weight: 400; }
.field-counter { font-size: 12px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.field-hint { font-size: 12px; color: var(--fg-2); line-height: 1.5; margin-top: 6px; }
.field-error { font-size: 12px; color: var(--danger); margin-top: 6px; }

/* Inline collapsible help that sits directly under a field. Click the
   summary to expand the numbered steps / sample block. */
.inline-help { margin-top: 10px; }
.inline-help > summary {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; user-select: none; list-style: none;
  font-size: 12px; font-weight: 500; color: var(--brand);
  padding: 4px 10px; border-radius: 999px;
  background: var(--as-green-50);
  width: -moz-fit-content; width: fit-content;
}
.inline-help > summary::-webkit-details-marker { display: none; }
.inline-help > summary::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .15s ease;
  margin-right: 2px;
  margin-bottom: 2px;
}
.inline-help[open] > summary::before { transform: rotate(45deg); margin-bottom: -2px; }
.inline-help > summary:hover { background: var(--as-green-100); }
.inline-help-body {
  margin-top: 10px;
  padding: 14px 16px;
  background: var(--as-green-50);
  border-radius: 12px;
  font-size: 13px; line-height: 1.55; color: var(--fg);
}
.inline-help-body .numbered-steps { margin: 0; }
.inline-help-body .hint {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.06);
  font-size: 12px; color: var(--fg-2);
}

.input, .select, .textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--fg);
  letter-spacing: -0.01em;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--as-green-100); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(140, 210, 177, .35);
}
.input-mono, .input--mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 13px; }
.input--area, textarea.input { resize: vertical; min-height: 100px; line-height: 1.5; }
.input--with-suffix { padding-right: 56px; }
.input-wrap { position: relative; display: block; }
.input-wrap .input { padding-right: 56px; }
.input-suffix {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 12px; font-weight: 500;
  color: var(--fg-2); letter-spacing: 0.01em;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-2) 50%), linear-gradient(-45deg, transparent 50%, var(--fg-2) 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.checkbox-row, .check-row {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; cursor: pointer; font-weight: 500;
  color: var(--fg);
}
.checkbox-row input[type="checkbox"], .check-row input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}

/* Radio-card picker — used by the product fulfillment-mode selector.
   Cards stack vertically (single column on every viewport) so the
   touch target stays generous on mobile and there's room for a short
   hint line. The selected state mirrors .topup-card.is-popular: green
   border + softer green background + an "ON" pill in the corner.
   Long-form details land in the option's `title` attribute so desktop
   users get a hover tooltip without polluting the layout. */
.radio-picker { display: grid; gap: 10px; }
.radio-option {
  position: relative;
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.radio-option:hover { border-color: var(--brand-accent); }
.radio-option input[type="radio"] {
  width: 16px; height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
}
.radio-option-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.radio-option-title { font-size: 14px; font-weight: 600; color: var(--fg); }
.radio-option-hint { font-size: 12px; color: var(--fg-2); line-height: 1.45; }
/* `:has()` lights up the selected card without any JS state. Browsers
   that don't support :has() (pre-2022 Safari, ancient Chromium) still
   see a working radio + the hint text — they just miss the colored
   border and the ON pill. Graceful. */
.radio-option:has(input[type="radio"]:checked) {
  border-color: var(--as-green-500);
  background: var(--surface-soft);
}
.radio-option-on {
  position: absolute; top: 14px; right: 14px;
  display: none;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--brand); color: var(--brand-on);
  padding: 2px 8px; border-radius: 999px;
}
.radio-option:has(input[type="radio"]:checked) .radio-option-on { display: inline-block; }
.radio-option.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.radio-option.is-disabled:hover { border-color: var(--border); }
.radio-option.is-disabled input[type="radio"] { cursor: not-allowed; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .form-grid-2 { grid-template-columns: 1fr; } }

.form-footer {
  display: flex; align-items: center; gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
  flex-wrap: wrap;
}

.inline-display {
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--as-green-50);
  font-size: 14px; color: var(--fg);
}

/* ---- Toggle (button-style) --------------------------------------------- */
.toggle {
  display: inline-flex; align-items: center; gap: 12px;
  background: transparent; border: 0; padding: 0; cursor: pointer;
  font-family: inherit; text-align: left; color: inherit;
}
.toggle-track {
  width: 38px; height: 22px; border-radius: 999px;
  background: var(--as-muted-200); position: relative;
  transition: background .15s ease;
  flex-shrink: 0;
}
.toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: left .15s ease;
}
.toggle.is-on .toggle-track { background: var(--brand); }
.toggle.is-on .toggle-thumb { left: 18px; }
/* Focus ring on the styled track when the underlying checkbox is keyboard-focused.
   Toggles are usually <label> wrapping a visually-hidden <input>, so the focus
   indicator has to live on the track. */
.toggle:has(input:focus-visible) .toggle-track,
.toggle input:focus-visible + .toggle-track {
  box-shadow: 0 0 0 4px rgba(140, 210, 177, .45);
}
.toggle-text { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
.toggle-label { font-size: 14px; font-weight: 500; }
.toggle-hint { font-size: 12px; color: var(--fg-2); line-height: 1.4; }

/* ---- Stat tiles --------------------------------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-label { font-size: 12px; font-weight: 500; color: var(--fg-2); }
.stat-value {
  font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1;
  margin-top: 6px;
}
.stat-unit { font-size: 13px; font-weight: 500; color: var(--fg-2); margin-left: 2px; }
.stat-trend { font-size: 12px; font-weight: 500; margin-top: 4px; }
.trend-up    { color: var(--as-green-700); }
.trend-warn  { color: var(--as-orange-500); }
.trend-muted { color: var(--fg-2); }

/* ---- Two-col layout ----------------------------------------------------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---- Share/QR ----------------------------------------------------------- */
.share-row { display: flex; gap: 20px; align-items: stretch; margin-top: 4px; }
.qr-tile {
  border-radius: 16px; background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px;
  flex-shrink: 0;
  line-height: 0;
}
.qr-tile img { display: block; }
.link-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface);
  min-width: 0;
}
.link-pill-url {
  flex: 1; font-family: var(--font-mono); font-size: 13px; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}

/* ---- Commands cheat-sheet ---------------------------------------------- */
.cmd-list { display: flex; flex-direction: column; gap: 6px; }
.cmd-list--2col { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.cmd-row {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 10px; border-radius: 10px;
  transition: background .15s ease;
}
.cmd-row:hover { background: var(--as-green-50); }
.cmd-code {
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  background: var(--as-green-50); color: var(--as-green-700);
  padding: 4px 10px; border-radius: 6px;
  flex-shrink: 0; min-width: 120px; text-align: left;
}
.cmd-desc { color: var(--fg-2); font-size: 13px; flex: 1; min-width: 0; }
.cmd-copy {
  background: transparent; border: 0; cursor: pointer; padding: 6px;
  color: var(--fg-2); border-radius: 8px;
  opacity: 0; transition: opacity .15s ease;
  display: inline-flex; align-items: center; justify-content: center;
}
.cmd-row:hover .cmd-copy { opacity: 1; }
.cmd-copy:hover { background: var(--surface); color: var(--fg); }
.link-pill .cmd-copy, .code-row .cmd-copy { opacity: 1; }
.code-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--as-green-50);
  overflow: hidden;
}
.code-row code {
  font-family: var(--font-mono); font-size: 13px; color: var(--fg);
  overflow-x: auto; white-space: nowrap; flex: 1; min-width: 0;
}

.kbd {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  padding: 2px 6px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 12px;
}

/* ---- Add product form --------------------------------------------------- */
.add-grid {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr 1.6fr auto;
  gap: 12px; align-items: flex-end;
}
.add-actions { display: flex; align-items: flex-end; padding-bottom: 2px; }
.add-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-top: 16px; padding-top: 16px;
  border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}
.add-meta-left { display: flex; align-items: center; gap: 14px; flex: 1 1 320px; min-width: 280px; }
.add-meta-text { min-width: 0; }
.add-meta-title { font-size: 13px; font-weight: 500; }
.add-meta-hint { font-size: 12px; color: var(--fg-2); margin-top: 2px; line-height: 1.5; }

/* ---- Product image slot ------------------------------------------------- */
.img-slot {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; overflow: hidden;
  background: var(--as-green-50);
  border: 1px solid var(--border);
  flex-shrink: 0;
  cursor: pointer;
  color: var(--fg-2);
  transition: border-color .15s ease, color .15s ease;
}
.img-slot.is-empty { border-style: dashed; background: transparent; }
.img-slot.is-empty:hover { border-color: var(--as-green-100); color: var(--fg); background: var(--as-green-50); }
.img-slot.has-image { padding: 0; cursor: default; }
.img-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-slot-x {
  position: absolute; top: 4px; right: 4px;
  background: rgba(12,49,36,0.78); color: white; border: 0;
  width: 22px; height: 22px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0; transition: opacity .15s ease;
}
.img-slot.has-image:hover .img-slot-x { opacity: 1; }
.img-slot-fallback {
  width: 100%; height: 100%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--as-green-500), var(--as-green-700));
  color: white;
  font-weight: 700; letter-spacing: -0.01em;
}

/* ---- Product list ------------------------------------------------------- */
.product-list { display: flex; flex-direction: column; gap: 8px; }
.product-row {
  display: grid;
  grid-template-columns: 44px 1fr auto auto auto auto;
  align-items: center; gap: 16px;
  padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color .15s ease;
}
.product-row:hover { border-color: var(--as-green-100); }
.product-row.is-inactive { opacity: 0.55; }
.product-meta { min-width: 0; }
.product-name {
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
}
.product-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-flag {
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--fg-2); background: var(--as-muted-100);
  padding: 1px 6px; border-radius: 4px;
  flex-shrink: 0;
}
.product-desc {
  font-size: 12px; color: var(--fg-2); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.product-fulfillment { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.product-fulfillment-pill {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 500;
  color: var(--fg-2);
  background: var(--surface-soft);
  padding: 3px 10px; border-radius: 999px;
  white-space: nowrap;
}
/* Tiny secondary badge that sits next to the fulfillment chip. Only
 * appears on auto_code products. Tone shifts at threshold and stock=0
 * so a glance at the catalog flags "you're about to oversell".
 *  - ok:  default muted grey, just informational
 *  - low: orange tint, owner should top up
 *  - out: red tint + filled, /shop is showing "Sold out" right now */
.product-stock-badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.product-stock-badge[data-tone="ok"]  { color: var(--fg-2);          background: var(--as-muted-100); }
.product-stock-badge[data-tone="low"] { color: #8A6315;              background: var(--as-orange-50); }
.product-stock-badge[data-tone="out"] { color: var(--as-red-600);    background: var(--as-red-50); }

/* Delivered-codes list inside the orders detail expansion. Each
 * auto_code order can have N rows; render them as a wrap-friendly
 * flex layout so 1, 2, or 10 codes all read cleanly without
 * overflowing the existing 2-col label/value detail grid. */
.order-codes {
  display: inline-flex; flex-wrap: wrap; gap: 6px 10px; align-items: center;
}
.order-code-cell {
  font-size: 12px;
  background: var(--surface-soft);
  padding: 2px 8px; border-radius: 6px;
}
.product-price { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.product-price .unit { font-size: 11px; color: var(--fg-2); font-weight: 500; margin-left: 2px; }
.product-status { display: flex; align-items: center; }
.product-actions { display: flex; gap: 2px; align-items: center; }

/* ---- Search ------------------------------------------------------------- */
.search {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--fg-2);
}
.search:focus-within { border-color: var(--brand); color: var(--fg); }
.search-input {
  border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 13px; width: 180px;
  color: var(--fg);
}

/* ---- Segmented control ------------------------------------------------- */
.seg {
  display: inline-flex; padding: 4px; gap: 0;
  background: var(--as-green-50); border-radius: 999px;
  flex-shrink: 0;
}
.seg-scroll { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.seg-scroll::-webkit-scrollbar { display: none; }
.seg-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  background: transparent; border: 0; cursor: pointer;
  font-family: inherit; font-weight: 500; font-size: 13px;
  color: var(--fg-2); white-space: nowrap;
  transition: background .15s ease, color .15s ease;
  text-decoration: none;
}
.seg-btn:hover { color: var(--fg); opacity: 1; }
.seg-btn.is-active, .seg-btn[aria-current="page"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.seg-count { font-size: 11px; color: var(--fg-2); font-variant-numeric: tabular-nums; }

/* ---- Orders filterbar + table ------------------------------------------ */
.orders-filterbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.filter-card { background: var(--as-green-50); border-color: var(--as-green-100); padding: 20px; border-radius: 20px; border: 1px solid var(--border); margin-top: 12px; }
.filter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }

.orders-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.orders-table th {
  text-align: left; font-weight: 500; color: var(--fg-2);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  background: var(--as-green-50);
}
.orders-table th:first-child { border-top-left-radius: 20px; }
.orders-table th:last-child  { border-top-right-radius: 20px; }
.orders-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.orders-table tbody tr:last-child td { border-bottom: 0; }
.orders-table tbody tr:hover td { background: rgba(242,248,245, 0.4); }
.orders-table .order-id, .order-id {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  color: var(--fg); background: var(--as-green-50);
  padding: 3px 8px; border-radius: 6px;
}
.unit { font-size: 11px; color: var(--fg-2); font-weight: 400; margin-left: 2px; }

/* Mobile order cards */
.orders-cards { display: none; padding: 4px; }
.ocard { border-bottom: 1px solid var(--border); padding: 14px 16px; display: grid; gap: 6px; }
.ocard:last-child { border-bottom: 0; }
.ocard-top { display: flex; align-items: center; justify-content: space-between; }
.ocard-amount { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ocard-meta { font-size: 13px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---- AI head + usage --------------------------------------------------- */
.ai-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.usage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.usage-tile { background: var(--as-green-50); border-radius: 16px; padding: 18px 20px; }
.usage-tile.is-warn { background: var(--as-orange-50); }
.usage-big { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.usage-small { font-size: 13px; font-weight: 400; color: var(--fg-2); margin-left: 4px; }
.usage-foot { margin-top: 8px; font-size: 12px; color: var(--fg-2); }

/* ---- Top-up packages --------------------------------------------------- */
.topup-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.topup-head { margin-bottom: 12px; }
.topup-sub { font-size: 13px; color: var(--fg-2); }
.topup-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.topup-card {
  position: relative; display: flex; flex-direction: column;
  gap: 8px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; cursor: pointer; text-align: left;
  font-family: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.topup-card:hover { border-color: var(--as-green-100); transform: translateY(-1px); }
.topup-card.is-popular { border-color: var(--as-green-500); }
.topup-flag {
  position: absolute; top: -10px; right: 14px;
  background: var(--brand); color: white;
  font-size: 10px; font-weight: 600; letter-spacing: 0.03em;
  padding: 3px 10px; border-radius: 999px; text-transform: uppercase;
}
.topup-label { font-size: 12px; font-weight: 600; color: var(--fg-2); text-transform: uppercase; letter-spacing: 0.06em; }
.topup-credits { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.topup-credits span { font-size: 12px; font-weight: 500; color: var(--fg-2); margin-left: 4px; }
.topup-price { font-size: 14px; color: var(--fg-2); margin-bottom: 4px; font-variant-numeric: tabular-nums; }

/* ---- Callouts + banners ------------------------------------------------ */
.callout {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 18px; border-radius: 14px;
  background: var(--as-green-50); color: var(--fg);
}
.callout--warn   { background: var(--as-orange-50); }
.callout--danger { background: var(--as-red-50); }
.callout--ok     { background: var(--success-bg); }
.callout--warn   .callout-title, .callout--warn   .callout-body { color: #8a5e10; }
.callout--danger .callout-title, .callout--danger .callout-body { color: var(--as-red-600); }
.callout--ok     .callout-title, .callout--ok     .callout-body { color: var(--success-fg); }
.callout-title { font-size: 14px; font-weight: 500; }
.callout-body { font-size: 12px; line-height: 1.5; margin-top: 4px; }

/* ---- Inline link (used in interpolated i18n strings) ------------------ */
a.link, .link {
  color: var(--brand);
  text-decoration: none;
}
a.link:hover, .link:hover { opacity: 0.85; text-decoration: underline; }

.banner { padding: 18px 20px; border-radius: 16px; border: 1px solid; }
.banner--warn   { background: #FFF6E5; border-color: #F2D896; color: #8A6315; }
.banner--danger { background: var(--as-red-50); border-color: #F6D9D4; color: var(--as-red-600); }
.banner-title { font-weight: 500; font-size: 15px; margin-bottom: 6px; letter-spacing: -0.01em; }
.banner-body { font-size: 13px; color: var(--fg); line-height: 1.55; margin-bottom: 12px; max-width: 65ch; }
.banner-trace {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  font-family: var(--font-mono); font-size: 11px; line-height: 1.5; color: var(--fg);
  white-space: pre-wrap; word-break: break-word;
  max-height: 100px; overflow-y: auto;
}
.banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- FAQ --------------------------------------------------------------- */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}
.faq-item summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-q { flex: 1; font-size: 14px; font-weight: 500; }
.faq-caret { color: var(--fg-2); transition: transform .15s ease; display: inline-flex; }
.faq-item[open] .faq-caret { transform: rotate(90deg); }
.faq-a { padding: 0 16px 16px 42px; font-size: 13px; color: var(--fg-2); line-height: 1.5; }
.faq-actions { display: flex; gap: 2px; }
.faq-drag-handle {
  cursor: grab; color: var(--fg-3, var(--fg-2)); display: inline-flex;
  padding: 2px; border-radius: 4px; user-select: none;
}
.faq-drag-handle:hover { color: var(--fg-1, var(--fg)); background: var(--as-green-50, transparent); }
.faq-drag-handle:active { cursor: grabbing; }
.faq-item.is-dragging { opacity: .4; }
.add-row {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px;
  border: 1px dashed var(--border); border-radius: 14px;
  background: transparent; color: var(--brand);
  cursor: pointer; font-family: inherit; font-weight: 500; font-size: 13px;
  width: 100%;
}
.add-row:hover { background: var(--as-green-50); border-color: var(--as-green-100); }

/* ---- Missed questions -------------------------------------------------- */
.missed-list { display: flex; flex-direction: column; gap: 8px; }
.missed-row {
  border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface);
}
.missed-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; flex-wrap: wrap; }
.missed-q { font-size: 14px; line-height: 1.45; color: var(--fg); }
.missed-actions { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.empty-inline {
  text-align: center; padding: 28px 20px;
  color: var(--fg-2); font-size: 13px;
  background: var(--as-green-50); border-radius: 14px;
}

/* ---- Numbered steps (BotFather) --------------------------------------- */
.info-card { background: var(--as-green-50); border-color: transparent; }
.numbered-steps {
  margin: 0; padding-left: 22px;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; line-height: 1.55;
}
.numbered-steps li { padding-left: 4px; }
.numbered-steps code {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--surface); padding: 2px 6px; border-radius: 4px;
}
.hint {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.06);
  font-size: 12px; color: var(--fg-2); line-height: 1.5;
}

/* ---- Settings ---------------------------------------------------------- */
.cred-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rotate-block {
  display: flex; flex-direction: column; gap: 14px;
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.danger-card { border-color: #f6dcd7; background: linear-gradient(to bottom, var(--surface), #FFFBFA); }

/* ---- Side sheet (modal panel) ------------------------------------------ */
.sheet-scrim {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.3);
  display: flex; justify-content: flex-end;
  animation: scrim-in .15s ease;
}
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  background: var(--surface);
  height: 100%;
  width: var(--sheet-w, 460px);
  max-width: 100%;
  display: flex; flex-direction: column;
  box-shadow: -12px 0 32px rgba(0,0,0,0.12);
  animation: sheet-in .25s cubic-bezier(.2,.7,.2,1);
}
@keyframes sheet-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.sheet-head h3 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.sheet-body { flex: 1; overflow-y: auto; padding: 20px 22px; }

/* ---- Bot cards grid (My bots) ----------------------------------------- */
.botcard-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.botcard {
  display: flex; flex-direction: column; gap: 12px;
  padding: 20px 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  cursor: pointer; text-align: left; font-family: inherit;
  text-decoration: none; color: inherit;
  transition: border-color .15s ease, transform .1s ease;
}
.botcard:hover { border-color: var(--as-green-100); transform: translateY(-1px); opacity: 1; }
.botcard-head { display: flex; align-items: center; gap: 12px; }
.botcard-avatar {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--as-green-500), var(--as-green-700));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  flex-shrink: 0;
}
.botcard-name-block { flex: 1; min-width: 0; }
.botcard-name { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.botcard-handle { font-size: 13px; color: var(--fg-2); margin-top: 2px; }
.botcard-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.botcard-stats {
  display: flex; gap: 20px;
  padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 14px; font-weight: 500;
}

/* ---- Activity feed ----------------------------------------------------- */
.activity-list { display: flex; flex-direction: column; gap: 4px; }
.activity-row {
  display: grid; grid-template-columns: 8px 1fr auto;
  gap: 14px; align-items: flex-start;
  padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px;
}
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--as-muted-400); }
.activity-row.level-info  .activity-dot { background: var(--as-green-500); }
.activity-row.level-warn  .activity-dot { background: var(--as-orange-500); }
.activity-row.level-error .activity-dot { background: var(--as-red-500); }
.activity-main { min-width: 0; }
.activity-msg { font-size: 14px; line-height: 1.45; color: var(--fg); }
.activity-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; font-size: 12px; }
.activity-type {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  color: var(--fg-2); background: var(--as-green-50);
  padding: 3px 7px; border-radius: 4px;
  flex-shrink: 0;
}

/* ---- Notifications list ----------------------------------------------- */
.notif-group-title { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; color: var(--fg); margin-bottom: 12px; }
.notif-list { display: flex; flex-direction: column; }
.notif-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding: 14px 0;
  border-top: 1px solid var(--border);
}
.notif-row:first-child { border-top: 0; padding-top: 0; }
.notif-text { flex: 1; min-width: 0; }
.notif-label { font-size: 14px; font-weight: 500; }
.notif-hint { font-size: 12px; color: var(--fg-2); margin-top: 2px; line-height: 1.5; }

/* ---- Tables (legacy generic) ------------------------------------------ */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
}
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table thead th {
  text-align: left; padding: 12px 18px;
  background: var(--bg-2);
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--fg-2);
  border-bottom: 1px solid var(--border);
}
.table tbody td { padding: 14px 18px; border-top: 1px solid var(--border); vertical-align: top; }
.table tbody tr:first-child td { border-top: 0; }
.table tbody tr:hover td { background: var(--bg-2); }
.table .t-right { text-align: right; }
.table .t-num { font-variant-numeric: tabular-nums; font-weight: 500; }
.table .t-muted { color: var(--fg-2); font-size: 12px; }

/* Admin pages use `.data-table` directly on the <table>. Mirror .table styling. */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table thead th {
  text-align: left; padding: 12px 18px;
  background: var(--bg-2);
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--fg-2);
  border-bottom: 1px solid var(--border);
}
.data-table tbody td { padding: 14px 18px; border-top: 1px solid var(--border); vertical-align: top; }
.data-table tbody tr:first-child td { border-top: 0; }
.data-table tbody tr:hover td { background: var(--bg-2); }

/* Wrap a .data-table card in .table-scroll so narrow viewports get
   horizontal scroll instead of an overflowing layout. Combine with
   .cell-trunc on long-content cells so a single rogue bot-token-as-name
   value doesn't push every other column off-screen — the truncated
   content keeps its title attribute so hover still reveals the full
   string for admins. */
.table-scroll { overflow-x: auto; }
.cell-trunc {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sortable column headers — used inside .data-table th, link the
   header text to a URL that flips this column's sort direction. */
.th-sort {
  display: inline-flex; align-items: center; gap: 4px;
  color: inherit;
  text-decoration: none;
  user-select: none;
}
.th-sort:hover { color: var(--fg); }
.th-sort.is-active { color: var(--fg); }
.th-sort--right { float: right; }
.th-sort__icon {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 10px;
  font-size: 9px;
  color: var(--fg-2);
}
.th-sort.is-active .th-sort__icon { color: var(--brand, var(--fg)); }
.th-sort__icon--idle {
  opacity: 0.35;
  font-size: 10px;
}

/* ---- Empty state ------------------------------------------------------ */
.empty {
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 36px;
  text-align: center;
  background: var(--bg-2);
}
.empty-title { font-weight: 500; color: var(--fg); font-size: 15px; margin: 0 0 6px; }
.empty-sub { color: var(--fg-2); font-size: 14px; margin: 0 0 16px; }

/* ---- Flash / toast (unchanged behavior) -------------------------------- */
.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.flash {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid transparent;
  display: flex; align-items: start; gap: 10px;
}
.flash-success { background: var(--success-bg); border-color: #C9E6D4; color: var(--success-fg); }
.flash-error { background: var(--danger-bg); border-color: #F6D9D4; color: var(--danger); }

.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 40px);
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  border: 1px solid transparent;
  box-shadow: 0 8px 28px rgba(12, 49, 36, 0.16), 0 1px 0 rgba(12, 49, 36, 0.04);
  min-width: 280px;
  max-width: 380px;
  background: var(--surface);
  transform: translateX(20px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s ease;
}
.toast.toast-in { transform: translateX(0); opacity: 1; }
.toast.toast-out { transform: translateX(20px); opacity: 0; }
.toast-success { background: var(--success-bg); border-color: #C9E6D4; color: var(--success-fg); }
.toast-warning { background: var(--as-orange-50); border-color: #F5DDB4; color: #8A6315; }
.toast-error { background: var(--danger-bg); border-color: #F6D9D4; color: var(--danger); }
.toast-icon {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px;
  background: rgba(255, 255, 255, 0.55);
  margin-top: 1px;
}
.toast-text { flex: 1; word-break: break-word; }
.toast-close {
  flex-shrink: 0;
  background: transparent; border: 0;
  color: currentColor;
  opacity: 0.5;
  cursor: pointer;
  padding: 0 4px;
  font-size: 18px;
  line-height: 1;
  font-family: inherit;
  margin-top: -1px;
}
.toast-close:hover { opacity: 1; }

@media (max-width: 520px) {
  .toast-container { left: 16px; right: 16px; bottom: 16px; max-width: none; }
  .toast { min-width: 0; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .toast { transition: opacity 0.15s ease; transform: none; }
  .toast.toast-out { transform: none; }
}

/* Row highlight after add/edit/deactivate */
@keyframes as-row-pulse {
  0%   { background-color: rgba(18, 209, 107, 0.20); }
  60%  { background-color: rgba(18, 209, 107, 0.10); }
  100% { background-color: transparent; }
}
.row-highlight > td { animation: as-row-pulse 2.5s ease-out forwards; }
.row-highlight { animation: as-row-pulse 2.5s ease-out forwards; }
@media (prefers-reduced-motion: reduce) {
  .row-highlight > td, .row-highlight { animation: none; background-color: rgba(18, 209, 107, 0.10); }
}

/* ---- Icon helpers ------------------------------------------------------ */
.icon { display: inline-flex; align-items: center; justify-content: center; }
.icon svg { width: 100%; height: 100%; display: block; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */

@media (max-width: 1180px) {
  .bot-header-inner { padding: 18px 24px 0; }
  .tab-content, .page-wrap { padding-left: 24px; padding-right: 24px; }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 80px 1fr; }
  .sidebar { padding: 24px 12px; }
  .sidebar-brand { padding: 4px 4px 24px; justify-content: center; }
  .sidebar-brand .sub,
  .sidebar-brand .subbrand,
  .nav-link span:not(.nav-icon),
  .nav-item span:not(.nav-icon):not(.icon),
  .lang-select span:not(.nav-icon),
  .logout span:not(.nav-icon),
  .sidebar-foot form > label,
  .sidebar-foot .eyebrow,
  .sidebar-foot .lang-eyebrow { display: none; }
  .nav-link, .nav-item { justify-content: center; padding: 11px 0; }
  .nav-badge { display: none; }
  .sidebar-foot .lang-select { padding: 10px 0; justify-content: center; }
  .sidebar-foot .logout { justify-content: center; padding: 10px 0; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .topup-grid { grid-template-columns: repeat(3, 1fr); }
  .add-grid { grid-template-columns: 1fr 1fr; }
  .add-grid .field:nth-child(3) { grid-column: 1 / -1; }
  .add-actions { grid-column: 1 / -1; }
  .cred-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app-shell { grid-template-columns: 1fr; }
  .appbar { display: flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; width: 84%; max-width: 320px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.2,.7,.2,1);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    height: 100vh;
  }
  .sidebar.is-open { transform: none; }
}
@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}
@media (max-width: 720px) {
  .sidebar-brand { padding: 4px 12px 24px; justify-content: flex-start; }
  /* Match the negated-class specificity of the 980px hide-rules above so the
     mobile drawer re-shows label text. Without :not() the 980px rule wins. */
  .sidebar-brand .sub,
  .sidebar-brand .subbrand,
  .nav-link span:not(.nav-icon),
  .nav-item span:not(.nav-icon):not(.icon),
  .lang-select span:not(.nav-icon),
  .logout span:not(.nav-icon),
  .sidebar-foot form > label,
  .sidebar-foot .eyebrow { display: inline; }
  .sidebar-foot .lang-eyebrow { display: flex; }
  .sidebar-brand .sub,
  .sidebar-brand .subbrand { display: inline-flex; }
  .nav-link, .nav-item { justify-content: flex-start; padding: 12px 16px; }
  .nav-badge { display: inline-flex; }
  .sidebar-foot .lang-select { justify-content: space-between; padding: 10px 14px; }
  .sidebar-foot .logout { justify-content: flex-start; padding: 10px 16px; }

  .bot-header { top: 56px; }
  .bot-header-inner { padding: 14px 16px; }
  .bot-name { font-size: 22px; }
  .bot-avatar { width: 48px; height: 48px; font-size: 20px; flex: 0 0 48px; border-radius: 14px; }
  .bot-id-row { gap: 12px; flex-wrap: wrap; }
  .bot-actions { display: none; }
  .crumb { display: none; }
  .tabs { display: none; }

  .bottom-tabs { display: flex; }
  .app-main { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

  .tab-content, .page-wrap { padding: 20px 16px 80px; }
  .page-head { margin-bottom: 18px; }
  .page-title { font-size: 22px; }

  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-tile { padding: 14px 16px; }
  .stat-value { font-size: 22px; }

  .ai-head-row { gap: 12px; }
  .usage-grid { grid-template-columns: 1fr; }
  .topup-grid { grid-template-columns: 1fr; }

  .strip-card { padding: 16px !important; }

  .add-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .add-grid .field:nth-child(3),
  .add-actions { grid-column: 1 / -1; }
  .add-actions .btn { width: 100%; }

  .product-row {
    grid-template-columns: 44px 1fr auto;
    grid-template-areas: "img name price" "img fulfillment status" "actions actions actions";
    row-gap: 6px;
  }
  .product-row > .img-slot,
  .product-row > .avatar,
  .product-row > .img-slot-fallback,
  .product-row > .product-image { grid-area: img; }
  .product-row > .product-meta { grid-area: name; }
  .product-row > .product-fulfillment { grid-area: fulfillment; }
  .product-row > .product-price { grid-area: price; }
  .product-row > .product-status { grid-area: status; justify-content: flex-end; }
  .product-row > .product-actions { grid-area: actions; justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }

  .filter-grid { grid-template-columns: 1fr 1fr; }

  .orders-filterbar { gap: 8px; }
  .orders-filterbar .search { flex: 1; }
  .orders-filterbar .search-input { width: 100%; }

  /* Swap orders table for cards on mobile */
  .orders-table { display: none; }
  .orders-cards { display: block; }

  .share-row { flex-direction: column; gap: 16px; align-items: stretch; }
  .qr-tile { width: 100%; display: flex; justify-content: center; }

  .cmd-list--2col { grid-template-columns: 1fr; }
  .cmd-code { min-width: 100px; }
  .cmd-copy { opacity: 1; }

  .section-head { gap: 12px; }
  .section-action { width: 100%; }
  .section-action .btn { width: 100%; }

  .activity-row { grid-template-columns: 8px 1fr; }
  .activity-type { grid-column: 1 / -1; margin-top: 4px; }

  .botcard-grid { grid-template-columns: 1fr; }

  .filter-card { padding: 16px !important; }
  .rotate-block { gap: 12px; padding-top: 12px; margin-top: 12px; }
}

/* ── Customer Chats inbox (/app/stores/:botId/chats) ─────────────────
   Two-pane master/detail reader + stage quick-filter chips + recovery
   nudge chips. ≤720px collapses to single-pane master→detail driven by
   .has-selection (server adds it when a thread is open). */
.conv-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.conv-list { max-height: calc(100vh - 340px); overflow-y: auto; padding-right: 4px; }
.conv-back { display: none; margin-bottom: 12px; }
.conv-unread-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand); flex-shrink: 0;
}

.stage-chips {
  display: flex; gap: 7px; margin-bottom: 16px;
  flex-wrap: wrap; align-items: center;
  overflow-x: auto; scrollbar-width: none;
}
.stage-chips::-webkit-scrollbar { display: none; }
.stage-chip { text-decoration: none; cursor: pointer; font-weight: 500; }
/* Active filter chip: subtle ring in the chip's OWN stage color (the
   near-black --brand-strong ring read as broken — design note 2026-06). */
.stage-chip.is-active { font-weight: 600; box-shadow: inset 0 0 0 1.5px currentColor; }
.stage-chip-all {
  padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 500;
  text-decoration: none; flex: 0 0 auto;
  border: 1px solid var(--border); background: var(--surface); color: var(--fg-2);
}
.stage-chip-all.is-active { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }

.nudge-chip {
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 12.5px;
  border: 1px solid var(--border); background: var(--surface); color: var(--fg-2);
}
.nudge-chip.is-active { border-color: var(--brand); color: var(--brand-strong); }

@media (max-width: 720px) {
  .conv-layout { grid-template-columns: 1fr; }
  .conv-list { max-height: none; overflow: visible; padding-right: 0; }
  .stage-chips { flex-wrap: nowrap; }
  /* master→detail: list full-width until a thread opens, then reader
     full-width with the "All chats" back button. */
  .conv-layout .conv-reader { display: none; }
  .conv-layout.has-selection .conv-reader { display: block; }
  .conv-layout.has-selection .conv-list { display: none; }
  .conv-back { display: inline-flex; }
}

/* ============================================================
   Setup wizard (/app/setup) — focused shell + stepper.
   Ported from the design prototype's setup-wizard.css; built only on
   the dashboard.css tokens above so it maps 1:1. Mobile-first. The
   prototype-only state dock + dimmed-dashboard mock are omitted. */
.wz-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.wz-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: rgba(250,251,250,0.85); backdrop-filter: blur(12px) saturate(1.1); -webkit-backdrop-filter: blur(12px) saturate(1.1); border-bottom: 1px solid var(--border); }
.wz-topbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wz-topbar-brand img { height: 22px; display: block; }
.wz-topbar-sub { font-size: 13px; font-weight: 500; color: var(--fg-2); padding-left: 10px; border-left: 1px solid var(--border); }
.wz-main { flex: 1; width: 100%; }
.wz-stage { width: 100%; max-width: 600px; margin: 0 auto; padding: 22px 16px 120px; }
@media (min-width: 860px) { .wz-stage { padding: 40px 24px 120px; } }

.wz-intro { margin-bottom: 22px; }
.wz-eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; letter-spacing: 0.01em; color: var(--brand); margin-bottom: 12px; }
.wz-eyebrow .pill { padding: 3px 9px; font-size: 11px; }
.wz-title { margin: 0; font-size: 27px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; }
.wz-sub { margin: 10px 0 0; color: var(--fg-2); font-size: 15px; line-height: 1.5; max-width: 52ch; }
@media (min-width: 860px) { .wz-title { font-size: 32px; } }

.wz-identity { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.wz-identity-avatar { width: 46px; height: 46px; border-radius: 14px; flex: 0 0 46px; background: linear-gradient(135deg, var(--as-green-500), var(--as-green-700)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.wz-identity-main { min-width: 0; flex: 1; }
.wz-identity-name { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.wz-identity-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }

.wz-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 22px; }
@media (min-width: 860px) { .wz-card { padding: 26px; } }
.wz-card + .wz-card { margin-top: 14px; }
.wz-subcard { border: 1px solid var(--border); border-radius: 16px; padding: 18px; background: var(--surface); }
.wz-subcard + .wz-subcard { margin-top: 12px; }
.wz-subcard-head { display: flex; align-items: flex-start; gap: 12px; }
.wz-subcard-icon { width: 38px; height: 38px; border-radius: 11px; flex: 0 0 38px; background: var(--surface-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.wz-subcard-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.wz-subcard-body { font-size: 13px; color: var(--fg-2); line-height: 1.55; margin-top: 3px; }

.wz-actions { display: flex; align-items: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.wz-actions .btn-primary { flex: 1; min-width: 160px; }
.wz-actions-spread { justify-content: space-between; }
.wz-skipline { margin-top: 12px; font-size: 12px; color: var(--fg-2); line-height: 1.5; display: flex; gap: 8px; align-items: flex-start; }
@media (max-width: 560px) { .wz-actions .btn { width: 100%; } .wz-actions { flex-direction: column-reverse; align-items: stretch; } }

.wz-progress { margin-bottom: 26px; }
.wz-progress-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.wz-progress-step { font-size: 13px; font-weight: 600; color: var(--fg); letter-spacing: -0.01em; }
.wz-progress-name { font-size: 13px; color: var(--fg-2); }
.wz-progress-track { display: flex; gap: 5px; }
.wz-progress-seg { flex: 1; height: 5px; border-radius: 999px; background: var(--as-muted-200); transition: background .25s ease; }
.wz-progress-seg.is-done { background: var(--brand-accent); }
.wz-progress-seg.is-current { background: var(--brand); }
.wz-nodes { display: none; }
@media (min-width: 680px) {
  .wz-progress-label, .wz-progress-track { display: none; }
  .wz-nodes { display: flex; position: relative; }
  .wz-node { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; align-items: center; gap: 9px; background: transparent; border: 0; cursor: pointer; font-family: inherit; color: var(--fg-2); }
  .wz-node-line { position: absolute; top: 16px; right: 50%; width: 100%; height: 2px; background: var(--border-strong); z-index: 0; }
  .wz-node:first-child .wz-node-line { display: none; }
  .wz-node-dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1.5px solid var(--border-strong); color: var(--fg-2); font-size: 13px; font-weight: 600; transition: all .2s ease; }
  .wz-node-label { font-size: 12.5px; font-weight: 500; letter-spacing: -0.01em; text-align: center; line-height: 1.25; max-width: 12ch; }
  .wz-node.is-current .wz-node-line, .wz-node.is-done .wz-node-line { background: var(--brand); }
  .wz-node.is-done .wz-node-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
  .wz-node.is-done .wz-node-label { color: var(--fg); }
  .wz-node.is-current .wz-node-dot { border-color: var(--brand); color: var(--brand); background: var(--surface-soft); box-shadow: 0 0 0 4px rgba(0,152,89,.12); }
  .wz-node.is-current .wz-node-label { color: var(--fg); font-weight: 600; }
}

.wz-url-row { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--as-green-50); margin: 4px 0 2px; }
.wz-url-text { flex: 1; font-family: var(--font-mono); font-size: 13px; color: var(--fg); overflow-x: auto; white-space: nowrap; min-width: 0; scrollbar-width: none; }
.wz-url-text::-webkit-scrollbar { display: none; }

.wz-howto { counter-reset: wz; display: flex; flex-direction: column; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.wz-howto li { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; color: var(--fg); }
.wz-howto li::before { counter-increment: wz; content: counter(wz); flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; margin-top: -1px; }

.wz-finish-hero { text-align: center; padding: 4px 0 2px; }
.wz-finish-badge { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 18px; background: var(--success-bg); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.wz-recap { display: flex; flex-direction: column; gap: 2px; }
.wz-recap-row { display: flex; align-items: center; gap: 10px; padding: 11px 2px; font-size: 14px; border-top: 1px solid var(--border); }
.wz-recap-row:first-child { border-top: 0; }
.wz-recap-row .wz-recap-mark { width: 20px; height: 20px; border-radius: 50%; flex: 0 0 20px; display: flex; align-items: center; justify-content: center; }
.wz-recap-row.is-done .wz-recap-mark { background: var(--brand); color: #fff; }
.wz-recap-row.is-skipped .wz-recap-mark { background: var(--as-muted-100); color: var(--fg-2); }
.wz-recap-label { flex: 1; }
.wz-recap-row.is-skipped .wz-recap-label { color: var(--fg-2); }
.wz-share { display: flex; gap: 18px; align-items: center; }
@media (max-width: 560px) { .wz-share { flex-direction: column; align-items: stretch; } .wz-share .qr-tile { align-self: center; } }
.wz-btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
@media (max-width: 460px) { .wz-btn-grid { grid-template-columns: 1fr; } }
.wz-note { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; line-height: 1.5; color: var(--fg-2); margin-top: 12px; }
.wz-note.is-ok { color: var(--success-fg); }
.as-spin { display: inline-flex; animation: as-btn-spin 0.8s linear infinite; }

.wz-resume { background: linear-gradient(180deg, var(--as-green-75), var(--surface)); border: 1px solid var(--as-green-100); border-radius: 18px; padding: 20px 22px; display: flex; gap: 18px; align-items: center; }
.wz-resume-icon { width: 46px; height: 46px; border-radius: 14px; flex: 0 0 46px; background: linear-gradient(135deg, var(--as-green-500), var(--as-green-700)); color: #fff; display: flex; align-items: center; justify-content: center; }
.wz-resume-main { flex: 1; min-width: 0; }
.wz-resume-title { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.wz-resume-body { font-size: 13px; color: var(--fg-2); margin-top: 3px; line-height: 1.5; }
.wz-resume-track { display: flex; gap: 4px; margin-top: 10px; max-width: 280px; }
.wz-resume-seg { flex: 1; height: 5px; border-radius: 999px; background: var(--as-muted-200); }
.wz-resume-seg.is-done { background: var(--brand-accent); }
.wz-resume-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
@media (max-width: 640px) { .wz-resume { flex-direction: column; align-items: flex-start; gap: 14px; } .wz-resume-actions { width: 100%; } .wz-resume-actions .btn { flex: 1; } .wz-resume-icon { display: none; } }
