@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --night-900: #0a0a16;
  --night-800: #12122a;
  --night-700: #1b1b3a;
  --night-600: #26264d;

  --ink: #f4f1ea;
  --ink-soft: #c3c0d8;
  --ink-muted: #8e8ba8;

  --gold: #e8b84b;
  --gold-soft: #f7d98a;
  --saffron: #ff8b3d;
  --lotus: #f06292;
  --violet: #9d7bff;
  --teal: #4fd1c5;

  --ok: #4ade80;
  --danger: #ff6b81;

  --stroke: rgba(255, 255, 255, 0.09);
  --stroke-strong: rgba(255, 255, 255, 0.16);
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.07);

  --shadow-lg: 0 30px 70px -25px rgba(0, 0, 0, 0.85);
  --shadow-sm: 0 10px 30px -18px rgba(0, 0, 0, 0.9);

  --radius: 20px;
  --radius-sm: 12px;

  --sans: "Inter", "Segoe UI", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--night-900);
  background-image:
    radial-gradient(900px 600px at 8% -5%, rgba(157, 123, 255, 0.22), transparent 60%),
    radial-gradient(800px 500px at 95% 0%, rgba(232, 184, 75, 0.16), transparent 55%),
    radial-gradient(700px 700px at 50% 110%, rgba(79, 209, 197, 0.12), transparent 60%),
    linear-gradient(180deg, #0a0a16, #101024 45%, #0a0a16);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 18%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.4px 1.4px at 68% 12%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1.8px 1.8px at 32% 62%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1.2px 1.2px at 84% 48%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1.5px 1.5px at 52% 84%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1.3px 1.3px at 22% 92%, rgba(255, 255, 255, 0.32), transparent);
  opacity: 0.7;
  animation: twinkle 7s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.35; }
  to { opacity: 0.85; }
}

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

/* ---------- shell ---------- */

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 20px 90px;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 10px 16px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(16px);
}

.topbar-back,
.topbar-home {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}

.topbar-back:hover,
.topbar-home:hover {
  color: var(--ink);
  background: rgba(232, 184, 75, 0.12);
  border-color: rgba(232, 184, 75, 0.4);
}

.topbar-chevron {
  font-size: 1rem;
  line-height: 1;
  color: var(--gold-soft);
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}

.topbar-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.78rem;
  color: #1a1206;
  background: linear-gradient(135deg, var(--gold-soft), var(--saffron));
}

.topbar-name {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

@media (max-width: 620px) {
  .topbar {
    border-radius: 18px;
    padding: 10px 12px;
  }

  .topbar-name {
    font-size: 0.92rem;
  }

  .topbar-back,
  .topbar-home {
    padding: 7px 10px;
    font-size: 0.78rem;
  }

  .topbar-back {
    max-width: 42%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: 28px;
  padding: 38px 34px;
  margin-bottom: 22px;
  background:
    linear-gradient(135deg, rgba(157, 123, 255, 0.16), rgba(232, 184, 75, 0.07) 45%, transparent 75%),
    var(--glass);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
}

.hero::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -90px;
  top: -140px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, var(--gold), var(--saffron), var(--lotus), var(--violet), var(--gold));
  filter: blur(70px);
  opacity: 0.32;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(232, 184, 75, 0.35);
  background: rgba(232, 184, 75, 0.1);
  color: var(--gold-soft);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 16px;
}

.hero h1 {
  position: relative;
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.03;
  letter-spacing: -0.02em;
  background: linear-gradient(105deg, #fff 10%, var(--gold-soft) 45%, var(--saffron) 78%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  position: relative;
  margin: 0;
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: 1.03rem;
  line-height: 1.6;
}

.hero-facts {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-fact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--glass-2);
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.hero-fact b {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- tabs ---------- */

.tabs {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  margin-bottom: 20px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(14px);
}

.tab-btn {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  padding: 11px 24px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.94rem;
  transition: color 0.22s ease, background 0.22s ease, transform 0.22s ease;
}

.tab-btn:hover {
  color: var(--ink);
}

.tab-btn.active {
  color: #1a1206;
  background: linear-gradient(135deg, var(--gold-soft), var(--saffron));
  box-shadow: 0 10px 26px -12px rgba(255, 139, 61, 0.9);
}

.panel {
  display: none;
  animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.panel.active {
  display: block;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- cards ---------- */

.card {
  position: relative;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  padding: 26px;
}

.card + .card {
  margin-top: 18px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
}

.card-title::before {
  content: "";
  width: 4px;
  height: 20px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--gold), var(--saffron));
}

/* ---------- form ---------- */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 4px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.field input,
.field select {
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  background: rgba(10, 10, 22, 0.55);
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input::placeholder {
  color: rgba(200, 197, 220, 0.4);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(232, 184, 75, 0.75);
  background: rgba(10, 10, 22, 0.8);
  box-shadow: 0 0 0 4px rgba(232, 184, 75, 0.14);
}

.field select option {
  background: var(--night-800);
  color: var(--ink);
}

.form-col {
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.col-title {
  margin: 0 0 16px;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold-soft);
}

.geo-wrap {
  position: relative;
}

.geo-wrap input {
  width: 100%;
}

.geo-results {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  border: 1px solid var(--stroke-strong);
  border-radius: 14px;
  background: rgba(18, 18, 42, 0.97);
  backdrop-filter: blur(20px);
  max-height: 280px;
  overflow: auto;
  display: none;
  box-shadow: var(--shadow-lg);
}

.geo-results.open {
  display: block;
  animation: rise 0.2s ease;
}

.geo-item {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease, color 0.15s ease;
}

.geo-item:last-child {
  border-bottom: 0;
}

.geo-item:hover,
.geo-item:focus {
  background: rgba(232, 184, 75, 0.14);
  color: var(--ink);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 9px;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.manual-coords {
  margin-top: 14px;
  border: 1px dashed var(--stroke-strong);
  border-radius: 14px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
}

.manual-coords summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--gold-soft);
  list-style: none;
  user-select: none;
}

.manual-coords summary::-webkit-details-marker {
  display: none;
}

.manual-coords summary::before {
  content: "⊕ ";
  color: var(--saffron);
}

.manual-coords[open] summary::before {
  content: "⊖ ";
}

.manual-grid {
  margin-top: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ---------- buttons ---------- */

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 13px 26px;
  cursor: pointer;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  color: #1a1206;
  background: linear-gradient(135deg, var(--gold-soft), var(--saffron));
  box-shadow: 0 16px 34px -16px rgba(255, 139, 61, 0.95);
}

.btn-secondary {
  background: var(--glass-2);
  border: 1px solid var(--stroke-strong);
  color: var(--ink-soft);
}

.btn-secondary:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.11);
}

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

/* ---------- status ---------- */

.status {
  margin-top: 14px;
  min-height: 1.2em;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.status.error {
  color: var(--danger);
}

.status.ok {
  color: var(--ok);
}

.loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-muted);
  padding: 14px 0;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(232, 184, 75, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

.skeleton {
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.13), rgba(255,255,255,0.05));
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
  margin-bottom: 10px;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ---------- report ---------- */

.report {
  margin-top: 22px;
  display: none;
}

.report.visible {
  display: block;
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.report-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.report-header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 24px 26px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(232, 184, 75, 0.14), transparent 60%),
    var(--glass);
  backdrop-filter: blur(16px);
}

.report-header h2 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--ink);
}

.nav-rail {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(16px);
}

.nav-pill {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  border-radius: 12px;
  padding: 11px 14px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 550;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-pill .nav-ico {
  font-size: 1rem;
  opacity: 0.85;
}

.nav-pill:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}

.nav-pill.active {
  color: var(--ink);
  background: linear-gradient(120deg, rgba(232, 184, 75, 0.22), rgba(157, 123, 255, 0.16));
  box-shadow: inset 0 0 0 1px rgba(232, 184, 75, 0.3);
}

.report-body {
  min-width: 0;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(16px);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.section {
  display: none;
}

.section.active {
  display: block;
  animation: rise 0.35s ease;
}

.section > h2 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ink);
}

.section-sub {
  margin: 0 0 20px;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.section-body h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 30px 0 14px;
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--gold-soft);
}

.section-body h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(232, 184, 75, 0.4), transparent);
}

/* ---------- accordions ---------- */

.acc {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 10px;
  overflow: hidden;
}

.acc[open] {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(232, 184, 75, 0.28);
}

.acc > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.18s ease;
}

.acc > summary::-webkit-details-marker {
  display: none;
}

.acc > summary:hover {
  background: rgba(232, 184, 75, 0.07);
}

.acc .acc-title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold-soft);
}

.acc .acc-caret {
  color: var(--ink-muted);
  font-size: 1.2rem;
  line-height: 1;
  transition: transform 0.22s ease;
}

.acc[open] > summary .acc-caret {
  transform: rotate(180deg);
  color: var(--gold-soft);
}

.acc-body {
  padding: 4px 18px 18px;
  animation: rise 0.28s ease;
}

.acc-body > h4:first-child {
  margin-top: 6px;
}

.section-body h4 {
  margin: 20px 0 8px;
  font-size: 0.98rem;
  color: var(--ink);
}

/* ---------- stats ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.stat {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 16px 16px 15px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.stat:hover {
  transform: translateY(-3px);
  border-color: rgba(232, 184, 75, 0.4);
}

.stat::after {
  content: "";
  position: absolute;
  top: -30px;
  right: -30px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 184, 75, 0.3), transparent 70%);
}

.stat .label {
  font-size: 0.7rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
}

.stat .value {
  margin-top: 7px;
  font-family: var(--display);
  font-size: 1.22rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}

/* ---------- data blocks ---------- */

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 11px 14px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.kv:hover {
  background: rgba(255, 255, 255, 0.07);
}

.kv .k {
  flex: 0 1 auto;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.kv .v {
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  word-break: break-word;
}

.kv.stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  grid-column: 1 / -1;
}

.kv.stacked .v {
  text-align: left;
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.kv .v.yes {
  color: #86efac;
}

.kv .v.no {
  color: var(--ink-muted);
}

.period {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  border-left: 3px solid var(--violet);
  background: linear-gradient(100deg, rgba(157, 123, 255, 0.14), rgba(255, 255, 255, 0.03));
}

.period .p-name {
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--ink);
}

.period .p-range {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.info-card {
  border: 1px solid var(--stroke);
  border-left: 3px solid var(--gold);
  border-radius: 14px;
  padding: 15px 17px;
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.2s ease, background 0.2s ease;
}

.info-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.075);
}

.info-card .ic-title {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold-soft);
  margin-bottom: 9px;
}

.info-card .ic-body {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.62;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.chip {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--stroke-strong);
  background: rgba(157, 123, 255, 0.14);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 500;
}

.chip.gold {
  background: rgba(232, 184, 75, 0.16);
  border-color: rgba(232, 184, 75, 0.34);
  color: var(--gold-soft);
}

.chip.ok {
  background: rgba(74, 222, 128, 0.14);
  border-color: rgba(74, 222, 128, 0.32);
  color: #86efac;
}

.chip.warn {
  background: rgba(255, 107, 129, 0.14);
  border-color: rgba(255, 107, 129, 0.32);
  color: #fda4af;
}

.prose {
  line-height: 1.68;
  color: var(--ink-soft);
  font-size: 0.93rem;
}

.prose p {
  margin: 0 0 11px;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--stroke-strong);
  border-radius: 14px;
  color: var(--ink-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* ---------- tables ---------- */

.table-wrap {
  overflow: auto;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: rgba(10, 10, 22, 0.35);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

table.data th,
table.data td {
  padding: 12px 15px;
  text-align: left;
  vertical-align: top;
  font-size: 0.885rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

table.data th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(27, 27, 58, 0.97);
  backdrop-filter: blur(8px);
  color: var(--gold-soft);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
}

table.data td {
  color: var(--ink-soft);
}

table.data .long {
  min-width: 340px;
  line-height: 1.6;
}

table.data tbody tr:last-child td {
  border-bottom: 0;
}

table.data tbody tr:hover td {
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink);
}

/* ---------- charts ---------- */

.chart-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--stroke);
}

.chart-chip {
  border: 1px solid var(--stroke-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-muted);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 550;
  transition: all 0.2s ease;
}

.chart-chip:hover {
  color: var(--ink);
  border-color: rgba(232, 184, 75, 0.5);
}

.chart-chip.active {
  color: #1a1206;
  background: linear-gradient(135deg, var(--gold-soft), var(--saffron));
  border-color: transparent;
  box-shadow: 0 8px 20px -10px rgba(255, 139, 61, 0.9);
}

.chart-stage {
  display: grid;
  gap: 14px;
}

.chart-box {
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(232, 184, 75, 0.1), transparent 60%),
    rgba(255, 255, 255, 0.035);
  text-align: center;
}

.chart-box h3 {
  justify-content: center;
  margin-top: 0;
}

.chart-box h3::after {
  display: none;
}

.chart-box canvas {
  display: block;
  margin: 6px auto 0;
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  background: linear-gradient(160deg, #fffdf6, #fdf3dd);
  box-shadow: 0 20px 50px -22px rgba(0, 0, 0, 0.9);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

/* ---------- matching ---------- */

.match-block {
  margin-top: 18px;
}

.score-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  padding: 22px;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(240, 98, 146, 0.16), rgba(157, 123, 255, 0.1));
  margin-bottom: 18px;
}

.score-ring {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--gold) calc(var(--pct) * 1%), rgba(255, 255, 255, 0.1) 0);
  position: relative;
  flex-shrink: 0;
}

.score-ring::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--night-800);
}

.score-ring span {
  position: relative;
  z-index: 1;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--gold-soft);
}

.people {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-size: 1.3rem;
}

/* ---------- dasha tree ---------- */

.tree-hint {
  margin: -4px 0 14px;
  font-size: 0.85rem;
  color: var(--ink-muted);
  line-height: 1.6;
}

.dasha-tree {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dnode {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.dnode > summary,
.dleaf {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.dnode > summary::-webkit-details-marker {
  display: none;
}

.dnode > summary:hover {
  background: rgba(232, 184, 75, 0.07);
  border-radius: 11px;
}

.dleaf {
  cursor: default;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid transparent;
}

.ddot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 184, 75, 0.16);
}

.ddot.lvl2 {
  background: var(--violet);
  box-shadow: 0 0 0 3px rgba(157, 123, 255, 0.16);
}

.ddot.lvl3 {
  width: 7px;
  height: 7px;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(79, 209, 197, 0.14);
}

.dname {
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
}

.dnode.lvl2 > summary .dname,
.dleaf .dname {
  font-size: 0.94rem;
  font-weight: 500;
}

.drange {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dnode > summary .acc-caret {
  color: var(--ink-muted);
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.22s ease;
}

.dnode[open] > summary .acc-caret {
  transform: rotate(180deg);
}

.dchildren {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 12px 12px 26px;
  padding-left: 14px;
  border-left: 2px solid rgba(232, 184, 75, 0.22);
}

.dnode.lvl2 .dchildren {
  border-left-color: rgba(157, 123, 255, 0.28);
}

.dnode.now,
.dleaf.now {
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(74, 222, 128, 0.08);
}

@media (max-width: 620px) {
  .dnode > summary,
  .dleaf {
    flex-wrap: wrap;
  }

  .drange {
    margin-left: 20px;
    width: 100%;
  }
}

.pair-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.koot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.koot {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 15px 17px;
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.koot:hover {
  transform: translateY(-3px);
  border-color: rgba(232, 184, 75, 0.4);
}

.koot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.koot-name {
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
}

.bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--saffron));
  transition: width 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.koot-desc {
  margin-top: 10px;
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

.koot-attrs {
  margin-top: 7px;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding: 24px 26px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(232, 184, 75, 0.08), transparent 60%),
    var(--glass);
  backdrop-filter: blur(14px);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.footer-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.05rem;
  color: #1a1206;
  background: linear-gradient(135deg, var(--gold-soft), var(--saffron));
  box-shadow: 0 10px 24px -12px rgba(255, 139, 61, 0.9);
}

.footer-name {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.footer-tagline {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.footer-credit {
  text-align: right;
}

.credit-line {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.credit-line strong {
  font-family: var(--display);
  font-weight: 600;
  color: var(--gold-soft);
}

.credit-meta {
  margin: 5px 0 0;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

@media (max-width: 620px) {
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .footer-credit {
    text-align: left;
  }
}

/* ---------- scrollbars ---------- */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: rgba(232, 184, 75, 0.35);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(232, 184, 75, 0.55);
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .report-shell {
    grid-template-columns: 1fr;
  }

  .nav-rail {
    position: static;
    flex-direction: row;
    overflow-x: auto;
  }

  .nav-pill {
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 20px 14px 70px;
  }

  .hero {
    padding: 26px 20px;
  }

  .grid-2,
  .manual-grid {
    grid-template-columns: 1fr;
  }

  .card,
  .report-body {
    padding: 18px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat .value {
    font-size: 1.02rem;
  }

  .tabs {
    display: flex;
    width: 100%;
  }

  .tab-btn {
    flex: 1;
    padding: 11px 12px;
  }
}

/* ---------- print ---------- */

@media print {
  body {
    background: #fff;
    color: #111;
  }

  body::before,
  .tabs,
  .actions,
  .nav-rail,
  .chart-toolbar,
  .no-print,
  .geo-results,
  .manual-coords {
    display: none !important;
  }

  .panel,
  .section {
    display: block !important;
  }

  .acc > .acc-body {
    display: block !important;
  }

  .acc .acc-caret {
    display: none;
  }

  .app-shell {
    max-width: none;
    padding: 0;
  }

  .hero,
  .card,
  .report-body,
  .report-header,
  .site-footer {
    border: 0;
    box-shadow: none;
    background: #fff;
    backdrop-filter: none;
  }

  .site-footer {
    border-top: 1px solid #ddd;
    padding: 14px 0 0;
  }

  .footer-mark {
    display: none;
  }

  .footer-name,
  .credit-line {
    color: #111;
  }

  .credit-line strong {
    color: #111;
  }

  .footer-tagline,
  .credit-meta {
    color: #666;
  }

  .hero h1,
  .section > h2,
  .report-header h2 {
    color: #111;
    -webkit-text-fill-color: #111;
  }

  .section-body h3 {
    color: #7c3f00;
  }

  .report-shell {
    display: block;
  }

  .stat,
  .kv,
  .info-card,
  .table-wrap {
    border-color: #ddd;
    background: #fff;
  }

  .stat .value,
  .kv .v,
  .prose,
  table.data td {
    color: #111;
  }

  table.data th {
    background: #f5f5f5;
    color: #333;
  }
}
