:root {
  color-scheme: dark;
  --bg: #07100e;
  --surface: #0b1714;
  --surface-2: #0f1e1a;
  --line: rgba(194, 255, 221, .12);
  --line-strong: rgba(194, 255, 221, .22);
  --text: #eef8f2;
  --muted: #82998f;
  --green: #61f2a0;
  --green-soft: rgba(97, 242, 160, .12);
  --cyan: #62d4c3;
  --amber: #f6b95d;
  --red: #ff776f;
  --radius: 16px;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; color: var(--text); font-family: var(--sans); background:
  radial-gradient(circle at 78% -10%, rgba(31, 113, 83, .22), transparent 30rem),
  linear-gradient(180deg, #081310 0, var(--bg) 34rem); min-height: 100vh; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.hidden { display: none !important; }
.noise { position: fixed; inset: 0; pointer-events: none; opacity: .2; background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.014) 1px, transparent 1px); background-size: 40px 40px; mask-image: linear-gradient(to bottom, black, transparent 75%); }
.app-shell { width: min(1480px, calc(100% - 48px)); margin: 0 auto; position: relative; }
.topbar { height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 13px; }
.brand > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.brand strong { font-size: 17px; letter-spacing: -.02em; }
.brand small { color: var(--muted); font: 9px/1 var(--mono); letter-spacing: .14em; }
.brand-mark { width: 35px; height: 35px; display: flex; align-items: flex-end; gap: 3px; padding: 7px; border: 1px solid rgba(97,242,160,.38); border-radius: 10px; background: var(--green-soft); transform: rotate(-2deg); }
.brand-mark i { width: 5px; border-radius: 2px; background: var(--green); box-shadow: 0 0 12px rgba(97,242,160,.4); }
.brand-mark i:nth-child(1) { height: 9px; }.brand-mark i:nth-child(2) { height: 17px; }.brand-mark i:nth-child(3) { height: 13px; }
.top-actions, .sync-state { display: flex; align-items: center; gap: 10px; }
.sync-state { color: var(--muted); font: 11px var(--mono); margin-right: 10px; }
.sync-state i { width: 7px; height: 7px; border-radius: 50%; background: #53635c; }
.sync-state i.online { background: var(--green); box-shadow: 0 0 10px var(--green); }
.sync-state i.error { background: var(--red); }
.icon-button, .ghost-button { height: 36px; border: 1px solid var(--line-strong); background: rgba(8, 18, 15, .72); color: var(--text); border-radius: 9px; }
.icon-button { width: 36px; font-size: 20px; line-height: 1; }.icon-button.loading { animation: spin .8s linear infinite; }
.ghost-button { padding: 0 14px; font-size: 12px; }
main { padding: 64px 0 30px; }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; margin-bottom: 44px; }
.eyebrow { margin: 0 0 10px; color: var(--green); font: 10px/1.2 var(--mono); letter-spacing: .16em; }
h1 { font-size: clamp(38px, 5vw, 68px); line-height: .98; letter-spacing: -.055em; margin: 0; max-width: 790px; font-weight: 650; }
h1 span { color: var(--green); }
.hero-copy { max-width: 620px; color: var(--muted); line-height: 1.7; font-size: 14px; margin: 22px 0 0; }
.time-panel { text-align: right; padding-bottom: 3px; flex: 0 0 auto; }
.time-panel span { color: var(--muted); font: 9px var(--mono); letter-spacing: .14em; }
.time-panel strong { display: block; font: 30px/1.2 var(--mono); letter-spacing: .03em; margin-top: 8px; }
.time-panel small { color: var(--muted); font: 10px var(--mono); }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.metric-card { min-height: 142px; padding: 21px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(16,33,28,.86), rgba(8,18,15,.82)); display: flex; flex-direction: column; }
.metric-card.accent { border-color: rgba(97,242,160,.28); background: linear-gradient(145deg, rgba(30,77,57,.58), rgba(8,20,16,.88)); }
.metric-card > span { color: var(--muted); font-size: 12px; }.metric-card strong { margin-top: 12px; font: 36px/1 var(--mono); font-weight: 500; }.metric-card small { margin-top: auto; color: var(--muted); font-size: 10px; display: flex; align-items: center; gap: 7px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: var(--muted); }.status-dot.online,.status-dot.healthy { background: var(--green); }.status-dot.warning { background: var(--amber); }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); gap: 12px; margin-bottom: 12px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(10, 23, 19, .83); backdrop-filter: blur(16px); }
.panel-heading { min-height: 75px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.panel-heading .eyebrow { margin-bottom: 5px; }.panel h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.segmented { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.14); }
.segmented button { color: var(--muted); border: 0; background: transparent; padding: 6px 10px; border-radius: 5px; font-size: 10px; }.segmented button.active { color: var(--text); background: var(--surface-2); }
.agent-list { min-height: 264px; padding: 7px 10px 10px; }
.agent-item { display: grid; grid-template-columns: 34px minmax(130px, 1fr) minmax(110px,.65fr) auto; align-items: center; gap: 12px; padding: 13px 10px; border-bottom: 1px solid rgba(194,255,221,.07); }
.agent-item:last-child { border-bottom: 0; }.node-icon { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--cyan); font: 12px var(--mono); background: rgba(98,212,195,.06); }
.agent-name strong { display: block; font-size: 12px; font-weight: 550; }.agent-name span,.agent-meta span { display: block; color: var(--muted); font: 9px/1.5 var(--mono); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-meta strong { font: 11px var(--mono); font-weight: 400; }.agent-state { justify-self: end; padding: 5px 8px; border-radius: 20px; font: 9px var(--mono); text-transform: uppercase; border: 1px solid; }
.agent-state.online { color: var(--green); background: var(--green-soft); border-color: rgba(97,242,160,.22); }.agent-state.pending { color:var(--cyan); background:rgba(98,212,195,.08); border-color:rgba(98,212,195,.22); }.agent-state.stale { color: var(--amber); background: rgba(246,185,93,.08); border-color: rgba(246,185,93,.22); }.agent-state.offline { color: var(--red); background: rgba(255,119,111,.08); border-color: rgba(255,119,111,.22); }
.node-controls { justify-self:end; display:flex; align-items:center; gap:6px; }.node-controls button { padding:6px 9px; border:1px solid var(--line-strong); border-radius:7px; background:rgba(98,212,195,.05); color:var(--muted); font-size:10px; }.node-controls button:hover { color:var(--green); border-color:rgba(97,242,160,.28); }.node-controls .agent-delete { border-color:rgba(255,119,111,.3); background:rgba(255,119,111,.07); color:var(--red); }.node-controls button:disabled { opacity:.35; cursor:not-allowed; }
.empty-state { height: 245px; display: grid; place-content: center; justify-items: center; color: var(--muted); font-size: 12px; }.radar { width: 48px; height: 48px; border: 1px solid var(--line-strong); border-radius: 50%; position: relative; }.radar::before,.radar::after { content:""; position:absolute; inset: 10px; border:1px solid var(--line); border-radius:50%; }.radar::after { inset: 22px; background: var(--green); border:0; box-shadow:0 0 12px var(--green); }
.enrollment-panel { padding-bottom: 20px; }.admin-badge { font: 9px var(--mono); color: var(--green); border: 1px solid rgba(97,242,160,.24); border-radius: 5px; padding: 4px 6px; }.panel-copy { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 18px 20px; }
.field-label { display: block; color: var(--muted); font: 9px var(--mono); letter-spacing: .08em; margin: 0 20px 7px; }
select,input { color: var(--text); background: #081310; border: 1px solid var(--line-strong); border-radius: 9px; }
.primary-button { width: calc(100% - 40px); min-height: 42px; margin: 12px 20px 0; border: 0; border-radius: 9px; background: var(--green); color: #04100b; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; }.primary-button:disabled { opacity: .35; cursor: not-allowed; }.primary-button span { font-size: 17px; }
.text-button { margin: 13px 20px 0; padding: 0; border: 0; background: none; color: var(--muted); font-size: 11px; }.text-button:hover { color: var(--green); }
.node-form > input { display:block; width:calc(100% - 40px); height:42px; margin:0 20px; padding:0 11px; font-size:12px; }.node-form .primary-button { width:calc(100% - 40px); }
.token-result { margin: 14px 20px 0; padding: 13px; border: 1px solid rgba(97,242,160,.28); border-radius: 10px; background: var(--green-soft); }.token-result > span { font: 9px var(--mono); color:var(--green); }.token-result > code { display:block; margin:9px 0; font: 10px/1.5 var(--mono); overflow-wrap:anywhere; color:var(--text); }.token-result div { display:flex; justify-content:space-between; align-items:center; }.token-result small { color:var(--muted); font-size:9px; }.token-result button { border:0; background:transparent; color:var(--green); font-size:10px; }.token-result .deploy-label { display:block; margin-top:16px; padding-top:13px; border-top:1px solid rgba(97,242,160,.16); }.token-result pre { max-height:150px; margin:9px 0; padding:10px; overflow:auto; border:1px solid var(--line); border-radius:7px; background:#06100d; white-space:pre-wrap; word-break:break-all; }.token-result pre code { color:#bdd0c6; font:9px/1.55 var(--mono); }.token-result .copy-deploy { width:100%; min-height:32px; border:1px solid rgba(97,242,160,.25); border-radius:7px; background:rgba(97,242,160,.08); }.token-result .copy-deploy:hover { background:rgba(97,242,160,.14); }.readonly-note { margin:18px 20px 0; color:var(--amber); font-size:11px; line-height:1.5; }
.tunnel-panel { margin-bottom: 12px; }.tunnel-heading { min-height: 82px; }.table-tools { display:flex; gap:8px; }.search-box { width: 250px; height: 36px; display:flex; align-items:center; gap:7px; padding:0 10px; border:1px solid var(--line); border-radius:8px; color:var(--muted); }.search-box input { border:0; background:transparent; outline:0; width:100%; font-size:10px; }.table-tools select { height:36px; padding:0 10px; font-size:10px; }
.table-wrap { overflow-x:auto; }table { width:100%; border-collapse:collapse; min-width:850px; }th { color:var(--muted); font:9px var(--mono); letter-spacing:.08em; text-align:left; padding:12px 20px; border-bottom:1px solid var(--line); }td { padding:15px 20px; border-bottom:1px solid rgba(194,255,221,.07); font-size:11px; }tbody tr:last-child td { border-bottom:0; }tbody tr:hover { background:rgba(97,242,160,.025); }.table-status { color:var(--green); font:9px var(--mono); }.table-status::before { content:""; display:inline-block; width:6px; height:6px; margin-right:7px; border-radius:50%; background:currentColor; }.table-status.failed,.table-status.degraded { color:var(--red); }.tunnel-name strong { display:block; font-weight:550; }.tunnel-name small { color:var(--muted); font:9px var(--mono); }.endpoint { font:10px var(--mono); color:#bdd0c6; }.table-empty { text-align:center; color:var(--muted); padding:42px; }
footer { height:65px; display:flex; align-items:center; justify-content:space-between; color:#51665c; font:9px var(--mono); letter-spacing:.1em; border-top:1px solid var(--line); }
dialog { width:min(430px, calc(100% - 32px)); padding:0; color:var(--text); background:#0a1713; border:1px solid var(--line-strong); border-radius:18px; box-shadow:0 30px 100px rgba(0,0,0,.65); }dialog::backdrop { background:rgba(1,7,5,.78); backdrop-filter:blur(8px); }dialog form { padding:30px; }.dialog-mark { width:42px; height:42px; border:1px solid rgba(97,242,160,.3); border-radius:12px; display:grid; place-items:center; margin-bottom:22px; background:var(--green-soft); }.dialog-mark span { width:10px; height:10px; background:var(--green); border-radius:50%; box-shadow:0 0 20px var(--green); }dialog h2 { margin:0; font-size:25px; }dialog p:not(.eyebrow) { color:var(--muted); font-size:12px; line-height:1.6; margin:12px 0 24px; }dialog .field-label { margin-left:0; }dialog input { width:100%; height:44px; padding:0 12px; }dialog .primary-button { width:100%; margin:14px 0 8px; }dialog .small-ghost { width:100%; }.dialog-error { margin-top:10px; color:var(--red); font-size:10px; }
.toast { position:fixed; right:24px; bottom:24px; transform:translateY(20px); opacity:0; pointer-events:none; background:#11231d; border:1px solid var(--line-strong); border-radius:9px; padding:11px 14px; font-size:11px; transition:.2s ease; box-shadow:0 15px 50px rgba(0,0,0,.4); }.toast.show { opacity:1; transform:translateY(0); }
@keyframes spin { to { transform:rotate(360deg); } }
@media (max-width: 900px) { .metrics-grid { grid-template-columns:repeat(2,1fr); }.workspace-grid { grid-template-columns:1fr; }.hero-row { align-items:flex-start; }.time-panel { display:none; } }
@media (max-width: 650px) { .app-shell { width:min(100% - 24px, 1480px); }.topbar { height:70px; }.sync-state { display:none; }.ghost-button { max-width:130px; overflow:hidden; text-overflow:ellipsis; }.top-actions { gap:6px; }main { padding-top:38px; }.hero-row { margin-bottom:30px; }h1 { font-size:40px; }.hero-copy { font-size:12px; }.metrics-grid { grid-template-columns:1fr 1fr; }.metric-card { min-height:115px; padding:16px; }.metric-card strong { font-size:29px; }.agent-item { grid-template-columns:32px 1fr auto; }.agent-meta { display:none; }.node-controls { flex-wrap:wrap; justify-content:flex-end; }.panel-heading { padding:15px; }.segmented button { padding:5px 7px; }.tunnel-heading { align-items:flex-start; flex-direction:column; }.table-tools { width:100%; }.search-box { flex:1; width:auto; }.table-tools select { max-width:120px; }footer { flex-direction:column; justify-content:center; gap:6px; }.primary-button,.node-form > input { width:calc(100% - 30px); margin-left:15px; margin-right:15px; }.panel-copy,.field-label,.text-button { margin-left:15px; margin-right:15px; } }
