:root {
  --bg: #0f172a;
  --panel: #111827;
  --muted: #1f2937;
  --text: #e5e7eb;
  --sub: #9ca3af;
  --accent: #ef6c00;
  --accent-quiet: #f59e0b;
  --card: #0b1226;
  --success: #10b981;
  --ring: rgba(239, 108, 0, .35);
  --line: rgba(255, 255, 255, .08);
  --line-soft: rgba(255, 255, 255, .06);
  --danger: #f87171;
  --shadow: 0 18px 50px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box }

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #0b1223, #0f172a 35%, #0f172a);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}

a { color: inherit; text-decoration: none }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.wrap {
  padding: 0 0 56px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 12, 24, .65);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  padding: 14px 0;
}

.logo {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 700;
  letter-spacing: .3px;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: conic-gradient(from 180deg, var(--accent), #ffb74d, var(--accent));
  box-shadow: 0 0 0 2px rgba(255,255,255,.06) inset;
}

.nav-links,
.nav-actions {
  display: flex;
  gap: 18px;
  align-items: center;
}

.nav-links a {
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--sub);
}

.nav-links a:hover {
  background: rgba(255, 255, 255, .06);
  color: var(--text);
}

.btn,
.btn-go,
.btn-secondary,
.btn-recalc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  transition: .2s box-shadow, .2s transform, .2s background, .2s border-color;
  cursor: pointer;
}

.btn-primary,
.btn-go,
.btn-recalc {
  background: var(--accent);
  color: #1b1b1b;
  border: 0;
  box-shadow: 0 10px 30px -10px var(--ring);
}

.btn-primary:hover,
.btn-go:hover,
.btn-recalc:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 40px -16px var(--ring);
}

.btn-ghost,
.btn-secondary {
  border: 1px solid rgba(255, 255, 255, .12);
  color: var(--text);
  background: transparent;
}

.btn-ghost:hover,
.btn-secondary:hover {
  background: rgba(255, 255, 255, .06);
}

.btn-go:disabled {
  opacity: .65;
  cursor: not-allowed;
  transform: none;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 36px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, .12);
  color: #a7f3d0;
  border: 1px solid rgba(16, 185, 129, .35);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.hero-title {
  font-size: 42px;
  line-height: 1.1;
  margin: 10px 0 12px;
}

.hero-text,
.section-copy,
.ind-row,
.step .sub,
.loc-bar,
.rc .det,
.md,
.print-note {
  color: var(--sub);
}

.hero-mock .mock {
  background: linear-gradient(180deg, #0e152a, #0f172a);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .45);
  padding: 18px;
}

.bar {
  height: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .06);
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 0 6px;
  margin-bottom: 14px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #ef4444;
}

.dot:nth-child(2) { background: #f59e0b }
.dot:nth-child(3) { background: #10b981 }

.mock-inner {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 16px;
}

.mock-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  padding: 12px;
}

.mock-chart { min-height: 240px }

.mock-fill {
  height: 160px;
  margin-top: 8px;
  border-radius: 12px;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.06), rgba(255,255,255,.06) 10px, rgba(255,255,255,.02) 10px, rgba(255,255,255,.02) 20px);
}

.status {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: #d1d5db;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  font-size: 11px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  padding: 4px 8px;
  color: #cbd5e1;
}

.badge-ok {
  border-color: rgba(16,185,129,.35);
  color: #a7f3d0;
}

.mock-list {
  list-style: none;
  padding: 10px 0 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.mock-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.tiny {
  font-size: 13px;
  color: var(--sub);
}

.tiny.accent { color: #fbbf24 }
.tiny.ok { color: #34d399 }
.hero-note { opacity: .7; margin-top: 8px }

.section-shell,
.result-shell {
  padding-top: 12px;
}

.card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  padding: 20px;
}

.section-heading {
  margin-bottom: 16px;
}

.card h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1.5fr .9fr .9fr;
  gap: 14px;
  margin-bottom: 14px;
}

.form-field label,
.ov-field label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 7px;
}

.form-field input,
.form-field select,
.ov-field input,
.ov-field select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: #0f172a;
  color: var(--text);
  font-size: 14px;
}

.form-field input:focus,
.form-field select:focus,
.ov-field input:focus,
.ov-field select:focus {
  outline: none;
  border-color: rgba(239, 108, 0, .65);
  box-shadow: 0 0 0 4px rgba(239, 108, 0, .14);
}

.addr-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.addr-wrap {
  position: relative;
  flex: 1;
}

.form-error {
  color: #fca5a5;
  font-size: 12px;
  min-height: 18px;
  margin-top: 8px;
}

.ind-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 6px;
  font-size: 13px;
}

.ind-row input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 18px;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  font-size: 13px;
}

.step .ico {
  font-size: 16px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.step .msg { font-weight: 700 }
.step.ok .ico::before { content: "\2713"; color: var(--success) }
.step.err .ico::before { content: "\00D7"; color: var(--danger) }
.step.run .ico { animation: spin .8s linear infinite }
.step.run .ico::before { content: "\27F3"; color: var(--accent); display: inline-block }
.step.wait .ico::before { content: "\25CB"; color: #64748b }
@keyframes spin { to { transform: rotate(360deg) } }

.loc-bar,
.override-panel {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
}

.loc-bar {
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.loc-bar strong { color: var(--text) }

.loc-bar .tag {
  background: rgba(16,185,129,.12);
  color: #a7f3d0;
  border: 1px solid rgba(16,185,129,.35);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}

.env-note,
.disc {
  background: rgba(239, 108, 0, .10);
  border: 1px solid rgba(239, 108, 0, .18);
  border-radius: 12px;
  padding: 12px 14px;
  color: #fed7aa;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.err-banner {
  background: rgba(248,113,113,.12);
  border: 1px solid rgba(248,113,113,.28);
  border-radius: 12px;
  padding: 12px 14px;
  color: #fecaca;
  font-size: 13px;
  margin-bottom: 14px;
}

.override-link {
  display: inline-block;
  margin-bottom: 14px;
  color: #fdba74;
  text-decoration: underline;
  cursor: pointer;
  font-size: 12px;
}

.override-panel {
  padding: 16px 18px;
  margin-bottom: 16px;
}

.ov-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.cards3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.rc {
  background: linear-gradient(180deg, #0e152a, #10182d);
  border: 1px solid rgba(255,255,255,.08);
  border-top: 4px solid #43506a;
  border-radius: 18px;
  padding: 20px;
  text-align: center;
  position: relative;
}

.rc .ico {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239,108,0,.12);
  color: #ffd6ab;
  font-size: 18px;
  font-weight: 800;
}

.rc .lbl {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--sub);
  margin-bottom: 9px;
}

.rc .val {
  font-size: 29px;
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 6px;
}

.rc .desc {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.rc .ref {
  font-size: 10px;
  color: #7f8ea8;
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 8px;
}

.sc1{border-top-color:#6ee7b7}.sc2{border-top-color:#22c55e}.sc3{border-top-color:#eab308}.sc4{border-top-color:#f97316}.sc5{border-top-color:#ef4444}.st{border-top-color:#8b5cf6}
.wa{border-top-color:#22c55e}.wb{border-top-color:#eab308}.wc{border-top-color:#f97316}.wd{border-top-color:#ef4444}
.zvl{border-top-color:#6ee7b7}.zl{border-top-color:#22c55e}.zm{border-top-color:#eab308}.zh{border-top-color:#f97316}.zvh{border-top-color:#ef4444}

.rc-loading { animation: rcpulse 1.4s ease-in-out infinite }
.rc-loading .val { font-size: 14px !important; color: #98a3b7 !important; font-weight: 700 !important }
.rc-loading .desc, .rc-loading .det { color: #6e7a8d !important }
@keyframes rcpulse { 0%,100%{opacity:1} 50%{opacity:.42} }

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tbl th {
  background: #111827;
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sub);
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.tbl td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  vertical-align: top;
}

.tbl tr:hover td { background: rgba(255,255,255,.015) }
.tbl tr:last-child td { border-bottom: none }

.mn { font-weight: 800; color: var(--text); font-size: 14px }
.ly { font-weight: 900; font-size: 17px }

.be { background: rgba(16,185,129,.12); color: #a7f3d0 }
.bg { background: rgba(96,165,250,.14); color: #bfdbfe }
.bm { background: rgba(245,158,11,.16); color: #fde68a }
.bp { background: rgba(249,115,22,.14); color: #fdba74 }
.bn { background: rgba(248,113,113,.14); color: #fecaca }

.action-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.ac-list {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  background: #10182d;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 0 0 12px 12px;
  box-shadow: var(--shadow);
  z-index: 999;
  display: none;
  overflow: hidden;
}

.ac-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,.05) }
.ac-item:last-child { border-bottom: none }
.ac-item:hover, .ac-item.ac-sel { background: rgba(255,255,255,.06) }
.ac-main { font-size: 13.5px; font-weight: 700; color: var(--text) }
.ac-sub { font-size: 11px; color: var(--sub); margin-top: 2px }

@media (max-width: 980px) {
  .hero-grid,
  .mock-inner,
  .controls-grid,
  .cards3 {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 760px) {
  .nav-inner,
  .nav-actions {
    gap: 8px;
  }

  .hero {
    padding: 42px 0 26px;
  }

  .hero-title {
    font-size: 34px;
  }

  .addr-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-go,
  .btn-secondary,
  .btn-recalc {
    width: 100%;
  }

  .tbl {
    display: block;
    overflow-x: auto;
  }
}

@media print {
  body { background: #fff; color: #111 }
  .nav, .hero-mock, .btn-go, .btn-secondary, .btn-recalc, .action-row, .steps, .override-link { display: none !important }
  .card, .rc, .loc-bar, .override-panel, .env-note, .disc { box-shadow: none; background: #fff; color: #111; border-color: #ddd }
  .tbl th, .tbl td { color: #111; border-color: #ddd }
}
