:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: rgba(15, 23, 42, .76);
  --panel-solid: #0f172a;
  --line: rgba(148, 163, 184, .18);
  --text: #e5f4ff;
  --text-muted: #94a3b8;
  --accent: #67e8f9;
  --accent-2: #a7f3d0;
  --hot: #f97316;
  --danger: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, .38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 8%, rgba(34, 211, 238, .16), transparent 28rem),
    radial-gradient(circle at 84% 10%, rgba(16, 185, 129, .12), transparent 30rem),
    linear-gradient(140deg, #07111f 0%, #0a1426 50%, #08101f 100%);
  color: var(--text);
  overflow-x: hidden;
}

button, input { font: inherit; }
button { cursor: pointer; }

.orb {
  position: fixed;
  width: 32rem;
  height: 32rem;
  border-radius: 999px;
  filter: blur(48px);
  opacity: .22;
  z-index: -1;
}
.orb-a { left: -10rem; top: 20rem; background: #22d3ee; }
.orb-b { right: -12rem; top: 6rem; background: #22c55e; }

.hero {
  width: min(1220px, calc(100% - 32px));
  margin: 28px auto 18px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 20px;
  align-items: stretch;
}

.hero-copy,
.hero-visual,
.cards,
.panel,
dialog form {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-copy {
  border-radius: 32px;
  padding: clamp(24px, 5vw, 54px);
}

.hero-visual {
  border-radius: 32px;
  min-height: 360px;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(125deg, rgba(103, 232, 249, .12), transparent 45%),
    radial-gradient(circle at 70% 20%, rgba(167, 243, 208, .16), transparent 20rem);
}

.hero-visual img {
  position: relative;
  width: min(98%, 560px);
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .38));
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .78rem;
  font-weight: 800;
}

h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 18px;
  font-size: clamp(2.2rem, 6vw, 5rem);
  line-height: .94;
  letter-spacing: -.07em;
}
h2 {
  margin-bottom: 8px;
  font-size: 1.08rem;
  letter-spacing: -.02em;
}
.lead {
  max-width: 70ch;
  color: var(--text-muted);
  font-size: 1.03rem;
  line-height: 1.65;
}

.hero-actions,
.status-line,
.tabs,
.inline-field {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

button,
.file-label {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  color: var(--text);
  background: rgba(148, 163, 184, .13);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
button:hover,
.file-label:hover { transform: translateY(-1px); }
.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06202b;
  font-weight: 800;
}
.secondary {
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, .72);
}
.ghost {
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, .08);
}
.danger { color: var(--danger); }
.file-label input { display: none; }
.full { width: 100%; }

.status-line { margin-top: 22px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--accent-2);
  background: rgba(15, 23, 42, .65);
  font-size: .86rem;
}
.pill[data-mode="remote"] { color: var(--accent); }
.pill[data-mode="warn"] { color: var(--hot); }
.pill.muted { color: var(--text-muted); }

main {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto 30px;
  display: grid;
  gap: 18px;
}

.metrics-grid {
  border-radius: 28px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.metric {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, .035);
  min-height: 136px;
}
.metric.hot { background: linear-gradient(145deg, rgba(249, 115, 22, .18), rgba(255,255,255,.03)); }
.metric small {
  display: block;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.metric strong {
  display: block;
  font-size: clamp(1.28rem, 2vw, 1.74rem);
  letter-spacing: -.04em;
  margin-bottom: 10px;
}
.metric span {
  display: block;
  color: var(--text-muted);
  font-size: .86rem;
  line-height: 1.4;
}

.assumptions {
  border-radius: 28px;
  padding: 22px;
  display: grid;
  grid-template-columns: .9fr 1.5fr;
  gap: 18px;
  align-items: center;
}
.assumptions p { color: var(--text-muted); margin-bottom: 0; }
.assumptions dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.assumptions dt {
  color: var(--text-muted);
  font-size: .78rem;
  margin-bottom: 8px;
}
.assumptions dd {
  margin: 0;
  font-weight: 800;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.wide-left { grid-template-columns: minmax(0, 1.5fr) minmax(280px, .5fr); }
.panel {
  border-radius: 28px;
  padding: 20px;
  min-width: 0;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-head p,
.settings-panel .hint,
footer p {
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 0;
}
canvas {
  width: 100%;
  height: 260px;
  border-radius: 22px;
  background: rgba(2, 6, 23, .34);
  border: 1px solid var(--line);
}

.tabs {
  padding: 4px;
  background: rgba(2, 6, 23, .35);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.tab { padding: 8px 12px; }
.tab.active {
  background: rgba(103, 232, 249, .18);
  color: var(--accent);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 740px;
}
th, td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
th {
  color: var(--text-muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
td { color: #dbeafe; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.actions { text-align: right; }
.empty {
  color: var(--text-muted);
  text-align: center;
  padding: 24px;
}

.settings-panel form,
dialog form {
  display: grid;
  gap: 14px;
}
label {
  display: grid;
  gap: 8px;
  color: var(--text-muted);
  font-size: .9rem;
}
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(2, 6, 23, .38);
  color: var(--text);
  padding: 13px 14px;
  outline: 0;
}
input:focus { border-color: rgba(103, 232, 249, .65); box-shadow: 0 0 0 3px rgba(103, 232, 249, .08); }
code {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 5px;
  background: rgba(2, 6, 23, .45);
  color: var(--accent);
}

dialog {
  border: 0;
  background: transparent;
  width: min(560px, calc(100% - 28px));
  color: var(--text);
}
dialog::backdrop { background: rgba(2, 6, 23, .72); backdrop-filter: blur(8px); }
dialog form {
  border-radius: 28px;
  padding: 22px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.modal-head p { color: var(--text-muted); margin-bottom: 0; }
.inline-field { flex-wrap: nowrap; }
.inline-field input { flex: 1; }

footer {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto 34px;
  text-align: center;
}

@media (max-width: 1080px) {
  .metrics-grid { grid-template-columns: repeat(3, 1fr); }
  .hero, .grid-two, .wide-left, .assumptions { grid-template-columns: 1fr; }
  .assumptions dl { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .hero, main, footer { width: min(100% - 20px, 1220px); }
  .hero-copy, .hero-visual, .panel, .cards { border-radius: 22px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .assumptions dl { grid-template-columns: 1fr; }
  .hero-actions .primary, .hero-actions .secondary, .file-label { width: 100%; justify-content: center; text-align: center; }
  .panel-head { flex-direction: column; }
  .hero-visual { min-height: 260px; }
  h1 { font-size: 2.45rem; }
}
