/* Playground layout on top of the site's styles.css tokens. */
.pg {
    max-width: 1200px;
    margin: 0 auto;
    padding: 7rem 1.25rem 3rem;
    display: grid;
    gap: 1.75rem;
}
.pg-head { display: grid; gap: 0.75rem; max-width: 760px; }
.pg-head h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.1; }
.pg-head p { color: var(--text-muted); font-size: 1.05rem; }
.badge {
    justify-self: start;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border: 1px solid var(--border-card);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
}

.pg-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 1rem;
}
@media (max-width: 860px) { .pg-grid { grid-template-columns: minmax(0, 1fr); } }

.pane {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.pane-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-card);
}
.pane-title {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.spacer { flex: 1; }

select, .tool {
    font: inherit;
    font-size: 0.9rem;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card);
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
}
select option { background: #11141c; color: var(--text-main); }
.tool { cursor: pointer; }
.tool:hover { background: rgba(255, 255, 255, 0.1); }
.run {
    border: 0;
    cursor: pointer;
    font: inherit;
    padding: 0.45rem 1.1rem;
}
.run:disabled { opacity: 0.55; cursor: progress; transform: none; box-shadow: none; }

#src, #out {
    font-family: 'Fira Code', ui-monospace, Menlo, monospace;
    font-size: 0.9rem;
    line-height: 1.55;
    tab-size: 4;
}
#src {
    flex: 1;
    min-height: 26rem;
    resize: vertical;
    border: 0;
    outline: none;
    padding: 1rem;
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.25);
    white-space: pre;
    overflow: auto;
}
#out {
    flex: 1;
    min-height: 26rem;
    margin: 0;
    padding: 1rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    overflow: auto;
    color: #d6f5e3;
    background: rgba(0, 0, 0, 0.35);
}
#out.err { color: #ffb4ab; }
.stats {
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.hint {
    margin: 0;
    padding: 0.65rem 0.9rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-card);
}

.pg-notes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}
.note-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 14px;
    padding: 1.1rem 1.2rem;
}
.note-card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.note-card p { color: var(--text-muted); font-size: 0.95rem; }
.note-card a { color: #c4b5fd; }
.pg code, footer code {
    font-family: 'Fira Code', monospace;
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.07);
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
}
.nav-links a[aria-current="page"] { color: var(--primary); }
footer .build { color: var(--text-muted); font-size: 0.85rem; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.verdict {
    margin: 0.75rem 0.75rem 0;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    border: 1px solid;
    display: grid;
    gap: 0.3rem;
}
.verdict p { margin: 0; font-size: 0.92rem; color: var(--text-muted); }
.verdict.refused { border-color: rgba(250, 204, 21, 0.45); background: rgba(250, 204, 21, 0.07); }
.verdict.refused strong { color: #fde68a; }
.verdict.stopped { border-color: rgba(96, 165, 250, 0.45); background: rgba(96, 165, 250, 0.07); }
.verdict.stopped strong { color: #bfdbfe; }
#out.raw { color: var(--text-muted); font-size: 0.82rem; }
.verdict[hidden] { display: none; }

.player {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-card);
}
.player[hidden] { display: none; }
.hint a { color: #c4b5fd; }

/* ── Programs / Capsules tabs ─────────────────────────────────────────── */
.mode-tabs { display: flex; gap: 0.25rem; justify-self: start; border: 1px solid var(--border-card); border-radius: 10px; padding: 0.2rem; }
.mode-tabs a { color: var(--text-muted); text-decoration: none; font-weight: 600; padding: 0.35rem 0.9rem; border-radius: 8px; }
.mode-tabs a[aria-current="page"] { color: var(--text-main); background: rgba(255, 255, 255, 0.08); }
.mode-tabs a:hover { color: var(--text-main); }

/* ── Capsules ─────────────────────────────────────────────────────────── */
.cap-body { padding: 0.9rem 1rem 1rem; display: grid; gap: 0.75rem; min-width: 0; }
.cap-h { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin: 0.25rem 0 0; }
.cap-h .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.hint.plain { border: 0; padding: 0; }
.grants { display: grid; gap: 0.5rem; }
.grant { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.55rem 0.7rem; border: 1px solid var(--border-card); border-radius: 10px; background: rgba(0, 0, 0, 0.2); cursor: pointer; }
.grant input { margin-top: 0.3rem; accent-color: var(--primary); }
.grant span { display: grid; gap: 0.15rem; min-width: 0; }
.grant code { font-family: 'Fira Code', monospace; font-size: 0.8rem; color: var(--text-muted); overflow-wrap: anywhere; }
.extra { display: grid; gap: 0.35rem; font-size: 0.9rem; color: var(--text-muted); }
.extra input { font: 0.9rem 'Fira Code', monospace; color: var(--text-main); background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border-card); border-radius: 8px; padding: 0.45rem 0.6rem; width: 100%; }
.presets { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.files { display: grid; gap: 0.6rem; }
.file { display: grid; gap: 0.3rem; min-width: 0; }
.file label, .file-path { font-family: 'Fira Code', monospace; font-size: 0.8rem; color: var(--text-muted); }
.file textarea { font: 0.85rem/1.5 'Fira Code', monospace; color: var(--text-main); background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border-card); border-radius: 8px; padding: 0.5rem 0.6rem; resize: vertical; width: 100%; }
.source summary { cursor: pointer; color: var(--text-muted); font-size: 0.9rem; }
.source pre { margin: 0.5rem 0 0; max-height: 18rem; overflow: auto; font: 0.8rem/1.5 'Fira Code', monospace; color: var(--text-muted); background: rgba(0, 0, 0, 0.3); border-radius: 8px; padding: 0.75rem; }
.output-pane #out { min-height: 8rem; flex: 0 0 auto; }
.after { padding: 0.75rem 1rem 1rem; display: grid; gap: 0.5rem; border-top: 1px solid var(--border-card); }
.after-file pre { margin: 0; font: 0.85rem/1.5 'Fira Code', monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-muted); background: rgba(0, 0, 0, 0.25); border-radius: 8px; padding: 0.5rem 0.6rem; }
.after-file.changed pre { color: #d6f5e3; border: 1px solid rgba(74, 222, 128, 0.35); }
.verdict.allowed { border-color: rgba(74, 222, 128, 0.45); background: rgba(74, 222, 128, 0.07); }
.verdict.allowed strong { color: #bbf7d0; }
.after[hidden] { display: none; }

.input-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.6rem 0.75rem; border-top: 1px solid var(--border-card); }
.input-row[hidden] { display: none; }
.input-row input { flex: 1; min-width: 8rem; font: 0.9rem 'Fira Code', monospace; color: var(--text-main); background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border-card); border-radius: 8px; padding: 0.45rem 0.6rem; }
