/* =====================================================================
   DigitalMart — base design system
   Tokens, components and the three layout shells (store, user panel,
   admin). Page-specific rules live in front.css / account.css / admin.css.
   Rule: colours only through the variables declared in this block.
   ===================================================================== */

:root {
    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    /* accent (overridden by .theme-*) */
    --brand: #7c3aed;
    --brand-2: #a855f7;
    --brand-deep: #4c1d95;
    --brand-pink: #ec4899;
    --brand-glow: #c084fc;

    /* palette */
    --c-purple: #8b5cf6;
    --c-blue: #3b82f6;
    --c-teal: #14b8a6;
    --c-orange: #f97316;
    --c-pink: #ec4899;
    --c-green: #22c55e;
    --c-red: #ef4444;
    --c-indigo: #6366f1;
    --c-amber: #f59e0b;
    --c-gold: #fbbf24;
    --c-silver: #94a3b8;
    --c-bronze: #fb923c;
    /* brand colours for profile links */
    --c-youtube: #ff0000;
    --c-linkedin: #0a66c2;

    --success: #16a34a;
    --warning: #d97706;
    --danger: #e11d48;
    --info: #2563eb;
    --star: #f59e0b;

    --white: #ffffff;
    --black: #000000;

    /* surfaces (light) */
    --bg: #f5f4fb;
    --bg-glow: #ede9fe;
    --surface: #ffffff;
    /* QR codes stay dark-on-white in both themes so phones can scan them */
    --qr-dark: #111111;
    --qr-light: #ffffff;
    --surface-2: #f8f7fd;
    --surface-3: #f1eefb;
    --border: #ebe8f5;
    --border-strong: #ddd8ee;
    --text: #1c1a2e;
    --text-2: #4b4864;
    --muted: #8a87a0;

    /* admin sidebar */
    --side-bg: #1e1745;
    --side-bg-2: #2b1f5e;
    --side-text: #cfc9f0;
    --side-muted: #8f88bd;
    --side-line: #362b6e;

    --shadow-sm: 0 1px 2px color-mix(in srgb, var(--brand-deep) 6%, transparent);
    --shadow: 0 6px 24px color-mix(in srgb, var(--brand-deep) 8%, transparent);
    --shadow-lg: 0 18px 48px color-mix(in srgb, var(--brand-deep) 16%, transparent);
    /* Flat design: buttons, tabs and icon buttons have no glow (kept as a token so it can return in one place). */
    --shadow-brand: none;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    /* sale bar colour styles (Settings › Sale Bar) */
    --sale-navy-a: #0b1640; --sale-navy-b: #2c5fd6; --sale-navy-c: #4a8cf0;
    --sale-purple-a: #2a0f63; --sale-purple-b: #6d28d9; --sale-purple-c: #a855f7;
    --sale-sunset-a: #4a1209; --sale-sunset-b: #c2410c; --sale-sunset-c: #f97316;
    --sale-emerald-a: #052e2b; --sale-emerald-b: #047857; --sale-emerald-c: #10b981;
    --sale-gold-a: #fde68a; --sale-gold-b: #f59e0b;
    /* shape of product images (cards, gallery): matches the recommended 1600 × 1000 upload, so nothing is cut off */
    --product-ratio: 16 / 10;
    --radius-xl: 24px;
    --radius-pill: 999px;

    --header-h: 76px;
    --sidebar-w: 260px;
    --admin-side-w: 232px;
    --bottom-nav-h: 68px;
    --container: 1480px;
    --gap: 20px;
    --ease: cubic-bezier(.2, .8, .2, 1);

    --hero-grad: linear-gradient(120deg, var(--brand-deep) 0%, var(--brand) 55%, var(--brand-2) 100%);
    --promo-grad: linear-gradient(150deg, var(--brand-2) 0%, var(--brand) 55%, var(--brand-deep) 100%);
    --soft-grad: linear-gradient(160deg, color-mix(in srgb, var(--brand) 22%, var(--surface)) 0%, color-mix(in srgb, var(--brand-2) 8%, var(--surface)) 100%);
    --btn-grad: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    --highlight-grad: linear-gradient(90deg, var(--brand-pink), var(--brand-glow));
    --logo-a: #f43f5e;
    --logo-b: #6366f1;
}

.theme-blue { --brand: #2563eb; --brand-2: #3b82f6; --brand-deep: #1e3a8a; --brand-glow: #93c5fd; --brand-pink: #22d3ee; }
.theme-emerald { --brand: #059669; --brand-2: #10b981; --brand-deep: #064e3b; --brand-glow: #6ee7b7; --brand-pink: #a3e635; }
.theme-rose { --brand: #e11d48; --brand-2: #f43f5e; --brand-deep: #881337; --brand-glow: #fda4af; --brand-pink: #fb923c; }

[data-theme="dark"] {
    --bg: #0f0d1a;
    --bg-glow: #1a1530;
    --surface: #181527;
    --surface-2: #1f1b33;
    --surface-3: #262140;
    --border: #2b2645;
    --border-strong: #3a3459;
    --text: #ecebf5;
    --text-2: #bdb9d6;
    --muted: #8a86a6;
    --side-bg: #120f22;
    --side-bg-2: #1a1533;
    --side-line: #2b2645;
    --shadow: 0 6px 24px color-mix(in srgb, var(--black) 35%, transparent);
    --shadow-lg: 0 18px 48px color-mix(in srgb, var(--black) 45%, transparent);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, h5, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 17px; font-weight: 700; }
ul { margin: 0; padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- utilities ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.text-muted { color: var(--muted); }
.text-soft { color: var(--text-2); }
.text-brand { color: var(--brand); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-bold { font-weight: 700; }
.fw-800 { font-weight: 800; }
.nowrap { white-space: nowrap; }
/* ---------- sale bar (top of store pages) ---------- */
.sale-bar { container-type: inline-size; --sale-a: var(--sale-navy-a); --sale-b: var(--sale-navy-b); --sale-c: var(--sale-navy-c); color: var(--white); background: linear-gradient(100deg, var(--sale-a) 0%, var(--sale-b) 55%, var(--sale-c) 100%); }
.sale-bar.style-purple { --sale-a: var(--sale-purple-a); --sale-b: var(--sale-purple-b); --sale-c: var(--sale-purple-c); }
.sale-bar.style-sunset { --sale-a: var(--sale-sunset-a); --sale-b: var(--sale-sunset-b); --sale-c: var(--sale-sunset-c); }
.sale-bar.style-emerald { --sale-a: var(--sale-emerald-a); --sale-b: var(--sale-emerald-b); --sale-c: var(--sale-emerald-c); }
.sale-bar-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1240px; min-height: 60px; margin: 0 auto; padding: 8px 56px 8px 24px; }
.sale-bar-text { display: flex; flex-direction: column; gap: 2px; flex: 0 1 auto; min-width: 170px; color: inherit; }
.sale-bar-title { display: inline-flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 800; }
.sale-bar-title .icon { color: var(--sale-gold-b); }
.sale-bar-sub { font-size: 13px; opacity: .85; }
.sale-bar-offer { font-size: 34px; font-weight: 900; font-style: italic; letter-spacing: -.02em; line-height: 1; white-space: nowrap; background: linear-gradient(180deg, var(--sale-gold-a), var(--sale-gold-b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sale-bar-countdown { display: flex; gap: 8px; }
.sale-bar-unit { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 50px; padding: 5px 6px; border: 1px solid color-mix(in srgb, var(--white) 22%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--white) 10%, transparent); }
.sale-bar-unit strong { font-size: 20px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sale-bar-unit small { font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.sale-bar-coupon { display: inline-flex; align-items: center; gap: 12px; padding: 8px 16px; border: 1.5px dashed color-mix(in srgb, var(--sale-gold-b) 70%, transparent); border-radius: 12px; color: inherit; background: color-mix(in srgb, var(--black) 12%, transparent); cursor: pointer; font: inherit; }
.sale-bar-coupon:hover { background: color-mix(in srgb, var(--black) 22%, transparent); }
.sale-bar-coupon-label { padding-right: 12px; border-right: 1px solid color-mix(in srgb, var(--white) 25%, transparent); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
.sale-bar-code { font-size: 20px; font-weight: 800; letter-spacing: .12em; color: var(--sale-gold-a); }
.sale-bar-copied-icon, .sale-bar-coupon.is-copied .sale-bar-copy-icon { display: none; }
.sale-bar-coupon.is-copied .sale-bar-copied-icon { display: inline-block; color: var(--sale-gold-a); }
.sale-bar-close { position: absolute; top: 50%; right: 14px; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; color: inherit; background: color-mix(in srgb, var(--white) 12%, transparent); transform: translateY(-50%); cursor: pointer; }
.sale-bar-close:hover { background: color-mix(in srgb, var(--white) 24%, transparent); }
.sale-bar-preview { overflow: hidden; border-radius: var(--radius); }
.sale-bar-preview .sale-bar-inner { padding-right: 24px; }
/* sized by the bar's own width (also fits the admin preview) */
@container (max-width: 1024px) {
    .sale-bar-sub { display: none; }
    .sale-bar-offer { font-size: 26px; }
    .sale-bar-inner { gap: 12px; }
}
@container (max-width: 760px) {
    .sale-bar-inner { flex-wrap: wrap; justify-content: center; gap: 8px 12px; padding: 8px 44px 10px 14px; }
    .sale-bar-text { flex-direction: row; }
    .sale-bar-title { font-size: 15px; }
    .sale-bar-offer { font-size: 22px; }
    .sale-bar-unit { min-width: 40px; padding: 3px 4px; }
    .sale-bar-unit strong { font-size: 16px; }
    .sale-bar-coupon { padding: 5px 10px; gap: 8px; }
    .sale-bar-coupon-label { display: none; }
    .sale-bar-code { font-size: 15px; }
}

/* the hidden attribute always wins over a component's display value */
[hidden] { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }
.hide { display: none !important; }
.prose { color: var(--text-2); line-height: 1.75; }
.prose h2, .prose h3 { color: var(--text); margin: 24px 0 10px; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose ul { list-style: disc; padding-left: 22px; }
.prose a { color: var(--brand); text-decoration: underline; }
.prose img { border-radius: var(--radius); }

/* ---------- tones ---------- */
.tone-purple { --tone: var(--c-purple); }
.tone-blue { --tone: var(--c-blue); }
.tone-teal { --tone: var(--c-teal); }
.tone-orange { --tone: var(--c-orange); }
.tone-pink { --tone: var(--c-pink); }
.tone-green { --tone: var(--c-green); }
.tone-red { --tone: var(--c-red); }
.tone-indigo { --tone: var(--c-indigo); }
.tone-amber { --tone: var(--c-amber); }
.tone-brand { --tone: var(--brand); }
[class*="tone-"] { --tone-soft: color-mix(in srgb, var(--tone) 13%, var(--surface)); --tone-line: color-mix(in srgb, var(--tone) 28%, transparent); }

/* ---------- icons ---------- */
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 30px; height: 30px; }
.icon-fill { fill: currentColor; }
.icon-tile {
    display: inline-grid; place-items: center; flex: none;
    width: 42px; height: 42px; border-radius: var(--radius);
    color: var(--tone, var(--brand)); background: var(--tone-soft, var(--surface-3));
}
.icon-tile.sm { width: 34px; height: 34px; border-radius: 10px; }
.icon-tile.lg { width: 52px; height: 52px; border-radius: 14px; }
.icon-tile.xl { width: 60px; height: 60px; border-radius: 16px; }
.icon-tile.lg .icon, .icon-tile.xl .icon { width: 26px; height: 26px; }
.star { color: var(--star); }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 44px; height: 44px; flex: none; }
.brand-mark-img { object-fit: contain; }
.brand-full-img { height: 52px; width: auto; max-width: 260px; object-fit: contain; }
.brand-name { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.brand-tagline { font-size: 13px; color: var(--text-2); }
.brand-name, .brand-tagline { display: block; }
.brand .grow { min-width: 0; }
.logo-inner { fill: var(--white); }
.logo-stop-a { stop-color: var(--logo-a); }
.logo-stop-b { stop-color: var(--logo-b); }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 20px; border-radius: var(--radius);
    font-weight: 700; font-size: 14px; white-space: nowrap;
    border: 1.5px solid transparent; transition: transform .15s var(--ease), box-shadow .2s, background .2s;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled, .btn.is-disabled { opacity: .55; pointer-events: none; }
.btn-primary { color: var(--white); background: var(--btn-grad); box-shadow: var(--shadow-brand); }
.btn-outline { color: var(--brand); border-color: var(--brand); background: var(--surface); }
.btn-ghost { color: var(--text-2); background: var(--surface-3); }
.btn-soft { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface)); border-color: color-mix(in srgb, var(--brand) 25%, transparent); }
.btn-light { color: var(--brand-deep); background: var(--white); }
.btn-glass { color: var(--white); border-color: color-mix(in srgb, var(--white) 55%, transparent); background: color-mix(in srgb, var(--white) 8%, transparent); }
.btn-danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.btn-success { color: var(--white); background: var(--success); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 16px; }
.btn-pill { border-radius: var(--radius-pill); }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.link-more { display: inline-flex; align-items: center; gap: 4px; color: var(--brand); font-weight: 700; font-size: 14px; }

.icon-btn {
    position: relative; display: inline-grid; place-items: center; flex: none;
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--surface-3); color: var(--text);
    transition: background .2s;
}
.icon-btn:hover { background: color-mix(in srgb, var(--brand) 12%, var(--surface)); }
.count-badge {
    position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px;
    display: grid; place-items: center; border-radius: var(--radius-pill);
    font-size: 11px; font-weight: 700; color: var(--white); background: var(--danger);
    border: 2px solid var(--surface);
}

/* ---------- cards ---------- */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.card-head.bordered { padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; }
.card-title .icon { color: var(--brand); }
.card-body { padding: 18px 22px 22px; }
.card-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); }
.card-soft { background: var(--soft-grad); border-color: color-mix(in srgb, var(--brand) 18%, transparent); }

/* ---------- section heading ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.section-title .icon { color: var(--c-orange); width: 26px; height: 26px; }

/* ---------- segmented tabs ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--border); }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: var(--radius-pill); font-weight: 600; font-size: 14px; color: var(--text-2); }
.tab.is-active { color: var(--white); background: var(--btn-grad); box-shadow: var(--shadow-brand); }
.tabs.square, .tabs.square .tab { border-radius: 10px; }
.underline-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.underline-tabs .tab { border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.underline-tabs .tab.is-active { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface)); border-color: color-mix(in srgb, var(--brand) 30%, transparent); box-shadow: none; }

/* ---------- badges & pills ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px;
    border-radius: var(--radius-pill); font-size: 13px; font-weight: 700;
    color: var(--tone, var(--brand)); background: var(--tone-soft, var(--surface-3));
}
.badge-white { background: var(--white); }
.badge-gold { color: var(--brand-deep); background: var(--c-gold); }
.badge-sm { height: 22px; padding: 0 9px; font-size: 11px; }
/* short text on a menu link ("New"), set in Admin › Menus */
.menu-badge { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; margin-left: 4px; border-radius: var(--radius-pill); font-size: 10px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--white); background: var(--brand); }
.chip { display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--surface-3); }
.chip.tone-orange, .chip.tone-purple, .chip.tone-blue, .chip.tone-green { color: var(--text); background: var(--tone-soft); }
.status { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.status-completed, .status-active, .status-approved, .status-published, .status-answered, .status-replied, .status-verified, .status-on { color: var(--success); background: color-mix(in srgb, var(--success) 12%, var(--surface)); }
.status-sr-completed, .status-comment-approved { color: var(--success); background: color-mix(in srgb, var(--success) 12%, var(--surface)); }
.status-sr-quoted, .status-sr-in_progress, .status-sr-reviewing { color: var(--brand); background: color-mix(in srgb, var(--brand) 11%, var(--surface)); }
.status-sr-new, .status-comment-pending { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, var(--surface)); }
.status-sr-declined, .status-comment-hidden { color: var(--danger); background: color-mix(in srgb, var(--danger) 11%, var(--surface)); }
.status-processing, .status-pending, .status-open, .status-draft, .status-new, .status-unverified { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, var(--surface)); }
.status-read, .status-archived, .status-off { color: var(--text-2); background: var(--surface-2); }
.status-refunded, .status-cancelled, .status-rejected, .status-revoked, .status-expired, .status-closed, .status-suspended { color: var(--danger); background: color-mix(in srgb, var(--danger) 11%, var(--surface)); }
.discount-tag { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 700; color: var(--white); background: var(--danger); }

/* ---------- avatar ---------- */
.avatar {
    display: inline-grid; place-items: center; flex: none; overflow: hidden;
    width: 44px; height: 44px; border-radius: 50%;
    font-weight: 700; font-size: 15px; color: var(--white);
    background: var(--tone, var(--brand)); border: 2px solid var(--surface);
    box-shadow: var(--shadow-sm);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { width: 28px; height: 28px; font-size: 11px; }
.avatar-sm { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-xl { width: 80px; height: 80px; font-size: 26px; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 7px; grid-column: 1 / -1; min-width: 0; }
.field.half { grid-column: auto; }
.label { font-size: 14px; font-weight: 700; color: var(--text); }
.required { color: var(--danger); }
.input, .select, .textarea {
    width: 100%; height: 46px; padding: 0 14px;
    border: 1.5px solid var(--border-strong); border-radius: 10px;
    background: var(--surface); color: var(--text); transition: border .2s, box-shadow .2s;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.textarea.tall { min-height: 220px; }
.select { appearance: none; padding-right: 38px; background-image: none; }
.select-wrap { position: relative; }
.select-wrap .icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.input-group { position: relative; display: flex; }
.input-group .input { padding-left: 42px; }
.input-group > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.field-hint { font-size: 12px; color: var(--muted); }
.field-error { font-size: 12px; font-weight: 600; color: var(--danger); }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
/* file pickers: dashed drop area + brand button (styles the browser's own button, so every
   <input type="file"> in the script gets it without markup changes) */
.file-input { display: flex; align-items: center; height: auto; min-height: 56px; padding: 8px; border-style: dashed; color: var(--muted); font-size: 14px; background: var(--surface-2); cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.file-input:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
input[type="file"]::file-selector-button {
    display: inline-flex; align-items: center; height: 38px; margin-right: 14px; padding: 0 18px;
    border: 0; border-radius: 10px; font: inherit; font-size: 13px; font-weight: 700;
    color: var(--white); background: var(--btn-grad); box-shadow: var(--shadow-brand); cursor: pointer;
    transition: filter .15s ease, transform .15s ease;
}
input[type="file"]::file-selector-button:hover { filter: brightness(1.08); }
input[type="file"]:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
/* other native controls: brand accents, and dark pickers in dark mode */
input[type="range"], input[type="checkbox"], input[type="radio"], progress { accent-color: var(--brand); }
input[type="date"]::-webkit-calendar-picker-indicator, input[type="time"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .6; }
input[type="date"]::-webkit-calendar-picker-indicator:hover, input[type="time"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
:root { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }
.upload-box { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); }
.upload-preview { display: grid; place-items: center; min-width: 64px; height: 64px; padding: 8px 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.upload-preview img { max-height: 48px; width: auto; }

/* toggle switch row */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-text strong { display: block; font-size: 14px; }
.toggle-text span { font-size: 13px; color: var(--muted); }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; margin: 0; }
.switch-track { position: absolute; inset: 0; border-radius: var(--radius-pill); background: var(--border-strong); transition: background .2s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--white); transition: transform .2s var(--ease); }
.switch input:checked + .switch-track { background: var(--btn-grad); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--brand); outline-offset: 2px; }

.form-actions { display: flex; justify-content: flex-end; gap: 12px; padding-top: 18px; margin-top: 6px; border-top: 1px solid var(--border); }

/* radio card (licence picker, gateways) */
.radio-card { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: border .2s, background .2s; }
.radio-card input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.radio-card:has(input:checked) { border-color: color-mix(in srgb, var(--brand) 45%, transparent); background: color-mix(in srgb, var(--brand) 7%, var(--surface)); }
.radio-card-body { flex: 1; min-width: 0; }
.radio-card-title { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; }
.radio-card-text { font-size: 13px; color: var(--muted); }

/* ---------- alerts ---------- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: var(--radius); font-weight: 600; font-size: 14px; border: 1px solid transparent; }
.alert-success { color: var(--success); background: color-mix(in srgb, var(--success) 10%, var(--surface)); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-error { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.alert-info { color: var(--info); background: color-mix(in srgb, var(--info) 8%, var(--surface)); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.alert ul { padding-left: 18px; list-style: disc; }
.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--gap); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 13px; font-weight: 700; color: var(--text-2); padding: 12px 14px; background: var(--surface-2); white-space: nowrap; }
.table th:first-child { border-radius: 10px 0 0 10px; }
.table th:last-child { border-radius: 0 10px 10px 0; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.cell-user, .cell-product { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-thumb { width: 44px; height: 34px; border-radius: 8px; object-fit: cover; flex: none; }

/* ---------- list rows ---------- */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow strong { display: block; font-size: 15px; }
.list-row .meta { font-size: 13px; color: var(--muted); }
.row-thumb { width: 116px; height: 66px; border-radius: 10px; object-fit: cover; flex: none; box-shadow: var(--shadow-sm); }

/* ---------- stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.stat-card { display: flex; flex-direction: column; gap: 6px; padding: 20px; }
.stat-card.inline { flex-direction: row; align-items: center; gap: 16px; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat-label { font-size: 14px; color: var(--text-2); }
.stat-trend { display: inline-flex; align-items: center; gap: 3px; font-size: 14px; font-weight: 700; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ---------- key/value rows ---------- */
.kv { display: flex; flex-direction: column; }
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv-row:last-child { border-bottom: 0; }
.kv-row dt, .kv-row .k { color: var(--text-2); display: flex; align-items: center; gap: 10px; }
.kv-row dd, .kv-row .v { margin: 0; font-weight: 700; text-align: right; }

/* ---------- quick actions ---------- */
.action-list { display: flex; flex-direction: column; gap: 10px; }
.action-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--surface-2); font-weight: 600; font-size: 14px; transition: background .2s; width: 100%; text-align: left; }
.action-item:hover { background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.action-item > .icon:last-child { margin-left: auto; color: var(--muted); }
.action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.action-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px 8px; border-radius: var(--radius); background: var(--tone-soft, var(--surface-2)); color: var(--text); font-weight: 600; font-size: 13px; text-align: center; }
.action-tile .icon { color: var(--tone, var(--brand)); width: 30px; height: 30px; }

/* ---------- promo / gradient cards ---------- */
.promo {
    position: relative; overflow: hidden; isolation: isolate;
    border-radius: var(--radius-lg); padding: 28px; color: var(--white);
    background: var(--promo-grad); box-shadow: var(--shadow-lg);
}
.promo::before { content: ""; position: absolute; inset: auto -20% -40% auto; width: 70%; aspect-ratio: 1; border-radius: 50%; background: color-mix(in srgb, var(--white) 10%, transparent); z-index: -1; }
.promo-hero { background: var(--hero-grad); }
.promo-eyebrow { font-size: 22px; font-weight: 700; }
.promo-title { font-size: 26px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.promo-title-xl { font-size: 46px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; }
.promo-highlight { background: var(--highlight-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.promo-text { color: color-mix(in srgb, var(--white) 86%, transparent); font-size: 15px; }
.promo-big { font-size: 34px; font-weight: 800; line-height: 1.1; color: var(--c-gold); }
.promo-art { pointer-events: none; }
.promo-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.promo-points { display: flex; flex-direction: column; gap: 8px; }
.promo-points li { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.promo-center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.carousel-dots { display: flex; gap: 8px; }
.carousel-dot { width: 8px; height: 8px; border-radius: 50%; background: color-mix(in srgb, var(--white) 40%, transparent); transition: width .2s; }
.carousel-dot.is-active { width: 22px; border-radius: var(--radius-pill); background: var(--white); }
[data-slide] { display: none; }
[data-slide].is-active { display: grid; }

/* ---------- product card ---------- */
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.product-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.product-card { position: relative; display: flex; flex-direction: column; overflow: hidden; padding: 0; transition: transform .2s var(--ease), box-shadow .2s; }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.product-media { position: relative; display: block; aspect-ratio: var(--product-ratio); overflow: hidden; background: var(--surface-3); }
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-media .badge { position: absolute; top: 12px; left: 12px; }
.fav-btn { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--text-2); background: color-mix(in srgb, var(--white) 88%, transparent); }
.fav-btn.is-on { color: var(--danger); }
.fav-btn.is-on .icon { fill: currentColor; }
.product-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px 16px; flex: 1; }
.product-title { font-size: 16px; font-weight: 800; line-height: 1.3; }
.product-tags { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 13px; color: var(--text-2); }
.product-tags span:not(:last-child)::after { content: "•"; margin: 0 7px; color: var(--muted); }
.product-meta { display: flex; align-items: center; gap: 18px; font-size: 13px; color: var(--text-2); }
.rating { display: inline-flex; align-items: center; gap: 5px; }
.rating .icon { color: var(--star); fill: var(--star); width: 16px; height: 16px; }
.product-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.price { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.price-old { font-size: 18px; color: var(--muted); text-decoration: line-through; font-weight: 600; }
.product-foot { gap: 8px; }
.product-foot .price { margin-right: auto; }
.owned-badge { position: absolute; right: 12px; bottom: 10px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--white); background: var(--success); border: 2px solid var(--white); }
.cart-btn.is-soft { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface)); box-shadow: none; }
.details-btn { height: 34px; padding: 0 14px; font-size: 12px; }
.cart-btn { display: grid; place-items: center; width: 44px; height: 34px; border-radius: 10px; color: var(--white); background: var(--btn-grad); box-shadow: var(--shadow-brand); }
.stars { display: inline-flex; gap: 2px; }
.stars .icon { width: 16px; height: 16px; color: var(--border-strong); fill: var(--border-strong); }
.stars .icon.on { color: var(--star); fill: var(--star); }

/* list variant (mobile & panels) */
.product-list { display: flex; flex-direction: column; gap: 14px; }
.product-list .product-card { flex-direction: row; padding: 10px; gap: 4px; }
.product-list .product-media { width: 42%; max-width: 260px; aspect-ratio: var(--product-ratio); border-radius: var(--radius); flex: none; }
.product-list .product-body { padding: 4px 8px 4px 16px; }
.product-list .fav-btn { position: static; background: none; box-shadow: none; width: 28px; height: 28px; }
.product-list .product-head { display: flex; justify-content: space-between; gap: 8px; }

/* ---------- empty state ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 20px; text-align: center; color: var(--muted); }
.empty .icon-tile { margin-bottom: 4px; }
.empty strong { color: var(--text); font-size: 16px; }

/* ---------- pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: var(--gap); }
.page-link { display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px; border-radius: 10px; font-weight: 700; font-size: 14px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
/* list / grid switch (store browse, admin products) */
.view-toggle { display: flex; gap: 6px; }
.view-btn { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); }
.view-btn.is-active { color: var(--white); background: var(--btn-grad); border-color: transparent; box-shadow: var(--shadow-brand); }
.page-step { display: inline-flex; align-items: center; white-space: nowrap; }
.page-link.is-active { color: var(--white); background: var(--btn-grad); border-color: transparent; }
.page-link.is-disabled { opacity: .45; pointer-events: none; }

/* ---------- dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; min-width: 230px;
    display: none; flex-direction: column; padding: 8px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.dropdown-menu.left { left: 0; right: auto; }
.dropdown.is-open .dropdown-menu { display: flex; }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); text-align: left; }
.dropdown-item:hover { background: var(--surface-3); color: var(--text); }
.dropdown-item .icon { color: var(--brand); }
.dropdown-head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown-head strong { display: block; }
.mega { grid-template-columns: repeat(2, minmax(220px, 1fr)); min-width: 480px; }
.dropdown.is-open .mega { display: grid; }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--border); stroke-dasharray: 3 4; }
.chart-axis { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chart-line { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linecap: round; }
.chart-area { fill: url(#chartFill); }
.chart-fill-a { stop-color: var(--brand); stop-opacity: .28; }
.chart-fill-b { stop-color: var(--brand); stop-opacity: 0; }
.chart-dot { fill: var(--surface); stroke: var(--brand); stroke-width: 2.5; }
.chart-tip { fill: var(--brand); }
.chart-tip-text { fill: var(--white); font-size: 12px; font-weight: 700; font-family: var(--font); }
.chart-bar { fill: url(#barFill); }
.chart-bar-a { stop-color: var(--brand-2); }
.chart-bar-b { stop-color: color-mix(in srgb, var(--brand-2) 45%, var(--surface)); }
.donut { width: 100%; max-width: 170px; }
.donut-track { fill: none; stroke: var(--surface-3); stroke-width: 5; }
.donut-slice { fill: none; stroke-width: 5; }
.series-1 { --series: var(--brand-2); }
.series-2 { --series: var(--c-blue); }
.series-3 { --series: var(--c-teal); }
.series-4 { --series: var(--c-amber); }
.series-5 { --series: var(--c-pink); }
.series-6 { --series: var(--c-silver); }
.donut-slice[class*="series-"] { stroke: var(--series); }
.legend { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.legend-item { display: flex; align-items: center; gap: 10px; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--series); flex: none; }
.legend-item .v { margin-left: auto; font-weight: 700; }
.donut-wrap { position: relative; display: grid; place-items: center; }
.donut-center { position: absolute; text-align: center; }
.donut-center strong { display: block; font-size: 24px; font-weight: 800; }

/* =====================================================================
   STORE / ACCOUNT HEADER
   ===================================================================== */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); max-width: var(--container); margin: 0 auto; padding: 0 28px; }
.main-nav { display: flex; align-items: center; gap: 6px; margin: 0 auto; }
.nav-link { display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 18px; border-radius: var(--radius); font-weight: 600; color: var(--text-2); }
.nav-link:hover { color: var(--brand); }
.nav-link.is-active { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }
.header-search { position: relative; width: 210px; }
.header-search .input { height: 40px; border-radius: var(--radius-pill); background: var(--surface-2); border-color: var(--border); padding-left: 40px; font-size: 14px; }
.header-search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-2); }
.header-actions { display: flex; align-items: center; gap: 14px; }
.user-trigger { display: flex; align-items: center; gap: 6px; }
.menu-toggle { display: none; }

/* search panel (opened by header search icon) */
.search-panel { display: none; border-top: 1px solid var(--border); background: var(--surface); }
.search-panel.is-open { display: block; }
.search-panel-form { display: flex; gap: 10px; max-width: 760px; margin: 0 auto; padding: 14px 20px; }
.search-panel-field { flex: 1; min-width: 0; }
.search-panel-field .input { height: 48px; padding-left: 46px; border-radius: var(--radius-pill); background: var(--surface-2); }
.search-panel-field .input:focus { background: var(--surface); }
.search-panel-field > .icon { left: 18px; }
.search-panel-btn { height: 48px; padding: 0 24px; border-radius: var(--radius-pill); }

/* drawer (mobile nav) */
.drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: color-mix(in srgb, var(--black) 45%, transparent); opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer { position: fixed; inset: 0 auto 0 0; z-index: 95; width: min(320px, 86vw); padding: 20px; overflow-y: auto; background: var(--surface); transform: translateX(-100%); transition: transform .25s var(--ease); display: flex; flex-direction: column; gap: 16px; }
body.drawer-open .drawer { transform: none; }
body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer-nav { display: flex; flex-direction: column; gap: 4px; }
.drawer-nav .nav-link { justify-content: flex-start; gap: 12px; }

/* bottom nav (mobile) */
.bottom-nav { display: none; }

/* store layout */
.store-main { max-width: var(--container); margin: 0 auto; padding: 24px 28px 48px; }
/* copy buttons: [data-copy] swaps the label for 1.5s (app.js adds .is-copied) */
.copy-btn .copied-label { display: none; }
.copy-btn.is-copied { color: var(--success); }
.copy-btn.is-copied .copy-label { display: none; }
.copy-btn.is-copied .copied-label { display: inline; }

/* user panel / admin panel footer — pushed to the bottom of short pages (margin-top: auto in a full-height column) */
.panel-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; margin-top: auto; padding: 16px 4px 0; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.panel-footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; }
.panel-footer-links a { color: var(--text-2); font-weight: 600; }
.panel-footer-links a:hover { color: var(--brand); }
.panel-footer-version { padding: 3px 10px; border-radius: var(--radius-pill); font-weight: 700; color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }

/* breadcrumbs: pill bar, gradient home chip, current page as a tinted pill */
.breadcrumbs { display: flex; max-width: 100%; margin-bottom: 18px; }
.crumbs { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; margin: 0; padding: 4px; list-style: none; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); box-shadow: var(--shadow-sm); overflow-x: auto; scrollbar-width: none; }
.crumbs::-webkit-scrollbar { display: none; }
.crumb { display: inline-flex; align-items: center; gap: 2px; min-width: 0; flex: none; }
.crumb:last-child { flex: 0 1 auto; }
.crumb-sep { width: 14px; height: 14px; flex: none; color: var(--muted); opacity: .7; }
.crumb-link, .crumb-current { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; white-space: nowrap; }
.crumb-link { color: var(--text-2); transition: color .15s ease, background-color .15s ease; }
.crumb-link:hover, .crumb-link:focus-visible { color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.crumb-home .crumb-link { padding-left: 4px; }
.crumb-home-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--white); background: var(--btn-grad); box-shadow: var(--shadow-brand); }
.crumb-home-icon .icon { color: var(--white); }
.crumb-current { display: block; line-height: 32px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--surface)); }

/* footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner { max-width: var(--container); margin: 0 auto; padding: 40px 28px 24px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-title { font-weight: 800; margin-bottom: 12px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; color: var(--text-2); font-size: 14px; }
.footer-links a:hover { color: var(--brand); }
.footer-bottom { max-width: var(--container); margin: 0 auto; padding: 16px 28px 28px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); }
.social { display: flex; gap: 8px; }
.social a { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); }

/* =====================================================================
   USER PANEL SHELL
   ===================================================================== */
.panel-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); gap: var(--gap); max-width: var(--container); margin: 0 auto; padding: 24px 28px 16px; min-height: calc(100dvh - var(--header-h)); }
.panel-sidebar { align-self: start; position: sticky; top: calc(var(--header-h) + 20px); padding: 18px; }
.profile-card { display: flex; align-items: center; gap: 14px; padding: 4px 4px 18px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.profile-card strong { display: block; font-size: 17px; }
.profile-card .meta { font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav + .side-nav { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.side-link { display: flex; align-items: center; gap: 14px; height: 44px; padding: 0 14px; border-radius: var(--radius); font-weight: 600; color: var(--text-2); }
.side-link:hover { color: var(--text); background: var(--surface-2); }
.side-link.is-active { color: var(--brand-deep); background: color-mix(in srgb, var(--brand) 13%, var(--surface)); }
.side-link.is-active .icon { color: var(--brand); }
.side-link.danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); width: 100%; }
[data-theme="dark"] .side-link.is-active { color: var(--text); }
.panel-main { min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.panel-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--gap); align-items: start; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.page-subtitle { color: var(--text-2); margin-top: 2px; }
.page-head-icon { display: flex; align-items: center; gap: 16px; }
.page-head-icon > .icon { width: 44px; height: 44px; color: var(--brand); }

/* =====================================================================
   ADMIN SHELL
   ===================================================================== */
.admin-body { background: var(--bg); }
.admin-shell { display: grid; grid-template-columns: var(--admin-side-w) minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar {
    position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 16px 14px 24px;
    color: var(--side-text); background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
    scrollbar-width: thin;
}
.admin-sidebar .brand { padding: 2px 4px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--side-line); }
.admin-sidebar .brand-name { color: var(--white); font-size: 22px; }
.admin-sidebar .brand-tagline { color: var(--side-muted); }
.side-section { padding: 10px 0; border-bottom: 1px solid var(--side-line); }
.side-section:last-child { border-bottom: 0; }
.side-section-title { padding: 6px 10px; font-size: 14px; font-weight: 700; color: var(--white); }
.admin-link { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--side-text); }
.admin-link:hover { color: var(--white); background: color-mix(in srgb, var(--white) 6%, transparent); }
.admin-link .chev { margin-left: auto; width: 15px; height: 15px; color: var(--side-muted); }
.admin-link.is-active { color: var(--white); background: var(--btn-grad); box-shadow: var(--shadow-brand); }
.admin-link.is-active .chev { color: var(--white); }
.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 18px; height: 76px; padding: 0 28px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar-search { position: relative; flex: 1; max-width: 470px; }
.topbar-search-spacer { flex: 1; }
.topbar-search .input { height: 44px; border-radius: var(--radius-pill); background: var(--surface-3); border-color: transparent; padding-left: 46px; }
.topbar-search .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-2); }
.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.topbar-actions .icon-btn { background: transparent; }
.admin-user { display: flex; align-items: center; gap: 10px; text-align: left; }
.admin-user > div strong { display: block; font-size: 14px; }
.admin-user > div span { font-size: 12px; color: var(--muted); }
.admin-content { flex: 1; padding: 26px 28px 16px; display: flex; flex-direction: column; gap: var(--gap); }
.admin-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.admin-grid-main { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .input, .filters .select { height: 40px; width: auto; min-width: 160px; }
.filters .input-group .input { min-width: 240px; }
.admin-mobile-head { display: none; }
.admin-mobile-brand .brand-name { font-size: 18px; }

/* theme toggle icon swap */
.theme-toggle .i-moon { display: none; }
[data-theme="dark"] .theme-toggle .i-moon { display: block; }
[data-theme="dark"] .theme-toggle .i-sun { display: none; }

/* =====================================================================
   AUTH
   ===================================================================== */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { display: flex; flex-direction: column; justify-content: space-between; padding: 40px; color: var(--white); background: var(--hero-grad); }
/* admin sign-in: same layout in the admin sidebar's colours */
.auth-shell-admin .auth-art { color: var(--side-text); background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%); }
.auth-shell-admin .auth-art img { width: min(260px, 70%); align-self: center; }
.auth-art .brand-name { color: var(--white); }
.auth-art .brand-tagline { color: color-mix(in srgb, var(--white) 75%, transparent); }
.auth-art img { max-width: 440px; margin: 0 auto; }
.auth-panel { display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 18px; }
.auth-card .form-grid { grid-template-columns: 1fr; }
.demo-logins { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--radius); background: var(--surface-3); font-size: 13px; }
.auth-divider { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.social-logins { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.social-login { justify-content: center; }
.verify-box { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }

/* error / maintenance */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.error-code { font-size: 96px; font-weight: 800; line-height: 1; background: var(--btn-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
/* desktop-only rules */
@media (min-width: 1025px) {
    .show-mobile { display: none !important; }
    .admin-shell + .drawer-backdrop, .admin-shell .drawer-backdrop { display: none; }
    body.drawer-open .admin-shell { grid-template-columns: 0 minmax(0, 1fr); }
    body.drawer-open .admin-sidebar { overflow: hidden; padding: 0; }
}

@media (max-width: 1280px) {
    .header-search { display: none; }
    .nav-link { padding: 0 12px; }
    .product-grid.cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .panel-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
    :root { --header-h: 68px; }
    .main-nav { display: none; }
    .menu-toggle { display: inline-grid; }
    .header-inner { gap: 14px; padding: 0 18px; }
    .header-actions { margin-left: auto; }
    .panel-shell { grid-template-columns: 1fr; padding: 16px 16px 96px; }
    .panel-sidebar { display: none; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 95; width: min(280px, 86vw); transform: translateX(-100%); transition: transform .25s var(--ease); }
    body.drawer-open .admin-sidebar { transform: none; }
    .admin-grid-2, .admin-grid-main { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-grid, .product-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-art { display: none; }

    .bottom-nav {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
        display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
        height: var(--bottom-nav-h); padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
        background: var(--surface); border-top: 1px solid var(--border); box-shadow: var(--shadow-lg);
    }
    .bottom-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: var(--radius); font-size: 12px; font-weight: 600; color: var(--text-2); }
    .bottom-nav-item .icon { width: 22px; height: 22px; }
    .bottom-nav-item.is-active { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }
    .bottom-nav-item.is-active .icon { fill: color-mix(in srgb, var(--brand) 25%, transparent); }
    .has-bottom-nav { padding-bottom: calc(var(--bottom-nav-h) + 24px + env(safe-area-inset-bottom)); }
    .site-footer { display: none; }
    .hide-mobile { display: none !important; }
}

/* opposite of .hide-mobile (same 1024px breakpoint) */
@media (min-width: 1025px) {
    .hide-desktop { display: none !important; }
}

@media (max-width: 640px) {
    .panel-footer { flex-direction: column; align-items: flex-start; }
    .panel-footer-links { gap: 6px 14px; }
    .breadcrumbs { margin-bottom: 12px; }
    .crumb-home-label { display: none; }
    .crumb-home .crumb-link { padding: 0 4px; }
    .crumb-link, .crumb-current { height: 30px; padding: 0 10px; font-size: 12px; }
    .crumb-current { line-height: 30px; max-width: 180px; }
    body { font-size: 14px; }
    h1, .page-title { font-size: 24px; }
    .brand-name { font-size: 20px; }
    .brand-mark, .brand-mark-img { width: 38px; height: 38px; }
    .brand-full-img { height: 40px; max-width: 170px; }
    .brand-tagline { font-size: 12px; }
    /* keep the header on one line: brand takes the free space, text ellipsises */
    .header-inner { gap: 10px; }
    .header-inner .brand { flex: 1; min-width: 0; gap: 10px; }
    .header-inner .header-actions { flex: none; margin-left: 0; }
    .brand-name { white-space: nowrap; }
    .brand-tagline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
    .icon-btn { width: 42px; height: 42px; }
    .header-actions { gap: 8px; }
    .store-main { padding-top: 14px; padding-left: 14px; padding-right: 14px; }
    .admin-topbar { padding: 0 14px; gap: 10px; height: 68px; }
    .admin-content { padding: 16px 14px 96px; }
    .topbar-search, .admin-user > div, .topbar-actions .hide-sm { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .field.half { grid-column: 1 / -1; }
    .product-grid, .product-grid.cols-4 { grid-template-columns: 1fr; }
    .product-list .product-card { padding: 8px; }
    .product-list .product-media { width: 44%; }
    .product-list .product-body { padding: 2px 4px 2px 12px; gap: 4px; }
    .product-list .product-title { font-size: 15px; }
    .product-list .product-meta { gap: 10px; }
    .card-pad { padding: 16px; }
    .card-head { padding: 16px 16px 0; }
    .card-body { padding: 14px 16px 16px; }
    .section-title { font-size: 20px; }
    .stat-value { font-size: 22px; }
    .stat-card { padding: 14px; }
    .promo { padding: 20px; }
    .promo-title-xl { font-size: 32px; }
    .row-thumb { width: 88px; height: 54px; }
    .footer-inner { grid-template-columns: 1fr; }
    .mega { grid-template-columns: 1fr; min-width: 0; }
    .action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .table th, .table td { padding: 10px; }
}

/* ticket / chat attachments */
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.attachment-thumb { display: block; width: 120px; height: 84px; overflow: hidden; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.attachment-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attachment-file { display: inline-flex; align-items: center; gap: 8px; max-width: 260px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600; }
.attachment-file:hover { border-color: var(--brand); color: var(--brand); }

/* =====================================================================
   LIVE CHAT (bubble + thread bubbles shared with admin)
   ===================================================================== */
.chat-widget { position: fixed; right: 24px; bottom: 24px; z-index: 80; display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.chat-launcher { position: relative; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; color: var(--white); background: var(--btn-grad); box-shadow: var(--shadow-brand); transition: transform .2s var(--ease); }
.chat-launcher:hover { filter: brightness(1.06); }
.chat-launcher .count-badge { top: -2px; right: -2px; }
.chat-widget.is-open .chat-launcher { display: none; }
.chat-panel { display: none; flex-direction: column; width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px)); overflow: hidden; border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.chat-widget.is-open .chat-panel { display: flex; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; color: var(--white); background: var(--hero-grad); }
.chat-head strong { display: block; font-size: 16px; }
.chat-head-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, var(--white) 18%, transparent); }
.chat-presence { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: color-mix(in srgb, var(--white) 85%, transparent); }
.chat-presence::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c-silver); }
.chat-widget.is-online .chat-presence::before { background: var(--c-green); }
.chat-icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--white); background: color-mix(in srgb, var(--white) 14%, transparent); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.chat-subtitle { text-align: center; font-size: 12px; color: var(--muted); }
.chat-notice { text-align: center; font-size: 13px; color: var(--muted); padding: 8px; border-radius: var(--radius); background: var(--surface-3); }
.chat-form { padding: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.chat-form.is-sending { opacity: .6; pointer-events: none; }
.chat-guest { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chat-guest.hide { display: none; }
.chat-guest .input { height: 40px; font-size: 14px; }
.chat-compose { display: flex; align-items: flex-end; gap: 8px; }
.chat-compose .textarea { min-height: 44px; max-height: 120px; resize: none; font-size: 14px; }
.chat-send { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; color: var(--white); background: var(--btn-grad); }
.chat-end { align-self: center; font-size: 12px; font-weight: 600; color: var(--muted); }
.chat-end:hover { color: var(--danger); }

.chat-msg { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; max-width: 85%; align-self: flex-end; }
.chat-msg.is-staff { align-items: flex-start; align-self: flex-start; }
.chat-bubble { padding: 10px 14px; border-radius: 16px 16px 4px 16px; color: var(--white); background: var(--btn-grad); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.chat-msg.is-staff .chat-bubble { color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 16px 16px 16px 4px; }
.chat-text p { margin: 0 0 6px; }
.chat-text p:last-child { margin: 0; }
.chat-text a { text-decoration: underline; }
.chat-files { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-files:not(:empty) { margin-top: 8px; }
.chat-image { display: block; max-width: 220px; overflow: hidden; border-radius: 10px; }
.chat-image img { width: 100%; height: auto; }
.chat-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 11px; color: var(--muted); }
.ticks { display: inline-flex; color: var(--muted); font-weight: 700; }
.ticks .tick-2 { margin-left: -9px; }
.ticks-read { color: var(--info); }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; margin-left: auto; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; color: var(--white); background: var(--danger); }

@media (max-width: 1024px) {
    .chat-widget { right: 16px; bottom: calc(var(--bottom-nav-h) + 16px); }
    .chat-widget.is-open { inset: auto 8px calc(var(--bottom-nav-h) + 8px) 8px; align-items: stretch; }
    .chat-panel { width: 100%; height: min(70vh, 560px); }
}

/* Settings › Appearance › Font Family / Font Size (classes on <html>) */
.font-jakarta { --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.font-system { --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.font-inter { --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.font-poppins { --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.corners-soft { --radius-sm: 10px; --radius: 16px; --radius-lg: 24px; --radius-xl: 30px; }
.corners-sharp { --radius-sm: 4px; --radius: 6px; --radius-lg: 8px; --radius-xl: 10px; }
.size-small body { font-size: 14px; }
.size-medium body { font-size: 15px; }
.size-large body { font-size: 16px; }

/* cookie consent banner */
.cookie-banner { position: fixed; z-index: 85; display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 14px; color: var(--text-2); }
.cookie-banner.hide { display: none; }
.cookie-bottom { left: 24px; right: 24px; bottom: 24px; justify-content: space-between; }
.cookie-bottom-left { left: 24px; bottom: 24px; max-width: 420px; flex-direction: column; align-items: flex-start; }
.cookie-bottom-right { right: 104px; bottom: 24px; max-width: 420px; flex-direction: column; align-items: flex-start; }
@media (max-width: 1024px) {
    .cookie-banner { left: 12px; right: 12px; bottom: calc(var(--bottom-nav-h) + 12px); max-width: none; flex-direction: column; align-items: stretch; }
}

/* narrowest phones: drop the header search button (search stays on Browse + menu) so the logo fits */
@media (max-width: 350px) {
    .header-search-btn { display: none; }
}

/* very small phones: compact header so the site name fits */
@media (max-width: 400px) {
    .header-inner { gap: 8px; padding: 0 12px; }
    .header-inner .header-actions { gap: 6px; }
    .header-inner .icon-btn { width: 36px; height: 36px; }
    .header-inner .icon-btn .icon { width: 18px; height: 18px; }
    .header-inner .avatar { width: 36px; height: 36px; }
    .header-inner .brand { gap: 8px; }
    .header-inner .brand-mark, .header-inner .brand-mark-img { width: 34px; height: 34px; }
    .header-inner .brand-name { font-size: 18px; }
    .header-inner .brand-tagline { font-size: 10px; }
}

/* ---------- shared bits (phase 3) ---------- */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; }
.star-toggle { color: var(--muted); }
.star-toggle.is-on { color: var(--c-amber); }
.star-toggle.is-on .icon { fill: currentColor; }

/* ---------- theme announcement bar + admin preview bar ---------- */
.announcement { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; font-size: 14px; font-weight: 600; text-align: center; color: var(--white); background: var(--tone, var(--brand)); }
.announcement a { color: inherit; text-decoration: underline; }
.preview-bar { position: sticky; top: 0; z-index: 60; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 8px 16px; font-size: 14px; color: var(--white); background: var(--text); }
.preview-bar form { display: inline; }
.recaptcha-box { min-height: 78px; }

/* ---------- rich-text editor (Quill snow theme, restyled with the design tokens) ---------- */
.rich-editor .rich-editor-source { display: block; }
.rich-editor.is-ready .rich-editor-source { display: none; }
.rich-editor:not(.is-ready) .rich-editor-mount { display: none; }
.rich-editor .ql-toolbar.ql-snow { border: 1px solid var(--border); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface-2); font-family: var(--font); }
.rich-editor .ql-container.ql-snow { border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); background: var(--surface); color: var(--text); font-family: var(--font); font-size: 15px; }
.rich-editor:focus-within .ql-container.ql-snow, .rich-editor:focus-within .ql-toolbar.ql-snow { border-color: var(--brand); }
.rich-editor .ql-editor { min-height: 160px; line-height: 1.65; }
.rich-editor.is-tall .ql-editor { min-height: 320px; }
.rich-editor .ql-container.ql-snow { max-height: 640px; overflow-y: auto; }
.rich-editor .ql-editor.ql-blank::before { color: var(--muted); font-style: normal; }
.rich-editor .ql-editor a { color: var(--brand); }
.rich-editor .ql-editor blockquote { border-left: 4px solid var(--border); padding-left: 14px; color: var(--text-2); }
.rich-editor .ql-editor pre.ql-syntax, .rich-editor .ql-editor .ql-code-block-container { border-radius: var(--radius-sm); color: var(--text); background: var(--surface-3); }
.rich-editor .ql-snow .ql-stroke { stroke: var(--text-2); }
.rich-editor .ql-snow .ql-fill { fill: var(--text-2); }
.rich-editor .ql-snow .ql-picker { color: var(--text-2); }
.rich-editor .ql-snow button:hover .ql-stroke, .rich-editor .ql-snow button.ql-active .ql-stroke { stroke: var(--brand); }
.rich-editor .ql-snow button:hover .ql-fill, .rich-editor .ql-snow button.ql-active .ql-fill { fill: var(--brand); }
.rich-editor .ql-snow button:hover, .rich-editor .ql-snow button.ql-active { color: var(--brand); }
.rich-editor .ql-snow .ql-tooltip { border-color: var(--border); border-radius: var(--radius-sm); color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.rich-editor .ql-snow .ql-tooltip input[type=text] { border-color: var(--border); border-radius: 6px; color: var(--text); background: var(--surface); }
.rich-editor .ql-snow .ql-tooltip a.ql-action, .rich-editor .ql-snow .ql-tooltip a.ql-remove { color: var(--brand); }
