body { background: radial-gradient(ellipse at 90% -20%, #26307a 0%, transparent 50%), var(--night); min-height: 100vh; }
.topbar { border-bottom: 1px solid var(--line); background: rgba(11, 15, 46, .7); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.small { font-size: .88rem; }
.block { width: 100%; }
[hidden] { display: none !important; }
button.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0 4px; }
button.link:hover { color: var(--ink); }
button.link.danger { color: var(--bad); }

/* auth */
.auth { display: grid; grid-template-columns: 1fr 420px; gap: 48px; align-items: center; min-height: calc(100vh - 160px); padding: 30px 0; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; min-height: 0; } }
.auth-pitch p { font-size: 1.15rem; max-width: 28em; }
.tabs { display: flex; gap: 4px; background: rgba(0, 0, 0, .25); padding: 4px; border-radius: 999px; margin-bottom: 22px; }
.tabs button { flex: 1; border: 0; background: none; color: var(--muted); padding: 10px; border-radius: 999px; font: 800 .95rem var(--font); cursor: pointer; }
.tabs button[aria-selected=true] { background: var(--night-3); color: var(--ink); }

/* dashboard */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 30px 0 22px; }
.head h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 4px; }
.head p { margin: 0; }
.banner { margin-top: 18px; padding: 12px 16px; border-radius: 12px; background: rgba(255, 214, 107, .12); border: 1px solid rgba(255, 214, 107, .35); color: var(--moon); font-weight: 700; }
.banner.bad { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 20px; background: rgba(255, 123, 138, .1); border-color: rgba(255, 123, 138, .4); color: var(--bad); }
.trial, .notif { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.trial { background: linear-gradient(135deg, rgba(255, 214, 107, .14), transparent); border-color: rgba(255, 214, 107, .35); }
.trial h2, .notif h3 { margin: 0 0 4px; }
.trial p, .notif p { margin: 0; }
.planline { margin: -8px 0 18px; }
.devices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 20px; }
.empty { text-align: center; padding: 48px 24px; }
.empty p { max-width: 30em; margin: 0 auto 20px; }

.device { display: flex; flex-direction: column; gap: 16px; }
.dev-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dev-name { font-size: 1.4rem; margin: 0 0 2px; }
.tonight { background: rgba(0, 0, 0, .22); border-radius: 14px; padding: 14px 16px; }
.tonight-main { font-weight: 700; }
.tonight-main b { color: var(--moon); }
.countdown { margin-top: 6px; font: 600 1.1rem var(--display); color: var(--moon); }
.pending { margin-top: 8px; color: var(--muted); }
.quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.quick .sd { display: inline-flex; gap: 6px; align-items: center; }
.quick select { width: auto; padding: 7px 10px; border-radius: 999px; font-size: .88rem; }

.sect { border-top: 1px solid var(--line); padding-top: 12px; }
.sect summary { cursor: pointer; font-weight: 800; list-style: none; display: flex; justify-content: space-between; }
.sect summary::after { content: '▾'; color: var(--muted); transition: transform .15s; }
.sect[open] summary::after { transform: rotate(180deg); }
.schedule { margin-top: 14px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 12px; }
.switch input { width: 20px; height: 20px; accent-color: var(--moon); }
.days { display: grid; gap: 6px; margin-bottom: 14px; }
.day { display: grid; grid-template-columns: 26px 1fr 130px; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: rgba(0, 0, 0, .18); }
.day input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--moon); }
.day input[type=time] { padding: 7px 10px; }
.day input[type=time]:disabled { opacity: .35; }
.day .nm { font-weight: 700; }
.day .nm small { color: var(--muted); font-weight: 600; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.row3 label { font-size: .8rem; color: var(--muted); min-height: 2.4em; display: flex; align-items: flex-end; }
@media (max-width: 520px) { .row3 { grid-template-columns: 1fr; } .row3 label { min-height: 0; } }
.row-actions { display: flex; align-items: center; gap: 12px; }
.events { list-style: none; margin: 12px 0 0; padding: 0; max-height: 280px; overflow: auto; }
.events li { display: grid; grid-template-columns: 112px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.events time { color: var(--muted); }
.events li.alert span { color: var(--bad); font-weight: 700; }
.events li.shutdown span { color: var(--moon); }
.dev-foot { display: flex; justify-content: flex-end; }

/* dialog */
dialog { border: 1px solid var(--line); border-radius: 22px; background: var(--night-2); color: var(--ink); padding: 0; width: min(500px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(5, 7, 25, .7); backdrop-filter: blur(3px); }
.dlg { padding: 28px; position: relative; }
.dlg .x { position: absolute; top: 14px; right: 16px; background: none; border: 0; color: var(--muted); font-size: 1.8rem; cursor: pointer; line-height: 1; }
.dlg ol { color: var(--muted); padding-left: 20px; }
.kidlink { display: block; font-weight: 800; font-size: 1.05rem; word-break: break-all; }
.bigcode { font: 600 clamp(2.2rem, 9vw, 3.2rem) var(--display); letter-spacing: .14em; text-align: center; margin: 16px 0 4px; padding: 14px; border-radius: 16px; background: rgba(0, 0, 0, .3); color: var(--moon); }
#pairExp { text-align: center; }
.waiting { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 700; margin: 6px 0 18px; }
.waiting.ok { color: var(--good); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--moon); animation: spin 0.9s linear infinite; }
.waiting.ok .spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.toast-msg { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 150%); background: var(--ink); color: var(--night); font-weight: 800; padding: 12px 20px; border-radius: 999px; transition: transform .25s, opacity .25s; z-index: 50; max-width: calc(100% - 32px); opacity: 0; pointer-events: none; }
.toast-msg.show { transform: translate(-50%, 0); opacity: 1; }
.toast-msg.err { background: var(--bad); }
