/* The link media follows the device; theme-preference.js handles explicit choices. */
  :root {
    color-scheme: dark;
    --bg: #0e1721;
    --ink: #e5edf5;
    --muted: #a8b8c7;
    --line: #304252;
    --pale: #192a39;
    --blue: #91bdff;
    --blue-dark: #275eb0;
    --cyan: #66d1e5;
    --green: #487823;
    --sm-surface: #152331;
    --sm-raised: #213547;
    --sm-action: #2355a0;
  }

  body { background: var(--bg); color: var(--ink); }
  .site-header, footer, .product-card, .categories-sidebar,
  .sm-catalog-modal, .sm-cart-empty { background: var(--sm-surface); }
  .topbar, .search, .category-card, .sort-apply, .sm-quantity,
  .sm-cart-summary, .sm-catalog-close, .sm-catalog-search > div,
  .sm-catalog-sidebar, .sm-categories-toggle { background: var(--pale); }
  .category-card:hover, .sm-catalog-close:hover,
  .sm-quantity button:hover, .sm-catalog-tree button:hover {
    background: var(--sm-raised);
  }
  .card-body, .footer-bottom, .hero-product, .sm-quantity,
  .sm-catalog-search > div, .sm-catalog-tree li, .sm-catalog-tree ul ul,
  .hero-orbit, .hero-orbit::after { border-color: var(--line); }

  .topbar, .nav-note, .eyebrow, .section-label, .hero-copy > p,
  .hero-caption, .visual-label, .category-number, .category-footer,
  .card-price del, .card-body > small, .footer-grid p,
  .footer-grid > div > a:not(.brand), .footer-grid > div > span,
  .footer-grid > div > small, .footer-bottom, .breadcrumbs,
  .breadcrumbs span:last-child, .sku, .product-price del, .muted,
  .short-description, .help-box p, .product-benefits, .inquiry-panel > p,
  .mq-lead-form label > span, .form-note, .catalog-heading p,
  .categories-sidebar details > a, .sm-cart-summary p, .sm-cart-summary small,
  .sm-catalog-result-heading p, .sm-catalog-search [data-catalog-clear] {
    color: var(--muted);
  }
  .topbar a, .footer-grid > div > a:not(.brand):hover,
  .categories-sidebar details > a:hover { color: var(--blue); }
  .hero h1 em { color: var(--cyan); }

  /* Link blue stays light; solid action buttons retain readable white text. */
  .primary, .hero .primary, .catalog-link, .sm-cart-count,
  .page-numbers.current { background: var(--sm-action); color: #fff; }
  .primary:hover, .hero .primary:hover, .catalog-link:hover {
    background: var(--blue-dark); color: #fff;
  }
  .outline { background: var(--sm-surface); border-color: #526b80; color: var(--blue); }
  .outline:hover { background: var(--sm-raised); }
  .sm-add { background: var(--green); color: #fff; }
  .sm-add:hover, .sm-card-add:hover { background: #527f2c; color: #fff; }
  .sm-card-add { background: #223b26; color: #c0e5a6; }
  .sm-stock { background: #223b26; color: #c0e5a6; }
  .sm-stock-request { background: var(--sm-raised); color: var(--muted); }
  .sm-quantity button { color: var(--ink); }
  .sm-cart-remove { color: var(--muted); }
  .sm-cart-remove:hover { color: #ffaaa4; }
  .sm-catalog-tree button[aria-pressed=true] { background: #264366; color: #b9d6ff; }

  input, textarea, select {
    background: #101d29;
    border-color: #526b80;
    color: var(--ink);
    accent-color: var(--blue);
  }
  input::placeholder, textarea::placeholder { color: #a1b1c1; opacity: 1; }
  .search input, .sm-catalog-search input, .sm-quantity input { background: transparent; }
  :focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
  .skip-link:focus { background: var(--sm-raised); color: var(--ink); }
  .sm-form-error { background: #402522; border-color: #a26860; color: #ffd3cd; }
  .sm-cart-error, .sm-catalog-modal [data-catalog-error] {
    background: #382d21; border-color: #8d7456; color: #f6debd;
  }

  .sm-product-bar {
    background: rgba(21, 35, 49, .98);
    border-color: var(--line);
    box-shadow: 0 -4px 24px #0003;
  }
  .sm-toast { background: #294355; color: #fff; box-shadow: 0 8px 35px #0005; }
  .sm-catalog-modal { box-shadow: 0 25px 90px #0008; }
  .sm-catalog-modal::backdrop { background: #030b14b8; }
  .consultation { background: #1d425d; }
  .consultation .eyebrow, .consultation p { color: #c6d9e8; }
  .consultation .light { background: #e5edf5; color: #193c55; }
  .consultation .light:hover { background: #fff; }

  .description tr:nth-child(even) { background: var(--sm-surface); }
  .description th { background: var(--pale); }
  .description .sm-spec-section { background: var(--sm-raised) !important; }
  /* Imported descriptions can carry light-only inline text/background colors. */
  .description [style*="color"], .short-description [style*="color"] {
    color: inherit !important;
    background-color: transparent !important;
  }

  /* Product photographs keep their original colors and a neutral backdrop. */
  .product-picture, .main-picture.sm-gallery-open, .thumbnails button,
  .sm-cart-item > a > img, .sm-bar-product img {
    background: #fff;
    color: #22394d;
    color-scheme: light;
  }
  .main-picture.sm-gallery-open { border-color: #526b80; }
  .sm-zoom-hint { background: rgba(255,255,255,.96); color: #22394d; border-color: #cbd8e1; }
  .hero-visual > img {
    mix-blend-mode: normal;
    filter: none;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
  }

  @media (max-width: 760px) {
    .description .sm-spec-table tr > :last-child:not(:first-child) { color: var(--muted); }
    .description .sm-spec-table tr > :last-child.sm-spec-number { color: var(--blue); }
  }
