:root {
  --bg: #08080a;
  --bg-2: #0d0d11;
  --card: rgba(255,255,255,.035);
  --card-2: rgba(255,255,255,.06);
  --line: rgba(255,255,255,.07);
  --line-2: rgba(255,255,255,.12);
  --text: #f3f1f4;
  --muted: #a7a3ad;
  --dim: #6f6b76;
  --red: #ef2b3a;
  --red-2: #ff5a66;
  --green: #34d399;
  --blue: #60a5fa;
  --amber: #fbbf24;
  --ui: "Segoe UI Variable Text", "Segoe UI", "Noto Sans Thai", "Leelawadee UI", system-ui, sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  --r: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--text); font: 14.5px/1.55 var(--ui); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(239,43,58,.13), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(96,165,250,.07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
.sprite { display: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
a { color: var(--blue); }

/* ---- buttons, fields ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--text);
  font: 600 .92rem var(--ui); cursor: pointer; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: rgba(255,255,255,.1); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: .82rem; border-radius: 10px; }
.btn-block { width: 100%; height: 46px; }
.btn-primary { background: linear-gradient(180deg, var(--red-2), var(--red)); border-color: transparent; color: #fff; box-shadow: 0 8px 24px -10px rgba(239,43,58,.8); }
.btn-primary:hover { filter: brightness(1.08); background: linear-gradient(180deg, var(--red-2), var(--red)); }
.btn-go { color: var(--green); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.08); }
.btn-go:hover { background: rgba(52,211,153,.16); }
.btn-danger { color: #ff8a92; border-color: rgba(239,43,58,.4); background: rgba(239,43,58,.1); }
.btn-danger:hover { background: rgba(239,43,58,.2); }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { color: var(--text); background: var(--card-2); }
input, select {
  height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.35);
  color: var(--text); font: inherit; outline: none; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
input:focus, select:focus { border-color: rgba(239,43,58,.6); box-shadow: 0 0 0 3px rgba(239,43,58,.15); }
select option { background: #15151a; }
.field { display: grid; gap: 6px; }
.field span { font-size: .82rem; color: var(--muted); }
.otp { letter-spacing: .4em; font: 600 1.15rem var(--mono); text-align: center; }

/* ---- sign-in / setup ---- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  width: min(420px, 100%); padding: 34px 30px 30px; border-radius: 22px; display: grid; gap: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); border: 1px solid var(--line-2);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.8); backdrop-filter: blur(14px);
}
.auth-card form { display: grid; gap: 16px; }
.auth-mark { width: 56px; height: 56px; margin: 0 auto 4px; border-radius: 16px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--red-2), #8a0f1a); box-shadow: 0 12px 30px -8px rgba(239,43,58,.7); }
.auth-mark svg { width: 28px; height: 28px; }
.auth-card h1 { text-align: center; font-size: 1.45rem; }
.auth-card h1 span { color: var(--red-2); }
.auth-sub { text-align: center; color: var(--muted); margin: -8px 0 4px; font-size: .9rem; }
.auth-err { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(239,43,58,.12); border: 1px solid rgba(239,43,58,.3); color: #ffb3b9; font-size: .88rem; }
.stepper { display: flex; gap: 8px; padding: 0; margin: 0; list-style: none; counter-reset: s; }
.stepper li { flex: 1; text-align: center; font-size: .78rem; color: var(--dim); padding-top: 8px; border-top: 3px solid var(--line-2); }
.stepper li.on { color: var(--text); border-top-color: var(--red); }
.howto { margin: 0; padding-left: 20px; color: var(--muted); display: grid; gap: 6px; font-size: .9rem; }
.secret { display: block; padding: 14px; border-radius: 12px; background: rgba(0,0,0,.45); border: 1px dashed var(--line-2);
  font: 600 1.05rem/1.5 var(--mono); letter-spacing: .1em; text-align: center; word-break: break-all; user-select: all; }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 22px 16px;
  border-right: 1px solid var(--line); background: rgba(10,10,14,.6); backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--red-2), #8a0f1a); box-shadow: 0 8px 20px -8px rgba(239,43,58,.7); }
.brand b { display: block; font-size: 1rem; }
.brand small { color: var(--red-2); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .68rem; }
.nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 12px; border: 0;
  background: transparent; color: var(--muted); font: 500 .93rem var(--ui); cursor: pointer; text-align: left; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--card-2); color: var(--text); }
.nav-item.on { background: linear-gradient(90deg, rgba(239,43,58,.18), rgba(239,43,58,.04)); color: #fff; box-shadow: inset 2px 0 0 var(--red); }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; background: linear-gradient(135deg, #3b3b46, #24242c); }
.me-txt { flex: 1; min-width: 0; }
.me-txt b { display: block; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-txt small { color: var(--red-2); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.main { min-width: 0; display: flex; flex-direction: column; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 28px 32px 18px; }
.head h1 { font-size: 1.6rem; margin-top: 8px; overflow-wrap: anywhere; }
.status-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.status { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: .8rem; background: var(--card-2); border: 1px solid var(--line-2); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.status.on { color: var(--green); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.08); }
.status.on i { background: var(--green); box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulse 2s infinite; }
.status.off { color: #ff8a92; border-color: rgba(239,43,58,.35); background: rgba(239,43,58,.08); }
.status.off i { background: var(--red); }
.status.held { color: var(--amber); border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.08); }
.status.held i { background: var(--amber); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.55); } 70% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.loc { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .86rem; }
.loc svg { width: 15px; height: 15px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
main { padding: 4px 32px 48px; max-width: 1280px; width: 100%; }
section { display: grid; gap: 18px; }

.notice { padding: 12px 16px; border-radius: 14px; background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.25); color: #fcd88a; font-size: .88rem; }
.notice:empty { display: none; }

/* ---- KPI cards ---- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { position: relative; overflow: hidden; padding: 18px 18px 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); display: grid; gap: 2px; min-height: 148px; }
.kpi-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.kpi-top small { color: var(--muted); font-size: .84rem; }
.kpi-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.k-red { color: var(--red-2); background: rgba(239,43,58,.12); }
.k-green { color: var(--green); background: rgba(52,211,153,.12); }
.k-blue { color: var(--blue); background: rgba(96,165,250,.12); }
.k-amber { color: var(--amber); background: rgba(251,191,36,.12); }
.kpi > b { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-sub { color: var(--dim); font-size: .82rem; }
.spark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 46px; opacity: .9; }
.spark path { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
#sparkPlayers path { stroke: var(--red-2); }
#sparkTick path { stroke: var(--green); }
#sparkRam path { stroke: var(--amber); }

/* ---- panels ---- */
.grid2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; }
.panel { padding: 20px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); display: grid; gap: 16px; align-content: start; min-width: 0; }
.panel h2 { font-size: .95rem; font-weight: 600; color: var(--muted); }
.gauges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.gauge { position: relative; aspect-ratio: 1; max-width: 140px; width: 100%; justify-self: center; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.g-track { stroke: rgba(255,255,255,.07); stroke-width: 10; fill: none; }
.g-val { stroke: var(--green); stroke-width: 10; fill: none; stroke-linecap: round; stroke-dasharray: 314.16; stroke-dashoffset: 314.16; transition: stroke-dashoffset .6s ease, stroke .3s; }
.gauge.hot .g-val { stroke: var(--amber); }
.gauge.crit .g-val { stroke: var(--red); }
.g-txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.g-txt b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.g-txt small { color: var(--dim); font-size: .72rem; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.facts > div { padding: 12px 14px; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px solid var(--line); display: grid; gap: 2px; min-width: 0; }
.facts span { color: var(--dim); font-size: .78rem; display: inline-flex; align-items: center; gap: 6px; }
.facts span svg { width: 14px; height: 14px; }
.facts b { font-size: .92rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 18px; bottom: -2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--dim); box-shadow: 0 0 0 3px var(--bg); }
.timeline li.t-start::after { background: var(--green); }
.timeline li.t-exit::after { background: var(--red); }
.timeline li.t-restart::after { background: var(--blue); }
.timeline b { display: block; font-size: .9rem; font-weight: 600; }
.timeline small { color: var(--dim); font-size: .78rem; font-family: var(--mono); }
.timeline .empty { color: var(--dim); padding-left: 0; }
.timeline .empty::after, .timeline .empty::before { display: none; }

/* ---- console ---- */
.announce { display: flex; gap: 10px; }
.announce input { flex: 1; }
.term { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-2); background: #050507; box-shadow: 0 30px 60px -30px rgba(0,0,0,.9); }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.03); flex-wrap: wrap; }
.term-bar > i { width: 11px; height: 11px; border-radius: 50%; background: #3a3a44; }
.term-bar > i:nth-child(1) { background: #ff5f57; } .term-bar > i:nth-child(2) { background: #febc2e; } .term-bar > i:nth-child(3) { background: #28c840; }
.term-bar > span { margin-left: 8px; color: var(--dim); font: .8rem var(--mono); }
.term-tool { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; }
.term-tool input { height: auto; accent-color: var(--red); }
.term-filter { height: 32px; width: 200px; font-size: .82rem; border-radius: 9px; }
pre.console { margin: 0; padding: 14px 16px; height: calc(100vh - 290px); min-height: 360px; overflow: auto; font: 12.5px/1.6 var(--mono); color: #c9c6cf; white-space: pre-wrap; word-break: break-all; }
.console .l-err { color: #ff8a92; } .console .l-warn { color: #fcd34d; } .console .l-ok { color: #6ee7b7; } .console .l-dim { color: #6f6b76; }

/* ---- staff / audit ---- */
.invite { display: grid; grid-template-columns: 1.4fr 1fr 1.3fr auto; gap: 10px; }
.linkbox { padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(52,211,153,.3); background: rgba(52,211,153,.06); display: grid; gap: 10px; }
.linkbox p { margin: 0; color: var(--muted); font-size: .88rem; }
.linkrow { display: flex; gap: 10px; align-items: center; }
.linkrow code { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; background: rgba(0,0,0,.4); font: 12.5px/1.4 var(--mono); word-break: break-all; user-select: all; }
.staff-list { display: grid; gap: 8px; }
.srow { display: grid; grid-template-columns: auto minmax(0, 1fr) 150px 120px auto; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: rgba(0,0,0,.22); border: 1px solid var(--line); }
.srow .avatar { width: 38px; height: 38px; }
.srow-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow-name small { display: block; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow select { height: 36px; border-radius: 10px; font-size: .85rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: .76rem; border: 1px solid var(--line-2); color: var(--muted); justify-self: start; }
.chip.ok { color: var(--green); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.08); }
.chip.warn { color: var(--amber); border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.08); }
.chip.bad { color: #ff8a92; border-color: rgba(239,43,58,.35); background: rgba(239,43,58,.08); }
.srow-act { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.audit { display: grid; gap: 2px; }
.arow { display: grid; grid-template-columns: 150px 140px 170px minmax(0, 1fr) 120px; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: .86rem; align-items: baseline; }
.arow:nth-child(odd) { background: rgba(255,255,255,.025); }
.arow time { color: var(--dim); font-family: var(--mono); font-size: .78rem; }
.arow code { font: .78rem var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.arow .act { font-weight: 600; }
.arow .act.bad { color: #ff8a92; }
.arow .ip { color: var(--dim); font: .78rem var(--mono); text-align: right; }

/* ---- dialog / toast ---- */
.confirm { border: 1px solid rgba(239,43,58,.35); border-radius: 20px; background: #111116; color: var(--text); padding: 26px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 40px 80px -20px rgba(0,0,0,.9); }
.confirm::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(4px); }
.confirm h3 { font-size: 1.15rem; }
.confirm p { color: var(--muted); }
.confirm input { width: 100%; margin: 6px 0 18px; font: 600 1rem var(--mono); letter-spacing: .1em; }
.confirm .row { display: flex; gap: 10px; justify-content: flex-end; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(16px); padding: 12px 18px; border-radius: 14px;
  background: rgba(20,20,26,.92); border: 1px solid var(--line-2); backdrop-filter: blur(10px); opacity: 0; transition: .2s; pointer-events: none;
  max-width: calc(100vw - 32px); box-shadow: 0 20px 40px -12px rgba(0,0,0,.8); }
.toast.on { opacity: 1; transform: translateX(-50%); }
.toast.err { border-color: rgba(239,43,58,.5); }
.toast.ok { border-color: rgba(52,211,153,.5); }

/* ---- responsive ---- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .arow { grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1fr); }
  .arow > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .arow code { grid-column: 2 / -1; }
  .arow .ip { grid-column: 1; grid-row: 2; text-align: left; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; z-index: 5; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand div, .me-txt, .me .avatar { display: none; }
  .nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
  .nav-item { height: 38px; padding: 0 10px; white-space: nowrap; }
  .nav-item.on { box-shadow: inset 0 -2px 0 var(--red); }
  .me { margin: 0; padding: 0; border: 0; background: none; }
  .head { padding: 20px 16px 12px; }
  main { padding: 4px 16px 40px; }
  .gauges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .invite { grid-template-columns: minmax(0, 1fr); }
  .srow { grid-template-columns: auto minmax(0, 1fr); }
  .srow select, .srow .chip, .srow-act { grid-column: 1 / -1; justify-self: stretch; }
  .srow-act { justify-content: flex-start; }
  .term-filter { width: 100%; }
}
@media (max-width: 480px) {
  .kpis { gap: 10px; }
  .kpi { padding: 14px; min-height: 128px; }
  .kpi > b { font-size: 1.55rem; }
  .kpi-top small { font-size: .78rem; }
  .head h1 { font-size: 1.3rem; }
  .actions { width: 100%; }
  .actions .btn { flex: 1; padding: 0 8px; }
  .nav-item span { display: none; }
}

/* ---- live charts ---- */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.live { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-size: .68rem; font-weight: 700; letter-spacing: .12em; color: var(--green); background: rgba(52,211,153,.1); vertical-align: middle; }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
.live.off { color: var(--dim); background: var(--card-2); }
.live.off i { background: var(--dim); animation: none; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(0,0,0,.35); border: 1px solid var(--line); }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 500 .8rem var(--ui); cursor: pointer; }
.seg button.on { background: var(--card-2); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset; }
.charts { display: grid; gap: 12px; }
.chart { padding: 12px 14px 8px; border-radius: 14px; background: rgba(0,0,0,.28); border: 1px solid var(--line); }
.ch-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ch-head > span { color: var(--muted); font-size: .82rem; }
.ch-head > b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.ch-head em { margin-left: auto; font-style: normal; color: var(--dim); font-size: .76rem; display: inline-flex; align-items: center; gap: 6px; }
.ch-head em b { color: var(--muted); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.d-red { background: var(--red-2); } .d-blue { background: var(--blue); } .d-amber { background: var(--amber); } .d-green { background: var(--green); }
.chart > svg { width: 100%; height: 110px; display: block; overflow: visible; }
.ch-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.c-red { stroke: var(--red-2); } .c-blue { stroke: var(--blue); } .c-amber { stroke: var(--amber); } .c-green { stroke: var(--green); }
.ch-area { stroke: none; }
.ch-grid line { stroke: rgba(255,255,255,.05); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ch-grid text { fill: var(--muted); stroke: none; font: 500 11px var(--ui); font-variant-numeric: tabular-nums; opacity: .8; }

/* ---- SFTP ---- */
.conn { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.conn > div { padding: 12px 14px; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px solid var(--line); display: grid; gap: 2px; min-width: 0; }
.conn span { color: var(--dim); font-size: .78rem; }
.conn b { font: 600 .95rem var(--mono); overflow-wrap: anywhere; }
.copyable { cursor: copy; }
.copyable:hover { color: var(--blue); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px solid var(--line); }
.auth-row.col { display: grid; justify-content: stretch; }
.auth-row b { display: block; }
.auth-row small { color: var(--dim); font-size: .8rem; }
.pwbox { padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(251,191,36,.35); background: rgba(251,191,36,.07); display: grid; gap: 8px; }
.pwbox p { margin: 0; color: #fcd88a; font-size: .85rem; }
.keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.keys li { padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.03); font: .8rem var(--mono); color: var(--muted); overflow-wrap: anywhere; }
textarea { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.35); color: var(--text); font: .82rem var(--mono); resize: vertical; outline: none; }
textarea:focus { border-color: rgba(239,43,58,.6); box-shadow: 0 0 0 3px rgba(239,43,58,.15); }
.perms { display: grid; gap: 8px; }
.perm { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(0,0,0,.22); border: 1px solid var(--line); }
.perm > svg { color: var(--muted); }
.perm.ok > svg { color: var(--green); }
.perm.lock > svg { color: var(--red-2); }
.perm b { display: block; font-size: .92rem; }
.perm small { color: var(--dim); font-size: .78rem; overflow-wrap: anywhere; }
.switch { position: relative; width: 46px; height: 26px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: rgba(255,255,255,.12); transition: background .2s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:disabled + i { opacity: .5; }
@media (max-width: 820px) { .conn { grid-template-columns: minmax(0, 1fr); } }

/* ---- restart, max players ---- */
section[data-view="settings"] .panel { display: grid; gap: 12px; align-content: start; }
.times { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.times li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--line); font: 600 1rem var(--ui); font-variant-numeric: tabular-nums; }
.times li.none { padding: 6px 12px; color: var(--dim); font-weight: 400; font-size: .88rem; }
.times .x { width: 24px; height: 24px; border: 0; border-radius: 7px; background: transparent; color: var(--dim); font-size: 1rem; cursor: pointer; }
.times .x:hover { background: rgba(239,43,58,.15); color: var(--red-2); }
.preview { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.3); border: 1px solid var(--line); }
.preview small { color: var(--dim); font-size: .76rem; }
.preview code { font: .88rem var(--mono); color: var(--text); overflow-wrap: anywhere; }
#rsMax { width: 120px; }
input[type="time"] { color-scheme: dark; }

/* ---- activity ---- */
section[data-view="activity"] .panel { display: grid; gap: 10px; align-content: start; }
.activity, .changes { display: grid; gap: 2px; max-height: 560px; overflow: auto; }
.acrow { display: grid; grid-template-columns: 140px 90px 110px minmax(0, 1fr) 70px 110px; gap: 12px; padding: 9px 12px; border-radius: 10px; font-size: .86rem; align-items: baseline; }
.acrow:nth-child(odd) { background: rgba(255,255,255,.025); }
.acrow time, .acrow .ip, .acrow .sz { color: var(--dim); font: .78rem var(--mono); }
.acrow .ip, .acrow .sz { text-align: right; }
.acrow .who { font-weight: 600; }
.acrow code { font: .8rem var(--mono); color: var(--text); overflow-wrap: anywhere; }
.acrow .kind { font-weight: 600; color: var(--muted); }
.acrow .kind.ok { color: var(--green); } .acrow .kind.warn { color: var(--amber); } .acrow .kind.bad { color: #ff8a92; }
.chg { display: grid; gap: 3px; padding: 10px 12px; border-radius: 10px; font-size: .86rem; }
.chg:nth-child(odd) { background: rgba(255,255,255,.025); }
.chg b { color: var(--dim); font-weight: 500; font-size: .78rem; }
.chg .warn { color: var(--amber); }
@media (max-width: 760px) {
  .acrow { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .acrow code { grid-column: 1 / -1; }
  .acrow .ip { display: none; }
}
