/* ─────────────────────────────────────────────────────────
   ATOMIC  ·  Components
   All values reference tokens; no raw px or hardcoded colors.
   ───────────────────────────────────────────────────────── */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
h1,h2,h3,h4,p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

body { background: var(--bg); }

/* Suppress all transitions during a theme swap so colors change instantly
   instead of getting stuck mid-interpolation when the tokens change. */
.theme-switching, .theme-switching *, .theme-switching *::before, .theme-switching *::after {
  transition: none !important;
}

.atomic {
  font-family: var(--ff);
  background: var(--canvas);
  color: var(--t1);
  width: 100%; height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizelegibility;
}

/* ── App shell ──
   Flex/height shell is only for dashboard layouts (sidebar + main).
   Public/auth pages render .app with no .sidebar and need normal document flow. */
.app:has(.sidebar) { display: flex; height: 100%; }

/* ────────────────── Sidebar ────────────────── */
.sidebar {
  position: relative;
  z-index: 20;
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--inset);
  border-right: 0.0625rem solid var(--line);
  display: flex;
  flex-direction: column;
  padding: var(--sp-10) var(--sp-7);
}

/* Fixed two-track grid: the mark never moves, only the name track collapses. */
.brand {
  display: grid;
  grid-template-columns: var(--brand-mark) minmax(0, 1fr);
  /* Mark is wider than a nav icon, so pull it left by half the difference:
     its center lands exactly on the nav icon column, and the gap is trimmed
     by the same amount so .brand-name lines up with .nav-label. */
  column-gap: calc(var(--sp-5) - ((var(--brand-mark) - var(--icon-md)) / 2));
  align-items: center;
  height: var(--brand-mark);
  padding: 0 calc(0.625rem - ((var(--brand-mark) - var(--icon-md)) / 2));
  margin: var(--sp-2) 0 var(--sp-10);
}

.brand-mark {
  width: var(--brand-mark); height: var(--brand-mark);
  border-radius: 0.5625rem;
  background: var(--ac);           /* was gradient - solid per rule */
  display: grid; place-items: center;
  font-weight: 700;
  font-size: var(--fs-xl);
  color: var(--ac-ink);
  flex: 0 0 var(--brand-mark);
}

.brand-name {
  font-weight: 700;
  font-size: var(--fs-xl);
  letter-spacing: -0.02em;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 0.125rem; }

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: var(--icon-md) minmax(0, 1fr);
  column-gap: var(--sp-5);
  align-items: center;
  padding: 0.625rem;
  border-radius: var(--r-md);
  color: var(--t2);
  font-size: var(--fs-base); font-weight: 500;
  text-decoration: none;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.nav-item svg { width: var(--icon-md); height: var(--icon-md); flex: 0 0 var(--icon-md); grid-column: 1; }
.nav-label {
  grid-column: 2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.nav-item:hover { background: var(--surface-2); color: var(--t1); }
.nav-item.active { background: var(--ac-soft); color: var(--ac-hi); box-shadow: var(--ring-top); font-weight: 600; }
.nav-item.active svg { color: var(--ac-hi); }
.nav-item.active::before {
  content: ""; position: absolute; right: -0.4375rem; top: 50%; transform: translateY(-50%);
  width: 0.1875rem; height: 1.125rem; border-radius: var(--r-pill);
  background: var(--ac);
}

/* ────────────────── Main ────────────────── */
.main { flex: 1 1 0%; min-width: 0; display: flex; flex-direction: column; }

/* ── Mode strip ── */
.mode-strip {
  display: flex; align-items: center; gap: var(--sp-5);
  background: var(--inset);
  border-bottom: 0.0625rem solid var(--line);
  padding: var(--sp-3) 1.75rem;
}

.mode-strip-label {
  font-size: var(--fs-2xs); font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--t3);
}

.mode-seg {
  display: inline-flex;
  background: var(--surface);
  border: 0.0625rem solid var(--line);
  border-radius: 0.5625rem;
  padding: 0.1875rem; gap: 0.125rem;
}
.mode-seg button {
  background: transparent; border: none;
  color: var(--t2); font-size: var(--fs-sm); font-weight: 600;
  padding: 0.375rem 0.8125rem; border-radius: 0.375rem;
  display: inline-flex; align-items: center; gap: 0.4375rem;
  cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast);
}
.mode-seg button svg { width: var(--icon-sm); height: var(--icon-sm); }
.mode-seg button.on { background: var(--ac-soft); color: var(--ac-hi); }

.mode-note { font-size: 0.75rem; color: var(--t3); }

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  border-bottom: 0.0625rem solid var(--line);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.75rem;
}

.store-switcher { position: relative; }

.store-switch {
  display: flex; align-items: center; gap: 0.625rem;
  background: var(--surface);
  border: 0.0625rem solid var(--line);
  border-radius: var(--r-md);
  padding: 0.4375rem 0.75rem;
  font-size: var(--fs-base); font-weight: 500;
  color: var(--t1);
  cursor: pointer;
  box-shadow: var(--shadow-sm), var(--ring-top);
  transition: border-color var(--dur-fast);
}
.store-switch:hover { border-color: var(--line-2); }
.store-switch[aria-expanded="true"] { border-color: var(--line-2); }
.store-switch[aria-expanded="true"] .icon-drop { transform: rotate(180deg); }
.store-switch .icon-drop { transition: transform var(--dur-fast); }
.store-switch-name { white-space: nowrap; }

.store-dot {
  width: var(--store-dot-s); height: var(--store-dot-s);
  border-radius: 0.375rem;
  background: var(--surface-3);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex: 0 0 var(--store-dot-s);
  display: grid; place-items: center;
  font-size: 0.6875rem; font-weight: 700; color: var(--t2); overflow: hidden;
}
.store-dot.store-dot-letter { color: var(--t2); }

.smi-logo {
  width: 2rem; height: 2rem; border-radius: var(--r-sm);
  flex: 0 0 2rem; overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ── Store switcher dropdown ── */
.store-menu {
  position: absolute; top: calc(100% + 0.5rem); left: 0;
  width: 18.5rem;
  background: var(--surface);
  border: 0.0625rem solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg), var(--ring-top);
  padding: 0.375rem;
  z-index: 60;
}
.store-menu[hidden] { display: none; }
.store-menu-head {
  font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--t3);
  padding: 0.375rem 0.625rem 0.5rem;
}
.store-menu-list { display: flex; flex-direction: column; gap: 0.125rem; }
.store-menu-item {
  display: flex; align-items: center; gap: 0.625rem;
  width: 100%; text-align: left;
  padding: 0.5rem;
  border: none; background: none; cursor: pointer;
  border-radius: var(--r-sm);
  color: var(--t1);
  transition: background var(--dur-fast);
}
.store-menu-item:hover { background: var(--surface-2); }
.store-menu-item.active { background: var(--surface-2); }
.smi-logo-letter {
  background: var(--surface-3);
  display: grid; place-items: center;
  font-size: var(--fs-base); font-weight: 700; color: var(--t2);
}
.smi-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.smi-name { font-size: var(--fs-sm); font-weight: 600; color: var(--t1); }
/* Meta line carries the store's own status; the check on the right says which
   store you're currently in. Two different facts, so they never displace one
   another. */
.smi-meta {
  display: flex; align-items: center; gap: 0.4375rem;
  font-size: var(--fs-2xs); color: var(--t3); font-variant-numeric: tabular-nums;
}
.smi-status { display: inline-flex; align-items: center; gap: 0.3125rem; font-weight: 600; }
.smi-dot {
  width: 0.375rem; height: 0.375rem; border-radius: 50%;
  background: var(--t3); flex: 0 0 auto;
}
.smi-status.is-active { color: var(--success); }
.smi-status.is-active .smi-dot { background: var(--success); }
.smi-current {
  padding: 0.0625rem 0.375rem;
  border-radius: var(--r-pill);
  background: var(--ac-soft); color: var(--t2);
  font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
}
.smi-check {
  width: var(--icon-sm); height: var(--icon-sm); color: var(--ac-hi);
  flex: 0 0 auto; opacity: 0;
}
.store-menu-item.active .smi-check { opacity: 1; }
/* Selected row gets an accent edge so it reads at a glance, not just by the tick */
.store-menu-item { position: relative; }
.store-menu-item.active::before {
  content: ""; position: absolute; left: 0; top: 0.4375rem; bottom: 0.4375rem;
  width: 0.1875rem; border-radius: var(--r-pill); background: var(--ac);
}
.store-menu-sep, .store-menu-new {
  margin-top: 0.375rem;
}
.store-menu-new {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5625rem 0.625rem;
  border-top: 0.0625rem solid var(--line);
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  font-size: var(--fs-sm); font-weight: 600; color: var(--t2);
  text-decoration: none;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.store-menu-new:hover { color: var(--ac-hi); }
.store-menu-new svg { width: var(--icon-sm); height: var(--icon-sm); }

.badge-status {
  font-size: var(--fs-2xs); font-weight: 700;
  color: var(--t3); background: var(--surface-2);
  padding: 0.125rem var(--sp-3);
  border-radius: 0.375rem; letter-spacing: 0.04em;
}

.icon-drop { width: var(--icon-sm); height: var(--icon-sm); color: var(--t3); }

.topbar-pill {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--surface);
  border: 0.0625rem solid var(--line);
  border-radius: var(--r-pill);
  padding: 0.4375rem 0.875rem;
  font-size: var(--fs-sm); color: var(--t2); font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm), var(--ring-top);
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
}
.topbar-pill:hover { border-color: var(--line-2); color: var(--t1); }
.topbar-pill svg { width: 0.9375rem; height: 0.9375rem; }
.topbar-pill--avatar { padding-left: 0.375rem; }

.avatar {
  width: var(--avatar); height: var(--avatar);
  border-radius: 50%;
  background: var(--ac);   /* solid - no gradient */
  display: grid; place-items: center;
  color: var(--ac-ink); font-weight: 700; font-size: var(--fs-sm);
  flex: 0 0 var(--avatar);
}

.save-chip {
  display: inline-flex; align-items: center; gap: 0.4375rem;
  font-size: var(--fs-sm); font-weight: 600; color: var(--t2);
  padding: 0.375rem 0.75rem;
  border-radius: var(--r-pill); border: 0.0625rem solid var(--line);
}
.save-chip .led {
  width: 0.4375rem; height: 0.4375rem;
  border-radius: 50%; background: var(--ac);
}

/* ── Scroll / wrap ── */
.set-scroll { flex: 1 1 0%; overflow: hidden auto; scroll-behavior: smooth; }
.set-scroll::-webkit-scrollbar { width: 0.625rem; }
.set-scroll::-webkit-scrollbar-thumb {
  background: var(--surface-3); border-radius: 0.375rem;
  border: 0.1875rem solid var(--bg);
}

.set-wrap { max-width: var(--content-max); margin: 0 auto; padding: 2.125rem 2.25rem 2.5rem; }

/* ── Head row ── */
.set-headrow {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-11); margin-bottom: var(--sp-15);
}

.page-titlerow { display: flex; align-items: center; gap: var(--sp-5); }
.page-title { font-size: 2.125rem; font-weight: 500; letter-spacing: -0.04em; }
.page-sub   { font-size: var(--fs-lg); color: var(--t2); margin-top: 0.5625rem; font-weight: 400; }

/* ── Lang column (replaces flex/col/gap inline style in headrow) ── */
.lang-col { display: flex; flex-direction: column; gap: 0.4375rem; align-items: flex-end; }

/* ── Eyebrow label ── */
.eyebrow {
  font-size: var(--fs-xs); font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--t3);
}

/* ── Language segment ── */
.lang-seg {
  display: inline-flex;
  background: var(--inset); border: 0.0625rem solid var(--line);
  border-radius: var(--r-md); padding: 0.1875rem; gap: 0.125rem;
}
.lang-seg button {
  border: none; background: transparent;
  color: var(--t2); font-size: var(--fs-sm); font-weight: 600;
  padding: 0.375rem 1rem; border-radius: 0.4375rem; cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.lang-seg button.on { background: var(--ac); color: var(--ac-ink); }

/* ── Language bar (create page) ── */
.lang-bar {
  display: flex; align-items: stretch; gap: 0.375rem;
}
.lang-manage { position: relative; }
.lang-manage-btn {
  display: flex; align-items: center; justify-content: center;
  width: 2.125rem; min-height: 2.125rem;
  border: 0.0625rem solid var(--line); background: var(--inset);
  border-radius: var(--r-md); color: var(--t2); cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.lang-manage-btn:hover { background: var(--surface); color: var(--t1); border-color: var(--line-hi, var(--line)); }
.lang-manage-btn[aria-expanded="true"] { background: var(--surface); color: var(--t1); border-color: var(--line-hi, var(--line)); }
.lang-manage-btn svg { width: 0.875rem; height: 0.875rem; }
.lang-manage-pop {
  position: absolute; top: calc(100% + 0.375rem); right: 0; z-index: 90;
  min-width: 12.5rem; max-height: 17rem; overflow-y: auto;
  padding: 0.375rem; background: var(--surface);
  border: 0.0625rem solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-md), var(--ring-top);
}
.lang-manage-title {
  font-size: var(--fs-xs); font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--t3);
  padding: 0.3125rem 0.5rem 0.4375rem;
}
.lang-manage-list {
  display: flex; flex-direction: column; gap: 0.125rem;
}
.lang-manage-chip {
  display: flex; align-items: center; gap: 0.625rem;
  width: 100%; padding: 0.5rem 0.5625rem;
  border: none; background: transparent;
  border-radius: 0.4375rem; cursor: pointer;
  font-family: inherit; text-align: left;
  transition: background var(--dur-fast), box-shadow var(--dur-fast);
}
.lang-manage-chip:hover { background: var(--inset); }
.lang-manage-chip.on {
  background: var(--ac-softer);
  box-shadow: inset 0 0 0 0.0625rem var(--ac-dim);
}
.lang-manage-code {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.04em;
  min-width: 1.75rem; text-align: center;
  padding: 0.1875rem 0.4375rem; border-radius: 0.3125rem;
  background: var(--inset); color: var(--t2);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.lang-manage-chip.on .lang-manage-code { background: var(--ac-soft); color: var(--ac-hi); }
.lang-manage-name {
  flex: 1; min-width: 0;
  font-size: var(--fs-sm); font-weight: 500; color: var(--t1);
}
.lang-manage-check {
  width: 1.125rem; height: 1.125rem; border-radius: 50%;
  flex: 0 0 1.125rem; border: 0.09375rem solid var(--line-2);
  display: grid; place-items: center; color: transparent;
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.lang-manage-chip.on .lang-manage-check {
  background: var(--ac); border-color: transparent; color: var(--ac-ink);
}
.lang-manage-check svg { width: 0.625rem; height: 0.625rem; }

/* ── Setup card ── */
.setup {
  position: relative;
  border-radius: var(--r-card);
  border: 0.0625rem solid var(--ac-soft);
  background: var(--surface);
  background-image:
    radial-gradient(120% 140% at 0% 0%, var(--ac-softer) 0%, transparent 42%),
    var(--panel-sheen);
  padding: var(--sp-10) var(--sp-11);
  margin-bottom: var(--sp-12);
  box-shadow: var(--shadow-md), var(--ring-top);
}

.setup-top { display: flex; align-items: center; gap: var(--sp-6); }

.setup-badge {
  display: inline-flex; align-items: center; gap: 0.4375rem;
  font-size: var(--fs-xs); font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.3125rem 0.6875rem; border-radius: var(--r-pill);
  background: var(--warn-soft); color: var(--warn);
  white-space: nowrap;
}
.setup-badge.draft { background: var(--surface-3); color: var(--t2); }
.setup-badge.attention { background: var(--danger-soft); color: var(--danger); }
.setup[hidden] { display: none !important; }
.setup.setup-fix {
  border-color: color-mix(in oklch, var(--danger) 32%, var(--line));
  background-image:
    radial-gradient(120% 140% at 0% 0%, var(--danger-soft) 0%, transparent 42%),
    var(--panel-sheen);
}

.setup-title { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.01em; }
.setup-sub   { font-size: var(--fs-sm); color: var(--t2); margin-top: 0.125rem; }

.setup-prog { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }

.setup-bar {
  width: 12.5rem; height: 0.5rem;
  border-radius: var(--r-pill);
  background: var(--inset); overflow: hidden;
}

.setup-bar-fill {
  display: block; height: 100%;
  background: var(--ac); border-radius: var(--r-pill);
  transition: width var(--dur-slow);
  width: var(--progress, 0%);
}

.setup-count { font-size: var(--fs-sm); font-weight: 700; color: var(--ac-hi); font-variant-numeric: tabular-nums; }

.setup-items { display: flex; flex-wrap: wrap; gap: 0.5625rem; margin-top: 1rem; }

.setup-chip {
  display: inline-flex; align-items: center; gap: 0.5625rem;
  background: var(--surface); border: 0.0625rem solid var(--line);
  border-radius: var(--r-md);
  padding: 0.5rem 0.6875rem 0.5rem 0.625rem;
  font-size: var(--fs-sm); font-weight: 600; color: var(--t1);
  cursor: pointer;
  box-shadow: var(--ring-top);
  transition: border-color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
}
.setup-chip:hover { border-color: var(--ac-dim); background: var(--surface-2); transform: translateY(-0.0625rem); box-shadow: var(--raise), var(--ring-top); }

.sc-ic {
  width: 1.125rem; height: 1.125rem;
  border-radius: 50%; flex: 0 0 1.125rem;
  display: grid; place-items: center;
}
.sc-ic.req { background: var(--danger); color: #fff; }
.sc-ic.con { background: var(--warn-soft); color: var(--warn); }
.sc-ic svg { width: 0.6875rem; height: 0.6875rem; }

.setup-chip .arrow { color: var(--t3); }
.setup-chip .arrow svg { width: 0.8125rem; height: 0.8125rem; }

/* ── Settings layout ── */
.set-layout { display: grid; grid-template-columns: var(--rail-w) 1fr; gap: var(--rail-gap); align-items: start; }
.set-layout[hidden] { display: none; }

/* ── Rail nav ── */
.rail { position: sticky; top: 0; }
.rail-group { margin-bottom: 0.875rem; }

.rail-glabel {
  font-size: var(--fs-2xs); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--t3); padding: 0 0.75rem 0.375rem;
}

.rail-item {
  position: relative;
  display: flex; align-items: center; gap: 0.6875rem;
  padding: 0.5625rem 0.75rem; border-radius: 0.5625rem;
  font-size: var(--fs-base); font-weight: 500; color: var(--t2);
  cursor: pointer; border: none; background: transparent;
  width: 100%; text-align: left;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.rail-item:hover  { background: var(--surface-2); color: var(--t1); }
.rail-item.active { background: var(--surface-2); color: var(--t1); font-weight: 600; box-shadow: var(--ring-top); }
.rail-item.active::before {
  content: ""; position: absolute; left: -0.4375rem; top: 50%; transform: translateY(-50%);
  width: 0.1875rem; height: 1.0625rem; border-radius: var(--r-pill);
  background: var(--ac);
}

.rail-tick {
  width: 1.125rem; height: 1.125rem;
  border-radius: 50%; flex: 0 0 1.125rem;
  display: grid; place-items: center;
}
.rail-tick svg   { width: 0.6875rem; height: 0.6875rem; }
.rail-tick.done  { background: var(--ac); color: var(--ac-ink); }
.rail-tick.todo  { border: 0.09375rem solid var(--line-2); }
.rail-tick.opt   { border: 0.09375rem dashed var(--line-2); }
.rail-tick.fail  { background: var(--danger); color: #fff; }
/* Danger-zone tick (was inline border style) */
.rail-tick.danger-tick { border: 0.09375rem solid color-mix(in oklch, var(--danger) 50%, transparent); }

.rail-badge {
  margin-left: auto;
  min-width: 1.1875rem; height: 1.1875rem; padding: 0 0.3125rem;
  border-radius: 0.625rem;
  background: var(--danger); color: #fff;
  font-size: var(--fs-2xs); font-weight: 700;
  display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}

.rail-opt { margin-left: auto; font-size: 0.65625rem; color: var(--t3); font-weight: 600; }

.rail-danger { color: var(--danger); }
.rail-danger:hover { background: var(--danger-soft); color: var(--danger); }

/* Replaces inline height/bg/margin on the rail divider div */
.rail-divider { height: 0.0625rem; background: var(--line); margin: 0.375rem 0.75rem 0.625rem; }

/* ── Sections ── */
.set-section { scroll-margin-top: 1rem; }
.set-section + .set-section { margin-top: 2.75rem; }

.section-head { display: flex; align-items: center; gap: 0.8125rem; margin-bottom: 1rem; }
.section-head .panel-ic {
  width: var(--box-lg); height: var(--box-lg); flex: 0 0 var(--box-lg);
  color: var(--ac-hi); background: var(--ac-soft);
  border: 0.0625rem solid var(--ac-soft); box-shadow: var(--ring-top);
}

.section-title { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -0.025em; }
.section-desc  { font-size: var(--fs-sm); color: var(--t2); margin-top: 0.125rem; }

/* ── Panel ── */
.panel {
  position: relative;
  background: var(--surface);
  background-image: var(--panel-sheen);
  border: 0.0625rem solid var(--line);
  border-radius: var(--r-card); padding: var(--sp-15) var(--sp-16);
  box-shadow: var(--shadow-md), var(--ring-top);
}
.panel + .panel { margin-top: var(--sp-9); }

.panel-ic {
  width: var(--box); height: var(--box);
  border-radius: var(--r-md);
  background: var(--surface-2); display: grid; place-items: center;
  color: var(--t2); flex: 0 0 var(--box);
}
.panel-ic svg { width: var(--icon-lg); height: var(--icon-lg); }

/* ── Grid 2-col ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-10); }

/* ── Field ── */
.field { display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-10); }
.field:last-child { margin-bottom: 0; }

.field-label {
  font-size: var(--fs-sm); font-weight: 600; color: var(--t1);
  display: flex; align-items: center; justify-content: space-between;
}

/* Replaces the inline-flex span inside every field-label */
.label-inner { display: inline-flex; align-items: center; gap: var(--sp-2); }

.req      { color: var(--ac); }
.lang-tag {
  font-size: 0.65625rem; font-weight: 600;
  color: var(--t3); background: var(--surface-2);
  padding: 0.0625rem 0.375rem; border-radius: var(--r-tag); letter-spacing: 0.04em;
}
.field-hint { font-size: var(--fs-sm); color: var(--t3); }

/* ── Inputs ── */
.input, .select, .textarea {
  width: 100%; background: var(--inset);
  border: 0.0625rem solid var(--line); border-radius: var(--r-fld);
  padding: 0.75rem 0.875rem; font-size: var(--fs-md); color: var(--t1);
  box-shadow: var(--well-inset);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--t3); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--ac-dim);
  box-shadow: var(--well-inset), 0 0 0 0.1875rem var(--ac-softer);
}
.textarea { resize: none; min-height: 5.5rem; line-height: 1.5; }
.select {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.875rem center;
  padding-right: 2.375rem;
}
.input.mono, .textarea.mono { font-family: var(--mono); font-size: var(--fs-sm); }
.input.err, .select.err, .textarea.err {
  border-color: var(--danger);
  background: var(--danger-soft);
  box-shadow: var(--well-inset), 0 0 0 0.1875rem var(--danger-soft);
}
.input-affix.err {
  border-color: var(--danger);
  background: var(--danger-soft);
  box-shadow: var(--well-inset), 0 0 0 0.1875rem var(--danger-soft);
}

/* ── Input with affix (prefix text) ── */
.input-affix {
  display: flex; align-items: stretch;
  background: var(--inset); border: 0.0625rem solid var(--line);
  border-radius: var(--r-fld); overflow: hidden;
  box-shadow: var(--well-inset);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  min-height: 2.75rem;
}
.input-affix:focus-within { border-color: var(--ac-dim); box-shadow: var(--well-inset), 0 0 0 0.1875rem var(--ac-softer); }
.input-affix .pre {
  display: flex; align-items: center; flex: 0 0 auto;
  padding: 0 0.25rem 0 0.875rem;
  color: var(--t3); font-size: var(--fs-md); line-height: 1;
}
.input-affix input {
  flex: 1 1 0%; background: transparent; border: none; outline: none;
  padding: 0 0.875rem 0 0.375rem;
  color: var(--t1); font-size: var(--fs-md); font-family: inherit;
  line-height: 1.25; min-height: 2.75rem;
  -moz-appearance: textfield; appearance: textfield;
}
.input-affix input[type="number"]::-webkit-outer-spin-button,
.input-affix input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-3);
  padding: 0.6875rem 1.125rem; border-radius: var(--r-fld); text-decoration: none;
  font-size: var(--fs-base); font-weight: 600;
  border: 0.0625rem solid transparent;
  transition: background var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast), transform 0.04s;
  white-space: nowrap; cursor: pointer; font-family: inherit;
}
.btn:active { transform: translateY(0.0625rem); }
.btn svg    { width: 1rem; height: 1rem; }
.btn-primary { background-color: var(--ac); background-image: var(--btn-sheen), var(--ac-gradient); color: var(--ac-ink); box-shadow: var(--ac-glow), var(--ring-top); }
.btn-primary:hover { box-shadow: var(--ac-glow), var(--ring-top), 0 0 0 0.0625rem color-mix(in oklch, var(--ac-hi) 45%, transparent); filter: brightness(1.06); }
.btn:disabled, .btn-primary:disabled {
  opacity: 0.45; cursor: not-allowed; filter: none; box-shadow: none;
  pointer-events: none;
}
.btn-ghost { background: var(--surface-2); color: var(--t1); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in oklch, var(--danger) 45%, transparent); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 0.5rem 0.8125rem; font-size: var(--fs-sm); }

/* ── Toggle ── */
.toggle {
  width: var(--toggle-w); height: var(--toggle-h);
  border-radius: var(--r-pill); background: var(--surface-3);
  position: relative; flex: 0 0 var(--toggle-w);
  transition: background var(--dur-med); border: 0.0625rem solid var(--line);
  display: block;
}
.toggle::after {
  content: ""; position: absolute;
  top: 0.125rem; left: 0.125rem;
  width: var(--toggle-knob); height: var(--toggle-knob);
  border-radius: 50%; background: var(--t2);
  transition: transform var(--dur-med), background var(--dur-med);
}
.toggle.on { background: var(--ac); border-color: transparent; }
.toggle.on::after { transform: translateX(1.125rem); background: var(--ac-ink); }

/* ── Switch row ── */
.switch-row { display: flex; align-items: center; gap: 1rem; padding: 1rem 0; }
.switch-row + .switch-row { border-top: 0.0625rem solid var(--line); }
.switch-row .meta { flex: 1 1 0%; }
.switch-row .meta .t { font-size: var(--fs-md); font-weight: 600; }
.switch-row .meta .d { font-size: var(--fs-sm); color: var(--t2); margin-top: 0.125rem; }

/* ── Pill ── */
.pill { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.6875rem 0.25rem 0.5625rem; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; }
.pill .led { width: 0.4375rem; height: 0.4375rem; border-radius: 50%; }
/* "ok" always means active/healthy - green everywhere: stores, products,
   coupons, categories, connection checks. */
.pill-ok   { background: var(--success-soft); color: var(--success); }
.pill-ok   .led { background: var(--success); }
.pill-warn { background: var(--warn-soft);   color: var(--warn);  }
.pill-warn .led { background: var(--warn);    }
.pill-off  { background: var(--surface-2);   color: var(--t3);    }
.pill-off  .led { background: var(--t3);      }
.pill-fail { background: var(--danger-soft); color: var(--danger); }
.pill-fail .led { background: var(--danger); }

/* ── Hint tooltip ── */
.hint { position: relative; display: inline-flex; }
.hint-btn {
  width: 1rem; height: 1rem; border-radius: 50%;
  border: none; background: var(--surface-3); color: var(--t2);
  display: grid; place-items: center; cursor: help; padding: 0; flex: 0 0 1rem;
}
.hint-btn svg { width: var(--icon-xs); height: var(--icon-xs); }
.hint-btn:hover { background: var(--ac-soft); color: var(--ac-hi); }

.hint-pop {
  position: absolute; bottom: calc(100% + 0.5625rem); left: 50%;
  transform: translateX(-50%) translateY(0.25rem);
  width: 14.5rem;
  background: var(--surface-3); color: var(--t1);
  border: 0.0625rem solid var(--line-2); border-radius: var(--r-md);
  padding: 0.6875rem 0.8125rem; font-size: var(--fs-sm); font-weight: 500; line-height: 1.5;
  box-shadow: 0 0.75rem 2.125rem rgba(0,0,0,0.45);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--dur-fast), transform var(--dur-fast);
  z-index: 60; text-transform: none; letter-spacing: 0;
}
.hint-pop::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 0.375rem solid transparent; border-top-color: var(--surface-3);
}
.hint:hover .hint-pop,
.hint:focus-within .hint-pop { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ── Multi-language chip ── */
.ml-chip {
  display: inline-flex; align-items: center; gap: 0.375rem;
  border: 0.0625rem solid var(--line); background: var(--surface-2);
  border-radius: var(--r-pill); padding: 0.1875rem 0.625rem 0.1875rem 0.5rem;
  font-size: 0.6875rem; font-weight: 700; color: var(--t2);
  cursor: pointer; letter-spacing: 0.02em;
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.ml-chip:hover { border-color: var(--ac-dim); color: var(--t1); }
.ml-chip svg   { width: 0.8125rem; height: 0.8125rem; }
.ml-chip .wd   { width: 0.375rem; height: 0.375rem; border-radius: 50%; background: var(--warn); }

/* ── How-to link ── */
.howto-link {
  display: inline-flex; align-items: center; gap: 0.3125rem;
  background: none; border: none; color: var(--ac-hi);
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
  padding: 0; font-family: inherit;
}
.howto-link svg { width: 0.875rem; height: 0.875rem; }
.howto-link:hover { text-decoration: underline; }

/* ── Divider & HR label ── */
.divider { height: 0.0625rem; background: var(--line); margin: var(--sp-11) 0; }
.hr-label { display: flex; align-items: center; gap: 0.875rem; margin: var(--sp-12) 0 var(--sp-8); }
.hr-label::after { content: ""; flex: 1 1 0%; height: 0.0625rem; background: var(--line); }
.hr-label span { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t3); }

/* ── Callout ── */
.callout {
  display: flex; gap: 0.75rem;
  background: var(--ac-softer); border: 0.0625rem solid var(--ac-soft);
  border-radius: var(--r-lg); padding: 0.875rem 1rem;
  font-size: var(--fs-sm); color: var(--t2); line-height: 1.55;
}
.callout svg { width: 1.0625rem; height: 1.0625rem; flex: 0 0 1.0625rem; color: var(--ac-hi); margin-top: 0.125rem; }
.callout b   { color: var(--t1); font-weight: 600; }

/* ── Stats ── */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.875rem; }
.stat { background: var(--inset); border: 0.0625rem solid var(--line); border-radius: 0.8125rem; padding: 1rem 1.125rem; box-shadow: var(--well-inset); }
.stat .sv { font-size: 1.625rem; font-weight: 700; letter-spacing: -0.03em; }
.stat .sl { font-size: var(--fs-sm); color: var(--t2); margin-top: 0.125rem; }

/* ── Pick grid (delivery methods) ── */
.pick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.625rem; }
.pick {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.8125rem 0.875rem; border: 0.0625rem solid var(--line);
  border-radius: var(--r-lg); background: var(--inset);
  cursor: pointer; text-align: left; font-family: inherit;
  transition: border-color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
}
.pick:hover { border-color: var(--line-2); transform: translateY(-0.0625rem); box-shadow: var(--raise); }
.pick.on    { border-color: var(--ac-dim); background: var(--ac-softer); box-shadow: var(--ring-top); }

.pick-ic {
  width: var(--box-lg); height: var(--box-lg); border-radius: 0.5625rem;
  flex: 0 0 var(--box-lg); display: grid; place-items: center;
  background: var(--surface-2); color: var(--t1);
}
.pick.on .pick-ic { background: var(--ac-soft); color: var(--ac-hi); }
.pick-ic svg { width: var(--icon-xl); height: var(--icon-xl); }

.pick-meta       { flex: 1 1 0%; min-width: 0; }
.pick-meta .pt   { font-size: var(--fs-base); font-weight: 600; }
.pick-meta .pd   { font-size: 0.75rem; color: var(--t2); margin-top: 0.0625rem; }

.pick-check {
  width: 1.25rem; height: 1.25rem; border-radius: 50%;
  flex: 0 0 1.25rem; border: 0.09375rem solid var(--line-2);
  display: grid; place-items: center;
}
.pick.on .pick-check { background: var(--ac); border-color: transparent; color: var(--ac-ink); }
.pick-check svg { display: none; width: 0.75rem; height: 0.75rem; }
.pick.on .pick-check svg { display: block; }

/* ── Social icon ── */
.social-ic {
  width: var(--box-md); height: var(--box-md); border-radius: 0.5625rem;
  flex: 0 0 var(--box-md); display: grid; place-items: center;
  background: var(--surface-2); color: var(--t2);
}
.social-ic svg    { width: var(--icon-lg); height: var(--icon-lg); }
.social-ic.active { background: var(--ac-soft); color: var(--ac-hi); }

/* ── Delivery price rows (replaces inline flex style in shipping) ── */
.price-rows { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.625rem; }
.price-row  { display: flex; align-items: center; gap: 0.75rem; }
.price-label { flex: 1 1 0%; font-size: var(--fs-base); font-weight: 600; }

/* ── Working hours ──
   Named grid so the day, switch, times, and copy action never drift.
   The list is a container: one line when the panel is wide enough for two
   native time fields; two aligned lines when it is not. */
.wh-list {
  container-type: inline-size;
  container-name: hours;
}
.wh-row {
  display: grid;
  grid-template-columns: 7.25rem 6.75rem minmax(0, 1fr) auto;
  grid-template-areas: "day switch times copy";
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.5rem;
  padding: 0.75rem 0;
}
.wh-row > [data-wh-closed] { display: none; }
.wh-row + .wh-row { border-top: 0.0625rem solid var(--line); }

.wh-day {
  grid-area: day;
  font-size: var(--fs-base); font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wh-switch, .wh-switch.btn-reset {
  grid-area: switch;
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: transparent; border: none; padding: 0; cursor: pointer;
  justify-self: start;
  width: auto;
  min-width: 0;
}
.wh-state {
  font-size: var(--fs-sm); font-weight: 600; color: var(--ac-hi);
  transition: color var(--dur-fast);
  min-width: 3.25rem;
}
.wh-row.closed .wh-state { color: var(--t3); }

.wh-times {
  grid-area: times;
  display: flex; align-items: center; gap: 0.5rem;
  min-width: 0;
}
.wh-times .input {
  width: 7.75rem; max-width: 100%;
  flex: 0 1 7.75rem;
  padding: 0.5rem 0.625rem;
}
.wh-time::-webkit-calendar-picker-indicator { filter: invert(0.5); cursor: pointer; }
.wh-sep { color: var(--t3); font-size: var(--fs-sm); flex: 0 0 auto; }
.wh-dur {
  font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.04em;
  color: var(--t3);
  background: var(--surface-2); border-radius: var(--r-pill);
  padding: 0.1875rem 0.5rem;
  flex: 0 0 auto;
  white-space: nowrap;
}
.wh-row.closed .wh-times { opacity: 0.4; pointer-events: none; }
.wh-row.closed .wh-dur   { visibility: hidden; }

.wh-copy {
  grid-area: copy;
  display: inline-flex; align-items: center; gap: 0.375rem;
  justify-self: end;
  padding: 0.375rem 0.625rem;
  border-radius: var(--r-sm);
  border: 0.0625rem solid var(--line);
  background: var(--surface-2);
  color: var(--t2);
  font-size: var(--fs-2xs); font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.wh-copy svg { width: var(--icon-sm); height: var(--icon-sm); }
.wh-copy:hover { background: var(--surface-3); border-color: var(--line-2); color: var(--t1); }

/* Keep a single row in the settings column: drop the copy label before wrapping. */
@container hours (max-width: 40rem) {
  .wh-row { grid-template-columns: 6.75rem 6.75rem minmax(0, 1fr) auto; }
  .wh-copy span { display: none; }
  .wh-copy { padding: 0.375rem; }
  .wh-times .input { width: 7.25rem; flex-basis: 7.25rem; }
}
@container hours (max-width: 28rem) {
  .wh-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "day switch"
      "times copy";
  }
  .wh-switch { justify-self: end; }
  .wh-copy { justify-self: start; }
  .wh-copy span { display: inline; }
  .wh-copy { padding: 0.375rem 0.625rem; }
}
@container hours (max-width: 22rem) {
  .wh-row {
    grid-template-areas:
      "day switch"
      "times times"
      "copy copy";
  }
}

/* ── Repeater card ── */
.rep-card { border: 0.0625rem solid var(--line); border-radius: 0.8125rem; padding: 1rem 1.125rem; background: var(--inset); }
.rep-card + .rep-card { margin-top: 0.75rem; }
.rep-head { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 0.875rem; }
.rep-head .rt { font-size: var(--fs-base); font-weight: 600; flex: 1 1 0%; }
.rep-del {
  width: 1.875rem; height: 1.875rem; border-radius: var(--r-sm);
  border: 0.0625rem solid var(--line); background: transparent;
  color: var(--t3); display: grid; place-items: center; cursor: pointer;
}
.rep-del:hover { color: var(--danger); border-color: color-mix(in oklch, var(--danger) 40%, transparent); }
.rep-del svg { width: 0.9375rem; height: 0.9375rem; }

/* ── Add row ── */
.add-row {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  margin-top: 0.875rem; color: var(--ac-hi);
  font-size: var(--fs-sm); font-weight: 600;
  cursor: pointer; background: transparent; border: none;
  padding: 0.375rem 0.25rem; font-family: inherit;
}
.add-row svg { width: 1rem; height: 1rem; }

/* ── Connection row ── */
.conn-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
/* keep the test/connect button intact and let the status pill shrink so they
   always fit; the button wraps to its own line rather than overflowing */
.conn-row > .btn, .conn-bar > .btn { flex: 0 0 auto; white-space: nowrap; }
.conn-row > .pill, .conn-bar > .pill { min-width: 0; }

/* ── Copy row (replaces inline flex gap-3 in miniapp) ── */
.copy-row { display: flex; gap: var(--sp-3); }

/* ── Sticky actions ── */
.sticky-actions { position: sticky; bottom: 0; display: flex; align-items: center; gap: 0.75rem; padding: var(--sp-8) 0 0; }

/* ── Color swatch row (branding) ── */
.swatch-row { display: flex; align-items: center; gap: 0.625rem; }
.swatch { width: 1.875rem; height: 1.875rem; border-radius: var(--sp-3); position: relative; cursor: pointer; }
.swatch.sel { box-shadow: 0 0 0 0.125rem var(--bg), 0 0 0 0.25rem var(--t1); }
.swatch-current { width: 2.75rem; height: 1.875rem; border-radius: var(--sp-3); border: 0.0625rem solid var(--line-2); }

/* ── Logo upload zone ── */
.logo-zone {
  border: 0.09375rem dashed var(--line-2);
  border-radius: var(--r-md); padding: var(--sp-9) var(--sp-7);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  gap: var(--sp-3); cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast);
  text-align: center;
}
.logo-zone:hover { border-color: var(--ac-dim); background: var(--ac-softer); }
.logo-zone .lz-hint { font-size: var(--fs-sm); color: var(--t3); }

/* ── Social row ── */
.social-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.6875rem 0; }
.social-row + .social-row { border-top: 0.0625rem solid var(--line); }
.social-row.on .social-ic { background: var(--ac-soft); color: var(--ac-hi); }
.social-name { width: 6rem; flex: 0 0 6rem; font-size: var(--fs-base); font-weight: 600; }

/* ── Danger zone section ── */
.danger-block {
  display: flex; align-items: center; gap: var(--sp-9);
  padding: var(--sp-9) 0;
}
.danger-block + .danger-block { border-top: 0.0625rem solid var(--line); }
.danger-block .meta { flex: 1 1 0%; }
.danger-block .meta .t { font-size: var(--fs-md); font-weight: 600; }
.danger-block .meta .d { font-size: var(--fs-sm); color: var(--t2); margin-top: 0.125rem; }

/* ── Swatch color presets (branding) - no inline style needed ── */
.swatch-green  { background: oklch(0.73 0.138 169); }
.swatch-blue   { background: oklch(0.55 0.16  240); }
.swatch-amber  { background: oklch(0.75 0.15   55); }
.swatch-purple { background: oklch(0.55 0.16  300); }
.swatch-red    { background: oklch(0.66 0.18   22); }
.swatch-teal   { background: oklch(0.72 0.13  190); }
.swatch-indigo { background: oklch(0.52 0.17  270); }
.swatch-pink   { background: oklch(0.66 0.17  350); }
.swatch-lime   { background: oklch(0.78 0.16  130); }

/* ── Logo zone icon ── */
.logo-zone-icon { width: var(--sp-11); height: var(--sp-11); color: var(--t3); }

/* ── Modal overlay ── */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(8,10,14,0.62);
  backdrop-filter: blur(0.375rem);
  display: grid; place-items: center;
  z-index: 200; padding: var(--sp-11);
}
.modal-back[hidden] { display: none !important; }

.modal {
  width: 100%; max-width: 31.25rem;
  background: var(--surface);
  border: 0.0625rem solid var(--line-2);
  border-radius: var(--r-card);
  box-shadow: 0 1.875rem 5rem rgba(0,0,0,0.55);
  overflow: hidden;
  animation: modal-in var(--dur-fast) ease;
}
.modal-lg { max-width: 35rem; }
.modal-od { max-width: 42rem; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(0.5rem) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.modal-head {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: var(--sp-10) var(--sp-11) var(--sp-1);
}
.modal-head .mic {
  width: var(--box-lg); height: var(--box-lg);
  border-radius: var(--r-md);
  background: var(--ac-softer); color: var(--ac-hi);
  display: grid; place-items: center;
  flex: 0 0 var(--box-lg);
}
.modal-head .mic svg { width: 1.25rem; height: 1.25rem; }
.modal-head .mt { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.01em; }
.modal-head .md { font-size: var(--fs-sm); color: var(--t2); margin-top: 0.1875rem; line-height: 1.45; }

.modal-x {
  margin-left: auto;
  width: 1.875rem; height: 1.875rem;
  border-radius: var(--r-sm); border: none;
  background: var(--surface-2); color: var(--t2);
  display: grid; place-items: center; cursor: pointer;
  flex: 0 0 1.875rem;
}
.modal-x:hover { background: var(--surface-3); color: var(--t1); }
.modal-x svg { width: 0.9375rem; height: 0.9375rem; }

.modal-body {
  padding: var(--sp-7) var(--sp-11) var(--sp-1);
  display: flex; flex-direction: column; gap: 1rem;
  max-height: 56vh; overflow-y: auto;
}

.modal-foot {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 1rem var(--sp-11);
  border-top: 0.0625rem solid var(--line);
  margin-top: 0.875rem;
}

/* ── Lang rows inside modal ── */
.lang-rowlabel {
  display: flex; align-items: center; gap: var(--sp-3);
  font-size: var(--fs-sm); font-weight: 700; color: var(--t2);
  margin-bottom: var(--sp-3);
}
.lang-code {
  width: 1.625rem; height: 1.125rem;
  border-radius: 0.25rem;
  display: grid; place-items: center;
  font-size: 0.625rem; font-weight: 800;
  background: var(--surface-3); color: var(--t1);
  letter-spacing: 0.03em;
}
.lang-done  { font-size: var(--fs-2xs); font-weight: 600; color: var(--ac-hi); }
.lang-empty { font-size: var(--fs-2xs); font-weight: 600; color: var(--warn); }

/* ── Steps (howto modal) ── */
.steps { display: flex; flex-direction: column; }
.step  { display: flex; gap: 0.875rem; padding-bottom: 1.375rem; position: relative; }
.step:not(:last-child)::before {
  content: ""; position: absolute;
  left: 0.8125rem; top: 1.75rem; bottom: 0;
  width: 0.125rem; background: var(--line);
}
.step-n {
  width: 1.75rem; height: 1.75rem;
  border-radius: 50%; flex: 0 0 1.75rem;
  background: var(--ac-soft); color: var(--ac-hi);
  display: grid; place-items: center;
  font-size: var(--fs-sm); font-weight: 700; z-index: 1;
}
.step-b         { flex: 1 1 0%; padding-top: 0.125rem; }
.step-b .st     { font-size: var(--fs-md); font-weight: 600; margin-bottom: 0.25rem; }
.step-b .sd     { font-size: var(--fs-sm); color: var(--t2); line-height: 1.55; }
.step-b .sd b   { color: var(--t1); font-weight: 600; }

/* ── Inline command block ── */
.cmd {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  font-family: var(--mono); font-size: var(--fs-sm);
  background: var(--inset); border: 0.0625rem solid var(--line);
  color: var(--ac-hi); padding: 0.3125rem 0.625rem;
  border-radius: 0.4375rem; margin-top: var(--sp-3);
}

/* ── Animations ── */
@keyframes spin { 100% { transform: rotate(360deg); } }
.spin { animation: spin 0.9s linear infinite; transform-origin: center; }
.spin svg, svg.spin { transform-origin: center; }

/* ── Verifying pill ── */
.pill-verify { background: var(--warn-soft); color: var(--warn); }
.pill-verify svg { width: 0.875rem; height: 0.875rem; }

/* ── Draft "Saving…" chip ── */
.save-chip.saving { color: var(--warn); }
.save-chip.saving .led { background: var(--warn); animation: pulse 0.9s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── Required field error ── */
.field-err {
  display: flex; align-items: center; gap: 0.375rem;
  margin-top: var(--sp-3);
  font-size: var(--fs-sm); font-weight: 600; color: var(--danger);
}
.field-err svg { width: 0.9375rem; height: 0.9375rem; flex: 0 0 0.9375rem; }

/* ── Setup banner: ready state ── */
.setup.ready { border-color: color-mix(in oklch, var(--ac) 35%, var(--line)); }
.setup-badge.ready-badge { background: var(--ac-soft); color: var(--ac-hi); }
.setup-badge.ready-badge svg { width: 0.8125rem; height: 0.8125rem; }

/* ── Copy chip inside command block ── */
.cmd .cp {
  display: inline-grid; place-items: center;
  width: 1.25rem; height: 1.25rem; margin-left: 0.125rem;
  border-radius: 0.3125rem; cursor: pointer; color: var(--t3);
}
.cmd .cp:hover { background: var(--surface-3); color: var(--ac-hi); }
.cmd .cp svg { width: 0.8125rem; height: 0.8125rem; }

/* ── Modal foot note ── */
.modal-foot-note { font-size: var(--fs-sm); color: var(--t3); }

/* ── Toast ── */
.toast {
  position: fixed; left: 50%; bottom: 1.75rem;
  transform: translate(-50%, 1.5rem);
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6875rem 1.125rem;
  background: var(--surface); color: var(--t1);
  border: 0.0625rem solid var(--line); border-radius: var(--r-pill);
  box-shadow: 0 0.75rem 2rem rgba(8,10,14,0.28);
  font-size: var(--fs-base); font-weight: 600;
  opacity: 0; pointer-events: none; z-index: 300;
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .tic {
  display: inline-grid; place-items: center;
  width: 1.25rem; height: 1.25rem; border-radius: 50%;
  background: var(--ac); color: var(--ac-ink);
}
.toast .tic svg { width: 0.8125rem; height: 0.8125rem; }

/* ── Store type chooser ── */
[hidden] { display: none !important; }

.set-headrow { margin-bottom: var(--sp-8); }

.storetype {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: var(--sp-4) var(--sp-7);
  border: none; background: none; box-shadow: none;
  border-bottom: 0.0625rem solid var(--line);
  padding: 0 0 var(--sp-8);
  margin-bottom: var(--sp-8);
}
.storetype-label {
  font-size: var(--fs-xs); font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--t3);
}
.storetype-seg {
  display: inline-flex; flex-wrap: wrap;
  background: var(--inset); border: 0.0625rem solid var(--line);
  border-radius: var(--r-md); padding: 0.1875rem; gap: 0.125rem;
}
.storetype-seg button {
  display: inline-flex; align-items: center; gap: 0.4375rem;
  border: none; background: transparent;
  color: var(--t2); font-size: var(--fs-sm); font-weight: 600;
  padding: 0.5rem 0.8125rem; border-radius: var(--r-sm);
  cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast);
}
.storetype-seg button svg { width: var(--icon-sm); height: var(--icon-sm); }
.storetype-seg button:hover:not(.on) { color: var(--t1); }
.storetype-seg button.on { background: var(--ac); color: var(--ac-ink); }
.storetype-seg button[data-soon] { color: var(--t3); }
.storetype-seg button[data-soon].on { background: var(--surface-3); color: var(--t1); }
.soon-tag {
  font-size: 0.625rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--t3);
  background: var(--surface-3); border-radius: var(--r-pill);
  padding: 0.125rem 0.375rem; margin-left: 0.0625rem;
}
.storetype-seg button[data-soon].on .soon-tag { background: var(--surface); }
.storetype-note { font-size: var(--fs-sm); color: var(--t3); margin-left: auto; }

/* ── Slim setup banner ── */
.setup-slim {
  padding: var(--sp-6) var(--sp-9);
  margin-bottom: var(--sp-10);
}
.setup-slim .setup-top { gap: var(--sp-5); }
.setup-lead { font-size: var(--fs-sm); font-weight: 600; color: var(--t2); }
.setup-slim .setup-items { margin-top: var(--sp-6); }

/* ── Coming-soon placeholder (Shopify) ── */
.comingsoon {
  border: 0.0625rem solid var(--line);
  background: var(--surface);
  background-image:
    radial-gradient(120% 130% at 50% 0%, var(--ac-softer) 0%, transparent 45%),
    var(--panel-sheen);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-md), var(--ring-top);
  padding: var(--sp-17) var(--sp-12) var(--sp-15);
  text-align: center;
  max-width: 40rem; margin: 0 auto;
}
.cs-icon {
  width: 4rem; height: 4rem; margin: 0 auto var(--sp-7);
  display: grid; place-items: center;
  border-radius: var(--r-card);
  background: var(--ac-soft); color: var(--ac-hi);
}
.cs-icon svg { width: 1.9rem; height: 1.9rem; }
.cs-title { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.01em; }
.cs-sub {
  font-size: var(--fs-md); color: var(--t2);
  margin: var(--sp-4) auto 0; max-width: 30rem; line-height: 1.55;
  text-wrap: pretty;
}
.cs-list-wrap {
  text-align: left; max-width: 25rem;
  margin: var(--sp-10) auto 0;
  border: 0.0625rem solid var(--line); border-radius: var(--r-pan);
  background: var(--inset); padding: var(--sp-7) var(--sp-8);
}
.cs-list-head {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--t3); margin-bottom: var(--sp-5);
}
.cs-list { list-style: none; display: grid; gap: var(--sp-4); }
.cs-list li {
  display: flex; align-items: flex-start; gap: var(--sp-4);
  font-size: var(--fs-sm); color: var(--t2);
}
.cs-list li svg { width: 1rem; height: 1rem; color: var(--ac-hi); flex: 0 0 1rem; margin-top: 0.05rem; }
.cs-actions { display: flex; justify-content: center; gap: var(--sp-5); margin-top: var(--sp-11); flex-wrap: wrap; }

/* ── Toast warning variant ── */
.toast--warn { color: var(--warn-fg, #b45309); }
.toast--warn .tic { background: var(--warn, #f59e0b); color: #fff; }
.toast .twarn svg { width: 0.8125rem; height: 0.8125rem; }

/* ── Error / Warning banner ── */
.error-banner {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-6);
  border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 500;
  margin: 0 var(--sp-6) var(--sp-4);
  animation: banner-in var(--dur-fast) ease-out;
}
@keyframes banner-in { from { opacity: 0; transform: translateY(-0.5rem); } }
.error-banner--error {
  background: var(--err-soft, #fef2f2);
  color: var(--err, #dc2626);
  border: 0.0625rem solid var(--err-line, #fecaca);
}
.error-banner--warning {
  background: var(--warn-soft, #fffbeb);
  color: var(--warn-fg, #b45309);
  border: 0.0625rem solid var(--warn-line, #fde68a);
}
.error-banner-ic { flex: 0 0 auto; display: grid; place-items: center; }
.error-banner-ic svg { width: 1rem; height: 1rem; }
.error-banner-text { flex: 1; line-height: 1.4; }
.error-banner-close {
  flex: 0 0 auto; border: none; background: none;
  cursor: pointer; color: inherit; opacity: 0.6;
  padding: 0.125rem;
}
.error-banner-close:hover { opacity: 1; }
.error-banner-close svg { width: 0.875rem; height: 0.875rem; }
.error-banner[hidden] { display: none; }

/* ── Scroll-to-top ── */
.scroll-top {
  position: fixed; right: var(--sp-12); bottom: var(--sp-12); z-index: 79;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  background: var(--ac); color: var(--ac-ink);
  border: none;
  display: grid; place-items: center; cursor: pointer;
  box-shadow: var(--ac-glow), 0 0.5rem 1.5rem -0.25rem color-mix(in oklch, var(--ac) 40%, transparent);
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(0.5rem);
  transition: opacity var(--dur-fast), visibility var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
}
.scroll-top.visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.scroll-top:hover { background: var(--ac-hi); transform: translateY(-0.1875rem); box-shadow: var(--ac-glow), 0 0.75rem 2rem -0.25rem color-mix(in oklch, var(--ac) 55%, transparent); }
.scroll-top svg { width: 1.25rem; height: 1.25rem; }

@media (max-width: 600px) {
  .scroll-top { right: var(--sp-6); bottom: 5rem; width: 2.5rem; height: 2.5rem; }
}
