:root {
  color-scheme: dark;
  --bg: #0b1020;
  --surface: #151e31;
  --surface-high: #202b41;
  --ink: #f6f8fe;
  --muted: #a7b4cb;
  --line: #334057;
  --accent: #75e3b0;
  --accent-ink: #102b24;
  --danger: #ffc2c7;
  --radius: 20px;
  font: 16px/1.55 "Segoe UI", "Noto Sans Thai", Tahoma, system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 12% -10%, #223451, transparent 46%), var(--bg); color: var(--ink); min-height: 100svh; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled, input:disabled { opacity: .48; cursor: default; }
button, a, input, select, summary { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 2.9rem); letter-spacing: -.035em; line-height: 1.22; }
h2 { font-size: 1.35rem; line-height: 1.3; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
.pane { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.topbar { background: #10182a; border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 24px; min-height: 72px; max-width: 1110px; margin: auto; padding: 10px 26px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 750; white-space: nowrap; }
.brand img { border-radius: 8px; image-rendering: auto; object-fit: contain; }
nav { display: flex; gap: 6px; }
nav a { color: var(--muted); padding: 9px 14px; border-radius: 10px; }
nav a[aria-current="page"], nav a:hover { background: var(--surface-high); color: var(--ink); }
.page { width: min(100% - 48px, 1040px); margin: 44px auto 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
.page-head p { margin-top: 8px; }
.server-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.server-card { padding: 22px; background: linear-gradient(125deg, #172d30, transparent 64%), var(--surface); }
.server-card.purpur { background: linear-gradient(125deg, #292343, transparent 64%), var(--surface); }
.card-top, .server-address, .console-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.engine-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: #294d46; color: #a0f1c9; font-size: 1.4rem; font-weight: 800; }
.purpur .engine-mark { background: #433963; color: #e0ceff; }
.server-card h2 { font-size: 1.6rem; margin-top: 14px; }
.status { flex: none; color: #d4dce9; border-radius: 99px; background: #2a3549; padding: 4px 11px; font-size: .88rem; font-weight: 650; }
.status[data-color="running"] { background: #174739; color: #a4f5d0; }
.status[data-color="starting"], .status[data-color="stopping"] { background: #514020; color: #ffe09b; }
.status[data-color="error"], .status[data-color="unknown"] { background: #4c2936; color: #ffc7cf; }
.server-address { border-top: 1px solid var(--line); padding-top: 13px; margin: 17px 0 13px; }
code, pre { font-family: "Cascadia Code", Consolas, monospace; }
.server-address code { color: #d3e2f7; overflow-wrap: anywhere; }
.actions { display: flex; gap: 9px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 43px; border-radius: 10px; border: 1px solid transparent; padding: 7px 14px; color: var(--ink); background: var(--surface-high); font-weight: 650; white-space: nowrap; transition: background .15s ease, color .15s ease; }
.primary { color: var(--accent-ink); background: var(--accent); }
.primary:not(:disabled):hover { background: #9af0c7; }
.quiet { border-color: var(--line); background: #1b2538; }
.quiet:not(:disabled):hover { background: #2a3851; }
.danger { color: var(--danger); background: #492e3b; border-color: #734455; }
.danger:not(:disabled):hover { background: #654052; }
.wide { width: 100%; }
.console-pane { margin-top: 18px; padding: 18px; }
.console-head { margin-bottom: 12px; }
.switcher { display: flex; gap: 3px; border: 1px solid var(--line); background: #10192b; padding: 3px; border-radius: 11px; }
.switcher button { border: 0; background: transparent; border-radius: 8px; color: var(--muted); padding: 5px 12px; min-height: 36px; }
.switcher button[aria-pressed="true"] { color: var(--ink); background: var(--surface-high); }
.terminal { height: 255px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; padding: 14px; background: #080e1c; border: 1px solid #28364c; border-radius: 11px; color: #bbd2d6; font-size: .87rem; }
.command-row { display: flex; gap: 9px; margin-top: 10px; }
.command-row input { flex: 1; min-width: 0; }
input:not([type="checkbox"]), select { min-height: 44px; width: 100%; border: 1px solid #465571; border-radius: 10px; color: var(--ink); background: #0e1728; padding: 9px 12px; }
input::placeholder { color: #91a0b8; }
label { font-weight: 620; }
label input:not([type="checkbox"]), label select { display: block; margin-top: 6px; font-weight: 400; }
.stack { display: grid; gap: 15px; }
.login-shell { min-height: 100svh; display: grid; place-items: center; padding: 25px; }
.login-card { width: min(100%, 450px); padding: 34px; box-shadow: 0 24px 84px #04081890; }
.login-brand { margin-bottom: 24px; }
.login-card .muted { margin: 8px 0 19px; }
.login-card .password-row { margin-top: -9px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.login-card .wide { margin-top: 6px; }
.notice { margin: 12px 0; padding: 9px 13px; border: 1px solid #3d6657; border-radius: 10px; background: #142e28; color: #c2f4e1; overflow-wrap: anywhere; }
.notice.error { color: #ffe0e3; background: #432533; border-color: #814c61; }
.confirm { width: min(100% - 32px, 370px); padding: 23px; color: var(--ink); }
.confirm::backdrop { background: #040916c9; }
.confirm p { margin: 9px 0 18px; }
.confirm .actions { justify-content: flex-end; }
.export-page { max-width: 850px; }
.export-form { padding: 22px; gap: 21px; }
.drop-zone { position: relative; min-height: 170px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; text-align: center; border: 2px dashed #496078; background: #101a2c; border-radius: 15px; cursor: pointer; padding: 16px; overflow-wrap: anywhere; }
.drop-zone:hover, .drop-zone.dragging, .drop-zone:focus-within { border-color: var(--accent); background: #162a30; }
.drop-zone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-icon { font-size: 1.6rem; color: var(--accent); }
.drop-zone .muted { font-size: .9rem; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 15px; }
summary { cursor: pointer; color: #d0ddf3; padding: 4px 0; }
.extras { margin-top: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check { display: flex; align-items: center; gap: 9px; font-weight: 400; }
.check input { accent-color: var(--accent); width: 18px; height: 18px; }
.export-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
@media (max-width: 650px) {
  .topbar-inner { padding: 9px 16px; gap: 6px; }
  .topbar-inner nav { order: 3; width: 100%; }
  .page { width: calc(100% - 30px); margin-top: 25px; }
  .server-grid { grid-template-columns: 1fr; }
  .page-head > .button { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .login-card, .server-card { padding: 20px; }
  .console-pane { padding: 13px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
