/* PulseHack AI — Flagship Obsidian & Emerald Design System */
:root, html.dark {
  --bg: #06090e;
  --surface: #0c1119;
  --surface-2: #111824;
  --surface-3: #182233;
  --border: rgba(148, 163, 184, 0.12);
  --border-hi: rgba(148, 163, 184, 0.24);
  --txt: #f8fafc;
  --txt-2: #cbd5e1;
  --muted: #7e8ea5;
  --acc: #10b981;
  --acc-2: #34d399;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --acc-soft: rgba(16, 185, 129, 0.12);
  --acc-line: rgba(16, 185, 129, 0.34);
  --cyan-soft: rgba(34, 211, 238, 0.11);
  --cyan-line: rgba(34, 211, 238, 0.32);
  --violet-soft: rgba(167, 139, 250, 0.12);
  --violet-line: rgba(167, 139, 250, 0.32);
  --cta-bg: #10b981;
  --cta-fg: #03150e;
  --cta-h: #34d399;
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.12);
  --ok-line: rgba(52, 211, 153, 0.30);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.13);
  --warn-line: rgba(245, 158, 11, 0.34);
  --bad: #f43f5e;
  --bad-soft: rgba(244, 63, 94, 0.13);
  --bad-line: rgba(244, 63, 94, 0.35);
  --hdr-bg: rgba(6, 9, 14, 0.78);
  --term-bg: #080c13;
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --grid-col: rgba(148, 163, 184, 0.055);
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

html.light {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #e9eff6;
  --border: rgba(15, 23, 42, 0.09);
  --border-hi: rgba(15, 23, 42, 0.18);
  --txt: #0f172a;
  --txt-2: #334155;
  --muted: #64748b;
  --acc: #059669;
  --acc-2: #059669;
  --cyan: #0891b2;
  --violet: #7c3aed;
  --acc-soft: rgba(5, 150, 105, 0.09);
  --acc-line: rgba(5, 150, 105, 0.28);
  --cyan-soft: rgba(8, 145, 178, 0.09);
  --cyan-line: rgba(8, 145, 178, 0.26);
  --violet-soft: rgba(124, 58, 237, 0.09);
  --violet-line: rgba(124, 58, 237, 0.26);
  --cta-bg: #059669;
  --cta-fg: #ffffff;
  --cta-h: #047857;
  --ok: #059669;
  --ok-soft: rgba(5, 150, 105, 0.10);
  --ok-line: rgba(5, 150, 105, 0.26);
  --warn: #b45309;
  --warn-soft: rgba(217, 119, 6, 0.11);
  --warn-line: rgba(217, 119, 6, 0.28);
  --bad: #dc2626;
  --bad-soft: rgba(220, 38, 38, 0.09);
  --bad-line: rgba(220, 38, 38, 0.26);
  --hdr-bg: rgba(243, 246, 250, 0.82);
  --term-bg: #0f172a;
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --grid-col: rgba(15, 23, 42, 0.045);
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background-color: var(--bg);
  color: var(--txt);
  font-family: var(--font-sans);
  font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 42% at 50% -6%, rgba(16, 185, 129, 0.13), transparent 70%),
    radial-gradient(35% 30% at 85% 12%, rgba(34, 211, 238, 0.07), transparent 70%),
    linear-gradient(to right, var(--grid-col) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-col) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.35) 55%, transparent 90%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.35) 55%, transparent 90%);
}
html.light body::before {
  background:
    radial-gradient(60% 42% at 50% -6%, rgba(5, 150, 105, 0.09), transparent 70%),
    linear-gradient(to right, var(--grid-col) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-col) 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
}

a { color: var(--acc-2); text-decoration: none; }
a:hover { color: var(--cyan); }
button, input, select, textarea { font-family: inherit; color: inherit; }

#app { min-height: 100vh; display: flex; flex-direction: column; overflow-x: clip; }

/* Header */
.hdr {
  position: sticky; top: 0; z-index: 40;
  background: var(--hdr-bg);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.hdr-in {
  max-width: 1200px; margin: 0 auto;
  padding: 13px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--txt); font-family: var(--font-display);
  font-weight: 700; font-size: 17px; letter-spacing: 0.01em;
}
.brand:hover { color: var(--txt); }
.brand-badge {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, rgba(16,185,129,0.22), rgba(34,211,238,0.12));
  border: 1px solid var(--acc-line);
  color: var(--acc-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.brand-tag {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 5px;
  background: var(--acc-soft); color: var(--acc-2);
  border: 1px solid var(--acc-line); letter-spacing: 0.07em;
}

.nav-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 4px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--glass-hi);
}
.nav-pill a {
  padding: 6px 15px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--muted);
  transition: all .15s;
}
.nav-pill a:hover { color: var(--txt); }
.nav-pill a.active {
  background: var(--surface-3); color: var(--txt); font-weight: 600;
}

.hdr-right { display: flex; align-items: center; gap: 8px; }
.h-btn {
  height: 34px; min-width: 34px; padding: 0 10px;
  border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--txt-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.h-btn:hover { border-color: var(--border-hi); color: var(--txt); background: var(--surface-2); }

.pulse-pill {
  height: 34px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--ok-line); background: var(--ok-soft);
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; color: var(--ok);
  white-space: nowrap;
}
.pulse-pill.warn { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); }
.pulse-pill.bad  { border-color: var(--bad-line); background: var(--bad-soft); color: var(--bad); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; flex-shrink: 0; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.dot.live { box-shadow: 0 0 0 3px var(--ok-soft); animation: pulseDot 2.2s infinite; }
.dot.warn.live { box-shadow: 0 0 0 3px var(--warn-soft); animation: none; }
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 2px var(--ok-soft); }
  50% { box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.04); }
}

/* Main */
.main {
  flex: 1; width: 100%;
  max-width: 1200px; margin: 0 auto;
  padding: 36px 24px 72px;
}

/* Flagship Asymmetric Split Hero (Full-width, zero pyramid) */
.hero-split {
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 34px;
}
.hero-left {
  min-width: 0;
  display: flex; flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%;
  padding: 6px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border-hi);
  box-shadow: var(--glass-hi);
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  color: var(--txt-2); letter-spacing: 0.02em;
}
.hero-tag b { color: var(--acc-2); }
.hero-title {
  margin: 14px 0 12px;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.35vw, 43px);
  font-weight: 700; line-height: 1.08; letter-spacing: -0.03em;
  text-wrap: balance;
}
.grad-txt {
  background: linear-gradient(95deg, var(--acc-2) 0%, var(--cyan) 55%, var(--violet) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-desc {
  margin: 0; font-size: 14.5px; line-height: 1.62;
  color: var(--muted); max-width: 540px;
  text-wrap: pretty;
}

/* 3-pillar value strip inside Left Hero */
.hero-pillars {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.pillar {
  min-width: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 13px;
  box-shadow: var(--glass-hi);
}
.pillar-t {
  font-family: var(--font-display); font-size: 13.5px; font-weight: 700;
  color: var(--txt); margin-bottom: 3px;
}
.pillar-s { font-size: 11.5px; line-height: 1.45; color: var(--muted); }

/* Right-hand Hero Command Card (Key Check + Quick Connect) */
.checker-shell {
  min-width: 0;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--acc-line);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: var(--glass-hi), 0 24px 64px -30px rgba(16, 185, 129, 0.34);
  display: flex; flex-direction: column; gap: 16px;
}
.console-form { display: flex; gap: 9px; align-items: stretch; }
.key-box {
  flex: 1; display: flex; align-items: center; gap: 9px;
  background: var(--surface-2); border: 1px solid var(--border-hi);
  border-radius: 11px; padding: 0 8px 0 13px;
  transition: border-color .15s, box-shadow .15s;
}
.key-box:focus-within {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-soft);
}
.key-prompt {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700;
  color: var(--acc-2); user-select: none; white-space: nowrap;
}
.key-input {
  flex: 1; min-width: 0; border: none; background: transparent;
  padding: 12px 4px; font-family: var(--font-mono); font-size: 13.5px;
  color: var(--txt); outline: none;
}
.key-vis {
  border: none; background: transparent; color: var(--muted);
  width: 30px; height: 30px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.key-vis:hover { color: var(--txt); background: var(--surface-3); }

.hero-divider { height: 1px; background: var(--border); }

.qc-block { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.qc-row {
  min-width: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 11px; padding: 9px 12px;
}
.qc-meta { min-width: 0; overflow: hidden; }
.qc-lbl {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.ep-url { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--acc-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-pill-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 13px; padding: 11px 14px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--glass-hi); max-width: 100%;
}

.cli-box {
  min-width: 0; max-width: 100%;
  background: var(--term-bg); border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 11px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 7px;
  color: #e2e8f0;
}
.cli-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.cli-head-l {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: #94a3b8;
}
.cli-os-sw {
  display: inline-flex; gap: 2px; background: rgba(255,255,255,0.06);
  padding: 2px; border-radius: 6px; flex-shrink: 0;
}
.cli-os-btn {
  border: none; background: transparent; color: #94a3b8;
  padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600;
  cursor: pointer;
}
.cli-os-btn.active { background: rgba(16,185,129,0.22); color: #34d399; }
.cli-line {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.cli-code {
  flex: 1; margin: 0; font-family: var(--font-mono); font-size: 10.8px;
  color: #e2e8f0; overflow-x: auto; white-space: nowrap;
  scrollbar-width: thin; scrollbar-color: rgba(148,163,184,0.25) transparent;
}
.inline-code {
  font-family: var(--font-mono); font-size: 12px;
  padding: 1px 6px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--acc-2);
}

/* Full-width Key Result Shell below Split Hero */
.kr-panel {
  background: var(--surface); border: 1px solid var(--acc-line);
  border-radius: 18px; padding: 22px 24px;
  margin-bottom: 30px;
  box-shadow: var(--glass-hi), 0 22px 54px -28px rgba(16, 185, 129, 0.28);
  animation: slideUp .18s ease-out;
}
.save-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 9px; font-size: 12px; color: var(--muted);
}
.save-chk {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none;
}
.save-chk input { accent-color: var(--acc); width: 14px; height: 14px; cursor: pointer; }

/* Live Mini-Playground inside Key Dashboard */
.pg-box {
  margin-top: 14px; padding: 14px 16px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.pg-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.pg-bar .sel { width: auto; min-width: 220px; padding: 7px 11px; font-family: var(--font-mono); font-size: 12.5px; }
.pg-out {
  margin-top: 10px; padding: 10px 13px; border-radius: 9px;
  background: var(--term-bg); border: 1px solid rgba(148, 163, 184, 0.16);
  color: #e2e8f0; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.5;
}
.pg-meta {
  display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px;
  font-size: 11px; color: #94a3b8;
}

/* Top-up Callout inside Key Dashboard */
.topup-callout {
  margin-top: 14px; padding: 14px 16px; border-radius: 12px;
  background: var(--warn-soft); border: 1px solid var(--warn-line);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.topup-callout.bad { background: var(--bad-soft); border-color: var(--bad-line); }
.kr-foot {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}

/* Token Package Calculator (Home) */
.calc-card {
  background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: 18px; padding: 24px 26px; margin-bottom: 24px;
  box-shadow: var(--glass-hi);
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 26px; align-items: center;
}
.calc-left { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.calc-big {
  font-family: var(--font-display); font-size: clamp(28px, 3.2vw, 38px);
  font-weight: 700; letter-spacing: -0.025em; line-height: 1.1;
}
.calc-big small { font-family: var(--font-sans); font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.calc-range {
  width: 100%; accent-color: var(--acc); cursor: pointer; height: 6px;
}
.calc-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.calc-pill {
  padding: 6px 11px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--txt-2);
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.calc-pill:hover { border-color: var(--border-hi); color: var(--txt); }
.calc-pill.active { background: var(--acc-soft); border-color: var(--acc-line); color: var(--acc-2); }
.calc-grid {
  min-width: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.calc-stat {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 15px;
}
.calc-stat-k {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.calc-stat-v {
  font-family: var(--font-display); font-size: 21px; font-weight: 700;
  color: var(--txt); margin: 4px 0 2px; letter-spacing: -0.02em;
}
.calc-stat-s { font-size: 11.5px; color: var(--muted); line-height: 1.4; }

/* Docs Client Guide Grid */
.doc-key-bar {
  background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: 13px; padding: 12px 16px; margin-bottom: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.doc-key-bar.active { border-color: var(--acc-line); background: var(--acc-soft); }
.guide-steps {
  margin: 0 0 14px; padding-left: 20px; color: var(--txt-2); font-size: 13.5px; line-height: 1.7;
}
.guide-steps li { margin-bottom: 4px; }
.kv-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.kv-box {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.kv-box .kv-v {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--txt);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Section Headers */
.sec-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.sec-title {
  margin: 0; font-family: var(--font-display);
  font-size: 24px; font-weight: 700; letter-spacing: -0.025em;
}
.sec-sub { font-size: 13.5px; color: var(--muted); margin-top: 3px; }

/* Premium Flagship Model Cards (3-col Showcase Grid) */
.showcase-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 18px; margin-bottom: 28px;
}
.m-pro {
  min-width: 0;
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 22px 18px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--glass-hi);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.m-pro::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--m-accent, var(--acc)), transparent 85%);
  opacity: 0.85;
}
.m-pro::after {
  content: ''; position: absolute; top: -60px; right: -60px; width: 170px; height: 170px;
  background: radial-gradient(circle, var(--m-glow, rgba(16,185,129,0.14)), transparent 70%);
  pointer-events: none;
}
.m-pro.accent-emerald { --m-accent: #10b981; --m-glow: rgba(16,185,129,0.16); }
.m-pro.accent-cyan    { --m-accent: #22d3ee; --m-glow: rgba(34,211,238,0.15); }
.m-pro.accent-violet  { --m-accent: #a78bfa; --m-glow: rgba(167,139,250,0.16); }

.m-pro:hover {
  transform: translateY(-2px);
  border-color: var(--border-hi);
  box-shadow: var(--glass-hi), 0 22px 44px -26px rgba(0,0,0,0.65);
}

.m-pro-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.m-fam-wrap { display: inline-flex; align-items: center; gap: 9px; }
.m-fam-ico {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border-hi);
  color: var(--m-accent, var(--acc-2));
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
}
.m-role-tag {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  color: var(--m-accent, var(--acc-2)); letter-spacing: 0.04em; text-transform: uppercase;
}
.m-pro-name {
  margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.2;
}
.m-id-chip {
  display: inline-flex; align-items: center; gap: 7px; width: fit-content;
  margin-top: 6px; padding: 4px 10px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 11.5px; color: var(--txt-2);
  cursor: pointer; transition: all .15s;
}
.m-id-chip:hover { border-color: var(--m-accent, var(--acc)); color: var(--txt); }
.m-pro-desc {
  margin: 0; font-size: 13px; line-height: 1.55; color: var(--muted);
  min-height: 42px; flex-grow: 1;
}

/* Unified 3-Metric Telemetry Grid (IDENTICAL units across every card!) */
.tel-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.tel-cell {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 10px 9px;
}
.tel-k {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.tel-v {
  font-family: var(--font-display); font-size: 17px; font-weight: 700;
  margin-top: 3px; color: var(--txt); letter-spacing: -0.02em; white-space: nowrap;
}
.tel-v small { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; color: var(--muted); margin-left: 3px; }

/* Live 24-check Uptime Sparkline */
.up-block { display: flex; flex-direction: column; gap: 5px; }
.up-head {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 10px; color: var(--muted);
}
.up-bars { display: flex; gap: 3px; height: 18px; align-items: stretch; }
.up-bar {
  flex: 1; border-radius: 3px; background: var(--ok); opacity: 0.82;
  transition: opacity .15s, transform .15s;
}
.up-bar.bad { background: var(--bad); opacity: 0.9; }
.up-bar:hover { opacity: 1; transform: scaleY(1.12); }

/* Capability Tags & Footer Actions on Model Card */
.cap-row { display: flex; flex-wrap: wrap; gap: 6px; }
.cap-tag {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  padding: 3px 8px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--txt-2);
}
.cap-tag.hl { background: var(--acc-soft); border-color: var(--acc-line); color: var(--acc-2); font-weight: 600; }

.m-pro-foot {
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border);
  display: flex; gap: 8px;
}
.m-pro-foot .btn { flex: 1; }

/* Panels & General Cards */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--glass-hi);
}
.panel.glow {
  border-color: var(--acc-line);
  box-shadow: var(--glass-hi), 0 18px 44px -26px rgba(16, 185, 129, 0.35);
}
.sec-kicker {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 12px;
}
.sec-kicker-l { display: inline-flex; align-items: center; gap: 7px; }

/* Inputs & Buttons */
.inp, .sel, .ta {
  width: 100%; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 13.5px; color: var(--txt);
  outline: none; transition: border-color .15s;
}
.inp:focus, .sel:focus, .ta:focus { border-color: var(--acc); }
.inp.mono, .ta.mono { font-family: var(--font-mono); font-size: 13px; }
.ta { min-height: 90px; resize: vertical; line-height: 1.5; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--txt);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--border-hi); background: var(--surface-3); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.cta { background: var(--cta-bg); color: var(--cta-fg); border-color: var(--cta-bg); }
.btn.cta:hover { background: var(--cta-h); border-color: var(--cta-h); }
.btn.ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
.btn.danger { color: var(--bad); border-color: var(--bad-line); background: var(--bad-soft); }
.btn.sm { padding: 7px 12px; font-size: 12.5px; border-radius: 8px; }
.btn.xs { padding: 4px 9px; font-size: 11.5px; border-radius: 6px; font-weight: 600; }
.btn.full { width: 100%; }
.btn.icon { width: 32px; height: 32px; padding: 0; }

.term-copy {
  flex-shrink: 0; height: 28px; padding: 0 9px; border-radius: 7px;
  border: 1px solid rgba(148,163,184,0.22); background: rgba(255,255,255,0.06); color: #e2e8f0;
  font-size: 11.5px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
.term-copy:hover { border-color: #10b981; color: #34d399; }

/* Key Check Result Dashboard (Donut Ring) */
.kr-wrap {
  margin-top: 18px; padding-top: 18px;
  border-top: 1px solid var(--border);
  animation: slideUp .18s ease-out;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.kr-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.kr-pkg { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.kr-mask { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 2px; }

.kr-meter {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 16px 18px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 12px;
}
.donut-wrap { position: relative; width: 78px; height: 78px; flex-shrink: 0; }
.donut-wrap svg { transform: rotate(-90deg); width: 78px; height: 78px; }
.donut-pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
}
.kr-nums { flex: 1; min-width: 200px; }
.kr-big { font-family: var(--font-display); font-size: clamp(26px, 3.4vw, 34px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.kr-big small { font-family: var(--font-sans); font-size: 13.5px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.bar { width: 100%; height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 9px; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--acc); transition: width .35s ease; }
.bar-fill.ok { background: var(--ok); }
.bar-fill.warn { background: var(--warn); }
.bar-fill.bad { background: var(--bad); }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; }
.st-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; }
.st-k { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.st-v { font-family: var(--font-mono); font-size: 16px; font-weight: 700; margin-top: 3px; }
.st-s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* Steps & Support Banner */
.bento-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.step-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--glass-hi);
}
.step-num { font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; color: var(--acc-2); margin-bottom: 8px; }
.step-card h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 16.5px; font-weight: 700; }
.step-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.58; }

.support-banner {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
  box-shadow: var(--glass-hi);
}

/* Models Page Hero & KPI Strip */
.page-hero {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 24px;
}
.page-hero h1 {
  margin: 12px 0 8px; font-family: var(--font-display);
  font-size: clamp(30px, 4.2vw, 44px); font-weight: 700;
  line-height: 1.06; letter-spacing: -0.03em;
}
.page-hero p { margin: 0; color: var(--muted); font-size: 14.5px; max-width: 560px; }

/* Pills, Alerts, Chips, Tables */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--txt-2);
  white-space: nowrap;
}
.pill.ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.pill.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.pill.bad { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.pill.acc { background: var(--acc-soft); border-color: var(--acc-line); color: var(--acc-2); }

.alert { margin-top: 12px; padding: 11px 14px; border-radius: 10px; font-size: 13px; line-height: 1.5; border: 1px solid var(--border); background: var(--surface-2); }
.alert.ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.alert.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.alert.bad { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.alert.acc { background: var(--acc-soft); border-color: var(--acc-line); color: var(--acc-2); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface-2);
  font-family: var(--font-mono); font-size: 12px; color: var(--txt); cursor: pointer;
}
.chip:hover { border-color: var(--acc); color: var(--acc-2); }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--glass-hi); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; padding: 11px 12px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
  background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.tbl td { padding: 12px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: var(--surface-2); }
.num { text-align: right !important; font-family: var(--font-mono); white-space: nowrap; }
table.tbl td.mono { white-space: nowrap; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tab { padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--muted); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--txt); }
.tab.active { color: var(--acc-2); border-bottom-color: var(--acc); }

pre.code-view {
  margin: 0; padding: 15px 16px; border-radius: 10px;
  background: var(--term-bg); border: 1px solid rgba(148,163,184,0.16);
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6;
  overflow-x: auto; color: #e2e8f0;
}

details.faq { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 14px 16px; }
details.faq summary { cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq[open] summary { margin-bottom: 8px; color: var(--acc-2); }
details.faq p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }

/* Footer */
.ftr { border-top: 1px solid var(--border); padding: 20px 24px; font-size: 12.5px; color: var(--muted); }
.ftr-in { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ftr-links { display: flex; gap: 16px; }
.ftr-links a { color: var(--muted); }
.ftr-links a:hover { color: var(--txt); }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* KPI Grid & Admin Components */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--glass-hi); }
.kpi-label { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.kpi-val { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin: 5px 0 3px; letter-spacing: -0.02em; }
.kpi-hint { font-size: 12px; color: var(--muted); }

.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-head h1 { margin: 0; font-family: var(--font-display); font-size: 27px; font-weight: 700; }
.admin-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.admin-nav-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.admin-nav-btn:hover { background: var(--surface); border-color: var(--border); color: var(--txt); }
.admin-nav-btn.active { background: var(--acc-soft); border-color: var(--acc-line); color: var(--acc-2); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.fpill { padding: 6px 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.fpill:hover { color: var(--txt); border-color: var(--border-hi); }
.fpill.active { background: var(--acc-soft); border-color: var(--acc-line); color: var(--acc-2); }
.preset-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.preset-btn { padding: 5px 10px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2); color: var(--txt-2); font-family: var(--font-mono); font-size: 12px; cursor: pointer; }
.preset-btn:hover, .preset-btn.active { border-color: var(--acc); background: var(--acc-soft); color: var(--acc-2); }
.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 135px; padding-top: 12px; }
.chart-col { flex: 1; min-width: 16px; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; max-width: 34px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--cyan), var(--acc)); min-height: 3px; opacity: 0.9; }
.chart-lbl { font-size: 10px; font-family: var(--font-mono); color: var(--muted); }

/* Master-Detail (Admin) */
.md-grid { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.md-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; max-height: 74vh; overflow-y: auto; }
.md-item { padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; border-left: 3px solid transparent; }
.md-item:last-child { border-bottom: none; }
.md-item:hover { background: var(--surface-2); }
.md-item.active { background: var(--acc-soft); border-left-color: var(--acc); }
.md-item-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.md-item-name { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-item-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.md-detail { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.lim-bar-wrap { min-width: 135px; }
.lim-bar-top { display: flex; justify-content: space-between; gap: 6px; font-family: var(--font-mono); font-size: 11.5px; margin-bottom: 4px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }

/* Modals & Toasts */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(4, 7, 12, 0.72); display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(5px); }
.modal-box { width: 100%; max-width: 580px; max-height: 90vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border-hi); border-radius: 16px; padding: 22px 24px; box-shadow: 0 28px 64px -20px rgba(0,0,0,0.7); }
.modal-box.wide { max-width: 760px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-head h3 { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 700; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--txt-2); margin-bottom: 5px; }
.field-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.check-list { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); font-size: 12.5px; cursor: pointer; user-select: none; }
.check-pill input { accent-color: var(--acc); }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.toast { padding: 10px 14px; border-radius: 10px; background: var(--surface-3); color: var(--txt); font-size: 13px; font-weight: 600; border: 1px solid var(--border-hi); animation: slideUp .15s ease-out; }
.toast.ok { background: #059669; color: #fff; border-color: transparent; }
.toast.err { background: #dc2626; color: #fff; border-color: transparent; }
.login-wrap { max-width: 440px; margin: 44px auto; }
.skel { height: 18px; border-radius: 7px; background: var(--surface-2); margin-bottom: 10px; opacity: 0.7; }

@media (max-width: 1020px) {
  .hero-split, .calc-card { grid-template-columns: 1fr; gap: 20px; }
  .showcase-grid, .bento-3, .md-grid, .two-col { grid-template-columns: 1fr; }
  .md-list { max-height: 320px; }
}
@media (max-width: 720px) {
  .hdr-in { padding: 10px 14px; flex-wrap: wrap; row-gap: 10px; }
  .nav-pill { order: 3; width: 100%; justify-content: center; }
  .nav-pill a { flex: 1; text-align: center; padding: 6px 10px; }
  .brand-tag { display: none; }
  .pulse-pill .st-txt { display: none; }
  .main { padding: 24px 14px 52px; }
  .hero-pillars, .calc-grid { grid-template-columns: 1fr; }
  .calc-card { padding: 18px 16px; }
  .console-form { flex-direction: column; }
}
