/* The tuvl look, as on tuvl.io, tuvl.dev and Insight: zinc neutrals (white / near-black), one cyan accent, Geist and Geist Mono. */
@font-face { font-family: "Geist"; src: url("../assets/fonts/Geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../assets/fonts/GeistMono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root, :root[data-theme="light"] {
  --bg: #ffffff; --panel: #fafafa; --ink: #09090b; --ink-2: #3f3f46; --muted: #71717a; --line: #e4e4e7; --line-strong: #d4d4d8; --soft: #f4f4f5;
  --accent: #0891b2; --accent-text: #0e7490; --accent-ink: #ffffff; --accent-soft: #cffafe; --btn: #0e7490; --btn-hover: #0891b2;
  --ok: #047857; --ok-bg: #d1fae5; --warn: #b45309; --warn-bg: #fef3c7; --bad: #be123c; --bad-bg: #ffe4e6; --info: #0e7490; --info-bg: #cffafe; --idle: #52525b; --idle-bg: #f4f4f5;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 10px 30px rgba(0, 0, 0, .07);
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace; --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 12px;
}
:root[data-theme="dark"] {
  --bg: #09090b; --panel: #111113; --ink: #fafafa; --ink-2: #d4d4d8; --muted: #a1a1aa; --line: #27272a; --line-strong: #3f3f46; --soft: #18181b;
  --accent: #22d3ee; --accent-text: #67e8f9; --accent-ink: #042f3a; --accent-soft: rgba(34, 211, 238, .14); --btn: #0e7490; --btn-hover: #0891b2;
  --ok: #34d399; --ok-bg: rgba(52, 211, 153, .14); --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .13); --bad: #fb7185; --bad-bg: rgba(251, 113, 133, .14); --info: #67e8f9; --info-bg: rgba(34, 211, 238, .14); --idle: #a1a1aa; --idle-bg: #18181b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 36px rgba(0, 0, 0, .45);
}
* { box-sizing: border-box; }
html { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; transition: background .25s ease, color .25s ease; }
h1 { font-size: 22px; line-height: 1.2; margin: 0 0 4px; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 15px; margin: 0; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 13px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .mono { font-family: var(--mono); font-size: 12.5px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.03em; padding: 2px 8px; }
.brand img { width: 28px; height: 30px; object-fit: contain; }
.brand span { line-height: 1.15; } .brand .sub { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; letter-spacing: .02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--soft); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 8px 0; display: grid; gap: 4px; }
.main { min-width: 0; }
.top { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 48px; padding: 0 28px; background: var(--panel); border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.page { padding: 4px 28px 56px; max-width: 1180px; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 20px; }
.top .theme { min-width: 36px; justify-content: center; }
.crumbs { font-size: 12px; margin-bottom: 4px; }
.ico { flex: none; }

/* surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.stack { display: grid; gap: 16px; } .stack-s { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .gap-s { gap: 6px; }
.grid { display: grid; gap: 16px; } .cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.tile { padding: 14px 16px; }
.tile .num { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.tile .lbl { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tr.link { cursor: pointer; } tr.link:hover td { background: var(--soft); }
td.num, th.num { text-align: right; }

/* controls */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); border-radius: 10px; padding: 7px 14px; font: inherit; font-weight: 600; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.btn:hover { background: var(--soft); border-color: var(--ink-2); }
.btn.primary { background: var(--btn); border-color: var(--btn); color: #fff; }
.btn.primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
input, select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; width: 100%; }
input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
label.field { display: grid; gap: 4px; font-weight: 600; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--bg); }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 6px 12px; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--idle-bg); color: var(--idle); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.bad { background: var(--bad-bg); color: var(--bad); } .chip.info { background: var(--info-bg); color: var(--info); }
.chip.pulse::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .chip.pulse::before { animation: none; } }
.badge { background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.tag { border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; font-size: 12px; color: var(--muted); background: var(--soft); }

/* messages */
.callout { border-radius: 10px; padding: 10px 14px; border: 1px solid var(--line); background: var(--soft); }
.callout.bad { background: var(--bad-bg); border-color: transparent; color: var(--bad); }
.callout.ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.callout.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty b { color: var(--ink); font-size: 15px; }
.findings { display: grid; gap: 6px; padding: 14px 18px; }
.finding { display: grid; grid-template-columns: max-content max-content 1fr; gap: 10px; align-items: baseline; }
pre.log { margin: 0; padding: 12px 14px; background: var(--soft); border-radius: 8px; overflow: auto; max-height: 280px; font: 12px/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--soft), var(--line), var(--soft)); background-size: 200% 100%; animation: sheen 1.3s linear infinite; }
@keyframes sheen { to { background-position: -200% 0; } }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.25); max-width: 360px; z-index: 5; }

/* sign in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; padding: 28px; display: grid; gap: 14px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; }
  .nav { flex-direction: row; flex-wrap: wrap; } .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-2 { grid-template-columns: 1fr; }
  .page, .top { padding-left: 16px; padding-right: 16px; }
}

/* upload */
.drop { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 22px 16px; border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer; color: var(--muted); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
details > summary { cursor: pointer; }
details[open] > summary { margin-bottom: 10px; }
select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; width: 100%; }
select[disabled] { opacity: .7; }

/* machines */
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.cmd { background: var(--soft); padding: 6px 10px; border-radius: 8px; overflow-x: auto; white-space: nowrap; max-width: 100%; }
.findings.flush { padding: 0; }
.findings.flush .finding { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.card-head p { margin: 2px 0 0; }

/* settings */
.btn.danger { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.btn.danger:hover { background: var(--bad-bg); border-color: var(--bad); }
td .stack-s { min-width: 180px; }

/* usage and credits: one hue per meter, fixed order (checked as a set, light and dark) */
:root { --m-vcpu: #2a78d6; --m-ram: #eb6834; --m-db: #1baf7a; --m-disk: #eda100; --m-io: #e87ba4; --m-llm: #008300; }
:root[data-theme="dark"] { --m-vcpu: #3987e5; --m-ram: #d95926; --m-db: #199e70; --m-disk: #c98500; --m-io: #d55181; --m-llm: #008300; }
.m-vcpu { fill: var(--m-vcpu); background: var(--m-vcpu); } .m-ram { fill: var(--m-ram); background: var(--m-ram); } .m-db { fill: var(--m-db); background: var(--m-db); }
.m-disk { fill: var(--m-disk); background: var(--m-disk); } .m-io { fill: var(--m-io); background: var(--m-io); } .m-llm { fill: var(--m-llm); background: var(--m-llm); }
svg .m-vcpu, svg .m-ram, svg .m-db, svg .m-disk, svg .m-io, svg .m-llm { background: none; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut-wrap { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; padding: 14px 18px 18px; }
.donut-wrap svg { width: 190px; height: 190px; flex: none; }
.donut-wrap .legend { flex: 1; min-width: 280px; }
.donut-wrap th, .donut-wrap td { padding: 7px 8px; }
.slice, .seg { stroke: var(--panel); stroke-width: 2; }
.donut-num { font: 650 24px var(--sans); fill: var(--ink); } .donut-sub { font: 12px var(--sans); fill: var(--muted); }
.axis { font: 11px var(--sans); fill: var(--muted); } .grid-line { stroke: var(--line); stroke-width: 1; }
.hit { fill: transparent; } .hit:hover { fill: var(--soft); opacity: .5; }
.chart-wrap { position: relative; padding: 8px 12px 0; } .chart-wrap svg { width: 100%; height: auto; display: block; }
.tip { position: absolute; transform: translateX(-50%); pointer-events: none; background: var(--ink); color: var(--bg); padding: 8px 10px; border-radius: 8px; font-size: 12px; line-height: 1.5; z-index: 3; white-space: nowrap; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.meterbar { height: 12px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.fill.warn { background: var(--warn); } .fill.bad { background: var(--bad); }
.bar-cell { display: flex; align-items: center; gap: 10px; min-width: 160px; } .bar-cell .track { flex: 1; height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; }
.card-pad .row.wrap { gap: 14px; }
.picker select { width: auto; min-width: 180px; }
.donut-wrap td:last-child, .donut-wrap th:last-child { white-space: nowrap; }
.fill.m-vcpu { background: var(--m-vcpu); } .fill.m-ram { background: var(--m-ram); } .fill.m-db { background: var(--m-db); }
.fill.m-disk { background: var(--m-disk); } .fill.m-io { background: var(--m-io); } .fill.m-llm { background: var(--m-llm); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-bottom: 1px solid var(--line); }
.stat { padding: 14px 18px; border-right: 1px solid var(--line); } .stat:last-child { border-right: 0; }
.stat .lbl { color: var(--muted); font-size: 12px; } .stat .num { font-size: 22px; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; }
@media (max-width: 900px) { .stats { grid-template-columns: 1fr; } .stat { border-right: 0; border-bottom: 1px solid var(--line); } }
.row.end { align-items: flex-end; } .dns-machine { margin-top: 12px; }
.grow { flex: 1 1 280px; min-width: 0; }
.btn.wide { width: 100%; justify-content: center; padding: 10px 14px; }
.auth-card details summary { cursor: pointer; }
