:root {
  --bg: #ffffff;
  --fg: #111318;
  --muted: #6b6f78;
  --line: #e3e4e8;
  --soft: #f6f6f8;
  --accent: #2b3fb2;
  --accent-hover: #23349a;
  --good: #1f7a4d;
  --warn: #a86b00;
  --bad: #b3261e;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button { font: inherit; cursor: pointer; }
.muted { color: var(--muted); }

.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; letter-spacing: -0.01em; }
.mark { width: 14px; height: 14px; background: var(--accent); display: inline-block; clip-path: polygon(50% 0, 100% 40%, 100% 100%, 0 100%, 0 40%); }

.top { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.signout { color: var(--muted); text-decoration: none; }
.signout:hover { color: var(--fg); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 32px 24px 64px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
h1 { font-size: 30px; font-weight: 500; letter-spacing: -0.02em; margin: 0 0 4px; }
.head p { margin: 0; }

.primary { background: var(--accent); color: #fff; border: 0; padding: 10px 18px; display: inline-flex; align-items: center; gap: 8px; font-weight: 550; }
.primary:hover { background: var(--accent-hover); }
.primary:disabled { opacity: .6; cursor: progress; }
.primary svg { width: 16px; height: 16px; }

.table { border: 1px solid var(--line); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { text-align: left; font-weight: 500; color: #3d4048; font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.right { text-align: right; }
.name { font-weight: 600; }
.host, .id { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.id { color: var(--fg); }
.state { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.state.running .dot { background: var(--good); }
.state.starting .dot, .state.deleting .dot { background: var(--warn); animation: pulse 1.2s infinite; }
.state.error .dot { background: var(--bad); }
@keyframes pulse { 50% { opacity: .3; } }
.more { background: none; border: 1px solid transparent; padding: 4px 8px; font-weight: 700; letter-spacing: 2px; }
.more:hover, .more[aria-expanded="true"] { background: var(--soft); border-color: var(--line); }
.empty { padding: 28px; text-align: center; color: var(--muted); margin: 0; }

.menu { position: absolute; z-index: 10; background: #fff; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(17, 19, 24, .1); min-width: 214px; padding: 6px 0; }
.menu button { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; padding: 9px 18px; text-align: left; color: var(--fg); }
.menu button:hover:not(:disabled) { background: var(--soft); }
.menu button:disabled { color: #b0b3ba; cursor: default; }
.menu button.danger { color: var(--bad); }
.menu svg { width: 18px; height: 18px; flex: none; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

.modal { position: fixed; inset: 0; background: rgba(17, 19, 24, .35); display: grid; place-items: center; z-index: 20; padding: 16px; }
.dialog { background: #fff; width: min(560px, 100%); padding: 24px; border: 1px solid var(--line); }
.dialog h2 { margin: 0 0 4px; font-size: 20px; font-weight: 550; }
.dialog label { display: block; font-size: 12px; color: var(--muted); margin: 16px 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.copyrow { display: flex; gap: 8px; }
.copyrow code { flex: 1; font-family: var(--mono); background: var(--soft); border: 1px solid var(--line); padding: 9px 12px; overflow-x: auto; white-space: nowrap; }
.copyrow button, .dialog-foot button { background: #fff; border: 1px solid var(--line); padding: 8px 14px; }
.copyrow button:hover, .dialog-foot button:hover { background: var(--soft); }
.dialog-foot { display: flex; justify-content: flex-end; margin-top: 22px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--fg); color: #fff; padding: 10px 16px; z-index: 30; max-width: calc(100% - 32px); }

body.login { display: grid; place-items: center; min-height: 100vh; background: var(--soft); padding: 16px; }
.login-card { background: #fff; border: 1px solid var(--line); padding: 32px; width: min(380px, 100%); display: grid; gap: 6px; }
.login-card h1 { margin-top: 18px; }
.login-card label { font-size: 13px; color: #3d4048; margin-top: 12px; }
.login-card input { font: inherit; padding: 10px 12px; border: 1px solid var(--line); outline: none; }
.login-card input:focus { border-color: var(--accent); }
.login-card .primary { margin-top: 14px; justify-content: center; }
.error { color: var(--bad); margin: 6px 0 0; }

@media (max-width: 640px) {
  .head { flex-direction: column; align-items: stretch; }
  .wrap { padding: 20px 16px 48px; }
  .top { padding: 12px 16px; }
}
