:root {
  --bg: #070b14;
  --panel: #0d1524;
  --panel-edge: #1a2940;
  --text: #d7e6f7;
  --muted: #7a93b0;
  --cyan: #2de2e6;
  --cyan-dim: rgba(45, 226, 230, 0.15);
  --amber: #f0b429;
  --danger: #ff6b8a;
  --ok: #5dffb1;
  --font: "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 10% -10%, #122038 0%, var(--bg) 55%);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.45;
  padding: 1.25rem clamp(1rem, 3vw, 2rem) 2rem;
}

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 3px
  );
  opacity: 0.35;
  z-index: 0;
}

.top, .layout, .foot { position: relative; z-index: 1; }

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--panel-edge);
}

.brand { display: flex; gap: 0.85rem; align-items: center; }
.brand-mark {
  width: 2.6rem; height: 2.6rem;
  display: grid; place-items: center;
  border: 1px solid var(--cyan);
  border-radius: 0.4rem;
  color: var(--cyan);
  font-family: var(--font);
  font-size: 1.35rem;
  background: var(--cyan-dim);
  box-shadow: 0 0 18px rgba(45, 226, 230, 0.25);
}
.brand h1 {
  font-family: var(--font);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--cyan);
  font-weight: 600;
}
.tagline { color: var(--muted); font-size: 0.85rem; margin-top: 0.15rem; }
.badge {
  font-family: var(--font);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--cyan);
  border: 1px solid var(--panel-edge);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(13, 21, 36, 0.8);
}

.layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 1.25rem;
  align-items: start;
}

.panel {
  background: linear-gradient(180deg, rgba(16, 26, 44, 0.95), var(--panel));
  border: 1px solid var(--panel-edge);
  border-radius: 0.75rem;
  padding: 1.15rem 1.2rem 1.35rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.panel h2 {
  font-family: var(--font);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.35rem;
}

.hint { color: var(--muted); font-size: 0.82rem; margin-bottom: 1rem; }

.toggle-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}
.toggle {
  font-family: var(--font);
  background: transparent;
  border: 1px solid var(--panel-edge);
  color: var(--muted);
  padding: 0.55rem;
  border-radius: 0.4rem;
  cursor: pointer;
  transition: 0.15s ease;
}
.toggle.active {
  color: var(--bg);
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(45, 226, 230, 0.35);
}

.field { display: block; margin-bottom: 0.95rem; }
.field > span {
  display: block;
  font-family: var(--font);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.field em { font-style: normal; opacity: 0.7; }
.row { display: grid; grid-template-columns: 1fr 5.2rem; gap: 0.55rem; align-items: center; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 0.35rem;
  background: var(--panel-edge);
  border-radius: 999px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1rem; height: 1rem;
  border-radius: 50%;
  background: var(--cyan);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(45, 226, 230, 0.5);
}
input[type="number"] {
  width: 100%;
  background: #09101c;
  border: 1px solid var(--panel-edge);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  padding: 0.4rem 0.45rem;
  border-radius: 0.35rem;
}
input[type="number"]:focus {
  outline: none;
  border-color: var(--cyan);
}

.greek-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.greek-card {
  background: rgba(7, 11, 20, 0.65);
  border: 1px solid var(--panel-edge);
  border-radius: 0.55rem;
  padding: 0.85rem 0.9rem;
  border-top: 2px solid var(--cyan);
}
.greek-card h3 {
  font-family: var(--font);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.greek-card .value {
  font-family: var(--font);
  font-size: 1.35rem;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}
.greek-card .sub { font-size: 0.72rem; color: var(--muted); margin-top: 0.2rem; }

.chart-wrap {
  border: 1px dashed var(--panel-edge);
  border-radius: 0.55rem;
  padding: 0.85rem;
  background: rgba(7, 11, 20, 0.4);
}
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.chart-head h3 {
  font-family: var(--font);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
}
#chart-greek {
  background: #09101c;
  color: var(--text);
  border: 1px solid var(--panel-edge);
  font-family: var(--font);
  font-size: 0.8rem;
  padding: 0.3rem 0.45rem;
  border-radius: 0.3rem;
}
#chart { width: 100%; height: auto; display: block; }
.chart-note { font-size: 0.75rem; color: var(--muted); margin-top: 0.5rem; }

.foot {
  margin-top: 1.75rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--panel-edge);
  border-radius: 0.55rem;
  background: rgba(13, 21, 36, 0.7);
  font-size: 0.8rem;
  color: var(--muted);
}
.foot strong { color: var(--amber); }
.foot .meta { margin-top: 0.45rem; font-family: var(--font); font-size: 0.72rem; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
}
