/* KelCommerce admin. Builds on /shared/tokens.css. Quiet surfaces, hairlines, one accent. */
:root {
  --sb-w: 248px;
  --top-h: 56px;
  --ok-ink: #166534; --warn-ink: #9A4A09; --bad-ink: #A61B1B; --info-ink: #1E40AF; --muted-ink: var(--ink-2);
  --muted-soft: var(--surface-2);
  --input-bg: var(--surface);
  --overlay: rgba(28, 26, 23, .42);
  --r-ctl: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ok-ink: #6BD69A; --warn-ink: #F0B26B; --bad-ink: #F49A9A; --info-ink: #9DB6F7; --input-bg: #181715; --overlay: rgba(0, 0, 0, .6);
    --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 8px 24px rgba(0,0,0,.45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ok-ink: #6BD69A; --warn-ink: #F0B26B; --bad-ink: #F49A9A; --info-ink: #9DB6F7; --input-bg: #181715; --overlay: rgba(0, 0, 0, .6);
  --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 8px 24px rgba(0,0,0,.45); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 14px/1.5 var(--font-sans); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
p { margin: 0 0 var(--s-2); }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--font-mono); font-size: .92em; }
address { font-style: normal; line-height: 1.6; }
.muted { color: var(--ink-2); }
.block { display: block; }
.show-sm { display: none; }
.grow { flex: 1 1 auto; }
.nowrap { white-space: nowrap; }
.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-bad { color: var(--bad-ink) !important; }
.text-warn { color: var(--warn-ink); }
.upper { text-transform: uppercase; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: var(--r-sm); }
.skip-link:focus { top: 8px; }
.ic { flex: none; }

/* ---------- boot / spinner ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 14px; line-height: 1; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast); position: relative;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: var(--focus); border-color: var(--accent); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
:root[data-theme="dark"] .btn-primary:hover { background: var(--accent-strong); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #991B1B; border-color: #991B1B; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 44px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[data-busy] { color: transparent !important; pointer-events: none; }
.btn[data-busy] > * { visibility: hidden; }
.btn[data-busy]::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--line-strong); border-top-color: var(--ink); animation: spin .7s linear infinite; }
.btn-primary[data-busy]::after, .btn-danger[data-busy]::after { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-ctl); border: 1px solid transparent;
  background: transparent; color: var(--ink-2); cursor: pointer; transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.icon-btn-sm { width: 28px; height: 28px; border-radius: 6px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-align: left; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 2px; }
.link-btn.strong { color: var(--ink); font-weight: 600; }
.link-btn.strong:hover { color: var(--accent); }
.link { font-weight: 600; font-size: 13px; }
.with-ic { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s-4); min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field > label, .fieldset > legend { font-weight: 600; font-size: 13px; color: var(--ink); }
.req { color: var(--bad-ink); }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea {
  width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  background: var(--input-bg); color: var(--ink); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
textarea { resize: vertical; line-height: 1.55; min-height: 80px; }
select { appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A857B' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:hover:not(:disabled):not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--ink-3); cursor: not-allowed; }
[aria-invalid="true"] { border-color: var(--bad) !important; }
[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 25%, transparent) !important; }
.hint { font-size: 12.5px; color: var(--ink-2); margin: 0; }
.field-error { font-size: 12.5px; color: var(--bad-ink); margin: 0; font-weight: 500; }
.field-error::before { content: "! "; font-weight: 700; }
.input-affix { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--input-bg); overflow: hidden; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.input-affix:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.input-affix:has([aria-invalid="true"]) { border-color: var(--bad); }
.input-affix input:not([type=checkbox]) { border: 0 !important; box-shadow: none !important; background: transparent; min-width: 0; flex: 1; border-radius: 0; }
.affix { display: flex; align-items: center; padding: 0 10px; color: var(--ink-3); background: var(--surface-2); font-size: 13px; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.affix:first-child { border-right: 1px solid var(--line); }
.affix:last-child { border-left: 1px solid var(--line); }
.input-sm, .input-sm input:not([type=checkbox]) { min-height: 32px !important; padding-top: 5px !important; padding-bottom: 5px !important; font-size: 13px; }
.input-sm .affix { padding: 0 8px; font-size: 12px; }
.input-row { display: flex; gap: var(--s-2); }
.input-row > input { flex: 1; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s-4); }
.grid-form.grid-3 { grid-template-columns: 1fr 2fr 1.4fr; }
.grid-form .field { margin-bottom: var(--s-4); }
.w-sm { max-width: none; }
.w-md { max-width: 360px; }
.fieldset { border: 0; padding: 0; margin: 0 0 var(--s-4); min-width: 0; }
.fieldset > legend { padding: 0; margin-bottom: var(--s-2); }
.check-list { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow: auto; margin: 0 -6px; padding: 0 6px; }
.check { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; flex: none; cursor: pointer; }
.toggles { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); margin-top: var(--s-4); }
.inline-form { display: flex; gap: var(--s-3); align-items: flex-end; }
.inline-form .field { margin: 0; }
.inline-form .btn { height: 38px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-4); }
.row-end { display: flex; justify-content: flex-end; margin-top: var(--s-2); }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 36px; height: 20px; border-radius: var(--r-pill); background: var(--line-strong); position: relative; transition: background var(--t-fast); flex: none; }
.switch-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform var(--t-fast); }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { box-shadow: var(--focus); }
.switch-label { font-weight: 500; }

/* radio cards */
.radio-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.radio-cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.radio-card { position: relative; cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card > span { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--surface); transition: border-color var(--t-fast), background var(--t-fast); height: 100%; }
.radio-card small { color: var(--ink-2); font-size: 12px; line-height: 1.35; }
.radio-card:hover > span { border-color: var(--ink-3); }
.radio-card input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.radio-card input:focus-visible + span { box-shadow: var(--focus); }
.check-card { position: relative; cursor: pointer; }
.check-card input { position: absolute; top: 12px; right: 12px; }
.check-card > span { display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); }
.check-card small { color: var(--ink-3); font-size: 12px; }
.check-card:has(input:checked) > span { border-color: var(--accent); background: var(--accent-soft); }
.lang-checks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); }
.chip-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { position: relative; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; }
.chip-check span { display: inline-block; padding: 5px 11px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); font-size: 13px; background: var(--surface); }
.chip-check input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); font-weight: 600; }
:root[data-theme="dark"] .chip-check input:checked + span { color: var(--ink); }
.chip-check input:focus-visible + span { box-shadow: var(--focus); }

/* segmented */
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; gap: 2px; }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-pressed="true"], .seg-btn[aria-checked="true"], .seg-radio:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.seg-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-radio:has(input:focus-visible) { box-shadow: var(--focus); }
.seg-sm .seg-btn { height: 24px; padding: 0 8px; }

/* language tabs */
.lang-tabs { display: inline-flex; gap: 2px; padding: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.lang-tab { position: relative; height: 26px; min-width: 38px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); font: 600 12px/1 var(--font-sans); letter-spacing: .04em; cursor: pointer; }
.lang-tab:hover { color: var(--ink); }
.lang-tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.dot-missing { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.dlg-lang { display: flex; justify-content: flex-end; margin: -4px 0 var(--s-3); }

/* tags input */
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 38px; padding: 5px 6px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--input-bg); cursor: text; }
.tags:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.tags:has([aria-invalid="true"]) { border-color: var(--bad); }
.tags input { flex: 1; min-width: 120px; border: 0 !important; box-shadow: none !important; padding: 2px 4px !important; min-height: 26px !important; background: transparent !important; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 4px 0 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; font-weight: 500; font-size: 13px; }
.tag button { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-3); cursor: pointer; }
.tag button:hover { background: var(--line); color: var(--ink); }

/* ---------- badges, banners, chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-ok { background: var(--ok-soft); color: var(--ok-ink); }
.badge-warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge-bad { background: var(--bad-soft); color: var(--bad-ink); }
.badge-info { background: var(--info-soft); color: var(--info-ink); }
.badge-muted { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.banner { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); margin-bottom: var(--s-4); font-size: 13.5px; }
.banner .ic { margin-top: 1px; }
.banner-bad { background: var(--bad-soft); color: var(--bad-ink); }
.banner-warn { background: var(--warn-soft); color: var(--warn-ink); }
.banner-info { background: var(--info-soft); color: var(--info-ink); }
.banner-info a { color: inherit; text-decoration: underline; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-block; padding: 1px 7px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); font: 600 11.5px/1.6 var(--font-mono); color: var(--ink-2); }
.code { font-family: var(--font-mono); font-weight: 600; letter-spacing: .03em; }
td .code { padding: 2px 8px; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 6px; color: var(--ink); }
.dlg-error { margin-bottom: var(--s-4); }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sb-w); display: flex; flex-direction: column; z-index: 30;
  background: var(--paper); border-right: 1px solid var(--line); padding: 12px 12px 16px;
}
.main { flex: 1; min-width: 0; margin-left: var(--sb-w); display: flex; flex-direction: column; }
.sb-top { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; }
.shop-switch { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid transparent; border-radius: 10px; background: transparent; cursor: pointer; text-align: left; }
.shop-switch:hover, .shop-switch[aria-expanded="true"] { background: var(--surface-2); }
.shop-switch-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shop-name { font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-host { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-switch-ic { color: var(--ink-3); }
.shop-mark { display: inline-grid; place-items: center; flex: none; border-radius: 8px; background: var(--ink); color: var(--paper); font-weight: 700; overflow: hidden; }
.shop-mark-md { width: 32px; height: 32px; font-size: 13px; }
.shop-mark-lg { width: 64px; height: 64px; font-size: 22px; border-radius: 14px; }
.shop-mark.has-logo { background: var(--surface); border: 1px solid var(--line); }
.shop-mark img { width: 100%; height: 100%; object-fit: contain; }
.sb-close { display: none; }
.sb-nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item { display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: 8px; color: var(--ink-2); font-weight: 550; text-decoration: none !important; transition: background var(--t-fast), color var(--t-fast); }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.nav-item[aria-current="page"] .ic { color: var(--accent); }
.nav-sep { height: 1px; background: var(--line); margin: 10px 6px; }
.sb-foot { margin-top: auto; }
.trial-pill { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none !important; }
.trial-pill-bad { border-color: var(--bad, #b42318); }
.trial-pill-bad strong { color: var(--bad, #b42318); }
.trial-pill:hover { border-color: var(--line-strong); }
.trial-pill-top { font-size: 13px; }
.trial-bar { height: 4px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.trial-bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.trial-pill-cta { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-weight: 600; font-size: 13px; }
.scrim { position: fixed; inset: 0; background: var(--overlay); z-index: 25; }

.topbar { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: var(--s-3); padding: 0 var(--s-6);
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 440px; }
.search-ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search input { padding-left: 34px !important; padding-right: 32px !important; height: 36px; min-height: 36px !important; background: var(--surface) !important; }
.search input::-webkit-search-cancel-button { display: none; }
.search-kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 600 11px var(--font-mono); color: var(--ink-3); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 5px; line-height: 17px; pointer-events: none; }
.search:focus-within .search-kbd { display: none; }
.search-panel { position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 420px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); padding: 6px; z-index: 40; }
.sr-head { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink); text-decoration: none !important; }
.sr-item:hover, .sr-item.active { background: var(--surface-2); }
.sr-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); overflow: hidden; flex: none; }
.sr-ic img { width: 100%; height: 100%; object-fit: cover; }
.sr-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-meta { margin-left: auto; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
.sr-empty { padding: 14px 10px; color: var(--ink-2); margin: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.avatar-btn { border: 0; background: transparent; padding: 2px; border-radius: 50%; cursor: pointer; margin-left: 4px; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; font-size: 12.5px; flex: none; }
.avatar-btn:hover .avatar, .avatar-btn[aria-expanded="true"] .avatar { box-shadow: 0 0 0 2px var(--line-strong); }
.avatar-sm { width: 30px; height: 30px; }
.content { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: var(--s-6) var(--s-6) var(--s-9); outline: none; }

/* menu */
.menu { position: fixed; z-index: 60; min-width: 200px; max-width: min(320px, calc(100vw - 16px)); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); padding: 6px; animation: pop .12s ease; }
.menu-wide { min-width: 260px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer; text-decoration: none !important; }
.menu-item:hover, .menu-item:focus { background: var(--surface-2); outline: none; }
.menu-item .ic { color: var(--ink-2); }
.menu-item.danger, .menu-item.danger .ic { color: var(--bad-ink); }
.menu-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.menu-hint { color: var(--ink-3); font-size: 12px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-check { color: var(--accent) !important; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-heading { padding: 6px 10px 4px; font-size: 12px; color: var(--ink-3); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- page structure ---------- */
.page-head { margin-bottom: var(--s-5); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 550; font-size: 13px; margin-bottom: var(--s-2); }
.back-link:hover { color: var(--ink); text-decoration: none; }
.page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.page-head-title { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; min-width: 0; }
.page-head-title h1 { font-size: 24px; overflow-wrap: anywhere; }
.page-sub { flex-basis: 100%; color: var(--ink-2); margin: 0; }
.page-actions { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.head-badges { display: inline-flex; gap: 6px; }
.page-hint { margin-top: var(--s-3); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-1); margin-bottom: var(--s-4); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 16px 20px 0; flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 15px; }
.card-sub { color: var(--ink-2); font-size: 13px; margin: 2px 0 0; }
.card-body { padding: 16px 20px 20px; }
.card > .card-body:first-child { padding-top: 20px; }
.card-flush { overflow: hidden; }
.card-flush-body .card-body { padding: 8px 0 0; }
.card > .list { padding: 8px 0; }
.card-head + .list { padding-top: 10px; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-4); align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
.eyebrow { display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }

/* empty / skeleton */
.empty { text-align: center; padding: var(--s-8) var(--s-5); max-width: 460px; margin: 0 auto; }
.empty-ic { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--surface-2); color: var(--ink-2); margin-bottom: var(--s-4); border: 1px solid var(--line); }
.empty h1, .empty h2 { font-size: 17px; margin-bottom: 6px; }
.empty p { color: var(--ink-2); margin-bottom: var(--s-4); }
.card .empty { padding: var(--s-7) var(--s-5); }
.center-page { min-height: 100vh; display: grid; place-items: center; padding: var(--s-5); }
.sk { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-title { width: 220px; height: 26px; margin-bottom: var(--s-5); }
.sk-block { height: 96px; border-radius: 12px; }
.sk-panel { height: 280px; border-radius: 12px; margin-top: var(--s-4); }
.sk-table td { height: 52px; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--ink-2); padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td, .table tbody tr:last-child th { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-click tbody tr { cursor: pointer; transition: background var(--t-fast); }
.table-click tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.row-link { color: inherit; text-decoration: none !important; }
.row-link:focus-visible { outline-offset: 4px; }
.table-compact th, .table-compact td { padding: 7px 12px; }
.actions-col { width: 1%; white-space: nowrap; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.stack { display: flex; flex-direction: column; }
.prod-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.prod-cell-text { display: flex; flex-direction: column; min-width: 0; }
.prod-cell-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }
.prod-cell-text .muted { font-size: 12.5px; }
.thumb { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-3); overflow: hidden; flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-sm { width: 28px; height: 28px; border-radius: 6px; }
.cat-name { display: inline-flex; align-items: center; gap: 10px; }
.cat-name.child { padding-left: 8px; }
.tree { color: var(--ink-3); font-family: var(--font-mono); }

/* list tools */
.list-tools { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab { height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.list-search { position: relative; width: 280px; max-width: 100%; margin-left: auto; }
.list-search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.list-search input { padding-left: 34px !important; height: 36px; min-height: 36px !important; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 10px 20px; border-top: 1px solid var(--line); }
.pager-info { color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.pager-btns { display: flex; gap: 6px; }
.pager .btn { width: 32px; padding: 0; }

/* plain lists */
.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: var(--ink); text-decoration: none !important; border-top: 1px solid var(--line); min-height: 56px; }
.list > li:first-child > .list-row { border-top: 0; }
a.list-row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-main > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-main .muted { font-size: 12.5px; }
.list-side { display: flex; align-items: center; gap: 10px; flex: none; color: var(--ink-3); }
.list-amt { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); min-width: 72px; text-align: right; }
.list-date { font-size: 12.5px; min-width: 88px; text-align: right; }
.list-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); flex: none; }
.card .list-row { padding-left: 20px; padding-right: 20px; }
.card-body .list { margin: -8px -20px -12px; }
.rank-n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 700; flex: none; }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); margin-bottom: var(--s-4); transition: opacity var(--t); }
.kpis.loading { opacity: .5; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-label { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 550; font-size: 13px; }
.kpi-label .ic { color: var(--ink-3); }
.kpi-value { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.kpi-period { font-size: 12px; color: var(--ink-3); }
.trial-banner { display: flex; align-items: center; gap: var(--s-4); padding: 14px 16px 14px 18px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); background: var(--accent-soft); border-radius: 12px; margin-bottom: var(--s-4); }
.trial-banner-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface); color: var(--accent); flex: none; }
.trial-banner-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.trial-banner-text span { color: var(--ink-2); font-size: 13px; }
.checklist .card-head { align-items: flex-start; }
.progress { height: 4px; background: var(--surface-2); margin: 14px 20px 0; border-radius: 4px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width var(--t); }
.ck-list { list-style: none; margin: 0; padding: 6px 0 8px; }
.ck-item { display: flex; align-items: center; gap: 14px; padding: 11px 20px; }
.ck-item + .ck-item { border-top: 1px solid var(--line); }
.ck-mark { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px dashed var(--line-strong); color: var(--accent-ink); flex: none; }
.ck-item.done .ck-mark { background: var(--accent); border: 0; }
.ck-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ck-text span { color: var(--ink-2); font-size: 13px; }
.ck-item.done .ck-text strong { color: var(--ink-2); font-weight: 550; }
.ck-done { color: var(--ink-3); font-size: 12.5px; font-weight: 600; }
.chart { position: relative; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-base { stroke: var(--line-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-ylab, .chart-xlab { fill: var(--ink-3); font-size: 11px; font-family: var(--font-sans); }
.chart-bar { fill: var(--accent); transition: opacity var(--t-fast); }
.chart:has(.chart-hit.on) .chart-bar { opacity: .45; }
.chart-hit { fill: transparent; cursor: default; outline: none; }
.chart-hit.on { fill: color-mix(in srgb, var(--accent) 8%, transparent); }
.chart-tip { position: absolute; top: -6px; pointer-events: none; display: flex; flex-direction: column; gap: 1px; background: var(--ink); color: var(--paper); padding: 8px 10px; border-radius: 8px; font-size: 12.5px; box-shadow: var(--shadow-2); white-space: nowrap; transform: translateY(-100%); }
.chart-tip .muted { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.chart-table { margin-top: var(--s-3); }
.chart-table summary { cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 550; width: fit-content; }
.chart-table .table-wrap { max-height: 260px; overflow: auto; margin-top: var(--s-2); border: 1px solid var(--line); border-radius: 8px; }
.chart-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: var(--s-7) var(--s-4); color: var(--ink-2); text-align: center; border: 1px dashed var(--line-strong); border-radius: 10px; }

/* ---------- order ---------- */
.lines { list-style: none; margin: -4px 0 0; padding: 0; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--s-4); align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line-main { display: flex; flex-direction: column; min-width: 0; }
.line-title { font-weight: 600; color: var(--ink); }
.line-main .muted { font-size: 12.5px; }
.line-qty { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.line-total { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 84px; text-align: right; }
.totals { margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; margin-left: auto; max-width: 360px; }
.totals > div { display: flex; justify-content: space-between; gap: var(--s-4); }
.totals dt { color: var(--ink-2); }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.totals-grand { padding-top: 8px; border-top: 1px solid var(--line); font-weight: 650; font-size: 15px; }
.totals-grand dt { color: var(--ink); }
.totals .muted dt, .totals .muted dd { color: var(--ink-3); font-size: 12.5px; }
.kv { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; }
.kv > div { display: contents; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv-wide { grid-template-columns: 140px 1fr; }
.cust { margin-bottom: 4px; }
.note-form textarea { min-height: 72px; }

/* ---------- product editor ---------- */
.lang-slot:empty, .sec-lang:empty { display: none; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.media-grid.is-empty { grid-template-columns: 1fr; }
.media-tile { position: relative; margin: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); cursor: grab; }
.media-tile.main { grid-column: span 2; grid-row: span 2; }
.media-tile img { width: 100%; height: 100%; object-fit: cover; }
.media-tile.dragging { opacity: .4; }
.media-tile.pending img { opacity: .75; }
.media-main, .media-pending { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font-size: 11.5px; font-weight: 600; box-shadow: var(--shadow-1); }
.media-pending { top: auto; bottom: 8px; background: var(--warn-soft); color: var(--warn-ink); }
.media-tools { position: absolute; right: 6px; top: 6px; display: flex; gap: 2px; padding: 2px; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-1); opacity: 0; transition: opacity var(--t-fast); }
.media-tile:hover .media-tools, .media-tile:focus-within .media-tools { opacity: 1; }
@media (hover: none) { .media-tools { opacity: 1; } }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 112px; aspect-ratio: auto; padding: 16px; text-align: center; border: 1.5px dashed var(--line-strong); border-radius: 10px; color: var(--ink-2); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.media-grid.is-empty .dropzone { min-height: 160px; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.dropzone:focus-within { box-shadow: var(--focus); border-color: var(--accent); }
.dz-main { font-weight: 600; font-size: 13px; color: var(--ink); }
.dz-sub { font-size: 12px; color: var(--ink-3); }
.opt-list { display: flex; flex-direction: column; gap: var(--s-3); margin-bottom: var(--s-4); }
.opt { border: 1px solid var(--line); border-radius: 10px; padding: 14px 14px 12px; background: var(--paper); }
.opt-head { display: flex; align-items: flex-end; gap: var(--s-2); margin-bottom: var(--s-3); }
.opt-name { flex: 1; margin: 0; max-width: 320px; }
.opt-name label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.opt .field:last-child { margin: 0; }
.opt-none { margin-bottom: var(--s-3); }
.opt-add { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.opt-add .muted { font-size: 13px; }
.variants-tools { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); flex-wrap: wrap; }
.bulk { display: flex; gap: 6px; align-items: center; }
.bulk .input-affix { width: 150px; }
.variants-wrap { border: 1px solid var(--line); border-radius: 10px; }
.variants-table th, .variants-table td { padding: 8px 8px; }
.variants-table th:first-child, .variants-table td:first-child { padding-left: 14px; }
.variants-table th:last-child, .variants-table td:last-child { padding-right: 14px; }
.variants-table thead th { font-size: 12px; }
.variants-table .v-name { background: transparent; font-weight: 600; color: var(--ink); white-space: nowrap; font-size: 13px; border-bottom: 1px solid var(--line); }
.variants-table td { min-width: 96px; }
.variants-table td:has([data-k=sku]) { min-width: 140px; }
.variants-table input.w-num { width: 84px; }
.variants-table td .input-affix { min-width: 104px; }
.promo-hint { display: flex; align-items: center; gap: 6px; color: var(--ok-ink); margin-top: -4px; }
.serp { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); margin-bottom: var(--s-4); font-family: Arial, ui-sans-serif, sans-serif; }
.serp-site { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.serp-site > span:last-child { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.serp-fav { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--ink-2); flex: none; }
.serp-name { font-size: 14px; color: var(--ink); }
.serp-url { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp-title { font-size: 19px; line-height: 1.3; color: #1a0dab; margin: 2px 0 3px; overflow-wrap: anywhere; }
:root[data-theme="dark"] .serp-title { color: #99c3ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .serp-title { color: #99c3ff; } }
.serp-desc { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.savebar { position: fixed; left: var(--sb-w); right: 0; bottom: 0; z-index: 22; padding: 12px var(--s-6); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(28,26,23,.06); }
.savebar-inner { max-width: 1096px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.savebar-text { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 550; }
.savebar-actions { display: flex; gap: var(--s-2); }
body.has-savebar .content { padding-bottom: 120px; }
.danger-zone { display: flex; justify-content: center; padding: var(--s-2) 0; }
.status-hint { margin-top: -6px; }

/* ---------- dialogs ---------- */
.dlg { border: 0; padding: 0; border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2), 0 0 0 1px var(--line); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
.dlg-sm { width: min(440px, calc(100vw - 24px)); }
.dlg-lg { width: min(760px, calc(100vw - 24px)); }
.dlg::backdrop { background: var(--overlay); }
.dlg[open] { animation: dlgIn .16s ease; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dlg-form { display: flex; flex-direction: column; max-height: inherit; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 16px 16px 8px 24px; }
.dlg-head h2 { font-size: 17px; }
.dlg-body { padding: 8px 24px 16px; overflow: auto; }
.dlg-text { color: var(--ink-2); margin-bottom: var(--s-4); }
.dlg-foot { display: flex; justify-content: flex-end; gap: var(--s-2); padding: 14px 24px; border-top: 1px solid var(--line); background: var(--paper); border-radius: 0 0 16px 16px; }
.upgrade-body { text-align: center; }
.upgrade-ic { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); margin-bottom: var(--s-3); }

/* toasts */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 14px; border-radius: 12px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow-2); font-weight: 500; animation: toastIn .18s ease; max-width: 100%; }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .18s ease; }
.toast-ok .ic { color: #6BD69A; }
.toast-error { background: var(--bad); color: #fff; }
.toast-msg { min-width: 0; overflow-wrap: anywhere; }
.toast-x { border: 0; background: transparent; color: inherit; opacity: .7; cursor: pointer; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; }
.toast-x:hover { opacity: 1; background: rgba(255,255,255,.12); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
:root[data-theme="dark"] .toast-ok .ic { color: var(--ok); }

/* ---------- auth ---------- */
.auth-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--s-6) var(--s-4); }
.auth-col { width: 100%; max-width: 400px; }
.auth-col-wide { max-width: 480px; }
.auth-brand { display: flex; justify-content: center; margin-bottom: var(--s-5); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-mark { color: var(--accent); display: inline-flex; }
.brand-word { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: var(--s-6); box-shadow: var(--shadow-1); }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card > .muted { margin-bottom: var(--s-5); }
.auth-card .btn-block { margin-top: var(--s-2); }
.auth-foot { text-align: center; color: var(--ink-2); margin-top: var(--s-4); }
.auth-forgot { margin: calc(var(--s-2) * -1) 0 var(--s-3); text-align: right; font-size: .875rem; }
.auth-langs { display: flex; justify-content: center; gap: var(--s-3); margin-top: var(--s-4); }
.auth-langs .link-btn { color: var(--ink-3); font-weight: 600; font-size: 12.5px; letter-spacing: .04em; padding: 4px; }
.auth-langs .link-btn.active { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.auth-actions { display: flex; justify-content: space-between; gap: var(--s-2); margin-top: var(--s-4); flex-wrap: wrap; }
.shop-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.shop-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--ink); text-decoration: none !important; border-top: 1px solid var(--line); }
.shop-list li:first-child .shop-row { border-top: 0; }
.shop-row:hover { background: var(--surface-2); }
.shop-row-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.shop-row-text .muted { font-size: 12.5px; }
.shop-row > .ic { color: var(--ink-3); }

/* ---------- settings ---------- */
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.settings-nav { position: sticky; top: calc(var(--top-h) + var(--s-6)); }
.settings-title { font-size: 24px; margin-bottom: var(--s-4); }
.settings-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.settings-link { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 8px; color: var(--ink-2); font-weight: 550; text-decoration: none !important; white-space: nowrap; }
.settings-link:hover { background: var(--surface-2); color: var(--ink); }
.settings-link[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.settings-link[aria-current="page"] .ic { color: var(--accent); }
.sub-head { margin: 4px 0 var(--s-5); }
.sub-head h2 { font-size: 19px; margin-bottom: 4px; }
.sub-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.sub-head .back-link { margin-bottom: 6px; }
.settings-body { min-width: 0; }
.logo-row { display: flex; gap: var(--s-4); align-items: flex-start; margin-bottom: var(--s-4); }
.logo-row .field { margin: 0; }
.gate { display: flex; align-items: center; gap: var(--s-4); padding: 16px 18px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--surface); margin-bottom: var(--s-4); }
.gate p { margin: 2px 0 0; color: var(--ink-2); font-size: 13px; }
.gate > div:nth-child(2) { flex: 1; min-width: 0; }
.gate-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); flex: none; }
.meter { height: 4px; background: var(--surface-2); border-radius: 4px; margin: 12px 20px 0; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); }
.list-row.static { cursor: default; }
.dns-help { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.dns-help h4 { font-size: 14px; margin-bottom: 4px; }
.dns-table { margin: var(--s-3) 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; border-collapse: separate; border-spacing: 0; }

/* payments */
.providers { display: flex; flex-direction: column; }
.provider-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; }
.provider-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; font-weight: 800; font-size: 17px; color: #fff; flex: none; }
.pm-stripe { background: #635BFF; } .pm-mollie { background: #111; } .pm-paypal { background: #003087; } .pm-worldline { background: #46BEAA; color: #0b2b26; }
:root[data-theme="dark"] .pm-mollie { background: #f2f0ea; color: #111; }
.provider-title { flex: 1; min-width: 0; }
.provider-title h3 { font-size: 15px; }
.provider-title p { font-size: 13px; margin: 2px 0 0; }
.provider-status { flex: none; }
.provider-form { padding: 4px 20px 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.provider-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; margin-bottom: 6px; }
.mode-hint { margin-bottom: var(--s-4); }
.provider-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-2); }
.provider.on { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }

/* theme */
.theme-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-4); align-items: start; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--s-4); }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--sw); cursor: pointer; position: relative; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sw); }
.swatch-custom { display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong); overflow: hidden; }
.swatch-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.swatch-custom:focus-within { box-shadow: var(--focus); }
.accent-row { display: flex; align-items: center; gap: var(--s-3); }
.accent-sample { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 8px; background: var(--sw); color: #fff; font-weight: 600; }
.accent-hex { color: var(--ink-2); }
.contrast-hint { display: flex; align-items: center; gap: 6px; color: var(--warn-ink); margin-top: var(--s-3); }
.font-card > span { align-items: center; text-align: center; padding: 14px 8px; }
.font-aa { font-size: 26px; font-weight: 600; line-height: 1.1; }
.sec-list { list-style: none; margin: 0 0 var(--s-3); padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sec { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.sec.open { border-color: var(--line-strong); }
.sec-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; }
.sec-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); flex: none; }
.sec-toggle { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0; border: 0; background: transparent; padding: 6px 4px; text-align: left; cursor: pointer; border-radius: 6px; }
.sec-toggle .muted { font-size: 12.5px; max-width: 100%; }
.sec-body { padding: 4px 14px 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.sec-empty { padding: var(--s-4); text-align: center; border: 1px dashed var(--line-strong); border-radius: 10px; margin-bottom: var(--s-3); }
.theme-preview { position: sticky; top: calc(var(--top-h) + var(--s-4)); }
.preview-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; }
.preview-dots { display: inline-flex; gap: 5px; } .preview-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.preview-url { flex: 1; min-width: 0; font-size: 12px; color: var(--ink-2); background: var(--surface-2); border-radius: 6px; padding: 3px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-frame { border: 1px solid var(--line); border-radius: 0 0 12px 12px; overflow: hidden; background: var(--surface-2); height: min(72vh, 720px); display: flex; justify-content: center; margin-bottom: var(--s-2); }
.preview-frame iframe { width: 100%; height: 100%; border: 0; background: #fff; transition: width var(--t); }
.preview-frame.mobile iframe { width: 390px; max-width: 100%; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }

/* billing */
.current-plan .cp-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.cp-name { font-size: 20px; display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.cp-note { display: flex; gap: 8px; align-items: flex-start; max-width: 340px; color: var(--ink-2); font-size: 13px; margin: 0; }
.billing-toggle { display: flex; align-items: center; gap: var(--s-3); margin: var(--s-5) 0 var(--s-4); flex-wrap: wrap; }
.save-pill { font-size: 11px; font-weight: 700; color: var(--ok-ink); background: var(--ok-soft); padding: 1px 6px; border-radius: var(--r-pill); }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); align-items: stretch; }
.plan { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; box-shadow: var(--shadow-1); }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-1); }
.plan-flag { position: absolute; top: -11px; left: 20px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; padding: 2px 10px; border-radius: var(--r-pill); }
.plan h3 { font-size: 17px; }
.plan-tag { font-size: 13px; min-height: 3em; margin: 4px 0 var(--s-3); }
.plan-price { margin: 0; display: flex; align-items: baseline; gap: 4px; }
.plan-price strong { font-size: 28px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.plan-sub { font-size: 12.5px; margin-bottom: var(--s-4); }
.plan.is-current { background: var(--paper); }
.feats { list-style: none; margin: var(--s-4) 0 0; padding: 0; font-size: 13px; }
.feats li { display: flex; justify-content: space-between; gap: var(--s-3); padding: 7px 0; border-top: 1px solid var(--line); }
.feat-v { font-weight: 600; text-align: right; }
.feat-yes { color: var(--ok-ink); display: inline-flex; }
.feat-no { color: var(--ink-3); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .theme-grid { grid-template-columns: 1fr; }
  .theme-preview { position: static; }
}
@media (max-width: 1080px) {
  .layout-2 { grid-template-columns: minmax(0, 1fr); }
  .settings { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
  .settings-nav { position: static; min-width: 0; }
  .settings-nav ul { flex-direction: row; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 2px 4px; }
  .settings-nav ul::-webkit-scrollbar { display: none; }
}
@media (max-width: 899px) {
  .sidebar { transform: translateX(-102%); transition: transform var(--t); box-shadow: var(--shadow-2); width: min(300px, 86vw); background: var(--surface); visibility: hidden; }
  .sidebar.open { transform: none; visibility: visible; }
  .sb-close { display: inline-grid; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; margin-left: -8px; }
  .topbar { padding: 0 var(--s-4); gap: var(--s-2); }
  .content { padding: var(--s-5) var(--s-4) var(--s-9); }
  .savebar { left: 0; padding: 10px var(--s-4); }
  .view-store span { display: none; }
  .view-store { width: 36px; padding: 0; }
  .search-kbd { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; max-width: 480px; }
  .kpis { gap: var(--s-3); }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .show-sm { display: block; }
  .show-sm.ellipsis { max-width: 92px; }
  .table th { white-space: normal; }
  .table .num { white-space: nowrap; }
  .table .price-cell { white-space: normal; }
  .table .num .block { white-space: normal; font-size: 12px; }
  .stack .show-sm.ellipsis { max-width: 92px; }
  .prod-cell { gap: 10px; } .prod-cell .thumb { width: 40px; height: 40px; }
  .prod-cell-text .show-sm { margin-top: 3px; }
  .price-cell { white-space: normal; min-width: 76px; }
  .stack .muted { max-width: 128px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chips { max-width: 96px; }
  td .code { padding: 2px 6px; letter-spacing: 0; }
  .table td, .table th { padding-left: 8px; padding-right: 8px; }
  .table th:first-child, .table td:first-child { padding-left: 12px; }
  .table th:last-child, .table td:last-child { padding-right: 12px; }
  .table .badge { padding: 0 7px; gap: 5px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpis > .kpi:first-child { grid-column: span 2; }
  .kpi-value { font-size: 22px; }
  .page-head-title h1, .settings-title { font-size: 21px; }
  .page-head-row { flex-direction: column; align-items: stretch; }
  .page-actions .seg { width: 100%; } .page-actions .seg .seg-btn { flex: 1; justify-content: center; }
  .grid-form, .grid-form.grid-3 { grid-template-columns: 1fr; }
  .radio-cards-3 { grid-template-columns: 1fr; }
  .font-card > span { flex-direction: row; justify-content: flex-start; gap: 12px; }
  .lang-checks { grid-template-columns: 1fr 1fr; }
  .list-tools { flex-direction: column; align-items: stretch; }
  .list-search { width: 100%; margin: 0; }
  .card-head { padding: 14px 16px 0; }
  .card-body { padding: 14px 16px 16px; }
  .table th:first-child, .table td:first-child { padding-left: 16px; }
  .table th:last-child, .table td:last-child { padding-right: 16px; }
  .table td, .table th { padding-left: 10px; padding-right: 10px; }
  .list-row, .card .list-row { padding-left: 16px; padding-right: 16px; }
  .card-body .list { margin: -8px -16px -12px; }
  .list-date { display: none; }
  .trial-banner { flex-wrap: wrap; }
  .trial-banner .btn { width: 100%; }
  .gate { flex-wrap: wrap; } .gate .btn { width: 100%; }
  .line { grid-template-columns: minmax(0, 1fr) auto; }
  .line-qty { grid-column: 1; grid-row: 2; margin-top: -8px; font-size: 13px; }
  .line-total { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
  .totals { max-width: none; }
  .kv, .kv-wide { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; }
  .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inline-form { flex-direction: column; align-items: stretch; }
  .provider-head { flex-wrap: wrap; } .provider-title { flex-basis: calc(100% - 60px); } .provider-status { margin-left: 54px; }
  .savebar-text span { display: none; }
  .savebar-inner { justify-content: flex-end; }
  .savebar-text { margin-right: auto; }
  .lang-btn span { display: none; }
  .lang-btn { width: 36px; padding: 0; }
  .search { max-width: none; }
  .dlg-body { padding: 8px 18px 16px; } .dlg-head { padding-left: 18px; } .dlg-foot { padding: 12px 18px; }
  .ellipsis { max-width: 140px; }
  .auth-card { padding: var(--s-5); }
  .logo-row { flex-direction: column; } .logo-row .field { width: 100%; }
  .prod-cell { min-width: 0; } .prod-cell-text strong { max-width: 180px; }
}

/* recent orders rows: fixed columns so badges and amounts line up */
.order-row { display: grid; grid-template-columns: minmax(0, 1fr) 112px 92px 108px; align-items: center; gap: 12px; }
.order-row .list-side { display: contents; }
.order-row .badge { justify-self: start; }
.order-row .list-amt, .order-row .list-date { text-align: right; min-width: 0; }
@media (max-width: 640px) { .order-row { grid-template-columns: minmax(0, 1fr) auto 84px; } }
body.has-savebar .toasts { bottom: 84px; }
