/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
    --bg:          #f5f2ee;
    --bg2:         #ede9e3;
    --surface:     #faf8f5;
    --border:      #d4cec5;
    --border2:     #c4bdb2;
    --text:        #1c1a17;
    --text-mid:    #6b6459;
    --text-dim:    #a09890;
    --white:       #fefcfa;
    --sage:        #7d9e8a;
    --sage-dark:   #6b8a77;
    --amber:       #c4a23a;
    --terracotta:  #a0785a;
    --soft-blue:   #6b8fa8;
    --lavender:    #8a7ab0;
    --accent:      #7d9e8a;
    --radius:      6px;
    --font-head:   'Young Serif', Georgia, serif;
    --font-body:   'Hanken Grotesk', system-ui, sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea { font: inherit; }
:focus:not(:focus-visible) { outline: none; }

/* ── Base ──────────────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-weight: 400;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    position: relative;
}

/* Grain overlay */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    background-repeat: repeat;
}

main { min-height: 100vh; }

/* ── Layout ────────────────────────────────────────────────────────────────── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 56px;
}

/* ── Typography helpers ────────────────────────────────────────────────────── */
.young-serif { font-family: var(--font-head); }

/* ── Back link ─────────────────────────────────────────────────────────────── */
.back-link {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-mid);
    margin-bottom: 40px;
    transition: color 0.15s;
}
.back-link:hover { color: var(--text); }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, opacity 0.15s;
    white-space: nowrap;
}

.btn-ghost {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-mid);
}
.btn-ghost:hover { border-color: var(--text-mid); color: var(--text); }

.btn-primary {
    background: var(--accent);
    color: var(--white);
    border: 1.5px solid transparent;
}
.btn-primary:hover { opacity: 0.88; }

.btn-nudge {
    width: 100%;
    padding: 18px 32px;
    font-size: 17px;
    font-weight: 500;
    background: var(--accent);
    color: var(--white);
    border-radius: var(--radius);
    transition: opacity 0.15s;
    letter-spacing: 0.01em;
}
.btn-nudge:hover:not(:disabled) { opacity: 0.88; }
.btn-nudge:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── HOME PAGE ─────────────────────────────────────────────────────────────── */
.home {}

/* Hero */
.hero {
    padding: 100px 0 72px;
}

.hero-headline {
    font-family: var(--font-head);
    font-weight: 400;
    font-size: clamp(52px, 8vw, 96px);
    letter-spacing: -2px;
    line-height: 0.95;
    color: var(--text);
    max-width: 900px;
    margin-bottom: 28px;
}

.hero-sub {
    font-weight: 300;
    font-size: 18px;
    color: var(--text-mid);
    max-width: 480px;
    margin-bottom: 48px;
    line-height: 1.5;
}

/* Search */
.search-wrap { position: relative; max-width: 640px; }

.search-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 400;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
}
.search-input::placeholder { color: var(--text-dim); }
.search-input:focus { border-color: var(--text-mid); }
.search-input::-webkit-search-cancel-button { cursor: pointer; }

.search-results {
    list-style: none;
    margin-top: 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    max-width: 640px;
}

.search-result-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.12s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg2); }

.search-result-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    flex-shrink: 0;
}
.search-result-desc {
    font-size: 13px;
    color: var(--text-mid);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-result-cat {
    font-size: 12px;
    color: var(--text-dim);
    flex-shrink: 0;
}

.search-empty {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-dim);
    max-width: 640px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
}

/* Category list */
.categories {
    padding-bottom: 80px;
}

.cat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 0;
    border-bottom: 1.5px solid var(--border);
    cursor: pointer;
    position: relative;
    transition: padding-left 0.2s;
}
.cat-row::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s, left 0.2s;
}
.cat-row:first-child { border-top: 1.5px solid var(--border); }
.cat-row:hover { padding-left: 16px; }
.cat-row:hover::before { opacity: 1; left: 0; }

.cat-row-left { display: flex; flex-direction: column; gap: 4px; }

.cat-name {
    font-family: var(--font-head);
    font-weight: 400;
    font-size: clamp(28px, 3.5vw, 44px);
    letter-spacing: -0.5px;
    line-height: 1.1;
    color: var(--text);
    display: block;
}

.cat-desc {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-mid);
    display: block;
}

.cat-count {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-dim);
    flex-shrink: 0;
    margin-left: 32px;
}

/* ── HOME — MISSION STRIP ──────────────────────────────────────────────────── */
.mission-strip {
    padding: 0 0 72px;
}

.mission-quote {
    font-family: var(--font-head);
    font-weight: 400;
    font-size: clamp(24px, 3vw, 38px);
    letter-spacing: -0.5px;
    line-height: 1.25;
    color: var(--text);
    max-width: 580px;
    margin-bottom: 52px;
}

.mission-beats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 52px;
    border-top: 1.5px solid var(--border);
    padding-top: 40px;
}

.mission-beat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mission-beat-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.1px;
}

.mission-beat-body {
    font-size: 14px;
    font-weight: 300;
    color: var(--text-mid);
    line-height: 1.6;
}

.mission-transition {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mission-transition-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    white-space: nowrap;
    flex-shrink: 0;
}

.mission-transition-rule {
    flex: 1;
    height: 1px;
    background: var(--border);
    min-width: 16px;
}

.mission-builder-link {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-mid);
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.15s;
}

.mission-builder-link span {
    font-weight: 500;
    color: var(--text);
}

.mission-builder-link:hover { color: var(--text); }
.mission-builder-link:hover span { color: var(--sage-dark); }

/* ── CATEGORY PAGE ─────────────────────────────────────────────────────────── */
.category-page { padding: 80px 0; }

.page-heading {
    font-family: var(--font-head);
    font-weight: 400;
    font-size: clamp(40px, 6vw, 72px);
    letter-spacing: -1.5px;
    line-height: 0.95;
    color: var(--text);
    margin-bottom: 16px;
    border-left: 5px solid var(--accent);
    padding-left: 20px;
}

.page-tagline {
    font-size: 16px;
    font-weight: 300;
    color: var(--text-mid);
    margin-bottom: 56px;
    padding-left: 25px;
}

/* Prompt grid */
.prompt-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.prompt-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 28px 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.prompt-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.prompt-card-body { flex: 1; }

.prompt-card-title {
    font-family: var(--font-head);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.25;
    color: var(--text);
    margin-bottom: 8px;
}

.prompt-card-desc {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-mid);
    line-height: 1.5;
}

.prompt-card-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.prompt-card-actions .btn-primary { flex: 1; }

.empty-state { font-size: 15px; color: var(--text-dim); margin-top: 40px; }

/* ── PROMPT PAGE ───────────────────────────────────────────────────────────── */
.prompt-page { padding: 80px 0; }

.prompt-page-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 48px;
}
.prompt-page-nav .back-link { margin-bottom: 0; }

/* Share buttons */
.share-group { display: flex; gap: 8px; align-items: center; }

.share-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-body);
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    color: var(--text-mid);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    white-space: nowrap;
}
.share-copy-btn:hover { border-color: var(--text-mid); color: var(--text); }

.share-x-btn,
.share-threads-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-body);
    background: #0f0f0f;
    border: 1.5px solid #0f0f0f;
    border-radius: 20px;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.15s;
    white-space: nowrap;
}
.share-x-btn:hover,
.share-threads-btn:hover { opacity: 0.82; }

/* Category badge */
.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.03em;
    margin-bottom: 16px;
}

.prompt-body { max-width: 720px; }

.prompt-heading {
    font-family: var(--font-head);
    font-weight: 400;
    font-size: clamp(32px, 4.5vw, 56px);
    letter-spacing: -1px;
    line-height: 1.05;
    color: var(--text);
    margin-bottom: 12px;
}

.prompt-desc {
    font-size: 15px;
    font-weight: 300;
    color: var(--text-mid);
    margin-bottom: 40px;
    max-width: 560px;
}

/* Fields */
.fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 32px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-mid);
    letter-spacing: 0.01em;
}

.field-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
}
.field-input:focus { border-color: var(--text-mid); }

/* Prompt preview card */
.prompt-preview-card {
    background: var(--bg2);
    border: 1.5px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.prompt-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.prompt-preview-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.btn-copy-prompt {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-body);
    color: var(--text-dim);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
    padding: 0;
}
.btn-copy-prompt:hover { color: var(--text); }

.prompt-preview-body {
    padding: 20px 24px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.8;
    word-break: break-word;
}

.prompt-preview-footer {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.prompt-placeholder {
    background: color-mix(in srgb, var(--amber) 14%, transparent);
    color: var(--amber);
    border-radius: 4px;
    padding: 1px 5px;
    font-style: normal;
}

.prompt-value {
    color: var(--text);
    font-weight: 500;
}

/* Nudge action */
.nudge-action { margin-bottom: 56px; }

.btn-nudge {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 32px;
    font-size: 17px;
    font-weight: 500;
    font-family: var(--font-body);
    background: var(--accent);
    color: var(--white);
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    letter-spacing: 0.01em;
}
.btn-nudge:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.btn-nudge:active:not(:disabled) { transform: translateY(0); }
.btn-nudge:disabled { opacity: 0.45; cursor: not-allowed; }

/* Response section */
.response-section { max-width: 720px; }

.response-section-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}

.response-box {
    background: var(--white);
    border: none;
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    padding: 28px 36px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
    min-height: 80px;
    word-break: break-word;
    box-shadow: 0 2px 20px rgba(0,0,0,0.05);
}
.response-box p { margin-bottom: 18px; }
.response-box p:last-child { margin-bottom: 0; }
.response-box h3 {
    font-family: var(--font-head);
    font-weight: 400;
    font-size: 19px;
    color: var(--text);
    margin: 28px 0 10px;
    line-height: 1.2;
}
.response-box h3:first-child { margin-top: 0; }
.response-box h4 {
    font-family: var(--font-head);
    font-weight: 400;
    font-size: 16px;
    color: var(--text);
    margin: 22px 0 8px;
}
.response-box h4:first-child { margin-top: 0; }
.response-box ul, .response-box ol {
    padding-left: 22px;
    margin-bottom: 18px;
}
.response-box li { margin-bottom: 8px; line-height: 1.7; }
.response-box li:last-child { margin-bottom: 0; }
.response-box strong { font-weight: 600; }
.response-box em { font-style: italic; color: var(--text-mid); }
.response-box h1, .response-box h2 {
    font-family: var(--font-head);
    font-weight: 400;
    color: var(--text);
    line-height: 1.2;
    margin: 32px 0 12px;
}
.response-box h1 { font-size: 22px; }
.response-box h2 { font-size: 20px; }
.response-box h1:first-child, .response-box h2:first-child { margin-top: 0; }
.response-box code {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.875em;
    padding: 2px 5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.response-box pre {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    overflow-x: auto;
    margin-bottom: 18px;
}
.response-box pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
}
.response-box blockquote {
    border-left: 3px solid var(--border2);
    padding-left: 16px;
    margin: 0 0 18px;
    color: var(--text-mid);
    font-style: italic;
}
.response-box blockquote p { margin-bottom: 0; }
.response-box table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 18px;
    font-size: 15px;
}
.response-box th {
    background: var(--bg2);
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 2px solid var(--border);
}
.response-box td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.response-box tr:last-child td { border-bottom: none; }

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
.streaming-cursor {
    display: inline-block;
    animation: blink 1s step-start infinite;
    color: var(--text-mid);
    font-size: 14px;
    vertical-align: middle;
    margin-left: 2px;
}

/* Post-response */
.post-response {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 720px;
}

.post-response .share-copy-btn { align-self: flex-start; }

/* Prompt details disclosure */
.prompt-details summary {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-mid);
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.prompt-details summary::-webkit-details-marker { display: none; }
.prompt-details summary::before {
    content: '▸';
    font-size: 11px;
    transition: transform 0.15s;
}
.prompt-details[open] summary::before { transform: rotate(90deg); }
.prompt-details summary:hover { color: var(--text); }

.prompt-used {
    margin-top: 12px;
    background: var(--bg2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    font-size: 13px;
    font-family: var(--font-body);
    color: var(--text-mid);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.65;
}

.try-another {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-mid);
    transition: color 0.15s;
    align-self: flex-start;
}
.try-another:hover { color: var(--text); }

/* Error */
.error-message {
    background: #fdf0f0;
    border: 1.5px solid #e8c5c5;
    border-radius: var(--radius);
    padding: 14px 18px;
    font-size: 14px;
    color: #8b3333;
    margin-bottom: 20px;
    max-width: 640px;
}

/* Usage limit modal */
.limit-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.limit-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(28, 26, 23, 0.4);
    backdrop-filter: blur(2px);
}

.limit-modal-box {
    position: relative;
    z-index: 1;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 40px 48px;
    max-width: 460px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.limit-modal-box h3 {
    font-family: var(--font-head);
    font-weight: 400;
    font-size: 24px;
    color: var(--text);
    margin-bottom: 20px;
}

.limit-modal-pro {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 24px;
    text-align: left;
}

.limit-modal-pro-label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-mid);
    margin-bottom: 12px;
}

.limit-modal-features {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.limit-modal-features li {
    font-size: 14px;
    font-weight: 300;
    color: var(--text);
    line-height: 1.6;
    padding-left: 18px;
    position: relative;
}

.limit-modal-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--text-mid);
    font-size: 12px;
}

.limit-modal-price {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-mid);
    margin: 0;
}

.limit-modal-capture {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.limit-modal-capture .field-input {
    text-align: center;
}

.limit-modal-cta {
    width: 100%;
    justify-content: center;
}

.limit-modal-success {
    font-size: 15px;
    font-weight: 300;
    color: var(--text-mid);
    line-height: 1.5;
    margin-bottom: 20px;
}

.limit-modal-dismiss {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    font-weight: 300;
    color: var(--text-dim);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.limit-modal-dismiss:hover {
    color: var(--text-mid);
}

/* ── BUILDER — EDITORIAL INTRO ─────────────────────────────────────────────── */
.builder-editorial {
    max-width: 720px;
    margin-bottom: 56px;
}

.builder-ed-hero {
    margin-bottom: 40px;
}

.builder-ed-headline {
    font-family: var(--font-head);
    font-weight: 400;
    font-size: clamp(34px, 5vw, 56px);
    letter-spacing: -1.5px;
    line-height: 1.05;
    color: var(--text);
    margin-bottom: 16px;
}

.builder-ed-subtext {
    font-size: 17px;
    font-weight: 300;
    color: var(--text-mid);
    line-height: 1.6;
    max-width: 520px;
}

.builder-ed-why {
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-size: 15px;
    font-weight: 300;
    color: var(--text-mid);
    line-height: 1.7;
    max-width: 640px;
    margin-bottom: 48px;
}

.builder-ed-principles {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 48px;
}

.builder-ed-principle {
    border-left: 3px solid var(--border);
    padding: 20px 0 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s;
}

.builder-ed-principle:hover {
    border-left-color: var(--sage);
}

.builder-ed-principle-meta {
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
}

.builder-ed-principle-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.01em;
    flex-shrink: 0;
    min-width: 88px;
}

.builder-ed-principle-why {
    font-size: 13px;
    font-weight: 300;
    color: var(--text-mid);
    line-height: 1.5;
}

.builder-ed-example {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.builder-ed-before,
.builder-ed-after {
    font-size: 13px;
    line-height: 1.55;
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.builder-ed-before { color: var(--text-dim); }
.builder-ed-after  { color: var(--text); }

.builder-ed-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 2px 7px;
    border-radius: 3px;
    flex-shrink: 0;
    background: var(--bg2);
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.builder-ed-badge--after {
    background: color-mix(in srgb, var(--sage) 15%, transparent);
    color: var(--sage-dark);
    border-color: color-mix(in srgb, var(--sage) 40%, transparent);
}

.builder-ed-cta {
    display: flex;
    align-items: baseline;
    gap: 18px;
    flex-wrap: wrap;
    padding-top: 4px;
}

.builder-ed-cta-text {
    font-family: var(--font-head);
    font-weight: 400;
    font-size: 28px;
    letter-spacing: -0.5px;
    color: var(--text);
}

.builder-ed-cta-sub {
    font-size: 14px;
    font-weight: 300;
    color: var(--text-mid);
}

/* ── PROMPT BUILDER ────────────────────────────────────────────────────────── */
.builder-page { padding: 72px 0 100px; }

.builder-header {
    max-width: 720px;
    margin-bottom: 52px;
}

.builder-title {
    font-family: var(--font-head);
    font-weight: 400;
    font-size: clamp(36px, 5vw, 56px);
    letter-spacing: -1px;
    line-height: 1.05;
    color: var(--text);
    margin-bottom: 14px;
}

.builder-subtitle {
    font-size: 16px;
    font-weight: 300;
    color: var(--text-mid);
    line-height: 1.6;
    margin-bottom: 32px;
    max-width: 540px;
}

.builder-category-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.builder-category-label {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
}

.builder-category-dropdown {
    padding: 10px 16px;
    font-size: 15px;
    font-family: var(--font-body);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    outline: none;
    cursor: pointer;
    min-width: 220px;
    transition: border-color 0.15s;
}
.builder-category-dropdown:focus { border-color: var(--text-mid); }

/* Two-pane layout */
.builder-layout {
    display: grid;
    grid-template-columns: 55fr 45fr;
    gap: 48px;
    align-items: start;
}

/* Steps column */
.builder-steps-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.builder-step {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 22px 22px 18px;
    transition: border-color 0.2s;
}

.builder-step--filled {
    border-color: color-mix(in srgb, var(--sage) 55%, var(--border));
}

.builder-step-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.builder-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg2);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-mid);
    flex-shrink: 0;
    margin-top: 3px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.builder-step--filled .builder-step-num {
    background: color-mix(in srgb, var(--sage) 15%, transparent);
    border-color: var(--sage);
    color: var(--sage-dark);
}

.builder-step-name {
    font-family: var(--font-head);
    font-weight: 400;
    font-size: 18px;
    color: var(--text);
    line-height: 1.2;
}

.builder-step-why {
    font-size: 13px;
    color: var(--text-mid);
    line-height: 1.6;
    margin-bottom: 12px;
    padding-left: 36px;
}

.builder-suggestion-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    font-family: var(--font-body);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-mid);
    outline: none;
    cursor: pointer;
    margin-bottom: 8px;
    transition: border-color 0.15s;
}
.builder-suggestion-select:focus { border-color: var(--text-mid); }

.builder-step-textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    font-family: var(--font-body);
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    outline: none;
    resize: vertical;
    min-height: 76px;
    line-height: 1.65;
    transition: border-color 0.15s;
}
.builder-step-textarea:focus { border-color: var(--text-mid); }
.builder-step-textarea::placeholder { color: var(--text-dim); }

/* Preview column */
.builder-preview-sticky {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.builder-preview-card {
    background: var(--bg2);
    border: 1.5px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 8px;
    overflow: hidden;
}

.builder-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-wrap: wrap;
}

.builder-preview-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.builder-preview-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-pro-save {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-body);
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    color: var(--text-dim);
    cursor: not-allowed;
    opacity: 0.65;
}

.pro-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 5px;
    background: var(--amber);
    color: var(--white);
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.builder-assembled {
    padding: 18px 20px;
    min-height: 110px;
    max-height: 380px;
    overflow-y: auto;
}

.builder-assembled-empty {
    font-size: 13px;
    color: var(--text-dim);
    font-style: italic;
    line-height: 1.6;
}

.builder-assembled-section {
    margin-bottom: 14px;
}
.builder-assembled-section:last-child { margin-bottom: 0; }

.builder-assembled-label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 3px;
}

.builder-assembled-text {
    font-size: 13px;
    color: var(--text);
    line-height: 1.65;
    margin: 0;
}

.builder-preview-run {
    padding: 14px 18px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

/* "Take it to the next level" CTA on PromptPage */
.builder-cta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 16px 20px;
    background: color-mix(in srgb, var(--sage) 7%, var(--surface));
    border: 1.5px solid color-mix(in srgb, var(--sage) 28%, var(--border));
    border-radius: 8px;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
    align-self: flex-start;
}
.builder-cta:hover {
    border-color: var(--sage);
    background: color-mix(in srgb, var(--sage) 12%, var(--surface));
}

.builder-cta-eyebrow {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--sage-dark);
}

.builder-cta-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}

.builder-cta-desc {
    font-size: 12px;
    color: var(--text-mid);
    margin-top: 1px;
}

/* ── RESPONSIVE ────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .builder-layout {
        grid-template-columns: 1fr;
    }
    .builder-preview-sticky {
        position: static;
    }
}

@media (max-width: 768px) {
    .container { padding: 0 24px; }

    .hero { padding: 60px 0 48px; }
    .hero-headline { letter-spacing: -1.5px; }
    .hero-sub { font-size: 16px; }

    .mission-strip { padding-bottom: 48px; }
    .mission-quote { font-size: clamp(20px, 4.5vw, 28px); margin-bottom: 28px; }
    .mission-beats { grid-template-columns: 1fr; gap: 16px; padding-top: 20px; margin-bottom: 28px; }
    .mission-transition { flex-wrap: wrap; gap: 10px; }
    .mission-transition-rule { display: none; }
    .mission-builder-link { font-size: 12px; }

    .builder-ed-cta { flex-direction: column; gap: 4px; }
    .builder-ed-principle-meta { flex-direction: column; gap: 4px; }
    .builder-ed-principle-label { min-width: 0; }

    .categories { padding-bottom: 48px; }
    .cat-row { padding: 20px 0; }

    .prompt-grid { grid-template-columns: 1fr; }

    .category-page { padding: 48px 0; }
    .prompt-page { padding: 48px 0; }
    .builder-page { padding: 48px 0 64px; }
    .builder-header { margin-bottom: 36px; }
    .builder-category-row { flex-direction: column; align-items: flex-start; }

    .prompt-heading { letter-spacing: -0.5px; }
    .share-group { gap: 6px; }
    .share-x-btn span, .share-threads-btn span { display: none; }

    .response-box { padding: 20px 20px; }
    .prompt-card { padding: 20px 20px 18px; }
    .limit-modal-box { padding: 28px 20px; }
    .limit-modal-pro { padding: 16px 18px; }
}

@media (max-width: 480px) {
    .container { padding: 0 20px; }
    .cat-row:hover { padding-left: 0; }
    .prompt-card-actions { flex-direction: column; }
    .prompt-card-actions .btn { width: 100%; }
}

/* ── 404 ───────────────────────────────────────────────────────────────────── */
.not-found-page { padding: 120px 0 80px; }
.not-found-code {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}
.not-found-heading {
    font-family: var(--font-head);
    font-weight: 400;
    font-size: clamp(36px, 5vw, 64px);
    letter-spacing: -1px;
    color: var(--text);
    margin-bottom: 12px;
}
.not-found-desc {
    font-size: 16px;
    font-weight: 300;
    color: var(--text-mid);
    margin-bottom: 32px;
}

/* ── ADMIN ─────────────────────────────────────────────────────────────────── */
.admin-page { padding: 64px 0 80px; }

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.admin-title {
    font-family: var(--font-head);
    font-weight: 400;
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: -0.5px;
    color: var(--text);
}

.admin-filters { margin-bottom: 24px; }

.admin-select {
    padding: 9px 14px;
    font-size: 14px;
    font-family: var(--font-body);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    outline: none;
    cursor: pointer;
}
.admin-select:focus { border-color: var(--text-mid); }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.admin-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0 12px 12px 0;
    border-bottom: 1.5px solid var(--border);
}
.admin-table td {
    padding: 14px 12px 14px 0;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }

.admin-col-title { font-weight: 500; color: var(--text); max-width: 360px; }
.admin-col-cat   { color: var(--text-mid); white-space: nowrap; }
.admin-col-live  { white-space: nowrap; }
.admin-col-actions { display: flex; gap: 8px; justify-content: flex-end; white-space: nowrap; }

.admin-toggle {
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-body);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    color: var(--text-dim);
    background: transparent;
    cursor: pointer;
    transition: all 0.15s;
}
.admin-toggle.is-live {
    border-color: var(--sage);
    color: var(--sage-dark);
    background: color-mix(in srgb, var(--sage) 10%, transparent);
}

.admin-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.admin-btn-delete {
    background: transparent;
    border: 1.5px solid #e8c5c5;
    color: #8b3333;
}
.admin-btn-delete:hover { background: #fdf0f0; }

.admin-empty {
    font-size: 14px;
    color: var(--text-dim);
    margin-top: 32px;
}

.admin-form {
    max-width: 680px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-top: 8px;
}

.admin-textarea {
    min-height: 140px;
    resize: vertical;
    max-width: 100%;
    line-height: 1.6;
}

.admin-hint {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4px;
    display: block;
}

.admin-field-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}
.admin-field-key   { max-width: 160px; font-family: monospace; font-size: 13px; }
.admin-field-label { flex: 1; }

/* ── 404 ───────────────────────────────────────────────────────────────────── */
.not-found-page {
    padding: 120px 0 80px;
    text-align: center;
}
.not-found-code {
    font-family: var(--font-head);
    font-size: clamp(80px, 15vw, 140px);
    color: var(--border);
    line-height: 1;
    margin: 0;
}
.not-found-heading {
    font-family: var(--font-head);
    font-size: clamp(28px, 5vw, 40px);
    margin: 16px 0 12px;
}
.not-found-desc {
    color: var(--text-dim);
    margin: 0 0 32px;
}

/* ── Blazor reconnect toast ────────────────────────────────────────────────── */
#components-reconnect-modal {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
}
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-connecting {
    display: flex;
}
.reconnect-toast {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--text);
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 9px 18px;
    font-size: 13px;
    font-family: var(--font-body);
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
    white-space: nowrap;
}
.reconnect-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sage);
    flex-shrink: 0;
    animation: reconnect-pulse 1.2s ease-in-out infinite;
}
@keyframes reconnect-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    background: var(--text);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 14px;
    padding: 14px 24px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
#blazor-error-ui b { font-weight: 600; }
#blazor-error-ui .dismiss { cursor: pointer; opacity: 0.6; font-size: 18px; line-height: 1; }
#blazor-error-ui .dismiss:hover { opacity: 1; }

/* ── PRO PAGE ──────────────────────────────────────────────────────────────── */
.pro-page {
    padding-top: 48px;
    padding-bottom: 80px;
}

.pro-hero {
    max-width: 560px;
    margin-bottom: 56px;
}

.pro-eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-mid);
    margin-bottom: 12px;
}

.pro-headline {
    font-family: var(--font-head);
    font-weight: 400;
    font-size: clamp(36px, 5vw, 52px);
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.1;
}

.pro-sub {
    font-size: 17px;
    font-weight: 300;
    color: var(--text-mid);
    line-height: 1.6;
}

.pro-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.pro-features {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.pro-tier {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px 28px;
}

.pro-tier--pro {
    background: var(--white);
    border-color: var(--text-dim);
}

.pro-tier-label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-mid);
    margin-bottom: 16px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.pro-price {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text);
}

.pro-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pro-feature-list li {
    font-size: 14px;
    font-weight: 300;
    color: var(--text-mid);
    line-height: 1.5;
    padding-left: 18px;
    position: relative;
}

.pro-feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    font-size: 12px;
    color: var(--text-dim);
}

.pro-feature--highlight {
    color: var(--text) !important;
}

.pro-feature--highlight::before {
    color: var(--text-mid) !important;
}

.pro-capture-panel {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 32px 36px;
    position: sticky;
    top: 32px;
}

.pro-capture-label {
    font-family: var(--font-head);
    font-weight: 400;
    font-size: 22px;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.2;
}

.pro-capture-sub {
    font-size: 13px;
    font-weight: 300;
    color: var(--text-dim);
    margin-bottom: 24px;
    line-height: 1.5;
}

.pro-capture-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pro-capture-btn {
    width: 100%;
    justify-content: center;
}

.pro-capture-success {
    text-align: center;
    padding: 16px 0;
}

.pro-capture-success p {
    font-size: 15px;
    font-weight: 300;
    color: var(--text-mid);
    line-height: 1.6;
}

.pro-capture-success p:first-child {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 4px;
}

@media (max-width: 768px) {
    .pro-layout {
        grid-template-columns: 1fr;
    }

    .pro-capture-panel {
        position: static;
        padding: 24px 20px;
    }
}
