:root {
  --bg: #071014;
  --panel: #0c181d;
  --panel-2: #102128;
  --line: #1c333c;
  --text: #ebf5f3;
  --muted: #84a2aa;
  --teal: #48e5c2;
  --blue: #55a7ff;
  --violet: #9f86ff;
  --amber: #ffc857;
  --red: #ff6b7a;
  --shadow: 0 18px 55px rgba(0, 0, 0, .28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 80% 0%, #123038 0, transparent 34%), var(--bg); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }

.shell { display: grid; grid-template-columns: 246px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 25px 18px 18px; border-right: 1px solid var(--line); background: rgba(7, 16, 20, .91); backdrop-filter: blur(16px); display: flex; flex-direction: column; }
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 20px; letter-spacing: .08em; }
.brand small { margin-top: -2px; color: var(--muted); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.brand-mark { width: 34px; height: 38px; position: relative; display: flex; gap: 4px; align-items: center; transform: skewY(-14deg); }
.brand-mark i { width: 7px; border-radius: 2px; background: var(--teal); box-shadow: 0 0 20px rgba(72,229,194,.25); }
.brand-mark i:nth-child(1) { height: 23px; opacity: .6; }.brand-mark i:nth-child(2) { height: 36px; }.brand-mark i:nth-child(3) { height: 28px; opacity: .8; }
nav { display: grid; gap: 5px; }
.nav-label { color: #58727a; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; margin: 18px 12px 6px; }
.nav-item { border: 0; background: transparent; border-radius: 10px; padding: 10px 12px; display: flex; gap: 11px; align-items: center; color: var(--muted); cursor: pointer; text-align: left; transition: .18s ease; }
.nav-item span { width: 19px; color: #66868e; font-family: ui-monospace, monospace; text-align: center; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.035); }
.nav-item.active { color: var(--text); background: linear-gradient(90deg, rgba(72,229,194,.16), rgba(72,229,194,.04)); box-shadow: inset 2px 0 var(--teal); }
.nav-item.active span { color: var(--teal); }
.sidebar-footer { margin-top: auto; display: grid; gap: 12px; }
.mode-card { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; }
.mode-card small, .mode-card strong { display: block; }.mode-card small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }.mode-card strong { margin-top: 2px; font-size: 13px; }
.status-dot { width: 8px; height: 8px; display: inline-block; flex: none; border-radius: 50%; background: var(--teal); box-shadow: 0 0 12px rgba(72,229,194,.7); }.status-dot.demo { background: var(--blue); box-shadow: 0 0 12px rgba(85,167,255,.65); }.status-dot.bad { background: var(--red); box-shadow: 0 0 12px rgba(255,107,122,.6); }
main { min-width: 0; }
.topbar { height: 112px; padding: 26px 34px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; background: rgba(7,16,20,.45); }
.topbar h1, h2 { margin: 2px 0 0; letter-spacing: -.035em; }.topbar h1 { font-size: 27px; }.card h2, .split-heading h2 { font-size: 18px; }
.eyebrow { margin: 0; color: var(--teal); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }.eyebrow.warning { color: var(--amber); }
.top-actions { display: flex; align-items: center; gap: 10px; }.health-chip { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; color: #bad0d4; font-size: 12px; }
.content { padding: 28px 34px 50px; max-width: 1540px; margin: 0 auto; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; transform: none !important; }
.ghost, .primary, .danger, .mini, .text-button, .icon-button { border-radius: 8px; transition: .15s ease; }
.mobile-only { display: none; }
.ghost { padding: 9px 13px; border: 1px solid var(--line); background: rgba(255,255,255,.02); color: #bad0d4; }.ghost:hover { background: var(--panel-2); border-color: #31515d; }.ghost.wide { width: 100%; }
.primary { padding: 9px 14px; background: var(--teal); color: #05201a; font-weight: 750; }.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.danger { padding: 9px 14px; background: var(--red); color: #240308; font-weight: 750; }.danger:disabled { opacity: .35; cursor: not-allowed; }
.text-button { padding: 5px 0; background: transparent; color: var(--teal); }.text-button:hover { color: #8ef4de; }
.icon-button { width: 32px; height: 32px; background: transparent; color: var(--muted); font-size: 24px; }.icon-button:hover { background: rgba(255,255,255,.06); color: var(--text); }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.metric { min-height: 125px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, rgba(255,255,255,.025), transparent), var(--panel); box-shadow: var(--shadow); display: flex; flex-direction: column; }.metric > span { color: var(--muted); font-size: 12px; }.metric strong { font-size: 28px; margin-top: auto; letter-spacing: -.03em; }.metric small { color: #66868e; font-size: 11px; }.metric.teal { border-top-color: rgba(72,229,194,.55); }.metric.amber { border-top-color: rgba(255,200,87,.7); }
.dashboard-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; margin-bottom: 14px; }
.card { border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, rgba(255,255,255,.018), transparent), var(--panel); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.card > header { min-height: 71px; padding: 17px 19px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 14px; }.card > header .caption { color: var(--muted); font-size: 11px; }
.gauges { min-height: 220px; padding: 28px 18px; display: flex; justify-content: space-around; align-items: center; gap: 16px; }
.gauge { display: grid; justify-items: center; gap: 11px; color: var(--muted); font-size: 12px; }.gauge-ring { --color: var(--teal); width: 100px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle closest-side, var(--panel) 77%, transparent 79% 100%), conic-gradient(var(--color) calc(var(--value) * 1%), #1b3037 0); }.gauge-ring strong { font-size: 20px; color: var(--text); }.gauge-ring.blue { --color: var(--blue); }.gauge-ring.violet { --color: var(--violet); }.gauge-ring.amber { --color: var(--amber); }
.sparkline { display: block; width: calc(100% - 36px); height: 135px; margin: 5px 18px 0; }.chart-meta { display: flex; align-items: baseline; gap: 8px; padding: 23px 20px 0; }.chart-meta strong { font-size: 30px; }.chart-meta span, .chart-axis { color: var(--muted); font-size: 11px; }.chart-axis { display: flex; justify-content: space-between; padding: 2px 20px 20px; }
.table-wrap { overflow-x: auto; }table { width: 100%; border-collapse: collapse; font-size: 12px; }th { text-align: left; padding: 11px 15px; color: #73939b; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; background: rgba(0,0,0,.12); }td { padding: 13px 15px; border-top: 1px solid rgba(28,51,60,.76); color: #c7dadd; white-space: nowrap; }tbody tr:hover { background: rgba(72,229,194,.025); }.row-actions { display: flex; gap: 6px; }.mini { padding: 5px 8px; border: 1px solid var(--line); background: transparent; color: #9db5ba; font-size: 10px; }.mini:hover { border-color: #41636d; color: var(--text); }.mini.danger-text { color: #ff98a2; }
.pill { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; background: #18292f; color: var(--muted); }.pill.ok { background: rgba(72,229,194,.1); color: var(--teal); }.pill.warn { background: rgba(255,200,87,.1); color: var(--amber); }.pill.danger { background: rgba(255,107,122,.1); color: var(--red); }
.split-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 0 18px; }.split-heading h2 { margin: 0; }.split-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.tabbed-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }.security-note { display: flex; gap: 14px; align-items: flex-start; padding: 17px; margin-bottom: 14px; border: 1px solid rgba(85,167,255,.27); background: rgba(85,167,255,.07); border-radius: 12px; }.security-note > span { color: var(--blue); font-size: 22px; }.security-note strong { font-size: 13px; }.security-note p { margin: 4px 0 0; max-width: 900px; color: #91abb1; font-size: 11px; line-height: 1.55; }
.explorer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }.explorer-grid .card { min-height: 550px; }.explorer-grid label, dialog label { display: grid; gap: 7px; margin: 16px 18px; color: #9bb4ba; font-size: 11px; }.explorer-grid select, .explorer-grid input, .explorer-grid textarea, dialog input { width: 100%; border: 1px solid var(--line); border-radius: 8px; outline: none; background: #081318; color: #dfecea; padding: 10px 11px; }.explorer-grid input:focus, .explorer-grid textarea:focus, .explorer-grid select:focus, dialog input:focus { border-color: rgba(72,229,194,.6); box-shadow: 0 0 0 3px rgba(72,229,194,.07); }.explorer-grid textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; line-height: 1.5; }.method-path { display: grid; grid-template-columns: 105px 1fr; gap: 8px; margin: 0 18px; }.request-footer { display: flex; align-items: center; justify-content: space-between; padding: 0 18px 18px; }.response-toolbar { display: flex; justify-content: space-between; padding: 13px 17px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }pre { margin: 0; padding: 18px; overflow: auto; color: #afd6d1; font: 11px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.empty, .error-state, .loading { min-height: 220px; display: grid; place-content: center; justify-items: center; text-align: center; }.empty span, .error-state p, .loading p { color: var(--muted); font-size: 12px; }.empty strong { font-size: 14px; }.error-state > span { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(255,107,122,.4); background: rgba(255,107,122,.08); color: var(--red); border-radius: 50%; }.loading span { width: 27px; height: 27px; border: 2px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite; }@keyframes spin { to { transform: rotate(360deg); } }
dialog { width: min(560px, calc(100vw - 40px)); max-height: calc(100vh - 22px); overflow: auto; border: 1px solid #29444d; border-radius: 16px; padding: 0; color: var(--text); background: #0b171c; box-shadow: 0 30px 100px #000; }dialog::backdrop { background: rgba(0,5,7,.78); backdrop-filter: blur(5px); }.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }.dialog-head h2 { margin: 3px 0 0; }.dialog-copy { margin: 17px 22px 8px; color: var(--muted); font-size: 12px; line-height: 1.55; }.field-grid { display: grid; grid-template-columns: 1fr 1fr; }.toggle-row { display: flex !important; align-items: center; gap: 9px !important; }.toggle-row input { width: auto; accent-color: var(--teal); }.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px 20px; }.risk-panel { margin: 18px 22px; padding: 14px; border-radius: 10px; border: 1px solid rgba(255,200,87,.25); background: rgba(255,200,87,.06); }.risk-panel strong { color: var(--amber); font-size: 12px; }.risk-panel p { color: #aabec2; font-size: 11px; line-height: 1.5; }.risk-panel pre { max-height: 115px; padding: 0; color: #92adb2; }#confirmation-phrase { display: block; margin: -5px 22px 8px; padding: 9px 11px; border: 1px dashed #38505a; border-radius: 8px; color: var(--amber); background: #081318; }
.toast { position: fixed; right: 25px; bottom: 25px; transform: translateY(25px); opacity: 0; pointer-events: none; padding: 12px 16px; border: 1px solid rgba(72,229,194,.25); border-radius: 10px; background: #10211f; color: var(--teal); box-shadow: var(--shadow); font-size: 12px; transition: .2s ease; }.toast.show { transform: translateY(0); opacity: 1; }.toast.error { border-color: rgba(255,107,122,.3); background: #251215; color: #ff9ba4; }
@media (max-width: 1180px) { .content { padding-left: 22px; padding-right: 22px; }.metrics-grid { grid-template-columns: repeat(2, 1fr); }.dashboard-grid, .explorer-grid { grid-template-columns: 1fr; }.tabbed-cards { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: sticky; z-index: 10; width: 100%; height: auto; padding: 10px 12px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 4px 9px; }
  .brand-mark { width: 25px; height: 29px; }
  .brand-mark i { width: 5px; }
  .brand-mark i:nth-child(1) { height: 17px; }.brand-mark i:nth-child(2) { height: 27px; }.brand-mark i:nth-child(3) { height: 21px; }
  .brand strong { font-size: 16px; }.brand small { font-size: 9px; }
  nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: thin; }
  .nav-label, .sidebar-footer { display: none; }
  .nav-item { flex: 0 0 auto; padding: 8px 10px; font-size: 11px; border: 1px solid transparent; }
  .nav-item.active { box-shadow: none; border-color: rgba(72,229,194,.28); }
  .topbar { height: auto; min-height: 86px; padding: 18px 17px; align-items: flex-start; gap: 12px; }
  .topbar h1 { font-size: 21px; }
  .top-actions { align-items: flex-end; flex-direction: column-reverse; }
  .mobile-only { display: inline-flex; }
  .health-chip { padding: 6px 9px; font-size: 10px; }
  .content { padding: 17px 12px 36px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { min-height: 105px; padding: 14px; }.metric strong { font-size: 22px; }
  .gauges { min-height: 0; padding: 20px 10px; display: grid; grid-template-columns: repeat(2, 1fr); }
  .gauge-ring { width: 82px; }
  .card > header { padding: 14px; align-items: flex-start; flex-direction: column; }
  .split-heading { align-items: flex-start; gap: 12px; }
  .split-heading .primary { flex: none; }
  .method-path { grid-template-columns: 85px 1fr; margin: 0 12px; }
  .explorer-grid label { margin-left: 12px; margin-right: 12px; }
  .request-footer { padding-left: 12px; padding-right: 12px; }
  .field-grid { grid-template-columns: 1fr; }
  dialog { width: calc(100vw - 22px); }
  .dialog-head, .dialog-actions { padding-left: 16px; padding-right: 16px; }
  .dialog-copy, dialog label, .risk-panel { margin-left: 16px; margin-right: 16px; }
  #confirmation-phrase { margin-left: 16px; margin-right: 16px; }
  .toast { right: 12px; bottom: 12px; max-width: calc(100vw - 24px); }
}
