:root {
    --bg0: #101814;
    --bg1: #17241c;
    --surface: rgba(220, 245, 230, 0.06);
    --surface-strong: rgba(220, 245, 230, 0.1);
    --line: rgba(160, 210, 175, 0.2);
    --text: #eef7f1;
    --muted: #9fb8a8;
    --accent: #3d9b6a;
    --accent-deep: #2a704c;
    --accent-glow: rgba(61, 155, 106, 0.3);
    --ok: #7dbe74;
    --err: #e07a6a;
    --radius: 16px;
    --font: "Segoe UI", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(900px 500px at 8% -10%, var(--accent-glow), transparent 60%),
        radial-gradient(700px 420px at 100% 0%, rgba(30, 80, 50, 0.4), transparent 55%),
        linear-gradient(165deg, var(--bg1), var(--bg0) 55%, #0a100d);
}

.page {
    width: min(760px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2.5rem 0 3rem;
    display: grid;
    gap: 0.9rem;
}

.page-staff {
    width: min(900px, calc(100% - 2rem));
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.brand img {
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(61, 155, 106, 0.4);
}
.brand-home {
    display: block;
    line-height: 0;
    border-radius: 50%;
    text-decoration: none;
}

.brand-home:hover img {
    filter: brightness(1.08);
}

.brand-home:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.brand-name {
    margin: 0;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
}

h1 {
    margin: 0.15rem 0 0;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 650;
    letter-spacing: -0.02em;
}

h2 {
    margin: 0 0 0.65rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.lede, .staff-links {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.staff-links a {
    color: var(--accent);
    text-decoration: none;
}

.staff-links a:hover { text-decoration: underline; }

.banner {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    line-height: 1.45;
}

.presets {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 0.65rem;
}

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

.holiday-personas {
    border: 1px solid rgba(61, 155, 106, 0.35);
    border-radius: var(--radius);
    background: rgba(61, 155, 106, 0.08);
    padding: 0.75rem 0.9rem;
    display: grid;
    gap: 0.55rem;
}

.holiday-personas-label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.persona-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.persona-btn {
    appearance: none;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.22);
    color: var(--text);
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 650;
    cursor: pointer;
}

.persona-btn:hover,
.persona-btn.is-active {
    border-color: var(--accent);
    background: rgba(61, 155, 106, 0.22);
}

.persona-btn.is-fun.is-active {
    border-color: #c9a227;
    background: rgba(201, 162, 39, 0.18);
}

.character-wrap {
    display: none;
    gap: 0.35rem;
}

.character-wrap.is-active {
    display: grid;
}

.character-wrap input[type="text"] {
    width: 100%;
    font: inherit;
    font-size: 0.98rem;
    color: var(--text);
    background: rgba(201, 162, 39, 0.06);
    border: 1px solid rgba(201, 162, 39, 0.4);
    border-radius: 12px;
    padding: 0.7rem 0.85rem;
}

.character-wrap input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

.prompt-row {
    appearance: none;
    width: 100%;
    display: grid;
    gap: 0.15rem;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.22);
    color: var(--text);
    border-radius: 12px;
    padding: 0.65rem 0.5rem;
    text-align: center;
    font: inherit;
    cursor: pointer;
    min-width: 0;
}

.prompt-row:hover,
.prompt-row.is-active {
    border-color: var(--accent);
    background: rgba(61, 155, 106, 0.18);
}

.prompt-code {
    display: block;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 0.95rem;
}

.prompt-name {
    display: block;
    font-weight: 600;
    font-size: 0.78rem;
    line-height: 1.25;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.active-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    align-items: baseline;
    padding: 0.55rem 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.18);
    font-weight: 650;
}

.active-published {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.9rem;
}

.banner-voice {
    border-color: rgba(61, 155, 106, 0.35);
    background: rgba(61, 155, 106, 0.1);
    color: var(--text);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 0.75rem;
}

.banner-voice strong {
    font-size: 1.02rem;
    font-weight: 700;
}

.banner-voice .banner-note {
    color: var(--muted);
    font-size: 0.9rem;
}

.dirty-hint {
    color: #e0b06a;
    font-weight: 600;
}

.field-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

textarea {
    width: 100%;
    resize: vertical;
    min-height: 140px;
    font: inherit;
    font-size: 1.05rem;
    line-height: 1.45;
    color: var(--text);
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.9rem 1rem;
}

.page-staff textarea {
    min-height: 220px;
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.meta-row {
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: -0.25rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.pdf-load {
    display: grid;
    gap: 0.4rem;
}

.pdf-load input[type="file"] {
    width: 100%;
    color: var(--muted);
    font: inherit;
}

.pdf-hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.45;
}

.pdf-hint a {
    color: var(--text);
}

.controls {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 0.85rem;
}

.field {
    display: grid;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.field select,
.field input[type="range"] {
    width: 100%;
}

.field select {
    appearance: none;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text);
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.7rem 0.85rem;
}

#speedLabel {
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 0.65rem 1.15rem;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    color: #0a100d;
    background: linear-gradient(180deg, #55b882, var(--accent-deep));
}

.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }

.btn.secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--line);
}

.progress {
    display: none;
    gap: 0.55rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.progress.is-active { display: grid; }

.progress-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.progress-pct {
    font-size: 1.15rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.progress-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #8fd0b0);
    transition: width 0.2s ease;
}

.progress-bar.is-indeterminate {
    width: 40% !important;
    animation: slide 1.1s ease-in-out infinite;
    transition: none;
}

@keyframes slide {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

.progress-label {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    flex: 1;
    min-width: 0;
}

.status {
    margin: 0;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.status.is-error {
    border-color: rgba(224, 122, 106, 0.45);
    background: rgba(224, 122, 106, 0.12);
    color: #f2c2ba;
}

.status.is-ok {
    border-color: rgba(125, 190, 116, 0.4);
    background: rgba(125, 190, 116, 0.1);
    color: #c8e4c3;
}

.player {
    width: 100%;
}

.foot {
    margin-top: 0.5rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.foot a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.foot a:hover {
    color: var(--text);
    border-bottom-color: var(--accent);
}

@media (max-width: 900px) {
    .prompt-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .controls { grid-template-columns: 1fr; }
    .page { padding-top: 1.5rem; }
    .prompt-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
