:root {
    --bg: #050505;
    --panel: rgba(10, 14, 16, 0.88);
    --cyan: #18ffff;
    --pink: #ff4081;
    --green: #00ff41;
    --text: #f3f3f3;
    --muted: #a7a7a7;
    --line: rgba(24, 255, 255, 0.22);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: "Kanit", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        linear-gradient(rgba(5,5,5,.94), rgba(5,5,5,.94)),
        repeating-linear-gradient(0deg, transparent 0 31px, rgba(24,255,255,.035) 32px),
        repeating-linear-gradient(90deg, transparent 0 31px, rgba(24,255,255,.025) 32px),
        var(--bg);
    line-height: 1.75;
}
a { color: var(--cyan); }
a:hover { color: #fff; }
.seo-shell { width: min(980px, calc(100% - 32px)); margin: 0 auto; }
.seo-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: rgba(0,0,0,.88);
    backdrop-filter: blur(12px);
}
.seo-topbar-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.seo-brand {
    font-family: "Orbitron", system-ui, sans-serif;
    font-weight: 900;
    letter-spacing: 1.8px;
    font-size: 22px;
    text-decoration: none;
    color: #fff;
    text-shadow: 0 0 12px var(--cyan);
}
.seo-nav { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.seo-nav a { color: #cfcfcf; text-decoration: none; font-size: 14px; }
.seo-nav a:hover { color: var(--cyan); }
.seo-hero { padding: 74px 0 34px; }
.seo-kicker {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--green);
    font-family: "Courier Prime", monospace;
    font-weight: 700;
    letter-spacing: .5px;
}
h1, h2, h3 { line-height: 1.35; }
h1 {
    margin: 0 0 18px;
    max-width: 860px;
    font-family: "Orbitron", "Kanit", sans-serif;
    font-size: clamp(34px, 6vw, 62px);
    letter-spacing: .4px;
}
h1 strong { color: var(--cyan); }
.seo-lead { max-width: 820px; margin: 0; color: #d6d6d6; font-size: 18px; }
.seo-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.seo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--cyan);
    color: #000;
    background: var(--cyan);
    font-weight: 700;
    text-decoration: none;
}
.seo-btn.secondary { background: transparent; color: var(--cyan); }
.seo-section { padding: 30px 0; }
.seo-card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: inset 0 0 30px rgba(24,255,255,.025);
}
/* GENX SEO UI PATCH — V4 FRAME SEPARATION
   Standalone framed sections keep their cyan frame, while direct two-column
   grids get non-collapsing breathing room above/below so borders never touch. */
.seo-card + .seo-card { margin-top: 28px; }
.seo-card + .seo-grid,
.seo-grid + .seo-card { margin-top: 0; }
.seo-section > .seo-shell > .seo-grid {
    padding-block: 30px;
    column-gap: 28px;
    row-gap: 28px;
}
.seo-section > .seo-shell > .seo-grid > .seo-card {
    min-width: 0;
}
.seo-card h2 { margin: 0 0 12px; color: var(--cyan); font-size: 26px; }
.seo-card h3 { margin: 22px 0 8px; color: var(--pink); font-size: 19px; }
.seo-card p { margin: 0 0 14px; color: #d4d4d4; }
.seo-card ul, .seo-card ol { margin: 10px 0 14px; padding-left: 24px; color: #d4d4d4; }
.seo-card li { margin: 7px 0; }
.seo-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 24px; }
.seo-code {
    margin: 14px 0;
    padding: 14px 16px;
    overflow-x: auto;
    border-left: 3px solid var(--cyan);
    background: #020505;
    color: #89e39f;
    font: 700 15px/1.65 "Courier Prime", monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.seo-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { padding: 12px; border-bottom: 1px solid rgba(255,255,255,.1); text-align: left; }
th { color: var(--cyan); }
td { color: #d7d7d7; }
/* Same visual language as the GenX landing-page topic links:
   no pink/cyan frame, dark inherited panel, left neon rail only. */
.seo-topic-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-top: 16px; }
.seo-topic-list a {
    position: relative;
    display: block;
    overflow: hidden;
    padding: 14px 14px 14px 20px;
    border: 0 !important;
    outline: 0;
    border-radius: 14px;
    background: transparent;
    color: #fff;
    text-decoration: none;
    box-shadow: none;
    transition: background .22s ease, box-shadow .22s ease;
}
.seo-topic-list a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 2px;
    border-radius: 0 999px 999px 0;
    background: rgba(24,255,255,.78);
    box-shadow: 0 0 8px rgba(24,255,255,.38);
    opacity: .72;
    pointer-events: none;
    transition: opacity .22s ease, box-shadow .22s ease;
}
.seo-topic-list a:hover,
.seo-topic-list a:focus-visible {
    background: linear-gradient(
        118deg,
        rgba(24,255,255,.075) 0%,
        rgba(255,64,129,.045) 54%,
        rgba(10,14,16,.42) 100%
    );
    box-shadow:
        inset 0 0 22px rgba(24,255,255,.04),
        0 0 16px rgba(24,255,255,.055);
    outline: none;
}
.seo-topic-list a:hover::before,
.seo-topic-list a:focus-visible::before {
    opacity: 1;
    box-shadow:
        0 0 8px rgba(24,255,255,.72),
        0 0 16px rgba(24,255,255,.28);
}
.seo-topic-list a strong { display: block; color: var(--pink); }
.seo-topic-list a span { display: block; margin-top: 2px; color: #aaa; font-size: 13px; }
.seo-note { color: #a8a8a8 !important; font-size: 14px; }
.seo-footer { margin-top: 36px; padding: 30px 0 44px; border-top: 1px solid var(--line); color: #929292; font-size: 13px; }
.seo-footer a { text-decoration: none; }
@media (max-width: 720px) {
    .seo-topbar-inner { align-items: flex-start; flex-direction: column; padding: 12px 0; }
    .seo-nav { gap: 10px 14px; justify-content: flex-start; }
    .seo-hero { padding-top: 48px; }
    .seo-lead { font-size: 16px; }
    .seo-grid, .seo-topic-list { grid-template-columns: 1fr; }
    .seo-section > .seo-shell > .seo-grid {
        padding-block: 22px;
        row-gap: 22px;
    }
    .seo-topic-list { gap: 12px; }
    .seo-card { padding: 18px; }
}

/* =========================================================
   GENX GUIDE SHELL V1 — Navbar + Terminal + Dock
   Scope: visual shell for the four public SEO guide pages only.
   No app/auth/queue logic is duplicated here.
   ========================================================= */
body.guide-page {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
}

/* Match the main GenX navbar proportions without copying app auth logic. */
.guide-page .seo-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 70px;
    border-bottom: 1px solid rgba(24,255,255,.20);
    background: rgba(0,0,0,.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.guide-page .seo-topbar-inner {
    width: 100%;
    max-width: none;
    min-height: 70px;
    padding: 0 30px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.guide-page .seo-brand {
    flex: 0 0 auto;
    font-size: 26px;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 0 10px var(--cyan);
}
.guide-page .seo-nav {
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
}
.guide-page .seo-nav::-webkit-scrollbar { display: none; }
.guide-page .seo-nav a {
    flex: 0 0 auto;
    white-space: nowrap;
}
.guide-page .seo-nav a[aria-current="page"] {
    color: var(--cyan);
    text-shadow: 0 0 8px rgba(24,255,255,.34);
}
.guide-page .seo-app-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 4px 14px;
    border: 1px solid var(--cyan);
    border-radius: 20px;
    color: var(--cyan) !important;
    background: transparent;
    box-shadow: 0 0 10px rgba(24,255,255,.20);
    font-weight: 700;
    transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.guide-page .seo-app-link:hover,
.guide-page .seo-app-link:focus-visible {
    color: #000 !important;
    background: var(--cyan);
    box-shadow: 0 0 18px rgba(24,255,255,.72);
    outline: none;
}

/* Public content sits on one GenX terminal surface. */
.guide-terminal {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    width: min(1180px, calc(100% - 48px));
    margin: 4px auto 0;
    padding-bottom: calc(132px + env(safe-area-inset-bottom));
    scroll-padding-bottom: calc(132px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border: 0;
    border-radius: 18px;
    background: rgba(0,0,0,.24);
    box-shadow: inset 0 0 32px rgba(24,255,255,.018);
}
.guide-terminal::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}
.guide-terminal-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 38px;
    padding: 8px 22px;
    border-bottom: 1px solid rgba(24,255,255,.10);
    color: rgba(164,224,217,.72);
    font: 700 12px/1.35 "Courier Prime", monospace;
    letter-spacing: .65px;
}
.guide-terminal-status .guide-ready {
    color: var(--green);
    text-shadow: 0 0 8px rgba(0,255,65,.42);
}
.guide-terminal .seo-hero {
    padding: 50px 0 28px;
}
.guide-terminal .seo-section {
    padding: 22px 0 42px;
}
.guide-terminal .seo-shell {
    width: min(1040px, calc(100% - 48px));
}

/* Fixed launcher dock: visual parity with the app, but every control is a safe link. */
.guide-dock {
    position: fixed;
    left: 50%;
    bottom: calc(20px + env(safe-area-inset-bottom));
    z-index: 110;
    width: 90%;
    max-width: 800px;
    transform: translateX(-50%);
    padding: 10px 20px;
    border: 1px solid rgba(24,255,255,.46);
    border-radius: 30px;
    background: #131318;
    box-shadow: 0 0 6px rgba(24,255,255,.14);
}
.guide-dock-prompt {
    display: block;
    min-height: 34px;
    padding: 1px 0 4px;
    overflow: hidden;
    color: #8c8c8c;
    text-decoration: none;
    font-size: 18px;
    line-height: 1.5;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.guide-dock-prompt:hover,
.guide-dock-prompt:focus-visible {
    color: #cfcfcf;
    outline: none;
}
.guide-dock-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 5px;
}
.guide-dock-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translate(-8px, 5px);
}
.guide-dock-icon,
.guide-dock-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: color .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.guide-dock-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
}
.guide-dock-icon:hover,
.guide-dock-icon:focus-visible {
    color: var(--cyan);
    background: rgba(24,255,255,.10);
    outline: none;
}
.guide-dock-send {
    width: 50px;
    height: 50px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 50%;
    color: #777;
    background: rgba(0,0,0,.16);
    font-size: 22px;
}
.guide-dock-send:hover,
.guide-dock-send:focus-visible {
    color: var(--cyan);
    border-color: rgba(24,255,255,.65);
    box-shadow: 0 0 14px rgba(24,255,255,.16);
    outline: none;
}
.guide-terminal .seo-footer {
    width: 100%;
    margin: 10px 0 0;
    padding: 26px 0 34px;
}
.guide-terminal .seo-footer .seo-shell {
    width: min(1040px, calc(100% - 48px));
}

@media (max-width: 720px) {
    .guide-page .seo-topbar-inner {
        min-height: 70px;
        padding: 0 15px;
        flex-direction: row;
        align-items: center;
    }
    .guide-page .seo-brand { font-size: 20px; }
    .guide-page .seo-nav { gap: 8px; }
    .guide-page .seo-nav .seo-guide-link { display: none; }
    .guide-page .seo-app-link {
        min-height: 32px;
        padding: 3px 12px;
        font-size: 12px;
    }
    .guide-terminal {
        width: calc(100% - 28px);
        margin-top: 4px;
        padding-bottom: calc(128px + env(safe-area-inset-bottom));
        scroll-padding-bottom: calc(128px + env(safe-area-inset-bottom));
        border-radius: 14px;
    }
    .guide-terminal-status {
        min-height: 34px;
        padding: 7px 14px;
        font-size: 10px;
    }
    .guide-terminal .seo-shell {
        width: calc(100% - 28px);
    }
    .guide-terminal .seo-hero {
        padding: 34px 0 22px;
    }
    .guide-terminal .seo-section {
        padding: 16px 0 30px;
    }
    .guide-dock {
        width: calc(100% - 34px);
        bottom: calc(18px + env(safe-area-inset-bottom));
        padding: 10px 18px;
        box-shadow: none;
        border-color: rgba(24,255,255,.62);
    }
    .guide-dock-prompt { font-size: 16px; }
    .guide-terminal .seo-footer {
        margin-top: 20px;
        padding-bottom: 30px;
    }
    .guide-terminal .seo-footer .seo-shell {
        width: calc(100% - 28px);
    }
}

/* =========================================================
   GENX GUIDE UI V2 — Main-terminal canonical layout
   Design source: public/index.html
   - One scrollable terminal viewport between Navbar and Dock.
   - Main content blocks stack vertically like terminal messages.
   - Dock never overlays guide content: its footprint is reserved
     by the terminal's flex margin, not by a page-level black gap.
   - SEO HTML/content remains unchanged.
   ========================================================= */
body.guide-page {
    --guide-edge-gap: 4px;
    --guide-dock-reserve: 134px;
}

/* The terminal is the viewport, not a large framed article container. */
.guide-page .guide-terminal {
    flex: 1 1 auto;
    min-height: 0;
    width: 90%;
    max-width: 800px;
    margin: var(--guide-edge-gap) auto calc(var(--guide-dock-reserve) + env(safe-area-inset-bottom));
    padding: 0 0 20px;
    scroll-padding: 16px 0 24px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.guide-page .guide-terminal::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* Terminal status line mirrors the lightweight system-message language. */
.guide-page .guide-terminal-status {
    width: 100%;
    min-height: 42px;
    margin: 0 0 16px;
    padding: 10px 4px 9px;
    border: 0;
    border-bottom: 1px solid rgba(24,255,255,.14);
    background: transparent;
}

/* Remove nested page gutters: the terminal owns the horizontal rhythm. */
.guide-page .guide-terminal .seo-shell,
.guide-page .guide-terminal .seo-footer .seo-shell {
    width: 100%;
    max-width: none;
}

/* The hero becomes the first terminal message/card instead of a landing-page slab. */
.guide-page .guide-terminal .seo-hero {
    padding: 0;
    margin: 0 0 18px;
}
.guide-page .guide-terminal .seo-hero > .seo-shell {
    padding: 22px;
    border: 1px solid rgba(24,255,255,.22);
    border-radius: 18px;
    background: rgba(10,14,16,.88);
    box-shadow: inset 0 0 28px rgba(24,255,255,.026);
}
.guide-page .guide-terminal .seo-kicker {
    margin-bottom: 8px;
    font-size: 13px;
}
.guide-page .guide-terminal h1 {
    margin: 0 0 14px;
    max-width: none;
    font-size: clamp(28px, 4.2vw, 44px);
    line-height: 1.28;
}
.guide-page .guide-terminal .seo-lead {
    max-width: none;
    font-size: 16px;
    line-height: 1.72;
}
.guide-page .guide-terminal .seo-actions {
    margin-top: 20px;
}

/* Main guide blocks are a single vertical terminal stream. */
.guide-page .guide-terminal .seo-section {
    padding: 0 0 26px;
}
.guide-page .guide-terminal .seo-section > .seo-shell {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.guide-page .guide-terminal .seo-card {
    width: 100%;
    margin: 0 !important;
    padding: 22px;
    border: 1px solid rgba(24,255,255,.22);
    border-radius: 18px;
    background: rgba(10,14,16,.88);
    box-shadow: inset 0 0 28px rgba(24,255,255,.026);
}
.guide-page .guide-terminal .seo-card + .seo-card,
.guide-page .guide-terminal .seo-card + .seo-grid,
.guide-page .guide-terminal .seo-grid + .seo-card {
    margin-top: 0 !important;
}
.guide-page .guide-terminal .seo-grid,
.guide-page .guide-terminal .seo-section > .seo-shell > .seo-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    width: 100%;
    margin: 0;
    padding: 0;
}
.guide-page .guide-terminal .seo-card h2 {
    font-size: clamp(23px, 3.2vw, 30px);
}

/* Related links remain sub-actions inside a message card. */
.guide-page .guide-terminal .seo-topic-list {
    gap: 14px;
}

/* Footer is part of the terminal stream and can scroll completely above the Dock. */
.guide-page .guide-terminal .seo-footer {
    width: 100%;
    margin: 0;
    padding: 20px 0 10px;
}

@media (max-width: 720px) {
    body.guide-page {
        --guide-dock-reserve: 132px;
    }
    .guide-page .guide-terminal {
        width: 90%;
        margin-top: var(--guide-edge-gap);
        margin-bottom: calc(var(--guide-dock-reserve) + env(safe-area-inset-bottom));
        padding-bottom: 16px;
    }
    .guide-page .guide-terminal-status {
        min-height: 38px;
        margin-bottom: 14px;
        padding: 9px 2px 8px;
        font-size: 10px;
    }
    .guide-page .guide-terminal .seo-hero {
        margin-bottom: 14px;
    }
    .guide-page .guide-terminal .seo-hero > .seo-shell,
    .guide-page .guide-terminal .seo-card {
        padding: 18px;
        border-radius: 16px;
    }
    .guide-page .guide-terminal h1 {
        font-size: clamp(27px, 9vw, 38px);
    }
    .guide-page .guide-terminal .seo-lead {
        font-size: 15px;
    }
    .guide-page .guide-terminal .seo-section > .seo-shell,
    .guide-page .guide-terminal .seo-grid,
    .guide-page .guide-terminal .seo-section > .seo-shell > .seo-grid {
        gap: 14px;
    }
    .guide-page .guide-terminal .seo-card h2 {
        font-size: clamp(22px, 7vw, 28px);
    }
    .guide-page .guide-terminal .seo-topic-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .guide-page .guide-terminal .seo-footer {
        padding: 18px 0 8px;
    }
}
