:root {
  --bg: #0e1117;
  --bg2: #131821;
  --panel: #171c26;
  --panel2: #1d2330;
  --hover: #242b3a;
  --line: #2a3242;
  --text: #e6ebf2;
  --dim: #8d98aa;
  --faint: #5d677a;
  --accent: #66c0f4;
  --accent-strong: #1a9fff;
  --accent-ink: #06243a;
  --green: #8fcd3d;
  --green-bg: rgba(143, 205, 61, .14);
  --amber: #f2a93b;
  --amber-bg: rgba(242, 169, 59, .14);
  --red: #f0645c;
  --red-bg: rgba(240, 100, 92, .14);
  --blue-bg: rgba(102, 192, 244, .13);
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 650; }
p { margin: 0 0 8px; }
.hidden { display: none !important; }
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.error-text { color: var(--red); min-height: 1.2em; font-size: 13px; }
.mono { font-family: var(--mono); }
svg { fill: currentColor; }

/* ---------------------------------------------------------------- controls */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--panel2); color: var(--text);
  font: inherit; font-weight: 550; padding: 8px 14px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--hover); border-color: #3a4457; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #8ad0f7; }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-bg); border-color: var(--red); }
.btn.green { background: var(--green); border-color: var(--green); color: #14240a; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn.ghost:hover { color: var(--text); background: var(--panel2); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.wide { width: 100%; justify-content: center; }

input[type=text], input[type=password], input[type=search], input[type=number], select, textarea {
  font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; outline: none; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(102,192,244,.15); }
select { cursor: pointer; }
textarea { width: 100%; resize: vertical; font-family: var(--mono); font-size: 12.5px; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; cursor: pointer; }
input[type=range] { accent-color: var(--accent); width: 100%; }
input.num { width: 84px; }

/* ---------------------------------------------------------------- auth screen */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 50% -10%, #1b2a3f 0%, var(--bg) 60%); }
.auth-card { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 32px 28px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); text-align: center; }
.auth-logo { width: 112px; height: 112px; margin: -6px auto 0; border-radius: 50%; }
.auth-card h1 span, .brand span { color: var(--accent); }

/* ---------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--bg2); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 16px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; padding: 0 6px; }
.brand img { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.account { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); min-height: 58px; }
.account img, .avatar-ph { width: 38px; height: 38px; border-radius: 6px; flex: none; background: var(--panel2); display: grid; place-items: center; color: var(--dim); font-weight: 700; }
.account .who { min-width: 0; }
.account .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account .status { font-size: 12px; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.dot.warn { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-bg); }
.dot.bad { background: var(--red); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--dim); font-weight: 550; text-decoration: none; }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a.active { background: var(--blue-bg); color: var(--accent); }
.nav a b { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--dim); }
.nav a b.live { color: var(--green); }
.conn { margin-top: auto; font-size: 12px; color: var(--dim); padding: 0 6px; display: flex; flex-direction: column; gap: 4px; }

.main { padding: 24px 28px 64px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }

/* ---------------------------------------------------------------- banners */
.banner { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.banner.warn { background: var(--amber-bg); border-color: rgba(242,169,59,.35); color: #ffd79a; }
.banner.info { background: var(--blue-bg); border-color: rgba(102,192,244,.3); color: #bfe4fb; }
.banner.bad { background: var(--red-bg); border-color: rgba(240,100,92,.35); color: #ffc0bb; }
.banner.ok { background: var(--green-bg); border-color: rgba(143,205,61,.35); }
.banner .grow { flex: 1; }

/* ---------------------------------------------------------------- steam connect */
.connect { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 0; overflow: hidden; }
.connect > div { padding: 22px; }
.connect > div + div { border-left: 1px solid var(--line); }
.connect h3 { margin: 0 0 6px; font-size: 15px; }
.connect form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.connect .check { display: flex; gap: 8px; align-items: center; color: var(--dim); font-size: 13px; }
.connect-head { grid-column: 1 / -1; padding: 18px 22px !important; border-bottom: 1px solid var(--line); background: var(--panel2); }
.qr { width: 220px; height: 220px; background: #fff; border-radius: 12px; padding: 10px; margin: 14px 0 10px; }
.qr svg { width: 100%; height: 100%; display: block; }
.steps { margin: 8px 0 0; padding-left: 18px; color: var(--dim); }
.steps li { margin-bottom: 3px; }
.center-box { grid-column: 1 / -1; text-align: center; padding: 34px 22px !important; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.code-input { font-family: var(--mono) !important; font-size: 22px !important; letter-spacing: .3em; text-transform: uppercase; text-align: center; width: 220px; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- toolbar & selection */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.search { flex: 1; min-width: 200px; position: relative; display: flex; }
.search svg { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--faint); }
.search input { flex: 1; padding-left: 34px; }
.selbar { position: sticky; top: 8px; z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px;
  background: #1c2a3b; border: 1px solid rgba(102,192,244,.35); border-radius: 10px; margin-bottom: 14px; box-shadow: var(--shadow); }
.selbar #sel-count { font-weight: 600; margin-right: 6px; padding-left: 4px; }

/* ---------------------------------------------------------------- game grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.card {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; cursor: pointer; transition: transform .12s, border-color .12s, box-shadow .12s;
}
.card:hover { transform: translateY(-2px); border-color: #3a4558; box-shadow: var(--shadow); }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card.active { border-color: rgba(143,205,61,.55); }
.card.hidden-game { opacity: .55; }
.thumb { position: relative; aspect-ratio: 460 / 215; background: linear-gradient(135deg, #1e2633, #121720); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center; color: var(--dim); font-weight: 650; font-size: 15px; }
.thumb .ph.icon img { width: 48px; height: 48px; border-radius: 6px; }
.sel { position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; border-radius: 7px; background: rgba(10,13,18,.72);
  display: grid; place-items: center; opacity: 0; transition: opacity .12s; }
.card:hover .sel, .card.selected .sel, .grid.selecting .sel { opacity: 1; }
.chips { position: absolute; top: 8px; right: 8px; display: flex; gap: 5px; }
.chip { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(10,13,18,.78); color: var(--text); letter-spacing: .02em; white-space: nowrap; }
.chip.new { background: var(--accent); color: var(--accent-ink); }
.chip.fav { color: #ffd166; }
.live { position: absolute; left: 8px; bottom: 8px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; display: none; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.card.active .live { display: inline-flex; background: rgba(20,36,10,.88); color: var(--green); }
.card.paused .live, .card.queued .live { display: inline-flex; background: rgba(40,28,8,.88); color: var(--amber); }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.card.active .live::before { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--dim); }
.card .meta .hours { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.card .tags { display: flex; gap: 6px; flex-wrap: wrap; min-height: 20px; margin-top: 2px; }
.tag { font-size: 11.5px; padding: 1px 7px; border-radius: 6px; background: var(--panel2); color: var(--dim); border: 1px solid var(--line); }
.tag.cards { color: #ffd166; border-color: rgba(255,209,102,.3); background: rgba(255,209,102,.08); }
.tag.target { color: var(--accent); border-color: rgba(102,192,244,.3); background: var(--blue-bg); }
.card .foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 4px; }
.card .foot .tags { margin-top: 0; }
.card .foot .btn { padding: 4px 12px; font-size: 12.5px; flex: none; }
.empty { text-align: center; padding: 50px 20px; color: var(--dim); }
.empty p:first-child { font-size: 16px; color: var(--text); }

/* ---------------------------------------------------------------- sessions */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .k { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.tile .v { font-size: 24px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .v small { font-size: 13px; color: var(--dim); font-weight: 500; }
.sess-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.sess { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.sess .thumb { aspect-ratio: 460 / 160; cursor: pointer; }
.sess .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.sess .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sess .title { font-weight: 650; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess .timer { font-family: var(--mono); font-size: 26px; font-weight: 600; color: var(--green); font-variant-numeric: tabular-nums; }
.sess.paused .timer { color: var(--amber); }
.sess .sub { display: flex; gap: 14px; color: var(--dim); font-size: 12.5px; flex-wrap: wrap; }
.sess .sub b { color: var(--text); font-weight: 600; }
.bar { height: 6px; border-radius: 99px; background: var(--panel2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); border-radius: 99px; }
.src { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; background: var(--panel2); color: var(--dim); }
.src.farm { background: rgba(255,209,102,.12); color: #ffd166; }
.src.new { background: var(--blue-bg); color: var(--accent); }
.queue { display: flex; flex-direction: column; gap: 6px; }
.queue .q { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px 6px 6px; }
.queue .q img { width: 92px; height: 43px; object-fit: cover; border-radius: 5px; background: var(--panel2); }
.queue .q .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
h2 .dim { font-weight: 500; font-size: 13px; }

/* ---------------------------------------------------------------- farm */
.farm-status { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.farm-status .big { font-size: 17px; font-weight: 600; }
.farm-ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--panel2); border: 1px solid var(--line); }
.farm-ring.on { border-color: rgba(143,205,61,.5); color: var(--green); }
.farm-ring svg { width: 28px; height: 28px; }
.farm-facts { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 8px; color: var(--dim); font-size: 13px; }
.farm-facts b { color: var(--text); font-variant-numeric: tabular-nums; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; color: var(--dim); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 6px 10px; border-bottom: 1px solid var(--line); }
table.list td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.list .gname { display: flex; align-items: center; gap: 10px; }
table.list .gname img { width: 76px; height: 35px; object-fit: cover; border-radius: 4px; background: var(--panel2); flex: none; }

/* ---------------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px 22px; align-items: start; }
.form-grid > label { display: flex; flex-direction: column; gap: 6px; font-weight: 550; }
.form-grid > label.check, label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; grid-column: 1 / -1; }
.form-grid > label.check .num { width: 64px; padding: 4px 8px; }
.range { display: flex; align-items: center; gap: 12px; }
.range output { min-width: 28px; text-align: right; font-weight: 650; color: var(--accent); }
.savebar { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 10px 12px;
  background: rgba(23,28,38,.92); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(6px); }
.row-form { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.row-form input { flex: 1; min-width: 200px; }
.devices { display: flex; flex-direction: column; gap: 6px; }
.device { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; }
.device .ip { font-family: var(--mono); flex: 1; }
.device .you { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--green-bg); color: var(--green); }
.this-device { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.acct-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.acct-row img { width: 56px; height: 56px; border-radius: 8px; }
.acct-row .grow { flex: 1; min-width: 180px; }

/* ---------------------------------------------------------------- log */
.log { font-family: var(--mono); font-size: 12.5px; padding: 8px 0; max-height: calc(100vh - 170px); overflow: auto; }
.log .l { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 3px 16px; }
.log .l:hover { background: var(--panel2); }
.log .t { color: var(--faint); }
.log .Warning .m { color: var(--amber); }
.log .Error .m, .log .Critical .m { color: var(--red); }

/* ---------------------------------------------------------------- drawer */
.backdrop { position: fixed; inset: 0; background: rgba(4,6,10,.55); z-index: 30; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 100vw; background: var(--bg2); border-left: 1px solid var(--line);
  z-index: 31; transform: translateX(105%); transition: transform .2s ease; overflow-y: auto; box-shadow: var(--shadow);
}
.drawer.open { transform: none; }
.drawer .hero { position: relative; aspect-ratio: 460 / 215; background: var(--panel2); }
.drawer .hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.drawer .close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(10,13,18,.75); color: #fff; font-size: 18px; cursor: pointer; }
.drawer .content { padding: 18px 20px 28px; display: flex; flex-direction: column; gap: 16px; }
.drawer h2 { font-size: 20px; margin: 0; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.facts > div { background: var(--panel); padding: 10px 12px; }
.facts .k { font-size: 11.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.facts .v { font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.drawer .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.drawer .links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.status-line { display: flex; align-items: center; gap: 8px; font-weight: 600; }

/* ---------------------------------------------------------------- modal & toasts */
.modal-wrap { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(4,6,10,.6); }
.modal { width: 100%; max-width: 480px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 32px); overflow: auto; }
.modal h3 { margin: 0; font-size: 17px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 36px); }
.toast { background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); animation: up .18s ease; max-width: 380px; }
.toast.bad { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; height: auto; z-index: 20; flex-direction: row; align-items: center; padding: 8px 12px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand div, .conn { display: none; }
  .account { order: 3; min-height: 0; padding: 0; background: none; border: 0; margin-left: auto; }
  .account .who { display: none; }
  .account img, .avatar-ph { width: 32px; height: 32px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 2px; scrollbar-width: none; }
  .nav a { padding: 8px 10px; }
  .nav a span { display: none; }
  .nav a b { margin-left: 0; }
  .main { padding: 18px 16px 64px; }
  .connect { grid-template-columns: 1fr; }
  .connect > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .card .foot { flex-direction: column; align-items: stretch; }
  .card .foot .btn { justify-content: center; }
  .log .l { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .sess-grid { grid-template-columns: 1fr; }
  h1 { font-size: 21px; }
}

/* ---------------------------------------------------------------- service: auth, license, account, admin */
.auth-card form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.auth-card .check { display: flex; gap: 8px; align-items: flex-start; color: var(--dim); }
.auth-card .check input { margin-top: 2px; flex: none; }
.auth-links { color: var(--faint); margin-top: 4px; }
.auth-links a { color: var(--dim); }
.brand-name span { color: var(--accent); }
.notice { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--dim); margin: 0; }
.seg { display: flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; white-space: nowrap; border: 0; background: transparent; color: var(--dim); font: inherit; font-weight: 600; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.seg button.active { background: var(--panel2); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset; }
.seg button:hover:not(.active) { color: var(--text); }
.wide-seg { margin-bottom: 16px; flex-wrap: wrap; }
.wide-seg button { flex: 0 1 auto; }
.grow { flex: 1; }
.form-grid .wide { grid-column: 1 / -1; }

.license { display: block; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--dim); font-size: 12.5px; text-decoration: none; }
.license:hover { text-decoration: none; border-color: #3a4558; }
.license b { display: block; color: var(--text); font-size: 13.5px; }
.license.ok b { color: var(--green); }
.license.warn { border-color: rgba(242,169,59,.4); }
.license.warn b { color: var(--amber); }
.license.bad { border-color: rgba(240,100,92,.45); background: var(--red-bg); }
.license.bad b { color: var(--red); }
.license-status { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.license-status .big { font-size: 22px; font-weight: 650; }
.danger-zone { border-color: rgba(240,100,92,.35); }

.gen-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.gen-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 550; }
.gen-form label.grow { min-width: 200px; }
#gen-result { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.tag.ok { color: var(--green); border-color: rgba(143,205,61,.35); background: var(--green-bg); }
.tag.bad { color: var(--red); border-color: rgba(240,100,92,.35); background: var(--red-bg); }
.tag.warn { color: var(--amber); border-color: rgba(242,169,59,.35); background: var(--amber-bg); }
.tag.admin { color: var(--accent); border-color: rgba(102,192,244,.35); background: var(--blue-bg); }
table.list.users td { vertical-align: top; }
table.list .sub { color: var(--dim); font-size: 12px; }
.table-wrap { overflow-x: auto; }
.actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.actions-grid .btn { justify-content: center; }
.codes { font-family: var(--mono); display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; }
.qr.small-qr { width: 190px; height: 190px; margin: 6px 0; }
.mono-box { font-family: var(--mono); background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; word-break: break-all; }
.risk { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.risk ul { margin: 8px 0 0; padding-left: 18px; color: var(--dim); }
.risk li { margin-bottom: 6px; }
.risk-accept { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.risk-accept input { margin-top: 2px; flex: none; }
@media (max-width: 900px) {
  .license { display: none; }
  .codes { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- terms / privacy pages */
.doc { max-width: 760px; margin: 0 auto; padding: 32px 20px 64px; }
.doc h1 { margin: 12px 0 4px; }
.doc h2 { margin: 26px 0 8px; font-size: 17px; }
.doc p, .doc li { color: #c9d2de; line-height: 1.6; }
.doc ul { padding-left: 20px; }
.doc li { margin-bottom: 6px; }

/* ---------------------------------------------------------------- slots, schedule, history */
.slot-wrap { display: flex; flex-direction: column; gap: 4px; padding: 0 2px; }
.slot-wrap select { width: 100%; }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.days label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg2); font-weight: 500; cursor: pointer; }
.hist-chart { position: relative; }
.hist-chart svg { display: block; width: 100%; height: 240px; overflow: visible; }
.hist-chart .grid line { stroke: #252c39; stroke-width: 1; }
.hist-chart .axis text { fill: var(--faint); font-size: 11px; }
.hist-chart .bar { fill: #3d9be0; }
.hist-chart .bar.hover { fill: var(--accent); }
.hist-chart .hit { fill: transparent; }
.hist-tip { position: absolute; pointer-events: none; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; box-shadow: var(--shadow); white-space: nowrap; transform: translate(-50%, calc(-100% - 8px)); z-index: 2; }
.hist-tip b { display: block; font-variant-numeric: tabular-nums; }
.hbar { height: 6px; background: var(--panel2); border-radius: 99px; overflow: hidden; min-width: 80px; }
.hbar > i { display: block; height: 100%; background: #3d9be0; border-radius: 99px; }
input[type=time] { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; color-scheme: dark; }
@media (max-width: 900px) { .slot-wrap { order: 2; max-width: 150px; padding: 0; } .slot-wrap span { display: none; } }
.src.target { background: rgba(143,205,61,.12); color: var(--green); }

/* ---------------------------------------------------------------- discord, invite, pause */
.discord-btn { background: #5865f2; border-color: #5865f2; color: #fff; text-decoration: none; }
.discord-btn:hover { background: #4752c4; border-color: #4752c4; text-decoration: none; }
.discord-btn svg { fill: #fff; }
.passkey-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.line-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.line-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; flex-wrap: wrap; }
.line-item .grow { min-width: 0; overflow-wrap: anywhere; }
.tfa-sub { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.tfa-sub p { margin: 4px 0 10px; }
.ach-job { display: flex; flex-direction: column; gap: 8px; }
.ach-job-top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ach-bigaction { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.ach-bigaction .grow { min-width: 220px; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ach-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.ach-card:hover, .ach-card:focus-visible { border-color: rgba(102,192,244,.45); transform: translateY(-1px); outline: none; }
.ach-card.perfect { border-color: rgba(143,205,61,.35); }
.ach-card-img { position: relative; aspect-ratio: 460 / 215; background: var(--panel2); }
.ach-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ach-badge { position: absolute; top: 8px; right: 8px; background: rgba(20,36,10,.85); color: var(--green); font-size: 12px; font-weight: 700;
  padding: 3px 8px; border-radius: 99px; border: 1px solid rgba(143,205,61,.4); }
.ach-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ach-card-body > b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ach-card-count { display: flex; justify-content: space-between; font-size: 13px; font-variant-numeric: tabular-nums; }
.ach-card-actions { display: flex; gap: 6px; align-items: center; margin-top: auto; padding-top: 4px; flex-wrap: wrap; }
.ach-back { margin-bottom: 12px; }
.ach-picker { position: relative; margin-bottom: 16px; }
.ach-picker .search { width: 100%; }
.ach-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; display: grid; gap: 2px; max-height: 420px; overflow-y: auto; }
.ach-pick { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; color: var(--text);
  font: inherit; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.ach-pick:hover, .ach-pick:focus-visible { background: var(--panel2); outline: none; }
.ach-pick img { width: 92px; height: 43px; object-fit: cover; border-radius: 5px; flex: none; background: var(--panel2); }
.ach-pick > span { display: flex; flex-direction: column; min-width: 0; }
.ach-pick b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ach-empty, .ach-loading { display: flex; align-items: center; gap: 14px; }
.ach-empty svg { width: 34px; height: 34px; fill: var(--faint); flex: none; }
.ach-empty p { margin: 2px 0 0; }
.ach-loading .spinner { width: 20px; height: 20px; border-width: 2px; }
.ach-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.ach-cover img { width: 184px; height: 86px; object-fit: cover; border-radius: 8px; display: block; background: var(--panel2); }
.ach-sum { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.ach-sum h2 { margin: 0; }
.ach-count b { font-size: 20px; }
.ach-main-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ach-selbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.ach-list { display: flex; flex-direction: column; gap: 6px; }
.ach-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); cursor: pointer; }
.ach-row:hover { border-color: rgba(102,192,244,.35); }
.ach-row.prot { cursor: default; opacity: .8; }
.ach-row.on { border-color: rgba(143,205,61,.3); }
.ach-icon { width: 48px; height: 48px; border-radius: 6px; flex: none; background: var(--panel2); overflow: hidden; }
.ach-icon img { width: 100%; height: 100%; display: block; }
.ach-row:not(.on) .ach-icon img { opacity: .75; }
.ach-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ach-text .small { overflow-wrap: anywhere; }
.ach-state { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; flex: none; }
.ach-done { color: var(--green); font-weight: 600; }
@media (max-width: 640px) {
  .ach-cover img { width: 100%; height: auto; aspect-ratio: 460 / 215; }
  .ach-cover { width: 100%; }
  .ach-state { align-items: flex-start; text-align: left; }
  .ach-row { flex-wrap: wrap; }
  .ach-text { flex-basis: calc(100% - 90px); }
}
.field-label { display: flex; flex-direction: column; gap: 4px; color: var(--dim); font-size: 13px; }
.copy-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy-row .mono-box { flex: 1; min-width: 220px; }
.tag.slotkey { color: #c39bff; border-color: rgba(195,155,255,.35); background: rgba(195,155,255,.1); }
