:root {
  --navy: #0b1220;
  --navy-2: #121c2e;
  --navy-3: #1a2740;
  --ink: #f4efe6;
  --muted: rgba(244, 239, 230, 0.62);
  --faint: rgba(244, 239, 230, 0.38);
  --gold: #c4a484;
  --gold-bright: #e0c4a8;
  --gold-dim: rgba(196, 164, 132, 0.16);
  --line: rgba(196, 164, 132, 0.22);
  --good: #8fbf9f;
  --watch: #d4a574;
  --high: #c98989;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-ui: "Outfit", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(ellipse 60% 40% at 10% 0%, rgba(196, 164, 132, 0.12), transparent 50%),
    linear-gradient(165deg, #070b14, #0e1624 45%, #151f33);
  background-attachment: fixed;
}

button,
input {
  font: inherit;
  color: inherit;
}

a {
  color: var(--gold);
  text-decoration: none;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.mark {
  font-family: var(--font-display);
  letter-spacing: 0.28em;
  font-size: 1rem;
  color: var(--gold-bright);
  font-weight: 600;
}

.mark-sub {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.mode-switch {
  display: flex;
  gap: 0.3rem;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(18, 28, 46, 0.8);
}

.mode {
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.82rem;
}

.mode.is-on {
  background: var(--gold-dim);
  color: var(--gold-bright);
}

.top-links {
  display: flex;
  gap: 1rem;
  font-size: 0.82rem;
}

.mode-panel {
  display: none;
  animation: rise 0.4s ease both;
}

.mode-panel.is-active {
  display: block;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 1.35rem;
}

.hero.compact {
  align-items: center;
}

.eyebrow {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero h1,
.detail-head h2,
.panel-head h2,
.overlay-head h2 {
  margin: 0.25rem 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  letter-spacing: 0.02em;
}

.detail-head h2,
.panel-head h2,
.overlay-head h2 {
  font-size: 1.75rem;
}

.hero-meta {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-weight: 300;
  font-size: 0.92rem;
}

.hero-aside {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-end;
}

.hero-aside.row {
  flex-direction: row;
  align-items: center;
}

.retest {
  text-align: right;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(18, 28, 46, 0.7);
}

.retest-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.retest strong {
  display: block;
  margin: 0.2rem 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--gold-bright);
}

.retest span:last-child {
  font-size: 0.78rem;
  color: var(--muted);
}

.btn {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--gold-bright);
  padding: 0.55rem 1rem;
  cursor: pointer;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.btn.solid {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
  font-weight: 500;
}

.btn.ghost:hover,
.btn.solid:hover {
  filter: brightness(1.05);
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  align-items: start;
}

.domain-rail {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  position: sticky;
  top: 1rem;
}

.domain-card {
  text-align: left;
  border: 1px solid transparent;
  background: rgba(18, 28, 46, 0.65);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  display: grid;
  gap: 0.15rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.domain-card:hover,
.domain-card.is-on {
  border-color: var(--line);
  background: rgba(196, 164, 132, 0.1);
}

.domain-kicker {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.domain-card strong {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 400;
  color: var(--gold-bright);
  line-height: 1.1;
}

.domain-unit {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 300;
}

.tag {
  display: inline-block;
  margin-top: 0.35rem;
  width: fit-content;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
}

.tag.good {
  color: var(--good);
  background: rgba(143, 191, 159, 0.12);
}

.tag.watch {
  color: var(--watch);
  background: rgba(212, 165, 116, 0.12);
}

.tag.soft {
  color: var(--gold);
  background: var(--gold-dim);
}

.detail {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(18, 28, 46, 0.7);
  padding: 1.25rem 1.35rem 1.5rem;
  min-height: 520px;
}

.detail-panel {
  display: none;
  animation: rise 0.35s ease both;
}

.detail-panel.is-active {
  display: block;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.15rem;
  flex-wrap: wrap;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.kpi {
  padding: 0.85rem;
  border-radius: 12px;
  background: rgba(11, 18, 32, 0.55);
  border: 1px solid rgba(196, 164, 132, 0.12);
}

.kpi strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 400;
  color: var(--gold-bright);
  line-height: 1;
}

.kpi span {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.subhead {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}

.table {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.15rem;
}

.tr {
  display: grid;
  grid-template-columns: 1.3fr repeat(4, 1fr);
  gap: 0.5rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(196, 164, 132, 0.12);
  font-size: 0.88rem;
}

.tr.th {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom-color: rgba(196, 164, 132, 0.22);
}

[data-detail="strength"] .tr {
  grid-template-columns: 1.4fr 1fr 1fr;
}

.good {
  color: var(--good);
}

.watch {
  color: var(--watch);
}

.high {
  color: var(--high);
}

.zones {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.45rem;
}

.zone {
  padding: 0.7rem 0.55rem;
  border-radius: 10px;
  background: rgba(196, 164, 132, 0.08);
  border: 1px solid rgba(196, 164, 132, 0.14);
  text-align: center;
}

.zone span {
  display: block;
  font-size: 0.65rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.zone strong {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 400;
  color: var(--gold-bright);
}

.split-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.flags {
  list-style: none;
  margin: 0;
  padding: 0;
}

.flags li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(196, 164, 132, 0.12);
  font-size: 0.9rem;
}

.flags li span {
  color: var(--muted);
  font-weight: 300;
}

.flags li strong {
  font-weight: 500;
  text-align: right;
}

.flags li em {
  grid-column: 1 / -1;
  font-style: normal;
  font-size: 0.75rem;
  color: var(--faint);
}

.flags.tall li {
  grid-template-columns: 140px 1fr;
}

.flags.tall li strong {
  text-align: left;
}

.gap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.gap {
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(196, 164, 132, 0.14);
  background: rgba(11, 18, 32, 0.4);
}

.gap span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.gap strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--watch);
}

.note,
.lead,
.panel-copy {
  color: var(--muted);
  font-weight: 300;
  font-size: 0.9rem;
  line-height: 1.45;
}

.lead {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--ink);
  margin: 0 0 1.15rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.summary-grid ul,
.recs {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-weight: 300;
  font-size: 0.9rem;
  line-height: 1.55;
}

.recs {
  color: var(--ink);
}

/* Practitioner */
.prac-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(18, 28, 46, 0.7);
  padding: 1.1rem 1.2rem;
}

.panel.wide {
  grid-column: 1 / -1;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.pill {
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--gold-bright);
}

.pill.soft {
  background: var(--gold-dim);
}

.ingest {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ingest li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(196, 164, 132, 0.12);
  font-size: 0.9rem;
}

.ingest li.ok strong {
  color: var(--good);
  font-weight: 500;
  font-size: 0.8rem;
}

.ingest li.pending strong {
  color: var(--watch);
  font-weight: 500;
  font-size: 0.8rem;
}

.ingest button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--gold);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
  cursor: pointer;
}

.ingest button.muted {
  opacity: 0.4;
  cursor: default;
}

.publish-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.check {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 300;
}

.check input {
  margin-top: 0.2rem;
  accent-color: var(--gold);
}

.summary-preview-strip {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  margin-top: 1rem;
  padding-bottom: 0.25rem;
}

.page-thumb {
  flex: 0 0 72px;
  height: 96px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(196, 164, 132, 0.2), rgba(11, 18, 32, 0.9));
  display: grid;
  place-items: end center;
  padding-bottom: 0.45rem;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

/* Overlay */
.overlay[hidden] {
  display: none !important;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 15, 0.72);
  backdrop-filter: blur(4px);
}

.overlay-sheet {
  position: relative;
  width: min(720px, 100%);
  max-height: min(85vh, 820px);
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--navy-2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: rise 0.35s ease both;
}

.overlay-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid rgba(196, 164, 132, 0.15);
  position: sticky;
  top: 0;
  background: var(--navy-2);
  z-index: 1;
}

.overlay-brand {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: rgba(196, 164, 132, 0.08);
  border-bottom: 1px solid rgba(196, 164, 132, 0.12);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.overlay-body {
  padding: 1.25rem;
}

.report-block h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
}

.report-block p {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-weight: 300;
  font-size: 0.9rem;
  line-height: 1.45;
}

.report-block ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.55;
  font-weight: 300;
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  color: var(--faint);
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy-3);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0.75rem 1.15rem;
  border-radius: 999px;
  font-size: 0.86rem;
  z-index: 50;
  animation: rise 0.3s ease both;
}

@media (max-width: 900px) {
  .layout,
  .prac-grid,
  .kpi-row,
  .zones,
  .split-metrics,
  .gap-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .domain-rail {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .tr {
    grid-template-columns: 1fr 1fr;
  }

  .tr.th {
    display: none;
  }
}
