/* ─────────────────────────────────────────────────────────────────
 *  Pyflo homepage — Editorial design system (Sprint 19.29)
 *  Warm paper · serif display · mobile-first · progressive reveal
 *  Replaces the prior 6-theme palette with one anchored, premium
 *  editorial look. Override-friendly: uses the same selectors the
 *  legacy CSS used so app.js keeps working unchanged.
 * ───────────────────────────────────────────────────────────────── */

/* ── Tokens — one warm-paper system, all old themes neutralised ── */
:root,
[data-theme="paper"],
[data-theme="midnight"],
[data-theme="light"],
[data-theme="ocean"],
[data-theme="forest"],
[data-theme="sunset"] {
    --bg-0:      #faf6ee;
    --bg-1:      #fffdf8;
    --bg-2:      #f3ede0;
    --bg-3:      #ebe3d2;
    --bg-ink:    #1f1a14;

    --text-0:    #1f1a14;
    --text-1:    #4a4036;
    --text-2:    #847865;
    --text-3:    #b3a690;

    --border:        #e2dac7;
    --border-strong: #c9bda3;
    --border-focus:  #b85a3a;

    --accent:        #b85a3a;
    --accent-soft:   rgba(184,90,58,0.08);
    --accent-glow:   rgba(184,90,58,0.05);
    --accent-ink:    #8a3e26;

    --green:         #5a8a3a;
    --green-soft:    rgba(90,138,58,0.10);
    --orange:        #c87830;
    --orange-soft:   rgba(200,120,48,0.10);
    --red:           #c4452c;

    --shadow-sm:  0 1px 2px rgba(31,26,20,0.04);
    --shadow:     0 1px 3px rgba(31,26,20,0.05),
                  0 4px 16px rgba(31,26,20,0.04);
    --shadow-lg:  0 4px 20px rgba(31,26,20,0.07),
                  0 12px 40px rgba(31,26,20,0.05);
    --glow-color: rgba(184,90,58,0.04);

    --r-xs: 4px; --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-xl: 20px;

    --font-display: 'Source Serif 4', 'Charter', 'Iowan Old Style',
                     'Apple Garamond', Cambria, Georgia, serif;
    --font:         'Instrument Sans', -apple-system, BlinkMacSystemFont,
                    'Segoe UI', system-ui, sans-serif;
    --mono:         'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    --ease:        cubic-bezier(0.22, 1, 0.36, 1);
    --ease-quick:  cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset + base ──────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
*::selection { background: var(--accent-soft); color: var(--accent-ink); }
html {
    font-size: 16px; -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
}
body {
    font-family: var(--font);
    background: var(--bg-0);
    color: var(--text-0);
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.55;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
img, svg { max-width: 100%; display: block; }

/* Kill the prior neon ambient glow */
.glow {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background: radial-gradient(ellipse 1200px 600px at 50% 0%,
                                 var(--glow-color) 0%, transparent 70%);
}

/* ── Layout container ──────────────────────────────────────────── */
.wrap {
    position: relative; z-index: 1;
    max-width: 720px; margin: 0 auto;
    padding: 0 20px;
}
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* ── Header ────────────────────────────────────────────────────── */
header {
    padding: 18px 0 14px;
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px;
}
.logo {
    font-family: var(--mono); font-weight: 700;
    font-size: 1.05rem; letter-spacing: -0.3px;
    color: var(--text-0); text-decoration: none; line-height: 1;
}
.logo b { color: var(--accent); }
.logo:hover { color: var(--accent); }
.badge {
    font-family: var(--mono); font-size: 0.62rem;
    text-transform: uppercase; letter-spacing: 1.6px;
    color: var(--text-2); background: var(--bg-2);
    border: 1px solid var(--border);
    padding: 3px 7px; border-radius: var(--r-xs);
}
header > div {
    display: flex; align-items: center; gap: 6px;
    position: relative;
}

/* Header buttons (theme/country/language/install/search-pos) */
.theme-btn, .country-btn, .install-btn, .search-pos-btn {
    height: 32px; padding: 0 9px; border-radius: var(--r-sm);
    border: 1px solid var(--border); background: var(--bg-1);
    cursor: pointer; font-family: var(--font); font-size: 0.78rem;
    color: var(--text-1); display: inline-flex; align-items: center;
    gap: 5px; transition: all 0.15s var(--ease-quick);
}
.theme-btn:hover, .country-btn:hover,
.install-btn:hover, .search-pos-btn:hover {
    border-color: var(--border-strong); background: var(--bg-2);
    color: var(--text-0);
}
.country-btn #countryFlag { font-size: 0.95rem; }
.country-btn #countryCode, .country-btn #languageCode {
    font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.4px;
}
/* Single theme — hide theme picker & button */
#themeBtn, .theme-btn, .theme-picker { display: none !important; }

.install-btn { padding: 0 11px; }
.install-label { font-weight: 500; }

/* The in-header search-pos button is redundant on mobile (the mobile
   bar carries its own ↑ toggle that's always within thumb reach) and
   crowds the toolbar on small viewports. Show only on desktop. */
@media (max-width: 719px) {
    .search-pos-btn { display: none !important; }
    /* Free up header space — drop install button label, hide the
       beta badge. Logo + country + language remain visible. */
    .install-label { display: none; }
    .install-btn { padding: 0; width: 32px; justify-content: center; }
    .badge { display: none; }
}

/* ── Country / language picker dropdowns ─────────────────────── */
.country-picker {
    position: absolute; top: 40px; right: 0;
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--r); z-index: 110; box-shadow: var(--shadow-lg);
    min-width: 240px; max-width: 280px;
    display: flex; flex-direction: column;
    animation: fadeIn 0.15s var(--ease-quick);
}
.country-picker[hidden] { display: none; }
.country-picker-search {
    padding: 8px; border-bottom: 1px solid var(--border);
}
.country-picker-search input {
    width: 100%; padding: 7px 10px; border-radius: var(--r-sm);
    border: 1px solid var(--border); background: var(--bg-0);
    color: var(--text-0); font-family: var(--font); font-size: 0.82rem;
}
.country-picker-search input:focus {
    outline: none; border-color: var(--accent);
}
.country-picker-list { max-height: 320px; overflow-y: auto; padding: 4px; }
.country-opt {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer;
    font-size: 0.84rem; color: var(--text-1); font-family: var(--font);
    border: none; background: none; width: 100%; text-align: left;
}
.country-opt:hover { background: var(--accent-soft); color: var(--text-0); }
.country-opt.active { color: var(--accent); font-weight: 600; }
.country-opt.detected::after {
    content: 'detected'; margin-left: auto; font-size: 0.62rem;
    color: var(--text-2); text-transform: uppercase; letter-spacing: 0.5px;
}
.country-opt-flag { font-size: 1.05rem; flex-shrink: 0; }
.country-opt-name { flex: 1; white-space: nowrap; overflow: hidden;
                    text-overflow: ellipsis; }
.country-opt-code { font-family: var(--mono); font-size: 0.7rem;
                    color: var(--text-2); }

/* ── Locale collapse drawer ────────────────────────────────────── */
.locale-collapse {
    margin: 4px 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--r); background: var(--bg-1); overflow: hidden;
}
.locale-collapse-summary {
    padding: 11px 14px; cursor: pointer; list-style: none;
    display: flex; align-items: center; gap: 8px;
    font-size: 0.82rem; color: var(--text-1); font-weight: 500;
}
.locale-collapse-summary::-webkit-details-marker { display: none; }
.locale-collapse-summary:hover { background: var(--bg-2); }
.locale-collapse-icon { font-size: 0.95rem; }
.locale-collapse-text { flex: 1; }
.locale-collapse-chev {
    font-size: 0.75rem; color: var(--text-2); transition: transform 0.2s;
}
.locale-collapse[open] .locale-collapse-chev { transform: rotate(180deg); }
.locale-collapse[open] .locale-collapse-summary {
    border-bottom: 1px solid var(--border);
}

/* Country bar — horizontally scrolling row of flags. Legacy CSS used
   border-bottom + max-width which fought the new collapse container.
   Override with !important so the inline <style> can't re-introduce. */
.country-bar {
    display: flex !important; gap: 8px !important;
    overflow-x: auto !important;
    padding: 12px 14px !important;
    margin: 0 !important; max-width: none !important;
    border-bottom: 1px solid var(--border) !important;
    background: var(--bg-1) !important;
    scrollbar-width: thin;
    scroll-snap-type: x mandatory;
}
.country-bar::-webkit-scrollbar { height: 4px; }
.country-bar::-webkit-scrollbar-thumb {
    background: var(--border-strong); border-radius: 2px;
}
.country-bar:empty { display: none !important; }

/* Country flag pills (rendered by app.js). */
.country-bar-flag {
    flex-shrink: 0;
    display: inline-flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-width: 50px; padding: 6px 6px; gap: 3px;
    border: 1px solid transparent; border-radius: var(--r-sm);
    background: var(--bg-0); cursor: pointer;
    font-family: var(--font); color: var(--text-1);
    transition: all 0.12s var(--ease-quick);
}
.country-bar-flag:hover {
    background: var(--accent-soft); color: var(--accent-ink);
    border-color: var(--border-strong);
}
.country-bar-flag.active {
    background: var(--accent); color: #fff; border-color: var(--accent);
}
.country-bar-flag.active .cb-code { color: #fff; }
.country-bar-flag .cb-flag { font-size: 1.3rem; line-height: 1; }
.country-bar-flag .cb-code {
    font-family: var(--mono); font-size: 0.6rem;
    letter-spacing: 0.5px; color: var(--text-2);
}
.country-bar-divider {
    flex-shrink: 0; width: 1px; align-self: stretch;
    background: var(--border); margin: 4px 2px;
}

/* Language wrap — vertical stack on mobile so the translate-to-EN
   toggle gets its own row instead of crowding the language pills. */
.language-bar-wrap {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px !important;
    margin: 0 !important; max-width: none !important;
    border-bottom: none !important;
    background: var(--bg-1) !important;
}
@media (min-width: 540px) {
    .language-bar-wrap { flex-direction: row; align-items: center; }
}
.language-bar {
    flex: 1; min-width: 0;
    display: flex; gap: 6px; overflow-x: auto;
    scrollbar-width: thin;
}
.language-bar::-webkit-scrollbar { height: 4px; }
.language-bar::-webkit-scrollbar-thumb {
    background: var(--border-strong); border-radius: 2px;
}
.language-bar:empty { display: none; }

.language-pill {
    flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 10px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--bg-0);
    cursor: pointer; font-family: var(--font);
    font-size: 0.76rem; color: var(--text-1);
    transition: all 0.12s var(--ease-quick);
    user-select: none;
}
.language-pill:hover {
    background: var(--accent-soft); color: var(--accent-ink);
    border-color: var(--border-strong);
}
.language-pill.active {
    background: var(--accent); color: #fff;
    border-color: var(--accent); font-weight: 600;
}
.language-pill .lp-flag { font-size: 0.95rem; line-height: 1; }
.language-pill .lp-code { font-family: var(--mono); font-size: 0.62rem;
                           letter-spacing: 0.5px; opacity: 0.85; }

/* Translate-to-EN toggle — confine the absolutely-positioned hidden
   checkbox to the label so it can't escape and overlap other rows. */
.lang-translate-toggle {
    position: relative;     /* anchors the absolute child */
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.72rem; color: var(--text-2); cursor: pointer;
    user-select: none; flex-shrink: 0;
    padding: 4px 0;
    margin: 0;
}
@media (min-width: 540px) {
    .lang-translate-toggle { margin-left: auto; }
}
.lang-translate-toggle input[type="checkbox"] {
    position: absolute; opacity: 0; pointer-events: none;
    width: 0; height: 0; margin: 0;
}
.lang-translate-track {
    display: inline-block; width: 30px; height: 17px;
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: 999px; position: relative; flex-shrink: 0;
    transition: background 0.18s, border-color 0.18s;
}
.lang-translate-track::after {
    content: ''; position: absolute; top: 1px; left: 1px;
    width: 13px; height: 13px; border-radius: 50%;
    background: var(--text-2);
    transition: transform 0.18s, background 0.18s;
}
.lang-translate-toggle input:checked + .lang-translate-track {
    background: var(--accent-soft); border-color: var(--accent);
}
.lang-translate-toggle input:checked + .lang-translate-track::after {
    background: var(--accent); transform: translateX(13px);
}
.lang-translate-label { line-height: 1; }

/* ── Hero ──────────────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 32px 0 20px;
    animation: fadeIn 0.4s var(--ease);
}
.hero h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.2rem, 8vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text-0);
    margin-bottom: 14px;
    text-wrap: balance;
}
.hero h1 .grad,
.hero h1 .gradient {
    color: var(--accent);
    font-style: italic;
    font-weight: 600;
    background: none;
    -webkit-text-fill-color: var(--accent);
}
.hero-subtitle {
    font-size: clamp(0.95rem, 2.4vw, 1.05rem);
    color: var(--text-1);
    max-width: 540px; margin: 0 auto 18px;
    line-height: 1.55; text-wrap: balance;
}
.trust-badges {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 8px; margin-top: 14px;
}
.trust-badge {
    font-size: 0.74rem; color: var(--text-1);
    background: var(--bg-1); border: 1px solid var(--border);
    padding: 5px 11px; border-radius: 999px; font-weight: 500;
}
.live-count {
    font-size: 0.78rem; color: var(--text-2);
    margin-top: 12px; min-height: 1em;
}
.hero.small { padding: 8px 0 4px; }
.hero.small h1 { font-size: clamp(1.4rem, 5vw, 1.8rem); margin-bottom: 4px; }
.hero.small .hero-subtitle,
.hero.small .trust-badges,
.hero.small .live-count { display: none; }

/* ── Search area ───────────────────────────────────────────────── */
.search-area { position: relative; }
.search-box {
    display: flex; align-items: stretch;
    background: var(--bg-1);
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.18s, box-shadow 0.18s;
}
.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: var(--shadow), 0 0 0 4px var(--accent-glow);
}
.search-box input {
    flex: 1; min-width: 0;
    padding: 14px 16px;
    font-family: var(--font); font-size: 1rem;
    background: transparent; color: var(--text-0);
    border: none; outline: none;
}
.search-box input::placeholder { color: var(--text-3); }
.clear-btn {
    background: none; border: none; cursor: pointer;
    color: var(--text-2); padding: 0 8px;
    display: none; align-items: center;
}
.clear-btn.on { display: flex; }
.clear-btn:hover { color: var(--text-0); }
.btn {
    background: var(--accent); color: #fff;
    border: none; cursor: pointer;
    padding: 0 16px; min-width: 56px;
    font-family: var(--font); font-weight: 600; font-size: 0.92rem;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; transition: background 0.15s;
}
.btn:hover { background: var(--accent-ink); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn .btn-label { display: none; }
@media (min-width: 540px) {
    .btn { padding: 0 22px; }
    .btn .btn-label { display: inline; }
}

.sliders {
    margin-top: 12px; padding: 12px 14px;
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--r-lg);
}
.sliders-hint { font-size: 0.78rem; color: var(--text-1);
                 margin-bottom: 8px; font-weight: 500; }
.sliders-grid { display: grid; gap: 10px; }
@media (min-width: 540px) {
    .sliders-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}
.slider-cell label { font-size: 0.78rem; color: var(--text-1);
                      display: flex; justify-content: space-between; }
.slider-value { font-family: var(--mono); font-size: 0.78rem;
                 color: var(--accent); font-weight: 600; }
.slider-cell input[type=range] {
    width: 100%; accent-color: var(--accent); margin: 6px 0 4px;
}
.slider-ends { display: flex; justify-content: space-between;
                font-size: 0.66rem; color: var(--text-2); }

.kbd-hint {
    margin-top: 8px; text-align: center;
    font-size: 0.72rem; color: var(--text-2);
}
.kbd-hint kbd {
    font-family: var(--mono); font-size: 0.7rem;
    background: var(--bg-2); border: 1px solid var(--border);
    padding: 1px 5px; border-radius: 3px; color: var(--text-1);
}

/* ── Example chips + recent + pills ────────────────────────────── */
.example-chips {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 6px 8px; margin: 16px 0 8px; padding: 0 2px;
}
.example-label {
    font-size: 0.78rem; color: var(--text-2); margin-right: 4px;
}
.example-chip,
.recent-chips a, .recent-chips button,
.pill {
    font-family: var(--font); font-size: 0.8rem;
    background: var(--bg-1); border: 1px solid var(--border);
    color: var(--text-1); padding: 5px 11px;
    border-radius: 999px; cursor: pointer;
    text-decoration: none; transition: all 0.12s var(--ease-quick);
}
.example-chip:hover,
.recent-chips a:hover, .recent-chips button:hover,
.pill:hover {
    border-color: var(--accent); background: var(--accent-soft);
    color: var(--accent-ink);
}

.recent-section {
    margin: 16px 0; padding: 12px 14px;
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--r-lg);
}
.recent-label {
    font-size: 0.78rem; color: var(--text-2); font-weight: 500;
    margin-bottom: 8px;
}
.recent-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }

/* ── Tabs bar — multi-query persistence ────────────────────────── */
.tabs-bar {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin: 16px 0 12px; align-items: center;
}
.tabs-bar:empty { display: none; }
.tabs-bar::before {
    content: 'Open answers';
    font-family: var(--mono); font-size: 0.62rem;
    text-transform: uppercase; letter-spacing: 1.4px;
    color: var(--text-2); margin-right: 4px;
}

/* Tab pill (the actual class JS renders) — interactive chip showing
   the prior answer's title. Click to switch back. */
.tab-pill {
    font-family: var(--font); font-size: 0.8rem;
    background: var(--bg-1); border: 1px solid var(--border);
    color: var(--text-1); padding: 5px 8px 5px 12px;
    border-radius: 999px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    max-width: 240px; overflow: hidden;
    transition: all 0.12s var(--ease-quick);
}
.tab-pill:hover {
    border-color: var(--border-strong); background: var(--bg-2);
    color: var(--text-0);
}
.tab-pill.active {
    background: var(--accent); color: #fff;
    border-color: var(--accent);
}
.tab-pill.active .tab-q { color: #fff; }
.tab-pill.loading {
    border-style: dashed; color: var(--text-2);
}
.tab-pill.loading .tab-q::after {
    content: '…'; animation: pulse 1.2s infinite;
}
.tab-q {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--text-1);
}
.tab-close {
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%;
    font-size: 0.95rem; line-height: 1; opacity: 0.55;
    transition: all 0.12s;
}
.tab-pill:hover .tab-close { opacity: 0.9; }
.tab-close:hover {
    background: rgba(255,255,255,0.2);
    opacity: 1;
}
.tab-pill.active .tab-close { opacity: 0.7; color: #fff; }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

/* Legacy class kept for any caller that still emits it */
.tab-btn {
    font-family: var(--font); font-size: 0.8rem;
    background: var(--bg-1); border: 1px solid var(--border);
    color: var(--text-1); padding: 5px 12px;
    border-radius: 999px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    max-width: 240px;
}
.tab-btn:hover { border-color: var(--border-strong); }
.tab-btn.active { background: var(--accent); color: #fff;
                  border-color: var(--accent); }

/* ── Cards (solution + products) ───────────────────────────────── */
.card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 24px 22px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.32s var(--ease);
}
@media (min-width: 540px) {
    .card { padding: 28px 28px; }
}
.tag {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--mono); font-size: 0.62rem;
    text-transform: uppercase; letter-spacing: 1.4px;
    color: var(--accent-ink); margin-bottom: 14px;
}
.tag svg { width: 12px; height: 12px; }
.tag-green { color: var(--green); }
.tag-orange { color: var(--orange); }

#solutionCard h2, #title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.5rem, 4.4vw, 2rem);
    line-height: 1.18;
    letter-spacing: -0.015em;
    color: var(--text-0);
    margin-bottom: 16px;
    text-wrap: balance;
}

.sol {
    font-size: 1rem; line-height: 1.65;
    color: var(--text-0);
}
.sol p { margin: 0 0 0.85em; }
.sol p:last-child { margin-bottom: 0; }
.sol h3 {
    font-family: var(--font-display); font-weight: 700;
    font-size: 1.15rem; line-height: 1.3;
    margin: 1.35em 0 0.4em; color: var(--text-0);
    letter-spacing: -0.01em;
}
.sol h4 { font-weight: 600; font-size: 0.98rem;
           margin: 1em 0 0.3em; color: var(--text-0); }
.sol ul, .sol ol { padding-left: 1.4em; margin: 0.5em 0 0.85em; }
.sol li { margin-bottom: 0.35em; }
.sol li::marker { color: var(--accent); }
.sol strong { color: var(--text-0); font-weight: 700; }
.sol code {
    font-family: var(--mono); font-size: 0.88em;
    background: var(--bg-2); padding: 1px 5px; border-radius: 3px;
    color: var(--accent-ink);
}
.sol blockquote {
    margin: 1em 0; padding: 0.6em 1em;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    font-style: italic; color: var(--text-1);
}
.sol a { color: var(--accent-ink); text-decoration: underline;
          text-decoration-color: var(--accent-soft);
          text-underline-offset: 2px; }
.sol a:hover { text-decoration-color: var(--accent); }
.callout-mistake { border-left: 3px solid var(--red);
                    background: rgba(196,69,44,0.06);
                    padding: 12px 14px; }
.callout-tip { border-left: 3px solid var(--green);
                background: var(--green-soft); padding: 12px 14px; }
.callout-warn { border-left: 3px solid var(--orange);
                 background: var(--orange-soft); padding: 12px 14px; }

#prodsCard { padding: 22px 22px; }
@media (min-width: 540px) { #prodsCard { padding: 26px 26px; } }
#prodsLabel {
    font-family: var(--mono); font-size: 0.62rem;
    text-transform: uppercase; letter-spacing: 1.4px;
}
.prod {
    padding: 14px 0; border-bottom: 1px solid var(--border);
    cursor: pointer; transition: background 0.12s;
    display: flex; gap: 12px; align-items: flex-start;
}
.prod:last-child { border-bottom: none; }
.prod:hover { background: var(--bg-2); margin: 0 -8px;
               padding-left: 8px; padding-right: 8px;
               border-radius: var(--r-sm); }
.prod-icon {
    flex-shrink: 0; width: 40px; height: 40px;
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.prod-icon img {
    width: 40px; height: 40px; border-radius: var(--r-sm); object-fit: cover;
}
.prod-body { flex: 1; min-width: 0; }
.prod-title {
    font-family: var(--font); font-weight: 600;
    font-size: 0.95rem; color: var(--text-0); line-height: 1.35;
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px;
}
.prod-desc {
    font-size: 0.84rem; color: var(--text-1); line-height: 1.5; margin-top: 4px;
}
.store-links {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.store-link {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 10px; border-radius: var(--r-sm);
    background: var(--bg-2); border: 1px solid var(--border);
    color: var(--text-1); text-decoration: none;
    font-size: 0.78rem; font-weight: 500; transition: all 0.12s;
}
.store-link:hover {
    border-color: var(--accent); background: var(--accent-soft);
    color: var(--accent-ink);
}
.store-link.primary {
    background: var(--accent); color: #fff; border-color: var(--accent);
}
.store-link.primary:hover { background: var(--accent-ink); color: #fff; }
.store-icon-sm { font-size: 0.92rem; line-height: 1; }
.prod-vote { display: inline-flex; gap: 2px; margin-left: auto; flex-shrink: 0; }
.prod-vote-btn {
    background: none; border: 1px solid transparent; cursor: pointer;
    padding: 4px 6px; border-radius: var(--r-sm); font-size: 0.95rem;
    opacity: 0.4; transition: all 0.15s;
}
.prod-vote-btn:hover { opacity: 1; background: var(--bg-2); }
.prod-vote-btn.voted { opacity: 1; background: var(--accent-soft); }

/* ── Refine chips ──────────────────────────────────────────────── */
.refine-chips {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    margin: 14px 0;
}
.refine-label { font-size: 0.78rem; color: var(--text-2); margin-right: 4px; }
.refine-chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-family: var(--font); font-size: 0.78rem;
    background: var(--bg-1); border: 1px solid var(--border);
    color: var(--text-1); padding: 6px 12px;
    border-radius: 999px; cursor: pointer; transition: all 0.12s var(--ease-quick);
}
.refine-chip:hover { border-color: var(--accent); color: var(--accent-ink);
                     background: var(--accent-soft); }

/* ── Source ribbon ─────────────────────────────────────────────── */
.source-ribbon {
    margin: 14px 0; padding: 10px 14px;
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--r-lg); font-size: 0.82rem;
}
.source-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.source-count { font-family: var(--mono); font-weight: 600; color: var(--accent); }
.source-label { color: var(--text-2); }
.source-fav-row { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.source-fav-row img { width: 16px; height: 16px; border-radius: 3px; }
.source-toggle { background: none; border: none; color: var(--accent);
                  cursor: pointer; font-size: 0.8rem; margin-left: auto;
                  text-decoration: underline; text-underline-offset: 2px;
                  font-family: var(--font); }
.source-list { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.source-list a { display: block; font-size: 0.82rem; color: var(--text-1);
                  text-decoration: none; padding: 4px 0; }
.source-list a:hover { color: var(--accent); }

/* ── Share bar ─────────────────────────────────────────────────── */
.share-bar {
    margin: 12px 0; display: flex; gap: 8px; flex-wrap: wrap;
    justify-content: center;
}
.share-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--bg-1); border: 1px solid var(--border);
    color: var(--text-1); padding: 7px 14px;
    border-radius: var(--r-sm); cursor: pointer;
    font-family: var(--font); font-size: 0.82rem; transition: all 0.12s;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent-ink);
                    background: var(--accent-soft); }
.share-btn svg { width: 14px; height: 14px; }

/* ── Continue ──────────────────────────────────────────────────── */
.continue-box {
    margin: 18px 0; padding: 16px 18px;
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.continue-title {
    font-family: var(--font-display); font-weight: 700;
    font-size: 1.05rem; color: var(--text-0); margin-bottom: 8px;
    letter-spacing: -0.01em;
}
.continue-row { display: flex; gap: 8px; }
.continue-row input {
    flex: 1; padding: 10px 12px; border-radius: var(--r-sm);
    border: 1px solid var(--border); background: var(--bg-0);
    font-family: var(--font); font-size: 0.92rem; color: var(--text-0);
    outline: none; min-width: 0;
}
.continue-row input:focus { border-color: var(--accent); }
.continue-btn {
    background: var(--accent); color: #fff; border: none;
    padding: 10px 16px; border-radius: var(--r-sm);
    cursor: pointer; font-family: var(--font); font-weight: 600;
    font-size: 0.85rem; display: inline-flex; align-items: center;
    gap: 6px; flex-shrink: 0;
}
.continue-btn:hover { background: var(--accent-ink); }
.continue-btn svg { width: 14px; height: 14px; }
.continue-hint { font-size: 0.75rem; color: var(--text-2);
                  margin-top: 6px; line-height: 1.45; }

/* ── Discover / KG / owner reviews / chain locator ────────────── */
.discover-box, .owner-reviews, .chain-location, .amzn-shop-box, .medianet-slot {
    margin: 14px 0; padding: 14px 16px;
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--r-lg);
}
.discover-box:empty, .amzn-shop-box:empty, .medianet-slot:empty { display: none; }
.discover-box[hidden], .amzn-shop-box[hidden], .medianet-slot[hidden] { display: none; }
.node-card, .related-item {
    background: var(--bg-2); border: 1px solid var(--border);
    color: var(--text-1);
}
.node-card:hover, .related-item:hover {
    border-color: var(--accent); background: var(--accent-soft);
    color: var(--accent-ink);
}
.owner-reviews-label, .chain-location-head, .amzn-shop-label {
    font-size: 0.78rem; color: var(--text-2); margin-bottom: 8px;
    display: flex; align-items: center; gap: 6px;
}

/* ── Ad slots — paper feel, dashed dividers ────────────────────── */
.ad-slot {
    margin: 14px 0; min-height: 0;
    border: none; padding: 0;
}
.ad-slot.on {
    min-height: 90px; padding: 8px 0;
    border-top: 1px dashed var(--border);
    border-bottom: 1px dashed var(--border);
    text-align: center;
}
.ad-label {
    display: block; font-family: var(--mono);
    font-size: 0.58rem; color: var(--text-3);
    text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 4px;
}

/* ── Feedback box ──────────────────────────────────────────────── */
.hp-feedback-box {
    margin: 18px 0; padding: 18px 20px;
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.hp-feedback-box[hidden] { display: none; }
.hp-feedback-box h2 {
    font-family: var(--font-display); font-weight: 700;
    font-size: 1.2rem; color: var(--text-0); margin-bottom: 6px;
    letter-spacing: -0.01em;
}
.hp-feedback-box p {
    color: var(--text-1); font-size: 0.88rem; margin-bottom: 12px;
}
.hp-feedback-box textarea {
    width: 100%; min-height: 70px; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: var(--r-sm);
    background: var(--bg-0); color: var(--text-0);
    font-family: var(--font); font-size: 0.9rem; resize: vertical;
}
.hp-feedback-box textarea:focus { outline: none; border-color: var(--accent); }
.hp-feedback-box button {
    margin-top: 10px; padding: 8px 16px;
    background: var(--accent); color: #fff; border: none;
    border-radius: var(--r-sm); font-family: var(--font);
    font-weight: 600; font-size: 0.85rem; cursor: pointer;
}
.hp-feedback-box button:hover { background: var(--accent-ink); }

.thumbs-feedback {
    display: flex; align-items: center; gap: 8px;
    margin: 12px 0; padding: 8px 12px;
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--r-sm); font-size: 0.82rem; color: var(--text-1);
}
.thumbs-feedback button {
    background: none; border: 1px solid transparent;
    cursor: pointer; padding: 4px 8px; border-radius: var(--r-xs);
    font-size: 1rem; transition: all 0.12s;
}
.thumbs-feedback button:hover { background: var(--accent-soft); }

/* ── Footer ────────────────────────────────────────────────────── */
footer {
    margin-top: 40px; padding: 24px 0 100px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-2); font-size: 0.78rem; line-height: 1.65;
}
@media (min-width: 720px) { footer { padding-bottom: 32px; } }
footer a { color: var(--text-1); text-decoration: none;
            margin: 0 8px; transition: color 0.12s; }
footer a:hover { color: var(--accent); }

/* ── Toast ─────────────────────────────────────────────────────── */
.toast {
    position: fixed; top: 18px; left: 50%;
    transform: translateX(-50%) translateY(-12px);
    background: var(--text-0); color: var(--bg-1);
    padding: 9px 16px; border-radius: var(--r-sm);
    font-size: 0.84rem; opacity: 0; pointer-events: none;
    transition: opacity 0.2s, transform 0.2s; z-index: 200;
    box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Timer ─────────────────────────────────────────────────────── */
.timer {
    text-align: center; font-size: 0.78rem;
    color: var(--text-2); margin: 8px 0;
    font-family: var(--mono); font-variant-numeric: tabular-nums;
}

/* ── Shimmer / loading ─────────────────────────────────────────── */
.shimmer-card {
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 24px;
    overflow: hidden; position: relative;
}
.shimmer-card::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent,
                                 rgba(255,253,248,0.6), transparent);
    animation: shimmer 1.6s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); }
                       to   { transform: translateX(100%); } }

/* ── Home content (below the fold) ─────────────────────────────── */
.home-content { margin: 32px 0; }
.hc-section { margin-bottom: 36px; }
.hc-kicker {
    font-family: var(--mono); font-size: 0.66rem;
    color: var(--accent); text-transform: uppercase;
    letter-spacing: 1.6px; margin-bottom: 8px;
}
.hc-section > h2 {
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 1.8rem); line-height: 1.2;
    color: var(--text-0); margin-bottom: 10px;
    letter-spacing: -0.015em; text-wrap: balance;
}
.hc-section > p {
    color: var(--text-1); font-size: 0.95rem;
    line-height: 1.65; margin-bottom: 16px; max-width: 60ch;
}
.hc-grid {
    display: grid; grid-template-columns: 1fr; gap: 12px;
}
@media (min-width: 720px) {
    .hc-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}
.hc-card {
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 16px 18px;
}
.hc-card .num {
    font-family: var(--mono); font-size: 0.72rem;
    color: var(--accent); margin-bottom: 8px;
}
.hc-card h3 {
    font-family: var(--font-display); font-weight: 700;
    font-size: 1.05rem; color: var(--text-0); margin-bottom: 6px;
    letter-spacing: -0.01em;
}
.hc-card p { font-size: 0.86rem; color: var(--text-1); line-height: 1.55; }

.hc-categories-v2 {
    display: grid; grid-template-columns: 1fr; gap: 10px;
}
@media (min-width: 540px) {
    .hc-categories-v2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 720px) {
    .hc-categories-v2 { grid-template-columns: repeat(3, 1fr); }
}
.hc-cat-card {
    display: block; background: var(--bg-1);
    border: 1px solid var(--border);
    border-left: 3px solid var(--cat-color, var(--accent));
    border-radius: var(--r-sm); padding: 12px 14px;
    text-decoration: none; color: var(--text-0);
    transition: all 0.15s var(--ease-quick);
}
.hc-cat-card:hover {
    background: var(--bg-2); transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.hc-cat-card .cat-emoji { font-size: 1.3rem; }
.hc-cat-card .cat-name { display: inline-block; margin-left: 6px;
                          font-weight: 700; font-size: 0.95rem; }
.hc-cat-card .cat-desc { font-size: 0.8rem; color: var(--text-1);
                          margin-top: 4px; line-height: 1.4; }

.hc-popular-v2 {
    display: grid; grid-template-columns: 1fr; gap: 8px;
}
@media (min-width: 540px) {
    .hc-popular-v2 { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile bottom search bar (Sprint 19.29) ───────────────────── */
/* Default state — visible on mobile WITHOUT requiring JS init.
   This way if app.js fails to load, the user still has a search bar.
   JS opt-in to "top" can hide it via body[data-search-pos="top"]. */
.mobile-search {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bg-1);
    border-top: 2px solid var(--accent);   /* accent rail = high prominence */
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    z-index: 100;
    box-shadow: 0 -8px 24px rgba(31,26,20,0.12),
                0 -2px 6px  rgba(31,26,20,0.06);
    display: none;     /* desktop default */
}
.mobile-search-wrap { position: relative; }
.mobile-search input {
    width: 100%;
    padding: 14px 56px 14px 16px;
    font-family: var(--font); font-size: 16px;   /* 16px = no iOS zoom-on-focus */
    font-weight: 500;
    border: 1.5px solid var(--border-strong); border-radius: var(--r);
    background: var(--bg-0); color: var(--text-0);
    outline: none;
    box-shadow: inset 0 1px 2px rgba(31,26,20,0.04);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.mobile-search input::placeholder { color: var(--text-3); }
.mobile-search input:focus {
    border-color: var(--accent);
    box-shadow: inset 0 1px 2px rgba(31,26,20,0.04),
                0 0 0 4px var(--accent-glow);
}
.mobile-search-btn {
    position: absolute; right: 5px; top: 50%;
    transform: translateY(-50%);
    background: var(--accent); color: #fff;
    border: none; cursor: pointer;
    width: 44px; height: 44px; border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
    box-shadow: 0 2px 6px rgba(184,90,58,0.25);
}
.mobile-search-btn:hover, .mobile-search-btn:active {
    background: var(--accent-ink);
}
.mobile-search-btn svg { width: 18px; height: 18px; }

/* In-page toggle (↑/↓) — sits inside the mobile bar so it's always
   reachable even when the header is too crowded. */
.mobile-search-toggle {
    position: absolute; left: -2px; top: -28px;
    background: var(--bg-1); border: 1.5px solid var(--accent);
    border-bottom: none;
    border-radius: var(--r-sm) var(--r-sm) 0 0;
    color: var(--accent); cursor: pointer;
    height: 28px; padding: 0 12px;
    font-family: var(--font); font-size: 0.72rem; font-weight: 600;
    display: inline-flex; align-items: center; gap: 5px;
    text-transform: uppercase; letter-spacing: 0.6px;
}
.mobile-search-toggle:hover { background: var(--accent-soft); }
.mobile-search-toggle::before { content: '↑'; font-size: 0.95rem;
                                 line-height: 1; }

/* ── Mobile (≤719px): bottom search visible by default ─────────── */
@media (max-width: 719px) {
    .mobile-search { display: block; }
    body { padding-bottom: 96px; }   /* room for the fixed bar */
    /* When user explicitly toggles to TOP, hide the bottom bar
       and show the in-page search box instead. */
    body[data-search-pos="top"] .mobile-search { display: none; }
    body[data-search-pos="top"] { padding-bottom: 0; }
    body[data-search-pos="top"] .search-area { display: block; }
    body:not([data-search-pos="top"]) .search-area { display: none; }
}

/* ── Desktop (≥720px): in-page search at top by default ────────── */
@media (min-width: 720px) {
    .mobile-search { display: none !important; }
    body { padding-bottom: 0; }
    /* User can opt-in to bottom on desktop via toggle */
    body[data-search-pos="bottom"] .mobile-search { display: block !important; }
    body[data-search-pos="bottom"] { padding-bottom: 96px; }
    body[data-search-pos="bottom"] .search-area { display: none; }
}

/* ── Privacy banner co-existence ───────────────────────────────── */
/* The .privacy-banner has z-index:150 and is also fixed bottom:0.
   When it's visible, it overlaps the mobile-search (z-index:100) and
   blocks the user's view of the Accept button. JS adds .banner-on to
   <body> when the banner is up so we can lift the search above it
   without relying on :has() (broken in older mobile Safari). */
body.banner-on .mobile-search {
    bottom: 110px;          /* float above the banner */
    box-shadow: 0 -8px 24px rgba(31,26,20,0.16),
                0 -2px 6px  rgba(31,26,20,0.10);
}
@media (max-width: 600px) {
    /* Banner stacks vertically on small screens — much taller (≈170px
       once the buttons stack into a full-width row each). */
    body.banner-on .mobile-search { bottom: 188px; }
}
/* Reserve enough room below content so footer + banner + search
   don't jam together when ALL three are visible. */
body.banner-on { padding-bottom: 240px; }
@media (max-width: 600px) {
    body.banner-on { padding-bottom: 320px; }
}
/* Defensive z-index lift — make absolutely sure the search bar's
   shadow (which fades into the banner) doesn't appear to overlap
   tap-targets. The banner is z-index:150; sit the search at 140 so
   it's clearly behind, and the lifted bottom (above) puts it
   physically above the banner. */
.mobile-search { z-index: 140; }
/* Privacy banner itself — re-skin to match the warm paper editorial
   palette (legacy CSS used dark colours that clashed with the new
   theme). */
.privacy-banner {
    background: var(--bg-1) !important;
    border-top: 1px solid var(--border) !important;
    box-shadow: 0 -8px 24px rgba(31,26,20,0.10) !important;
}
.privacy-banner p { color: var(--text-1) !important; }
.privacy-banner a { color: var(--accent-ink) !important; }
.privacy-btn-primary {
    background: var(--accent) !important; color: #fff !important;
}
.privacy-btn-primary:hover { background: var(--accent-ink) !important; }
.privacy-btn-secondary {
    background: var(--bg-2) !important; color: var(--text-1) !important;
    border: 1px solid var(--border) !important;
}
.privacy-btn-secondary:hover {
    background: var(--bg-3) !important; border-color: var(--border-strong) !important;
}

/* ── Progressive reveal — collapsible sections (<details>) ─────── */
.reveal {
    margin: 14px 0; border: 1px solid var(--border);
    border-radius: var(--r-lg); background: var(--bg-1); overflow: hidden;
}
.reveal-summary {
    list-style: none; cursor: pointer; user-select: none;
    padding: 12px 16px; display: flex; align-items: center; gap: 10px;
    font-size: 0.88rem; color: var(--text-1); font-weight: 500;
    transition: background 0.12s;
}
.reveal-summary::-webkit-details-marker { display: none; }
.reveal-summary:hover { background: var(--bg-2); }
.reveal-summary .reveal-icon { font-size: 1rem; line-height: 1; }
.reveal-summary .reveal-count {
    font-family: var(--mono); font-size: 0.7rem;
    color: var(--text-2); background: var(--bg-2);
    padding: 2px 7px; border-radius: 999px; margin-left: auto;
}
.reveal-summary .reveal-chev {
    font-size: 0.75rem; color: var(--text-2);
    transition: transform 0.18s var(--ease-quick); margin-left: 8px;
}
.reveal[open] .reveal-chev { transform: rotate(180deg); }
.reveal-body { padding: 6px 16px 16px; border-top: 1px solid var(--border); }

/* Sprint 19.29 — feedback boxes ONLY after solve completes. The
   prior bug: "Was this helpful?" rendered during streaming. App.js
   sets body[data-state="solved"] in onSolveComplete; until then,
   any code that un-hides .hp-feedback-box / .thumbs-feedback is
   visually overridden by this rule. */
body:not([data-state="solved"]) .hp-feedback-box,
body:not([data-state="solved"]) .thumbs-feedback {
    display: none !important;
}

/* ─────────────────────────────────────────────────────────────────
 *  Distinctive editorial moments — Sprint 19.29
 *  These are the "screenshot-worthy" details. Removable as a unit
 *  if any of them feel too much.
 * ───────────────────────────────────────────────────────────────── */

/* 1) Drop cap on the first paragraph of every answer. Big serif
      first letter, terracotta, hangs into the gutter — lifts the
      answer immediately into "this was written" territory. */
.sol > p:first-child::first-letter,
#sol > p:first-of-type::first-letter,
.answer > p:first-child::first-letter {
    font-family: var(--font-display);
    font-weight: 700;
    float: left;
    font-size: 3.4em;
    line-height: 0.9;
    padding: 0.08em 0.12em 0 0;
    margin: 0.05em 0.06em 0 -0.04em;
    color: var(--accent);
    text-transform: none;
}
/* Skip the drop cap when the first paragraph starts with a strong
   tag (most "The most common cause is X" answers do). The drop-cap
   on a bold word looks broken. */
.sol > p:first-child:has(> strong:first-child)::first-letter {
    all: unset;
}

/* 2) Italic-serif lede — first line of the first paragraph reads
      with editorial weight. Use ::first-line which only applies to
      the visual first line (not first sentence). */
.sol > p:first-child::first-line,
#sol > p:first-of-type::first-line {
    font-style: italic;
    color: var(--text-0);
    font-weight: 600;
    letter-spacing: -0.005em;
}

/* 3) Kinetic underline on inline answer links — the underline grows
      from left as the user hovers. Subtle but unmistakable. */
.sol a {
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 1.5px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    text-decoration: none;
    text-decoration-color: transparent;
    transition: background-size 0.3s var(--ease);
}
.sol a:hover {
    background-size: 100% 1.5px;
    text-decoration: none;
}

/* 4) Terracotta scroll-progress rail at the very top of the
      viewport. Updates via CSS scroll-driven animations on browsers
      that support it; falls back gracefully. */
@supports (animation-timeline: scroll()) {
    body::before {
        content: '';
        position: fixed; top: 0; left: 0; height: 3px;
        width: 100%; transform-origin: left;
        background: var(--accent);
        z-index: 999; pointer-events: none;
        animation: scrollProgress linear;
        animation-timeline: scroll(root);
    }
    @keyframes scrollProgress {
        from { transform: scaleX(0); }
        to   { transform: scaleX(1); }
    }
}

/* 5) Editorial figure caption style for any image embed. */
.sol figure { margin: 1.2em 0; }
.sol figure img { border-radius: var(--r-sm); display: block; }
.sol figure figcaption {
    margin-top: 6px;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 0.86em;
    color: var(--text-2);
    text-align: center;
    line-height: 1.4;
}

/* 6) Pull-quote treatment for blockquotes — the blockquote gets an
      oversized opening curly-quote glyph in terracotta sitting in
      the gutter. */
.sol blockquote {
    position: relative; padding-left: 32px;
    border-left: none; background: transparent;
    font-family: var(--font-display);
    font-size: 1.1rem; line-height: 1.5;
    color: var(--text-0);
    margin: 1.4em 0;
}
.sol blockquote::before {
    content: '\201C';   /* left double quote */
    position: absolute;
    left: -2px; top: -10px;
    font-family: var(--font-display);
    font-size: 3rem; font-weight: 700;
    color: var(--accent); line-height: 1;
    pointer-events: none;
}

/* 7) Section divider — three centered dots in serif separating
      major sections of long answers. */
.sol hr {
    border: none;
    height: 1.4em; margin: 1.8em 0;
    background: none;
    text-align: center;
    overflow: visible;
}
.sol hr::before {
    content: '\b7  \b7  \b7';   /* middle dots */
    font-family: var(--font-display);
    font-size: 1.4rem; color: var(--accent);
    letter-spacing: 0.3em;
    line-height: 1;
}

/* 8) Brand mark micro-flourish — pyflo logo in mono with the
      'flo' italic-serif accent on hover. */
.logo {
    transition: letter-spacing 0.3s var(--ease);
}
.logo:hover { letter-spacing: -0.1px; }
.logo b {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: 1.1em;
    letter-spacing: -0.5px;
    color: var(--accent);
    margin-left: -1px;
}

/* 9) Hero h1 — italic serif accent for the second line, tight
      tracking, balanced wrap. The "Get the fix." gets the editorial
      flourish so first-paint says "this is a publication, not a
      tool". */
.hero h1 .grad,
.hero h1 .gradient {
    font-style: italic;
    font-weight: 600;
    color: var(--accent);
    background: none;
    -webkit-text-fill-color: var(--accent);
    letter-spacing: -0.025em;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.04em;
}

/* 10) Solve button micro-interaction — accent ring on focus, slight
      letter-spacing tighten on click for tactile feedback. */
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--accent-glow);
}
.btn:active { letter-spacing: -0.5px; }

/* ── Animations ────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Reduced motion ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Print ─────────────────────────────────────────────────────── */
@media print {
    .glow, header, footer, .ad-slot, .mobile-search,
    .share-bar, .refine-chips, .continue-box, .pills,
    .recent-section, .return-hero { display: none !important; }
    body { background: white; color: black; }
    .card { border: 1px solid #ccc; box-shadow: none; }
}

/* ── Inline video cards (YouTube / Vimeo / TikTok) ─────────────────
   inline_video_enricher + sources/vimeo + sources/tiktok render cards
   with inline style="..." attributes baked into cached HTML. Pre-
   Sprint-19.32 cards used a dark palette (#12121a bg, #2e2e3e border,
   #ff0033 accent) that clashes with the warm editorial surface. New
   solves now write the warm palette directly; this override layer
   rewrites EXISTING cached cards in place. !important is needed
   because inline styles outrank class selectors. Play-button colors
   stay platform-branded for instant recognition. */
.inline-video-suggest,
.inline-video-search,
.enrich-vimeo,
.enrich-tiktok {
    background: var(--card-bg, #fffdf8) !important;
    border: 1px solid var(--border, #e2dac7) !important;
    border-left: 3px solid var(--accent, #b85a3a) !important;
    color: var(--fg, #1f1a14) !important;
}
.inline-video-suggest > div:first-child,
.inline-video-search > div:first-child,
.enrich-vimeo > div:first-child,
.enrich-tiktok > div:first-child {
    color: var(--muted, #847865) !important;
}
.yt-card > div,
.vimeo-card > div,
.tiktok-card > div {
    color: var(--fg, #1f1a14) !important;
}
.yt-card > div + div,
.vimeo-card > div + div,
.tiktok-card > div + div {
    color: var(--muted, #847865) !important;
}
.enrich-tiktok a {
    color: var(--accent, #b85a3a) !important;
}
.inline-video-search a {
    background: rgba(184, 90, 58, 0.08) !important;
    border-color: rgba(184, 90, 58, 0.3) !important;
    color: var(--fg, #1f1a14) !important;
}
.inline-video-search a > span:last-child {
    color: var(--accent, #b85a3a) !important;
}
.yt-chapter-list {
    background: rgba(0, 0, 0, 0.04) !important;
}
.yt-chapter-list > div:first-child,
.yt-chapter-row > span:first-child {
    color: var(--muted, #847865) !important;
}
.yt-chapter-row > span:last-child,
.yt-chapter-row {
    color: var(--fg, #1f1a14) !important;
}
.yt-chapter-row .ch-aligned {
    color: var(--accent, #b85a3a) !important;
}
.ch-jump {
    background: rgba(184, 90, 58, 0.10) !important;
    color: var(--accent, #b85a3a) !important;
    border-color: rgba(184, 90, 58, 0.3) !important;
}
