:root {
    color-scheme: dark;
    --bg: #0f1117;
    --panel: #171a24;
    --line: #2a2f40;
    --text: #e8eaf6;
    --muted: #98a0c0;
    --accent: #7dd3fc;
    --ok: #7be0a5;
    --warn: #ffc857;
    --bad: #ff8a8a;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font:
        16px / 1.5 system-ui,
        sans-serif;
}
a {
    color: var(--accent);
}
h1 {
    margin: 0 0 8px;
    font-size: 28px;
}
h2 {
    margin: 0 0 12px;
    font-size: 20px;
}
button,
input,
textarea {
    font: inherit;
}
main,
.foot {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}
.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
}
.brand {
    font-weight: 700;
    font-size: 20px;
    color: var(--text);
    text-decoration: none;
}
.session {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
}
.button {
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
}
.button:hover:not(:disabled) {
    border-color: var(--accent);
}
.button:disabled {
    opacity: 0.55;
    cursor: progress;
}
.button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #07131c;
    font-weight: 600;
}
.intro {
    padding: 20px 0 4px;
    max-width: 72ch;
    color: var(--muted);
}
.intro h1 {
    color: var(--text);
}
.notice {
    margin: 12px 0;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}
.notice.error {
    border-color: var(--bad);
}
.card {
    margin: 16px 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
}
.field {
    display: block;
    color: var(--muted);
    font-size: 14px;
}
textarea {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
}
.pickers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 14px 0;
}
fieldset {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}
legend {
    padding: 0 6px;
    color: var(--muted);
    font-size: 14px;
}
.models {
    max-height: 190px;
    overflow: auto;
}
.models label,
.check {
    display: flex;
    gap: 8px;
    align-items: baseline;
    padding: 2px 0;
    font-size: 14px;
}
.models .price {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}
.check {
    margin: 6px 0;
}
.fine {
    color: var(--muted);
    font-size: 14px;
}
.row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}
.scroll {
    overflow-x: auto;
}
table {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
}
th,
td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}
th {
    color: var(--muted);
    font-weight: 500;
}
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.pic {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
}
.pic img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    background: #fff;
}
.pic h3 {
    margin: 10px 0 2px;
    font-size: 15px;
}
.pic .meta {
    color: var(--muted);
    font-size: 13px;
}
.seek {
    margin: 8px 0 0;
    padding: 8px 10px;
    border-left: 3px solid var(--line);
    font-size: 14px;
}
.seek .how {
    color: var(--muted);
}
.v-decoded {
    border-color: var(--ok);
}
.v-close {
    border-color: var(--warn);
}
.v-wrong,
.v-false-alarm,
.v-error {
    border-color: var(--bad);
}
.badge {
    display: inline-block;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--bg);
    font-size: 12px;
}
details {
    margin-top: 8px;
    font-size: 13px;
}
details textarea {
    height: 120px;
    font:
        12px / 1.4 ui-monospace,
        monospace;
}
.foot {
    padding-bottom: 28px;
    color: var(--muted);
    font-size: 14px;
}
@media (max-width: 760px) {
    .pickers {
        grid-template-columns: 1fr;
    }
}

select {
    font: inherit;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
}
.inline {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}
.button.small {
    padding: 4px 10px;
    font-size: 13px;
}
.presets {
    margin-bottom: 12px;
    flex-wrap: wrap;
}
h3 {
    margin: 20px 0 8px;
    font-size: 16px;
}
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}
.chip {
    padding: 2px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg);
    color: var(--muted);
    font-size: 13px;
}
.group {
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.group.main {
    border-color: var(--accent);
}
.quote {
    margin: 4px 0;
    font-style: italic;
}
.heat {
    text-align: center;
    min-width: 56px;
}

/* Idle Hands */
:root {
    --a: #7dd3fc;
    --b: #ffc857;
    --c: #7be0a5;
    --d: #f5a3d4;
}
.slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}
.slot {
    display: flex;
    align-items: center;
    gap: 8px;
}
.slot select {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
}
.badge,
.who {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #0f1117;
    font-weight: 700;
    font-size: 13px;
}
.agent-A {
    background: var(--a);
}
.agent-B {
    background: var(--b);
}
.agent-C {
    background: var(--c);
}
.agent-D {
    background: var(--d);
}
.stage {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: flex-start;
}
.grid {
    display: grid;
    grid-template-columns: repeat(9, 44px);
    grid-auto-rows: 44px;
    gap: 2px;
    padding: 6px;
    border-radius: 10px;
    background: #0a1a2a;
}
.cell {
    position: relative;
    border-radius: 4px;
    background: #1d3a2a;
}
.cell.water {
    background: #12304f;
}
.cell.h1 {
    background: #285238;
}
.cell.h2 {
    background: #386a46;
}
.cell.h3 {
    background: #4d8456;
}
.cell.h4,
.cell.h5,
.cell.h6 {
    background: #6aa36b;
}
.cell .height {
    position: absolute;
    top: 1px;
    left: 4px;
    font-size: 10px;
    color: #ffffff99;
}
.cell .pile {
    position: absolute;
    bottom: 1px;
    left: 3px;
    font-size: 9px;
    color: #f5e9c8;
    max-width: 38px;
    overflow: hidden;
    white-space: nowrap;
}
.cell.ring::after {
    content: "";
    position: absolute;
    inset: 9px;
    border: 3px solid #ffc857;
    border-radius: 50%;
}
.cell.drum::after {
    content: "";
    position: absolute;
    right: 5px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #f5a3d4;
}
.cell .who {
    position: absolute;
    inset: 9px;
    width: 26px;
    height: 26px;
    font-size: 15px;
    z-index: 1;
}
.side {
    flex: 1;
    min-width: 260px;
}
.side output {
    color: var(--text);
}
.side input[type="range"] {
    display: block;
    width: 100%;
}
.log {
    margin: 10px 0;
    max-height: 300px;
    overflow: auto;
    font-size: 14px;
}
.log .line {
    margin: 4px 0;
}
.log .who {
    width: 18px;
    height: 18px;
    font-size: 11px;
    margin-right: 6px;
}
.log .tag {
    margin-right: 6px;
    padding: 0 6px;
    border-radius: 4px;
    font-size: 11px;
    color: #0f1117;
}
.log .think {
    color: var(--muted);
    font-style: italic;
}
h3 {
    margin: 16px 0 8px;
    font-size: 16px;
}
.strip {
    display: flex;
    align-items: center;
    gap: 3px;
    margin: 4px 0;
}
.strip .who {
    margin-right: 6px;
}
.tick {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
}
.tick.now {
    border-color: #fff;
}
.cat-build {
    background: #ffc857;
}
.cat-climb {
    background: #7be0a5;
}
.cat-pattern {
    background: #c8a2ff;
}
.cat-sport {
    background: #ff9b6b;
}
.cat-music {
    background: #f5a3d4;
}
.cat-social {
    background: #7dd3fc;
}
.cat-explore {
    background: #5b6486;
}
.cat-rest {
    background: #2a2f40;
}
.cat-invalid {
    background: #ff8a8a;
}
.cat-none {
    background: transparent;
    border: 1px dashed var(--line);
}
.chip[class*="cat-"] {
    color: #0f1117;
    border: none;
}
.cat-rest.chip {
    color: var(--text);
}
@media (max-width: 560px) {
    .grid {
        grid-template-columns: repeat(9, 32px);
        grid-auto-rows: 32px;
    }
    .cell .who {
        inset: 4px;
    }
}
