:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, sans-serif;
  color: #f3f6f5;
  background: #101316;
  --panel: #181c20;
  --line: #323b41;
  --muted: #aebcbe;
  --accent: #94f4c6;
  --warn: #ffd18a;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
body::before {
  position: fixed;
  content: "";
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 87% -14%, #204439 0%, transparent 58%);
  z-index: -1;
}

.shell { width: min(1080px, calc(100% - 64px)); margin: 0 auto; padding-bottom: 56px; }
.top { min-height: 78px; display: flex; justify-content: space-between; align-items: center; gap: 15px; border-bottom: 1px solid #34413e; }
.top a { color: var(--accent); font-weight: 620; font-size: .875rem; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { width: 25px; height: 25px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; transform: rotate(-8deg); }
.brand-mark i { display: block; background: var(--accent); border-radius: 2px; }
.brand-mark i:nth-child(2) { opacity: .5; }
.brand-mark i:nth-child(3) { opacity: .72; }

.hero { padding: 48px 0 34px; }
.hero h1 { font-size: clamp(2.35rem, 7vw, 5rem); line-height: .97; letter-spacing: -.075em; font-weight: 750; margin: 0 0 19px; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--muted); max-width: 590px; line-height: 1.56; margin: 0; }
.workspace { display: grid; grid-template-columns: minmax(270px, 340px) minmax(0, 1fr); gap: 21px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 15px; }
.setup { padding: 22px; }
h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.025em; }
.setup h2 { margin-bottom: 23px; }
form > label, legend { font-size: .875rem; font-weight: 650; display: block; margin: 0 0 8px; }
.muted { color: var(--muted); font-weight: 400; }
input[type="text"] { width: 100%; border: 1px solid var(--line); background: #111519; color: inherit; border-radius: 9px; padding: 12px; font: inherit; }
input::placeholder { color: #849397; }
fieldset { padding: 0; margin: 17px 0 18px; border: 0; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: #111519; }
.segmented label { position: relative; min-width: 0; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; text-align: center; padding: 8px 6px; font-size: .875rem; border-radius: 5px; color: var(--muted); cursor: pointer; }
.segmented input:checked + span { background: #2a3835; color: #ddfff0; font-weight: 670; }
.segmented input:focus-visible + span, :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button { cursor: pointer; color: inherit; font: 660 .875rem system-ui, sans-serif; padding: 10px 14px; border-radius: 8px; min-height: 42px; }
button:disabled { cursor: default; opacity: .54; }
.primary { width: 100%; min-height: 48px; border: 1px solid transparent; color: #12291e; background: var(--accent); }
.primary:not(:disabled):hover { background: #b0ffd8; }
.secondary { border: 1px solid #435057; background: #232a30; }
.secondary:not(:disabled):hover { background: #303e43; border-color: #779b8b; }
.progress-wrap { display: grid; gap: 11px; margin-top: 18px; }
.progress-label { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-size: .875rem; }
.progress-label time { font: 500 .875rem ui-monospace, Consolas, monospace; white-space: nowrap; }
progress { accent-color: var(--accent); width: 100%; height: 6px; border: 0; border-radius: 6px; background-color: #29343a; }
progress::-webkit-progress-bar { background: #29343a; border-radius: 6px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 6px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 6px; }
.note { color: var(--muted); font-size: .875rem; line-height: 1.48; margin: 13px 0 0; }

.results-heading, .route-head, .report-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.results-heading { margin: 0 0 11px; min-height: 27px; }
.transport { color: var(--muted); font: .8125rem ui-monospace, Consolas, monospace; }
.targets { display: grid; gap: 10px; }
.route { padding: 15px 19px 13px; }
.route-head { align-items: start; }
.route-head > div { min-width: 0; }
.route h3 { margin: 0; font-size: 1rem; }
.target-address { margin: 4px 0 0; overflow-wrap: anywhere; font: .8125rem ui-monospace, Consolas, monospace; color: var(--muted); }
.state { border: 1px solid #435057; padding: 4px 8px; border-radius: 6px; font-size: .8125rem; white-space: nowrap; }
.state[data-state="good"] { color: var(--accent); background: #1c3029; border-color: #355b4b; }
.state[data-state="warn"] { color: var(--warn); background: #352b22; border-color: #69553c; }
.readings { display: grid; grid-template-columns: 1fr 1fr .8fr; gap: 8px; margin-top: 12px; }
.readings > div { display: grid; gap: 3px; }
.readings span { color: var(--muted); font-size: .875rem; }
.readings strong { font: 650 1.2rem ui-monospace, Consolas, monospace; }
.route canvas { display: block; width: 100%; height: 27px; margin: 6px 0 3px; }
.route-meta { color: var(--muted); font-size: .8125rem; margin: 0; overflow-wrap: anywhere; }
.report, .scripts { margin-top: 22px; padding: 20px; }
.downloads { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 12px; }
.downloads a { color: var(--accent); font-size: .875rem; font-weight: 650; text-underline-offset: 4px; }
pre { overflow: auto; max-height: 315px; border: 1px solid var(--line); background: #111519; color: #e1ebe8; border-radius: 8px; padding: 13px; margin: 13px 0 0; font: .875rem/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
[hidden] { display: none !important; }

@media (max-width: 700px) {
  .shell { width: calc(100% - 32px); }
  .workspace { grid-template-columns: 1fr; }
  .hero { padding: 34px 0 24px; }
  .hero h1 { letter-spacing: -.06em; }
  .top { min-height: 65px; }
  .report-heading { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 360px) {
  .setup, .route, .report, .scripts { padding-right: 12px; padding-left: 12px; }
  .state { white-space: normal; text-align: center; }
}
