:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #18211d;
  background: #f3f5f1;
  font-synthesis: none;
  --ink: #18211d;
  --muted: #6d7771;
  --line: #dfe5df;
  --surface: #ffffff;
  --green: #176b4d;
  --green-dark: #0d4d37;
  --green-soft: #e5f4ec;
  --amber: #a46618;
  --amber-soft: #fff2dc;
  --red: #a73e3e;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 8% -10%, #dfece4 0, transparent 28rem), #f3f5f1; }
button, input { font: inherit; }
button { cursor: pointer; }
.page-shell { min-height: 100vh; }
.topbar { height: 72px; padding: 0 max(24px, calc((100vw - 1240px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(24, 33, 29, .09); background: rgba(255,255,255,.78); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--ink); color: #dff4e8; font-size: 12px; font-weight: 800; letter-spacing: .08em; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 10px; margin-top: 2px; text-transform: uppercase; letter-spacing: .08em; }
.cluster-pill { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #59645e; font-size: 12px; }
.cluster-pill span { width: 7px; height: 7px; border-radius: 50%; background: #2cad76; box-shadow: 0 0 0 4px #def3e9; }
main { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 64px 0 80px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.eyebrow { margin: 0 0 10px; color: var(--green); font-size: 11px; line-height: 1; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 6vw, 68px); line-height: .98; font-weight: 500; letter-spacing: -.045em; }
.hero-copy { max-width: 620px; margin: 18px 0 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.primary-button, .ghost-button, .table-button, .icon-button { border: 0; border-radius: 10px; transition: transform .15s ease, background .15s ease, opacity .15s ease; text-decoration: none; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; background: var(--green); color: white; font-weight: 700; box-shadow: 0 8px 24px rgba(23,107,77,.2); }
.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.primary-button:disabled, button:disabled { opacity: .55; cursor: wait; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 42px 0 20px; }
.stats article { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 15px; }
.stats strong, .stats small { display: block; }
.stats strong { font-family: Georgia, serif; font-size: 29px; font-weight: 500; line-height: 1; }
.stats small { margin-top: 5px; color: var(--muted); font-size: 12px; }
.stat-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; font-size: 11px; font-weight: 800; }
.stat-icon.running { color: var(--green); background: var(--green-soft); }
.stat-icon.paused { color: var(--amber); background: var(--amber-soft); }
.stat-icon.source { color: #536a91; background: #eaf0fa; }
.registry-panel { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 60px rgba(38, 52, 44, .06); }
.toolbar { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.search-box { flex: 1; display: flex; align-items: center; gap: 9px; min-width: 180px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8faf8; color: var(--muted); }
.search-box:focus-within { border-color: #74a891; box-shadow: 0 0 0 3px #e7f2ec; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.deleted-toggle { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.deleted-toggle input { accent-color: var(--green); }
.ghost-button { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); background: white; color: #4d5953; font-weight: 650; font-size: 13px; }
.ghost-button:hover { background: #f2f6f3; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 960px; }
th { padding: 13px 18px; background: #fafbfa; color: #879089; font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .1em; font-weight: 750; }
td { padding: 17px 18px; border-top: 1px solid #edf0ed; vertical-align: middle; font-size: 13px; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #fbfcfb; }
.clickable-row { cursor: pointer; }
.clickable-row:focus-visible { outline: 2px solid #74a891; outline-offset: -2px; }
td strong, td small, td span { display: block; }
td strong { font-size: 13px; }
td small { margin-top: 5px; color: #929b95; font-size: 10px; }
td code { display: block; max-width: 290px; overflow: hidden; text-overflow: ellipsis; color: #57635c; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; white-space: nowrap; }
.status-badge { display: inline-flex; align-items: center; width: fit-content; padding: 6px 9px; border-radius: 999px; font-size: 10px; font-weight: 750; }
.status-badge.running { color: var(--green); background: var(--green-soft); }
.status-badge.paused { color: var(--amber); background: var(--amber-soft); }
.status-badge.deleted { color: #727a75; background: #ecefed; }
.status-badge.neutral { color: #66716b; background: #edf0ee; }
.status-badge.starting { color: #7451a5; background: #f0e9fa; }
.status-badge.ready, .status-badge.active { color: var(--green); background: var(--green-soft); }
.status-badge.idle { color: var(--amber); background: var(--amber-soft); }
.status-badge.failed { color: var(--red); background: #fbeeee; }
.time-cell { color: var(--muted); font-size: 11px; white-space: nowrap; }
.actions { text-align: right; white-space: nowrap; }
.table-button { padding: 7px 9px; margin-left: 4px; background: transparent; color: #59645e; font-size: 11px; font-weight: 700; }
.table-button:hover { background: #edf3ef; color: var(--green); }
.table-button.danger:hover { color: var(--red); background: #fbeeee; }
.play-link { display: inline-block; color: var(--green); }
tr[data-state="DELETED"] { opacity: .58; }
.empty-state { padding: 78px 24px; text-align: center; }
.empty-state div { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 14px; background: var(--green-soft); color: var(--green); font-size: 24px; }
.empty-state h2 { margin: 0; font-family: Georgia, serif; font-size: 24px; font-weight: 500; }
.empty-state p { margin: 8px 0 20px; color: var(--muted); font-size: 13px; }
dialog { width: min(610px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 30px 100px rgba(12, 24, 18, .28); }
dialog::backdrop { background: rgba(18, 28, 23, .48); backdrop-filter: blur(4px); }
dialog form { padding: 28px; }
.detail-shell { padding: 28px; }
.detail-dialog { width: min(760px, calc(100% - 32px)); }
.detail-identity { margin: 12px 0 20px; color: var(--muted); font: 11px "SFMono-Regular", Consolas, monospace; }
.detail-status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.detail-status-grid article { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #f8faf8; }
.detail-status-grid small, .detail-status-grid strong, .detail-status-grid span { display: block; }
.detail-status-grid small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.detail-status-grid strong { margin: 8px 0 4px; font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.detail-status-grid span { overflow: hidden; color: #8d9690; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.detail-list { margin: 20px 0 0; }
.detail-list div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.detail-list dt { color: var(--muted); font-size: 11px; }
.detail-list dd { min-width: 0; margin: 0; font-size: 11px; }
.detail-list code, .detail-list a { display: block; overflow: hidden; color: var(--green-dark); text-overflow: ellipsis; white-space: nowrap; }
.detail-play { min-height: 40px; }
.detail-page { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0 80px; }
.detail-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.detail-page-head h1 { font-size: clamp(38px, 5vw, 58px); }
.back-link { display: inline-block; margin-bottom: 20px; color: var(--green); font-size: 12px; font-weight: 700; text-decoration: none; }
.detail-panel { padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 18px 60px rgba(38,52,44,.06); }
.runtime-section { margin-top: 22px; }
.runtime-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.runtime-section h2 { margin: 0; font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.runtime-note { color: var(--muted); font-size: 11px; }
.runner-list { display: grid; gap: 12px; }
.runner-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; }
.runner-head { display: grid; grid-template-columns: minmax(180px, 1.6fr) repeat(3, minmax(70px, .5fr)); gap: 12px; padding: 14px 16px; background: #f8faf8; }
.runner-head strong, .runner-head span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runner-head strong { font: 11px "SFMono-Regular", Consolas, monospace; }
.runner-head span { color: var(--muted); font-size: 11px; }
.room-table { width: 100%; min-width: 580px; }
.room-table th, .room-table td { padding: 10px 16px; }
.player-detail-row > td { padding: 0 12px 14px 38px; background: #fbfcfb; }
.player-detail-row:hover { background: transparent; }
.player-table { min-width: 900px; border: 1px solid #e7ebe8; border-radius: 9px; background: white; }
.player-table th { padding: 9px 11px; font-size: 9px; }
.player-table td { padding: 10px 11px; font-size: 11px; white-space: nowrap; }
.player-table td:nth-child(3) { color: var(--muted); }
.player-table td:nth-child(5), .player-table td:nth-child(6) { max-width: 160px; overflow: hidden; font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; text-overflow: ellipsis; }
.player-status { display: inline-flex; width: fit-content; padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 750; }
.player-status.online { color: var(--green); background: var(--green-soft); }
.player-status.reconnecting { color: var(--amber); background: var(--amber-soft); }
.player-status.left { color: #727a75; background: #ecefed; }
.kick-button { margin: 0; }
.empty-runtime { padding: 30px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); text-align: center; font-size: 12px; }
.launch-body { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.launch-card { width: min(620px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.92); box-shadow: 0 30px 100px rgba(30,48,39,.12); }
.launch-card h1 { margin: 0 0 14px; font-size: clamp(34px, 7vw, 54px); }
.launch-card > p:not(.eyebrow) { min-height: 24px; color: var(--muted); line-height: 1.6; }
.launch-spinner { width: 44px; height: 44px; margin-bottom: 28px; border: 4px solid #dce9e1; border-top-color: var(--green); border-radius: 50%; animation: spin 1s linear infinite; }
.launch-progress { overflow: hidden; height: 7px; margin: 24px 0; border-radius: 99px; background: #e9eeeb; }
.launch-progress i { display: block; width: 12%; height: 100%; border-radius: inherit; background: var(--green); transition: width .5s ease; }
.launch-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 28px; }
.launch-metrics div { padding: 12px; border-radius: 11px; background: #f4f7f5; }
.launch-metrics dt { color: var(--muted); font-size: 9px; }
.launch-metrics dd { margin: 5px 0 0; font-weight: 750; }
.launch-card > a { color: var(--green); font-size: 12px; }
.login-body { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.94); box-shadow: 0 30px 100px rgba(30,48,39,.13); }
.login-card .brand-mark { margin-bottom: 28px; }
.login-card h1 { font-size: 46px; }
.login-card > p:not(.eyebrow) { margin: 14px 0 26px; color: var(--muted); line-height: 1.6; }
.login-card form { display: grid; gap: 15px; }
.login-card label { display: grid; gap: 7px; color: #37423c; font-size: 11px; font-weight: 750; }
.login-card input { width: 100%; height: 45px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: #fbfcfb; }
.login-card input:focus { border-color: #74a891; box-shadow: 0 0 0 3px #e7f2ec; }
.login-card .primary-button { width: 100%; }
@keyframes spin { to { transform: rotate(360deg); } }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; }
.dialog-head h2 { margin: 0; font-family: Georgia, serif; font-size: 34px; font-weight: 500; letter-spacing: -.03em; }
.icon-button { width: 36px; height: 36px; background: #f0f3f0; color: #536059; font-size: 22px; }
.form-note { margin: 14px 0 22px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid label { display: grid; gap: 7px; color: #37423c; font-size: 11px; font-weight: 750; }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid em { margin-left: 5px; color: #9ba39e; font-size: 9px; font-style: normal; font-weight: 600; text-transform: uppercase; }
.form-grid input { width: 100%; height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; outline: 0; color: var(--ink); background: #fbfcfb; font-size: 13px; }
.form-grid input:focus { border-color: #74a891; box-shadow: 0 0 0 3px #e7f2ec; background: white; }
.identity-hint { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 10px 12px; border-radius: 9px; background: #f2f6f3; color: var(--muted); font-size: 10px; }
.identity-hint span { flex: none; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.identity-hint code { overflow: hidden; text-overflow: ellipsis; color: var(--green-dark); white-space: nowrap; }
.form-error { min-height: 18px; margin: 10px 0 0; color: var(--red); font-size: 11px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; padding: 13px 17px; border-radius: 11px; background: #183c2f; color: white; box-shadow: 0 14px 40px rgba(15, 42, 32, .24); font-size: 12px; font-weight: 700; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast[data-tone="error"] { background: #8c3535; }

@media (max-width: 720px) {
  .topbar { padding: 0 18px; }
  .cluster-pill { display: none; }
  main { width: min(100% - 28px, 1240px); padding-top: 38px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .hero .primary-button { width: 100%; }
  .stats { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-wrap: wrap; }
  .search-box { flex-basis: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid label.full { grid-column: auto; }
  dialog form { padding: 22px; }
  .detail-status-grid { grid-template-columns: 1fr 1fr; }
  .detail-list div { grid-template-columns: 1fr; gap: 5px; }
  .launch-card { padding: 28px; }
  .detail-page { width: min(100% - 28px, 1240px); padding-top: 28px; }
  .detail-page-head { align-items: stretch; flex-direction: column; }
  .runner-head { grid-template-columns: 1fr 1fr; }
}
