/*!
 * Anvil — the UI framework of Ferrum Commerce.
 *
 * Goals: readable at a glance, calm and modern, accessible (WCAG AA contrast,
 * visible focus, 44px touch targets), mobile first, zero dependencies.
 *
 * Structure (cascade layers, lowest priority first):
 *   tokens      design tokens (colors, spacing, radii, shadows, type scale)
 *   reset       modern CSS reset
 *   base        element defaults and typography
 *   layout      containers, stacks, grids, clusters
 *   components  buttons, forms, cards, tables, badges, dialogs, toasts, …
 *   utilities   small single-purpose helpers
 *
 * Themes override tokens only (e.g. --primary), never component internals.
 */

/* Inter (SIL Open Font License 1.1, see ui/fonts/LICENSE-Inter.txt), self-hosted for privacy and speed. */
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("fonts/inter-latin-ext.woff2") format("woff2-variations"), url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("fonts/inter-latin.woff2") format("woff2-variations"), url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

@layer tokens, reset, base, layout, components, utilities;

/* ==========================================================================
   Tokens
   ========================================================================== */
@layer tokens {
  :root {
    color-scheme: light;

    /* Brand – themes override these two and everything else follows. */
    --primary: #2457e6;
    --accent: #f59e0b;

    --primary-hover: color-mix(in srgb, var(--primary) 86%, #000);
    --primary-soft: color-mix(in srgb, var(--primary) 10%, var(--surface));
    --primary-ring: color-mix(in srgb, var(--primary) 35%, transparent);
    --on-primary: #fff;

    /* Neutrals */
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #f1f3f6;
    --surface-3: #e7eaef;
    --border: #e1e5eb;
    --border-strong: #c9d0da;
    --text: #141a24;
    --text-2: #4a5566;
    --text-3: #77839a;

    /* Semantic */
    --success: #12805c;
    --success-soft: #e3f5ed;
    --warning: #b25e09;
    --warning-soft: #fdf1df;
    --danger: #c8293f;
    --danger-soft: #fce8eb;
    --info: #1f6fb2;
    --info-soft: #e4f0fb;

    /* Typography */
    --font-sans: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --font-display: var(--font-sans);
    --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-md: 1.125rem;
    --text-lg: 1.375rem;
    --text-xl: 1.75rem;
    --text-2xl: clamp(1.875rem, 1.4rem + 1.6vw, 2.5rem);
    --text-3xl: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);
    --leading: 1.6;
    --leading-tight: 1.2;

    /* Spacing (4px grid) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Shape & depth */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 999px;
    --shadow-xs: 0 1px 2px rgb(16 24 40 / 0.06);
    --shadow-sm: 0 1px 3px rgb(16 24 40 / 0.08), 0 1px 2px rgb(16 24 40 / 0.04);
    --shadow: 0 4px 12px -2px rgb(16 24 40 / 0.08), 0 2px 4px -2px rgb(16 24 40 / 0.04);
    --shadow-lg: 0 16px 40px -8px rgb(16 24 40 / 0.18), 0 6px 12px -6px rgb(16 24 40 / 0.08);

    /* Controls */
    --control-height: 2.75rem;
    --control-height-sm: 2.25rem;
    --focus-ring: 0 0 0 3px var(--primary-ring);

    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --duration: 160ms;
    --container: 1240px;
  }

  /* Dark mode: follows the OS unless forced with data-theme. */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
      --bg: #0e1117;
      --surface: #161b24;
      --surface-2: #1d2430;
      --surface-3: #262f3d;
      --border: #2a3342;
      --border-strong: #3a4558;
      --text: #e8ecf3;
      --text-2: #b0bacb;
      --text-3: #8591a6;
      --primary: #5b8cff;
      --primary-soft: color-mix(in srgb, var(--primary) 16%, var(--surface));
      --success: #3ecf8e;
      --success-soft: #12261d;
      --warning: #f0a33a;
      --warning-soft: #2b2112;
      --danger: #ff6b81;
      --danger-soft: #2c1519;
      --info: #5aa9ef;
      --info-soft: #132235;
      --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.4);
      --shadow: 0 4px 14px rgb(0 0 0 / 0.45);
      --shadow-lg: 0 18px 44px rgb(0 0 0 / 0.55);
    }
  }
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0e1117;
    --surface: #161b24;
    --surface-2: #1d2430;
    --surface-3: #262f3d;
    --border: #2a3342;
    --border-strong: #3a4558;
    --text: #e8ecf3;
    --text-2: #b0bacb;
    --text-3: #8591a6;
    --primary: #5b8cff;
    --primary-soft: color-mix(in srgb, var(--primary) 16%, var(--surface));
    --success: #3ecf8e;
    --success-soft: #12261d;
    --warning: #f0a33a;
    --warning-soft: #2b2112;
    --danger: #ff6b81;
    --danger-soft: #2c1519;
    --info: #5aa9ef;
    --info-soft: #132235;
    --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.4);
    --shadow: 0 4px 14px rgb(0 0 0 / 0.45);
    --shadow-lg: 0 18px 44px rgb(0 0 0 / 0.55);
  }
}

/* ==========================================================================
   Reset
   ========================================================================== */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { min-height: 100dvh; }
  img, picture, video, canvas, svg { display: block; max-width: 100%; }
  img { height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { cursor: pointer; background: none; border: 0; padding: 0; }
  p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
  table { border-collapse: collapse; border-spacing: 0; }
  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
  [hidden] { display: none !important; }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  }
}

/* ==========================================================================
   Base
   ========================================================================== */
@layer base {
  html { scroll-behavior: smooth; }
  body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  h1, h2, h3, h4 { font-family: var(--font-display); line-height: var(--leading-tight); font-weight: 700; letter-spacing: -0.015em; color: var(--text); }
  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
  h3 { font-size: var(--text-lg); }
  h4 { font-size: var(--text-md); }
  a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
  a:hover { color: var(--primary-hover); }
  small { font-size: var(--text-sm); }
  strong, b { font-weight: 650; }
  hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-6) 0; }
  code, kbd, pre { font-family: var(--font-mono); font-size: 0.92em; }
  code { background: var(--surface-2); padding: 0.1em 0.35em; border-radius: var(--radius-sm); }
  ::selection { background: var(--primary-ring); }
  :focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

  .icon { width: 1.25em; height: 1.25em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

  /* Rich text content (product descriptions, pages, blog) */
  .prose { color: var(--text); max-width: 72ch; }
  .prose > * + * { margin-top: 1em; }
  .prose h2 { font-size: var(--text-lg); margin-top: 1.6em; }
  .prose h3 { font-size: var(--text-md); margin-top: 1.4em; }
  .prose ul, .prose ol { padding-left: 1.4em; }
  .prose li + li { margin-top: 0.35em; }
  .prose img { border-radius: var(--radius); }
  .prose blockquote { border-left: 3px solid var(--primary); padding: 0.25em 0 0.25em 1em; color: var(--text-2); font-style: italic; }
  /* Wide tables scroll inside the text column instead of widening the whole page on phones. */
  .prose table { display: block; width: 100%; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: var(--text-sm); -webkit-overflow-scrolling: touch; }
  .prose th, .prose td { vertical-align: top; }
  @media (max-width: 640px) { .prose th, .prose td { min-width: 9rem; } }
  .prose th, .prose td { border: 1px solid var(--border); padding: 0.5em 0.75em; text-align: left; }
  .prose th { background: var(--surface-2); }
  .prose iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: var(--radius); }
}

/* ==========================================================================
   Layout primitives
   ========================================================================== */
@layer layout {
  .container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1rem, 3vw, 2rem); }
  .container--narrow { max-width: 760px; }
  .container--wide { max-width: 1440px; }

  /* Vertical rhythm: children separated by --gap. */
  .stack { display: flex; flex-direction: column; gap: var(--gap, var(--space-4)); }
  .stack--sm { --gap: var(--space-2); }
  .stack--lg { --gap: var(--space-8); }

  /* Horizontal group that wraps. */
  .cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, var(--space-3)); }
  .cluster--between { justify-content: space-between; }
  .cluster--end { justify-content: flex-end; }
  .cluster--nowrap { flex-wrap: nowrap; }

  /* Responsive auto grid: as many columns of at least --min as fit. */
  .grid { display: grid; gap: var(--gap, var(--space-6)); grid-template-columns: repeat(auto-fill, minmax(min(var(--min, 240px), 100%), 1fr)); }
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  @media (max-width: 900px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 560px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); } }

  /* Main content + sidebar that stacks on narrow screens. */
  .with-aside { display: grid; gap: var(--space-6); grid-template-columns: minmax(0, 1fr); align-items: start; }
  @media (min-width: 1024px) {
    .with-aside { grid-template-columns: minmax(0, 1fr) 340px; }
    .with-aside--left { grid-template-columns: 280px minmax(0, 1fr); }
  }
  .sticky { position: sticky; top: var(--sticky-top, var(--space-6)); }

  .section { padding-block: clamp(2.5rem, 5vw, 4.5rem); }
  .section--tight { padding-block: clamp(1.5rem, 3vw, 2.5rem); }
  .section__header { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
  .section__title { font-size: var(--text-xl); }
  .section__lead { color: var(--text-2); max-width: 60ch; }
}

/* ==========================================================================
   Components
   ========================================================================== */
@layer components {
  /* ---- Buttons ----------------------------------------------------------- */
  .btn {
    --btn-bg: var(--surface);
    --btn-fg: var(--text);
    --btn-border: var(--border-strong);
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    min-height: var(--control-height); padding: 0 var(--space-5);
    font-weight: 600; font-size: var(--text-sm); line-height: 1; white-space: nowrap; text-decoration: none;
    color: var(--btn-fg); background: var(--btn-bg); border: 1px solid var(--btn-border); border-radius: var(--radius);
    box-shadow: var(--shadow-xs); cursor: pointer; user-select: none;
    transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease), transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  }
  .btn:hover { color: var(--btn-fg); background: color-mix(in srgb, var(--btn-bg) 92%, var(--text)); }
  .btn:active { transform: translateY(1px); }
  .btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
  .btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }
  .btn--primary { --btn-bg: var(--primary); --btn-fg: var(--on-primary); --btn-border: var(--primary); }
  .btn--primary:hover { background: var(--primary-hover); }
  .btn--accent { --btn-bg: var(--accent); --btn-fg: #1a1205; --btn-border: var(--accent); }
  .btn--success { --btn-bg: var(--success); --btn-fg: #fff; --btn-border: var(--success); }
  .btn--danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-border: var(--danger); }
  .btn--danger-ghost { --btn-bg: transparent; --btn-fg: var(--danger); --btn-border: transparent; box-shadow: none; }
  .btn--danger-ghost:hover { background: var(--danger-soft); }
  .btn--ghost { --btn-bg: transparent; --btn-border: transparent; box-shadow: none; }
  .btn--ghost:hover { background: var(--surface-2); }
  .btn--soft { --btn-bg: var(--primary-soft); --btn-fg: var(--primary); --btn-border: transparent; box-shadow: none; }
  .btn--sm { min-height: var(--control-height-sm); padding: 0 var(--space-3); font-size: var(--text-sm); }
  .btn--lg { min-height: 3.25rem; padding: 0 var(--space-8); font-size: var(--text-base); border-radius: var(--radius-lg); }
  .btn--block { width: 100%; }
  .btn--icon { padding: 0; width: var(--control-height); }
  .btn--icon.btn--sm { width: var(--control-height-sm); }
  .btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
  .btn.is-loading::after {
    content: ""; position: absolute; inset: 0; margin: auto; width: 1.1em; height: 1.1em;
    border: 2px solid var(--btn-fg); border-right-color: transparent; border-radius: 50%; animation: anvil-spin 0.7s linear infinite;
  }
  @keyframes anvil-spin { to { transform: rotate(360deg); } }

  .link-btn { color: var(--primary); font-weight: 600; font-size: var(--text-sm); display: inline-flex; align-items: center; gap: var(--space-1); }
  .link-btn:hover { text-decoration: underline; }

  /* ---- Form fields ---------------------------------------------------------- */
  .field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
  .field__label { font-weight: 600; font-size: var(--text-sm); color: var(--text); display: flex; align-items: center; gap: var(--space-2); }
  .field__label .req { color: var(--danger); }
  .field__help { font-size: var(--text-sm); color: var(--text-3); line-height: 1.45; }
  .field__error { font-size: var(--text-sm); color: var(--danger); font-weight: 600; display: flex; gap: var(--space-1); align-items: center; }
  .field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); background: var(--danger-soft); }

  .input, .select, .textarea {
    width: 100%; min-height: var(--control-height); padding: 0 var(--space-3);
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border-strong); border-radius: var(--radius);
    font-size: var(--text-base); transition: border-color var(--duration), box-shadow var(--duration);
  }
  .textarea { padding: var(--space-3); min-height: 6rem; line-height: 1.5; resize: vertical; }
  .textarea--code { font-family: var(--font-mono); font-size: var(--text-sm); min-height: 14rem; tab-size: 2; }
  .input::placeholder, .textarea::placeholder { color: var(--text-3); }
  .input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
  .input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }
  .input[readonly] { background: var(--surface-2); }
  .select {
    appearance: none; padding-right: 2.5rem; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2377839a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 1.1rem;
  }
  select[multiple].select { padding: var(--space-2); background-image: none; min-height: 9rem; }
  .input--sm, .select--sm { min-height: var(--control-height-sm); font-size: var(--text-sm); }

  /* Input with a prefix/suffix (zł, %, kg) or an attached button. */
  .input-group { display: flex; align-items: stretch; }
  .input-group > .input { border-radius: 0; flex: 1 1 auto; min-width: 0; }
  .input-group > :first-child { border-top-left-radius: var(--radius); border-bottom-left-radius: var(--radius); }
  .input-group > :last-child { border-top-right-radius: var(--radius); border-bottom-right-radius: var(--radius); }
  .input-group > * + * { margin-left: -1px; }
  .input-group__addon { display: inline-flex; align-items: center; padding: 0 var(--space-3); background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-2); font-size: var(--text-sm); font-weight: 600; white-space: nowrap; }
  .input-group > .btn { border-radius: 0; box-shadow: none; }

  /* Checkbox and radio */
  .check { display: flex; align-items: flex-start; gap: var(--space-3); cursor: pointer; line-height: 1.45; }
  .check input { appearance: none; flex-shrink: 0; width: 1.25rem; height: 1.25rem; margin-top: 0.1rem; border: 1.5px solid var(--border-strong); border-radius: 5px; background: var(--surface); display: grid; place-content: center; cursor: pointer; transition: all var(--duration); }
  .check input[type="radio"] { border-radius: 50%; }
  .check input::before { content: ""; width: 0.7rem; height: 0.7rem; transform: scale(0); transition: transform 120ms var(--ease); background: var(--on-primary); clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); }
  .check input[type="radio"]::before { clip-path: circle(50%); width: 0.5rem; height: 0.5rem; }
  .check input:checked { background: var(--primary); border-color: var(--primary); }
  .check input:checked::before { transform: scale(1); }
  .check input:focus-visible { box-shadow: var(--focus-ring); outline: none; }
  .check__text { font-size: var(--text-sm); }
  .check__text strong { display: block; font-size: var(--text-base); }
  .check__hint { display: block; color: var(--text-3); font-size: var(--text-sm); }

  /* Toggle switch (on/off settings) */
  .switch { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); cursor: pointer; }
  .switch__text { display: flex; flex-direction: column; gap: 2px; }
  .switch__text strong { font-size: var(--text-sm); font-weight: 600; }
  .switch__text span { color: var(--text-3); font-size: var(--text-sm); line-height: 1.45; }
  .switch input { appearance: none; flex-shrink: 0; position: relative; width: 2.75rem; height: 1.6rem; border-radius: var(--radius-full); background: var(--surface-3); border: 1px solid var(--border-strong); cursor: pointer; transition: background var(--duration); }
  .switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: calc(1.6rem - 6px); height: calc(1.6rem - 6px); border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--duration) var(--ease); }
  .switch input:checked { background: var(--success); border-color: var(--success); }
  .switch input:checked::after { transform: translateX(1.15rem); }
  .switch input:focus-visible { box-shadow: var(--focus-ring); outline: none; }

  /* Large selectable cards (shipping & payment choice, wizard options). */
  .choice { position: relative; display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4); border: 1.5px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); cursor: pointer; transition: border-color var(--duration), box-shadow var(--duration), background var(--duration); }
  .choice:hover { border-color: var(--border-strong); }
  .choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
  .choice:has(input:focus-visible) { box-shadow: var(--focus-ring); }
  .choice:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
  .choice > input { position: absolute; opacity: 0; pointer-events: none; }
  .choice__mark { flex-shrink: 0; width: 1.25rem; height: 1.25rem; margin-top: 0.15rem; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; background: var(--surface); }
  .choice:has(input:checked) .choice__mark { border-color: var(--primary); background: var(--primary); box-shadow: inset 0 0 0 3px var(--surface); }
  .choice__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .choice__title { font-weight: 650; }
  .choice__desc { color: var(--text-2); font-size: var(--text-sm); }
  .choice__side { font-weight: 700; white-space: nowrap; }
  .choice__meta { display: inline-flex; align-items: center; gap: 0.35em; margin-top: 2px; color: var(--text-2); font-size: var(--text-xs, 0.75rem); }
  .choice__meta .icon { width: 0.95em; height: 0.95em; }
  .choice__meta--accent { color: var(--primary); font-weight: 600; }
  .choice--disabled { cursor: default; opacity: 0.6; background: var(--surface-2, var(--surface)); border-style: dashed; }
  .choice--disabled:hover { border-color: var(--border); }
  .choices { display: grid; gap: var(--space-3); }

  /* Form layout grid: full / half / third width fields. */
  .form-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-5) var(--space-4); }
  .form-grid > * { grid-column: span 6; }
  @media (min-width: 640px) {
    .form-grid > .w-half { grid-column: span 3; }
    .form-grid > .w-third { grid-column: span 2; }
  }
  .form-heading { grid-column: 1 / -1; font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-weight: 700; padding-top: var(--space-2); border-top: 1px solid var(--border); }

  /* ---- Cards ------------------------------------------------------------------- */
  .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
  .card__header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-5) var(--space-6) 0; }
  .card__title { font-size: var(--text-md); font-weight: 700; }
  .card__subtitle { color: var(--text-3); font-size: var(--text-sm); margin-top: 2px; }
  .card__body { padding: var(--space-5) var(--space-6) var(--space-6); }
  .card__footer { padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
  .card--flat { box-shadow: none; }
  .card--hover { transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease), border-color var(--duration); }
  .card--hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--border-strong); }
  @media (max-width: 560px) {
    .card__header { padding: var(--space-4) var(--space-4) 0; }
    .card__body { padding: var(--space-4); }
    .card__footer { padding: var(--space-3) var(--space-4); }
  }
  details.card > summary { list-style: none; cursor: pointer; padding: var(--space-5) var(--space-6); display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
  details.card > summary::-webkit-details-marker { display: none; }
  details.card > summary::after { content: ""; width: 0.6rem; height: 0.6rem; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg); transition: transform var(--duration); }
  details.card[open] > summary::after { transform: rotate(-135deg); }
  details.card[open] > summary { padding-bottom: 0; }

  /* ---- Badges ---------------------------------------------------------------- */
  .badge { display: inline-flex; align-items: center; gap: 0.35em; padding: 0.2em 0.65em; border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: 650; line-height: 1.5; white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
  .badge::before { content: ""; width: 0.45em; height: 0.45em; border-radius: 50%; background: currentColor; opacity: 0.85; }
  .badge--plain::before { display: none; }
  .badge--success { background: var(--success-soft); color: var(--success); border-color: transparent; }
  .badge--warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
  .badge--danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
  .badge--info { background: var(--info-soft); color: var(--info); border-color: transparent; }
  .badge--primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
  .badge--solid { background: var(--danger); color: #fff; border-color: transparent; }
  .badge--solid::before { display: none; }

  .pill-count { min-width: 1.4rem; height: 1.4rem; padding: 0 0.4rem; display: inline-grid; place-items: center; border-radius: var(--radius-full); background: var(--danger); color: #fff; font-size: 0.7rem; font-weight: 700; }

  /* ---- Alerts / callouts -------------------------------------------------------- */
  .alert { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4); border-radius: var(--radius); border: 1px solid transparent; background: var(--info-soft); color: var(--text); font-size: var(--text-sm); }
  .alert > .icon { color: var(--info); margin-top: 0.1rem; }
  .alert__title { font-weight: 700; margin-bottom: 2px; }
  .alert--success { background: var(--success-soft); } .alert--success > .icon { color: var(--success); }
  .alert--warning { background: var(--warning-soft); } .alert--warning > .icon { color: var(--warning); }
  .alert--error { background: var(--danger-soft); } .alert--error > .icon { color: var(--danger); }
  .alert--neutral { background: var(--surface-2); border-color: var(--border); }

  /* ---- Tables (turn into cards on phones) ---------------------------------------------- */
  .table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }
  .table { width: 100%; font-size: var(--text-sm); }
  .table th { text-align: left; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); font-weight: 700; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
  .table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
  .table tbody tr:last-child td { border-bottom: 0; }
  .table tbody tr { transition: background var(--duration); }
  .table--hover tbody tr:hover { background: var(--surface-2); }
  .table--clickable tbody tr { cursor: pointer; }
  .table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .table .shrink { width: 1%; white-space: nowrap; }
  .table__title { font-weight: 650; color: var(--text); text-decoration: none; }
  .table__title:hover { color: var(--primary); }
  .table__thumb { width: 44px; height: 44px; max-width: none; display: block; padding: 2px; background: #fff; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); }
  @media (max-width: 720px) {
    .table--responsive thead { display: none; }
    .table--responsive, .table--responsive tbody, .table--responsive tr, .table--responsive td { display: block; width: 100%; }
    .table--responsive tr { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); position: relative; }
    .table--responsive td { border: 0; padding: var(--space-1) 0; display: flex; justify-content: space-between; gap: var(--space-4); text-align: right; }
    .table--responsive td::before { content: attr(data-label); color: var(--text-3); font-weight: 600; text-align: left; }
    .table--responsive td[data-label=""]::before { display: none; }
    .table--responsive td.cell-primary { font-size: var(--text-base); justify-content: flex-start; text-align: left; }
    .table--responsive td.cell-primary::before, .table--responsive td.cell-select::before { display: none; }
    .table--responsive td.cell-select { position: absolute; top: var(--space-3); right: var(--space-4); width: auto; padding: 0; }
    .table .num { text-align: right; }
  }

  /* ---- Tabs ---------------------------------------------------------------------- */
  .tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs__tab { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); font-weight: 600; font-size: var(--text-sm); color: var(--text-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
  .tabs__tab:hover { color: var(--text); }
  .tabs__tab[aria-current="page"], .tabs__tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }
  .tabs__count { background: var(--surface-2); color: var(--text-2); font-size: var(--text-xs); padding: 0 0.5em; border-radius: var(--radius-full); }

  /* ---- Pagination ------------------------------------------------------------------- */
  .pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-1); }
  .pagination a, .pagination span { min-width: 2.5rem; height: 2.5rem; padding: 0 var(--space-3); display: inline-grid; place-items: center; border-radius: var(--radius); font-weight: 600; font-size: var(--text-sm); text-decoration: none; color: var(--text-2); border: 1px solid transparent; }
  .pagination a:hover { background: var(--surface); border-color: var(--border); color: var(--text); }
  .pagination [aria-current="page"] { background: var(--primary); color: var(--on-primary); }
  .pagination .is-disabled { opacity: 0.4; }

  /* ---- Breadcrumbs ---------------------------------------------------------------------- */
  .breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-3); }
  .breadcrumbs a { color: var(--text-2); text-decoration: none; }
  .breadcrumbs a:hover { color: var(--primary); text-decoration: underline; }
  .breadcrumbs li { display: inline-flex; align-items: center; gap: var(--space-2); }
  .breadcrumbs li + li::before { content: "/"; color: var(--border-strong); }

  /* ---- Dialog (native <dialog>) --------------------------------------------------------- */
  /* Reset sets margin:0 on * — without auto, modal dialogs stick to the top-left. */
  dialog:modal { margin: auto; }
  .dialog { border: 0; padding: 0; border-radius: var(--radius-xl); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); }
  .dialog--wide { width: min(960px, calc(100vw - 2rem)); }
  .dialog::backdrop { background: rgb(10 14 22 / 0.55); backdrop-filter: blur(3px); }
  .dialog[open] { animation: anvil-pop 180ms var(--ease); }
  .dialog__header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--border); }
  .dialog__title { font-size: var(--text-md); font-weight: 700; }
  .dialog__body { padding: var(--space-6); overflow: auto; max-height: calc(100dvh - 12rem); }
  .dialog__footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--space-3); padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
  @keyframes anvil-pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

  /* ---- Drawer (side panel) -------------------------------------------------------------- */
  .drawer { position: fixed; inset: 0; z-index: 90; visibility: hidden; }
  .drawer.is-open { visibility: visible; }
  .drawer__backdrop { position: absolute; inset: 0; background: rgb(10 14 22 / 0.5); opacity: 0; transition: opacity 220ms var(--ease); }
  .drawer.is-open .drawer__backdrop { opacity: 1; }
  .drawer__panel { position: absolute; top: 0; bottom: 0; right: 0; width: min(420px, 92vw); background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform 260ms var(--ease); }
  .drawer--left .drawer__panel { right: auto; left: 0; transform: translateX(-100%); }
  .drawer.is-open .drawer__panel { transform: none; }
  .drawer__header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border); }
  .drawer__body { flex: 1; overflow-y: auto; padding: var(--space-5); }
  .drawer__footer { padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border); background: var(--surface-2); }

  /* ---- Toasts --------------------------------------------------------------------------------- */
  .toasts { position: fixed; z-index: 100; top: var(--space-4); right: var(--space-4); left: auto; bottom: auto; display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); pointer-events: none; }
  .toast { pointer-events: none; display: flex; align-items: flex-start; gap: var(--space-3); max-width: 420px; padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); font-size: var(--text-sm); font-weight: 500; animation: anvil-toast 220ms var(--ease); }
  .toast .icon { margin-top: 1px; }
  .toast--success .icon { color: #4ade80; }
  .toast--error .icon { color: #ff8a9b; }
  .toast--warning .icon { color: #fbbf24; }
  .toast.is-leaving { opacity: 0; transform: translateY(-6px); transition: all 200ms; }
  @keyframes anvil-toast { from { opacity: 0; transform: translateY(-10px); } }
  @media (max-width: 560px) { .toasts { left: var(--space-4); align-items: stretch; } .toast { max-width: none; } }

  /* ---- Dropdown menu ------------------------------------------------------------------------- */
  .dropdown { position: relative; }
  .dropdown__menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 220px; padding: var(--space-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); display: none; }
  .dropdown.is-open .dropdown__menu { display: block; animation: anvil-pop 140ms var(--ease); }
  .dropdown__item { display: flex; width: 100%; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: var(--text-sm); text-align: left; }
  .dropdown__item:hover { background: var(--surface-2); color: var(--text); }
  .dropdown__item--danger { color: var(--danger); }
  .dropdown__divider { height: 1px; background: var(--border); margin: var(--space-2) 0; }

  /* ---- Empty state ---------------------------------------------------------------------------- */
  .empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); padding: var(--space-12) var(--space-6); color: var(--text-2); }
  .empty__icon { width: 4rem; height: 4rem; display: grid; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
  .empty__icon .icon { width: 1.75rem; height: 1.75rem; }
  .empty__title { font-size: var(--text-md); font-weight: 700; color: var(--text); }
  .empty p { max-width: 46ch; }

  /* ---- Stat tile ----------------------------------------------------------------------------- */
  .stat { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
  .stat__label { color: var(--text-3); font-size: var(--text-sm); font-weight: 600; display: flex; align-items: center; gap: var(--space-2); }
  .stat__value { font-size: var(--text-xl); font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
  .stat__meta { font-size: var(--text-sm); color: var(--text-3); }
  .trend-up { color: var(--success); font-weight: 650; }
  .trend-down { color: var(--danger); font-weight: 650; }

  /* ---- Progress ---------------------------------------------------------------------------- */
  .progress { height: 0.5rem; border-radius: var(--radius-full); background: var(--surface-3); overflow: hidden; }
  .progress__bar { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 60%, var(--accent))); transition: width 400ms var(--ease); }

  /* ---- Steps (wizards) --------------------------------------------------------------------- */
  .steps { display: flex; gap: var(--space-2); counter-reset: step; list-style: none; padding: 0; overflow-x: auto; scrollbar-width: none; }
  .steps__item { flex: 1; min-width: 7rem; display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-xs); font-weight: 650; color: var(--text-3); }
  .steps__item::before { counter-increment: step; content: counter(step); width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-size: var(--text-sm); }
  .steps__item.is-current { color: var(--text); }
  .steps__item.is-current::before { background: var(--primary); color: var(--on-primary); box-shadow: 0 0 0 4px var(--primary-ring); }
  .steps__item.is-done::before { content: "✓"; background: var(--success); color: #fff; }

  /* ---- Checklist (onboarding) ----------------------------------------------------------------- */
  .checklist { list-style: none; padding: 0; display: flex; flex-direction: column; }
  .checklist li a { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; color: var(--text); text-decoration: none; border-bottom: 1px dashed var(--border); font-size: var(--text-sm); font-weight: 550; }
  .checklist li:last-child a { border-bottom: 0; }
  .checklist li a:hover { color: var(--primary); }
  .checklist__mark { width: 1.5rem; height: 1.5rem; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; }
  .checklist .is-done .checklist__mark { background: var(--success); border-color: var(--success); color: #fff; }
  .checklist .is-done span:last-child { color: var(--text-3); text-decoration: line-through; }
  .checklist__mark .icon { width: 0.9rem; height: 0.9rem; stroke-width: 3; }

  /* ---- Timeline -------------------------------------------------------------------------- */
  .timeline { list-style: none; padding: 0; position: relative; }
  .timeline::before { content: ""; position: absolute; left: 0.45rem; top: 0.5rem; bottom: 0.5rem; width: 2px; background: var(--border); }
  .timeline li { position: relative; padding: 0 0 var(--space-4) var(--space-8); font-size: var(--text-sm); }
  .timeline li::before { content: ""; position: absolute; left: 0; top: 0.35rem; width: 0.95rem; height: 0.95rem; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); }
  .timeline__meta { color: var(--text-3); font-size: var(--text-xs); }

  /* ---- Description list ----------------------------------------------------------------------- */
  .dl { display: grid; grid-template-columns: minmax(7rem, auto) 1fr; gap: var(--space-2) var(--space-4); font-size: var(--text-sm); }
  .dl dt { color: var(--text-3); }
  .dl dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }

  /* ---- Misc ------------------------------------------------------------------------------- */
  .avatar { width: 2.25rem; height: 2.25rem; border-radius: 50%; display: inline-grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: var(--text-sm); flex-shrink: 0; }
  .kbd, kbd { display: inline-flex; align-items: center; padding: 0.05em 0.45em; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; font-size: 0.75em; font-family: var(--font-sans); color: var(--text-2); background: var(--surface); }
  .divider { display: flex; align-items: center; gap: var(--space-3); color: var(--text-3); font-size: var(--text-sm); }
  .divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
  .skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: anvil-shimmer 1.2s infinite; border-radius: var(--radius-sm); }
  @keyframes anvil-shimmer { to { background-position: -200% 0; } }
  .spinner { width: 1.25rem; height: 1.25rem; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: anvil-spin 0.7s linear infinite; }
  [data-tooltip] { position: relative; }
  [data-tooltip]:hover::after { content: attr(data-tooltip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 60; padding: 0.35rem 0.6rem; background: var(--text); color: var(--surface); font-size: var(--text-xs); font-weight: 500; border-radius: var(--radius-sm); white-space: nowrap; pointer-events: none; }
  .price { font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
  .price--old { color: var(--text-3); text-decoration: line-through; font-weight: 500; }
  .price--sale { color: var(--danger); }
  .qty { display: inline-flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
  .qty button { width: 2.5rem; display: grid; place-items: center; color: var(--text-2); }
  .qty button:hover { background: var(--surface-2); color: var(--text); }
  .qty input { width: 3.25rem; text-align: center; border: 0; background: transparent; font-weight: 650; -moz-appearance: textfield; min-height: var(--control-height); }
  .qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
  .qty input:focus { outline: none; background: var(--primary-soft); }
  .announcement-bar { text-align: center; padding: 0.5rem 1rem; font-size: var(--text-sm); font-weight: 600; }
  .announcement-bar a { color: inherit; }
  .free-shipping { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--surface-2); font-size: var(--text-sm); }
  .cookie-consent { position: fixed; z-index: 95; left: var(--space-4); right: var(--space-4); bottom: var(--space-4); max-width: 640px; margin-inline: auto; padding: var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: var(--space-4); font-size: var(--text-sm); }
  .cookie-consent__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }
  .quick-contact { position: fixed; z-index: 80; right: var(--space-4); bottom: var(--space-4); display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); }
  .quick-contact__btn { display: inline-flex; align-items: center; gap: var(--space-2); padding: 0.75rem 1rem; border-radius: var(--radius-full); background: var(--success); color: #fff; font-weight: 700; font-size: var(--text-sm); text-decoration: none; box-shadow: var(--shadow-lg); }
  .quick-contact__btn:hover { color: #fff; filter: brightness(1.05); }
  .quick-contact__btn--wa { background: #25d366; width: 3rem; height: 3rem; padding: 0; justify-content: center; }
  @media (max-width: 560px) { .quick-contact__btn span { display: none; } .quick-contact__btn { width: 3.25rem; height: 3.25rem; padding: 0; justify-content: center; } }

  /* ---- Cookie consent (ui/tracking.js) ----------------------------------------------------- */
  .consent { position: fixed; inset: auto 1rem 1rem 1rem; z-index: 90; display: flex; justify-content: center; pointer-events: none; animation: consent-in 280ms var(--ease, ease-out); }
  .consent__panel { pointer-events: auto; width: min(100%, 720px); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 18px 50px rgb(15 20 30 / 0.22); padding: 1.25rem 1.4rem; display: grid; gap: 0.75rem; }
  .consent__title { margin: 0; font-weight: 750; font-size: 1.05rem; }
  .consent__text { margin: 0; font-size: 0.875rem; line-height: 1.55; color: var(--text-2); }
  .consent__text a { color: inherit; font-weight: 600; }
  .consent__options { display: grid; gap: 0.5rem; margin: 0.25rem 0; }
  .consent__option { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 0.85rem; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
  .consent__option-text { display: grid; gap: 0.15rem; font-size: 0.85rem; color: var(--text-2); }
  .consent__option-text strong { color: var(--text); font-size: 0.9rem; }
  .consent__always { font-size: 0.75rem; font-weight: 650; color: var(--success); white-space: nowrap; }
  .consent__switch { position: relative; flex-shrink: 0; width: 2.6rem; height: 1.5rem; }
  .consent__switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
  .consent__switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--border-strong); transition: background 150ms; }
  .consent__switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); transition: transform 150ms; }
  .consent__switch input:checked + span { background: var(--success); }
  .consent__switch input:checked + span::after { transform: translateX(1.1rem); }
  .consent__switch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
  .consent__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
  .consent__btn { min-height: 2.6rem; }
  @media (max-width: 560px) {
    .consent { inset: auto 0 0 0; }
    .consent__panel { border-radius: 12px 12px 0 0; padding: 1rem; }
    .consent__actions { display: grid; grid-template-columns: 1fr 1fr; }
    .consent__actions [data-consent="accept"] { grid-column: 1 / -1; order: -1; }
  }
  @keyframes consent-in { from { transform: translateY(16px); opacity: 0; } }
  @media (prefers-reduced-motion: reduce) { .consent { animation: none; } }

  /* ---- Standalone error / maintenance screen ----------------------------------------------- */
  .error-screen { display: grid; place-items: center; padding: var(--space-6); background: radial-gradient(circle at 20% 10%, var(--primary-soft), transparent 50%), var(--bg); }
  .error-screen__box { max-width: 520px; text-align: center; display: flex; flex-direction: column; gap: var(--space-4); align-items: center; }
  .error-screen__code { font-size: 5rem; font-weight: 800; line-height: 1; letter-spacing: -0.05em; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }

  .maintenance-screen {
    min-height: 100dvh; display: grid; place-items: center; padding: var(--space-6);
    background:
      radial-gradient(circle at 15% 0%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 45%),
      radial-gradient(circle at 85% 100%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 40%),
      var(--bg);
  }
  .maintenance-screen__card {
    width: min(440px, 100%); padding: 0 0 var(--space-8); text-align: center; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg); display: flex; flex-direction: column; align-items: center; gap: var(--space-4);
  }
  .maintenance-screen__brand {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3);
    width: 100%; min-height: 5.5rem; padding: var(--space-6) var(--space-6) var(--space-5); margin-bottom: var(--space-1);
    background: linear-gradient(180deg, #0f2744 0%, #0a1830 100%); color: #fff;
  }
  .maintenance-screen__logo { max-height: 52px; max-width: min(220px, calc(100% - 2rem)); width: auto; height: auto; object-fit: contain; }
  .maintenance-screen__logo--on-dark { filter: brightness(0) invert(1); }
  .maintenance-screen__brand .maintenance-screen__name { color: #fff; }
  .maintenance-screen__body { width: 100%; padding: 0 var(--space-6); display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }
  .maintenance-screen__mark {
    width: 3.25rem; height: 3.25rem; border-radius: var(--radius-lg); display: grid; place-items: center;
    color: var(--on-primary); background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #000));
    box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--primary) 80%, transparent);
  }
  .maintenance-screen__mark .icon { width: 1.65rem; height: 1.65rem; }
  .maintenance-screen__name { font-weight: 700; font-size: var(--text-md); color: var(--text-2); }
  .maintenance-screen__icon {
    width: 3.5rem; height: 3.5rem; border-radius: 999px; display: grid; place-items: center;
    background: var(--warning-soft); color: var(--warning);
  }
  .maintenance-screen__icon .icon { width: 1.75rem; height: 1.75rem; }
  .maintenance-screen__title { font-size: var(--text-xl); font-weight: 800; letter-spacing: -0.02em; line-height: var(--leading-tight); }
  .maintenance-screen__lead { color: var(--text-2); font-size: var(--text-base); max-width: 36ch; line-height: 1.55; }
  .maintenance-screen__contact { width: 100%; margin-top: var(--space-2); padding-top: var(--space-5); border-top: 1px solid var(--border); }
  .maintenance-screen__contact-label { font-size: var(--text-sm); color: var(--text-3); margin-bottom: var(--space-3); }
  .maintenance-screen__contact-links { justify-content: center; gap: var(--space-2); }
  .maintenance-screen__retry { margin-top: var(--space-2); }
}

/* ==========================================================================
   Utilities
   ========================================================================== */
@layer utilities {
  .sr-only, .visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .muted { color: var(--text-2); }
  .subtle { color: var(--text-3); }
  .small { font-size: var(--text-sm); }
  .xsmall { font-size: var(--text-xs); }
  .bold { font-weight: 700; }
  .mono { font-family: var(--font-mono); }
  .nowrap { white-space: nowrap; }
  .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .text-center { text-align: center; }
  .text-right { text-align: right; }
  .text-success { color: var(--success); }
  .text-danger { color: var(--danger); }
  .text-warning { color: var(--warning); }
  .w-full { width: 100%; }
  .grow { flex: 1 1 auto; min-width: 0; }
  .mt-2 { margin-top: var(--space-2); } .mt-4 { margin-top: var(--space-4); } .mt-6 { margin-top: var(--space-6); } .mt-8 { margin-top: var(--space-8); }
  .mb-2 { margin-bottom: var(--space-2); } .mb-4 { margin-bottom: var(--space-4); } .mb-6 { margin-bottom: var(--space-6); }
  .p-0 { padding: 0 !important; }
  .rounded { border-radius: var(--radius); }
  .surface { background: var(--surface); }
  @media (max-width: 720px) { .hide-sm { display: none !important; } }
  @media (min-width: 721px) { .show-sm { display: none !important; } }
  @media (max-width: 1023px) { .hide-md { display: none !important; } }
  @media (min-width: 1024px) { .show-md { display: none !important; } }
}
