:root {
  color-scheme: light;
  --bg: #fbf7ef;
  --panel: #fffdf8;
  --ink: #17172b;
  --muted: #555568;
  --line: #e7dcc9;
  --accent: #5d4f8f;
  --accent-dark: #42366d;
  --gold: #b99048;
  --green: #277a86;
  --shadow: 0 18px 55px rgba(69, 49, 31, 0.13);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

button,
input {
  font: inherit;
}

.app-shell {
  width: 100%;
  margin: 0 auto;
  padding: 0 0 32px;
}

.intro {
  display: grid;
  gap: 18px;
  padding: 20px 0 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.83rem;
  font-weight: 750;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 6vw, 4.4rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: 1.55rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.intro-text,
.result-hero p,
.key-results p,
.main-placements p,
.chart-note p {
  color: var(--muted);
  line-height: 1.55;
}

.workspace {
  display: grid;
  gap: 24px;
}

.birth-form,
.results {
  background: rgba(255, 253, 249, 0.86);
  border: 1px solid rgba(221, 211, 199, 0.85);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.birth-form {
  display: grid;
  gap: 18px;
  padding: 22px;
}

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

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 111, 101, 0.15);
}

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

.place-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 10px;
}

.icon-button,
.primary-button,
.place-option {
  border: 0;
  cursor: pointer;
}

.icon-button {
  min-width: 46px;
  min-height: 46px;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-size: 1.35rem;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 750;
}

.primary-button:hover,
.icon-button:hover {
  background: var(--accent-dark);
}

.place-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.calculation-error {
  border: 1px solid rgba(156, 63, 48, 0.35);
  border-radius: 6px;
  background: #fff4f1;
  color: #742d24;
  padding: 11px 12px;
  line-height: 1.5;
}

.place-options {
  display: grid;
  gap: 8px;
}

.place-option {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.manual-settings {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
}

summary {
  cursor: pointer;
  color: var(--green);
  font-weight: 750;
}

.results {
  display: grid;
  gap: 24px;
  padding: 22px;
  min-width: 0;
}

.results > *,
.table-section,
.chart-section {
  min-width: 0;
}

.result-hero {
  border-left: 4px solid var(--accent);
  padding-left: 18px;
}

.ascendant-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 18px;
}

.degree-line {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 1.04rem;
  font-weight: 800;
}

.ascendant-sign-description {
  margin: 16px 0 10px;
  color: var(--ink) !important;
  line-height: 1.6;
}

.main-placements {
  display: grid;
  gap: 10px;
}

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

.placement-cards article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.placement-cards p {
  margin-bottom: 6px;
  font-size: 0.92rem;
  font-weight: 700;
}

.placement-cards h3 {
  margin-bottom: 0;
  color: var(--accent);
  font-size: 1.42rem;
}

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

.key-results article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.key-results h2 {
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.result-label {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

.soft-line {
  margin-bottom: 0;
  color: var(--green);
  font-weight: 700;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

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

th {
  background: #fbf6ef;
  color: var(--muted);
  font-size: 0.85rem;
}

tr:last-child td {
  border-bottom: 0;
}

.retrograde-mark {
  color: var(--muted);
  font-weight: 700;
}

.retrograde-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.retrograde-note strong {
  color: var(--ink);
}

.topic-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.topic-links[hidden],
.recommended-articles[hidden],
#consultation-link[hidden] {
  display: none;
}

.topic-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--green);
  padding: 8px 11px;
  font-size: 0.9rem;
  font-weight: 750;
  text-decoration: none;
}

.topic-link:hover {
  border-color: var(--green);
}

.chart-and-note {
  display: grid;
  grid-template-columns: minmax(280px, 470px) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  min-width: 0;
}

.north-chart {
  display: block;
  width: 100%;
  max-width: 470px;
  min-width: 0;
  aspect-ratio: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.chart-cell {
  fill: none;
  stroke: #6f5d4e;
  stroke-width: 1.6;
}

.chart-sign {
  fill: var(--gold);
  font-size: 13px;
  font-weight: 750;
  paint-order: stroke;
  stroke: #fffdf9;
  stroke-width: 4px;
}

.chart-planets {
  fill: var(--ink);
  font-size: 15px;
  font-weight: 750;
  paint-order: stroke;
  stroke: #fffdf9;
  stroke-width: 4px;
}

.chart-house {
  fill: var(--muted);
  font-size: 10px;
  paint-order: stroke;
  stroke: #fffdf9;
  stroke-width: 3px;
}

.chart-lagna-group .chart-house {
  fill: var(--accent);
  font-weight: 800;
}

.chart-planet-asc {
  fill: var(--accent);
}

.chart-reading {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.chart-reading p {
  color: var(--muted);
  line-height: 1.55;
}

.chart-reading p:last-child {
  margin-bottom: 0;
  color: var(--green);
  font-weight: 750;
}

.learning-block {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  color: var(--muted);
}

.meaning-section,
.reading-section,
.consultation-section {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.section-intro,
.reading-section > p,
.consultation-section p {
  color: var(--muted);
  line-height: 1.55;
}

.planet-explanations {
  display: grid;
  gap: 8px;
}

.planet-explanation {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.planet-explanation summary {
  padding: 14px 16px;
  color: var(--ink);
  list-style-position: inside;
}

.planet-explanation-body {
  border-top: 1px solid var(--line);
  padding: 14px 16px 16px;
}

.planet-explanation-body p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.article-card {
  display: flex;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--green);
  padding: 14px;
  font-weight: 750;
  text-decoration: none;
}

.article-card:hover {
  border-color: var(--green);
}

.consultation-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.consultation-section h2,
.consultation-section p {
  margin-bottom: 6px;
}

.consultation-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 11px 16px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.consultation-button:hover {
  background: var(--accent-dark);
}

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

.learning-block ol,
.learning-block ul {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.8;
}

#sign-list {
  list-style: none;
  padding-left: 0;
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 18px;
  }

  .field-row,
  .key-results,
  .placement-cards,
  .chart-and-note,
  .learning-grid,
  .recommended-articles {
    grid-template-columns: 1fr;
  }

  .consultation-section {
    align-items: flex-start;
    flex-direction: column;
  }

  .birth-form,
  .results {
    padding: 16px;
  }

  table {
    min-width: 560px;
  }

  .north-chart {
    max-width: 100%;
  }
}
