/* =====================================================================
   ZeroConnect — کارت‌بانک | App shell, navigation, transitions, components
   Layer order (index.html):
     1. bootstrap.rtl.min.css
     2. zeronex-bootstrap.css   — ZERONEX design system (tokens + component skins)
     3. tokens.css               — --zc-* aliases of the DS semantic tokens
     4. this file                — native-app shell + panel components, DS-skinned
   Only DS tokens (or their --zc-* aliases) are used for colour, radius, shadow
   and motion, so dark / light come from data-bs-theme on <html>.
   ===================================================================== */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: auto; }
body {
  margin: 0;
  font-family: var(--zc-font);
  font-size: var(--zc-fs-body);
  line-height: var(--zc-lh);
  color: var(--fg-primary);
  background: var(--bg-canvas);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, a, input, select, textarea, [role="button"], label { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
img, svg, canvas { max-width: 100%; }
h1, h2, h3, h4, h5, h6 { font-weight: 600; margin: 0; line-height: 1.45; color: var(--fg-primary); }
p { margin: 0 0 var(--zc-space-2); }
a { color: var(--fg-brand); text-decoration: none; }
a:hover { color: var(--accent-hover); }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--ring) !important; border-radius: var(--zx-r-sm); }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.num { font-variant-numeric: tabular-nums; }
.mono, .font-mono { font-family: var(--zx-font-mono); direction: ltr; unicode-bidi: isolate; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.text-muted, .muted { color: var(--fg-secondary) !important; }
.text-primary { color: var(--fg-brand) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--zc-warning-text) !important; }
.small, small { font-size: var(--zc-fs-label); }
.caption { font-size: var(--zc-fs-caption); color: var(--fg-secondary); }
.fw-800 { font-weight: 700; }
.gap-2 { gap: var(--zc-space-2); } .gap-3 { gap: var(--zc-space-3); }
.no-scroll { overflow: hidden !important; }


/* ---------- Persian typography guard ----------
   The DS tracks + uppercases buttons, badges, eyebrows, labels, table heads and
   tabs for Latin. Letter-spacing breaks the joins of Persian script, so for
   Persian (lang="fa", the whole panel) tracking/uppercase are neutralised and
   the Persian face is used. Latin runs marked lang="en" keep the DS treatment. */
:is(.btn, .badge, .zx-chip, .zx-eyebrow, .zx-lbl, .nav-tabs .nav-link, .table thead th, .navbar-brand):lang(fa) {
  letter-spacing: 0; text-transform: none; font-family: var(--zx-font-fa);
}
:is(h1, h2, h3, h4, h5, h6, .card-title, .accordion-button):lang(fa) { font-family: var(--zx-font-fa); }
.zx-eyebrow:lang(fa), .zx-lbl:lang(fa) { direction: rtl; }
:is(.btn, .badge, .zx-chip) [lang="en"],
:is(.btn, .badge, .zx-chip):lang(en) { font-family: var(--zx-font-display); letter-spacing: .08em; text-transform: uppercase; }
.zx-latin { font-family: var(--zx-font-display); direction: ltr; unicode-bidi: isolate; }

/* ---------- Boot splash ---------- */
.boot {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: var(--bg-canvas); z-index: 100; transition: opacity var(--zx-d-slow) var(--zx-ease);
}
.boot-logo { width: 72px; height: 72px; border-radius: var(--zx-r-xl); display: grid; place-items: center;
  background: var(--grad-brand); color: #fff; font-size: 34px; box-shadow: var(--shadow-glow); }
.boot.hide { opacity: 0; pointer-events: none; }

/* ---------- App shell ---------- */
.app { position: fixed; inset: 0; height: 100dvh; overflow: hidden; }
.stacks { position: absolute; inset: 0; }
.stack { position: absolute; inset: 0; }
.stack[hidden] { display: none; }

.page {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  /* canvas + soft brand glow (admin shell family) */
  background: radial-gradient(520px 320px at 100% -6%, var(--accent-soft), transparent 64%) no-repeat, var(--bg-canvas);
  z-index: 1; overflow: hidden;
  contain: layout paint;
}
.page[hidden] { display: none; }
.page.is-modal { z-index: 30; }
.page.is-anim { will-change: transform; box-shadow: var(--shadow-lg); }
.page-dim { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 5; }

/* ---------- App bar (DS navbar: blurred canvas when scrolled) ---------- */
.appbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 2px;
  min-height: calc(var(--zc-appbar-h) + var(--zc-safe-top));
  padding: var(--zc-safe-top) calc(4px + var(--zc-safe-right)) 0 calc(4px + var(--zc-safe-left));
  background: transparent;
  position: relative; z-index: 4;
  transition: background-color var(--zc-dur-fast) var(--zc-ease), box-shadow var(--zc-dur-fast) var(--zc-ease);
}
.appbar::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1px; background: var(--border-subtle); opacity: 0; transition: opacity var(--zc-dur-fast) var(--zc-ease); }
.page.scrolled .appbar { background: var(--zc-glass); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%); }
.page.scrolled .appbar::after { opacity: 1; }
.appbar-start, .appbar-end { display: flex; align-items: center; min-width: 88px; }
.appbar-end { justify-content: flex-end; }
.appbar-title {
  flex: 1; min-width: 0; text-align: center; font-weight: 600; font-size: var(--zc-fs-title); color: var(--fg-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity var(--zc-dur-fast) var(--zc-ease), transform var(--zc-dur-fast) var(--zc-ease);
}
.page.has-large-title:not(.scrolled) .appbar-title { opacity: 0; transform: translateY(4px); }
.appbar .back-btn { gap: 2px; padding-inline: 6px 10px; font-weight: 500; color: var(--fg-brand); }
.appbar .back-btn .bi { font-size: 22px; }
.appbar .back-label { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--zc-fs-body-sm); }

/* Icon button (DS .btn-icon behaviour, 44px touch target) */
.icon-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--zc-touch); height: var(--zc-touch); padding: 0 10px;
  border: 1px solid transparent; border-radius: var(--zx-r-pill);
  background: transparent; color: var(--fg-primary);
  font: inherit; cursor: pointer;
  transition: background-color var(--zx-d-fast) var(--zx-ease), color var(--zx-d-fast) var(--zx-ease), border-color var(--zx-d-fast) var(--zx-ease), transform var(--zx-d-fast) var(--zx-ease);
}
.icon-btn .bi { font-size: 21px; line-height: 1; }
.icon-btn:hover { background: var(--bg-hover); color: var(--fg-brand); }
.icon-btn:active { transform: scale(.92); background: var(--bg-active); }
.icon-btn.primary { color: var(--fg-brand); }
.icon-btn .dot { position: absolute; top: 6px; inset-inline-end: 6px; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  background: var(--danger); color: var(--fg-inverse); font-size: 11px; font-weight: 700; display: grid; place-items: center; line-height: 1; border: 2px solid var(--bg-canvas); }

/* ---------- Scroll area ---------- */
.page-scroll {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--zc-tabbar-h) + var(--zc-safe-bottom) + 28px);
  scroll-padding-top: 16px;
}
.app.no-tabbar .page-scroll, .page.is-modal .page-scroll, .page.no-tabbar .page-scroll { padding-bottom: calc(var(--zc-safe-bottom) + 28px); }
.page-inner { max-width: var(--zc-content-max); margin: 0 auto; padding-inline: calc(var(--zc-gutter) + var(--zc-safe-right)) calc(var(--zc-gutter) + var(--zc-safe-left)); }
/* Large title = admin .zx-page-title (light weight, display scale) */
.large-title { font-size: var(--zc-fs-display); font-weight: 300; padding: 2px 0 12px; line-height: 1.35; color: var(--fg-primary); }
.large-subtitle { color: var(--fg-secondary); margin-top: -8px; margin-bottom: 14px; font-size: var(--zc-fs-body-sm); }

/* Sticky bottom action bar in forms (blurred surface, like admin .zx-form-actions) */
.page-footer {
  flex: 0 0 auto; padding: 12px calc(var(--zc-gutter) + var(--zc-safe-right)) calc(12px + var(--zc-safe-bottom)) calc(var(--zc-gutter) + var(--zc-safe-left));
  background: var(--zc-glass); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  border-top: 1px solid var(--border-subtle); z-index: 4;
}
.page-footer > .inner { max-width: var(--zc-content-max); margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.page:not(.is-modal):not(.no-tabbar) .page-footer { margin-bottom: calc(var(--zc-tabbar-h) + var(--zc-safe-bottom)); padding-bottom: 12px; }
.app.no-tabbar .page .page-footer { margin-bottom: 0; padding-bottom: calc(12px + var(--zc-safe-bottom)); }

/* ---------- Pull to refresh ---------- */
.ptr { height: 0; display: flex; align-items: flex-end; justify-content: center; overflow: visible; position: relative; }
.ptr-spinner {
  position: absolute; top: 6px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg-raised); border: 1px solid var(--border-default); box-shadow: var(--shadow-md);
  color: var(--fg-brand); opacity: 0; transform: translateY(-40px) scale(.6);
}
.ptr-spinner .bi { font-size: 18px; }
.ptr.refreshing .ptr-spinner .bi { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Bottom tab bar (blurred canvas like the DS navbar, teal active) ---------- */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 20;
  display: flex; align-items: stretch; justify-content: space-around;
  height: calc(var(--zc-tabbar-h) + var(--zc-safe-bottom));
  padding: 0 var(--zc-safe-right) var(--zc-safe-bottom) var(--zc-safe-left);
  background: var(--zc-glass); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  border-top: 1px solid var(--border-subtle);
  transition: transform var(--zx-d-base) var(--zx-ease-out);
}
.app.no-tabbar .tabbar { transform: translateY(110%); }
.tab {
  flex: 1; max-width: 120px; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: none; color: var(--fg-secondary); font: inherit; cursor: pointer;
  padding: 6px 0 4px; min-height: var(--zc-touch);
  transition: color var(--zx-d-fast) var(--zx-ease);
}
.tab:hover { color: var(--fg-primary); }
.tab-icon { position: relative; display: grid; place-items: center; width: 56px; height: 30px; border-radius: var(--zx-r-pill); transition: background-color var(--zx-d-fast) var(--zx-ease), transform var(--zx-d-fast) var(--zx-ease); }
.tab-icon .bi { font-size: 21px; line-height: 1; }
.tab .ic-fill { display: none; }
.tab[aria-selected="true"] .ic-line { display: none; }
.tab[aria-selected="true"] .ic-fill { display: inline-block; }
.tab-label { font-size: 11.5px; font-weight: 500; line-height: 1.2; }
.tab[aria-selected="true"] { color: var(--fg-brand); }
.tab[aria-selected="true"] .tab-label { font-weight: 600; }
.tab[aria-selected="true"] .tab-icon { background: var(--accent-soft); color: var(--fg-brand); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
.tab:active .tab-icon { transform: scale(.9); }
.tab-badge { position: absolute; top: -3px; inset-inline-end: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: var(--fg-inverse); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; line-height: 1; border: 2px solid var(--bg-canvas); }
.tab-badge[hidden] { display: none; }
.tabbar .rail-brand { display: none; }

/* ---------- Desktop: navigation rail (admin sidebar family) + centered column ---------- */
@media (min-width: 992px) {
  .tabbar {
    inset-inline-start: 0; inset-inline-end: auto; top: 0; bottom: 0;
    width: var(--zc-rail-w); height: auto;
    flex-direction: column; justify-content: flex-start; gap: 6px;
    padding: 20px 0; border-top: 0; border-inline-end: 1px solid var(--border-subtle);
    background-color: var(--bg-surface); background-image: var(--grad-surface);
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .app.no-tabbar .tabbar { transform: translateX(110%); }
  .tabbar .rail-brand { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 18px; border-radius: var(--zx-r-md);
    background: var(--grad-brand); color: #fff; font-size: 22px; box-shadow: var(--shadow-glow); }
  .tab { flex: 0 0 auto; max-width: none; padding: 8px 0; }
  .tab-icon { width: 60px; height: 34px; }
  .app:not(.no-tabbar) .stacks { inset-inline-start: var(--zc-rail-w); }
  .page-scroll, .app .page-scroll { padding-bottom: 48px; }
  .page:not(.is-modal):not(.no-tabbar) .page-footer { margin-bottom: 0; padding-bottom: 12px; }
  .appbar { padding-inline: max(8px, calc((100% - var(--zc-content-max)) / 2)); }
  .snackbar-root { bottom: 24px !important; }
}

/* ---------- Buttons ----------
   Skin = DS (.btn-primary gradient pill, .btn-secondary hairline, .btn-ghost,
   .btn-aurum for the one decisive action, .btn-danger soft). The panel only adds
   the 44px touch target, icon gap, Persian size and a loading state. */
.btn {
  --bs-btn-font-size: var(--zc-fs-body-sm);
  min-height: var(--zc-touch); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-lg { --bs-btn-font-size: var(--zc-fs-body); min-height: 52px; }
.btn-sm { --bs-btn-font-size: var(--zc-fs-label); --bs-btn-padding-y: .35rem; min-height: 36px; }
.btn > * { position: relative; z-index: 1; } /* above the primary sheen */
/* AA on the gradient: the DS shows the dark end of --grad-brand under the label.
   Dark theme uses dark ink (--fg-on-brand) → show the bright half; light theme uses
   white ink → keep the dark half on hover too (the sheen still sweeps). ≥4.5:1 both. */
[data-bs-theme="dark"] .btn-primary, [data-bs-theme="dark"] .fab { background-position: 66% 50%; }
[data-bs-theme="dark"] .btn-primary:hover, [data-bs-theme="dark"] .btn-primary:focus, [data-bs-theme="dark"] .fab:hover { background-position: 90% 50%; }
[data-bs-theme="light"] .btn-primary:hover, [data-bs-theme="light"] .btn-primary:focus, [data-bs-theme="light"] .fab:hover { background-position: 12% 50%; }
.btn-secondary { --bs-btn-disabled-opacity: .55; }
.btn-ghost { --bs-btn-color: var(--fg-brand); --bs-btn-hover-color: var(--fg-brand); --bs-btn-active-color: var(--fg-brand); }
/* DS: .btn-aurum keeps dark ink on the gold gradient in both themes (white fails contrast in light) */
.btn-aurum, .btn-aurum:hover, .btn-aurum:focus, .btn-aurum:active, [data-bs-theme="light"] .btn-aurum { color: #1A1408; font-weight: 600; }
.btn-danger { --bs-btn-active-color: var(--fg-inverse); --bs-btn-active-bg: var(--danger); --bs-btn-active-border-color: var(--danger); }
.btn.is-loading { pointer-events: none; opacity: .85; }
.btn.is-loading::after { content: ""; position: static; inset: auto; transform: none; background: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite; }
.btn-block { width: 100%; }
.btn:focus-visible { box-shadow: var(--ring) !important; }

/* ---------- Surfaces / cards (DS .card) ---------- */
.zc-card {
  position: relative;
  background-color: var(--bg-surface); background-image: var(--grad-surface);
  border: 1px solid var(--border-subtle); border-radius: var(--zx-r-lg); box-shadow: var(--shadow-sm);
  padding: var(--zx-s-4);
  transition: transform var(--zx-d-base) var(--zx-ease-out), box-shadow var(--zx-d-base) var(--zx-ease-out), border-color var(--zx-d-base) var(--zx-ease);
}
.zc-card + .zc-card { margin-top: var(--zc-space-3); }
.zc-card.flat { box-shadow: none; background-image: none; background-color: var(--bg-inset); }
/* tinted = DS .card-feature (glow + hairline) */
.zc-card.tinted { border-color: var(--border-default); box-shadow: var(--shadow-glow); background-image: radial-gradient(420px 220px at 100% 0%, var(--accent-soft), transparent 70%); }
.zc-card.tinted::before { content: ""; position: absolute; inset-inline: var(--zx-s-5); top: 0; height: 1px; background: var(--grad-hairline); }
.zc-card.tinted .bi { color: var(--fg-brand); }
.zc-card.tap { cursor: pointer; }
.zc-card.tap:active { transform: scale(.985); }
@media (hover: hover) { .zc-card.tap:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-default); } }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-title-row h3 { font-size: var(--zc-fs-title); font-weight: 500; }

.section { margin-top: var(--zc-space-6); }
.section:first-child { margin-top: var(--zc-space-2); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 4px 10px; min-height: 28px; }
/* Section title = DS eyebrow (hairline after the label), Persian-safe */
.section-title { flex: 1; display: flex; align-items: center; gap: var(--zx-s-3); font-size: var(--zc-fs-label); font-weight: 600; color: var(--fg-secondary); }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--grad-hairline); min-width: 24px; }
.section-head .btn-ghost { min-height: 36px; padding: 2px 12px; font-size: var(--zc-fs-label); flex: 0 0 auto; }

/* ---------- Grouped lists (iOS inset rows on a DS card surface) ---------- */
.list { background-color: var(--bg-surface); background-image: var(--grad-surface); border-radius: var(--zx-r-lg); overflow: hidden; border: 1px solid var(--border-subtle); box-shadow: var(--shadow-xs); margin: 0; padding: 0; list-style: none; }
.list-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 10px 16px; width: 100%;
  background: transparent; color: inherit; border: 0; text-align: start; font: inherit;
  transition: background-color var(--zx-d-fast) var(--zx-ease);
}
button.list-item, a.list-item, .list-item.tap { cursor: pointer; }
@media (hover: hover) { button.list-item:hover, a.list-item:hover, .list-item.tap:hover { background: var(--bg-hover); color: var(--fg-primary); } }
button.list-item:active, a.list-item:active, .list-item.tap:active { background: var(--bg-active); }
.list-item + .list-item::before, .list > li + li > .list-item::before, .list > .swipe-row + .swipe-row::before {
  content: ""; position: absolute; top: 0; inset-inline-start: 64px; inset-inline-end: 0; height: 1px; background: var(--border-subtle);
}
.list.no-icons .list-item + .list-item::before { inset-inline-start: 16px; }
/* Icon tile — soft tint of --tone (default: brand). Inline style sets --tone:var(--success|--warning|--danger|--aurum|--fg-secondary) */
.li-icon { --tone: var(--fg-brand); flex: 0 0 36px; width: 36px; height: 36px; border-radius: var(--zx-r-md); display: grid; place-items: center; font-size: 18px;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 18%, transparent); }
.li-icon.soft { --tone: var(--fg-brand); }
.li-body { flex: 1; min-width: 0; }
.li-title { font-weight: 500; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-primary); }
.li-sub { font-size: var(--zc-fs-label); color: var(--fg-secondary); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub.wrap, .li-title.wrap { white-space: normal; }
.li-trail { display: flex; align-items: center; gap: 6px; color: var(--fg-secondary); font-size: var(--zc-fs-label); flex-shrink: 0; }
.li-chev { color: var(--fg-muted); font-size: 14px; }
.list-item.danger, .list-item.danger .li-title { color: var(--danger); }
.list-item.danger .li-icon { --tone: var(--danger); }

/* Avatar = admin .zx-avatar */
.avatar { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 15px;
  background: var(--grad-brand); color: #fff; }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; box-shadow: var(--shadow-glow); }
.avatar.sel { background: var(--accent); color: var(--fg-on-brand); }

/* ---------- Badges / status chips = DS soft badges (.badge.badge-soft-*) ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; line-height: 1.5; border-radius: var(--zx-r-pill); vertical-align: middle; }
.badge:lang(fa) { font-size: 12px; font-weight: 500; padding: .2em .75em; }
.badge .bi { font-size: 12px; }
.badge-soft-warning { color: var(--zc-warning-text) !important; }
/* Light theme: success / aurum are ~4.2:1 on their soft tint → darken the ink slightly for AA. */
[data-bs-theme="light"] .badge-soft-success { color: color-mix(in srgb, var(--success) 85%, var(--fg-primary)) !important; }
[data-bs-theme="light"] .badge-soft-aurum, [data-bs-theme="light"] .text-aurum { color: color-mix(in srgb, var(--aurum) 80%, var(--fg-primary)) !important; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }

/* ---------- Filter chips = DS .zx-chip (state via aria-pressed / aria-checked) ---------- */
.filter-chip { flex: 0 0 auto; position: relative; min-height: 36px; font: inherit; font-size: var(--zc-fs-label); font-weight: 500; color: var(--fg-secondary); white-space: nowrap; }
.filter-chip::after { content: ""; position: absolute; inset: -4px 0; } /* 44px hit area */
.filter-chip.ltr { direction: ltr; font-family: var(--zx-font-mono); font-size: var(--zc-fs-caption); }
.zx-chip[aria-pressed="true"], .zx-chip[aria-checked="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--fg-brand); }
.zx-chip:focus-visible { box-shadow: var(--ring) !important; border-radius: var(--zx-r-pill); }

/* ---------- Segmented control = DS .zx-segment (pill track; JS sets aria-checked) ---------- */
.segmented { display: flex; padding: 4px; gap: 2px; background: var(--bg-inset); border: 1px solid var(--border-subtle); border-radius: var(--zx-r-pill); position: relative; }
.segmented button { flex: 1; min-height: 40px; border: 0; background: transparent; border-radius: var(--zx-r-pill); font: inherit; font-size: var(--zc-fs-label); font-weight: 500;
  color: var(--fg-secondary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; white-space: nowrap;
  transition: background-color var(--zx-d-base) var(--zx-ease), color var(--zx-d-base) var(--zx-ease), box-shadow var(--zx-d-base) var(--zx-ease); }
.segmented button:hover { color: var(--fg-primary); }
.segmented button[aria-checked="true"], .segmented button[aria-selected="true"] { background: var(--bg-raised); color: var(--fg-primary); box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--border-subtle); }
.segmented button:focus-visible { border-radius: var(--zx-r-pill); }
@media (pointer: coarse) { .segmented button { min-height: 44px; } }

/* ---------- Forms (DS form-control / form-select / input-group) ---------- */
.field { margin-bottom: var(--zc-space-4); }
.field-label { display: block; font-weight: 500; font-size: var(--zc-fs-label); margin-bottom: 6px; color: var(--fg-secondary); }
.field-label .req { color: var(--danger); margin-inline-start: 2px; }
.field-hint { font-size: var(--zc-fs-caption); color: var(--fg-secondary); margin-top: 6px; line-height: 1.6; }
.form-control, .form-select { font-size: 16px; /* no iOS zoom */ }
textarea.form-control { min-height: 96px; line-height: 1.8; height: auto; }
.form-control::placeholder { color: var(--fg-muted); opacity: 1; }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--danger); background-image: none; padding-inline-end: var(--zx-s-4); box-shadow: 0 0 0 3px var(--danger-soft); }
.form-control.is-valid { border-color: var(--success); background-image: none; }
.invalid-feedback { color: var(--danger); font-size: var(--zc-fs-caption); font-weight: 500; }
.valid-feedback { color: var(--success); font-size: var(--zc-fs-caption); font-weight: 500; }
.form-control.ltr-input, input[dir="ltr"] { direction: ltr; text-align: left; }
/* card number / IBAN / codes in JetBrains Mono (DS: codes & numbers) */
#card_number, #sheba, #w-sheba, #code, #slug, .form-control.mono { font-family: var(--zx-font-mono); letter-spacing: .02em; }
.input-affix { position: relative; display: flex; align-items: stretch; }
.input-affix .form-control { flex: 1; }
.input-affix .affix { display: flex; align-items: center; padding: 0 12px; color: var(--fg-muted); font-weight: 500; background: var(--bg-inset); border: 1px solid var(--border-subtle); font-family: var(--zx-font-mono); font-size: var(--zc-fs-label); }
.input-affix:focus-within .affix { color: var(--accent); }
.input-affix .affix.start { border-inline-end: 0; border-radius: 0 var(--zx-r-md) var(--zx-r-md) 0; }
.input-affix .affix.end { border-inline-start: 0; border-radius: var(--zx-r-md) 0 0 var(--zx-r-md); }
.input-affix .affix.start + .form-control { border-radius: var(--zx-r-md) 0 0 var(--zx-r-md); }
.input-affix .form-control:has(+ .affix.end) { border-radius: 0 var(--zx-r-md) var(--zx-r-md) 0; }
.input-affix[dir="ltr"] .affix.start { border-radius: var(--zx-r-md) 0 0 var(--zx-r-md); border-inline-end: 0; }
.input-affix[dir="ltr"] .affix.start + .form-control { border-radius: 0 var(--zx-r-md) var(--zx-r-md) 0; }
.input-icon-btn { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); }
.form-select option { color: var(--fg-primary); background-color: var(--bg-raised); }

/* Switch rows host DS .zx-switch (markup: <span|label class="zx-switch"><input><span class="track"></span>) */
.switch-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px; background: transparent; cursor: pointer; }
.switch-row .li-body { cursor: pointer; }
.zx-switch { position: relative; flex: 0 0 auto; min-height: var(--zc-touch); }
.zx-switch input:disabled + .track { opacity: .45; cursor: not-allowed; }
.zx-check { position: relative; min-height: 28px; color: var(--fg-primary); }
.zx-check .box { margin-top: 0; }
.zx-check.align-items-start .box { margin-top: 3px; }
.form-range { height: 32px; }

.color-input { width: 50px; height: 50px; padding: 4px; border-radius: var(--zx-r-md); border: 1px solid var(--border-default); background: var(--bg-inset); cursor: pointer; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--bg-surface); box-shadow: 0 0 0 1px var(--border-default); cursor: pointer; padding: 0; position: relative; }
.swatch::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--accent), var(--shadow-glow); }

/* Notice / callout = DS .alert (markup: .alert.alert-{info|success|warning|danger}.notice).
   Body text stays --fg-primary for AA in both themes (as admin .zx-flash); the
   status colour drives the 3px start bar and the icon. */
.notice { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 0; padding: 12px 14px; padding-inline-start: 16px; font-size: var(--zc-fs-body-sm); line-height: 1.7; color: var(--fg-primary) !important; }
.notice.mb-3 { margin-bottom: 1rem; }
.notice > .bi { font-size: 20px; line-height: 1.3; flex-shrink: 0; }
.notice.alert-info > .bi, .notice.alert-info::before { color: var(--accent); background-color: transparent; }
.notice.alert-success > .bi { color: var(--success); }
.notice.alert-warning > .bi { color: var(--warning); }
.notice.alert-danger > .bi { color: var(--danger); }
.notice.alert-info::before { background: var(--accent); }
.notice.alert-success::before { background: var(--success); }
.notice.alert-warning::before { background: var(--warning); }
.notice.alert-danger::before { background: var(--danger); }
.notice b { font-weight: 700; }
.notice a { color: var(--fg-brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Skeleton (DS .placeholder-glow / .placeholder shimmer) ---------- */
.placeholder.skel { display: block; width: 100%; min-height: 0; opacity: 1; cursor: wait; border-radius: var(--zx-r-sm); }
.skel-line { height: 14px; margin: 8px 0; }
.skel-line.w50 { width: 50%; } .skel-line.w70 { width: 70%; } .skel-line.w30 { width: 30%; }
.skel-block { height: 120px; border-radius: var(--zx-r-lg) !important; margin-bottom: 12px; }
.skel-card { aspect-ratio: 1.586; border-radius: var(--zx-r-lg) !important; margin-bottom: 14px; }
.skel-row { display: flex; gap: 12px; align-items: center; padding: 12px 16px; }
.placeholder.skel-circle { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.placeholder-glow .stat-grid .placeholder { border-radius: var(--zx-r-lg); }

/* ---------- Empty / error states = admin .zx-empty ---------- */
.state { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.state-art { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; margin-bottom: 6px;
  background: var(--accent-soft); color: var(--fg-brand); box-shadow: var(--shadow-glow); }
.state.error .state-art { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.state h3 { font-size: var(--zc-fs-title); font-weight: 500; }
.state p { color: var(--fg-secondary); max-width: 340px; margin: 0 auto 8px; font-size: var(--zc-fs-body-sm); }

/* ---------- FAB (brand gradient pill, glow) ---------- */
.fab {
  position: absolute; z-index: 6; inset-inline-start: auto; inset-inline-end: calc(18px + var(--zc-safe-left));
  bottom: calc(var(--zc-tabbar-h) + var(--zc-safe-bottom) + 18px);
  height: 56px; min-width: 56px; padding: 0 22px; border-radius: var(--zx-r-pill); border: 0;
  background: var(--grad-brand); background-size: 180% 180%; background-position: 12% 50%;
  color: var(--fg-on-brand); box-shadow: var(--shadow-glow), var(--shadow-md);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; cursor: pointer;
  transition: transform var(--zx-d-base) var(--zx-ease-out), opacity var(--zx-d-base) var(--zx-ease), background-position var(--zx-d-slow) var(--zx-ease);
}
[data-bs-theme="light"] .fab { color: #fff; }
.fab:hover { background-position: 88% 50%; }
.fab .bi { font-size: 22px; }
.fab:active { transform: scale(.94); }
.fab.hide { transform: translateY(24px) scale(.8); opacity: 0; pointer-events: none; }
@media (min-width: 992px) { .fab { bottom: 28px; inset-inline-end: max(24px, calc((100% - var(--zc-content-max)) / 2 - 80px)); } }

/* ---------- Toast / Snackbar (DS .toast: raised surface) ---------- */
.toast-root { position: fixed; top: calc(var(--zc-safe-top) + 10px); inset-inline: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast-app { pointer-events: auto; display: inline-flex; align-items: center; gap: 10px; max-width: 420px;
  background: var(--bg-raised); color: var(--fg-primary); border: 1px solid var(--border-default); padding: 10px 18px; border-radius: var(--zx-r-pill);
  font-weight: 500; font-size: var(--zc-fs-body-sm); box-shadow: var(--shadow-md);
  animation: toastIn var(--zx-d-slow) var(--zx-ease-out) both; }
.toast-app.out { animation: toastOut var(--zx-d-base) var(--zx-ease-in-out) both; }
.toast-app .bi { font-size: 18px; color: var(--fg-brand); }
.toast-app.success .bi { color: var(--success); } .toast-app.error .bi { color: var(--danger); } .toast-app.warning .bi { color: var(--warning); }
@keyframes toastIn { from { transform: translateY(-24px) scale(.96); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(-16px); opacity: 0; } }

.snackbar-root { position: fixed; inset-inline: 0; bottom: calc(var(--zc-tabbar-h) + var(--zc-safe-bottom) + 12px); z-index: 85; display: flex; justify-content: center; padding: 0 12px; pointer-events: none; }
.app.no-tabbar ~ .snackbar-root, .snackbar-root.low { bottom: calc(var(--zc-safe-bottom) + 16px); }
.snackbar { pointer-events: auto; display: flex; align-items: center; gap: 12px; width: 100%; max-width: 520px; min-height: 52px;
  background: var(--bg-raised); color: var(--fg-primary); border: 1px solid var(--border-default); border-radius: var(--zx-r-md); padding: 6px 8px; padding-inline: 16px 8px;
  box-shadow: var(--shadow-lg); animation: snackIn var(--zx-d-slow) var(--zx-ease-out) both; font-size: var(--zc-fs-body-sm); font-weight: 500; }
.snackbar.out { animation: snackOut var(--zx-d-base) var(--zx-ease-in-out) both; }
.snackbar .msg { flex: 1; }
.snackbar button { border: 0; background: transparent; color: var(--fg-brand); font: inherit; font-weight: 600; min-height: 44px; padding: 0 14px; border-radius: var(--zx-r-pill); cursor: pointer; }
.snackbar button:hover { background: var(--bg-hover); }
@keyframes snackIn { from { transform: translateY(30px); opacity: 0; } }
@keyframes snackOut { to { transform: translateY(20px); opacity: 0; } }

/* ---------- Bottom sheet (DS offcanvas/modal: raised surface, overlay token) ---------- */
.overlay-root { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.overlay-root > * { pointer-events: auto; }
.sheet-backdrop { position: fixed; inset: 0; background: var(--bg-overlay); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); opacity: 0; transition: opacity var(--zx-d-base) var(--zx-ease); }
.sheet-backdrop.show { opacity: 1; }
.sheet {
  position: fixed; inset-inline: 0; bottom: 0; margin: 0 auto; max-width: 560px;
  max-height: calc(100dvh - var(--zc-safe-top) - 24px);
  background: var(--bg-raised); border: 1px solid var(--border-default); border-bottom: 0;
  border-radius: var(--zx-r-xl) var(--zx-r-xl) 0 0;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform var(--zx-d-slow) var(--zx-ease-out);
  padding-bottom: var(--zc-safe-bottom);
}
.sheet::before { content: ""; position: absolute; inset-inline: var(--zx-s-6); top: 0; height: 1px; background: var(--grad-hairline); }
.sheet.show { transform: translateY(0); }
.sheet.dragging { transition: none; }
.sheet-grab { flex: 0 0 auto; padding: 10px 0 2px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--border-strong); }
.sheet-header { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 4px 12px 8px 12px; touch-action: none; }
.sheet-header h2 { flex: 1; font-size: var(--zc-fs-title); font-weight: 500; text-align: center; }
.sheet-header .icon-btn { flex: 0 0 auto; }
.sheet-header .spacer { width: 44px; }
.sheet-body { flex: 1 1 auto; overflow-y: auto; padding: 4px var(--zc-gutter) 20px; overscroll-behavior: contain; }
.sheet-footer { flex: 0 0 auto; padding: 10px var(--zc-gutter) 14px; border-top: 1px solid var(--border-subtle); display: flex; gap: 10px; }
@media (min-width: 992px) { .sheet { bottom: 24px; border-radius: var(--zx-r-xl); border-bottom: 1px solid var(--border-default); } }

/* Action sheet (DS dropdown items) */
.action-list { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.action-item { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 8px 12px; border: 0; background: none; font: inherit; font-weight: 500;
  color: var(--fg-primary); border-radius: var(--zx-r-md); cursor: pointer; text-align: start; width: 100%; transition: background-color var(--zx-d-fast) var(--zx-ease); }
.action-item:active, .action-item:hover { background: var(--bg-hover); }
.action-item .bi { font-size: 20px; width: 28px; text-align: center; color: var(--fg-secondary); }
.action-item:hover .bi { color: var(--fg-brand); }
.action-item.danger, .action-item.danger .bi { color: var(--danger); }
.action-item.danger:hover { background: var(--danger-soft); }
.action-item .ai-sub { display: block; font-weight: 400; font-size: var(--zc-fs-caption); color: var(--fg-secondary); }

/* ---------- Dialog (DS modal + admin .zx-confirm) ---------- */
.dialog-wrap { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; }
.dialog { width: 100%; max-width: 380px; background: var(--bg-raised); border: 1px solid var(--border-default); border-radius: var(--zx-r-lg); padding: 28px 22px 18px; box-shadow: var(--shadow-lg);
  transform: scale(.94); opacity: 0; transition: transform var(--zx-d-base) var(--zx-ease-out), opacity var(--zx-d-fast) var(--zx-ease); text-align: center; position: relative; }
.dialog::before { content: ""; position: absolute; inset-inline: var(--zx-s-5); top: 0; height: 1px; background: var(--grad-hairline); }
.dialog.show { transform: scale(1); opacity: 1; }
.dialog-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: var(--accent-soft); color: var(--fg-brand); box-shadow: var(--shadow-glow); }
.dialog.danger .dialog-icon { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.dialog h2 { font-size: var(--zc-fs-title); font-weight: 500; margin-bottom: 8px; }
.dialog p { color: var(--fg-secondary); font-size: var(--zc-fs-body-sm); }
.dialog-actions { display: flex; gap: 10px; margin-top: 20px; }
.dialog-actions .btn { flex: 1; }

/* ---------- Swipe rows ---------- */
.swipe-row { position: relative; overflow: hidden; background: var(--bg-surface); }
.swipe-content { position: relative; z-index: 1; background: var(--bg-surface); transition: transform var(--zx-d-base) var(--zx-ease-out); touch-action: pan-y; }
.swipe-row.dragging .swipe-content { transition: none; }
.swipe-actions { position: absolute; top: 0; bottom: 0; inset-inline-end: 0; display: flex; z-index: 0; }
.swipe-actions button { width: 76px; border: 0; font: inherit; font-size: 12px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.swipe-actions button .bi { font-size: 20px; }
.swipe-actions .sa-edit { background: var(--fg-brand); color: var(--fg-inverse); }
.swipe-actions .sa-delete { background: var(--danger); color: var(--fg-inverse); }
.swipe-actions .sa-neutral { background: var(--fg-secondary); color: var(--fg-inverse); }

/* ---------- Reorder ---------- */
.reorder-item { touch-action: pan-y; position: relative; }
.reorder-item.lifted { z-index: 10; transform: scale(1.03); box-shadow: var(--shadow-lg); transition: box-shadow var(--zx-d-fast) var(--zx-ease), transform var(--zx-d-fast) var(--zx-ease); }
.reorder-item.dragging { transition: none !important; }
.drag-handle { cursor: grab; touch-action: none; color: var(--fg-muted); }

/* ---------- Home: page-link hero (admin .zx-hero) ---------- */
.hero-link {
  position: relative; overflow: hidden; border-radius: var(--zx-r-xl); padding: 18px; color: var(--fg-primary);
  background-color: var(--bg-surface); border: 1px solid var(--border-default); box-shadow: var(--shadow-glow);
}
.hero-link::before { content: ""; position: absolute; inset-inline: 28px; top: 0; height: 1px; background: var(--grad-hairline); z-index: 1; }
.hero-link::after { content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%; inset-inline-end: -120px; top: -150px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%); pointer-events: none; }
.hero-link.is-aurum { border-color: color-mix(in srgb, var(--aurum) 32%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--aurum) 18%, transparent), 0 14px 40px -16px color-mix(in srgb, var(--aurum) 45%, transparent); }
.hero-link.is-aurum::after { background: radial-gradient(circle, var(--aurum-soft), transparent 70%); }
.hero-link > * { position: relative; z-index: 1; }
.hero-link .hl-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.hero-link .hl-title { font-size: var(--zc-fs-title); font-weight: 600; }
.hero-link .hl-heading { font-size: var(--zc-fs-title-lg); font-weight: 500; margin: 6px 0; }
.hero-link .hl-logo { width: 48px; height: 48px; border-radius: var(--zx-r-md); background: var(--accent-soft); color: var(--fg-brand); border: 1px solid var(--border-default); display: grid; place-items: center; font-size: 22px; overflow: hidden; }
.hero-link .hl-logo img { width: 100%; height: 100%; object-fit: cover; }
.hero-link .hl-url { width: 100%; display: flex; align-items: center; gap: 8px; background: var(--bg-inset); border: 1px solid var(--border-subtle); color: var(--fg-primary);
  border-radius: var(--zx-r-md); padding: 10px 14px; min-height: 48px; font: inherit; font-weight: 500; font-size: 16px; cursor: pointer;
  transition: border-color var(--zx-d-base) var(--zx-ease), background-color var(--zx-d-base) var(--zx-ease); }
.hero-link .hl-url:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.hero-link .hl-url .bi { color: var(--fg-brand); }
.hero-link .hl-url span { direction: ltr; unicode-bidi: isolate; flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--zx-font-mono); font-size: 15px; }
.hero-link .hl-url .hl-code { flex: 0 1 auto; text-align: center; font-size: 22px; letter-spacing: .18em; color: var(--fg-primary); }
.hero-link .hl-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.hero-link .hl-actions .btn { padding-inline: 8px; }
.hero-link .muted-w { color: var(--fg-secondary); font-size: var(--zc-fs-label); }
.hero-link .icon-btn { color: var(--fg-secondary); }

/* Stat tiles = admin .zx-stat */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.stat-tile { background-color: var(--bg-surface); background-image: var(--grad-surface); border: 1px solid var(--border-subtle); border-radius: var(--zx-r-lg); padding: 12px 14px; box-shadow: var(--shadow-xs); min-width: 0; }
.stat-tile .st-label { font-size: var(--zc-fs-caption); color: var(--fg-secondary); display: flex; align-items: center; gap: 6px; }
.stat-tile .st-label .bi { color: var(--fg-brand); }
.stat-tile .st-value { font-size: 24px; font-weight: 300; line-height: 1.45; color: var(--fg-primary); font-variant-numeric: tabular-nums; }
.stat-tile .st-delta { font-size: 11.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-tile .st-delta.up { color: var(--success); } .stat-tile .st-delta.down { color: var(--danger); }

/* Quick actions (DS .btn-icon tiles) */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.qa { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 2px; border: 0; background: none; font: inherit; color: var(--fg-secondary); cursor: pointer; border-radius: var(--zx-r-lg); font-size: 12.5px; font-weight: 500; text-align: center; line-height: 1.4; transition: color var(--zx-d-base) var(--zx-ease); }
.qa:hover { color: var(--fg-primary); }
.qa:active { background: var(--bg-hover); }
.qa-icon { width: 54px; height: 54px; border-radius: var(--zx-r-lg); display: grid; place-items: center; font-size: 22px; background: var(--bg-inset); border: 1px solid var(--border-subtle); color: var(--fg-brand);
  transition: border-color var(--zx-d-base) var(--zx-ease), background-color var(--zx-d-base) var(--zx-ease), transform var(--zx-d-base) var(--zx-ease-out); }
.qa:hover .qa-icon { border-color: var(--border-strong); background: var(--bg-hover); transform: translateY(-2px); }

/* Progress = DS .progress (gradient bar on inset track) */
.progress-app { height: 6px; border-radius: 3px; background: var(--bg-inset); border: 1px solid var(--border-subtle); overflow: hidden; }
.progress-app > span { display: block; height: 100%; border-radius: 3px; background: var(--grad-brand); transition: width .6s var(--zx-ease-out); }
.progress-app.warn > span { background: var(--warning); } .progress-app.danger > span { background: var(--danger); } .progress-app.ok > span { background: var(--grad-brand); }

.checklist .list-item .check { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border-default); background: var(--bg-inset); display: grid; place-items: center; flex-shrink: 0; color: transparent; }
.checklist .list-item.done .check { background: var(--grad-brand); border-color: transparent; color: var(--fg-on-brand); }
[data-bs-theme="light"] .checklist .list-item.done .check { color: #fff; }
.checklist .list-item.done .li-title { text-decoration: line-through; color: var(--fg-secondary); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; display: flex; gap: 14px; padding-bottom: 20px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; top: 30px; bottom: 0; inset-inline-start: 13px; width: 2px; background: var(--border-default); }
.timeline li:last-child::before { display: none; }
.timeline li.done::before { background: var(--accent); }
.tl-dot { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-inset); color: var(--fg-secondary); font-size: 14px; position: relative; z-index: 1; border: 1px solid var(--border-default); }
.timeline li.done .tl-dot { background: var(--grad-brand); color: #fff; border-color: transparent; }
.timeline li.current .tl-dot { background: var(--bg-surface); color: var(--fg-brand); border-color: var(--accent); box-shadow: var(--ring); }
.timeline li.failed .tl-dot { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.tl-body { flex: 1; min-width: 0; padding-top: 2px; }
.tl-title { font-weight: 500; }
.tl-sub { font-size: var(--zc-fs-caption); color: var(--fg-secondary); }

/* ---------- OTP (DS inputs, mono digits) ---------- */
.otp { display: flex; gap: 10px; justify-content: center; direction: ltr; }
.otp input { width: 54px; height: 62px; text-align: center; font-family: var(--zx-font-mono); font-size: 26px; font-weight: 500; border-radius: var(--zx-r-md); border: 1px solid var(--border-default); background: var(--bg-inset); color: var(--fg-primary); caret-color: var(--accent); padding: 0;
  transition: border-color var(--zx-d-base) var(--zx-ease), box-shadow var(--zx-d-base) var(--zx-ease), background-color var(--zx-d-base) var(--zx-ease); }
.otp input:focus { border-color: var(--accent); box-shadow: var(--ring); background: var(--bg-surface); }
.otp.error input { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.otp input.filled { border-color: var(--border-strong); }
.shake { animation: shake .42s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }
@media (max-width: 360px) { .otp { gap: 6px; } .otp input { width: 48px; height: 56px; } }

/* ---------- Auth / onboarding ---------- */
.auth-hero { text-align: center; padding: 28px 0 20px; }
.brand-mark { width: 76px; height: 76px; border-radius: var(--zx-r-xl); margin: 0 auto 16px; display: grid; place-items: center; font-size: 36px; color: #fff; background: var(--grad-brand); box-shadow: var(--shadow-glow); }
.brand-mark.is-aurum { background: var(--grad-aurum); color: #1A1408; box-shadow: 0 12px 34px -14px color-mix(in srgb, var(--aurum) 70%, transparent); }
.auth-hero h1 { font-size: var(--zc-fs-headline); font-weight: 300; margin-bottom: 6px; }
.auth-hero p { color: var(--fg-secondary); }

.onb { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg-canvas); padding-top: var(--zc-safe-top); padding-bottom: var(--zc-safe-bottom); }
.onb-top { display: flex; justify-content: flex-end; padding: 8px 12px; }
.onb-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.onb-track::-webkit-scrollbar { display: none; }
.onb-slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px 32px; }
.onb-art { --tone: var(--fg-brand); width: min(260px, 64vw); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; margin-bottom: 32px; position: relative;
  color: var(--tone); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--tone) 22%, transparent), color-mix(in srgb, var(--tone) 4%, transparent) 70%);
  border: 1px solid color-mix(in srgb, var(--tone) 24%, transparent); box-shadow: 0 24px 60px -24px color-mix(in srgb, var(--tone) 50%, transparent); }
.onb-art .bi { font-size: 96px; }
.onb-slide h2 { font-size: var(--zc-fs-headline); font-weight: 300; margin-bottom: 10px; }
.onb-slide p { color: var(--fg-secondary); max-width: 340px; }
.onb-bottom { padding: 16px 24px 20px; display: flex; flex-direction: column; gap: 18px; max-width: 480px; width: 100%; margin: 0 auto; }
.onb-dots { display: flex; justify-content: center; gap: 8px; }
.onb-dots span { width: 8px; height: 8px; border-radius: 4px; background: var(--border-strong); transition: width var(--zx-d-base) var(--zx-ease-out), background-color var(--zx-d-base) var(--zx-ease); }
.onb-dots span.on { width: 26px; background: var(--grad-brand); }

/* ---------- Plans ---------- */
.plan-card { position: relative; border: 1px solid var(--border-subtle); border-radius: var(--zx-r-xl); padding: 18px; background-color: var(--bg-surface); background-image: var(--grad-surface); box-shadow: var(--shadow-sm); cursor: pointer;
  transition: border-color var(--zx-d-base) var(--zx-ease), box-shadow var(--zx-d-base) var(--zx-ease-out); }
.plan-card + .plan-card { margin-top: 14px; }
.plan-card[aria-checked="true"] { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.plan-card[aria-checked="true"]::before { content: ""; position: absolute; inset-inline: var(--zx-s-5); top: 0; height: 1px; background: var(--grad-hairline); }
.plan-card .plan-badge { position: absolute; top: -12px; inset-inline-start: 18px; background: var(--bg-raised) !important; }
.plan-card h3 { font-size: var(--zc-fs-title-lg); font-weight: 500; }
.plan-price { font-size: 26px; font-weight: 300; margin: 6px 0 0; }
.plan-price small { font-size: 13px; font-weight: 400; color: var(--fg-secondary); }
.plan-feats { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; font-size: var(--zc-fs-body-sm); color: var(--fg-secondary); }
.plan-feats li { display: flex; gap: 8px; align-items: center; }
.plan-feats .bi-check-circle-fill { color: var(--fg-brand); }
.plan-feats .bi-x-circle { color: var(--fg-muted); }
.price-table { width: 100%; font-size: var(--zc-fs-body-sm); }
.price-table td { padding: 7px 0; color: var(--fg-secondary); }
.price-table td:last-child { text-align: left; font-weight: 500; white-space: nowrap; color: var(--fg-primary); }
.price-table tr.minus td:last-child { color: var(--success); }
.price-table tr.total td { border-top: 1px dashed var(--border-default); padding-top: 12px; font-size: 17px; font-weight: 500; color: var(--fg-primary); }
.price-table tr.total td:last-child { font-size: 20px; font-weight: 600; }

.result-hero { text-align: center; padding: 40px 16px 16px; }
.result-icon { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center; font-size: 48px; animation: pop .5s var(--zx-ease-out) both; }
.result-icon.ok { background: var(--success-soft); color: var(--success); box-shadow: 0 0 0 1px color-mix(in srgb, var(--success) 30%, transparent), 0 16px 44px -16px color-mix(in srgb, var(--success) 60%, transparent); }
.result-icon.fail { background: var(--danger-soft); color: var(--danger); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

/* ---------- Phone frame (theme preview; device bezel) ---------- */
.phone-frame { width: 100%; max-width: 300px; margin: 0 auto; aspect-ratio: 9 / 18; border-radius: 40px; padding: 10px; background: var(--zx-abyss-950); border: 1px solid var(--border-default); box-shadow: var(--shadow-lg), var(--shadow-glow); position: relative; }
.phone-frame::before { content: ""; position: absolute; top: 16px; left: 50%; transform: translateX(-50%); width: 80px; height: 20px; border-radius: 12px; background: #000; z-index: 3; }
.phone-screen { width: 100%; height: 100%; border-radius: 31px; overflow: hidden; overflow-y: auto; position: relative; scrollbar-width: none; }
.phone-screen::-webkit-scrollbar { display: none; }
.phone-screen .pp { min-height: 100%; font-size: 13px; }
.theme-gallery { display: flex; gap: 12px; overflow-x: auto; padding: 6px 4px 12px; scroll-snap-type: x proximity; scrollbar-width: none; }
.theme-gallery::-webkit-scrollbar { display: none; }
.theme-tile { flex: 0 0 116px; scroll-snap-align: start; border: 1px solid var(--border-subtle); border-radius: var(--zx-r-lg); background: var(--bg-surface); padding: 8px; cursor: pointer; text-align: center; position: relative; font: inherit; color: var(--fg-primary);
  transition: border-color var(--zx-d-base) var(--zx-ease), box-shadow var(--zx-d-base) var(--zx-ease); }
.theme-tile:hover { border-color: var(--border-strong); }
.theme-tile[aria-checked="true"] { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.theme-thumb { height: 132px; border-radius: var(--zx-r-md); overflow: hidden; position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 14px; gap: 6px; }
.theme-thumb i.l { width: 28px; height: 28px; border-radius: 50%; display: block; }
.theme-thumb i.t { width: 60%; height: 6px; border-radius: 3px; display: block; }
.theme-thumb i.c { width: 80%; height: 34px; border-radius: 8px; display: block; margin-top: 4px; }
.theme-tile .tt-name { font-weight: 500; font-size: 13px; margin-top: 6px; }
.lock-badge { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--zx-abyss-900); color: var(--zx-aurum-300); border: 1px solid color-mix(in srgb, var(--zx-aurum-400) 40%, transparent); font-size: 13px; box-shadow: var(--shadow-sm); }

/* ---------- QR / stand (printed artefacts stay white) ---------- */
.qr-box { background: #fff; border-radius: var(--zx-r-xl); padding: 18px; display: grid; place-items: center; box-shadow: var(--shadow-md); border: 1px solid var(--border-subtle); max-width: 300px; margin: 0 auto; }
.qr-box canvas { width: 100%; height: auto; image-rendering: pixelated; }
.stand-wrap { display: grid; place-items: center; padding: 12px 0; perspective: 900px; }
.stand {
  width: min(280px, 80vw); aspect-ratio: 105 / 148; /* A6 */
  border-radius: 14px; padding: 18px 16px; background: #fff; color: #111; position: relative; overflow: hidden;
  box-shadow: var(--shadow-lg), 0 2px 0 #ddd; transform: rotateX(6deg);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.stand-band { position: absolute; inset-inline: 0; top: 0; height: 26%; }
.stand-logo { position: relative; z-index: 1; width: 52px; height: 52px; border-radius: 16px; background: #fff; display: grid; place-items: center; font-size: 22px; box-shadow: 0 4px 12px rgba(0,0,0,.18); margin-top: 8%; overflow: hidden; }
.stand-logo img { width: 100%; height: 100%; object-fit: cover; }
.stand-name { position: relative; z-index: 1; font-weight: 900; font-size: 15px; margin-top: 8px; }
.stand-cta { font-size: 11px; color: #444; margin: 2px 0 8px; }
.stand-qr { width: 58%; aspect-ratio: 1; }
.stand-qr canvas { width: 100%; height: 100%; }
.stand-url { margin-top: 8px; font-weight: 900; font-size: 14px; direction: ltr; letter-spacing: .3px; }
.stand-foot { margin-top: auto; font-size: 9px; color: #777; }
.stand-base { width: min(300px, 86vw); height: 16px; margin-top: -4px; border-radius: 0 0 16px 16px; background: linear-gradient(#d4d4d8, #a1a1aa); }

/* ---------- Charts ---------- */
.chart-box { position: relative; height: 240px; }
.chart-box.sm { height: 200px; }
.legend-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; margin-top: 12px; font-size: var(--zc-fs-label); color: var(--fg-secondary); }
.legend-list b { color: var(--fg-primary); font-weight: 600; }
.legend-list span.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: middle; }
.bar-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: var(--zc-fs-label); }
.bar-row .bl { width: 110px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.bar-row .bt { flex: 1; height: 8px; border-radius: 4px; background: var(--bg-inset); border: 1px solid var(--border-subtle); overflow: hidden; }
.bar-row .bt span { display: block; height: 100%; border-radius: 4px; background: var(--grad-brand); }
.bar-row .bv { width: 44px; text-align: left; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Message preview bubble ---------- */
.msg-preview { background: var(--bg-inset); border: 1px solid var(--border-subtle); border-radius: 20px 20px 6px 20px; padding: 12px 14px; white-space: pre-wrap; line-height: 1.9; font-size: var(--zc-fs-body-sm); position: relative; color: var(--fg-primary); }
.msg-preview.bale { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 22%, transparent); }
.msg-preview .var { background: var(--accent-soft); color: var(--fg-brand); border-radius: 6px; padding: 0 4px; font-weight: 500; font-family: var(--zx-font-mono); font-size: .92em; }
.msg-preview a, .msg-preview .lnk { color: var(--fg-brand); direction: ltr; unicode-bidi: isolate; }
.msg-meta { display: flex; justify-content: space-between; font-size: var(--zc-fs-caption); color: var(--fg-secondary); margin-top: 6px; }

/* ---------- Upload ---------- */
.upload-cover { position: relative; height: 120px; border-radius: var(--zx-r-lg); background: var(--bg-inset) center/cover no-repeat; border: 1px dashed var(--border-strong); display: grid; place-items: center; cursor: pointer; overflow: hidden; color: var(--fg-secondary); transition: border-color var(--zx-d-base) var(--zx-ease); }
.upload-cover:hover { border-color: var(--accent); }
.upload-logo { position: relative; width: 84px; height: 84px; border-radius: var(--zx-r-xl); background: var(--bg-surface) center/cover no-repeat; border: 3px solid var(--bg-canvas); box-shadow: var(--shadow-md); display: grid; place-items: center; margin: -42px auto 0; cursor: pointer; color: var(--fg-secondary); font-size: 26px; overflow: hidden; }
.upload-logo .edit, .upload-cover .edit { position: absolute; bottom: 6px; inset-inline-end: 6px; width: 30px; height: 30px; border-radius: 50%; background: var(--grad-brand); color: #fff; display: grid; place-items: center; font-size: 14px; }
.upload-logo .edit { bottom: 2px; inset-inline-end: 2px; width: 26px; height: 26px; font-size: 12px; }

/* ---------- Contact alpha index ---------- */
.alpha-head { position: sticky; top: 0; z-index: 2; padding: 6px 16px; font-weight: 600; font-size: var(--zc-fs-label); color: var(--fg-brand); background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle); }
.select-bar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--zx-r-lg); background: var(--bg-raised); border: 1px solid var(--accent); color: var(--fg-brand); margin-bottom: 10px; box-shadow: var(--shadow-glow); }
.checkmark { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border-default); background: var(--bg-inset); display: grid; place-items: center; color: transparent; flex-shrink: 0; font-size: 14px; }
.selected .checkmark { background: var(--grad-brand); border-color: transparent; color: #fff; }

.search-box { position: relative; margin-bottom: 12px; }
.search-box .bi-search { position: absolute; top: 50%; inset-inline-start: 16px; transform: translateY(-50%); color: var(--fg-muted); pointer-events: none; z-index: 1; }
.search-box .form-control { padding-inline-start: 44px; height: 46px; border-radius: var(--zx-r-pill); }
.search-box:focus-within .bi-search { color: var(--accent); }

/* ---------- Misc ---------- */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: var(--zc-fs-body-sm); border-bottom: 1px solid var(--border-subtle); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--fg-secondary); }
.kv .v { font-weight: 500; text-align: left; color: var(--fg-primary); }
.divider { height: 1px; background: var(--border-subtle); margin: 14px 0; }
.token-mask { font-family: var(--zx-font-mono); direction: ltr; unicode-bidi: isolate; letter-spacing: .06em; font-size: var(--zc-fs-label); }
.pill-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; border-radius: 11px; padding: 0 6px; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--fg-brand); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions .btn { flex: 1; }
.big-amount { font-size: 34px; font-weight: 300; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.link-like { background: none; border: 0; padding: 0; color: var(--fg-brand); font: inherit; font-weight: 500; cursor: pointer; min-height: 32px; }
.pattern-code { font-family: var(--zx-font-mono); font-size: var(--zc-fs-label); background: var(--bg-inset); border: 1px solid var(--border-subtle); border-radius: var(--zx-r-sm); padding: 1px 8px; direction: ltr; unicode-bidi: isolate; display: inline-block; color: var(--fg-primary); }
.limit-meter { display: flex; align-items: center; gap: 10px; font-size: var(--zc-fs-label); color: var(--fg-secondary); }
.limit-meter .progress-app { flex: 1; }
.cards-list { display: flex; flex-direction: column; gap: 16px; }
.card-row-tools { display: flex; align-items: center; gap: 4px; margin-top: 8px; padding: 0 4px; }
.card-row-tools .grow { flex: 1; min-width: 0; }
.hidden-card .bank-card { filter: grayscale(.8); opacity: .55; }
.table { --bs-table-color: var(--fg-secondary); }

/* ---------- Public page isolation ----------
   The customer page (.pp, themes.css) keeps its own look independent of the
   panel theme and of the DS globals (heading face, 50px inputs). */
.pp :is(h1, h2, h3, h4, h5, h6) { font-family: inherit; color: inherit; }
.pp .form-control { height: auto; padding: .6rem .9rem; font-size: 16px; line-height: 1.5; }
.pp .form-control:focus { background: var(--pp-surface); color: var(--pp-text); border-color: var(--pp-primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pp-primary) 20%, transparent); }
.pp a { transition: none; }

/* ---------- Print (invoice) ---------- */
@media print {
  body { overflow: visible; background: #fff; color: #000; }
  .tabbar, .appbar, .page-footer, .toast-root, .snackbar-root, .overlay-root, .no-print, .fab { display: none !important; }
  .app, .stacks, .stack, .page, .page-scroll { position: static !important; overflow: visible !important; height: auto !important; transform: none !important; display: block !important; padding: 0 !important; }
  .page[hidden], .stack[hidden] { display: none !important; }
  .page:not(.print-target) { display: none !important; }
  .zc-card { box-shadow: none; border: 1px solid #ccc; background: #fff; color: #000; }
}

/* ---------- Reduced motion (DS also zeroes transitions/animations) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .btn-primary::after { display: none; }
}
.page-scroll { scrollbar-width: thin; scrollbar-color: var(--border-default) transparent; }
/* Phone-sized / touch screens: no visible scrollbar, like native apps */
@media (max-width: 991.98px), (hover: none) and (pointer: coarse) {
  .page-scroll { scrollbar-width: none; }
  .page-scroll::-webkit-scrollbar { display: none; }
}
.notice > div { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Payment methods (checkout) + card-to-card ---------- */
.pay-method { width: 100%; text-align: start; }
.pay-method .li-check { margin-inline-start: auto; color: var(--accent); font-size: 20px; opacity: 0; transition: opacity var(--zx-d-fast, .15s); }
.pay-method.selected { box-shadow: inset 0 0 0 2px var(--accent); border-radius: var(--zx-r-md, 12px); }
.pay-method.selected .li-check { opacity: 1; }
.c2c-card .bank-card { margin-bottom: 4px; }
.c2c-amount { font-size: 22px; font-weight: 800; }
