@import url("fonts.css");

:root {
  --bg: #02030f;
  --bg-elev: #060a1c;
  --panel: #0a1230;
  --panel-2: #0c1738;
  --text: #e8edff;
  --muted: #c5cef2;
  --line: rgba(0, 232, 255, 0.28);
  --line-strong: rgba(0, 232, 255, 0.55);
  --brand: #1c3fd1;
  --neon: #5cefff;
  --ok: #b6ffd0;
  --warn: #ffd27a;
  --danger: #ffb4c4;
  --link: #9ecbff;
  --radius: 14px;
  --font: "Onest", "Segoe UI", sans-serif;
  --display: "Unbounded", "Onest", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  max-width: 100%;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(0, 13, 251, 0.35), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(0, 232, 255, 0.12), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

body {
  min-height: 100dvh;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button,
select,
.choice,
input[type="range"] {
  min-height: 44px;
}

button {
  cursor: pointer;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  padding: 0.55rem 0.9rem;
}

button.primary {
  background: var(--brand);
  border-color: transparent;
  color: #ffffff;
  font-weight: 650;
}

button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: #12182e;
}

a {
  color: var(--link);
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  transform: translateY(-150%);
  background: var(--brand);
  color: #ffffff;
  padding: 0.6rem 0.9rem;
  z-index: 5;
}

.skip:focus {
  transform: none;
}

.wrap {
  width: min(1180px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1rem 0 2.5rem;
}

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.kicker {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--neon);
}

h1,
.h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.03em;
}

.sub {
  margin: 0.2rem 0 0;
  color: var(--muted);
  max-width: 46rem;
}

.lang {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: min(100%, 12rem);
}

.lang span,
.field-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

select,
input[type="text"],
input[type="number"] {
  background: #070d22;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  min-height: 44px;
  width: 100%;
}

.disclaimer {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(10, 18, 48, 0.72);
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.85fr);
  gap: 1rem;
}

.panel {
  background: rgba(10, 18, 48, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.9rem;
  min-width: 0;
}

.panel h2 {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  margin: 0 0 0.7rem;
  color: var(--neon);
}

.dock {
  grid-column: 1 / -1;
}

.modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.modes button[aria-selected="true"] {
  background: var(--brand);
  color: #ffffff;
  border-color: transparent;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.probes {
  display: grid;
  gap: 0.45rem;
}

.probe {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  width: 100%;
}

.probe b {
  font-family: var(--mono);
  font-weight: 500;
  white-space: nowrap;
}

.choices {
  display: grid;
  gap: 0.45rem;
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.35rem 0.7rem;
  background: #070d22;
}

.choice input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--neon);
}

#feedback:not(:empty) {
  margin-top: 0.85rem;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #070d22;
}

#feedback[data-state="pass"] {
  border-color: var(--ok);
}

#feedback[data-state="fail"] {
  border-color: var(--danger);
}

.hint {
  color: var(--muted);
  margin: 0.6rem 0 0;
}

.trend {
  width: 100%;
  height: 92px;
  display: block;
  background: #070d22;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 0.6rem;
}

.proc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.55rem 0 0.2rem;
}

.program {
  font-family: var(--mono);
  font-size: 0.92rem;
  background: #070d22;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  overflow-x: auto;
  white-space: pre;
  margin: 0.4rem 0 0.8rem;
}

.rules,
.theory-card {
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  background: #070d22;
}

.rules summary,
.theory-card h3 {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 650;
}

.theory-card p,
.rules p,
.lead {
  margin: 0.35rem 0 0.6rem;
}

.gauges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.gauge {
  background: #070d22;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0.35rem 0.35rem 0.55rem;
}

.gauge p {
  margin: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.sat-wrap {
  margin-top: 0.8rem;
}

.table-scroll {
  overflow-x: auto;
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.82rem;
}

th,
td {
  text-align: right;
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid rgba(232, 237, 255, 0.12);
}

th:first-child,
td:first-child {
  text-align: left;
}

caption {
  text-align: left;
  font-family: var(--font);
  margin-bottom: 0.4rem;
  color: var(--muted);
}

.schematic {
  width: 100%;
  height: auto;
  display: block;
}

.sliders {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.8rem;
}

.sliders label {
  display: grid;
  gap: 0.15rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.chip-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #070d22;
}

select {
  font: inherit;
  color: var(--text);
  background: #070d22;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 44px;
  padding: 0.35rem 0.6rem;
  width: 100%;
  margin-top: 0.35rem;
}

.conditions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.pill {
  font-family: var(--mono);
  font-size: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  color: var(--muted);
}

.foot {
  margin-top: 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.75rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 140px;
  padding: 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(10, 18, 48, 0.9);
  color: inherit;
  text-decoration: none;
}

a.card:hover {
  border-color: var(--line-strong);
}

.badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge.ready {
  color: var(--ok);
}

.badge.wait {
  color: var(--warn);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

  .dock {
    grid-column: auto;
  }
}

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

  .wrap {
    width: min(1180px, calc(100% - 1rem));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .panel,
  .probe,
  button,
  .choice,
  .card {
    border: 1px solid CanvasText;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .fan {
    transform-origin: 78px 118px;
    animation: spin 2.8s linear infinite;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
