:root {
    color-scheme: dark;
    --bg: #060606;
    --bg-secondary: #0f0f10;
    --surface: rgba(16, 16, 18, 0.94);
    --surface-soft: rgba(24, 24, 28, 0.86);
    --surface-elevated: linear-gradient(180deg, rgba(28, 28, 33, 0.98), rgba(16, 16, 18, 0.95));
    --text: #f6ede5;
    --muted: #a99f97;
    --line: rgba(255, 255, 255, 0.08);
    --accent: #ff7a18;
    --accent-soft: #ffb878;
    --accent-glow: rgba(255, 122, 24, 0.28);
    --chip: rgba(255, 255, 255, 0.05);
    --shadow: 0 32px 80px rgba(0, 0, 0, 0.46);
    --container: min(1120px, calc(100vw - 28px));
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 18px;
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #f7f0e9;
    --bg-secondary: #efe5dc;
    --surface: rgba(255, 250, 246, 0.96);
    --surface-soft: rgba(255, 245, 237, 0.92);
    --surface-elevated: linear-gradient(180deg, rgba(255, 250, 246, 0.98), rgba(249, 241, 233, 0.96));
    --text: #241710;
    --muted: #735f54;
    --line: rgba(36, 23, 16, 0.1);
    --accent: #d86108;
    --accent-soft: #a84400;
    --accent-glow: rgba(216, 97, 8, 0.18);
    --chip: rgba(36, 23, 16, 0.04);
    --shadow: 0 24px 60px rgba(61, 33, 13, 0.12);
}

html[data-theme="light"] .live-select select {
    background: rgba(255, 248, 242, 0.95);
    border-color: rgba(36, 23, 16, 0.15);
}

html[data-theme="light"] .gradient-text,
html[data-theme="light"] .hero-center h1 {
    background: linear-gradient(135deg, #b94f00 0%, #3a2417 76%);
    -webkit-background-clip: text;
    background-clip: text;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    font-family: "Plus Jakarta Sans", sans-serif;
    background:
        radial-gradient(circle at 10% 0%, rgba(255, 122, 24, 0.18), transparent 24%),
        radial-gradient(circle at 100% 22%, rgba(140, 58, 0, 0.22), transparent 24%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-secondary) 100%);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.04;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 120px 120px;
    mask-image: radial-gradient(circle at center, black, transparent 82%);
}

.container {
    width: var(--container);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(18px);
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    border-bottom: 1px solid var(--line);
}

.nav-shell,
.top-controls,
.nav-links,
.brand,
.reader-actions,
.tool-meta,
.result-tags,
.result-header {
    display: flex;
    align-items: center;
}

.nav-shell {
    justify-content: space-between;
    gap: 18px;
    padding: 14px 0;
}

.brand {
    gap: 12px;
}

.brand strong,
.brand small,
.button,
.hero-center h1,
.tool-header h2,
.section-heading h2,
.showcase-copy h2,
.step-card h3,
.feature-card h3,
.testimonial-card strong,
.result-header h3 {
    font-family: "Outfit", sans-serif;
}

.brand small,
.tool-header small,
.result-header small,
.prompt-dialog-head small {
    display: block;
    color: var(--muted);
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, #ff8d32, #8b3700);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 12px 28px var(--accent-glow);
}

.nav-links {
    gap: 26px;
}

.nav-links a,
.footer-grid a {
    color: var(--muted);
    transition: color 180ms ease, transform 180ms ease;
}

.nav-links a:hover,
.footer-grid a:hover {
    color: var(--text);
    transform: translateY(-1px);
}

.top-controls {
    gap: 10px;
}

.top-select {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--chip);
    border: 1px solid var(--line);
}

.top-select span {
    color: var(--muted);
    font-size: 0.85rem;
}

.top-select select,
.field input,
.field select,
.field textarea {
    color: var(--text);
    background: transparent;
    border: 0;
    outline: none;
}

.icon-button,
.button,
.prompt-launch,
.prompt-option {
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.icon-button,
.close-dialog {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 14px;
    background: var(--chip);
    color: var(--text);
    cursor: pointer;
}

.icon-button:hover,
.button:hover,
.prompt-launch:hover,
.prompt-option:hover {
    transform: translateY(-2px);
}

.button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    padding: 0 18px;
    border: 1px solid transparent;
    cursor: pointer;
}

.button-primary {
    color: #fff7f0;
    background: linear-gradient(135deg, #ff7a18, #ff962e);
    box-shadow: 0 16px 36px var(--accent-glow);
}

.button-outline {
    color: var(--accent-soft);
    border-color: rgba(255, 122, 24, 0.52);
    background: rgba(255, 122, 24, 0.08);
}

.button-muted {
    color: var(--text);
    background: var(--chip);
    border-color: var(--line);
}

.top-controls form,
.nav-actions form {
    margin: 0;
}

.button-wide {
    width: 100%;
}

.hero {
    padding: 42px 0 36px;
}

.hero-compact-inner {
    display: grid;
    gap: 26px;
}

.hero-center,
.section-heading {
    text-align: center;
}

.hero-center {
    max-width: 760px;
    margin: 0 auto;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-soft);
    background: rgba(255, 122, 24, 0.08);
    border: 1px solid rgba(255, 122, 24, 0.22);
}

.hero-center h1,
.tool-header h2,
.section-heading h2,
.showcase-copy h2 {
    margin: 0;
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.hero-center h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    background: linear-gradient(135deg, #ff821f 0%, #ffd8ba 70%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-center p,
.section-heading p,
.showcase-copy p,
.feature-card p,
.step-card p,
.testimonial-card p,
.site-footer p,
.story-content,
.empty-state p,
.result-summary {
    color: var(--muted);
    line-height: 1.7;
}

/* Shared surface styles */
.tool-shell,
.feature-card,
.testimonial-card,
.site-footer,
.tool-frame,
.result-panel,
.prompt-dialog {
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.tool-frame {
    padding: 18px;
    border-radius: var(--radius-xl);
    background: var(--surface-elevated);
}

.tool-frame-live {
    padding: 0;
    overflow: clip; /* clips visually for border-radius, but doesn't block child scroll */
}

.live-bar {
    display: grid;
    grid-template-columns: 24px 1fr 24px;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(27, 29, 35, 0.88);
}

.live-bar strong {
    text-align: center;
    font-family: "Outfit", sans-serif;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
}

.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 18px var(--accent-glow);
}

.tool-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 8px 8px 18px;
}

.tool-meta {
    gap: 10px;
    flex-wrap: wrap;
}

.tool-meta span,
.result-tags span {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 122, 24, 0.08);
    color: var(--accent-soft);
    font-size: 0.82rem;
    border: 1px solid rgba(255, 122, 24, 0.18);
}

.story-form {
    display: grid;
    gap: 18px;
}

.story-form-live {
    padding: 22px 22px 18px;
}

.tool-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.9fr;
    gap: 18px;
}

.live-step {
    display: grid;
    gap: 14px;
}

.step-label {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    color: var(--text);
    font-family: "Outfit", sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.step-label span {
    color: inherit;
}

.live-selects {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    padding-bottom: 4px;
}

.tool-shell {
    padding: 0px;
    border-radius: var(--radius-xl);
}

.tool-frame {
    border-radius: calc(var(--radius-xl) - 6px);
}

.live-select select {
    width: 100%;
    min-height: 52px;
    padding: 0 40px 0 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(18, 18, 20, 0.94);
    color: var(--text);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a99f97' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.advanced-inline {
    display: grid;
    grid-template-columns: 1.2fr repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding-top: 6px;
}

.tool-main,
.tool-sidebar {
    display: grid;
    gap: 14px;
}

.field {
    display: grid;
    gap: 8px;
}

.field span,
.result-stats small {
    color: #d9c7bc;
    font-size: 0.92rem;
}

html[data-theme="light"] .field span,
html[data-theme="light"] .result-stats small {
    color: #6d5548;
}

/* Shared border-radius */
.field textarea,
.field input,
.field select,
.range-shell,
.result-storybox,
.result-sidebox,
.feature-card,
.testimonial-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.field textarea,
.field input,
.field select {
    width: 100%;
    padding: 14px 16px;
}

.field textarea {
    min-height: 180px;
    resize: vertical;
}

.field textarea:focus,
.field input:focus,
.field select:focus {
    box-shadow: 0 0 0 4px rgba(255, 122, 24, 0.12);
}

.choice-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.choice-row-tight {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-pill input {
    display: none;
}

.choice-pill span {
    display: block;
    text-align: center;
    padding: 12px 10px;
    border-radius: 14px;
    background: var(--chip);
    border: 1px solid var(--line);
    cursor: pointer;
}

.choice-pill input:checked + span {
    background: rgba(255, 122, 24, 0.14);
    color: var(--accent-soft);
    border-color: rgba(255, 122, 24, 0.44);
}

.range-shell {
    padding: 14px 16px;
}

.range-shell input[type="range"] {
    width: 100%;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
}

.range-labels strong {
    color: var(--accent-soft);
}

.prompt-input-wrap {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
}

.prompt-launch {
    min-height: 48px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 122, 24, 0.34);
    background: rgba(255, 122, 24, 0.1);
    color: var(--accent-soft);
    cursor: pointer;
}

.tool-actions {
    padding-top: 4px;
}

.live-output {
    position: relative;
    min-height: 230px;
    display: flex;
    flex-direction: column;
    margin-top: 4px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #050505;
    overflow: hidden;
}

html[data-theme="light"] .live-output {
    border-color: rgba(36, 23, 16, 0.12);
    background: rgba(255, 250, 246, 0.94);
    color: var(--text);
}

.live-output-text {
    max-height: 320px;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding-right: 8px; /* prevents text from sitting flush against the scrollbar */
    min-height: 150px;
}

/* Optional nice scrollbar */
.live-output-text::-webkit-scrollbar {
    width: 6px;
}

.live-output-text::-webkit-scrollbar-thumb {
    background: #ff7a18;
    border-radius: 10px;
}

.live-output-text h4 {
    margin: 0 0 10px;
    font-family: "Outfit", sans-serif;
    font-size: 1.3rem;
}

.live-output-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 12px;
}

.tool-icon {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.tool-icon img {
    width: 18px;
    height: 18px;
    filter: invert(52%) sepia(98%) saturate(1200%) hue-rotate(360deg) brightness(103%);
}

.tool-icon:hover {
    background: rgba(255, 122, 24, 0.08);
}

.live-cursor {
    color: var(--accent);
}

.story-copy {
    white-space: pre-wrap;
    line-height: 1.75;
}

.story-rating-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding: 14px 0 16px;
    border-top: 1px solid var(--line);
}

.story-rating-panel p {
    margin: 4px 0 0;
    color: var(--muted);
}

.story-rating-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rating-select {
    min-width: 130px;
}

.is-hidden {
    display: none;
}

.loading-indicator {
    text-align: center;
    padding: 20px;
}

.spinner {
    width: 28px;
    height: 28px;
    margin: 0 auto 12px;
    border-radius: 50%;
    border: 3px solid rgba(255, 122, 24, 0.18);
    border-top-color: var(--accent);
    animation: spin 0.9s linear infinite;
}

.ajax-alert[hidden],
.loading-indicator[hidden] {
    display: none;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.auth-page,
.history-page {
    padding: 48px 0 80px;
}

.auth-shell {
    max-width: 620px;
}

.admin-upload-shell {
    max-width: 880px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 160px;
    gap: 14px;
}

.admin-section-title {
    display: grid;
    gap: 4px;
    margin: 4px 0 12px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 122, 24, 0.2);
    background: rgba(255, 122, 24, 0.08);
}

.admin-section-title span {
    color: var(--muted);
    font-size: 0.92rem;
}

.admin-image-pairs {
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
}

.admin-image-row {
    display: grid;
    grid-template-columns: minmax(180px, 0.45fr) minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.admin-remove-image {
    min-height: 48px;
}

.auth-card {
    display: grid;
    gap: 22px;
}

.auth-card h1 {
    margin: 0;
    line-height: 1.05;
}

.story-page .site-header {
    position: sticky;
}

.story-layout {
    padding: 44px 0 84px;
}

.story-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
    gap: 24px;
    align-items: start;
}

.reader-card,
.side-panel {
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.reader-card {
    display: grid;
    gap: 22px;
    padding: 30px;
    border-radius: 30px;
    background:
        radial-gradient(circle at top left, rgba(255, 122, 24, 0.1), transparent 34%),
        var(--surface-elevated);
}

.reader-topline {
    display: grid;
    gap: 14px;
}

.story-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.story-tags span,
.mini-recent-list a span {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 122, 24, 0.08);
    color: var(--accent-soft);
    font-size: 0.82rem;
    border: 1px solid rgba(255, 122, 24, 0.18);
}

.reader-card h1 {
    margin: 0;
    font-size: clamp(2.3rem, 5vw, 4rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
    max-width: 16ch;
}

.reader-summary {
    margin: 0;
    max-width: 60ch;
    font-size: clamp(1.1rem, 1.8vw, 1.35rem);
    line-height: 1.45;
    color: #eadbd0;
}

html[data-theme="light"] .reader-summary {
    color: #4d382c;
}

.reader-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.reader-meta div {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

html[data-theme="light"] .reader-meta div,
html[data-theme="light"] .detail-rating-panel,
html[data-theme="light"] .mini-recent-list a {
    background: rgba(36, 23, 16, 0.035);
}

.reader-meta small,
.story-facts dt {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.reader-meta strong,
.story-facts dd,
.side-panel h2 {
    color: var(--text);
    font-family: "Outfit", sans-serif;
}

.reader-actions {
    flex-wrap: wrap;
    gap: 12px;
}

.reader-actions .button {
    min-width: 142px;
}

.detail-rating-panel {
    margin: 0;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.025);
}

.detail-rating-panel strong {
    display: block;
    font-size: 1.15rem;
    font-family: "Outfit", sans-serif;
}

.story-content {
    display: block;
    padding: 28px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: rgba(5, 5, 5, 0.68);
    color: #cdbfb6;
    font-size: clamp(1.15rem, 1.5vw, 1.28rem);
    line-height: 1.95;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

html[data-theme="light"] .story-content {
    background: rgba(255, 250, 246, 0.82);
    color: #352319;
}

.story-sidebar {
    display: grid;
    gap: 18px;
    position: sticky;
    top: 92px;
    align-self: start;
}

.side-panel {
    padding: 22px;
    border-radius: 24px;
}

.side-panel h2 {
    margin: 0 0 16px;
    font-size: 1.2rem;
}

.story-facts,
.beats-list,
.mini-recent-list {
    margin: 0;
}

.story-facts {
    display: grid;
    gap: 14px;
}

.story-facts div {
    display: grid;
    gap: 4px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.story-facts div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.story-facts dd {
    margin: 0;
    font-size: 1rem;
}

.beats-list {
    display: grid;
    gap: 10px;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.65;
}

.mini-recent-list {
    display: grid;
    gap: 12px;
}

.mini-recent-list a {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.mini-recent-list a:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 122, 24, 0.28);
    background: rgba(255, 122, 24, 0.06);
}

.mini-recent-list a strong {
    font-size: 1rem;
    line-height: 1.35;
}

.story-page .reveal,
.story-page .reveal-delay {
    opacity: 1;
    transform: none;
    transition: none;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 22px;
    align-items: stretch;
}

.history-card {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
    gap: 16px;
    min-width: 0;
    padding: 26px;
    overflow: hidden;
}

.history-card-head,
.history-meta,
.nav-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.history-card-head {
    align-items: flex-start;
}

.history-card-head .eyebrow,
.history-card-head small,
.history-card h3,
.history-card p,
.history-card .button,
.history-meta span {
    min-width: 0;
}

.history-card-head small {
    flex-shrink: 0;
    color: var(--text);
    white-space: nowrap;
}

.history-card h3 {
    margin: 6px 0 0;
    font-size: clamp(1.4rem, 2vw, 1.9rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.history-card p {
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
}

.history-tags span {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.history-card .button {
    width: 100%;
    margin-top: auto;
}

.history-meta {
    color: var(--muted);
    font-size: 0.9rem;
    padding-top: 2px;
    border-top: 1px solid var(--line);
}

.empty-history {
    max-width: 760px;
    margin: 0 auto;
}

.detail-rating-panel {
    margin-bottom: 22px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.result-summary {
    margin-top: 0;
    margin-bottom: 14px;
}

.button-live {
    min-height: 56px;
    border-radius: 16px;
    font-size: 1.05rem;
}

/* ============================================================
   PROOF STRIP
   ============================================================ */
.proof-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 18px;
}

.avatar-row {
    display: flex;
    align-items: center;
}

.avatar-row img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-left: -12px;
    border: 3px solid var(--bg);
    object-fit: cover;
}

.avatar-row img:first-child {
    margin-left: 0;
}

.proof-divider {
    width: 1px;
    height: 48px;
    border-left: 2px dashed rgba(255, 255, 255, 0.15);
}

html[data-theme="light"] .proof-divider {
    border-color: rgba(36, 23, 16, 0.15);
}

.proof-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.proof-stars {
    color: #ffffff;
    font-size: 1rem;
    letter-spacing: 4px;
}

html[data-theme="light"] .proof-stars {
    color: var(--accent);
}

.proof-text strong {
    font-family: "Outfit", sans-serif;
    font-size: 1.1rem;
    color: var(--text);
}

/* ============================================================
   FEATURE CARDS
   ============================================================ */
.feature-band,
.showcase-section,
.testimonial-section,
.site-footer {
    padding: 38px 0 76px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.feature-card,
.testimonial-card {
    padding: 22px;
    border-radius: var(--radius-lg);
}

.card-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    margin-bottom: 16px;
    color: var(--accent-soft);
    background: rgba(255, 122, 24, 0.1);
    border: 1px solid rgba(255, 122, 24, 0.2);
    font-family: "Outfit", sans-serif;
}

/* ============================================================
   SHOWCASE
   ============================================================ */
.showcase-pair {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 28px;
    align-items: center;
    margin-bottom: 28px;
}

.reverse-pair {
    grid-template-columns: 1.1fr 0.9fr;
}

/* Image slot — clean, transparent */
.image-slot {
    min-height: 360px;
    padding: 20px;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--muted);
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
}

.image-slot img {
    max-width: 65%;
    height: auto;
    object-fit: contain;
}

.image-slot-tall {
    min-height: 420px;
}

.image-slot-angled {
    transform: rotate(-8deg);
}

/* ============================================================
   STEPS SECTION
   ============================================================ */
.steps-section {
    padding: 60px 0 80px;
}

.steps-section .section-heading h2 {
    font-style: italic;
}

.section-heading {
    max-width: 720px;
    margin: 0 auto 26px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    position: relative;
    padding-top: 30px;
}

/* Horizontal connecting line */
.steps-connector {
    position: absolute;
    top: 62px;
    left: 16%;
    right: 16%;
    height: 2px;
    background: var(--line);
    z-index: 0;
    grid-column: 1 / -1;
}

/* Step card — transparent, centered */
.step-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 22px 16px;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    position: relative;
    z-index: 1;
}

/* Icon wrapper with badge */
.step-icon-wrap {
    position: relative;
    margin-bottom: 20px;
}

.step-icon-wrap img {
    width: 52px;
    height: 52px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
}

html[data-theme="light"] .step-icon-wrap img {
    background: rgba(36, 23, 16, 0.05);
}

/* Orange numbered badge */
.step-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: "Outfit", sans-serif;
    display: grid;
    place-items: center;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.step-card h3 {
    font-size: 1.05rem;
    margin: 0 0 8px;
    color: var(--text);
}

.step-card p {
    font-size: 0.88rem;
    max-width: 220px;
    margin: 0;
}

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    border-top: 1px solid var(--line);
    margin-top: 10px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 24px;
}

.footer-grid h4 {
    margin-top: 0;
    margin-bottom: 14px;
}

.footer-grid a {
    display: block;
    margin-bottom: 10px;
}

/* ============================================================
   PROMPT DIALOG
   ============================================================ */
.prompt-dialog {
    width: min(760px, calc(100vw - 22px));
    border-radius: 24px;
    padding: 20px;
    color: var(--text);
}

.prompt-dialog::backdrop {
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
}

.prompt-dialog-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.prompt-dialog-head h3 {
    margin: 4px 0 0;
    font-family: "Outfit", sans-serif;
}

.prompt-dialog-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.prompt-option {
    text-align: left;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--chip);
    color: var(--text);
    cursor: pointer;
}

/* ============================================================
   FORM ALERT / EMPTY STATE
   ============================================================ */
.form-alert {
    margin-bottom: 16px;
    padding: 16px 18px;
    border-radius: 18px;
    color: #ffe0cf;
    background: rgba(164, 58, 0, 0.22);
    border: 1px solid rgba(255, 122, 24, 0.24);
}

.form-alert-success {
    color: #dbffe9;
    background: rgba(22, 121, 70, 0.22);
    border-color: rgba(95, 214, 139, 0.28);
}

html[data-theme="light"] .form-alert {
    color: #3a2417;
    background: rgba(255, 122, 24, 0.1);
    border-color: rgba(191, 80, 0, 0.24);
}

html[data-theme="light"] .form-alert-success {
    color: #183a24;
    background: rgba(33, 150, 83, 0.1);
    border-color: rgba(33, 150, 83, 0.26);
}

.empty-state {
    min-height: 220px;
    display: grid;
    place-items: center;
    text-align: center;
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 650ms ease, transform 650ms ease;
}

.reveal-delay {
    transition-delay: 120ms;
}

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

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
    .nav-links {
        display: none;
    }

    .tool-grid,
    .result-grid,
    .story-grid,
    .showcase-pair,
    .reverse-pair,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .cards-grid,
    .testimonial-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .live-selects,
    .advanced-inline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .story-sidebar {
        position: static;
    }
}

@media (max-width: 760px) {
    .nav-shell,
    .top-controls,
    .result-header,
    .proof-strip {
        flex-direction: column;
        align-items: stretch;
    }

    .top-controls {
        width: 100%;
    }

    .top-select,
    .icon-button,
    .button-outline {
        justify-content: center;
    }

    .choice-row,
    .prompt-dialog-list,
    .admin-form-grid,
    .admin-image-row,
    .cards-grid,
    .testimonial-grid,
    .steps-grid,
    .history-grid,
    .reader-meta,
    .live-selects,
    .advanced-inline {
        grid-template-columns: 1fr;
    }

    .story-rating-panel,
    .story-rating-actions,
    .nav-actions,
    .reader-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .history-card-head,
    .history-meta {
        flex-direction: row;
        align-items: center;
    }

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

    .tool-frame,
    .result-panel,
    .feature-card,
    .testimonial-card {
        padding: 16px;
    }

    .reader-card,
    .side-panel,
    .story-content {
        padding: 20px;
    }

    .reader-card h1 {
        max-width: none;
        font-size: clamp(2rem, 10vw, 2.9rem);
    }

    .steps-connector {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

.gradient-text {
    background: linear-gradient(135deg, #ff821f 0%, #ffd8ba 70%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.italic {
    font-style: italic;
}
.social-links {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

.social-links img {
    width: 30px;
    height: 30px;
    filter: invert(52%) sepia(98%) saturate(1200%) hue-rotate(360deg) brightness(103%);
}

.footer-bottom {
    margin-top: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.footer-legal {
    display: flex;
    gap: 14px;
}

.footer-legal a {
    color: var(--muted);
    font-size: 0.85rem;
}

.footer-legal a:hover {
    color: var(--accent-soft);
}

@media (max-width: 760px) {
    .footer-bottom-inner {
        flex-direction: column;
        text-align: center;
    }
}

.store-links {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.store-links img {
    height: 40px;
    width: auto;
}
