/* Kernalite "joyful" site theme — shared by every page on kernalite.com.
 *
 * Dark slate ground (#0d1117), emerald brand (#10b981), and a cast of four
 * chibi guides (assets/chibi/*.svg) who introduce sections instead of
 * marketing headings doing all the work. Replaces the neo-brutalist layer
 * (assets/brutalist.css, kept as a one-line @import shim so pages published
 * before the switch keep resolving).
 *
 * Two contracts this file keeps so older per-page <style> blocks survive:
 *   1. The legacy custom-property names (--cream, --ink, --yellow, --pink,
 *      --cyan, --line, --hard-shadow, --bg-*, --text-*) are redefined here
 *      with joyful values. A page that says `background: var(--cream)` gets
 *      the slate ground; `var(--yellow)` is now the emerald accent.
 *   2. The class names the chrome injector (assets/joyful-chrome.js) and the
 *      shared components use (.bt-*, .site-card, .site-cta, .glass, .display)
 *      are unchanged.
 *
 * Chibi components (.chibi-stage, .speech-bubble, .feature-chibi-badge,
 * .kl-guide) live at the bottom. Zero framework, zero build step.
 */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@500;700;800;900&family=Fira+Code:wght@400;600&display=swap');

:root {
    color-scheme: dark;

    /* Ground + surfaces */
    --bg-deep: #010409;
    --bg-primary: #0d1117;
    --bg-surface: #161b22;
    --bg-surface-elevated: #21262d;
    --border-color: #30363d;
    --border-strong: #484f58;

    /* Brand */
    --brand-green: #10b981;
    --brand-green-hover: #059669;
    --brand-green-soft: rgba(16, 185, 129, .12);
    --brand-green-line: rgba(16, 185, 129, .38);
    --brand-green-glow: 0 6px 20px rgba(16, 185, 129, .28);
    --green-text: #a7f3d0;
    --rose-text: #fecdd3;
    --bg-glass: rgba(13, 17, 23, .86);
    --hero-dots: 1;

    /* Joyful accents — one per guide, so the cast is not four green people */
    --amber: #f59e0b;
    --sky: #38bdf8;
    --rose: #fb7185;
    --violet: #a78bfa;
    --green-ink: #10b981;
    --sky-ink: #38bdf8;
    --amber-ink: #f59e0b;
    --rose-ink: #fb7185;
    --violet-ink: #a78bfa;
    --on-accent: #052e22;
    --on-green: #052e22;

    /* Type */
    --text-main: #f0f6fc;
    --text-soft: #c9d1d9;
    --text-muted: #8b949e;
    --font-sans: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* Shape */
    --r: 10px;
    --r-lg: 16px;
    --r-pill: 999px;
    --line: 1px solid var(--border-color);
    --shadow-card: 0 8px 24px rgba(1, 4, 9, .45);
    --shadow-pop: 0 18px 44px rgba(1, 4, 9, .55);

    /* ---- Legacy names (older per-page styles read these) ---- */
    --cream: var(--bg-primary);
    --ink: var(--text-main);
    --yellow: var(--brand-green);
    --pink: var(--rose);
    --cyan: var(--sky);
    --hard-shadow: var(--shadow-card);
    --shadow: var(--shadow-card);
    --shadow-lg: var(--shadow-pop);
    --primary: var(--green-ink);
    --secondary: var(--rose);
    --accent: var(--brand-green);
    --on-primary: #ffffff;
    --bg: var(--bg-primary);
    --bg-page: var(--bg-primary);
    --bg-section: var(--bg-primary);
    --bg-elev: var(--bg-surface);
    --bg-panel: var(--bg-surface);
    --bg-panel-solid: var(--bg-surface);
    --panel: var(--bg-surface);
    --text: var(--text-main);
    --text-dim: var(--text-soft);
    --text-mute: var(--text-muted);
    --dim: var(--text-soft);
    --border: var(--border-color);
    --grad-cyber: var(--brand-green);
    --hero-radius: var(--r-lg);
}


/* ---- Light form ----
 * Dark is the brand's home; light follows the pale teal of the illustration
 * set. Three states: an explicit data-theme wins, otherwise the OS decides.
 * Only tokens change here — every component reads through them. */
:root[data-theme="light"] {
    color-scheme: light;
    --bg-deep: #e6f2ed;
    --bg-primary: #f4faf8;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #eaf4f0;
    --border-color: #d2e3dc;
    --border-strong: #aec7bc;
    --brand-green-hover: #059669;
    --brand-green-soft: rgba(16, 185, 129, .14);
    --brand-green-line: rgba(5, 150, 105, .45);
    --brand-green-glow: 0 6px 18px rgba(16, 185, 129, .3);
    --green-text: #065f46;
    --rose-text: #9f1239;
    --amber: #b45309;
    --sky: #0284c7;
    --rose: #e11d48;
    --violet: #7c3aed;
    --green-ink: #047857;
    --sky-ink: #0369a1;
    --amber-ink: #b45309;
    --rose-ink: #be123c;
    --violet-ink: #6d28d9;
    --on-accent: #ffffff;
    --text-main: #0f1b17;
    --text-soft: #2f3f39;
    --text-muted: #5b6d66;
    --shadow-card: 0 8px 24px rgba(15, 27, 23, .09);
    --shadow-pop: 0 18px 44px rgba(15, 27, 23, .14);
    --bg-glass: rgba(244, 250, 248, .88);
    --hero-dots: .7;
}
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        color-scheme: light;
        --bg-deep: #e6f2ed;
        --bg-primary: #f4faf8;
        --bg-surface: #ffffff;
        --bg-surface-elevated: #eaf4f0;
        --border-color: #d2e3dc;
        --border-strong: #aec7bc;
        --brand-green-hover: #059669;
        --brand-green-soft: rgba(16, 185, 129, .14);
        --brand-green-line: rgba(5, 150, 105, .45);
        --brand-green-glow: 0 6px 18px rgba(16, 185, 129, .3);
        --green-text: #065f46;
        --rose-text: #9f1239;
        --amber: #b45309;
        --sky: #0284c7;
        --rose: #e11d48;
        --violet: #7c3aed;
        --green-ink: #047857;
        --sky-ink: #0369a1;
        --amber-ink: #b45309;
        --rose-ink: #be123c;
        --violet-ink: #6d28d9;
        --on-accent: #ffffff;
    --green-ink: #047857;
    --sky-ink: #0369a1;
    --amber-ink: #b45309;
    --rose-ink: #be123c;
    --violet-ink: #6d28d9;
    --on-accent: #ffffff;
        --text-main: #0f1b17;
        --text-soft: #2f3f39;
        --text-muted: #5b6d66;
        --shadow-card: 0 8px 24px rgba(15, 27, 23, .09);
        --shadow-pop: 0 18px 44px rgba(15, 27, 23, .14);
        --bg-glass: rgba(244, 250, 248, .88);
        --hero-dots: .7;
    }
}

/* ---- Base ---- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
/* Tailwind pages put .font-sans (Inter) on <body> — win that fight. */
.font-sans { font-family: var(--font-sans) !important; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
img { display: block; }
::selection { background: var(--brand-green); color: #052e22; }
.tag[style*="background"] { color: #052e22 !important; }
hr { border: 0; border-top: 1px solid var(--border-color); }
code, kbd, pre { font-family: var(--font-mono); }

.display, .site-brand-font {
    font-family: var(--font-sans);
    font-weight: 900;
    text-transform: none;
    line-height: 1.08;
    letter-spacing: -0.03em;
}
.wrap { max-width: 1160px; margin-inline: auto; padding-inline: clamp(18px, 4vw, 36px); }
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-no-top { padding-top: 0; }
.section-no-bottom { padding-bottom: 0; }
.h2 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); }
.sub { color: var(--text-muted); font-size: 1.1rem; }
.mono { font-family: var(--font-mono); }
.hero-glow { display: none !important; }

/* ---- Utility compat (used across pages, used to come from site.css) ---- */
.text-default { color: var(--text-main) !important; }
.text-dim { color: var(--text-soft) !important; }
.text-mute { color: var(--text-muted) !important; }
.bg-section { background: transparent !important; }
.text-gradient {
    background: linear-gradient(90deg, var(--brand-green), var(--sky));
    -webkit-background-clip: text; background-clip: text;
    color: transparent; -webkit-text-fill-color: transparent;
    padding: 0;
}

/* ---- Buttons & chips ---- */
.btn, .btn-primary, .btn-secondary, .site-cta, .chip, .bt-chip {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    border: 1px solid transparent; border-radius: var(--r);
    font-family: inherit; font-weight: 800; line-height: 1.2;
    text-decoration: none; cursor: pointer;
    transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.btn, .btn-primary, .btn-secondary, .site-cta { padding: .85rem 1.4rem; font-size: 1rem; }
.chip, .bt-chip { padding: .4rem .9rem; font-size: .85rem; font-weight: 700; }

.btn-primary, .btn.yellow, .site-cta, .bt-buy, .chip.buy {
    background: var(--brand-green) !important;
    color: var(--on-green) !important;
    border-color: rgba(255, 255, 255, .12) !important;
    box-shadow: var(--brand-green-glow);
}
.btn-primary:hover, .btn.yellow:hover, .site-cta:hover, .bt-buy:hover, .chip.buy:hover {
    background: var(--brand-green-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(16, 185, 129, .36);
}
.btn, .btn-secondary, .chip, .bt-chip {
    background: var(--bg-surface-elevated);
    color: var(--text-main);
    border-color: var(--border-color);
}
.btn:hover, .btn-secondary:hover, a.chip:hover, a.bt-chip:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}
.btn:active, .btn-primary:active, .btn-secondary:active, .site-cta:active { transform: translateY(0); }
.btn-text { display: block; margin-top: .6rem; font-size: .9rem; font-weight: 700; color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; }
.btn-text:hover { color: var(--text-main); }

:where(a, button, summary, input, textarea, select):focus-visible {
    outline: 3px solid var(--brand-green); outline-offset: 3px;
}

/* ---- Tags ---- */
.tag, .hero-tag {
    display: inline-block;
    font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
    letter-spacing: .04em; text-transform: uppercase;
    color: var(--green-ink); background: var(--brand-green-soft);
    border: 1px solid var(--brand-green-line);
    padding: .2rem .6rem; border-radius: var(--r-pill);
}
/* Older pages paint a tag with an inline accent background (the brutalist
   yellow/cyan/pink chips). Emerald-on-emerald would be invisible, so a tag
   that brings its own fill gets dark text instead. */
.tag[style*="background"] { color: #052e22 !important; border-color: transparent; }
.tag.t-p, .tag.rose   { color: var(--rose-ink);   background: rgba(251, 113, 133, .12); border-color: rgba(251, 113, 133, .4); }
.tag.t-c, .tag.sky    { color: var(--sky-ink);    background: rgba(56, 189, 248, .12);  border-color: rgba(56, 189, 248, .4); }
.tag.t-a, .tag.amber  { color: var(--amber-ink);  background: rgba(245, 158, 11, .12);  border-color: rgba(245, 158, 11, .4); }
.tag.t-v, .tag.violet { color: var(--violet-ink); background: rgba(167, 139, 250, .12); border-color: rgba(167, 139, 250, .4); }

/* ---- Cards ---- */
.card, .site-card, .glass, .feature-card, .panel {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
    backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover, .site-card:hover, .feature-card:hover {
    transform: translateY(-3px);
    border-color: var(--brand-green-line) !important;
    box-shadow: var(--shadow-pop);
}
.site-card h3 { color: var(--text-main); font-weight: 800; font-size: 1.12rem; margin-bottom: .4rem; }
.site-card p { color: var(--text-muted); font-size: .95rem; line-height: 1.55; }
.site-card-icon {
    width: 3rem; height: 3rem;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--brand-green-line); border-radius: .8rem;
    background: var(--brand-green-soft); color: var(--green-ink);
    font-size: 1.2rem; margin-bottom: 1.1rem;
}
.site-card:nth-child(3n+2) .site-card-icon { background: rgba(56, 189, 248, .12); border-color: rgba(56, 189, 248, .4); color: var(--sky-ink); }
.site-card:nth-child(3n) .site-card-icon   { background: rgba(251, 113, 133, .12); border-color: rgba(251, 113, 133, .4); color: var(--rose-ink); }

.site-version-pill {
    display: inline-flex; align-items: center; gap: .5em;
    border: 1px solid var(--brand-green-line); border-radius: var(--r-pill);
    background: var(--brand-green-soft) !important; color: var(--green-ink) !important;
    padding: .35rem .9rem; font-weight: 700; font-size: .85rem; font-family: var(--font-mono);
}
.site-version-dot { width: .6em; height: .6em; border-radius: 50%; background: var(--brand-green); box-shadow: 0 0 0 4px var(--brand-green-soft); }

/* ---- Forms ---- */
.field, input.field, textarea.field, select.field {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color); border-radius: var(--r);
    color: var(--text-main);
    padding: .8rem 1rem;
    font: inherit; font-size: 1rem;
}
.field::placeholder { color: var(--text-muted); opacity: 1; }
.field:focus { outline: none; border-color: var(--green-ink); box-shadow: 0 0 0 4px var(--brand-green-soft); }

/* ---- Chrome (markup injected by joyful-chrome.js) ---- */
.site-header {
    position: sticky; top: 0; z-index: 60;
    background: var(--bg-glass);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}
.bt-theme {
    width: 36px; height: 36px; padding: 0; border-radius: 50%;
    display: inline-grid; place-items: center;
    background: var(--bg-surface-elevated); border: 1px solid var(--border-color); color: var(--text-muted);
    cursor: pointer; margin-left: 4px;
}
.bt-theme:hover { color: var(--text-main); border-color: var(--border-strong); }
.bt-theme svg { width: 18px; height: 18px; }
.bt-theme .sun { display: none; }
:root[data-theme="light"] .bt-theme .sun { display: block; }
:root[data-theme="light"] .bt-theme .moon { display: none; }
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .bt-theme .sun { display: block; }
    :root:not([data-theme="dark"]) .bt-theme .moon { display: none; }
}
.bt-hdr-in {
    max-width: 1160px; margin-inline: auto;
    padding: 12px clamp(18px, 4vw, 36px);
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
}
.bt-mark, .bt-mark:hover {
    background: none; border-color: transparent; box-shadow: none; transform: none;
    font-weight: 900; font-size: 1.2rem; letter-spacing: -0.03em;
    padding: .2rem .2rem; color: var(--text-main);
}
.bt-mark .bt-slash { color: var(--green-ink); font-family: var(--font-mono); font-weight: 700; }
.bt-logo { width: 26px; height: 26px; flex: none; display: block; border-radius: 7px; }
.bt-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; align-items: center; }
.bt-nav .bt-sub { background: none; border-color: transparent; color: var(--text-muted); }
.bt-nav .bt-sub:hover { color: var(--text-main); background: var(--bg-surface-elevated); border-color: var(--border-color); transform: none; }
.bt-chip.is-here { color: var(--green-ink) !important; background: var(--brand-green-soft) !important; border-color: var(--brand-green-line) !important; }
.bt-login { margin-left: 6px; }

.bt-foot { border-top: 1px solid var(--border-color); background: var(--bg-deep); }
.bt-foot-in {
    max-width: 1160px; margin-inline: auto;
    padding: clamp(1.8rem, 4vw, 2.5rem) clamp(18px, 4vw, 36px);
    display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px;
    color: var(--text-muted); font-size: .9rem;
}
.bt-foot-in nav { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.bt-foot-in .bt-chip { font-size: .78rem; padding: .3rem .6rem; background: none; border-color: transparent; color: var(--text-muted); }
.bt-foot-in .bt-chip:hover { color: var(--text-main); border-color: var(--border-color); transform: none; }
.bt-foot-guide {
    flex-basis: 100%;
    display: flex; align-items: center; gap: 12px;
    padding-top: 1rem; border-top: 1px dashed var(--border-color);
}
.bt-foot-guide img { width: 44px; height: 44px; border-radius: 50%; background: var(--bg-surface-elevated); border: 1px solid var(--border-color); }
.bt-foot-guide a { color: var(--green-ink); font-weight: 800; }
.bt-foot-guide a:hover { text-decoration: underline; }
.bt-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; order: 3; }
.bt-burger { display: none; }
.bt-nav { order: 2; }
/* Small screens: the page links fold behind the menu button. The header is
   a normal-flow block, so the open list pushes the page down rather than
   floating over it — nothing to mis-stack, nothing to trap focus in. */
@media (max-width: 720px) {
    .bt-hdr-in { gap: 8px 10px; }
    /* Tools stay on the brand row; the list wraps underneath (order 2). */
    .bt-tools { margin-left: auto; order: 1; }
    .bt-burger {
        display: inline-flex; align-items: center; justify-content: center;
        width: 40px; height: 40px; padding: 0; border-radius: 10px; cursor: pointer;
        background: var(--bg-surface); border: 1px solid var(--border-color); color: var(--text-main);
    }
    .bt-burger svg { width: 22px; height: 22px; }
    .bt-burger .l1, .bt-burger .l2, .bt-burger .l3 { transition: transform .2s ease, opacity .2s ease; transform-origin: 12px 12px; }
    .site-header.is-open .bt-burger .l1 { transform: translateY(5px) rotate(45deg); }
    .site-header.is-open .bt-burger .l2 { opacity: 0; }
    .site-header.is-open .bt-burger .l3 { transform: translateY(-5px) rotate(-45deg); }
    .bt-nav {
        display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 4px;
        margin: 4px 0 6px; padding-top: 10px; border-top: 1px dashed var(--border-color);
    }
    .site-header.is-open .bt-nav { display: flex; }
    .bt-nav .bt-chip { justify-content: flex-start; font-size: 1rem; padding: .7rem .9rem; }
    .bt-nav .bt-sub { color: var(--text-main); }
    .bt-nav .bt-login { margin-left: 0; }
}

/* Wide tables (comparison grids) scroll inside their own box on a phone.
   Without this the page width stays 390px and the right-hand columns are
   simply cut off — no scrollbar, no hint they exist. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.table-scroll table { min-width: 560px; }

/* ---- University subscribe box ----
   One form, three places (library, archive, every article). joyful-chrome.js
   posts it to api/university_subscribe.php and writes the reply into
   .kl-subscribe-status, so the markup carries no script of its own. */
.kl-subscribe {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px;
    padding: 1.2rem 1.4rem; margin: 2rem 0;
    background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 14px; box-shadow: var(--shadow-card);
}
.kl-subscribe img { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--border-color); background: var(--bg-surface-elevated); flex: none; }
.kl-subscribe .kl-subscribe-copy { flex: 1 1 220px; min-width: 0; }
.kl-subscribe .kl-subscribe-copy strong { display: block; font-family: var(--font-sans); font-weight: 900; font-size: 1rem; color: var(--text-main); }
.kl-subscribe .kl-subscribe-copy span { display: block; color: var(--text-muted); font-size: .88rem; margin-top: 2px; }
.kl-subscribe input[type="email"] {
    flex: 1 1 200px; min-width: 0; font: inherit; padding: .7rem .9rem;
    border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-primary); color: var(--text-main);
}
.kl-subscribe input[type="email"]::placeholder { color: var(--text-dim); opacity: 1; }
.kl-subscribe .kl-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.kl-subscribe-status { flex-basis: 100%; font-weight: 700; font-size: .9rem; }
.kl-subscribe-status.ok { color: var(--green-text); }
.kl-subscribe-status.err { color: var(--rose-text); }

/* ---- Chibi guide components ---- */
.chibi-stage {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 1.5rem;
    background: radial-gradient(circle at center, var(--brand-green-soft) 0%, rgba(13, 17, 23, 0) 70%);
}
.chibi-wrapper { position: relative; display: inline-block; }
.chibi-img {
    width: 240px; height: auto; display: block;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .45));
    animation: kl-float 5s ease-in-out infinite;
}
.chibi-img.sm { width: 140px; }
.chibi-img.lg { width: 300px; }
@keyframes kl-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes kl-pop {
    from { opacity: 0; transform: scale(.85) translateY(6px); }
    to { opacity: 1; transform: none; }
}

.speech-bubble {
    position: absolute; top: -30px; right: -30px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: .75rem 1rem; border-radius: 12px;
    font-size: .85rem; line-height: 1.45; color: var(--text-main);
    max-width: 230px;
    box-shadow: var(--shadow-card);
    animation: kl-pop .5s cubic-bezier(.2, .9, .3, 1.4) backwards;
}
.speech-bubble::after {
    content: ""; position: absolute; bottom: -8px; left: 24px;
    border-width: 8px 8px 0; border-style: solid;
    border-color: var(--bg-surface-elevated) transparent;
    display: block; width: 0;
}
.speech-bubble.left { right: auto; left: -30px; }
.speech-bubble.left::after { left: auto; right: 24px; }
.speech-speaker {
    font-family: var(--font-mono); font-weight: 700; font-size: .68rem;
    color: var(--green-ink); text-transform: uppercase; letter-spacing: .06em;
    margin-bottom: .2rem;
}
.speech-speaker.amber { color: var(--amber-ink); }
.speech-speaker.sky { color: var(--sky-ink); }
.speech-speaker.rose { color: var(--rose-ink); }
.speech-speaker.violet { color: var(--violet-ink); }

.feature-chibi-badge {
    width: 52px; height: 52px; flex-shrink: 0;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.feature-chibi-badge img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* A guide introduces a section: avatar beside a bubble. Add .right to flip. */
.kl-guide { display: flex; align-items: flex-start; gap: 14px; margin: 1.5rem 0; max-width: 640px; }
.kl-guide img {
    width: 64px; height: 64px; flex: none; border-radius: 50%;
    background: var(--bg-surface-elevated); border: 1px solid var(--border-color);
    object-fit: cover;
}
.kl-guide-bubble {
    position: relative;
    background: var(--bg-surface-elevated); border: 1px solid var(--border-color);
    border-radius: 12px; padding: .75rem 1rem;
    font-size: .95rem; line-height: 1.5; color: var(--text-soft);
    box-shadow: var(--shadow-card);
}
.kl-guide-bubble::after {
    content: ""; position: absolute; left: -8px; top: 22px;
    border-width: 8px 8px 8px 0; border-style: solid;
    border-color: transparent var(--bg-surface-elevated) transparent transparent;
}
.kl-guide-bubble .speech-speaker { margin-bottom: .15rem; }
.kl-guide-bubble strong { color: var(--text-main); }
.kl-guide.right { flex-direction: row-reverse; margin-left: auto; }
.kl-guide.right .kl-guide-bubble::after {
    left: auto; right: -8px;
    border-width: 8px 0 8px 8px;
    border-color: transparent transparent transparent var(--bg-surface-elevated);
}

@media (max-width: 860px) {
    .speech-bubble, .speech-bubble.left { position: static; margin-top: 1rem; max-width: 100%; }
    .speech-bubble::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .chibi-img, .speech-bubble { animation: none; }
    * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---- Shared page components (pricing, security, about, switching guides) ---- */
.page-hero { padding-top: clamp(2.2rem, 5vw, 3.5rem); padding-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.page-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); max-width: 18ch; margin: .8rem 0 0; text-wrap: balance; }
.page-hero .lead { margin-top: 1rem; max-width: 60ch; font-size: 1.1rem; color: var(--text-soft); }
.page-hero .kl-guide { margin-top: 1.4rem; }
.faq { max-width: 780px; margin: clamp(1.6rem, 4vw, 2.4rem) 0 0; display: grid; gap: 12px; }
.faq details { border: 1px solid var(--border-color); border-radius: var(--r-lg); background: var(--bg-surface); transition: border-color .15s ease; }
.faq details[open] { border-color: var(--brand-green-line); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 1rem 1.2rem; font-weight: 800; font-size: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .plus { flex: none; color: var(--green-ink); font-weight: 900; transition: transform .2s ease; }
.faq details[open] summary .plus { transform: rotate(45deg); }
.faq .ans { padding: 0 1.2rem 1.1rem; font-size: .97rem; color: var(--text-soft); margin: 0; }
.faq .ans a { color: var(--green-ink); text-decoration: underline; text-underline-offset: 3px; }
.switch-grid { display: grid; grid-template-columns: 1fr; gap: 1.6rem; align-items: start; }
@media (min-width: 900px) { .switch-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr); } }
.steps { margin: 1.2rem 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: .9rem; max-width: 64ch; }
/* The number is absolutely placed so the <strong> lead-in and the sentence
   after it stay in one text flow — as flex items they became two narrow
   columns and a three-word lead-in wrapped onto three lines. */
.steps li { counter-increment: step; position: relative; padding-left: 44px; font-size: 1rem; line-height: 1.55; color: var(--text-soft); }
.steps li::before { content: counter(step); position: absolute; left: 0; top: .1rem; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-green); color: var(--on-green); font-weight: 900; font-size: .85rem; }
.steps strong { color: var(--text-main); }
.steps em { font-style: normal; font-family: var(--font-mono); font-size: .88em; color: var(--green-ink); }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; font-size: .93rem; color: var(--text-soft); }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list li::before { flex: none; font-weight: 900; width: 1.2em; }
.check-list .yes::before { content: "✓"; color: var(--green-ink); }
.check-list .no::before { content: "–"; color: var(--text-muted); }
.shots { margin-top: clamp(1.6rem, 4vw, 2.4rem); display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.shot-card { border: 1px solid var(--border-color); border-radius: var(--r-lg); background: var(--bg-surface); overflow: hidden; box-shadow: var(--shadow-card); }
.shot-card .bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-bottom: 1px solid var(--border-color); font-size: .78rem; font-weight: 800; color: var(--text-muted); }
.shot-card .bar i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.shot-card .bar span { margin-left: 6px; }
.shot-card img { display: block; width: 100%; height: auto; }
.shot-card p { margin: 0; padding: .8rem 1rem; font-size: .9rem; color: var(--text-muted); border-top: 1px solid var(--border-color); }
.shot-card p b { color: var(--text-main); }
.team-note { margin-top: 1.6rem; padding: 1.4rem 1.6rem; display: grid; gap: .6rem; max-width: 70ch; }
.team-note h3 { margin: 0; font-size: 1.05rem; font-weight: 900; }
.team-note p { margin: 0; color: var(--text-soft); font-size: .97rem; }
.team-note .sig { font-family: var(--font-mono); font-size: .75rem; color: var(--text-muted); }

/* Screens that follow the theme: each card carries a dark and a light
   capture; the theme decides which one shows. .shot-swap reverses it, for
   the card that deliberately shows the other form. */
.shot-card .shot-light { display: none; }
:root[data-theme="light"] .shot-card .shot-light { display: block; }
:root[data-theme="light"] .shot-card .shot-dark { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .shot-card .shot-light { display: block; }
  :root:not([data-theme="dark"]) .shot-card .shot-dark { display: none; }
}
.shot-card.shot-swap .shot-light { display: block; }
.shot-card.shot-swap .shot-dark { display: none; }
:root[data-theme="light"] .shot-card.shot-swap .shot-light { display: none; }
:root[data-theme="light"] .shot-card.shot-swap .shot-dark { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .shot-card.shot-swap .shot-light { display: none; }
  :root:not([data-theme="dark"]) .shot-card.shot-swap .shot-dark { display: block; }
}
