/* ──────────────────────────────────────────────────────────────────────
   sliceLab — Direction D1 "Clear"
   Apple-like, big quiet titles, monochrome with warm orange accent.
   Geist for UI, Fraunces italic for accent words, JetBrains Mono for data.
   ──────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400..600;1,9..144,400..600&family=Instrument+Sans:ital,wght@0,400..600;1,400..600&family=Geist:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* D1 tokens */
    --bg:           #fbfbfa;
    --surface:      #ffffff;
    --surface-soft: #faf9f6;
    --surface-warm: #f5f4f1;
    --ink:          #0a0a0a;
    --text:         #0a0a0a;
    --text-mid:     #44423d;
    --text-soft:    #65615a;
    --text-muted:   #8e887d;
    --border:       rgba(0, 0, 0, 0.06);
    --border-soft:  rgba(0, 0, 0, 0.04);
    --border-mid:   rgba(0, 0, 0, 0.10);
    --accent:       #E4572E;
    --accent-soft:  #FCE9DF;
    --accent-deep:  #B14620;
    --good:         #36B67A;
    --warn:         #E4572E;

    --radius-lg:    20px;
    --radius:       18px;
    --radius-sm:    14px;
    --radius-xs:    8px;

    /* Page gutter — nav, breadcrumb and .shell all align on it */
    --gutter:       32px;

    --font-sans:  'Geist', system-ui, -apple-system, sans-serif;
    --font-serif: 'Fraunces', Georgia, serif;
    --font-mono:  'JetBrains Mono', ui-monospace, monospace;

    /* Legacy aliases — JS code refers to these */
    --color-primary: var(--accent);
    --color-accent:  var(--accent);
    --color-bg:      var(--bg);
    --color-text:    var(--text);
    --color-text-muted: var(--text-muted);
    --color-white:   var(--surface);
    --color-border:  var(--border);
    --color-row-even: var(--surface-soft);
    --color-row-selected: rgba(228, 87, 46, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

p { margin: 0 0 1em; color: var(--text-mid); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 500;
    letter-spacing: -0.025em;
    color: var(--text);
    margin: 0 0 0.5em;
    line-height: 1.1;
    text-wrap: balance;
}

em.serif, .serif {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.02em;
}

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

::selection { background: var(--accent-soft); color: var(--accent-deep); }

.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }

/* ── Layout shell ── */
.shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

@media (max-width: 720px) {
    :root { --gutter: 20px; }
}

/* ── Section label ── */
.eye {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    font-weight: 600;
    margin: 0 0 14px;
}
.eye.muted { color: var(--text-muted); }

/* ── Top nav (injected by nav.js) ── */
.sl-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(251, 251, 250, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.sl-nav-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    padding: 14px var(--gutter);
}
.sl-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}
.sl-brand .dot {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--ink);
    color: var(--bg);
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    overflow: hidden;
}
.sl-brand .dot:has(img) { background: transparent; border-radius: 0; }
.sl-brand .dot img { width: 22px; height: 22px; object-fit: cover; }
.sl-links {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
}
.sl-links a {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 8px;
    color: var(--text-mid);
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.sl-links a:hover { background: rgba(0, 0, 0, 0.04); color: var(--text); }
.sl-links a.active { background: rgba(0, 0, 0, 0.05); color: var(--text); }
.sl-right {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}
.sl-search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-soft);
    font-size: 12.5px;
    cursor: pointer;
    border: 0;
    font-family: inherit;
}
.sl-search .kbd {
    font-family: var(--font-mono);
    font-size: 10.5px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
}
.sl-lang {
    position: relative;
    display: inline-flex;
}
.sl-lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.sl-lang-toggle:hover { background: rgba(0, 0, 0, 0.05); }
.sl-lang-caret { display: inline-flex; color: var(--text-muted); }
.sl-lang.open .sl-lang-caret { transform: rotate(180deg); }
.sl-lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 132px;
    margin: 0;
    padding: 5px;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    display: none;
    z-index: 60;
}
.sl-lang.open .sl-lang-menu { display: block; }
.sl-lang-menu a {
    display: block;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}
.sl-lang-menu a:hover { background: rgba(0, 0, 0, 0.05); }
.sl-lang-menu a.active {
    background: var(--ink);
    color: var(--bg);
    font-weight: 600;
}
.sl-mobile {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-mid);
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text);
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sl-mobile svg { display: block; }
.sl-mobile .ic-close { display: none; }
.sl-mobile[aria-expanded="true"] {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
}
.sl-mobile[aria-expanded="true"] .ic-bars { display: none; }
.sl-mobile[aria-expanded="true"] .ic-close { display: block; }

/* Dimmer behind the open mobile drawer. Lives on <body>: .sl-nav has a
   backdrop-filter, which would make it the containing block for a fixed child. */
.sl-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(10, 10, 10, 0.30);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s;
    -webkit-tap-highlight-color: transparent;
}
.sl-nav-backdrop.open { opacity: 1; visibility: visible; }

/* Scroll lock shared by the mobile drawer and the search palette */
html.sl-locked, html.sl-locked body { overflow: hidden; }

@media (max-width: 880px) {
    .sl-nav-inner { grid-template-columns: auto 1fr auto; gap: 12px; padding: 10px var(--gutter); }

    /* Links become a drawer sliding out from under the nav bar. It stays
       absolutely positioned so the nav's own height never changes (sticky-thead
       measures it). */
    .sl-links {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding: 4px var(--gutter) calc(12px + env(safe-area-inset-bottom, 0px));
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 20px 34px -22px rgba(0, 0, 0, 0.35);
        max-height: calc(100vh - var(--sl-nav-h, 60px));
        max-height: calc(100dvh - var(--sl-nav-h, 60px));
        overflow-y: auto;
        overscroll-behavior: contain;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.16s ease, transform 0.18s cubic-bezier(0.2, 0.7, 0.3, 1), visibility 0.18s;
    }
    .sl-links.open { opacity: 1; visibility: visible; transform: none; }
    .sl-links li + li { border-top: 1px solid var(--border-soft); }
    .sl-links a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 52px;
        padding: 12px 4px;
        border-radius: 10px;
        font-size: 15px;
        color: var(--text-mid);
        -webkit-tap-highlight-color: transparent;
    }
    /* Chevron affordance */
    .sl-links a::after {
        content: '';
        flex: 0 0 auto;
        width: 7px;
        height: 7px;
        margin-right: 6px;
        border-right: 1.6px solid currentColor;
        border-bottom: 1.6px solid currentColor;
        transform: rotate(-45deg);
        opacity: 0.3;
    }
    .sl-links a:active { background: rgba(0, 0, 0, 0.04); }
    .sl-links a.active {
        background: transparent;
        color: var(--accent);
        font-weight: 600;
    }
    .sl-links a.active::after { opacity: 0.6; }
    .sl-links a:focus-visible { border-radius: 10px; outline-offset: -3px; }

    /* Collapse search to an icon-only button on mobile */
    .sl-right { gap: 6px; }
    .sl-search { padding: 0; width: 40px; height: 40px; justify-content: center; border-radius: 10px; }
    .sl-search-label, .sl-search .kbd { display: none; }
    .sl-search-ic { color: var(--text); }
    .sl-lang-toggle { height: 40px; padding: 0 10px; border-radius: 10px; border-color: var(--border-mid); }
    .sl-lang-menu { min-width: 148px; }
    .sl-lang-menu a { padding: 11px 12px; font-size: 14px; }
    .sl-mobile { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
    .sl-links, .sl-nav-backdrop { transition-duration: 0.01ms; }
}

/* ── Command-palette search ── */
.sl-search-ic { display: inline-flex; color: var(--text-soft); }
.sl-search:hover { background: rgba(0, 0, 0, 0.07); }

.sl-pal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding: 14vh 20px 20px;
    background: rgba(25, 25, 25, 0.35);
    backdrop-filter: blur(2px);
}
.sl-pal-overlay.open { display: flex; }
.sl-pal {
    width: 100%;
    max-width: 560px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    animation: sl-pal-in 0.12s ease-out;
}
@keyframes sl-pal-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.sl-pal-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.sl-pal-input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
}
.sl-pal-input::placeholder { color: var(--text-soft); }
.sl-pal-results {
    max-height: 52vh;
    overflow-y: auto;
    padding: 6px;
}
.sl-pal-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 9px;
    text-decoration: none;
    color: var(--text);
}
.sl-pal-row.active { background: rgba(0, 0, 0, 0.05); }
.sl-pal-kind {
    flex: 0 0 auto;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    min-width: 78px;
}
.sl-pal-title { flex: 0 1 auto; font-size: 14px; font-weight: 500; }
.sl-pal-sub {
    flex: 1 1 auto;
    font-size: 12px;
    color: var(--text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}
.sl-pal-empty {
    padding: 20px 16px;
    text-align: center;
    color: var(--text-soft);
    font-size: 14px;
}
@media (max-width: 560px) {
    .sl-pal-overlay { padding: 6vh 12px 12px; }
    .sl-pal-results { max-height: 62dvh; overscroll-behavior: contain; }
    .sl-pal-row { flex-wrap: wrap; gap: 2px 8px; padding: 11px 12px; }
    .sl-pal-kind { min-width: 0; flex-basis: 100%; order: -1; }
    .sl-pal-title { font-size: 15px; }
    .sl-pal-sub { flex-basis: 100%; text-align: left; white-space: normal; }
    /* 16px keeps iOS Safari from zooming the page when the field takes focus */
    .sl-pal-input { font-size: 16px; }
    .sl-pal-head .kbd { display: none; }
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: -0.005em;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--dark    { background: var(--ink); color: var(--bg); }
.btn--dark:hover    { background: #2a2a2a; color: var(--bg); }
.btn--accent  { background: var(--accent); color: #fff; }
.btn--accent:hover  { background: var(--accent-deep); color: #fff; }
.btn--line    { background: transparent; color: var(--text); border: 1px solid var(--border-mid); }
.btn--line:hover    { background: rgba(0,0,0,0.04); color: var(--text); }

/* ── Hero (centered, big) ── */
.hero {
    text-align: center;
    padding: 96px 32px 32px;
    max-width: 1100px;
    margin: 0 auto;
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 6px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    font-size: 12.5px;
    color: var(--text-mid);
    margin-bottom: 28px;
}
.hero-eyebrow .pill {
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
}
.hero h1 {
    font-size: clamp(42px, 6.5vw, 72px);
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 1.02;
    margin: 0 0 20px;
}
.hero h1 .soft { color: var(--text-muted); }
.hero h1 em { font-style: italic; font-family: var(--font-serif); font-weight: 400; }
.hero-lede {
    font-size: 19px;
    line-height: 1.45;
    color: var(--text-mid);
    max-width: 56ch;
    margin: 0 auto 36px;
}
.hero-ctas {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}
.hero-ctas .meta { color: var(--text-muted); font-size: 12.5px; }

/* Hero variant: left-aligned (compare/diagnose) */
.hero--left {
    text-align: left;
    padding: 64px 32px 24px;
    max-width: 1240px;
}
.hero--left h1 {
    font-size: clamp(38px, 5vw, 56px);
    max-width: 24ch;
}
.hero--left p:not(.eye) {
    font-size: 17px;
    color: var(--text-mid);
    max-width: 60ch;
    line-height: 1.5;
    margin: 0;
}
.hero--center {
    text-align: center;
    padding: 64px 32px 32px;
}
.hero--center h1 { margin-left: auto; margin-right: auto; max-width: 18ch; }
.hero--center p { margin-left: auto; margin-right: auto; }

/* ── Section ── */
.section {
    padding: 80px 32px;
    max-width: 1240px;
    margin: 0 auto;
}
.section-head {
    text-align: center;
    margin-bottom: 48px;
}
.section-head h2 {
    font-size: clamp(34px, 4vw, 48px);
    font-weight: 500;
    letter-spacing: -0.03em;
    margin: 0 0 14px;
    line-height: 1.05;
}
.section-head h2 em { font-style: italic; font-family: var(--font-serif); }
.section-head p:not(.eye) {
    font-size: 17px;
    color: var(--text-mid);
    max-width: 56ch;
    margin: 0 auto;
    line-height: 1.5;
}
.section-head--left { text-align: left; margin-bottom: 32px; }
.section-head--left p { margin-left: 0; }

@media (max-width: 720px) {
    .hero { padding: 56px 20px 20px; }
    .hero--left, .hero--center { padding: 44px 20px 16px; }
    .section { padding: 56px 20px; }
}

/* ── Card primitive ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.card-bg { /* legacy alias used by app.js */
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* Tailwind .rounded-lg / shadow-* are killed so cards behave consistently */
.rounded-lg, .rounded-md, .rounded-xl { border-radius: var(--radius) !important; }
.rounded { border-radius: var(--radius-sm) !important; }
.shadow, .shadow-sm, .shadow-md, .shadow-lg, .shadow-xl { box-shadow: none !important; }

/* ── Feature grid (home) ── */
.features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.feature {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 18px;
    min-height: 280px;
    color: var(--text);
    transition: transform 0.2s, border-color 0.2s;
}
.feature:hover { transform: translateY(-2px); border-color: var(--border-mid); }
.feature .ico {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
}
.feature h3 {
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.015em;
    margin: 0;
    line-height: 1.15;
}
.feature h3 em { font-style: italic; font-family: var(--font-serif); }
.feature p { font-size: 14.5px; color: var(--text-mid); margin: 0; line-height: 1.55; }
.feature .bot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-muted);
}
.feature .bot .go { color: var(--text); font-weight: 500; }

@media (max-width: 880px) { .features { grid-template-columns: 1fr; } }

/* ── Promise card (dark) ── */
.promise {
    padding: 64px 32px;
    max-width: 1100px;
    margin: 0 auto;
}
.promise-card {
    background: var(--ink);
    color: var(--bg);
    border-radius: 22px;
    padding: 56px 48px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.promise-card::before {
    content: '';
    position: absolute;
    right: -120px;
    top: -100px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(228,87,46,0.4), transparent 65%);
    filter: blur(40px);
    pointer-events: none;
}
.promise-card h2 {
    font-size: clamp(32px, 3.5vw, 44px);
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin: 0 0 16px;
    color: var(--bg);
    position: relative;
}
.promise-card h2 em { font-style: italic; font-family: var(--font-serif); color: var(--accent); }
.promise-card p { color: #b8b3a9; line-height: 1.55; max-width: 42ch; position: relative; }
.promise-card .badges {
    display: flex; gap: 8px; flex-wrap: wrap; position: relative;
}
.promise-card .badges span {
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
    font-family: var(--font-mono);
    color: #d6d2c8;
}
.promise-card .right { position: relative; }
.promise-card .quote {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 26px;
    line-height: 1.25;
    letter-spacing: -0.015em;
    color: var(--bg);
    margin: 0 0 18px;
}
.promise-card .who {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: #b8b3a9;
}
.promise-card .who .av {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #9c2f12);
    flex-shrink: 0;
}
.promise-card .who strong { color: var(--bg); font-weight: 500; }

@media (max-width: 880px) {
    .promise-card { grid-template-columns: 1fr; padding: 36px 28px; gap: 28px; }
    .promise-card .quote { font-size: 22px; }
}

/* ── Guides grid (home + listing) ── */
.guides-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
}
.guide-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 22px;
    min-height: 180px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 12px;
    color: var(--text);
    transition: transform 0.2s, border-color 0.2s;
}
.guide-card:hover { transform: translateY(-2px); border-color: var(--border-mid); }
.guide-card .tag-pill {
    width: fit-content;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--surface-warm);
    color: var(--text-mid);
    font-weight: 500;
    letter-spacing: 0.02em;
}
.guide-card h4 {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin: 0;
    line-height: 1.25;
    color: var(--text);
}
.guide-card .meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

@media (max-width: 880px) { .guides-grid { grid-template-columns: 1fr; } }

/* ── Dashboard preview (home) ── */
.dash-wrap { padding: 24px 32px 80px; max-width: 1240px; margin: 0 auto; }
.dash {
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 24px 48px -12px rgba(0,0,0,0.08);
    overflow: hidden;
}
.dash-head {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-soft);
}
.dash-head .dots { display: flex; gap: 6px; }
.dash-head .dots span { width: 10px; height: 10px; border-radius: 50%; background: #e8e6e0; }
.dash-head .tab {
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--surface-warm);
    font-family: var(--font-mono);
    font-size: 11.5px;
}
.dash-head .tab.on { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.dash-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.dash-head .live { display: inline-flex; align-items: center; gap: 6px; }
.dash-head .live::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: var(--good); box-shadow: 0 0 0 3px rgba(54,182,122,0.18);
}
.dash-body { display: grid; grid-template-columns: 240px 1fr; min-height: 380px; }
.dash-side { padding: 18px 14px; border-right: 1px solid var(--border); }
.dash-side h6 {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin: 8px;
    font-weight: 600;
}
.dash-side .item {
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 13px;
    color: var(--text-mid);
    display: flex; align-items: center; gap: 9px;
}
.dash-side .item .sw { width: 9px; height: 9px; border-radius: 2px; }
.dash-side .item .ct { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); }
.dash-side .item.on { background: var(--surface-warm); color: var(--text); font-weight: 500; }
.dash-content {
    padding: 22px 24px;
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 18px;
}
.dash-chips { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-chips .chip {
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--surface-warm);
    font-size: 12px;
    color: var(--text-mid);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.dash-chips .chip.on { background: var(--accent-soft); color: var(--accent); }
.dash-chips .more { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.dash-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.dash-stats .s {
    padding: 14px 16px;
    border-right: 1px solid var(--border);
}
.dash-stats .s:last-child { border-right: 0; }
.dash-stats .s .l {
    font-size: 11.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    font-weight: 500;
}
.dash-stats .s .v {
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1;
}
.dash-stats .s .v small { font-size: 14px; color: var(--text-muted); font-weight: 400; }
.dash-stats .s .d {
    font-size: 11.5px;
    color: var(--good);
    margin-top: 4px;
    font-family: var(--font-mono);
}
.dash-stats .s .d.warn { color: var(--accent); }

@media (max-width: 880px) {
    .dash-body { grid-template-columns: 1fr; }
    .dash-side { display: none; }
    .dash-stats { grid-template-columns: repeat(2, 1fr); }
    .dash-stats .s:nth-child(2) { border-right: 0; }
}

/* ──────────────────────────────────────────────────────────────
   COMPARE — D1
   ────────────────────────────────────────────────────────────── */

.cmp-controls {
    padding: 0 32px 16px;
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.cmp-controls .pill {
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--border-mid);
    background: var(--surface);
    font-size: 13px;
    color: var(--text-mid);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: inherit;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cmp-controls .pill:hover { border-color: var(--text-muted); color: var(--text); }
.cmp-controls .pill.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cmp-controls .pill.on:hover { background: #2a2a2a; }
.cmp-controls .pill .ct { font-family: var(--font-mono); font-size: 11px; opacity: 0.7; }
.cmp-controls .div { width: 1px; height: 22px; background: var(--border-mid); margin: 0 4px; }
.cmp-controls .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.cmp-wrap { padding: 0 32px 32px; max-width: 1240px; margin: 0 auto; }

/* 2-col grid: filter sidebar + table */
.cmp-grid {
    display: grid;
    grid-template-columns: 248px 1fr;
    gap: 16px;
    align-items: start;
}
@media (max-width: 880px) { .cmp-grid { grid-template-columns: 1fr; } }

/* Filter sidebar */
.cmp-filters {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 16px 14px;
    position: sticky;
    top: 80px;
}
.cmp-filters .fhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}
.cmp-filters .fhead h5 {
    margin: 0;
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: -0.005em;
    color: var(--text);
}
.cmp-filters .fhead .ct {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    font-weight: 600;
}
.cmp-filters .fhead .ct.idle { color: var(--text-muted); background: var(--surface-warm); }
.cmp-filters .group { margin-bottom: 14px; }
.cmp-filters .group:last-of-type { margin-bottom: 4px; }
.cmp-filters .group > h6 {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin: 4px 8px 8px;
    font-weight: 600;
}
.cmp-filters .fbot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}
.cmp-filters .fclear {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    font-size: 11.5px;
    cursor: pointer;
    font-family: inherit;
    padding: 2px 0;
}
.cmp-filters .fclear:hover { color: var(--text); text-decoration: underline; }
.cmp-filters .fcount {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}
.cmp-filters .empty {
    font-size: 12px;
    color: var(--text-muted);
    padding: 4px 8px;
    font-style: italic;
}

/* ── "See radar" pill — appears in cmp-controls when 2+ filaments selected ── */
.see-radar {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid transparent;
    color: var(--accent-deep);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.see-radar:hover { background: var(--accent); color: #fff; }
.see-radar.pulse { animation: see-radar-pulse 1.4s ease-out 1; }

@keyframes see-radar-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(228, 87, 46, 0.55); }
    70%  { box-shadow: 0 0 0 10px rgba(228, 87, 46, 0); }
    100% { box-shadow: 0 0 0 0 rgba(228, 87, 46, 0); }
}

/* ── Comparator table ── */
.cmp-table {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

/* Right-edge fade hint: shows there's more table content to scroll to.
   Pinned over the scroll wrapper, faded out once user reaches the end. */
.cmp-table::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 56px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), var(--surface) 85%);
    pointer-events: none;
    z-index: 2;
    opacity: 1;
    transition: opacity 0.25s;
}
.cmp-table.scrolled-end::after { opacity: 0; }
.cmp-table .scroll-hint {
    padding: 10px 16px;
    font-size: 11.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    display: none;
    align-items: center;
    gap: 8px;
}
.cmp-table .scroll-hint .arrow { animation: hint-bounce 1.5s ease-in-out infinite; }
@keyframes hint-bounce { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }

.cmp-table .table-scroll { overflow-x: auto; cursor: grab; }
.cmp-table .table-scroll.dragging { cursor: grabbing; }

/* Floating column-header row, pinned under the top nav while the real
   header is scrolled out of view (built by sticky-thead.js). The wide table
   scrolls horizontally, which traps CSS sticky, so the header is cloned. */
.sl-sticky-head {
    position: fixed;
    z-index: 30; /* under the nav (50), over the page */
    overflow: hidden;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 10px 20px -16px rgba(0, 0, 0, 0.45);
    display: none;
}
.sl-sticky-head .sl-sticky-head-scroll { overflow: hidden; }
.sl-sticky-head table { margin: 0; table-layout: fixed; border-collapse: collapse; }
.sl-sticky-head thead th { border-bottom: 0; }
.sl-sticky-head input { pointer-events: none; }
/* Keep normal cursors over interactive cells */
.cmp-table .table-scroll th,
.cmp-table .table-scroll input,
.cmp-table .table-scroll a,
.cmp-table .table-scroll label { cursor: pointer; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
table th {
    text-align: left;
    padding: 14px 16px;
    font-weight: 500;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border);
    white-space: normal;
    line-height: 1.25;
    vertical-align: middle;
    cursor: default;
}
table th .th-label {
    display: inline;
}
table th .th-unit {
    display: block;
    margin-top: 2px;
    font-size: 9.5px;
    font-weight: 400;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.85;
}
table th .sort-icon {
    margin-left: 4px;
    opacity: 0.35;
    font-size: 10px;
    display: inline;
    white-space: nowrap;
}
table th.sortable:hover .sort-icon { opacity: 0.7; }
table th.sort-asc .sort-icon,
table th.sort-desc .sort-icon { opacity: 1; color: var(--accent); }
table th:first-child, table td:first-child { padding-left: 22px; }
table th.sortable { cursor: pointer; user-select: none; }
table th.sortable:hover { color: var(--text); }
table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-mid);
    vertical-align: middle;
}
table tbody tr:last-child td { border-bottom: 0; }
table tbody tr:hover { background: rgba(0, 0, 0, 0.012); }
table tr.selected { background: rgba(228, 87, 46, 0.04) !important; }
table tr.filtered-out { opacity: 0.25; }

a.mat-link {
    color: var(--text);
    font-weight: 500;
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
    transition: color 0.15s, border-color 0.15s;
}
a.mat-link:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Compare table cell helpers ── */
.cell-name {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    white-space: nowrap;
}
.cell-name .sw {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.06);
}

/* Compare table — fixed layout + per-column widths so columns line up cleanly */
.cmp-table table { min-width: 1622px; table-layout: fixed; }

/* Checkbox column */
.cmp-table thead tr > th:first-child,
.cmp-table tbody tr > td:first-child { width: 56px; }

/* Filament name / Type */
.cmp-table th[data-key="name"] { width: 160px; }
.cmp-table th[data-key="type"] { width: 110px; }

/* All data columns share the same width so the label + sort icon
   always fit on one line and bars/numbers line up cleanly */
.cmp-table th[data-key="rigid"],
.cmp-table th[data-key="impact"],
.cmp-table th[data-key="adhesion"],
.cmp-table th[data-key="temp"],
.cmp-table th[data-key="uv"],
.cmp-table th[data-key="water"],
.cmp-table th[data-key="warping"],
.cmp-table th[data-key="printEase"],
.cmp-table th[data-key="nozzleTemp"],
.cmp-table th[data-key="bedTemp"],
.cmp-table th[data-key="density"],
.cmp-table th[data-key="price"] { width: 108px; }

@media (max-width: 880px) {
    .cmp-table .scroll-hint { display: flex; }
}

.type-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--surface-warm);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-soft);
    text-transform: lowercase;
    letter-spacing: 0;
    font-weight: 400;
}

.cell-num,
.cell-price {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-mid);
}

/* Boolean (✓ / –) cells, used by the printers comparison */
.cell-bool {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}
.cell-bool.yes { color: var(--good, #5FA266); }
.cell-bool.no  { color: var(--border, #cfcdc6); }

/* ── Bars (level indicators) ── */
.bars {
    display: inline-flex;
    gap: 2px;
    vertical-align: middle;
    line-height: 0;
}
.bars > span {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: #e8e6e0;
    display: inline-block;
}
.bars > span.on { background: var(--ink); }
.bars.warn > span.on { background: var(--accent); }

/* ── Tag levels ── */
.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 500;
    font-size: 12px;
    font-family: var(--font-mono);
    letter-spacing: -0.01em;
    background: var(--surface-warm);
    color: var(--text-mid);
}
.tag-vlow,
.tag-low     { background: #FCE9DF; color: var(--accent-deep); }
.tag-med     { background: #F4ECD9; color: #8c6a18; }
.tag-high    { background: #E5F0E8; color: #2D6A45; }
.tag-vhigh   { background: var(--ink); color: var(--bg); }
.tag-special { background: #ECE6F2; color: #5b3e8a; }
.tag-soluble { background: #F2E6EE; color: #843D73; }

/* ── Search ── */
.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 320px;
}
.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 13px;
}
.search-input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    border: 1px solid var(--border-mid);
    border-radius: 10px;
    background: var(--surface);
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}

/* ── Filter chip (default pill — kept for any flat usage) ── */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-mid);
    background: var(--surface);
    color: var(--text-mid);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.filter-chip:hover { border-color: var(--text-muted); color: var(--text); }
.filter-chip.active {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
}

/* When a filter-chip lives inside the sidebar, render as an .opt row */
.cmp-filters .filter-chip {
    display: grid;
    grid-template-columns: 16px 1fr auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 7px 8px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    text-align: left;
    font-size: 13px;
    color: var(--text-mid);
    cursor: pointer;
    font-family: inherit;
    font-weight: 400;
    transition: background 0.15s, color 0.15s;
}
.cmp-filters .filter-chip::before {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 5px;
    border: 1.5px solid #cdc9be;
    background: var(--surface);
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 700;
    color: transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cmp-filters .filter-chip:hover {
    background: var(--surface-soft);
    color: var(--text);
}
.cmp-filters .filter-chip.active {
    background: var(--accent-soft);
    color: var(--text);
}
.cmp-filters .filter-chip.active::before {
    content: '✓';
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.cmp-filters .filter-chip .ct {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-muted);
}
.cmp-filters .filter-chip.active .ct { color: var(--accent-deep); }

/* ── Export panel ── */
.export-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

/* ── Detail (radar + verdict, 2-col card) ── */
.cmp-detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 26px;
}
.cmp-detail-card.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: stretch;
}
@media (max-width: 880px) {
    .cmp-detail-card.split { grid-template-columns: 1fr; gap: 24px; }
}
.cmp-detail-card h3 {
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.015em;
    margin: 0 0 4px;
}
.cmp-detail-card .sub { font-size: 13px; color: var(--text-soft); margin: 0 0 20px; }

.chart-container {
    position: relative;
    width: 100%;
    height: 380px;
    background: var(--surface-soft);
    border-radius: 12px;
    padding: 12px;
}
.cmp-detail-card .vs-radar { min-height: 320px; }

/* Verdict rows */
.verdict-list { display: flex; flex-direction: column; gap: 10px; }
.verdict-row {
    padding: 14px 16px;
    background: var(--surface-soft);
    border-radius: 11px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}
.verdict-row .tag-l {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
    font-weight: 500;
}
.verdict-row p { font-size: 13px; color: var(--text-mid); margin: 0; line-height: 1.4; }
.verdict-row .win {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: var(--ink);
    color: var(--bg);
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 500;
    height: fit-content;
    white-space: nowrap;
}
.verdict-toggle {
    align-self: flex-start;
    margin-top: 2px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 9px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-mid);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.verdict-toggle:hover {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
}

/* Table cell helpers (used by app.js generated markup) */
.cmp-table table th:first-child,
.cmp-table table td:first-child { padding-left: 22px; }

/* "Add to comparison" pill in the first cell of each row.
   Renders as a + button by default, ✓ on accent bg when checked,
   – for the select-all indeterminate state. */
.cmp-table input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    border: 1px solid transparent;
    background: var(--surface-warm);
    color: var(--text-muted);
    cursor: pointer;
    margin: 0;
    display: inline-grid;
    place-items: center;
    transition: background 0.15s, color 0.15s, transform 0.1s;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    vertical-align: middle;
    position: relative;
}
.cmp-table input[type="checkbox"]::after { content: '+'; line-height: 1; }
.cmp-table input[type="checkbox"]:hover { background: #e2dfd5; color: var(--text); }
.cmp-table input[type="checkbox"]:active { transform: scale(0.94); }
.cmp-table input[type="checkbox"]:checked {
    background: var(--accent);
    color: #fff;
}
.cmp-table input[type="checkbox"]:checked::after { content: '✓'; font-size: 13px; font-weight: 600; }
.cmp-table input[type="checkbox"]:indeterminate {
    background: var(--ink);
    color: #fff;
}
.cmp-table input[type="checkbox"]:indeterminate::after { content: '–'; font-size: 14px; }

/* ──────────────────────────────────────────────────────────────
   DIAGNOSE — D1
   ────────────────────────────────────────────────────────────── */

.dx-grid {
    padding: 24px 32px 56px;
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 18px;
    align-items: start;
}
@media (max-width: 880px) { .dx-grid { grid-template-columns: 1fr; padding: 20px 20px 40px; } }

.dx-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
}
.dx-card h4 {
    font-size: 13.5px;
    font-weight: 500;
    margin: 0 0 14px;
    color: var(--text-soft);
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.dx-card h4 .ct {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}

/* Defect tile grid (left pane) */
.defect-tile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
@media (min-width: 540px) { .defect-tile-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 880px) { .defect-tile-grid { grid-template-columns: repeat(4, 1fr); } }

.defect-tile {
    aspect-ratio: 1;
    border-radius: 12px;
    background: var(--surface-soft);
    border: 1.5px solid transparent;
    padding: 8px;
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 4px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.defect-tile:hover {
    border-color: var(--border-mid);
    color: inherit;
}
.defect-tile.on {
    background: var(--accent-soft);
    border-color: var(--accent);
}
.defect-tile .art {
    border-radius: 8px;
    background:
        repeating-linear-gradient(135deg, rgba(0,0,0,0.04) 0 6px, transparent 6px 12px),
        linear-gradient(180deg, #efece4, #e6e2d6);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 6px;
}
.defect-tile.on .art {
    background:
        repeating-linear-gradient(135deg, rgba(228,87,46,0.10) 0 6px, transparent 6px 12px),
        linear-gradient(180deg, #FCE9DF, #F6D8C4);
    border-color: rgba(228,87,46,0.32);
}
.defect-tile .art svg {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    color: var(--text-mid);
}
.defect-tile.on .art svg { color: var(--accent); }
.defect-tile .lbl {
    font-size: 10.5px;
    text-align: center;
    line-height: 1.2;
    font-weight: 500;
    color: var(--text);
}
.defect-tile-foot {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}
.defect-tile-foot a { color: var(--text); border-bottom: 1px solid currentColor; }

/* Problem cards (full list — JS emits .ts-card with a row layout + .ts-detail expanded) */
.ts-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: border-color 0.15s;
}
.ts-card:hover { border-color: var(--border-mid); }
.ts-card .flex.items-start { display: flex; align-items: flex-start; gap: 18px; }
.ts-card .flex-1 { flex: 1; min-width: 0; }
.ts-card .flex.items-start > div:first-child {
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 10px;
    display: grid;
    place-items: center;
}
.ts-card .flex.items-start > div:first-child svg { max-width: 100%; height: auto; }
.ts-card h3 { font-size: 22px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; }
.ts-card .ts-detail { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--border); }
.ts-card .ts-detail h4 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
    margin: 0 0 10px;
}
.ts-card .ts-detail .mb-4 { margin-bottom: 18px; }
.ts-card .ts-detail ul.list-disc {
    margin: 0;
    padding-left: 20px;
    color: var(--text-mid);
    list-style: disc;
}
.ts-card .ts-detail ul.list-disc li { padding: 3px 0; line-height: 1.5; }
.ts-card .ts-detail ol { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.ts-card .ts-detail .ml-5 { margin-left: 20px; }
.ts-card .ts-detail .space-y-1 > * + * { margin-top: 4px; }
.ts-card .ts-detail .space-y-2 > * + * { margin-top: 6px; }

/* Questionnaire (JS-injected) — title + grid of category buttons */
#questionnaire h3 {
    font-size: 17px;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin: 0 0 14px;
    color: var(--text);
}
#questionnaire .grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
@media (min-width: 600px) {
    #questionnaire .grid { grid-template-columns: 1fr 1fr; }
}

/* Defect rows shown in step-2 (right pane) */
#questionnaire-result {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.defect-link {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 11px;
    background: var(--surface-soft);
    border: 1.5px solid transparent;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s;
}
.defect-link:hover {
    background: var(--surface);
    border-color: var(--border-mid);
    color: var(--text);
}
.defect-link-art {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 4px;
}
.defect-link-art svg { max-width: 100%; max-height: 100%; color: var(--text-mid); }
.defect-link-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.defect-link-name { font-size: 14px; font-weight: 500; color: var(--text); }
.defect-link-desc {
    font-size: 12.5px;
    color: var(--text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}
.defect-link-go {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-muted);
}

/* ── Diagnose flow card (right pane) ── */
.dx-flow {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 460px;
}
.dx-flow > .group { display: contents; }
.dx-flow .empty-state {
    flex: 1;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 36px 12px;
}
.dx-flow .empty-state .ico-empty {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--surface-soft);
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    color: var(--text-muted);
}
.dx-flow .nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    margin-top: auto;
    gap: 10px;
}
.dx-flow .progress { display: flex; gap: 4px; align-items: center; }
.dx-flow .progress span {
    width: 28px;
    height: 3px;
    border-radius: 2px;
    background: #e8e6e0;
}
.dx-flow .progress span.on { background: var(--ink); }
.dx-flow .progress-hint {
    font-size: 12px;
    color: var(--text-muted);
}
.dx-flow .selected {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--accent-soft);
    border-radius: 12px;
}
.dx-flow .selected .ico {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid rgba(228,87,46,0.18);
    display: grid;
    place-items: center;
    padding: 8px;
    flex-shrink: 0;
}
.dx-flow .selected h3 {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin: 0 0 4px;
}
.dx-flow .selected p { font-size: 13px; color: var(--text-mid); margin: 0; }

.dx-flow .step {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}
.dx-flow .q {
    font-size: 17px;
    font-weight: 500;
    margin: 0 0 12px;
    letter-spacing: -0.01em;
}
.dx-flow .opts { display: flex; flex-direction: column; gap: 8px; }

.ts-option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border-radius: 11px;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.ts-option-btn:hover { border-color: var(--border-mid); }
.ts-option-btn.selected {
    background: var(--surface);
    border-color: var(--ink);
    color: var(--text);
}
.ts-option-btn::before {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid #cdc9be;
    background: var(--surface);
    flex-shrink: 0;
    display: grid;
    place-items: center;
    color: transparent;
    font-size: 11px;
    font-weight: 700;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ts-option-btn.selected::before {
    content: '✓';
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}
.ts-option-btn .det {
    color: var(--text-muted);
    font-size: 12.5px;
    margin-left: 6px;
    font-weight: 400;
}

/* ── Problem cards (full list, expanded) ── */
.problem {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}
.problem-head {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}
.problem-head .ico {
    width: 88px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 10px;
    display: grid;
    place-items: center;
}
.problem-head .ico svg { max-width: 100%; height: auto; }
.problem-head h3 {
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.015em;
    margin: 0 0 6px;
}
.problem-head p { color: var(--text-mid); margin: 0; line-height: 1.5; }

.problem-detail {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
    display: grid;
    gap: 22px;
}
.problem-block h4 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
    margin: 0 0 10px;
}
.problem-block ul { margin: 0; padding-left: 20px; color: var(--text-mid); }
.problem-block ul li { padding: 3px 0; }
.problem-block ol { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.ts-solution-step {
    counter-increment: step;
    position: relative;
    padding: 10px 0 10px 36px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-mid);
    font-size: 14px;
    line-height: 1.5;
}
.ts-solution-step:last-child { border-bottom: 0; }
.ts-solution-step::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 9px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--surface);
    border: 1.5px solid var(--border-mid);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    display: grid;
    place-items: center;
}

/* Result card (dark) */
.dx-result {
    padding: 0 32px 56px;
    max-width: 1240px;
    margin: 0 auto;
}
.dx-result-card {
    background: var(--ink);
    color: var(--bg);
    border-radius: 22px;
    padding: 32px 36px;
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 24px;
    align-items: center;
}
.dx-result-card .glyph {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 10px;
    display: grid;
    place-items: center;
}
.dx-result-card .badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(228,87,46,0.18);
    color: var(--accent);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}
.dx-result-card h3 {
    font-size: 26px;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
    line-height: 1.15;
    color: var(--bg);
}
.dx-result-card h3 em { font-style: italic; font-family: var(--font-serif); color: var(--accent); }
.dx-result-card p { color: #b8b3a9; margin: 0; max-width: 50ch; line-height: 1.5; font-size: 14px; }
.dx-result-card .actions { display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 720px) {
    .dx-grid { grid-template-columns: 1fr; padding: 20px 20px 40px; }
    .dx-result { padding: 0 20px 40px; }
    .dx-result-card { grid-template-columns: 1fr; padding: 24px; }
    .dx-result-card .actions { flex-direction: row; }
}

/* ── Footer ── */
.sl-footer {
    border-top: 1px solid var(--border);
    padding: 56px 32px 36px;
    margin-top: 32px;
}
.sl-footer-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}
.sl-footer h6 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 12px;
    font-weight: 600;
}
.sl-footer a {
    display: block;
    padding: 4px 0;
    color: var(--text-mid);
    font-size: 13.5px;
    transition: color 0.15s;
}
.sl-footer a:hover { color: var(--text); }
.sl-footer .blurb {
    color: var(--text-soft);
    font-size: 13.5px;
    max-width: 36ch;
    margin: 12px 0 0;
    line-height: 1.55;
}
.sl-footer .bottom {
    max-width: 1240px;
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-muted);
}
.sl-footer .bottom a { display: inline; padding: 0; }

@media (max-width: 720px) {
    .sl-footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
    .sl-footer .bottom { flex-direction: column; align-items: flex-start; }
}

/* ── Skip link ── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 200;
    padding: 10px 18px;
    background: var(--ink);
    color: var(--bg);
    font-weight: 600;
    border-radius: 0 0 8px 8px;
    transition: top 0.2s;
}
.skip-link:focus { top: 0; outline: none; }

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

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

/* ── Breadcrumb ── */
.breadcrumb {
    max-width: 1240px;
    margin: 0 auto;
    padding: 18px var(--gutter) 0;
    font-size: 12.5px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumb a { color: var(--text-muted); transition: color 0.15s; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .separator { margin: 0 6px; opacity: 0.5; }

/* On phones the trail stays on one line — guide titles are long, so the last
   crumb truncates instead of wrapping over three rows. */
@media (max-width: 720px) {
    .breadcrumb { padding-top: 14px; font-size: 11.5px; }
    .breadcrumb ol { flex-wrap: nowrap; }
    .breadcrumb li { display: flex; align-items: center; min-width: 0; white-space: nowrap; }
    .breadcrumb li:last-child { min-width: 0; overflow: hidden; }
    .breadcrumb li:last-child span { overflow: hidden; text-overflow: ellipsis; }
    .breadcrumb .separator { margin: 0 5px; }
}

/* ── Material detail page (kept usable, restyled) ── */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.detail-prop {
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}
.detail-prop-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}
.detail-list { list-style: none; padding: 0; margin: 0; }
.detail-list li {
    padding: 8px 0 8px 22px;
    position: relative;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-mid);
}
.detail-list li:last-child { border-bottom: none; }
.detail-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    width: 7px; height: 7px;
    border-radius: 50%;
}
.detail-list.pros li::before { background: var(--good); }
.detail-list.cons li::before { background: var(--accent); }
.detail-list.uses li::before { background: var(--text); }

/* ── Ad slots ── */
.ad-slot {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 32px auto;
    min-height: 90px;
    max-width: 1100px;
    padding: 0 32px;
}
.ad-slot ins { display: block; width: 100%; }

/* ── Guide inline tables ── */
.guide-table {
    width: 100%;
    font-size: 13.5px;
    border-collapse: collapse;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 8px;
}
.guide-table th {
    background: var(--surface-soft);
    color: var(--text);
    padding: 10px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-weight: 600;
    white-space: normal;
}
.guide-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-mid);
}
.guide-table tr:last-child td { border-bottom: 0; }

/* ── Tailwind compatibility shims (so JS-generated markup and legacy pages still look good) ── */
.text-sm  { font-size: 13.5px; }
.text-xs  { font-size: 12px; }
.text-lg  { font-size: 17px; }
.text-xl  { font-size: 20px; }
.text-2xl { font-size: 26px; letter-spacing: -0.02em; line-height: 1.15; }
.text-3xl { font-size: 32px; letter-spacing: -0.025em; line-height: 1.1; }
.text-4xl { font-size: 40px; letter-spacing: -0.03em; line-height: 1.05; }
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.font-bold     { font-weight: 600; }
.font-semibold { font-weight: 500; }
.no-underline  { text-decoration: none; }
.block         { display: block; }
.flex           { display: flex; }
.flex-1         { flex: 1; min-width: 0; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.gap-3          { gap: 12px; }
.gap-4          { gap: 16px; }
.mb-2           { margin-bottom: 8px; }
.mb-4           { margin-bottom: 16px; }
.mt-2           { margin-top: 8px; }
.mt-6           { margin-top: 24px; }
.ml-5           { margin-left: 20px; }
.w-10           { width: 40px; }
.list-disc      { list-style: disc; }
.space-y-1 > * + * { margin-top: 4px; }
.space-y-2 > * + * { margin-top: 8px; }
.transition     { transition: all 0.15s; }
.muted-text   { color: var(--text-muted); }
.primary-text { color: var(--text); }
.accent-text  { color: var(--accent); }
.text-yellow-600 { color: #8c6a18; }
.text-red-600    { color: var(--accent-deep); }
.text-green-600  { color: #2D6A45; }
.text-blue-600   { color: var(--text); }

/* Buttons used by app.js for copy actions */
button.bg-blue-600,
a.bg-blue-600 {
    background: var(--ink) !important;
    color: var(--bg) !important;
    border: 0 !important;
    border-radius: 999px !important;
    padding: 9px 18px !important;
    font-family: inherit !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    cursor: pointer;
}
button.bg-blue-600:hover, a.bg-blue-600:hover { background: #2a2a2a !important; }
button.bg-green-600,
a.bg-green-600 {
    background: var(--accent) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 999px !important;
    padding: 9px 18px !important;
    font-family: inherit !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    cursor: pointer;
}
button.bg-green-600:hover, a.bg-green-600:hover { background: var(--accent-deep) !important; }

/* ── Legacy header transition (slicing, guides, about, guide-*, material, legal pages) ──
   Older templates still emit <header class="header-bg p-6 shadow-md"> with logo + title + lang.
   Hide chrome the new top-nav now carries; keep the page title as a clean hero. */
.theme-toggle,
.lang-switcher,
.header-bg .site-name,
.header-bg img { display: none !important; }
.header-bg .flex.items-center.gap-3.mb-2 { display: none !important; }

header.header-bg {
    background: transparent !important;
    box-shadow: none !important;
    padding: 64px 32px 24px !important;
}
header.header-bg > .container {
    max-width: 1240px !important;
    margin: 0 auto !important;
    display: block !important;
    padding: 0 !important;
}
header.header-bg h1,
header.header-bg .header-text {
    font-family: var(--font-sans) !important;
    color: var(--text) !important;
    font-size: clamp(36px, 5vw, 52px) !important;
    font-weight: 500 !important;
    letter-spacing: -0.035em !important;
    line-height: 1.05 !important;
    margin: 0 0 14px !important;
    max-width: 24ch;
}
header.header-bg p,
header.header-bg .text-gray-100 {
    color: var(--text-mid) !important;
    font-size: 17px !important;
    line-height: 1.5 !important;
    max-width: 60ch !important;
    margin: 0 !important;
}

@media (max-width: 720px) {
    header.header-bg { padding: 44px 20px 16px !important; }
}

/* Legacy <main class="container mx-auto p-4 md:p-8"> — confine to D1 width and gutters */
main.container,
body > div.container {
    max-width: 1240px !important;
    padding-left: 32px !important;
    padding-right: 32px !important;
}
@media (max-width: 720px) {
    main.container,
    body > div.container { padding-left: 20px !important; padding-right: 20px !important; }
}

/* Legacy hero feature cards on guide listings — D1 treatment */
a.hero-feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    color: var(--text);
    display: block;
    transition: transform 0.2s, border-color 0.2s;
}
a.hero-feature-card:hover { transform: translateY(-2px); border-color: var(--border-mid); }
a.hero-feature-card h3 { font-size: 18px; font-weight: 500; line-height: 1.25; margin: 0 0 6px; }
a.hero-feature-card p { font-size: 13.5px; color: var(--text-mid); }

/* Anchor scroll-padding so sticky nav doesn't cover targets + smooth jumps */
html { scroll-padding-top: 80px; scroll-behavior: smooth; }

/* ── Layout helpers ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 880px) {
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stack > * + * { margin-top: 14px; }
.stack-lg > * + * { margin-top: 22px; }

/* ──────────────────────────────────────────────────────────────
   GUIDE / ARTICLE PAGE — D1  ("08 · Page guide / article")
   Sticky TOC sidebar + narrow prose column, byline, callouts, foot.
   ────────────────────────────────────────────────────────────── */
.article-page { max-width: 1100px; margin: 0 auto; padding: 0 32px 80px; }

.article-head {
    padding: 28px 0 36px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 36px;
}
.article-head .tag {
    display: block;
    width: fit-content;
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.article-head h1 {
    font-size: clamp(38px, 5.5vw, 56px);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1.05;
    margin: 0 0 18px;
    max-width: 24ch;
}
.article-head h1 em { font-style: italic; font-family: var(--font-serif); font-weight: 400; }
.article-head .sub {
    font-size: 18px;
    color: var(--text-mid);
    line-height: 1.5;
    margin: 0 0 24px;
    max-width: 60ch;
}
.article-head .byline {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--text-soft);
}
.article-head .byline .av {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    flex-shrink: 0;
}
.article-head .byline .name { color: var(--text); font-weight: 500; font-size: 14px; }
.article-head .byline .meta {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-muted);
}

.article-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 48px;
    align-items: start;
}
.article-toc { position: sticky; top: 90px; }
.article-toc .lbl {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 12px;
}
.article-toc ol {
    list-style: none; padding: 0; margin: 0;
    display: grid; gap: 4px; counter-reset: toc;
}
.article-toc li { counter-increment: toc; }
.article-toc a {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 8px;
    padding: 7px 0;
    font-size: 12.5px;
    color: var(--text-soft);
    line-height: 1.35;
    border-bottom: 0;
    transition: color 0.15s;
}
.article-toc a::before {
    content: counter(toc, decimal-leading-zero);
    font-family: var(--font-mono);
    color: #cdc9be;
    font-size: 10.5px;
    padding-top: 2px;
}
.article-toc a:hover { color: var(--text); }
.article-toc a.on { color: var(--accent); }
.article-toc a.on::before { color: var(--accent); }

.article-body { font-size: 16px; line-height: 1.65; color: #2a2820; max-width: 64ch; }
.article-body > section { scroll-margin-top: 90px; }
.article-body h2 {
    font-size: clamp(26px, 3.2vw, 30px);
    font-weight: 500;
    letter-spacing: -0.02em;
    margin: 40px 0 14px;
    line-height: 1.15;
    scroll-margin-top: 90px;
    color: var(--text);
}
.article-body > section:first-child h2 { margin-top: 0; }
.article-body h2 em { font-style: italic; font-family: var(--font-serif); }
.article-body h3 {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 24px 0 8px;
    color: var(--text);
}
.article-body p { margin: 0 0 14px; color: #2a2820; }
.article-body p b,
.article-body p strong,
.article-body li strong { color: var(--text); font-weight: 600; }
.article-body ul { padding-left: 22px; margin: 0 0 16px; }
.article-body ul li { margin-bottom: 6px; }
.article-body a {
    color: var(--accent);
    border-bottom: 1px solid currentColor;
    padding-bottom: 1px;
}
.article-body a:hover { color: var(--accent-deep); }
.article-body code {
    font-family: var(--font-mono);
    font-size: 14px;
    padding: 1px 6px;
    background: var(--surface-warm);
    border-radius: 4px;
    color: #C85A2E;
}
.article-body figure {
    margin: 24px 0; padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.article-body figure .ph {
    height: 280px;
    background:
        repeating-linear-gradient(135deg, rgba(0,0,0,0.04) 0 8px, transparent 8px 16px),
        linear-gradient(180deg, #efece4, #e6e2d6);
    display: grid; place-items: center;
}
.article-body figure figcaption {
    padding: 10px 14px;
    background: var(--surface-soft);
    font-size: 12.5px;
    color: var(--text-soft);
    line-height: 1.5;
}
.article-body figure img {
    display: block;
    width: 100%;
    height: auto;
}
.article-body figure figcaption .credit {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-soft);
    opacity: 0.75;
}
.article-body .figure-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 700px) {
    .article-body .figure-row { grid-template-columns: 1fr; }
}
.article-body .callout {
    margin: 22px 0;
    padding: 16px 18px;
    background: #FBF7EC;
    border-left: 2px solid var(--accent);
    border-radius: 8px;
    font-size: 14.5px;
    color: #5a4e30;
}
.article-body .callout .lbl {
    font-size: 11px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 6px;
}
.article-body .callout p { color: #5a4e30; margin: 0; }
.article-body .callout strong { color: #463c22; }
.article-body .guide-table { margin: 18px 0; }
.article-body .ad-slot { padding: 0; margin: 28px 0; }

.article-foot {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-muted);
}
.article-foot .actions { display: flex; gap: 8px; justify-content: center; font-family: var(--font-sans); }
/* These buttons are <a> inside .article-body, so re-assert .btn styling
   over the generic `.article-body a` link rule (which would tint them orange). */
.article-foot .actions .btn { border-bottom: 0; padding: 10px 18px; }
.article-foot .actions .btn--line {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--ink);
}
.article-foot .actions .btn--line:hover { background: rgba(0, 0, 0, 0.04); color: var(--text); }
.article-foot .actions .btn--accent {
    background: var(--accent);
    color: #fff;
    border: 0;
}
.article-foot .actions .btn--accent:hover { background: var(--accent-deep); color: #fff; }

@media (max-width: 880px) {
    .article-grid { grid-template-columns: 1fr; gap: 28px; }
    .article-toc {
        position: static;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        padding: 16px 18px;
        background: var(--surface);
    }
    .article-body { max-width: none; }
}
@media (max-width: 720px) {
    .article-page { padding: 0 20px 56px; }
    .article-foot .actions { flex-wrap: wrap; justify-content: center; }
}

/* ──────────────────────────────────────────────────────────────
   GUIDES LISTING — D1  ("07 · Liste guides")
   Category pills + dark feature card + 3-col grid with textured bands.
   ────────────────────────────────────────────────────────────── */
.guides-list-page { max-width: 1240px; margin: 0 auto; padding: 0 32px 80px; }

.guides-cats {
    display: flex; gap: 8px; flex-wrap: wrap;
    padding: 0 0 18px; margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.guides-cats .pill {
    padding: 7px 13px; border-radius: 999px;
    border: 1px solid var(--border-mid); background: var(--surface);
    font-size: 13px; color: var(--text-mid); cursor: pointer;
    display: inline-flex; align-items: center; gap: 7px;
    font-family: inherit;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.guides-cats .pill:hover { border-color: var(--text-muted); color: var(--text); }
.guides-cats .pill.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.guides-cats .pill .ct { font-family: var(--font-mono); font-size: 11px; opacity: 0.7; }

.guides-feature {
    background: var(--ink); color: var(--bg); border-radius: 20px; padding: 36px 40px;
    display: grid; grid-template-columns: 1.3fr 1fr; gap: 36px; align-items: center;
    margin-bottom: 18px; position: relative; overflow: hidden;
    transition: transform 0.2s;
}
.guides-feature:hover { transform: translateY(-2px); }
.guides-feature::before {
    content: ''; position: absolute; right: -100px; top: -80px; width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(228,87,46,0.4), transparent 65%);
    filter: blur(50px); pointer-events: none;
}
.guides-feature .lab { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); font-weight: 600; margin-bottom: 14px; position: relative; }
.guides-feature h2 { font-size: clamp(28px, 4vw, 38px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.1; margin: 0 0 14px; position: relative; max-width: 22ch; color: var(--bg); }
.guides-feature h2 em { font-style: italic; font-family: var(--font-serif); color: var(--accent); }
.guides-feature p { font-size: 15px; color: #b8b3a9; line-height: 1.55; margin: 0 0 18px; max-width: 50ch; position: relative; }
.guides-feature .meta-line { font-family: var(--font-mono); font-size: 11.5px; color: #b8b3a9; display: flex; gap: 14px; flex-wrap: wrap; position: relative; }
.guides-feature .visual {
    position: relative; min-height: 200px; border-radius: 14px;
    background:
        repeating-linear-gradient(135deg, rgba(255,255,255,0.04) 0 8px, transparent 8px 16px),
        rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08); display: grid; place-items: center;
}
.guides-feature .visual .tag { font-family: var(--font-mono); font-size: 11px; color: #b8b3a9; padding: 4px 10px; border-radius: 5px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); }

.guides-grid-2 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.guides-grid-2 .g {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 0; display: grid; grid-template-rows: 120px 1fr; overflow: hidden; color: var(--text);
    transition: transform 0.2s, border-color 0.2s;
}
.guides-grid-2 .g:hover { transform: translateY(-2px); border-color: var(--border-mid); }
.guides-grid-2 .g .vis {
    position: relative;
    background:
        repeating-linear-gradient(135deg, rgba(0,0,0,0.04) 0 6px, transparent 6px 12px),
        linear-gradient(180deg, #efece4, #e6e2d6);
    border-bottom: 1px solid var(--border);
}
.guides-grid-2 .g .vis img,
.guides-feature .visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.guides-feature .visual { overflow: hidden; padding: 0; }
.guides-grid-2 .g .body { padding: 18px 20px 20px; display: grid; grid-template-rows: auto 1fr auto; gap: 10px; }
.guides-grid-2 .g .tag-cat { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: var(--surface-warm); color: var(--text-mid); width: fit-content; font-weight: 500; }
.guides-grid-2 .g h4 { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; margin: 0; line-height: 1.25; }
.guides-grid-2 .g .meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); display: flex; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border-soft); }

.guides-total { text-align: center; margin-top: 32px; font-size: 13px; color: var(--text-muted); font-family: var(--font-mono); }
.guides-grid-2 .g[hidden] { display: none; }

@media (max-width: 880px) {
    .guides-list-page { padding: 0 20px 56px; }
    .guides-feature { grid-template-columns: 1fr; padding: 28px; gap: 24px; }
    .guides-grid-2 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .guides-grid-2 { grid-template-columns: 1fr; }
}

/* ── Long-form prose card content ── */
.prose p { font-size: 15px; line-height: 1.65; color: var(--text-mid); margin: 0 0 14px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--accent); border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.prose a:hover { color: var(--accent-deep); }
.prose h3 {
    font-size: 18px; font-weight: 600; letter-spacing: -0.01em;
    margin: 0 0 8px; color: var(--text);
}
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; color: var(--text-mid); }
.prose ul li, .prose ol li { padding: 3px 0; line-height: 1.55; }
.prose em { font-style: italic; }
