:root {
    --font-ui: Verdana, "Segoe UI", Tahoma, Arial, sans-serif;
    --bg: #f7efe3;
    --bg-deep: #f2e0c8;
    --panel: rgba(255, 251, 246, 0.9);
    --panel-strong: #fffdf9;
    --ink: #263238;
    --muted: #6f7a80;
    --accent: #dd6b20;
    --accent-dark: #b45309;
    --accent-soft: rgba(221, 107, 32, 0.14);
    --success: #2f855a;
    --warning: #b7791f;
    --pending: #4a5568;
    --outline: rgba(38, 50, 56, 0.12);
    --shadow: 0 18px 45px rgba(87, 64, 34, 0.12);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --hero-accent-shadow: rgba(180, 83, 9, 0.22);
    --orb-one: rgba(241, 196, 15, 0.22);
    --orb-two: rgba(72, 187, 120, 0.14);
}

body[data-theme="girl"] {
    --bg: #fff1f6;
    --bg-deep: #ffd9e8;
    --panel: rgba(255, 248, 252, 0.92);
    --panel-strong: #fffafd;
    --ink: #3d2d38;
    --muted: #7a6471;
    --accent: #e85d93;
    --accent-dark: #bf3f73;
    --accent-soft: rgba(232, 93, 147, 0.16);
    --success: #2f855a;
    --warning: #b7791f;
    --pending: #6b5b68;
    --outline: rgba(61, 45, 56, 0.12);
    --shadow: 0 18px 45px rgba(136, 84, 112, 0.14);
    --hero-accent-shadow: rgba(232, 93, 147, 0.24);
    --orb-one: rgba(255, 165, 198, 0.34);
    --orb-two: rgba(255, 211, 124, 0.22);
}

body[data-theme="boy"] {
    --bg: #eef6ff;
    --bg-deep: #d9e8ff;
    --panel: rgba(247, 251, 255, 0.92);
    --panel-strong: #fbfdff;
    --ink: #24364a;
    --muted: #607287;
    --accent: #2f80ed;
    --accent-dark: #1f5fb7;
    --accent-soft: rgba(47, 128, 237, 0.16);
    --success: #2f855a;
    --warning: #b7791f;
    --pending: #516479;
    --outline: rgba(36, 54, 74, 0.12);
    --shadow: 0 18px 45px rgba(76, 108, 148, 0.14);
    --hero-accent-shadow: rgba(47, 128, 237, 0.24);
    --orb-one: rgba(97, 168, 255, 0.28);
    --orb-two: rgba(122, 214, 196, 0.2);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-ui);
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(248, 212, 175, 0.85), transparent 28rem),
        radial-gradient(circle at right center, rgba(255, 232, 198, 0.9), transparent 26rem),
        linear-gradient(160deg, var(--bg) 0%, #fefaf4 48%, var(--bg-deep) 100%);
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

.page-shell {
    position: relative;
    overflow-x: hidden;
}

.orb {
    position: fixed;
    border-radius: 999px;
    filter: blur(20px);
    pointer-events: none;
    opacity: 0.45;
}

.orb-one {
    top: -8rem;
    right: -6rem;
    width: 18rem;
    height: 18rem;
    background: var(--orb-one);
}

.orb-two {
    bottom: 6rem;
    left: -5rem;
    width: 16rem;
    height: 16rem;
    background: var(--orb-two);
}

.app-shell {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.25rem 0 3rem;
    transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
    will-change: opacity, transform;
}

body.is-loading .app-shell,
.app-shell.is-swapping {
    opacity: 0.72;
    transform: translateY(4px);
    filter: saturate(0.96);
    pointer-events: none;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0 1.25rem;
}

.site-header-controls {
    flex-shrink: 0;
}

.brand-lockup {
    display: inline-flex;
    flex-direction: column;
    gap: 0.2rem;
    text-decoration: none;
}

.brand-name {
    font-family: var(--font-ui);
    font-size: 1.65rem;
    font-weight: 700;
}

.brand-tagline {
    color: var(--muted);
    font-size: 0.95rem;
}

.flash-stack {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.flash-card {
    border-radius: var(--radius-md);
    padding: 0.95rem 1rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(6px);
}

.flash-success {
    background: rgba(47, 133, 90, 0.14);
    border: 1px solid rgba(47, 133, 90, 0.2);
}

.flash-error {
    background: rgba(221, 107, 32, 0.12);
    border: 1px solid rgba(221, 107, 32, 0.22);
}

.hero-card,
.panel-card,
.state-card {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.hero-card {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 1.5rem;
    padding: 1.75rem;
    margin-bottom: 1rem;
}

.home-hero {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.hero-topbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.hero-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem;
    border-radius: 999px;
    border: 1px solid rgba(38, 50, 56, 0.12);
    background: rgba(255, 255, 255, 0.78);
}

.theme-switch-label {
    padding: 0 0.45rem 0 0.6rem;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.theme-option {
    border: 0;
    min-height: 2.4rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font-weight: 700;
}

.theme-option.is-active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff;
}

.print-entry-button {
    min-width: 9rem;
}

.panel-card-print-chooser {
    margin-bottom: 1rem;
}

.export-option-block {
    display: grid;
    gap: 0.9rem;
}

.export-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.export-choice-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.9rem;
    align-items: start;
    padding: 1rem 1.05rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(38, 50, 56, 0.1);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.export-choice-card:has(input:checked) {
    border-color: color-mix(in srgb, var(--accent) 60%, white 40%);
    box-shadow:
        0 14px 28px rgba(87, 64, 34, 0.12),
        inset 0 0 0 2px color-mix(in srgb, var(--accent) 50%, white 50%);
}

.export-choice-card-boy {
    background:
        radial-gradient(circle at top right, rgba(97, 168, 255, 0.24), transparent 8rem),
        linear-gradient(180deg, rgba(239, 247, 255, 0.95), rgba(225, 238, 255, 0.85));
}

.export-choice-card-girl {
    background:
        radial-gradient(circle at top right, rgba(255, 165, 198, 0.24), transparent 8rem),
        linear-gradient(180deg, rgba(255, 244, 248, 0.96), rgba(255, 230, 240, 0.84));
}

.export-choice-card input {
    width: auto;
    margin: 0.15rem 0 0;
}

.export-choice-card-copy {
    display: grid;
    gap: 0.35rem;
}

.export-choice-card-copy strong {
    font-size: 1rem;
}

.export-choice-card-copy span {
    color: var(--muted);
    line-height: 1.5;
}

.print-mode {
    background:
        linear-gradient(180deg, rgba(236, 242, 248, 0.92), rgba(223, 233, 242, 0.9));
}

.print-shell {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1rem 0 2rem;
}

.print-toolbar,
.print-toolbar-note {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto 1rem;
}

.print-toolbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
}

.print-toolbar-copy {
    display: grid;
    gap: 0.25rem;
    justify-items: center;
    text-align: center;
}

.print-toolbar-copy strong {
    font-size: 1.05rem;
}

.print-toolbar-copy span,
.print-toolbar-note p {
    color: var(--muted);
}

.print-toolbar-note p {
    margin: 0;
    text-align: center;
}

.print-document {
    display: grid;
    gap: 1.5rem;
}

.print-sheet {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(210mm, 100%);
    min-height: 297mm;
    margin: 0 auto;
    padding: 12mm;
    overflow: hidden;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 28px 65px rgba(53, 70, 90, 0.18);
    page-break-after: always;
    break-after: page;
}

.print-sheet:last-child {
    page-break-after: auto;
    break-after: auto;
}

.print-sheet-decor {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.print-blob {
    position: absolute;
    border-radius: 999px;
    opacity: 0.88;
    filter: blur(2px);
}

body[data-theme="boy"] .print-sheet {
    background:
        linear-gradient(180deg, rgba(248, 252, 255, 0.98), rgba(239, 247, 255, 0.98));
}

body[data-theme="boy"] .print-blob-one {
    top: -42mm;
    right: -26mm;
    width: 98mm;
    height: 98mm;
    background: rgba(114, 177, 255, 0.28);
}

body[data-theme="boy"] .print-blob-two {
    bottom: -36mm;
    left: -24mm;
    width: 84mm;
    height: 84mm;
    background: rgba(123, 214, 197, 0.24);
}

body[data-theme="girl"] .print-sheet {
    background:
        linear-gradient(180deg, rgba(255, 250, 252, 0.98), rgba(255, 242, 247, 0.98));
}

body[data-theme="girl"] .print-blob-one {
    top: -44mm;
    right: -24mm;
    width: 96mm;
    height: 96mm;
    background: rgba(255, 171, 205, 0.28);
}

body[data-theme="girl"] .print-blob-two {
    bottom: -32mm;
    left: -24mm;
    width: 82mm;
    height: 82mm;
    background: rgba(255, 217, 124, 0.2);
}

.print-sheet-head {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
    margin-bottom: 8mm;
}

.print-sheet-head h1 {
    margin: 0 0 0.35rem;
    font-size: 2rem;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.print-sheet-head p {
    margin: 0;
    max-width: 110mm;
    color: var(--muted);
    line-height: 1.45;
}

.print-sheet-meta {
    display: grid;
    gap: 0.45rem;
    justify-items: end;
    text-align: right;
}

.print-sheet-meta strong,
.print-sheet-meta span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(38, 50, 56, 0.08);
}

.print-poster-grid,
.print-card-grid {
    position: relative;
    z-index: 1;
    flex: 1;
}

.print-poster-grid {
    display: grid;
    grid-template-columns: repeat(var(--poster-columns), minmax(0, 1fr));
    grid-template-rows: repeat(var(--poster-rows), minmax(0, 1fr));
    gap: 4mm;
}

.print-poster-card,
.print-letter-card {
    display: grid;
    align-items: center;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(38, 50, 56, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.print-poster-card {
    grid-template-rows: auto 1fr auto;
    gap: 2mm;
    padding: 3.4mm;
    border-radius: 14px;
}

.print-poster-letter,
.print-card-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    min-width: 10mm;
    min-height: 10mm;
    padding: 0 3mm;
    border-radius: 999px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(38, 50, 56, 0.08);
}

.print-poster-figure,
.print-card-figure {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
}

.print-poster-figure {
    min-height: 0;
    padding: 2mm;
}

.print-poster-figure img {
    max-height: 30mm;
    width: 100%;
    object-fit: contain;
}

.print-poster-word,
.print-card-word {
    font-weight: 700;
    line-height: 1.2;
}

.print-poster-word {
    font-size: 0.9rem;
}

.print-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 8mm;
}

.print-letter-card {
    grid-template-rows: auto 1fr auto;
    gap: 4mm;
    padding: 8mm;
    border-radius: 20px;
}

.print-letter-card-empty {
    visibility: hidden;
}

.print-card-letter {
    min-width: 16mm;
    min-height: 16mm;
    padding: 0 5mm;
    font-size: 1.2rem;
}

.print-card-figure {
    min-height: 0;
    padding: 4mm;
}

.print-card-figure img {
    max-height: 115mm;
    width: 100%;
    object-fit: contain;
}

.print-card-word {
    font-size: 1.35rem;
}

@media (max-width: 900px) {
    .export-choice-grid {
        grid-template-columns: 1fr;
    }

    .print-toolbar {
        grid-template-columns: 1fr;
    }

    .print-toolbar-copy {
        justify-items: start;
        text-align: left;
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 10mm;
    }

    html,
    body {
        background: #fff !important;
    }

    body.print-mode {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .print-shell,
    .print-toolbar,
    .print-toolbar-note {
        width: auto;
        margin: 0;
        padding: 0;
    }

    .print-toolbar,
    .print-toolbar-note {
        display: none !important;
    }

    .print-document {
        gap: 0;
    }

    .print-sheet {
        width: auto;
        min-height: calc(297mm - 20mm);
        margin: 0;
        padding: 8mm;
        border-radius: 0;
        box-shadow: none;
    }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    min-height: 2.5rem;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    background: rgba(47, 133, 90, 0.12);
    color: var(--success);
    font-weight: 700;
}

.language-menu {
    position: relative;
}

.language-menu summary {
    list-style: none;
}

.language-menu summary::-webkit-details-marker {
    display: none;
}

.language-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 2.75rem;
    padding: 0.65rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(38, 50, 56, 0.12);
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-weight: 700;
}

.language-menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    min-width: 190px;
    display: grid;
    gap: 0.35rem;
    padding: 0.45rem;
    border-radius: 18px;
    border: 1px solid rgba(38, 50, 56, 0.08);
    background: rgba(255, 253, 249, 0.98);
    box-shadow: var(--shadow);
    z-index: 10;
}

.language-menu-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    border-radius: 14px;
    text-decoration: none;
}

.language-menu-item:hover,
.language-menu-item.is-active {
    background: rgba(221, 107, 32, 0.12);
}

.hero-card-home {
    grid-template-columns: minmax(0, 1.7fr) minmax(290px, 1fr);
    padding: 2rem;
}

.hero-copy h1,
.headline-card h1,
.state-card h1 {
    margin: 0 0 0.75rem;
    font-family: var(--font-ui);
    font-size: clamp(2rem, 5vw, 3.3rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.title-row h1 {
    margin-bottom: 0;
}

.title-edit-button,
.dialog-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 999px;
    border: 1px solid rgba(38, 50, 56, 0.12);
    background: rgba(255, 255, 255, 0.78);
    color: var(--accent-dark);
}

.title-edit-button:hover,
.dialog-close:hover {
    background: var(--accent-soft);
}

.hero-text {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.hero-summary {
    margin: 0;
    max-width: 44rem;
    font-size: 1.02rem;
    line-height: 1.65;
}

.hero-actions {
    display: block;
    margin: 1.5rem 0 0.9rem;
}

.hero-button {
    width: 100%;
    min-height: 4.8rem;
    padding: 1.15rem 1.5rem;
    font-size: 1.18rem;
    letter-spacing: 0.01em;
    box-shadow: 0 18px 30px var(--hero-accent-shadow);
}

.hero-inline-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.8rem;
    color: var(--accent-dark);
    font-weight: 700;
    text-decoration: none;
}

.hero-inline-link::after {
    content: "↓";
    font-size: 0.95rem;
}

.hero-note-line {
    margin: 0;
    color: var(--muted);
}

.hero-note {
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    background: linear-gradient(180deg, rgba(255, 245, 232, 0.95), rgba(255, 252, 248, 0.8));
    border: 1px solid rgba(221, 107, 32, 0.12);
}

.hero-note-home {
    align-self: stretch;
}

.hero-points {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--muted);
    line-height: 1.7;
}

.trust-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.trust-item,
.story-step,
.detail-card {
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(38, 50, 56, 0.08);
}

.trust-item {
    padding: 1.1rem 1.15rem;
}

.trust-item strong,
.story-step strong {
    display: block;
    margin-bottom: 0.35rem;
}

.trust-item p,
.story-step p,
.footer-donate p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.eyebrow {
    margin: 0 0 0.55rem;
    color: var(--accent-dark);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.76rem;
    font-weight: 700;
}

.language-switches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1.2rem;
}

.language-chip,
.term-chip,
.word-chip,
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    font-size: 0.88rem;
}

.language-chip {
    text-decoration: none;
    border: 1px solid rgba(38, 50, 56, 0.12);
    background: rgba(255, 255, 255, 0.74);
}

.language-chip.is-active {
    background: var(--accent);
    border-color: transparent;
    color: white;
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-grid-home {
    align-items: start;
}

.panel-grid-homepage {
    margin-bottom: 1rem;
}

.panel-grid-editor-top {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.9fr);
    align-items: stretch;
}

.create-abc-section {
    scroll-margin-top: 1.5rem;
}

.panel-card {
    padding: 1.4rem;
}

.panel-card-form,
.panel-card-story,
.showcase-card,
.panel-card-devtools {
    padding: 1.6rem;
}

.panel-card-form,
.panel-card-story {
    grid-column: 1 / -1;
}

.panel-card-form {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.85);
}

.panel-card-form::before {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 34px;
    border: 2px solid transparent;
    opacity: 0;
    transform: scale(0.985);
    transition: opacity 180ms ease, transform 180ms ease, border-color 180ms ease;
    pointer-events: none;
}

.create-abc-section:target .panel-card-form,
.panel-card-form:target {
    box-shadow:
        0 22px 50px var(--hero-accent-shadow),
        var(--shadow);
    border-color: rgba(255, 255, 255, 0.96);
}

.create-abc-section:target .panel-card-form::before,
.panel-card-form:target::before {
    opacity: 1;
    transform: scale(1);
    border-color: color-mix(in srgb, var(--accent) 65%, white 35%);
}

.section-intro {
    margin-bottom: 1.15rem;
}

.section-intro h2 {
    margin: 0 0 0.5rem;
    font-family: var(--font-ui);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    letter-spacing: -0.02em;
}

.headline-card {
    display: flex;
    justify-content: space-between;
    gap: 1.25rem;
    align-items: start;
    margin-bottom: 1rem;
}

.compact-headline-card,
.compact-workflow-card {
    margin-bottom: 0;
    height: 100%;
}

.compact-headline-card {
    gap: 1rem;
}

.headline-copy {
    display: grid;
    gap: 0.45rem;
}

.panel-card-focus,
.panel-card-overview {
    margin-bottom: 1rem;
}

.workflow-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.compact-workflow-card {
    align-items: stretch;
}

.workflow-card h2 {
    margin-bottom: 0.45rem;
}

.workflow-actions,
.section-head-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.panel-grid-utility {
    align-items: start;
}

.panel-card-utility {
    background: rgba(255, 255, 255, 0.72);
}

.status-block {
    display: grid;
    gap: 0.65rem;
    justify-items: end;
    text-align: right;
}

.inline-status-block {
    align-self: stretch;
    justify-content: center;
    min-width: 180px;
    padding: 0.2rem 0 0;
}

.inline-status-block p {
    margin: 0;
}

.status-pill {
    font-weight: 700;
    background: rgba(74, 85, 104, 0.12);
    color: var(--pending);
}

.status-completed,
.status-filled {
    background: rgba(47, 133, 90, 0.14);
    color: var(--success);
}

.status-draft,
.status-pending {
    background: rgba(74, 85, 104, 0.12);
    color: var(--pending);
}

.status-skipped {
    background: rgba(183, 121, 31, 0.16);
    color: var(--warning);
}

.stack-form {
    display: grid;
    gap: 1rem;
}

.compact-form {
    gap: 0.85rem;
}

.form-field {
    display: grid;
    gap: 0.45rem;
}

.form-field span {
    font-weight: 700;
}

.form-field small,
.muted-text {
    color: var(--muted);
    line-height: 1.5;
}

input,
select,
textarea {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--outline);
    background: rgba(255, 255, 255, 0.88);
    padding: 0.95rem 1rem;
    color: var(--ink);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(221, 107, 32, 0.24);
    border-color: rgba(221, 107, 32, 0.42);
}

textarea {
    min-height: 7rem;
    resize: vertical;
}

.field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.field-row-single {
    grid-template-columns: 1fr;
}

button,
.inline-button {
    appearance: none;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    text-decoration: none;
}

.primary-button,
.secondary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.25rem;
    min-height: 2.8rem;
    font-weight: 700;
}

.primary-button {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: white;
}

.secondary-button {
    background: rgba(38, 50, 56, 0.1);
    color: var(--ink);
}

.ghost-button {
    background: transparent;
    border: 1px solid rgba(38, 50, 56, 0.12);
    color: var(--ink);
}

.small-button {
    padding: 0.55rem 0.9rem;
    min-height: auto;
}

.inline-button {
    align-self: start;
}

.app-dialog {
    width: min(560px, calc(100% - 1.5rem));
    padding: 0;
    border: 0;
    border-radius: 28px;
    background: transparent;
    box-shadow: none;
}

.app-dialog::backdrop {
    background: rgba(20, 28, 38, 0.45);
    backdrop-filter: blur(6px);
}

.dialog-shell {
    padding: 1.4rem;
    border-radius: 28px;
    background: rgba(255, 251, 246, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow);
}

.app-dialog-suggestion {
    width: min(1040px, calc(100% - 1.5rem));
}

.dialog-shell-suggestion {
    padding: 1.5rem;
}

.dialog-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
}

.dialog-head h2 {
    margin: 0;
    font-family: var(--font-ui);
    font-size: 1.6rem;
}

.feature-list {
    margin: 1rem 0 0;
    padding-left: 1.2rem;
    color: var(--muted);
    line-height: 1.7;
}

.story-steps {
    display: grid;
    gap: 0.85rem;
}

.story-step {
    padding: 1rem 1.05rem;
}

.story-step span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.65rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 700;
}

.showcase-card {
    overflow: hidden;
}

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

.template-card {
    display: grid;
    gap: 1rem;
    padding: 1.15rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(38, 50, 56, 0.08);
}

.template-card-head h3 {
    margin: 0 0 0.45rem;
    font-family: var(--font-ui);
    font-size: 1.35rem;
}

.template-card-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.template-tag {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    margin-bottom: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 0.82rem;
    font-weight: 700;
}

.template-preview-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.template-preview {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    padding: 0.75rem;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 252, 248, 0.98), rgba(255, 241, 226, 0.92));
    border: 1px solid rgba(38, 50, 56, 0.08);
}

.template-preview img {
    width: 100%;
    max-height: 86px;
    object-fit: contain;
}

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

.detail-card {
    padding: 1.4rem;
}

.site-footer {
    padding: 1.2rem 0 0.5rem;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.footer-nav a {
    text-decoration: none;
    color: var(--muted);
}

.footer-note {
    margin: 0 0 1rem;
    color: var(--muted);
    line-height: 1.6;
}

.footer-donate {
    padding: 1rem 1.1rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(38, 50, 56, 0.08);
}

.footer-donate strong {
    display: block;
    margin-bottom: 0.35rem;
}

.panel-card-devtools {
    margin-bottom: 1rem;
    border: 1px solid rgba(183, 121, 31, 0.18);
    background: linear-gradient(180deg, rgba(255, 250, 242, 0.94), rgba(255, 245, 231, 0.92));
}

.panel-card-admin,
.admin-hero-card {
    margin-bottom: 1rem;
}

.admin-nav {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.admin-nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.8rem;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid rgba(38, 50, 56, 0.12);
    background: rgba(255, 255, 255, 0.74);
    font-weight: 700;
}

.admin-nav-link.is-active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff;
    border-color: transparent;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.admin-grid-languages {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.admin-form-card {
    padding: 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(38, 50, 56, 0.1);
}

.admin-form-card.is-selected {
    border-color: color-mix(in srgb, var(--accent) 45%, white 55%);
    box-shadow: 0 12px 24px rgba(87, 64, 34, 0.08);
}

.admin-form-card-new {
    border-style: dashed;
}

.admin-field-row {
    align-items: start;
}

.checkbox-field {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 2.4rem;
}

.checkbox-field input {
    width: auto;
    margin: 0;
}

.checkbox-field span {
    font-weight: 700;
}

.compact-admin-head {
    margin-bottom: 0.4rem;
}

.admin-workspace {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.admin-sidebar {
    position: sticky;
    top: 1rem;
}

.admin-search-form {
    margin-bottom: 1rem;
}

.admin-list {
    display: grid;
    gap: 0.6rem;
    margin-bottom: 1rem;
    max-height: 70vh;
    overflow: auto;
    padding-right: 0.2rem;
}

.admin-list-item {
    display: grid;
    gap: 0.15rem;
    padding: 0.8rem 0.9rem;
    border-radius: 16px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(38, 50, 56, 0.08);
}

.admin-list-item span,
.admin-list-item small {
    color: var(--muted);
}

.admin-list-item.is-active {
    border-color: color-mix(in srgb, var(--accent) 45%, white 55%);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 24px rgba(87, 64, 34, 0.08);
}

.admin-detail-stack {
    display: grid;
    gap: 1rem;
}

.admin-image-preview-frame {
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    padding: 1rem;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(38, 50, 56, 0.08);
    background: linear-gradient(180deg, rgba(255, 251, 246, 0.98), rgba(255, 241, 226, 0.9));
}

.admin-image-preview-frame img {
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
}

.devtools-warning {
    margin: 0 0 1rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: rgba(183, 121, 31, 0.12);
    border: 1px solid rgba(183, 121, 31, 0.18);
    color: color-mix(in srgb, var(--warning) 80%, var(--ink) 20%);
    font-weight: 700;
}

.devtools-footnote {
    margin: 1rem 0 0;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-head h2,
.panel-card h2 {
    margin: 0;
    font-family: var(--font-ui);
    font-size: 1.45rem;
}

.section-head h2,
.panel-card h2 {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.copy-row {
    display: flex;
    gap: 0.75rem;
}

.overview-note {
    margin: -0.2rem 0 1rem;
}

.top-gap {
    margin-top: 1rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.summary-box {
    display: grid;
    gap: 0.3rem;
    padding: 1rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(38, 50, 56, 0.08);
}

.summary-box strong {
    font-size: 1.75rem;
}

.linked-list {
    margin-top: 1.25rem;
    display: grid;
    gap: 0.75rem;
}

.linked-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.72);
}

.suggestion-card {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(0, 1.2fr);
    gap: 1.1rem;
}

.suggestion-copy {
    display: grid;
    align-content: start;
    gap: 1rem;
}

.suggestion-image-frame,
.mini-figure {
    margin: 0;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(38, 50, 56, 0.08);
    background: linear-gradient(180deg, rgba(255, 251, 246, 0.95), rgba(255, 241, 226, 0.92));
}

.suggestion-image-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 1rem;
}

.compact-figure {
    min-height: 220px;
}

.mini-figure {
    min-height: 120px;
    margin-bottom: 0.75rem;
    padding: 0.6rem;
}

.mini-figure-placeholder {
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.92) 0%, rgba(250, 240, 228, 0.72) 68%, rgba(245, 230, 211, 0.56) 100%);
    border-style: dashed;
    border-color: rgba(87, 64, 34, 0.18);
}

.mini-figure-placeholder-mark {
    position: relative;
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 999px;
    border: 2px solid rgba(87, 64, 34, 0.24);
    opacity: 0.8;
}

.mini-figure-placeholder-mark::before,
.mini-figure-placeholder-mark::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.4rem;
    height: 2px;
    border-radius: 999px;
    background: rgba(87, 64, 34, 0.24);
    transform-origin: center;
}

.mini-figure-placeholder-mark::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.mini-figure-placeholder-mark::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.suggestion-image-frame img,
.mini-figure img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
}

.term-list,
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.term-chip {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
    gap: 0.55rem;
}

.letter-card {
    position: relative;
    display: grid;
    gap: 0.35rem;
    padding: 0.68rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(38, 50, 56, 0.08);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.letter-card.is-filled {
    background: linear-gradient(180deg, rgba(241, 255, 247, 0.98), rgba(227, 245, 235, 0.95));
    border-color: rgba(47, 133, 90, 0.18);
}

.letter-card.is-skipped {
    background: linear-gradient(180deg, rgba(255, 249, 239, 0.98), rgba(248, 236, 209, 0.94));
    border-color: rgba(183, 121, 31, 0.18);
}

.letter-card.is-targeted {
    border-color: color-mix(in srgb, var(--accent) 45%, white 55%);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 247, 238, 0.92));
    box-shadow: 0 14px 28px rgba(87, 64, 34, 0.1);
}

.letter-card.is-highlighted {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--success) 48%, white 52%);
    background: linear-gradient(180deg, rgba(245, 255, 249, 0.98), rgba(232, 249, 239, 0.94));
    box-shadow: 0 16px 30px rgba(47, 133, 90, 0.18);
}

.letter-head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: center;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(38, 50, 56, 0.08);
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.status-indicator-filled {
    color: var(--success);
}

.status-indicator-skipped {
    color: var(--warning);
}

.letter-label {
    font-size: 1.2rem;
    font-family: var(--font-ui);
    line-height: 1;
}

.entry-word {
    margin: 0;
    min-height: 2.15rem;
    display: grid;
    place-items: center;
    width: 100%;
    text-align: center;
    font-weight: 700;
    font-size: 0.88rem;
    line-height: 1.2;
}

.entry-word-placeholder {
    opacity: 0;
    user-select: none;
}

.icon-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    border: 1px solid rgba(38, 50, 56, 0.12);
    background: rgba(255, 255, 255, 0.86);
    color: var(--ink);
    padding: 0;
}

.icon-action-button:hover {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.letter-card .muted-text {
    font-size: 0.8rem;
    line-height: 1.25;
    margin: 0;
}

.letter-card form {
    justify-self: start;
}

.letter-card .mini-figure {
    min-height: 74px;
    margin-bottom: 0.1rem;
    padding: 0.35rem;
}

.letter-card.is-highlighted .mini-figure {
    animation: settled-entry 620ms cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-origin: center center;
}

@keyframes settled-entry {
    0% {
        transform: translateY(-16px) scale(0.9);
        opacity: 0.35;
    }

    55% {
        transform: translateY(2px) scale(1.03);
        opacity: 1;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.simple-state {
    display: grid;
    place-items: center;
    padding: 4rem 0;
}

.state-card {
    width: min(720px, 100%);
    padding: 2rem;
    display: grid;
    gap: 1rem;
}

.debug-box {
    overflow-x: auto;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: rgba(38, 50, 56, 0.92);
    color: #f8fafc;
}

.conflict-word {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin: 1rem 0 1.25rem;
}

@media (max-width: 900px) {
    .hero-card,
    .panel-grid,
    .suggestion-card,
    .field-row,
    .headline-card {
        grid-template-columns: 1fr;
    }

    .headline-card {
        display: grid;
    }

    .workflow-card {
        display: grid;
    }

    .panel-grid-editor-top {
        grid-template-columns: 1fr;
    }

    .trust-strip {
        grid-template-columns: 1fr;
    }

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

    .admin-workspace {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
    }

    .admin-list {
        max-height: none;
    }

    .status-block {
        justify-items: start;
        text-align: left;
    }
}

@media (max-width: 640px) {
    .site-header {
        flex-direction: column;
    }

    .app-shell {
        width: min(100% - 1rem, 100%);
    }

    .hero-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-controls {
        width: 100%;
        justify-content: stretch;
    }

    .theme-switch {
        width: 100%;
        justify-content: space-between;
    }

    .language-menu {
        width: 100%;
    }

    .language-menu-trigger {
        width: 100%;
        justify-content: space-between;
    }

    .language-menu-list {
        left: 0;
        min-width: 0;
    }

    .hero-card,
    .panel-card,
    .state-card {
        border-radius: 22px;
    }

    .section-head,
    .section-head-actions,
    .workflow-actions,
    .linked-item,
    .conflict-word {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .app-dialog,
    .app-dialog-suggestion {
        width: calc(100% - 0.75rem);
        max-width: none;
        margin: auto 0.375rem;
    }

    .dialog-shell,
    .dialog-shell-suggestion {
        padding: 1.15rem;
        border-radius: 24px;
    }

    .suggestion-image-frame {
        min-height: 220px;
    }

    .admin-image-preview-frame {
        min-height: 240px;
    }
}
