/* ==========================================================================
   Design tokens
   One accent, a strict neutral ramp, a 4px spacing scale and a fixed type
   scale. Everything below composes from these — no ad-hoc values.
   ========================================================================== */
:root {
    /* Neutrals — slightly blue-tinted near-black through to near-white */
    --n-950: #08090c;
    --n-900: #0b0d12;
    --n-850: #101319;
    --n-800: #151922;
    --n-700: #1e2430;
    --n-600: #2b3242;
    --n-500: #4a5468;
    --n-400: #6e7889;
    --n-300: #949cab;
    --n-200: #c3c8d2;
    --n-100: #e6e8ed;
    --n-050: #f5f6f8;

    --bg: var(--n-950);
    --surface-1: rgba(255, 255, 255, 0.024);
    --surface-2: rgba(255, 255, 255, 0.045);
    --surface-3: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.075);
    --border-strong: rgba(255, 255, 255, 0.14);

    --text: var(--n-050);
    --text-muted: var(--n-300);
    --text-subtle: var(--n-400);
    --text-faint: var(--n-500);

    /* Single accent + semantic colors */
    --accent: #7c5cff;
    --accent-soft: rgba(124, 92, 255, 0.13);
    --accent-line: rgba(124, 92, 255, 0.32);
    --info: #4c9ffe;
    --success: #2fcf8f;
    --warning: #f5a524;
    --danger: #f5566e;

    /* Spacing scale (4px base) */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 20px;
    --s-6: 24px;
    --s-8: 32px;
    --s-10: 40px;
    --s-12: 48px;
    --s-16: 64px;
    --s-20: 80px;
    --s-24: 96px;

    /* Radii */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --r-full: 999px;

    /* Elevation — restrained, mostly used for overlays only */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px -6px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 64px -16px rgba(0, 0, 0, 0.6);

    /* Type */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --text-xs: 0.75rem;    /* 12 */
    --text-sm: 0.8125rem;  /* 13 */
    --text-base: 0.9375rem;/* 15 */
    --text-md: 1rem;       /* 16 */
    --text-lg: 1.125rem;   /* 18 */
    --text-xl: 1.375rem;   /* 22 */
    --text-2xl: 1.75rem;   /* 28 */
    --text-3xl: 2.25rem;   /* 36 */
    --text-4xl: 3rem;      /* 48 */

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    --container: 1140px;
    --gutter: var(--s-6);
    --nav-h: 60px;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html {
    scroll-behavior: smooth;
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    background: transparent; /* fixed bg layers live behind this */
    color: var(--text);
    font-family: var(--font);
    font-size: var(--text-base);
    line-height: 1.6;
    letter-spacing: -0.006em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

h1, h2, h3, h4 {
    line-height: 1.2;
    letter-spacing: -0.022em;
    font-weight: 600;
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

a {
    color: inherit;
    text-decoration: none;
}

img, svg, video {
    display: block;
    max-width: 100%;
}

button, input, textarea, select {
    font: inherit;
    color: inherit;
}

::selection {
    background: var(--accent);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

.mono {
    font-family: var(--font-mono);
    font-size: 0.92em;
    letter-spacing: -0.02em;
}

.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }

/* Scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--n-600) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: var(--n-700);
    border-radius: var(--r-full);
    border: 3px solid transparent;
    background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--n-600); background-clip: content-box; }

/* ==========================================================================
   Background layers
   ========================================================================== */
#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: -3;
}

.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 30%, transparent 100%);
}

.bg-glow {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(720px 400px at 50% -10%, rgba(124, 92, 255, 0.13), transparent 70%),
        radial-gradient(520px 340px at 88% 6%, rgba(76, 159, 254, 0.06), transparent 65%);
}

/* ==========================================================================
   Layout primitives
   ========================================================================== */
.page {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.page-narrow {
    max-width: 680px;
}

.section {
    padding-block: var(--s-20);
}

.section-tight {
    padding-block: var(--s-12);
}

.stack > * + * { margin-top: var(--s-4); }

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--s-4);
    flex-wrap: wrap;
    margin-bottom: var(--s-8);
}

.section-head h2 {
    font-size: var(--text-2xl);
}

.section-head .section-sub {
    color: var(--text-subtle);
    font-size: var(--text-sm);
    margin-top: var(--s-1);
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: color 0.15s var(--ease), gap 0.2s var(--ease);
}

.link-arrow:hover {
    color: var(--text);
    gap: var(--s-3);
}

/* ==========================================================================
   Eyebrow / labels
   ========================================================================== */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.01em;
    color: var(--text-muted);
    background: var(--surface-1);
    border: 1px solid var(--border);
    padding: var(--s-1) var(--s-3);
    border-radius: var(--r-full);
}

.eyebrow .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    position: relative;
}

.eyebrow .dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: var(--success);
    opacity: 0.25;
    animation: pulse-ring 2.4s var(--ease) infinite;
}

@keyframes pulse-ring {
    0%   { transform: scale(0.7); opacity: 0.35; }
    70%  { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
}

.label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-subtle);
    letter-spacing: 0.01em;
    margin-bottom: var(--s-2);
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 60;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    background: rgba(8, 9, 12, 0.7);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.navbar.scrolled {
    border-bottom-color: var(--border);
    background: rgba(8, 9, 12, 0.86);
}

.navbar-inner {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
    display: flex;
    align-items: center;
    gap: var(--s-8);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-weight: 600;
    font-size: var(--text-md);
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.brand .icon {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--s-1);
    flex: 1;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-md);
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.nav-links a .icon {
    width: 15px;
    height: 15px;
    opacity: 0.75;
}

.nav-links a:hover {
    color: var(--text);
    background: var(--surface-2);
}

.nav-links a.active {
    color: var(--text);
    background: var(--surface-2);
}

.nav-links a.active .icon {
    color: var(--accent);
    opacity: 1;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    flex-shrink: 0;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-1) var(--s-3) var(--s-1) var(--s-1);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.navbar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.navbar-toggle:hover {
    color: var(--text);
    background: var(--surface-3);
}

.avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface-3);
    flex-shrink: 0;
}

/* ==========================================================================
   Icons
   ========================================================================== */
.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.icon-xs { width: 13px; height: 13px; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 32px; height: 32px; }
.icon-2xl { width: 44px; height: 44px; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    --btn-bg: transparent;
    --btn-fg: var(--text);
    --btn-border: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    padding: 0 var(--s-4);
    height: 38px;
    border-radius: var(--r-md);
    background: var(--btn-bg);
    color: var(--btn-fg);
    border: 1px solid var(--btn-border);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: -0.01em;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s var(--ease), border-color 0.15s var(--ease),
                transform 0.1s var(--ease), opacity 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.btn .icon {
    width: 15px;
    height: 15px;
}

.btn:active { transform: translateY(0.5px); }

.btn-primary {
    --btn-bg: var(--accent);
    --btn-fg: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 2px rgba(0, 0, 0, 0.4);
}

.btn-primary:hover {
    --btn-bg: #8b6dff;
}

.btn-secondary {
    --btn-bg: var(--surface-2);
    --btn-border: var(--border);
}

.btn-secondary:hover {
    --btn-bg: var(--surface-3);
    --btn-border: var(--border-strong);
}

.btn-ghost {
    --btn-fg: var(--text-muted);
}

.btn-ghost:hover {
    --btn-bg: var(--surface-2);
    --btn-fg: var(--text);
}

.btn-danger {
    --btn-bg: rgba(245, 86, 110, 0.1);
    --btn-fg: var(--danger);
    --btn-border: rgba(245, 86, 110, 0.24);
}

.btn-danger:hover {
    --btn-bg: rgba(245, 86, 110, 0.18);
    --btn-border: rgba(245, 86, 110, 0.4);
}

.btn-sm { height: 30px; padding-inline: var(--s-3); font-size: var(--text-xs); }
.btn-lg { height: 46px; padding-inline: var(--s-6); font-size: var(--text-md); }
.btn-block { width: 100%; }

.btn:disabled,
.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--r-md);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-subtle);
    cursor: pointer;
    transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.icon-btn:hover {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}

.icon-btn.danger:hover {
    color: var(--danger);
    border-color: rgba(245, 86, 110, 0.3);
    background: rgba(245, 86, 110, 0.08);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
    padding-block: var(--s-24) var(--s-16);
    text-align: center;
}

.hero h1 {
    font-size: clamp(2rem, 5.4vw, var(--text-4xl));
    letter-spacing: -0.035em;
    margin-block: var(--s-6) var(--s-5);
    max-width: 16ch;
    margin-inline: auto;
}

.hero .lede {
    color: var(--text-muted);
    font-size: var(--text-lg);
    max-width: 54ch;
    margin-inline: auto;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: var(--s-3);
    flex-wrap: wrap;
    margin-top: var(--s-8);
}

/* ==========================================================================
   Trust bar
   ========================================================================== */
.trust-bar {
    border-block: 1px solid var(--border);
    background: var(--surface-1);
}

.trust-bar-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--s-4) var(--s-10);
    padding-block: var(--s-5);
}

.trust-item {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 500;
}

.trust-item .icon {
    width: 15px;
    height: 15px;
    color: var(--accent);
}

/* ==========================================================================
   Cards & grids
   ========================================================================== */
.grid {
    display: grid;
    gap: var(--s-5);
    grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease-out);
}

a.card:hover {
    border-color: var(--border-strong);
    background: var(--surface-2);
    transform: translateY(-2px);
}

.card-media {
    aspect-ratio: 4 / 3;
    background: var(--n-900);
    border-bottom: 1px solid var(--border);
    display: grid;
    place-items: center;
    color: var(--text-faint);
    overflow: hidden;
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--ease-out);
}

a.card:hover .card-media img {
    transform: scale(1.03);
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    padding: var(--s-5);
    flex: 1;
}

.card-body h3 {
    font-size: var(--text-md);
    font-weight: 600;
}

.card-specs {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
    margin: 0;
    padding: 0;
    list-style: none;
    flex: 1;
}

.card-specs li {
    display: flex;
    align-items: flex-start;
    gap: var(--s-2);
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: 1.5;
}

.card-specs li::before {
    content: '';
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-faint);
    margin-top: 0.6em;
    flex-shrink: 0;
}

.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    margin-top: var(--s-2);
    padding-top: var(--s-4);
    border-top: 1px solid var(--border);
}

.price {
    font-family: var(--font-mono);
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.03em;
}

.price-lg {
    font-size: var(--text-xl);
}

.card-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--s-1);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-subtle);
    transition: color 0.15s var(--ease), gap 0.2s var(--ease);
}

a.card:hover .card-cta {
    color: var(--accent);
    gap: var(--s-2);
}

.empty-state {
    display: grid;
    place-items: center;
    gap: var(--s-3);
    text-align: center;
    padding: var(--s-16) var(--s-6);
    border: 1px dashed var(--border);
    border-radius: var(--r-lg);
    color: var(--text-subtle);
    font-size: var(--text-sm);
}

.empty-state .icon {
    color: var(--text-faint);
}

/* ==========================================================================
   Process / steps
   ========================================================================== */
.steps {
    display: grid;
    gap: var(--s-5);
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    counter-reset: step;
}

.step {
    position: relative;
    padding: var(--s-6);
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
}

.step-num {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: var(--r-sm);
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 600;
    margin-bottom: var(--s-4);
}

.step h3 {
    font-size: var(--text-base);
    margin-bottom: var(--s-2);
}

.step p {
    color: var(--text-subtle);
    font-size: var(--text-sm);
    line-height: 1.6;
}

/* ==========================================================================
   Ratings & vouches
   ========================================================================== */
.stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--warning);
    line-height: 1;
}

.stars .icon {
    width: 15px;
    height: 15px;
}

.stars .icon.is-filled {
    fill: currentColor;
}

.stars .icon.is-empty {
    color: var(--n-600);
}

.stars-lg .icon { width: 20px; height: 20px; }

.rating-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--s-10);
    align-items: center;
    padding: var(--s-8);
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
}

.rating-score {
    text-align: center;
    padding-right: var(--s-8);
    border-right: 1px solid var(--border);
}

.rating-score .score-value {
    font-size: var(--text-4xl);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.rating-score .score-meta {
    color: var(--text-subtle);
    font-size: var(--text-xs);
    font-family: var(--font-mono);
    margin-top: var(--s-2);
}

.rating-score .stars {
    margin-top: var(--s-3);
}

.rating-bars {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    min-width: 0;
}

.rating-bar-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: center;
    gap: var(--s-3);
    font-size: var(--text-xs);
    color: var(--text-subtle);
    font-family: var(--font-mono);
}

.rating-bar {
    height: 6px;
    border-radius: var(--r-full);
    background: var(--surface-3);
    overflow: hidden;
}

.rating-bar span {
    display: block;
    height: 100%;
    border-radius: var(--r-full);
    background: var(--warning);
    transition: width 0.6s var(--ease-out);
}

.rating-bar-row .count {
    text-align: right;
}

/* Interactive star picker */
.star-input {
    display: inline-flex;
    gap: var(--s-1);
}

.star-input button {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: var(--n-600);
    line-height: 0;
    transition: color 0.12s var(--ease), transform 0.12s var(--ease);
}

.star-input button .icon {
    width: 28px;
    height: 28px;
}

.star-input button:hover {
    transform: scale(1.12);
}

.star-input button.on {
    color: var(--warning);
}

.star-input button.on .icon {
    fill: currentColor;
}

.star-hint {
    margin-left: var(--s-3);
    font-size: var(--text-sm);
    color: var(--text-subtle);
}

/* Review cards */
.vouch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--s-4);
}

.vouch {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    padding: var(--s-5);
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    transition: border-color 0.2s var(--ease);
}

.vouch:hover {
    border-color: var(--border-strong);
}

.vouch-head {
    display: flex;
    align-items: center;
    gap: var(--s-3);
}

.vouch-head .avatar {
    width: 34px;
    height: 34px;
}

.vouch-who {
    min-width: 0;
    flex: 1;
}

.vouch-name {
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vouch-date {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-faint);
}

.vouch-text {
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.vouch-product {
    align-self: flex-start;
    margin-top: auto;
}

@media (max-width: 720px) {
    .rating-panel {
        grid-template-columns: 1fr;
        gap: var(--s-6);
    }
    .rating-score {
        padding-right: 0;
        padding-bottom: var(--s-6);
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

/* ==========================================================================
   Breadcrumb
   ========================================================================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    font-size: var(--text-sm);
    color: var(--text-faint);
    margin-bottom: var(--s-8);
}

.breadcrumb a {
    color: var(--text-subtle);
    transition: color 0.15s var(--ease);
}

.breadcrumb a:hover { color: var(--text); }
.breadcrumb .icon { width: 13px; height: 13px; }

/* ==========================================================================
   Product detail
   ========================================================================== */
.product-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: var(--s-12);
    align-items: start;
}

.product-media {
    position: sticky;
    top: calc(var(--nav-h) + var(--s-6));
    aspect-ratio: 4 / 3;
    background: var(--n-900);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    display: grid;
    place-items: center;
    color: var(--text-faint);
}

.product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info h1 {
    font-size: var(--text-3xl);
    letter-spacing: -0.03em;
    margin-bottom: var(--s-3);
}

.product-price-row {
    display: flex;
    align-items: baseline;
    gap: var(--s-3);
    padding-bottom: var(--s-6);
    margin-bottom: var(--s-6);
    border-bottom: 1px solid var(--border);
}

.spec-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--s-8);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}

.spec-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--s-3);
    color: var(--text-muted);
    font-size: var(--text-base);
    line-height: 1.55;
}

.spec-list .icon {
    width: 16px;
    height: 16px;
    color: var(--success);
    margin-top: 0.22em;
    flex-shrink: 0;
}

.product-cta-note {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-top: var(--s-4);
    color: var(--text-faint);
    font-size: var(--text-xs);
}

/* ==========================================================================
   Forms
   ========================================================================== */
.field {
    margin-bottom: var(--s-5);
}

.field-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-3);
    margin-bottom: var(--s-2);
}

.field-head .label { margin-bottom: 0; }

.field-note {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-faint);
    white-space: nowrap;
}

.input,
input[type='text'],
input[type='email'],
input[type='number'],
input[type='url'],
input[type='password'],
textarea,
select {
    width: 100%;
    background: var(--n-900);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 0 var(--s-3);
    height: 38px;
    color: var(--text);
    font-size: var(--text-sm);
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}

textarea {
    height: auto;
    min-height: 92px;
    padding: var(--s-3);
    resize: vertical;
    line-height: 1.6;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-faint);
}

input:hover,
textarea:hover,
select:hover {
    border-color: var(--border-strong);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--n-850);
}

input[type='color'] {
    padding: 3px;
    height: 38px;
    width: 46px;
    cursor: pointer;
}

input[type='file'] {
    height: auto;
    padding: var(--s-2) var(--s-3);
    color: var(--text-subtle);
    font-size: var(--text-xs);
    cursor: pointer;
}

.check-row {
    display: flex;
    align-items: center;
    gap: var(--s-2);
}

.check-row input[type='checkbox'] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.check-row label {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
    cursor: pointer;
}

.help-text {
    display: block;
    margin-top: var(--s-2);
    color: var(--text-faint);
    font-size: var(--text-xs);
    line-height: 1.5;
}

.panel {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s-6);
}

.panel-header {
    display: flex;
    align-items: flex-start;
    gap: var(--s-3);
    padding-bottom: var(--s-5);
    margin-bottom: var(--s-6);
    border-bottom: 1px solid var(--border);
}

.panel-header .panel-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: var(--r-md);
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    color: var(--accent);
    flex-shrink: 0;
}

.panel-header h1 {
    font-size: var(--text-lg);
}

.panel-header p {
    color: var(--text-faint);
    font-size: var(--text-xs);
    margin-top: 2px;
}

/* Option selectors (category / priority) */
.option-grid {
    display: grid;
    gap: var(--s-2);
}

.option-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.option-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.option {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3);
    background: var(--n-900);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-muted);
    text-align: left;
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease);
}

.option:hover {
    border-color: var(--border-strong);
    background: var(--n-850);
}

.option.selected {
    border-color: var(--accent-line);
    background: var(--accent-soft);
    color: var(--text);
}

.option.selected::after {
    content: '';
    position: absolute;
    top: var(--s-2);
    right: var(--s-2);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.option-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: var(--r-sm);
    background: var(--surface-3);
    color: var(--text-muted);
    flex-shrink: 0;
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.option-icon .icon { width: 15px; height: 15px; }

.option.selected .option-icon {
    background: var(--accent);
    color: #fff;
}

.option-label {
    font-size: var(--text-sm);
    font-weight: 500;
}

.option-vertical {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.option-vertical .option-label {
    display: flex;
    align-items: center;
    gap: var(--s-2);
}

.option-vertical small {
    color: var(--text-faint);
    font-size: var(--text-xs);
}

.dot-marker {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-low { background: var(--text-faint); }
.dot-medium { background: var(--info); }
.dot-high { background: var(--warning); }
.dot-urgent { background: var(--danger); }

/* ==========================================================================
   Ticket form layout
   ========================================================================== */
.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 296px;
    gap: var(--s-6);
    align-items: start;
}

.sidebar-stack {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    position: sticky;
    top: calc(var(--nav-h) + var(--s-6));
}

.side-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s-5);
}

.side-card h2 {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin-bottom: var(--s-4);
}

.side-card h2 .icon { width: 13px; height: 13px; }

.stat-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    padding-block: var(--s-3);
    border-top: 1px solid var(--border);
    font-size: var(--text-sm);
}

.stat-line:first-of-type { border-top: none; padding-top: 0; }
.stat-line:last-child { padding-bottom: 0; }

.stat-line .stat-key {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    color: var(--text-muted);
}

.stat-line .stat-key .icon { width: 14px; height: 14px; color: var(--text-faint); }

.stat-line .stat-val {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.02em;
}

.faq-entry {
    padding-block: var(--s-3);
    border-top: 1px solid var(--border);
}

.faq-entry:first-of-type { border-top: none; padding-top: 0; }
.faq-entry:last-child { padding-bottom: 0; }

.faq-entry strong {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: var(--s-1);
}

.faq-entry p {
    color: var(--text-subtle);
    font-size: var(--text-xs);
    line-height: 1.6;
}

/* ==========================================================================
   Status pills / badges / tags
   ========================================================================== */
.pill {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: 3px var(--s-3);
    border-radius: var(--r-full);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.pill::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.pill-open {
    background: rgba(47, 207, 143, 0.1);
    color: var(--success);
    border-color: rgba(47, 207, 143, 0.22);
}

.pill-closed {
    background: rgba(245, 86, 110, 0.09);
    color: var(--danger);
    border-color: rgba(245, 86, 110, 0.2);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: var(--s-1);
    padding: 2px var(--s-2);
    border-radius: var(--r-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-subtle);
    font-size: var(--text-xs);
    font-weight: 500;
}

.tag-low    { color: var(--text-subtle); }
.tag-medium { color: var(--info);    border-color: rgba(76, 159, 254, 0.22); }
.tag-high   { color: var(--warning); border-color: rgba(245, 165, 36, 0.24); }
.tag-urgent { color: var(--danger);  border-color: rgba(245, 86, 110, 0.26); }

/* ==========================================================================
   Ticket chat
   ========================================================================== */
.chat-wrap {
    max-width: 880px;
    margin-inline: auto;
    padding: var(--s-6) var(--gutter) var(--s-10);
}

.chat-shell {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--nav-h) - var(--s-16));
    min-height: 480px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
}

.chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-4) var(--s-5);
    border-bottom: 1px solid var(--border);
    background: var(--surface-1);
}

.chat-head h1 {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    font-size: var(--text-base);
    font-weight: 600;
}

.chat-head .icon { color: var(--text-faint); }

.chat-head-tags {
    display: flex;
    gap: var(--s-2);
    margin-top: var(--s-2);
    flex-wrap: wrap;
}

.chat-head-actions {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    flex-shrink: 0;
}

.chat-log {
    flex: 1;
    overflow-y: auto;
    padding: var(--s-5);
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    scroll-behavior: smooth;
}

.msg {
    display: flex;
    gap: var(--s-3);
    max-width: 76%;
    animation: msg-in 0.3s var(--ease-out);
}

@keyframes msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.msg .avatar {
    width: 28px;
    height: 28px;
    margin-top: 2px;
}

.msg-bubble {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: var(--s-2) var(--s-3);
    min-width: 0;
}

.msg-meta {
    display: flex;
    align-items: baseline;
    gap: var(--s-2);
    font-size: var(--text-xs);
    color: var(--text-faint);
    margin-bottom: 3px;
}

.msg-author {
    font-weight: 600;
    color: var(--text-muted);
}

.msg-role {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent);
}

.msg-time {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    margin-left: auto;
    padding-left: var(--s-2);
}

.msg-text {
    font-size: var(--text-sm);
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.msg.self {
    margin-left: auto;
    flex-direction: row-reverse;
}

.msg.self .msg-bubble {
    background: var(--accent);
    border-color: transparent;
    color: #fff;
}

.msg.self .msg-meta,
.msg.self .msg-author,
.msg.self .msg-role { color: rgba(255, 255, 255, 0.78); }

.msg.system {
    max-width: 100%;
    justify-content: center;
}

.msg.system .msg-bubble {
    background: transparent;
    border-style: dashed;
    text-align: center;
}

.msg.system .msg-text {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-faint);
}

.chat-composer {
    display: flex;
    gap: var(--s-3);
    align-items: flex-end;
    padding: var(--s-3);
    border-top: 1px solid var(--border);
    background: var(--surface-1);
}

.chat-composer textarea {
    flex: 1;
    min-height: 38px;
    max-height: 148px;
    padding: var(--s-2) var(--s-3);
}

.chat-locked {
    padding: var(--s-4);
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-faint);
    font-size: var(--text-xs);
    font-family: var(--font-mono);
}

/* ==========================================================================
   Ticket list rows
   ========================================================================== */
.row-list {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}

.row-item {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    padding: var(--s-4) var(--s-5);
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.row-item:hover {
    border-color: var(--border-strong);
    background: var(--surface-2);
}

.row-item .row-main { flex: 1; min-width: 0; }

.row-item .row-title {
    font-size: var(--text-sm);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row-item .row-sub {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-faint);
    margin-top: 2px;
}

/* ==========================================================================
   Admin shell
   ========================================================================== */
.admin-shell {
    display: grid;
    grid-template-columns: 216px minmax(0, 1fr);
    min-height: calc(100vh - var(--nav-h));
}

.admin-nav {
    border-right: 1px solid var(--border);
    padding: var(--s-5) var(--s-3);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-nav .nav-group-label {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    padding: var(--s-2) var(--s-3);
    margin-top: var(--s-3);
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-md);
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.admin-nav a .icon { color: var(--text-faint); transition: color 0.15s var(--ease); }
.admin-nav a:hover { background: var(--surface-2); color: var(--text); }
.admin-nav a:hover .icon { color: var(--text-muted); }

.admin-nav a.active {
    background: var(--surface-2);
    color: var(--text);
}

.admin-nav a.active .icon { color: var(--accent); }

.admin-body {
    padding: var(--s-8);
    min-width: 0;
}

.admin-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--s-4);
    flex-wrap: wrap;
    margin-bottom: var(--s-6);
}

.admin-header h1 {
    font-size: var(--text-xl);
}

.admin-header p {
    color: var(--text-subtle);
    font-size: var(--text-sm);
    margin-top: var(--s-1);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--s-4);
    margin-bottom: var(--s-8);
}

.metric {
    padding: var(--s-5);
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
}

.metric-key {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    font-size: var(--text-xs);
    color: var(--text-subtle);
    margin-bottom: var(--s-3);
}

.metric-key .icon { width: 14px; height: 14px; color: var(--text-faint); }

.metric-val {
    font-size: var(--text-2xl);
    font-weight: 600;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

/* Tables */
.table-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
}

.table-scroll { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: var(--s-3) var(--s-4);
    font-size: var(--text-sm);
    white-space: nowrap;
}

th {
    background: var(--surface-1);
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

td {
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.12s var(--ease); }
tbody tr:hover { background: var(--surface-1); }

td.cell-strong { color: var(--text); font-weight: 500; }

.thumb {
    width: 34px;
    height: 34px;
    border-radius: var(--r-sm);
    object-fit: cover;
    background: var(--n-900);
    border: 1px solid var(--border);
}

.thumb-placeholder {
    display: grid;
    place-items: center;
    color: var(--text-faint);
}

.cell-user {
    display: flex;
    align-items: center;
    gap: var(--s-2);
}

.cell-actions {
    display: flex;
    gap: var(--s-1);
    justify-content: flex-end;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--s-1);
    padding: 2px var(--s-2);
    border-radius: var(--r-sm);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    border: 1px solid transparent;
}

.badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.badge-on {
    background: rgba(47, 207, 143, 0.09);
    color: var(--success);
    border-color: rgba(47, 207, 143, 0.2);
}

.badge-off {
    background: var(--surface-2);
    color: var(--text-faint);
    border-color: var(--border);
}

/* ==========================================================================
   Modal
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--s-5);
    background: rgba(5, 6, 9, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-backdrop.open {
    display: flex;
    animation: fade-in 0.16s var(--ease);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
    width: 100%;
    max-width: 480px;
    max-height: 88vh;
    overflow-y: auto;
    background: var(--n-850);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    animation: modal-in 0.2s var(--ease-out);
}

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

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    padding: var(--s-5) var(--s-5) var(--s-4);
    border-bottom: 1px solid var(--border);
}

.modal-head h2 { font-size: var(--text-md); }

.modal-body { padding: var(--s-5); }

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: var(--s-2);
    padding: var(--s-4) var(--s-5);
    border-top: 1px solid var(--border);
    background: var(--surface-1);
}

.img-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    background: var(--n-900);
    margin-top: var(--s-2);
    display: none;
}

.color-row {
    display: flex;
    align-items: center;
    gap: var(--s-2);
}

.color-row input[type='text'] { max-width: 116px; }

/* ==========================================================================
   Toast
   ========================================================================== */
.toast {
    position: fixed;
    bottom: var(--s-5);
    right: var(--s-5);
    z-index: 300;
    display: flex;
    align-items: center;
    gap: var(--s-3);
    max-width: 340px;
    padding: var(--s-3) var(--s-4);
    background: var(--n-800);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    font-size: var(--text-sm);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease-out);
}

.toast.show {
    opacity: 1;
    transform: none;
}

.toast::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
}

.toast.error {
    border-color: rgba(245, 86, 110, 0.4);
}

.toast.error::before { background: var(--danger); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    border-top: 1px solid var(--border);
    margin-top: var(--s-16);
    padding-block: var(--s-10) var(--s-8);
    background: var(--surface-1);
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    gap: var(--s-10);
    flex-wrap: wrap;
    padding-bottom: var(--s-8);
    margin-bottom: var(--s-6);
    border-bottom: 1px solid var(--border);
}

.footer-brand {
    max-width: 280px;
}

.footer-brand .brand { margin-bottom: var(--s-3); }

.footer-brand p {
    color: var(--text-subtle);
    font-size: var(--text-sm);
    line-height: 1.6;
}

.footer-cols {
    display: flex;
    gap: var(--s-16);
    flex-wrap: wrap;
}

.footer-col h4 {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    font-weight: 500;
    margin-bottom: var(--s-3);
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    font-size: var(--text-sm);
    padding-block: var(--s-1);
    transition: color 0.15s var(--ease);
}

.footer-col a:hover { color: var(--text); }

.footer-base {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    flex-wrap: wrap;
    color: var(--text-faint);
    font-size: var(--text-xs);
}

/* ==========================================================================
   Error pages
   ========================================================================== */
.state-panel {
    max-width: 440px;
    margin: var(--s-24) auto;
    text-align: center;
    padding-inline: var(--gutter);
}

.state-panel .state-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 0 auto var(--s-5);
    border-radius: var(--r-lg);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-subtle);
}

.state-panel h1 {
    font-size: var(--text-xl);
    margin-bottom: var(--s-2);
}

.state-panel p {
    color: var(--text-subtle);
    margin-bottom: var(--s-6);
    font-size: var(--text-sm);
}

/* ==========================================================================
   Reveal on scroll
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal.in {
    opacity: 1;
    transform: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: var(--s-8);
    }
    .product-media { position: static; }

    .form-layout {
        grid-template-columns: 1fr;
    }
    .sidebar-stack { position: static; }
}

@media (max-width: 860px) {
    :root { --gutter: var(--s-5); }

    .navbar-toggle { display: inline-flex; }

    .nav-links {
        position: absolute;
        top: var(--nav-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: var(--s-3) var(--gutter) var(--s-4);
        background: var(--n-900);
        border-bottom: 1px solid var(--border);
        display: none;
        box-shadow: var(--shadow-md);
    }

    .nav-links.open { display: flex; }
    .nav-links a { padding: var(--s-3); }

    .user-chip span { display: none; }

    .admin-shell { grid-template-columns: 1fr; }

    .admin-nav {
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: var(--s-3);
    }

    .admin-nav .nav-group-label { display: none; }
    .admin-nav a { white-space: nowrap; }

    .admin-body { padding: var(--s-6) var(--gutter); }

    .option-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
    .option-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }

    .section { padding-block: var(--s-12); }
    .hero { padding-block: var(--s-16) var(--s-12); }

    .msg { max-width: 90%; }

    .chat-wrap { padding: var(--s-3) var(--s-3) var(--s-6); }
    .chat-shell { height: calc(100vh - var(--nav-h) - var(--s-10)); }

    .footer-cols { gap: var(--s-10); }
}

@media (max-width: 520px) {
    .hero-actions .btn { width: 100%; }
    .toast { left: var(--s-4); right: var(--s-4); max-width: none; }
    .grid { grid-template-columns: 1fr; }
    .metric-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}
