:root {
    color-scheme: dark;
    font-family: Inter, system-ui, sans-serif;
    background: #0f1115;
    color: #f4f5f7;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, #242832, #0f1115 55%); }
a { color: #d9dde8; }
.topbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px 4vw; background: #0b0d11ee; border-bottom: 1px solid #30343d; }
.brand { color: white; font-weight: 800; text-decoration: none; letter-spacing: .02em; }
nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
nav form { margin: 0; }
.page { width: min(1400px, 92vw); margin: 32px auto; }
.card { background: #191c22; border: 1px solid #343943; border-radius: 14px; padding: 24px; box-shadow: 0 18px 50px #0005; }
.login-card { width: min(430px, 100%); margin: 8vh auto; text-align: center; }
.logo { display: block; width: 110px; height: auto; margin: 0 auto 20px; }
.stack { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; align-items: end; }
label { display: grid; gap: 7px; font-weight: 650; }
input, select, button, .button { min-height: 42px; border-radius: 8px; border: 1px solid #454b57; background: #0f1115; color: white; padding: 9px 11px; font: inherit; }
button, .button { cursor: pointer; background: #e7e9ef; color: #111319; border: 0; font-weight: 800; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
button:hover, .button:hover { background: white; }
button:disabled { opacity: .45; cursor: not-allowed; }
.danger { background: #a72d37; color: white; }
.check { display: flex; align-items: center; gap: 9px; }
.check input { min-height: auto; width: 18px; height: 18px; }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.heading h1 { margin-bottom: 4px; }
.heading p { margin: 0; color: #aeb4c0; }
.notice { padding: 12px 16px; margin-bottom: 18px; border-radius: 9px; background: #263044; }
.notice.error { background: #552229; }
.notice.success { background: #1d503a; }
.table-card { margin-top: 24px; }
.studio-launcher { display: grid; gap: 18px; margin-bottom: 24px; }
.studio-launcher h2 { margin: 0 0 5px; }
.studio-launcher p { margin: 0; color: #aeb4c0; }
.studio-launcher-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.studio-launch { display: grid; gap: 5px; min-height: 92px; padding: 17px; border: 1px solid #725c27; border-radius: 11px; background: linear-gradient(145deg, #30230f, #18191e 72%); color: white; text-decoration: none; }
.studio-launch:hover { border-color: #ffbe3d; background: linear-gradient(145deg, #46300c, #1d1e23 72%); transform: translateY(-1px); }
.studio-launch strong { color: #ffcb57; font-size: 1.08rem; }
.studio-launch span { color: #c8cbd3; font-size: .9rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; border-bottom: 1px solid #343943; text-align: left; vertical-align: middle; }
td input, td select { width: 100%; min-width: 120px; }
.actions { display: flex; gap: 8px; }
fieldset { border: 1px solid #343943; border-radius: 10px; padding: 18px; }
.agent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.agent { padding: 9px; border: 1px solid #343943; border-radius: 8px; }
.agent small { margin-left: auto; color: #aeb4c0; }
code { background: #090a0d; padding: 8px 10px; border-radius: 7px; }
.studio-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card { display: grid; gap: 7px; padding: 20px; border-radius: 14px; border: 1px solid #3a414d; background: #171a20; }
.metric-card span, .metric-card small { color: #aeb4c0; }
.metric-card strong { font-size: clamp(1.5rem, 3vw, 2.4rem); }
.metric-card.active { border-color: #ffbe3d; box-shadow: 0 0 0 1px #ffbe3d44 inset; }
.metric-card.danger-card { border-color: #ff5365; background: #351820; }
.broadcast-permission { display: grid; gap: 15px; border-width: 2px; }
.broadcast-permission.armed { border-color: #ffbe3d; background: #30220e; }
.broadcast-permission p { margin: 0; color: #d2d6df; }
.yes-no { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.yes-no label { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 12px; border: 1px solid #454b57; border-radius: 10px; background: #101217; }
.yes-no input { width: 20px; height: 20px; min-height: auto; }
@media (max-width: 760px) { .topbar, .heading { align-items: flex-start; flex-direction: column; } .page { margin-top: 20px; } }
@media (max-width: 760px) { .studio-overview, .yes-no { grid-template-columns: 1fr; } }
@media (max-width: 980px) { .studio-launcher-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .studio-launcher-grid { grid-template-columns: 1fr; } }
