/* ===== PAGE SETUP ===== */
html, body {
    height: 100%;
    overflow: hidden;
}

/* ===== HORIZONTAL BOOK ===== */
.book {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.book-track {
    display: flex;
    height: 100%;
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.page {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

.page-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 28px;
    max-width: 460px;
    margin: 0 auto;
    width: 100%;
    text-align: center;
}

.page-center-left {
    text-align: left;
}

/* Page fade-in when it becomes active */
.page .page-inner { opacity: 0; transform: translateY(8px); transition: opacity 0.5s ease 0.15s, transform 0.5s ease 0.15s; }
.page.active .page-inner { opacity: 1; transform: translateY(0); }

.btn-begin {
    padding: 14px 40px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Varela Round', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.btn-begin:hover { opacity: 0.85; }
.btn-begin:active { transform: scale(0.97); }

/* Right-align continue buttons in left-aligned page contexts */
.page-center-left .btn-begin,
.domain-intro-wrap .btn-begin {
    margin-left: auto;
    margin-right: 0;
    display: block;
    width: fit-content;
}

/* ===== PAGE 0.5: THE GRAVEYARD ===== */
.graveyard-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-height: 200px;
    transition: opacity 0.5s ease;
    width: 100%;
    max-width: 360px;
}

.graveyard-container.gy-fade-out { opacity: 0; }

.gy-line {
    font-size: 17px;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.7s ease, transform 0.7s ease, color 0.4s ease;
}

.gy-line.gy-visible { opacity: 1; transform: translateY(0); }

.gy-want { color: #111; }
.gy-want-header { margin-bottom: 2px; font-size: 24px; font-weight: 700; }
.gy-dim { color: #888; }
.gy-bold { color: #111; font-weight: 700; font-size: 22px; }
.gy-solo { margin-top: 0; align-self: center; }

.gy-grave {
    color: #666;
    position: relative;
    display: inline-block;
}

.gy-grave.gy-struck {
    color: #bbb;
}

.gy-grave.gy-struck::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #bbb;
    animation: strikeThrough 0.3s ease forwards;
}

@keyframes strikeThrough {
    from { width: 0; }
    to { width: 100%; }
}

.gy-spacer { height: 12px; }

.gy-btn {
    margin-top: 20px;
    opacity: 0 !important;
    animation: none !important;
    transition: opacity 0.6s ease, transform 0.15s;
}

.gy-btn.gy-visible { opacity: 1 !important; }

/* ===== PAGE 2: Y INTRO ===== */
.y-intro-wrap {
    text-align: left;
    max-width: 360px;
    width: 100%;
}

.y-intro-line {
    font-size: 17px;
    color: #111;
    line-height: 1.6;
}

.y-intro-bold {
    font-weight: 700;
    font-size: 22px;
    margin-bottom: 0;
}

.y-intro-dim {
    color: #888;
}

/* Line-by-line reveal for Y intro */
.page.active .y-intro-wrap { opacity: 1; transform: none; transition: none; }
.y-intro-wrap .y-intro-line,
.y-intro-wrap .y-intro-spacer,
.y-intro-wrap .btn-begin {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.y-intro-wrap .y-intro-line.y-line-visible,
.y-intro-wrap .y-intro-spacer.y-line-visible,
.y-intro-wrap .btn-begin.y-line-visible {
    opacity: 1;
    transform: translateY(0);
}

.y-intro-spacer {
    height: 16px;
}

/* ===== PAGE 4: THE FIRST GIVE ===== */
.first-give-wrap {
    text-align: left;
    max-width: 460px;
    width: 100%;
}

.fg-line {
    font-size: 34px;
    color: #888;
    line-height: 1.8;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fg-line.fg-visible {
    opacity: 1;
    transform: translateY(0);
}
.fg-spacer {
    height: 24px;
    opacity: 0;
}
.fg-spacer.fg-visible {
    opacity: 1;
}

.fg-anchor {
    color: #111;
    font-weight: 700;
    font-size: 36px;
}

.fg-segue {
    font-size: 15px;
    color: #999;
    letter-spacing: 0.3px;
}

/* ===== PAGE 2: DOMAIN INTRO ===== */
.domain-intro-wrap {
    text-align: left;
    max-width: 360px;
    width: 100%;
}

.domain-intro-text {
    font-size: 17px;
    color: #111;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 16px;
}

.domain-intro-domains {
    font-size: 16px;
    color: #888;
    line-height: 1.7;
    margin-bottom: 20px;
}

.domain-intro-sub {
    font-size: 15px;
    color: #999;
    line-height: 1.6;
    margin-bottom: 28px;
}

/* ===== MICRO-GIVES ===== */
.micro-give {
    font-size: 14px;
    color: #888;
    font-style: italic;
    margin-top: 16px;
    min-height: 20px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.micro-give.mg-visible { opacity: 1; transform: translateY(0); }

/* Full-screen affirmation overlay */
.micro-give-fullscreen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.micro-give-fullscreen.mg-fs-visible {
    opacity: 1;
}
.mg-fs-text {
    font-size: 20px;
    color: #111;
    font-style: italic;
    text-align: center;
    max-width: 320px;
    line-height: 1.6;
    padding: 0 28px;
}

/* ===== PAGE 1: IDENTITY QUESTION ===== */
.tf-context {
    font-size: 14px;
    color: #999;
    line-height: 1.6;
    margin-bottom: 16px;
}

.tf-question {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.3px;
    margin-bottom: 28px;
    color: #111;
    text-align: left;
}

.tf-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.tf-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 18px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Varela Round', sans-serif;
    color: #333;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    line-height: 1.45;
}

.tf-option:hover { border-color: rgba(0,0,0,0.25); background: #fafafa; }
.tf-option:active { transform: scale(0.98); }
.tf-option.selected { border-color: #111; background: #111; color: #fff; }
.tf-option.selected .tf-option-key { background: rgba(255,255,255,0.2); color: #fff; border-color: transparent; }

.tf-continue-btn {
    margin-top: 20px;
    margin-left: auto;
    margin-right: 0;
    display: block;
    width: fit-content;
}

.tf-option-key {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #999;
    transition: all 0.2s;
}

/* ===== PAGE 2: DOMAIN PULSE ===== */
.pulse-header {
    margin-bottom: 24px;
    text-align: left;
    width: 100%;
}

.pulse-intro {
    font-size: 14px;
    color: #888;
    line-height: 1.5;
    margin-bottom: 6px;
}

.pulse-intro-sub {
    font-size: 13px;
    color: #bbb;
    line-height: 1.55;
}

.pulse-progress {
    height: 2px;
    background: rgba(0,0,0,0.06);
    border-radius: 2px;
    margin-bottom: 32px;
    overflow: hidden;
    width: 100%;
}

.pulse-progress-fill {
    height: 100%;
    width: 0%;
    background: #111;
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.pulse-domain {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    animation: domainIn 0.45s ease;
}

.pulse-domain.active { display: flex; }

@keyframes domainIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.domain-icon {
    font-size: 18px;
    color: #ccc;
    margin-bottom: 8px;
}

.domain-name {
    font-size: 24px;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.3px;
    margin-bottom: 8px;
}

.domain-explain {
    font-size: 14px;
    color: #888;
    line-height: 1.6;
    margin-bottom: 28px;
    max-width: 360px;
}

.domain-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 360px;
}

.pulse-option {
    width: 100%;
    padding: 14px 20px;
    background: none;
    border: 1.5px solid rgba(0,0,0,0.12);
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Varela Round', sans-serif;
    font-size: 15px;
    color: #555;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.pulse-option:hover { border-color: rgba(0,0,0,0.3); color: #333; }
.pulse-option:active { transform: scale(0.97); }
.pulse-option.selected { background: #111; border-color: #111; color: #fff; }

/* ===== PAGE 3: PULSE RESULT ===== */
.pulse-result-wrap {
    max-width: 460px;
}

.pulse-result-line {
    font-size: 28px;
    font-weight: 700;
    color: #111;
    line-height: 1.5;
    margin-bottom: 16px;
    letter-spacing: -0.3px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.pulse-result-insight {
    font-size: 17px;
    color: #888;
    line-height: 1.7;
    margin-bottom: 0;
    font-style: italic;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.pulse-result-spacer {
    height: 24px;
}

.pulse-result-sub {
    font-size: 14px;
    color: #999;
    line-height: 1.6;
    margin-bottom: 28px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.pulse-result-wrap .btn-begin {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.pulse-result-line.pr-visible,
.pulse-result-insight.pr-visible,
.pulse-result-sub.pr-visible,
.pulse-result-wrap .btn-begin.pr-visible {
    opacity: 1;
    transform: translateY(0);
}

.pulse-result-visual {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 116px;
}

.pulse-result-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.pulse-result-bar-fill-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
    height: 100px;
}

.pulse-result-bar-score {
    font-size: 13px;
    font-weight: 600;
    color: #111;
    transition: opacity 0.4s ease;
    flex-shrink: 0;
}

.pulse-result-bar-fill {
    width: 100%;
    min-width: 32px;
    border-radius: 3px 3px 0 0;
    transition: height 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.pulse-result-bar-label {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    flex-shrink: 0;
}

/* ===== PAGE 4: IMPORT ===== */
#page5 .page-center {
    justify-content: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: 60px;
    padding-bottom: 40px;
}

.import-wrap {
    width: 100%;
    max-width: 440px;
    padding: 0 0 20px;
}

/* Line-by-line reveal for import */
.page.active .import-wrap { opacity: 1; transform: none; transition: none; }
.import-wrap .import-line,
.import-wrap .import-spacer,
.import-wrap .import-action-block {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.import-wrap .import-line.import-line-visible,
.import-wrap .import-spacer.import-line-visible,
.import-wrap .import-action-block.import-line-visible {
    opacity: 1;
    transform: translateY(0);
}

.import-line {
    font-size: 17px;
    color: #111;
    line-height: 1.5;
    margin: 0;
    text-align: left;
}

.import-bold {
    font-weight: 700;
    font-size: 19px;
}

.import-spacer {
    height: 16px;
}

/* Option A */
.import-option-a {
    margin-bottom: 0;
}

.import-option-label {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    letter-spacing: 0.3px;
    margin: 0 0 14px 0;
    cursor: pointer;
}

.import-option-a-body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.4s ease, margin 0.4s ease;
    margin-bottom: 0;
}
.import-option-a-body.option-open {
    max-height: 800px;
    opacity: 1;
    margin-bottom: 8px;
}

.import-option-desc {
    font-size: 15px;
    color: #888;
    line-height: 1.6;
    margin: 0;
}
.import-option-desc-bold {
    color: #111;
    font-weight: 600;
    margin-bottom: 20px;
}

.import-time-est {
    font-size: 13px;
    color: #bbb;
    margin-top: 6px;
    text-align: left;
}

/* Or divider */
.import-or-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: #bbb;
    margin: 24px 0;
}
.import-or-divider::before,
.import-or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

/* Option B */
.import-option-b {
    margin-bottom: 8px;
}

.import-option-b-label {
    font-size: 13px;
    font-weight: 600;
    color: #999;
    letter-spacing: 0.3px;
    margin: 0 0 8px 0;
    cursor: pointer;
}

.import-option-b-desc {
    font-size: 13px;
    color: #999;
    line-height: 1.6;
    margin: 0;
}

.import-option-b-summary {
    max-height: 200px;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    overflow: hidden;
}
.import-option-b-summary.summary-hidden {
    max-height: 0;
    opacity: 0;
}

.btn-long-way {
    background: none;
    border: none;
    font-size: 13px;
    font-family: 'Varela Round', sans-serif;
    color: #999;
    cursor: pointer;
    padding: 6px 0;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
    margin-top: 4px;
}
.btn-long-way:hover { color: #666; }

.import-option-b-body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.4s ease;
}
.import-option-b-body.option-open {
    max-height: 600px;
    opacity: 1;
}

.import-option-b-prompt {
    font-size: 14px;
    color: #888;
    line-height: 1.65;
    margin: 0 0 4px 0;
}

.import-option-b-prompt-sub {
    font-size: 13px;
    color: #bbb;
    font-style: italic;
    margin: 0 0 16px 0;
}

.import-paste-label {
    font-size: 14px;
    color: #aaa;
    margin-top: 24px;
    margin-bottom: 12px;
    text-align: left;
}

.ai-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

.ai-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 12px;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Varela Round', sans-serif;
    font-weight: 500;
    text-decoration: none;
    color: #111;
    transition: border-color 0.2s;
}

.ai-btn:hover { border-color: #111; }
.ai-btn-svg { width: 20px; height: 20px; flex-shrink: 0; }

.ai-buttons-hint {
    font-size: 12px;
    color: #bbb;
    margin-bottom: 10px;
    text-align: left;
}

.prompt-copy-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f5f5;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
}

.prompt-copy-text {
    flex: 1;
    font-size: 13px;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prompt-copy-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Varela Round', sans-serif;
    color: #888;
    padding: 4px 10px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.prompt-copy-btn:hover { color: #111; border-color: #aaa; }
.prompt-copy-btn.copied { color: #2a9d5c; border-color: #2a9d5c; }

#memoryInput,
#manualInput {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
    font-size: 14px;
}

.import-paste-nudge {
    font-size: 13px;
    color: #bbb;
    margin-top: 8px;
    font-style: italic;
    text-align: left;
}

.import-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
}

.btn-generate {
    padding: 18px 36px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-family: 'Varela Round', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    width: 100%;
    max-width: 340px;
}

.btn-generate:hover:not(:disabled) { opacity: 0.85; }
.btn-generate:disabled { opacity: 0.25; cursor: not-allowed; }

.btn-dummy {
    background: transparent;
    border: none;
    font-size: 13px;
    font-family: 'Varela Round', sans-serif;
    color: #bbb;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s;
}

.btn-dummy:hover { color: #888; }

.privacy-line {
    font-size: 12px;
    color: #999;
    margin-top: 12px;
    text-align: center;
}

.error-msg {
    margin-top: 16px;
    font-size: 14px;
    color: #c00;
    text-align: center;
}

/* ===== PAGE 5: LOADING ===== */
.loading-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.loader-bar {
    width: 200px;
    height: 2px;
    background: rgba(0,0,0,0.06);
    border-radius: 2px;
    overflow: hidden;
}

.loader-bar-fill {
    height: 100%;
    background: #111;
    border-radius: 2px;
    width: 0%;
}

.loader-text {
    font-size: 13px;
    color: #999;
    margin-top: 16px;
    letter-spacing: 0.3px;
    transition: opacity 0.4s ease;
}

.loader-text.swapping { opacity: 0; }

.loader-error { text-align: center; margin-top: 24px; }
.loader-error-text { font-size: 14px; color: #888; margin-bottom: 16px; }
.btn-retry { width: auto; padding: 12px 28px; margin-top: 0; }

/* ===== POST-CARD: HORIZONTAL FUNNEL ===== */
.funnel-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #fff;
}

.funnel-track {
    display: flex;
    height: 100%;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.funnel-track::-webkit-scrollbar { display: none; }

.funnel-page {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.funnel-page-inner {
    max-width: 420px;
    width: 100%;
    padding: 0 28px;
    text-align: left;
}

/* Fade-in on scroll into view */
.funnel-page .funnel-page-inner { opacity: 0; transform: translateY(14px); transition: opacity 0.7s ease, transform 0.7s ease; }
.funnel-page.in-view .funnel-page-inner { opacity: 1; transform: translateY(0); }

/* Mirror moment */
.mirror-center {
    text-align: center;
    width: 100%;
}

.mirror-text {
    font-size: 22px;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.3px;
    opacity: 0;
    animation: mirrorIn 1.2s ease 0.3s forwards;
}

@keyframes mirrorIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Card page */
.funnel-page-card {
    flex-direction: column;
    padding: 40px 24px 20px;
}

/* Screen labels & body */
.screen-label {
    font-size: 24px;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.3px;
    margin-bottom: 24px;
}

.screen-body {
    font-size: 17px;
    color: #333;
    line-height: 1.75;
}

.screen-body .sentence {
    display: block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    margin-bottom: 0.55em;
}

.screen-body .sentence:last-child { margin-bottom: 0; }
.screen-body .sentence.sentence-visible { opacity: 1; transform: translateY(0); }

.screen-body .pct {
    font-weight: 600;
    color: #111;
}

.sentence-trail {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.sentence-trail.sentence-visible { opacity: 1; transform: translateY(0); }

.foreshadow-line {
    font-size: 15px;
    color: #888;
    margin-top: 28px;
    font-style: italic;
}

.assignment-explainer {
    font-size: 15px;
    color: #888;
    line-height: 1.65;
    margin-top: 28px;
}

/* ===== APPLY ===== */
.apply-context {
    font-size: 14px;
    color: #888;
    line-height: 1.6;
    margin-bottom: 24px;
    text-align: center;
}

.apply-heading-text {
    font-size: 20px;
    font-weight: 500;
    color: #111;
    margin-bottom: 28px;
    text-align: center;
}

.apply-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

.form-field { text-align: left; }

.form-label {
    display: block;
    font-size: 10px;
    letter-spacing: 1.5px;
    color: #999;
    margin-bottom: 6px;
    font-weight: 500;
}

.btn-apply {
    width: 100%;
    padding: 14px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Varela Round', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-top: 6px;
}

.btn-apply:hover:not(:disabled) { opacity: 0.85; }
.btn-apply:disabled { opacity: 0.3; cursor: not-allowed; }

.apply-note-text { font-size: 13px; color: #999; margin-top: 16px; text-align: center; }
.apply-error { font-size: 14px; color: #c00; margin-top: 12px; text-align: center; }

/* ===== CONFIRMATION ===== */
.confirm-badge {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 2px;
    color: #111;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 20px;
    padding: 6px 16px;
    margin-bottom: 24px;
}

.confirm-title { font-size: 28px; font-weight: 700; color: #111; margin-bottom: 14px; }
.confirm-sub { font-size: 14px; color: #888; line-height: 1.6; margin-bottom: 32px; }

.confirm-steps { text-align: left; margin: 0 auto; max-width: 320px; }
.confirm-step { font-size: 15px; color: #333; padding: 8px 0; letter-spacing: 0.3px; }

.confirm-email-note { font-size: 14px; color: #888; margin-top: 28px; }

.manifesto-link {
    display: inline-block;
    margin-top: 28px;
    font-size: 13px;
    color: #999;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: color 0.3s;
}

.manifesto-link:hover { color: #000; }

/* ===== CHARACTER CARD ===== */
.card {
    width: 380px;
    max-width: 100%;
    border-radius: 22px;
    padding: 28px 28px 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3), 0 12px 40px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.08);
    margin: 0 auto;
    animation: sheetReveal 0.6s ease;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(115deg, transparent 0%, transparent 30%, rgba(255,255,255,0.12) 45%, rgba(255,255,255,0.03) 50%, transparent 55%, transparent 100%);
    pointer-events: none;
}

.card::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.055;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    pointer-events: none;
}

.card > * { position: relative; z-index: 2; }

/* Card text — light mode (dark gradients) */
.card .player-name { color: rgba(255,255,255,0.95); font-size: 13px; font-weight: 600; letter-spacing: 0.2px; }
.card .player-num { color: rgba(255,255,255,0.4); font-size: 11px; letter-spacing: 1px; }
.card .card-brand { color: rgba(255,255,255,0.4); font-size: 11px; letter-spacing: 1px; }
.card .archetype-name { background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.7)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; color: rgba(255,255,255,0.95); font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -0.5px; margin-bottom: 4px; }
.card .rising { color: rgba(255,255,255,0.4); font-size: 13px; font-style: italic; margin-bottom: 18px; }
.card .rising span { color: rgba(255,255,255,0.7); }
.card .subtitle { color: rgba(255,255,255,0.6); font-size: 14px; line-height: 1.65; font-style: italic; font-weight: 300; margin-bottom: 20px; }
.card .trait-label { color: rgba(255,255,255,0.4); font-size: 7px; letter-spacing: 3px; text-transform: uppercase; font-weight: 600; margin-bottom: 3px; }
.card .trait-value { color: rgba(255,255,255,0.95); font-size: 16px; font-weight: 400; }
.card .trait-value-blind { color: rgba(255,255,255,0.95); }
.card .stat-label { color: rgba(255,255,255,0.4); font-size: 9px; letter-spacing: 2.5px; text-transform: uppercase; font-weight: 500; }
.card .stat-val { color: rgba(255,255,255,0.95); font-size: 19px; font-weight: 500; }
.card .stat-bar-bg { background: rgba(255,255,255,0.1); height: 3px; border-radius: 2px; overflow: hidden; }
.card .stat-bar-fill { height: 100%; border-radius: 2px; background: rgba(255,255,255,0.6); width: 0%; transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1); }
.card .stat-bar-fill.stat-bar-high { background: rgba(255,255,255,0.9); }
.card .stat-bar-fill.stat-bar-low { background: rgba(255,255,255,0.2); }
.card .y-mark { color: rgba(255,255,255,0.06); font-size: 11px; text-align: center; margin-top: 8px; letter-spacing: 4px; font-weight: 500; }

/* Card dark text mode */
.card[data-text-mode="dark"] .player-name { color: rgba(0,0,0,0.85); }
.card[data-text-mode="dark"] .player-num { color: rgba(0,0,0,0.45); }
.card[data-text-mode="dark"] .card-brand { color: rgba(0,0,0,0.45); }
.card[data-text-mode="dark"] .archetype-name { background: none; -webkit-background-clip: unset; -webkit-text-fill-color: rgba(0,0,0,0.85); background-clip: unset; color: rgba(0,0,0,0.85); }
.card[data-text-mode="dark"] .rising { color: rgba(0,0,0,0.45); }
.card[data-text-mode="dark"] .rising span { color: rgba(0,0,0,0.65); }
.card[data-text-mode="dark"] .subtitle { color: rgba(0,0,0,0.55); }
.card[data-text-mode="dark"] .trait-label { color: rgba(0,0,0,0.45); }
.card[data-text-mode="dark"] .trait-value { color: rgba(0,0,0,0.85); }
.card[data-text-mode="dark"] .stat-label { color: rgba(0,0,0,0.45); }
.card[data-text-mode="dark"] .stat-val { color: rgba(0,0,0,0.85); }
.card[data-text-mode="dark"] .stat-bar-bg { background: rgba(0,0,0,0.1); }
.card[data-text-mode="dark"] .stat-bar-fill { background: rgba(0,0,0,0.5); }
.card[data-text-mode="dark"] .stat-bar-fill.stat-bar-high { background: rgba(0,0,0,0.7); }
.card[data-text-mode="dark"] .stat-bar-fill.stat-bar-low { background: rgba(0,0,0,0.18); }
.card[data-text-mode="dark"] .y-mark { color: rgba(0,0,0,0.06); }

.header-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 24px; }
.traits { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin-bottom: 22px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin-bottom: 22px; }
.stat { display: flex; flex-direction: column; gap: 5px; }
.stat-top { display: flex; justify-content: space-between; align-items: baseline; }

.btn-share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    color: #999;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-top: 16px;
}

.btn-share-icon:hover { color: #111; border-color: #111; }

/* Reveal animations */
.reveal { opacity: 0; transform: translateY(6px); transition: opacity 1.6s ease, transform 1.4s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-blur { opacity: 0; filter: blur(14px); transform: translateY(6px); transition: opacity 2s ease, filter 2.2s ease, transform 1.8s ease; }
.reveal-blur.visible { opacity: 1; filter: blur(0px); transform: translateY(0); }

/* Page turn hint */
.page-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 22px;
    color: #111;
    letter-spacing: 1px;
    cursor: pointer;
    user-select: none;
    animation: hintPulse 1.6s ease-in-out infinite;
    white-space: nowrap;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.5; transform: translateX(calc(-50% + 0px)); }
    50% { opacity: 1; transform: translateX(calc(-50% + 8px)); }
}

@keyframes sheetReveal {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Screenshot mode — force full visibility for html2canvas */
.screenshot-mode {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

.screenshot-mode .reveal,
.screenshot-mode .reveal-blur {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    transition: none !important;
}

.screenshot-mode .archetype-name {
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
}

.screenshot-mode::before,
.screenshot-mode::after {
    display: none !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .tf-question { font-size: 19px; }
    .tf-option { padding: 13px 15px; font-size: 14px; }
    .domain-name { font-size: 21px; }
    .scale-dot::before { width: 32px; height: 32px; }
    .import-line { font-size: 15px; }
    .import-bold { font-size: 17px; }
    .screen-label { font-size: 20px; }
    .screen-body { font-size: 16px; }
    .card { padding: 24px 22px 20px; border-radius: 18px; }
    .card .archetype-name { font-size: 28px; }
    .card .stat-val { font-size: 17px; }
    .funnel-page-inner { padding: 0 22px; }
    .assignment-explainer { font-size: 14px; }
    .gy-line { font-size: 15px; }
    .gy-bold { font-size: 20px; }
    .fg-line { font-size: 28px; }
    .fg-anchor { font-size: 30px; }
    .y-intro-bold { font-size: 20px; }
    .y-intro-line { font-size: 15px; }
    .domain-intro-text { font-size: 15px; }
    .domain-intro-domains { font-size: 14px; }
    .pulse-result-line { font-size: 24px; }
    .pulse-result-insight { font-size: 15px; }
}
