:root {
  color-scheme: light;
  --bg: #f4f7f3;
  --surface: #ffffff;
  --surface-soft: #eef3ee;
  --ink: #17201b;
  --muted: #68736c;
  --line: #d7dfd8;
  --green: #1f7a5a;
  --red: #b23a48;
  --gold: #a87918;
  --blue: #315f8f;
  --violet: #6b4c8f;
  --shadow: 0 18px 50px rgba(23, 32, 27, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(31, 122, 90, 0.18);
}

button:active {
  transform: translateY(0);
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
}

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

.city-field {
  position: relative;
}

.city-field.is-loading::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 34px;
  width: 16px;
  height: 16px;
  border: 2px solid #d7dfd8;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  pointer-events: none;
}

.city-field.is-loading input {
  padding-right: 36px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sky-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0.32;
  pointer-events: none;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1380px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 92px;
  padding: 18px 22px;
  border: 1px solid rgba(215, 223, 216, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.topbar h1,
.section-head h2,
.panel-heading h2,
.panel-heading h3 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
}

.topbar-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.storage-state,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.warning {
  color: var(--red);
}

.storage-state.warning {
  color: var(--red);
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.profile-panel,
.content-panel {
  border: 1px solid rgba(215, 223, 216, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.profile-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
}

.content-panel {
  min-width: 0;
  padding: 16px;
}

.panel-heading,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading.compact {
  margin-top: 6px;
}

.panel-heading.compact span {
  display: inline-flex;
  justify-content: center;
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 800;
}

.field-grid,
.button-row,
.profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.button-row button,
.profile-actions button {
  padding: 0 12px;
}

.profile-actions {
  grid-template-columns: 1fr;
}

.profile-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.secondary-button {
  background: var(--blue);
}

.ghost-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.danger-button {
  border-color: rgba(178, 58, 72, 0.34);
  color: var(--red);
}

.profile-state {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.profile-state strong {
  color: var(--ink);
}

.profile-state span {
  color: var(--green);
  font-weight: 800;
}

.saved-profiles {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding-right: 3px;
}

.city-suggestions {
  position: absolute;
  z-index: 10;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  display: none;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 34px rgba(23, 32, 27, 0.16);
}

.city-suggestions.is-open {
  display: grid;
}

.city-option {
  display: grid;
  gap: 2px;
  min-height: 52px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.city-option:last-child {
  border-bottom: 0;
}

.city-option:hover,
.city-option.is-active {
  transform: none;
  background: var(--surface-soft);
  box-shadow: none;
}

.city-option strong {
  font-size: 13px;
}

.city-option span {
  color: var(--muted);
  font-size: 12px;
}

.city-loading {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.city-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #d7dfd8;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

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

.saved-profile {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.saved-profile.is-active {
  border-color: rgba(31, 122, 90, 0.55);
  background: #f4fbf6;
}

.saved-profile strong {
  display: block;
  font-size: 14px;
}

.saved-profile span {
  color: var(--muted);
  font-size: 12px;
}

.profile-load {
  min-height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.profile-load:hover {
  transform: none;
  box-shadow: none;
}

.profile-delete {
  min-height: 30px;
  padding: 0 9px;
  background: var(--red);
}

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

.tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.tab.is-active {
  background: var(--ink);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(300px, 440px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 16px;
}

.matrix-dashboard {
  display: grid;
  justify-items: center;
  margin-top: 18px;
}

.health-panel {
  margin-top: 22px;
}

.health-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.health-panel h3 {
  margin: 0;
  font-size: 22px;
}

.health-table-wrap {
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.health-table {
  min-width: 0;
}

.health-table th {
  height: 66px;
  background: #f0f0f3;
  color: var(--ink);
  font-size: 14px;
  text-transform: none;
}

.health-table td {
  height: 74px;
  background: #fff;
  font-size: 16px;
  text-align: center;
}

.health-table tr:nth-child(even) td {
  background: #f3f3f5;
}

.health-table .chakra-name {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 14px;
  min-width: 220px;
  padding-left: 0;
  text-align: left;
}

.chakra-color {
  display: grid;
  place-items: center;
  align-self: stretch;
  min-height: 74px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.chakra-name strong {
  display: block;
  margin-top: 3px;
}

.chakra-name small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.3;
}

.matrix-note {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  text-align: right;
}

.matrix-map {
  position: relative;
  width: min(900px, 100%);
  aspect-ratio: 1 / 1;
  min-height: 780px;
  border-radius: 8px;
  background: #fff;
  overflow: visible;
}

.matrix-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.outer-shape,
.inner-square,
.inner-shape,
.axis-line {
  fill: none;
  stroke: #1f2730;
  stroke-width: 0.42;
}

.inner-square {
  stroke-width: 0.32;
}

.axis-line {
  stroke: #65706a;
  stroke-width: 0.22;
}

.male-line,
.female-line {
  stroke-width: 0.42;
}

.male-line {
  stroke: #7f45b6;
}

.female-line {
  stroke: #ef3b3f;
}

.money-line {
  fill: none;
  stroke: #6f766f;
  stroke-width: 0.28;
  stroke-dasharray: 1.4 1.2;
}

.matrix-node {
  position: absolute;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: #fff;
  color: #1f2730;
  box-shadow: none;
  z-index: 2;
}

.matrix-node strong {
  font-size: 20px;
  line-height: 1;
}

.matrix-node span {
  display: none;
}

.matrix-node.main {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border: 0;
  color: #fff;
}

.matrix-node.main strong {
  font-size: 34px;
}

.matrix-node.corner {
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-color: #1f2730;
}

.matrix-node.corner strong {
  font-size: 30px;
}

.matrix-node.mid {
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
}

.matrix-node.small {
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
}

.matrix-node.small strong {
  font-size: 16px;
}

.matrix-node.extra {
  width: 37px;
  height: 37px;
  margin: -17px 0 0 -17px;
  border-color: #1f2730;
  background: #fff;
  color: #1f2730;
  z-index: 3;
}

.matrix-node.extra strong {
  font-size: 18px;
}

.matrix-node.center {
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border: 0;
  background: #ffe74a;
  color: var(--ink);
  z-index: 4;
}

.matrix-node.center strong {
  font-size: 36px;
}

.node-A {
  background: #7449b7;
}

.node-B {
  background: #8c4ac2;
}

.node-C,
.node-D {
  background: #ef3b3f;
}

.node-J,
.node-L {
  border: 0;
  background: #35bfd1;
  color: #fff;
}

.node-K {
  border: 0;
  background: #40c6d3;
  color: #fff;
}

.node-M {
  border: 0;
  background: #f3a326;
  color: #fff;
}

.node-N,
.node-O,
.node-P {
  border: 0;
  background: #506dde;
  color: #fff;
}

.node-U,
.node-V {
  border: 0;
  background: #9bd85d;
  color: #fff;
}

.node-X {
  border: 0;
  background: #f3a326;
  color: #fff;
}

.line-label {
  position: absolute;
  z-index: 1;
  color: #7b4ca5;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  pointer-events: none;
}

.line-label.male {
  left: 30%;
  top: 40%;
  transform: rotate(45deg);
}

.line-label.female {
  left: 54%;
  top: 40%;
  color: #d94a4f;
  transform: rotate(-45deg);
}

.matrix-icon {
  position: absolute;
  z-index: 3;
  font-size: 24px;
  font-weight: 850;
}

.matrix-icon.heart {
  left: 55%;
  top: 65%;
  color: #ef3b3f;
}

.matrix-icon.money {
  left: 64%;
  top: 55%;
  color: #8ccf48;
}

.age-label {
  position: absolute;
  z-index: 1;
  color: #1f2730;
  min-width: 42px;
  padding: 2px 3px;
  background: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  font-weight: 850;
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.perimeter-tick {
  position: absolute;
  z-index: 1;
  display: grid;
  justify-items: center;
  min-width: 34px;
  color: #1f2730;
  line-height: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.perimeter-tick strong {
  font-size: 13px;
  font-weight: 900;
}

.perimeter-tick small {
  margin-top: 3px;
  color: #56615a;
  font-size: 8px;
  font-weight: 750;
}

.perimeter-tick.half strong {
  font-size: 15px;
}

.perimeter-tick.eighth strong {
  font-size: 12px;
}

.perimeter-tick.half small,
.perimeter-tick.decade small {
  font-size: 10px;
  font-weight: 850;
}

.perimeter-tick.decade strong {
  display: none;
}

.summary-box,
.compat-panel,
.selector-panel,
.insight-card,
.score-card,
.future-grid article,
.energy-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.summary-box {
  padding: 15px;
}

.summary-box h3,
.compat-panel h3,
.insight-card h3,
.future-grid h3,
.energy-card h3 {
  margin: 0 0 8px;
}

.summary-box h3:not(:first-child) {
  margin-top: 16px;
}

.summary-box p,
.compat-panel p,
.insight-card p,
.future-grid p,
.energy-card p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.arcana-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-top: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f7efe2;
  color: var(--gold);
  font-weight: 800;
}

.line-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.overview-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(31, 122, 90, 0.22);
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fbf8, #fff);
}

.overview-hero h3 {
  margin: 8px 0 0;
  font-size: 28px;
}

.readiness-meter {
  display: grid;
  place-items: center;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 58%, transparent 59%),
    conic-gradient(var(--green) calc(var(--value) * 1%), #dfe7df 0);
  color: var(--ink);
}

.readiness-meter strong {
  font-size: 26px;
  line-height: 1;
}

.readiness-meter span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.data-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.data-checklist span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.data-checklist .is-ok {
  background: #edf8ef;
  color: var(--green);
}

.data-checklist .is-missing {
  background: #fff6e8;
  color: var(--gold);
}

.overview-card-grid,
.overview-split,
.action-grid,
.timeline-grid,
.style-board,
.month-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.overview-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.overview-split {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.overview-card,
.action-card,
.timeline-card,
.style-tile,
.month-card,
.overview-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.overview-card,
.action-card,
.timeline-card,
.style-tile {
  padding: 13px;
}

.overview-card span,
.action-card span,
.timeline-card span,
.style-tile span,
.month-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.overview-card strong,
.action-card strong,
.timeline-card strong,
.style-tile strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.overview-card p,
.action-card p,
.timeline-card p,
.style-tile p {
  margin: 7px 0 0;
  color: var(--muted);
}

.action-list {
  display: grid;
  gap: 8px;
}

.action-row {
  display: grid;
  height: auto;
  min-height: 58px;
  justify-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.action-row span {
  color: var(--muted);
  font-size: 13px;
}

.action-grid,
.timeline-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.style-board {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.month-card {
  min-height: 92px;
  padding: 10px;
}

.month-card strong {
  display: block;
  margin: 4px 0;
  font-size: 28px;
}

.month-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.overview-note {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  background: var(--surface-soft);
}

.subhead {
  margin: 18px 0 8px;
}

.line-item {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 10px;
  padding: 12px;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: var(--surface-soft);
}

.line-item strong {
  font-size: 13px;
}

.line-item span {
  color: var(--muted);
}

.table-wrap {
  max-height: 460px;
  overflow: auto;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.selector-panel {
  padding: 14px;
  margin: 14px 0;
  background: #fff;
}

.insight-grid,
.score-grid,
.forecast-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.insight-card,
.score-card {
  padding: 14px;
}

.insight-card strong,
.score-card strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

.insight-card span,
.score-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.score-card {
  display: grid;
  gap: 7px;
  border-color: #c7d9cd;
  background: var(--surface-soft);
}

.score-card.featured {
  border-color: rgba(31, 122, 90, 0.45);
  background: #f4fbf6;
}

.score-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.score-value strong {
  font-size: 42px;
}

.score-value small {
  color: var(--muted);
  font-weight: 800;
}

.channel-list,
.compat-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.channel-item,
.compat-item,
.forecast-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.compat-item {
  grid-template-columns: 170px 1fr auto;
  align-items: center;
}

.channel-item strong,
.compat-item strong,
.forecast-item strong {
  display: block;
}

.channel-item span,
.compat-item span,
.forecast-item span {
  color: var(--muted);
  font-size: 13px;
}

.arcana-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.compat-score {
  min-width: 58px;
  text-align: right;
  font-size: 18px;
  font-weight: 900;
}

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

.future-grid article,
.energy-card,
.compat-panel {
  padding: 14px;
}

.energy-grid {
  grid-template-columns: minmax(280px, 520px);
}

.energy-card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding-left: 18px;
}

.jyotish-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.jyotish-reading-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}

.jyotish-reading-card {
  display: grid;
  gap: 7px;
  padding: 13px;
  border: 1px solid rgba(31, 122, 90, 0.28);
  border-radius: 8px;
  background: #f8fbf8;
}

.jyotish-reading-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.jyotish-reading-card strong {
  font-size: 18px;
}

.jyotish-reading-card p {
  margin: 0;
  color: var(--muted);
}

.jyotish-card {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.jyotish-card span,
.jyotish-card small,
.rashi-head span,
.dasha-item small {
  color: var(--muted);
}

.jyotish-card strong {
  font-size: 18px;
}

.rashi-chart {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.rashi-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 118px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.rashi-card.is-lagna {
  border-color: var(--red);
  background: #fff8f7;
}

.rashi-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.rashi-head span {
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

.planet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.planet-chips span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.planet-chips em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.jyotish-table {
  max-height: 390px;
}

.dasha-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dasha-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dasha-item span {
  color: var(--ink);
  font-size: 13px;
}

.hd-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.hd-metric,
.hd-info-card,
.hd-compat-panel,
.bodygraph-panel,
.hd-side,
.gate-summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.hd-metric,
.hd-info-card,
.hd-compat-panel,
.bodygraph-panel,
.hd-side,
.gate-summary-card {
  padding: 13px;
}

.hd-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.hd-metric strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.hd-metric p,
.hd-info-card p,
.gate-summary-card p {
  margin: 7px 0 0;
  color: var(--muted);
}

.human-design-layout {
  display: grid;
  grid-template-columns: minmax(390px, 520px) minmax(280px, 1fr);
  gap: 14px;
  align-items: start;
}

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

.hd-panel-head h3,
.hd-side h3,
.hd-info-card h3 {
  margin: 0 0 8px;
}

.hd-panel-head span {
  max-width: 260px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.bodygraph-scroll {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.hd-bodygraph-svg {
  display: block;
  width: min(100%, 460px);
  min-width: 360px;
  height: auto;
  margin: 0 auto;
}

.hd-silhouette {
  fill: #f1f5f2;
  stroke: #d4ddd6;
  stroke-width: 2;
}

.hd-channel-bg {
  stroke: #c9d2cc;
  stroke-width: 8;
  stroke-linecap: round;
}

.hd-channel-active {
  stroke: var(--green);
  stroke-width: 9;
  stroke-linecap: round;
}

.hd-channel-active.design {
  stroke: var(--red);
}

.hd-channel-active.personality {
  stroke: var(--blue);
}

.hd-channel-active.both {
  stroke: var(--violet);
}

.hd-center {
  fill: #fff;
  stroke: #1f2730;
  stroke-width: 2;
}

.hd-center.defined.head,
.hd-center.defined.ajna {
  fill: #f2cf5b;
}

.hd-center.defined.throat,
.hd-center.defined.g {
  fill: #70c8d4;
}

.hd-center.defined.ego,
.hd-center.defined.sacral {
  fill: #efb04a;
}

.hd-center.defined.spleen {
  fill: #8fcf74;
}

.hd-center.defined.solar {
  fill: #d67c79;
}

.hd-center.defined.root {
  fill: #bda4d6;
}

.hd-center-label {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 850;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.hd-gate circle {
  fill: #fff;
  stroke: #89958d;
  stroke-width: 1.5;
}

.hd-gate.personality circle {
  fill: #e8f0ff;
  stroke: var(--blue);
}

.hd-gate.design circle {
  fill: #fff0ef;
  stroke: var(--red);
}

.hd-gate.both circle {
  fill: #f2e9fb;
  stroke: var(--violet);
}

.hd-gate text {
  fill: var(--ink);
  font-size: 9px;
  font-weight: 850;
  text-anchor: middle;
  pointer-events: none;
}

.tag-list,
.compact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag,
.compact-list span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tag.active {
  background: #edf8ef;
  color: var(--green);
}

.hd-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.hd-info-card ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

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

.hd-table {
  max-height: 480px;
  margin-top: 0;
}

.hd-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.compact-lines .line-item {
  grid-template-columns: 145px 1fr;
}

.gate-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.gate-summary-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hd-compat-panel {
  margin-top: 18px;
}

.warning-list,
.missing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.warning-list span,
.missing-list span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff6e8;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.technical-details {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.technical-details summary {
  cursor: pointer;
  padding: 12px;
  color: var(--ink);
  font-weight: 850;
}

.technical-details .line-list {
  padding: 0 12px 12px;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.report-preview {
  overflow: auto;
  max-height: 620px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  white-space: pre-wrap;
  line-height: 1.55;
}

.energy-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 100%;
  background: var(--green);
}

.energy-card.vampire::before {
  background: var(--red);
}

.energy-card.neutral::before {
  background: var(--blue);
}

.energy-card.donor::before {
  background: var(--green);
}

.energy-number {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 12px;
}

.energy-number strong {
  font-size: 58px;
  line-height: 1;
}

.energy-number span {
  color: var(--muted);
  font-size: 20px;
  font-weight: 800;
}

.compat-panel {
  margin-top: 12px;
}

.relation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.relation-grid article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.relation-grid h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.relation-grid p {
  margin: 0;
}

.empty-state {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
}

@media (max-width: 980px) {
  .workspace,
  .result-layout {
    grid-template-columns: 1fr;
  }

  .profile-panel {
    position: static;
  }

  .matrix-map {
    width: min(820px, 100%);
    min-height: 700px;
  }

  .energy-grid {
    grid-template-columns: 1fr;
  }

  .relation-grid {
    grid-template-columns: 1fr;
  }

  .jyotish-overview,
  .jyotish-reading-grid,
  .rashi-chart,
  .dasha-list,
  .hd-summary-grid,
  .hd-mini-grid,
  .hd-activation-grid,
  .gate-summary-grid,
  .insight-grid,
  .score-grid,
  .forecast-grid,
  .overview-card-grid,
  .action-grid,
  .timeline-grid,
  .style-board,
  .month-grid {
    grid-template-columns: 1fr 1fr;
  }

  .human-design-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 16px, 1380px);
    padding-top: 8px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    min-height: auto;
  }

  .tabs,
  .field-grid,
  .button-row,
  .future-grid,
  .jyotish-reading-grid,
  .overview-hero,
  .overview-split,
  .overview-card-grid,
  .action-grid,
  .timeline-grid,
  .style-board,
  .month-grid,
  .insight-grid,
  .score-grid,
  .forecast-grid,
  .channel-item,
  .compat-item,
  .forecast-item {
    grid-template-columns: 1fr;
  }

  .compat-score {
    text-align: left;
  }

  .topbar-status {
    justify-content: flex-start;
  }

  .readiness-meter {
    width: 102px;
    height: 102px;
  }

  .health-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .matrix-note {
    text-align: left;
  }

  .health-table th,
  .health-table td {
    height: auto;
  }

  .health-table .chakra-name {
    min-width: 168px;
    grid-template-columns: 18px 1fr;
  }

  .chakra-color {
    min-height: 58px;
  }

  .matrix-map {
    min-height: 430px;
  }

  .matrix-node.main {
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
  }

  .matrix-node.main strong,
  .matrix-node.center strong {
    font-size: 25px;
  }

  .matrix-node.corner {
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
  }

  .matrix-node.corner strong {
    font-size: 22px;
  }

  .matrix-node.center {
    width: 54px;
    height: 54px;
    margin: -27px 0 0 -27px;
  }

  .matrix-node.mid {
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
  }

  .matrix-node.small {
    width: 26px;
    height: 26px;
    margin: -13px 0 0 -13px;
  }

  .matrix-node.extra {
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
  }

  .matrix-node strong,
  .matrix-node.small strong,
  .matrix-node.extra strong {
    font-size: 14px;
  }

  .line-label,
  .age-label {
    font-size: 9px;
  }

  .perimeter-tick strong,
  .perimeter-tick.half strong {
    font-size: 9px;
  }

  .perimeter-tick small {
    display: none;
  }

  .line-item {
    grid-template-columns: 1fr;
  }

  .jyotish-overview,
  .rashi-chart,
  .dasha-list,
  .hd-summary-grid,
  .hd-mini-grid,
  .hd-activation-grid,
  .gate-summary-grid {
    grid-template-columns: 1fr;
  }

  .hd-panel-head {
    display: block;
  }

  .hd-panel-head span {
    display: block;
    max-width: none;
    text-align: left;
  }

  th,
  td {
    padding: 10px 8px;
    font-size: 13px;
  }
}

@media print {
  .profile-panel,
  .tabs,
  .sky-canvas,
  .report-actions,
  .topbar-status {
    display: none !important;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .workspace {
    display: block;
  }

  .content-panel,
  .summary-box {
    border: 0;
    box-shadow: none;
  }

  .tab-panel {
    display: none !important;
  }

  #tab-report {
    display: block !important;
  }
}
