:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #657089;
  --line: #d7ddec;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: #ffffff;
  --blue: #1f70e8;
  --blue-soft: #eaf2ff;
  --pink: #e63d85;
  --pink-soft: #ffeaf3;
  --neutral: #8b95a8;
  --paper: #f6f8fd;
  --danger: #b42318;
  --success: #22744b;
  --shadow: 0 18px 50px rgba(35, 57, 94, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(31, 112, 232, 0.13), transparent 34rem),
    radial-gradient(circle at top right, rgba(230, 61, 133, 0.12), transparent 30rem),
    linear-gradient(135deg, #f8fbff 0%, #f6f8fd 52%, #fff7fb 100%);
}

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

button {
  border: 0;
}

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

.app-shell {
  min-height: 100vh;
}

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 14px;
  text-align: center;
  color: var(--muted);
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto;
  font-weight: 800;
  color: var(--blue);
  background: linear-gradient(135deg, rgba(31, 112, 232, 0.15), rgba(230, 61, 133, 0.15));
  border: 1px solid rgba(31, 112, 232, 0.16);
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
}

.auth-hero {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.6rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.auth-hero p {
  max-width: 640px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.auth-panel {
  min-height: 100vh;
  background: rgba(255, 255, 255, 0.72);
  border-left: 1px solid rgba(31, 112, 232, 0.12);
  backdrop-filter: blur(18px);
  padding: 34px;
  display: flex;
  align-items: center;
}

.panel-stack {
  width: 100%;
  display: grid;
  gap: 14px;
}

.card {
  background: var(--panel);
  border: 1px solid rgba(215, 221, 236, 0.82);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card,
.request-card {
  padding: 22px;
}

.login-card h2,
.request-card h2,
.section-title h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
}

.tiny {
  font-size: 0.78rem;
}

.form-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  outline: none;
}

textarea {
  min-height: 94px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(31, 112, 232, 0.58);
  box-shadow: 0 0 0 3px rgba(31, 112, 232, 0.12);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.btn {
  min-height: 38px;
  border-radius: 8px;
  padding: 9px 13px;
  cursor: pointer;
  color: var(--ink);
  background: #eef3ff;
  border: 1px solid rgba(31, 112, 232, 0.18);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  outline: none;
  border-color: rgba(31, 112, 232, 0.4);
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #2d82ff);
  border-color: transparent;
}

.btn.pink {
  color: #fff;
  background: linear-gradient(135deg, var(--pink), #f05f9c);
  border-color: transparent;
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  color: var(--danger);
  background: #fff1f0;
  border-color: rgba(180, 35, 24, 0.22);
}

.btn:disabled {
  cursor: default;
  opacity: 0.68;
  transform: none;
}

.message {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.message.error {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.22);
  background: #fff5f4;
}

.message.success {
  color: var(--success);
  border-color: rgba(34, 116, 75, 0.22);
  background: #f2fbf6;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px;
  background: rgba(255, 255, 255, 0.74);
  border-right: 1px solid rgba(31, 112, 232, 0.12);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.brand h1 {
  margin: 0;
  font-size: 1.08rem;
}

.brand p {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  text-align: left;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.nav button.active {
  color: var(--ink);
  background: linear-gradient(90deg, rgba(31, 112, 232, 0.12), rgba(230, 61, 133, 0.10));
}

.user-box {
  margin-top: auto;
  display: grid;
  gap: 10px;
  font-size: 0.86rem;
}

.main {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.topbar h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.8rem);
  letter-spacing: 0;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(86px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stat {
  padding: 13px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(215, 221, 236, 0.88);
  border-radius: 8px;
}

.stat strong {
  display: block;
  font-size: 1.35rem;
}

.stat span {
  color: var(--muted);
  font-size: 0.78rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 410px);
  gap: 16px;
  align-items: start;
}

.content-grid.map-layout {
  grid-template-columns: minmax(0, 1fr);
}

.content-grid.map-layout .detail-card {
  position: static;
}

.content-grid.map-layout .tree-map {
  height: min(68vh, 620px);
  min-height: 480px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}

.tree-card,
.detail-card,
.admin-card {
  padding: 14px;
}

.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.search-row input {
  min-height: 40px;
}

.tree-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  margin-bottom: 12px;
}

.tree-toolbar .search-row {
  margin-bottom: 0;
}

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.segmented button {
  min-height: 32px;
  padding: 6px 11px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.segmented button.active {
  color: var(--ink);
  background: linear-gradient(90deg, rgba(31, 112, 232, 0.14), rgba(230, 61, 133, 0.12));
}

.segmented.compact button {
  font-size: 0.78rem;
  min-height: 28px;
}

.generation {
  margin-bottom: 16px;
}

.generation h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pair-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
  margin-bottom: 7px;
}

.person-slot {
  min-height: 64px;
  display: flex;
}

.empty-slot {
  min-height: 64px;
  height: 100%;
  border: 1px dashed rgba(101, 112, 137, 0.22);
  border-radius: 8px;
}

.person-card {
  width: 100%;
  height: 100%;
  min-height: 64px;
  text-align: left;
  border-radius: 8px;
  border: 1px solid rgba(215, 221, 236, 0.9);
  background: #fff;
  padding: 8px 9px 8px 13px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(31, 65, 120, 0.06);
}

.person-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--neutral);
}

.person-card.male {
  background: var(--blue-soft);
  border-color: rgba(31, 112, 232, 0.22);
}

.person-card.male::before {
  background: var(--blue);
}

.person-card.female {
  background: var(--pink-soft);
  border-color: rgba(230, 61, 133, 0.22);
}

.person-card.female::before {
  background: var(--pink);
}

.person-card.selected {
  box-shadow: 0 0 0 3px rgba(31, 112, 232, 0.18);
}

.person-name {
  display: block;
  color: var(--ink);
  font-weight: 760;
  line-height: 1.2;
}

.person-years,
.person-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-relation {
  display: block;
  margin-top: 3px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 760;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pair-link {
  align-self: center;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--blue), var(--pink));
  opacity: 0.58;
}

.detail-card {
  position: sticky;
  top: 18px;
}

.detail-card h3 {
  margin: 0;
  font-size: 1.45rem;
}

.relationship-subtitle {
  margin: 5px 0 0;
  color: var(--blue);
  font-weight: 760;
}

.relationship-path {
  margin-top: 12px;
}

.path-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.path-arrow {
  color: var(--muted);
  font-size: 0.86rem;
}

.map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.map-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.map-toolbar strong,
.map-toolbar span {
  display: block;
}

.map-focus {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(215, 221, 236, 0.88);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.map-focus strong,
.map-focus span {
  display: block;
}

.map-focus span {
  margin-top: 2px;
  color: var(--blue);
  font-weight: 760;
}

.tree-map {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(31, 112, 232, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(230, 61, 133, 0.04) 1px, transparent 1px),
    rgba(255, 255, 255, 0.62);
  background-size: 24px 24px;
  min-height: 440px;
}

.map-canvas {
  position: relative;
}

.map-space {
  position: absolute;
  inset: 0 auto auto 0;
  transform-origin: top left;
}

.map-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.map-lines path {
  fill: none;
  stroke: rgba(77, 105, 180, 0.28);
  stroke-width: 1.45;
}

.map-lines path.highlight {
  stroke: rgba(31, 112, 232, 0.92);
  stroke-width: 3.4;
}

.map-generation-rail {
  position: absolute;
  height: 1px;
  background: rgba(101, 112, 137, 0.14);
  z-index: 0;
}

.map-generation-label {
  position: absolute;
  width: 84px;
  padding: 4px 5px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(215, 221, 236, 0.78);
  font-size: 0.64rem;
  font-weight: 760;
  line-height: 1.15;
  z-index: 3;
}

.map-unit {
  position: absolute;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px;
  z-index: 2;
}

.map-unit.couple::before {
  content: "";
  position: absolute;
  left: calc(50% - 10px);
  right: calc(50% - 10px);
  top: 50%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--pink));
  opacity: 0.62;
  transform: translateY(-50%);
  z-index: 0;
}

.map-unit.couple.path::before {
  opacity: 0.95;
  box-shadow: 0 0 0 2px rgba(31, 112, 232, 0.08);
}

.map-person,
.map-empty {
  position: relative;
  z-index: 1;
  min-width: 0;
  height: 100%;
  border-radius: 8px;
}

.map-empty {
  border: 1px dashed rgba(101, 112, 137, 0.22);
  background: rgba(255, 255, 255, 0.45);
}

.map-person {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  padding: 6px 7px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(31, 65, 120, 0.06);
}

.map-person.male {
  background: var(--blue-soft);
  border-color: rgba(31, 112, 232, 0.22);
}

.map-person.female {
  background: var(--pink-soft);
  border-color: rgba(230, 61, 133, 0.22);
}

.map-person.selected {
  box-shadow: 0 0 0 3px rgba(31, 112, 232, 0.18);
}

.map-person.path {
  border-color: rgba(31, 112, 232, 0.62);
  box-shadow: 0 0 0 2px rgba(31, 112, 232, 0.12), 0 8px 20px rgba(31, 65, 120, 0.06);
}

.map-person.path.female {
  border-color: rgba(230, 61, 133, 0.58);
  box-shadow: 0 0 0 2px rgba(230, 61, 133, 0.11), 0 8px 20px rgba(31, 65, 120, 0.06);
}

.map-person.selected.path {
  box-shadow: 0 0 0 3px rgba(31, 112, 232, 0.24), 0 8px 20px rgba(31, 65, 120, 0.08);
}

.map-name-line,
.map-person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-name {
  display: block;
  font-weight: 780;
  font-size: 0.75rem;
  line-height: 1.03;
}

.map-name-line {
  max-width: 100%;
}

.map-person small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.05;
}

.fact-list,
.relative-list,
.submission-list,
.admin-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.fact {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.fact strong {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 3px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(215, 221, 236, 0.86);
  font-size: 0.76rem;
}

button.chip {
  cursor: pointer;
}

button.chip:hover,
button.chip:focus-visible {
  color: var(--ink);
  border-color: rgba(31, 112, 232, 0.4);
  background: rgba(234, 242, 255, 0.9);
  outline: none;
}

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

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

.admin-card h3 {
  margin: 0 0 10px;
}

.row-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.row-item strong {
  display: block;
}

.status {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status.approved {
  color: var(--success);
}

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

.media-preview {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-top: 8px;
}

.pre-wrap {
  white-space: pre-wrap;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .content-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .detail-card {
    position: static;
  }
}

@media (max-width: 760px) {
  .auth-wrap {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    padding: 28px 22px 12px;
  }

  .auth-panel {
    min-height: auto;
    border-left: 0;
    padding: 16px;
  }

  .main {
    padding: 14px;
  }

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

  .topbar {
    display: grid;
  }

  .tree-toolbar,
  .map-toolbar {
    display: grid;
  }

  .pair-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .pair-link,
  .empty-slot {
    display: none;
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

/* ---- Fan chart ---- */
.fan-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fan-viewport {
  height: min(72vh, 720px);
  overflow: hidden;
  border-radius: 14px;
  background: #fdfdff;
  border: 1px solid var(--line);
  touch-action: none;
  cursor: grab;
}

.fan-viewport:active {
  cursor: grabbing;
}

#fanSvg {
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
}

.fan-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: -1px;
}

.fan-legend {
  flex-wrap: wrap;
}

/* ---- Places map ---- */
.places-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

#placesMap {
  height: min(72vh, 720px);
  border-radius: 14px;
  border: 1px solid var(--line);
}

.map-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #fcbd2e, #e32e85 55%, #a23bdb);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(35, 57, 94, 0.35);
}

.map-pin.news {
  background: linear-gradient(135deg, #5856d6, #3634a3);
  font-size: 14px;
}

.popup-list {
  margin-top: 6px;
  max-height: 260px;
  overflow-y: auto;
}

.popup-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 5px 0;
  border-top: 1px solid var(--line);
}

/* ---- Story chapters ---- */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.story-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.story-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.story-card strong {
  font-size: 17px;
  line-height: 1.3;
}

.story-card-top {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.story-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.story-years {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
}

.story-snippet {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.story-people-count {
  font-size: 12px;
  color: var(--muted);
}

.story-reader {
  max-width: 760px;
}

.story-header {
  margin: 14px 0 6px;
}

.story-header h2 {
  margin: 4px 0;
}

.story-paragraph {
  font-size: 16px;
  line-height: 1.75;
  margin: 0 0 18px;
}

.person-link {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  border-bottom: 1px solid rgba(31, 112, 232, 0.35);
}

.person-link:hover {
  border-bottom-color: var(--blue);
}

.story-nav {
  margin-top: 18px;
  flex-wrap: wrap;
}

/* ---- Insights ---- */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 14px;
}

.insight-card h3 {
  margin: 0 0 10px;
}

.insight-svg {
  width: 100%;
  height: auto;
}

.split-bar {
  height: 24px;
  border-radius: 8px;
  background: #d9deea;
  overflow: hidden;
  margin-bottom: 6px;
}

.split-bar div {
  height: 100%;
  background: linear-gradient(135deg, #fcbd2e, #e32e85 55%, #a23bdb);
  border-radius: 8px;
}

.split-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

.mini-map {
  height: 230px;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin: 6px 0;
}

.leader-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leader-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-strong);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.leader-row:hover {
  box-shadow: var(--shadow);
}

.leader-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
}

.leader-name small {
  display: block;
  font-weight: 400;
  color: var(--muted);
}

.wall-gen {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gen-tiles {
  display: flex;
  gap: 10px;
}

.gen-tiles div {
  flex: 1;
  text-align: center;
  padding: 14px 6px;
  border-radius: 10px;
  background: var(--paper);
}

.gen-tiles strong {
  display: block;
  font-size: 22px;
}

.gen-tiles span {
  font-size: 11px;
  color: var(--muted);
}

.two-charts {
  display: flex;
  gap: 10px;
}

.rings-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.insight-rings {
  width: 190px;
  height: 190px;
  flex-shrink: 0;
}

.rings-legend div {
  display: flex;
  gap: 8px;
  font-size: 11px;
  padding: 1px 0;
}

.rings-legend span { color: var(--muted); width: 42px; }
.rings-legend em { color: var(--blue); font-style: normal; font-weight: 700; }

.chip-active {
  background: linear-gradient(135deg, #fcbd2e, #e32e85 55%, #a23bdb);
  color: #fff;
}
