:root {
  --bg: #111827;
  --panel: #1f2937;
  --panel-2: #273449;
  --text: #f3f4f6;
  --muted: #aeb8c8;
  --line: #43516a;
  --accent: #d5ad5c;
  --field: #111827;
  --error: #fecaca;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% -10%, #273755 0, #111827 48%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
header {
  min-height: 72px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 24, 39, 0.9);
}
.brand-title {
  font-weight: 800;
  letter-spacing: 0.15em;
  font-size: 20px;
}
.brand-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.page-link,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 8px;
  padding: 8px 13px;
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}
.page-link,
.secondary-button {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
}
.primary-button {
  color: #17120a;
  background: var(--accent);
  border: 1px solid var(--accent);
}
main {
  width: min(1180px, calc(100% - 32px));
  margin: 30px auto 50px;
}
.intro {
  max-width: 820px;
  margin-bottom: 22px;
}
.intro h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 42px);
}
.intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 390px) 1fr;
  gap: 20px;
  align-items: start;
}
.card {
  background: rgba(31, 41, 55, 0.96);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}
.card h2 {
  margin: 0 0 6px;
  font-size: 17px;
}
.card-note {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-wide {
  grid-column: 1/-1;
}
label {
  font-size: 11px;
  font-weight: 700;
  color: #dbe3ef;
}
input,
select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
}
input:focus,
select:focus {
  outline: 2px solid rgba(213, 173, 92, 0.35);
  border-color: var(--accent);
}
.actions {
  display: flex;
  gap: 9px;
  margin-top: 18px;
}
.status {
  min-height: 20px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}
.status.error {
  color: var(--error);
}
.empty-state {
  display: grid;
  place-items: center;
  min-height: 330px;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}
.planet-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
}
.planet-table th,
.planet-table td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 11px 8px;
  font-size: 13px;
}
.planet-table th {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.planet-symbol {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  margin-right: 8px;
  border-radius: 50%;
  background: #37445b;
  font-size: 17px;
}
.retrograde {
  color: #f2c777;
  font-weight: 800;
}
.result-summary {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.phase-note {
  margin-top: 18px;
  padding: 13px;
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
/* Zodiacal Cell Salts layer: Bridge of Life / Personal Mineral Profile chips
   (see js/natal.js's bridgeOfLifeMarkup()). */
.mineral-subheading {
  margin: 16px 0 4px;
  font-size: 13px;
  color: var(--text);
}
.mineral-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.mineral-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  font-size: 12px;
  min-width: 120px;
}
.mineral-chip b {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.mineral-chip span {
  font-size: 13px;
  font-weight: 700;
}
.mineral-chip small {
  font-weight: 400;
  color: var(--muted);
}
@media (max-width: 800px) {
  header {
    padding: 10px 14px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  main {
    width: min(100% - 22px, 640px);
    margin-top: 20px;
  }
  .empty-state {
    min-height: 220px;
  }
}
@media (max-width: 430px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field-wide {
    grid-column: auto;
  }
  .card {
    padding: 15px;
  }
  .planet-table th:nth-child(3),
  .planet-table td:nth-child(3) {
    display: none;
  }
}
/* Natal angles and Equal House results */
.result-section {
  margin-top: 22px;
}
.result-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
}
.angle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.angle-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}
.angle-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.angle-value {
  display: block;
  margin-top: 5px;
  font-size: 15px;
  font-weight: 750;
}
.natal-chart-wrap {
  margin: 18px auto 4px;
  max-width: 680px;
}
.natal-chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart-bg {
  fill: #141d2d;
  stroke: #586782;
  stroke-width: 2;
}
.chart-ring {
  fill: none;
  stroke: #586782;
  stroke-width: 1;
}
.zodiac-sector {
  stroke: #526078;
  stroke-width: 1;
}
.sign-fire {
  fill: #512f32;
}
.sign-earth {
  fill: #304539;
}
.sign-air {
  fill: #33445b;
}
.sign-water {
  fill: #293f55;
}
.chart-radial {
  stroke: #586782;
  stroke-width: 1;
}
.house-radial {
  stroke: #8290a8;
  stroke-width: 1.2;
}
.axis-ac {
  stroke: #f3f4f6;
  stroke-width: 3;
}
.axis-mc {
  stroke: #d5ad5c;
  stroke-width: 2.5;
}
.chart-sign {
  fill: #f3f4f6;
  font-size: 25px;
  text-anchor: middle;
  dominant-baseline: middle;
}
.chart-house {
  fill: #aeb8c8;
  font-size: 12px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
}
.chart-planet {
  fill: #f8fafc;
  font-size: 25px;
  text-anchor: middle;
  dominant-baseline: middle;
}
.chart-planet-dot {
  fill: #d5ad5c;
}
.chart-angle {
  fill: #f3f4f6;
  font-size: 11px;
  font-weight: 800;
}
.chart-angle-mc {
  fill: #e8c77f;
}
.aspect-line {
  fill: none;
  stroke-width: 1.7;
  opacity: 0.8;
}
.aspect-conjunction {
  stroke: #d5ad5c;
}
.aspect-opposition {
  stroke: #ef7777;
}
.aspect-trine {
  stroke: #66c28a;
}
.aspect-square {
  stroke: #e38a68;
  stroke-dasharray: 6 4;
}
.aspect-sextile {
  stroke: #6ca8df;
  stroke-dasharray: 3 3;
}
.aspect-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px 14px;
  margin: 10px 0 4px;
  color: var(--muted);
  font-size: 11px;
}
.aspect-key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.aspect-swatch {
  display: inline-block;
  width: 20px;
  border-top: 2px solid;
}
.aspect-swatch.square,
.aspect-swatch.sextile {
  border-top-style: dashed;
}
.aspect-swatch.conjunction {
  border-color: #d5ad5c;
}
.aspect-swatch.opposition {
  border-color: #ef7777;
}
.aspect-swatch.trine {
  border-color: #66c28a;
}
.aspect-swatch.square {
  border-color: #e38a68;
}
.aspect-swatch.sextile {
  border-color: #6ca8df;
}
.empty-state {
  min-height: 84px;
  padding: 10px 6px;
}
@media (max-width: 800px) {
  .empty-state {
    min-height: 72px;
  }
}
@media (hover: hover) and (pointer: fine) {
  input[type="date"],
  input[type="time"] {
    color-scheme: dark;
  }
  input[type="date"]::-webkit-calendar-picker-indicator,
  input[type="time"]::-webkit-calendar-picker-indicator {
    opacity: 0.78;
    cursor: pointer;
  }
}
@media (hover: none) and (pointer: coarse) {
  input,
  select {
    font-size: 16px;
  }
}

/* Programmatic natal analysis */
.natal-analysis-summary {
  margin: 14px 0;
  padding: 16px;
  border: 1px solid var(--border, #343b48);
  border-radius: 14px;
  background: var(--panel-soft, rgba(255, 255, 255, 0.025));
}
.natal-analysis-summary h4,
.interpretation-section-title {
  margin: 0 0 10px;
}
.natal-analysis-summary p {
  margin: 7px 0;
  line-height: 1.55;
}
.interpretation-evidence {
  margin: 12px 0 18px;
  border: 1px solid var(--border, #343b48);
  border-radius: 12px;
  overflow: hidden;
}
.interpretation-evidence > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}
.interpretation-evidence > summary::-webkit-details-marker {
  display: none;
}
.interpretation-evidence-body {
  padding: 0 14px 14px;
}
.interpretation-degree-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}
.interpretation-degree-grid > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--border, #343b48);
  border-radius: 10px;
}
.interpretation-degree-grid span {
  line-height: 1.35;
}
@media (max-width: 760px) {
  .interpretation-degree-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 480px) {
  .interpretation-degree-grid {
    grid-template-columns: 1fr;
  }
}

/* Overall synthesis — structured presentation */
.natal-analysis-summary {
  padding: 18px;
}
.natal-analysis-summary > h4 {
  font-size: 15px;
  margin-bottom: 13px;
}
.synthesis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.synthesis-group {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
}
.synthesis-group.synthesis-patterns {
  grid-column: 1/-1;
}
.synthesis-group h5 {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.synthesis-group-body {
  display: grid;
  gap: 0;
}
.synthesis-item {
  display: grid;
  grid-template-columns: minmax(135px, 0.72fr) minmax(0, 1.28fr);
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
  line-height: 1.4;
}
.synthesis-item:first-child {
  padding-top: 0;
  border-top: 0;
}
.synthesis-item:last-child {
  padding-bottom: 0;
}
.synthesis-item > b {
  font-size: 12px;
}
.synthesis-item > span {
  min-width: 0;
  font-size: 11px;
  color: var(--text);
}
.synthesis-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}
.synthesis-patterns .synthesis-item > span {
  line-height: 1.55;
}
.interpretation-meaning {
  margin-top: 12px;
  padding: 14px 15px;
  border: 1px solid color-mix(in srgb, var(--accent) 48%, var(--line));
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 7%, var(--panel-2));
}
.interpretation-meaning h4 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
}
.interpretation-meaning-body {
  display: grid;
  gap: 7px;
}
.natal-analysis-summary .interpretation-meaning p {
  margin: 0;
  line-height: 1.55;
}
.synthesis-footnote {
  margin: 11px 2px 0;
  font-size: 10px;
  line-height: 1.45;
}
@media (max-width: 760px) {
  .synthesis-grid {
    grid-template-columns: 1fr;
  }
  .synthesis-group.synthesis-patterns {
    grid-column: auto;
  }
  .synthesis-item {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .synthesis-item > b {
    font-size: 12px;
  }
  .synthesis-item > span {
    font-size: 11px;
  }
  .interpretation-meaning {
    padding: 12px 13px;
  }
}
@media (max-width: 480px) {
  .natal-analysis-summary {
    padding: 13px;
  }
  .synthesis-group {
    padding: 11px;
  }
  .synthesis-grid {
    gap: 8px;
  }
  .interpretation-meaning {
    margin-top: 9px;
  }
}

/* Natal Analysis v18: reuse the app's standard Seven badges in synthesis. */
/* Keep the standard coloured badges, but size/align them to synthesis text. */
.natal-interpretations .natal-analysis-summary .natal-planet-badge,
.natal-interpretations .interpretation-evidence .natal-planet-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 18px;
  min-height: 18px;
  max-height: 18px;
  margin: 0 0.12em;
  vertical-align: -0.22em;
  font-size: 12px;
  line-height: 18px;
}
.natal-interpretations
  .natal-analysis-summary
  .natal-planet-badge
  .celestial-glyph,
.natal-interpretations
  .interpretation-evidence
  .natal-planet-badge
  .celestial-glyph {
  line-height: 1;
}
.natal-interpretations .synthesis-planet-ref {
  display: inline-flex;
  align-items: center;
  gap: 0.12em;
  white-space: nowrap;
  vertical-align: baseline;
  position: relative;
  top: 1px;
}
.natal-interpretations .synthesis-planet-ref .natal-planet-badge {
  margin: 0;
}
.natal-interpretations .synthesis-planet-name {
  vertical-align: baseline;
}
.natal-interpretations .synthesis-aspect-label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2em;
  line-height: 1.45;
}
.natal-interpretations .synthesis-aspect-symbol {
  display: inline-block;
  min-width: 1em;
  text-align: center;
  font-weight: 700;
  line-height: 1;
}
.natal-interpretations .synthesis-badge-line {
  display: inline-flex;
  align-items: center;
  gap: 0.22em;
  flex-wrap: wrap;
  line-height: 1.45;
}
.natal-interpretations .natal-analysis-summary p,
.natal-interpretations .synthesis-item > span {
  line-height: 1.6;
}

/* Saved natal chart profiles */
.saved-charts {
  margin: 0 0 16px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
}
.saved-charts-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}
.saved-charts-heading::-webkit-details-marker {
  display: none;
}
.saved-charts-heading h3 {
  margin: 0;
  font-size: 12px;
}
.saved-charts-heading-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.saved-charts-count {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.saved-charts-chevron {
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  transition: transform 0.15s;
}
.saved-charts[open] .saved-charts-chevron {
  transform: rotate(180deg);
}
.saved-charts-body {
  margin-top: 9px;
}
.saved-charts-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.saved-charts-row select {
  height: 36px;
  font-size: 12px;
}
.saved-charts-row .secondary-button,
.saved-charts-actions .secondary-button {
  min-height: 36px;
  padding: 7px 11px;
}
.saved-charts-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.saved-charts-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  text-align: justify;
}
.saved-charts button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
@media (max-width: 430px) {
  .saved-charts-row {
    grid-template-columns: 1fr;
  }
  .saved-charts-row .secondary-button {
    width: 100%;
  }
  .saved-charts-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .saved-charts-actions .secondary-button {
    width: 100%;
  }
}

.natal-interpretations .synthesis-term-list {
  display: flex;
  flex-direction: column;
  gap: 0.32em;
}
.natal-interpretations .synthesis-term-list > span {
  display: block;
}

/* Forecast / Historic modal badge sizing - v30 */
#forecastModal .forecast-event-title .natal-planet-badge {
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 18px;
  min-height: 18px;
  max-height: 18px;
  padding: 0;
  flex: 0 0 18px;
}
#forecastModal .forecast-natal-context .natal-planet-badge,
#forecastModal .forecast-natal-context .natal-zodiac-badge {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: 16px;
  min-height: 16px;
  max-height: 16px;
  padding: 0;
  flex: 0 0 16px;
}
/* Override the global width:100% rule only for natal-context glyphs. */
#forecastModal .forecast-natal-context .celestial-badge .celestial-glyph {
  width: auto;
}
