@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/cormorant-garamond-400.ttf") format("truetype");
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/cormorant-garamond-500.ttf") format("truetype");
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/cormorant-garamond-600.ttf") format("truetype");
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/cormorant-garamond-700.ttf") format("truetype");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-400.ttf") format("truetype");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter-500.ttf") format("truetype");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-600.ttf") format("truetype");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/inter-700.ttf") format("truetype");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/inter-800.ttf") format("truetype");
}

@font-face {
  font-family: "Allura";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/allura-400.ttf") format("truetype");
}

:root {
  color-scheme: dark;
  --paper: #1f2733;
  --paper-soft: #263041;
  --ink: #ffffff;
  --ink-deep: #e8ded2;
  --muted: #b8c0cc;
  --line: rgba(232, 222, 210, 0.2);
  --line-focus: #ead6a4;
  --gold: #d6a157;
  --gold-deep: #ead6a4;
  --design: #b97d74;
  --personality: #263646;
  --navy: #1f2733;
  --blue-signature: #17396d;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-script: "Allura", cursive;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 8%, rgba(234, 214, 164, 0.15), transparent 28rem),
    radial-gradient(circle at 85% 18%, rgba(23, 57, 109, 0.26), transparent 30rem),
    linear-gradient(135deg, #1c2230 0%, #202a3a 48%, #252e40 100%);
  font-family: var(--font-sans);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1420px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 28px 72px;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 198px;
  aspect-ratio: 1;
  place-items: center;
  margin: 0 auto 22px;
}

.brand-mark::before {
  display: none;
  content: none;
}

.brand-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.result-mark {
  width: 132px;
  margin-bottom: 12px;
}

.input-section {
  width: min(960px, 100%);
  margin: 0 auto;
  text-align: center;
}

.input-section[hidden],
.result-section[hidden] {
  display: none;
}

.input-section h1,
.result-title h2,
.properties-panel h2 {
  margin: 0;
  color: var(--ink-deep);
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: 0;
}

.input-section h1 {
  font-size: clamp(3.8rem, 7.2vw, 6.3rem);
  line-height: 0.95;
}

.input-section p {
  width: min(820px, 100%);
  margin: 22px auto 48px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.chart-form {
  width: min(620px, 100%);
  margin: 0 auto;
  text-align: left;
}

fieldset {
  position: relative;
  margin: 0 0 22px;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(18, 25, 38, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

fieldset:focus-within {
  border-color: var(--line-focus);
}

legend {
  margin-left: 18px;
  padding: 0 10px;
  color: var(--ink-deep);
  font-size: 0.9rem;
  font-weight: 600;
}

input,
select {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  outline: none;
  color: var(--ink);
  background: transparent;
}

select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--ink-deep) 50%) calc(100% - 17px) 52% / 8px 8px no-repeat,
    linear-gradient(135deg, var(--ink-deep) 50%, transparent 50%) calc(100% - 12px) 52% / 8px 8px no-repeat;
}

input::placeholder,
select:invalid {
  color: rgba(184, 192, 204, 0.72);
}

.city-field {
  z-index: 4;
}

.city-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  right: 4px;
  left: 4px;
  z-index: 10;
  padding: 8px;
  border: 1px solid rgba(232, 222, 210, 0.26);
  border-radius: 3px;
  background: #253043;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.city-search-value {
  min-height: 42px;
  padding: 11px 12px;
  border: 1px solid rgba(232, 222, 210, 0.26);
  border-radius: 4px;
  color: var(--ink);
}

.city-option {
  display: flex;
  width: 100%;
  gap: 10px;
  align-items: center;
  padding: 12px 5px;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.city-option:hover {
  background: rgba(234, 214, 164, 0.08);
}

.place-marker {
  position: relative;
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1px solid var(--gold-deep);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.place-marker::after {
  position: absolute;
  inset: 3px;
  content: "";
  border-radius: 50%;
  background: var(--gold-deep);
}

.primary-button {
  display: block;
  width: auto;
  min-width: 210px;
  min-height: 54px;
  margin: 26px auto 0;
  padding: 0 28px;
  border: 0;
  border-radius: 4px;
  color: #1f2733;
  background:
    linear-gradient(135deg, rgba(255, 246, 219, 0.82), rgba(214, 161, 87, 0.96)),
    var(--gold);
  box-shadow: 0 18px 46px rgba(214, 161, 87, 0.22);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: filter 160ms ease, transform 160ms ease;
}

.primary-button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.status-pill {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.form-error {
  min-height: 22px;
  margin: 12px 0 0;
  color: #ffb6ad;
  font-size: 0.9rem;
}

.result-section {
  width: 100%;
}

.pdf-mode,
.pdf-mode body {
  width: 210mm;
  min-height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden;
  background: #1f2733 !important;
  background-image: none !important;
  color: var(--ink);
}

.pdf-mode body::before,
.pdf-mode header,
.pdf-mode nav,
.pdf-mode .app-header,
.pdf-mode .navbar,
.pdf-mode .top-bar,
.pdf-mode .page-header,
.pdf-mode .input-section,
.pdf-mode .result-actions,
.pdf-mode .tabs,
.pdf-mode .properties-content {
  display: none !important;
}

.pdf-mode .app-shell {
  width: 210mm;
  max-width: none;
  min-height: 297mm;
  margin: 0 !important;
  padding: 12mm 10mm 0;
  background: #1f2733 !important;
  background-image: none !important;
  box-shadow: none !important;
}

.pdf-mode .result-section {
  display: block !important;
  width: 100%;
  background: #1f2733 !important;
  background-image: none !important;
}

.pdf-mode .result-title {
  margin: 0 auto 7mm;
  padding: 0;
  background: transparent !important;
  background-image: none !important;
}

.pdf-mode .result-title h2 {
  color: var(--ink-deep);
  font-size: 28pt;
  line-height: 0.9;
}

.pdf-mode .chart-name {
  color: var(--gold-deep);
  font-size: 25pt;
  line-height: 0.94;
}

.pdf-mode .result-title p {
  margin-top: 2.5mm;
  color: var(--muted);
  font-size: 10pt;
}

.pdf-mode .result-mark {
  width: 29mm;
  margin-bottom: 2mm;
}

.pdf-mode .brand-mark::before {
  display: none;
  content: none;
  box-shadow: none;
}

.pdf-mode .report-shell {
  position: relative;
  display: grid;
  grid-template-columns: 38mm 94mm 38mm;
  gap: 0 6mm;
  align-items: start;
  min-height: auto;
  margin-top: 0;
  overflow: visible;
  background: transparent !important;
  background-image: none !important;
}

.pdf-mode .chart-card {
  position: static;
  grid-column: 2;
  grid-row: 1;
  width: 96mm;
  min-width: 0;
  transform: none;
  background: transparent !important;
  background-image: none !important;
}

.pdf-mode .design-column {
  position: static;
  grid-column: 1;
  grid-row: 1;
  width: 38mm;
  margin-top: 7mm;
}

.pdf-mode .personality-column {
  position: static;
  grid-column: 3;
  grid-row: 1;
  width: 38mm;
  margin-top: 7mm;
}

.pdf-mode .properties-panel {
  position: relative;
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  min-height: 277mm;
  margin: 0;
  padding-top: 14mm;
  break-before: page;
  page-break-before: always;
  background: #1f2733 !important;
  background-image: none !important;
}

.pdf-mode .bodygraph {
  width: 92mm;
  margin: 0 auto;
}

.pdf-mode .activation-pill {
  grid-template-columns: 5mm minmax(0, 1fr);
  min-height: 5.8mm;
  padding: 0 1.8mm;
  font-size: 7.4pt;
  break-inside: avoid;
  page-break-inside: avoid;
}

.pdf-mode .activation-list {
  gap: 1.7mm;
}

.pdf-mode .activation-column h3 {
  margin-bottom: 3mm;
  color: var(--ink-deep);
  font-size: 9pt;
  text-align: left;
}

.pdf-mode .personality-column h3 {
  text-align: right;
}

.pdf-mode .chart-copyright {
  margin-top: 2mm;
  color: var(--muted);
  font-size: 8pt;
}

.pdf-mode .properties-panel h2 {
  margin-bottom: 8mm;
  color: var(--ink-deep);
  font-size: 30pt;
  line-height: 0.95;
}

.pdf-mode .print-properties {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 7mm 10mm;
  margin-top: 0;
  align-items: start;
  visibility: visible !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.pdf-mode .print-properties section {
  break-inside: avoid;
  page-break-inside: avoid;
}

.pdf-mode .print-properties section:first-child {
  grid-column: 1;
}

.pdf-mode .print-properties section:nth-child(2) {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.pdf-mode .print-properties section:nth-child(3) {
  grid-column: 1;
}

.pdf-mode .print-properties h3 {
  margin: 0 0 2mm;
  color: var(--ink-deep);
  font-family: var(--font-serif);
  font-size: 15pt;
  font-weight: 500;
}

.pdf-mode .print-properties .property-row {
  display: grid;
  grid-template-columns: 38mm 1fr;
  gap: 6mm;
  margin-bottom: 1.6mm;
  break-inside: avoid;
  page-break-inside: avoid;
}

.pdf-mode .print-properties .property-row span {
  color: var(--gold-deep);
  font-size: 8.8pt;
}

.pdf-mode .print-properties .property-row strong {
  color: var(--ink);
  font-size: 8.8pt;
}

.result-title {
  text-align: center;
}

.result-title h2 {
  font-size: clamp(3rem, 5.2vw, 4.7rem);
  line-height: 0.92;
}

.chart-name {
  margin-top: 4px;
  color: var(--gold-deep);
  font-family: var(--font-serif);
  font-size: clamp(2.65rem, 4.2vw, 4rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
}

.result-title p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.result-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 26px 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gold);
}

.text-button,
.icon-button,
.tab {
  border: 0;
  background: transparent;
}

.text-button {
  color: var(--gold-deep);
  font-size: 0.95rem;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--gold-deep);
}

.icon-button svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
}

.report-shell {
  display: grid;
  grid-template-columns: 140px minmax(300px, 360px) 140px minmax(300px, 1fr);
  gap: 18px;
  align-items: start;
}

.activation-column h3 {
  margin: 0 0 18px;
  color: var(--ink-deep);
  font-size: 0.96rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.personality-column h3 {
  text-align: right;
}

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

.activation-pill {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 5px;
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
}

.activation-pill.design {
  background: var(--design);
}

.activation-pill.personality {
  background: var(--personality);
  border: 1px solid rgba(232, 222, 210, 0.12);
}

.planet-icon-wrap {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
}

.planet-icon {
  display: block;
  width: 17px;
  max-height: 18px;
  object-fit: contain;
}

.activation-pill strong {
  text-align: right;
}

.chart-card {
  min-width: 0;
}

.chart-stage {
  display: grid;
  place-items: center;
}

.bodygraph {
  width: min(100%, 360px);
  aspect-ratio: 3 / 4;
}

.bodygraph svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.bodygraph-svg-astrolo {
  shape-rendering: geometricPrecision;
}

.astrolo-body-outline {
  fill: rgba(232, 222, 210, 0.72);
  stroke: rgba(234, 214, 164, 0.22);
  stroke-width: 0.7;
  pointer-events: none;
}

.center {
  stroke: rgba(49, 49, 51, 0.55);
  stroke-width: 0.012;
}

.astrolo-center {
  stroke: rgba(49, 49, 51, 0.56);
  stroke-width: 0.8;
}

.center.is-open {
  fill: #ffffff;
}

.gate text {
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

.gate-marker {
  stroke: rgba(49, 49, 51, 0.6);
  stroke-width: 0.45;
  paint-order: stroke fill;
}

.astrolo-gate text {
  font-family: var(--font-sans);
}

.channel-touch {
  stroke-width: 0.026;
  stroke: transparent;
}

.channel-segment {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.properties-panel h2 {
  font-size: clamp(3.2rem, 5vw, 4.1rem);
  line-height: 0.95;
}

.tabs {
  display: flex;
  gap: 28px;
  margin-top: 24px;
  border-bottom: 1px solid transparent;
}

.tab {
  position: relative;
  padding: 0 0 11px;
  color: var(--ink);
  font-size: 0.95rem;
}

.tab.is-active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  content: "";
  background: var(--gold);
}

.properties-content {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.print-properties {
  display: none;
}

.property-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 26px;
  align-items: baseline;
}

.property-row span {
  color: var(--gold-deep);
  font-size: 0.94rem;
}

.property-row strong {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.35;
}

.chart-copyright {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

@media (max-width: 1040px) {
  .report-shell {
    grid-template-columns: 140px minmax(300px, 420px) 140px;
  }

  .properties-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .report-shell {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px 14px;
  }

  .chart-card {
    grid-column: 1 / -1;
    order: 1;
  }

  .design-column {
    grid-column: 1;
    order: 2;
  }

  .personality-column {
    grid-column: 2;
    order: 3;
  }

  .properties-panel {
    grid-column: 1 / -1;
    order: 4;
  }

  .bodygraph {
    width: min(100%, 420px);
  }

  .activation-column h3,
  .personality-column h3 {
    text-align: left;
  }

  .activation-pill {
    min-height: 38px;
    padding: 0 10px;
    grid-template-columns: 24px minmax(0, 1fr);
    font-size: 0.9rem;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 24px 16px 54px;
  }

  .brand-mark {
    width: 150px;
  }

  .input-section h1 {
    font-size: clamp(3rem, 15vw, 4.6rem);
  }

  .chart-form {
    width: 100%;
  }

  .primary-button {
    width: min(280px, 100%);
    min-height: 50px;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
  }

  .properties-panel h2 {
    font-size: 3rem;
  }

  .tabs {
    gap: 18px;
    overflow-x: auto;
  }

  .property-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 430px) {
  .report-shell {
    gap: 22px 10px;
  }

  .activation-pill {
    min-height: 34px;
    padding: 0 8px;
    grid-template-columns: 20px minmax(0, 1fr);
    font-size: 0.78rem;
  }

  .planet-icon-wrap {
    width: 20px;
    height: 20px;
  }

  .planet-icon {
    width: 16px;
    max-height: 17px;
  }
}

@page {
  size: A4 portrait;
  margin: 0;
  background: #1f2733;
}

@media print {
  :root {
    --print-bg: #1f2733;
  }

  *,
  *::before,
  *::after {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  html,
  body {
    width: 210mm;
    min-height: 100%;
    margin: 0 !important;
    background: var(--print-bg) !important;
    background-image: none !important;
    color: var(--ink);
  }

  body::before {
    display: none !important;
  }

  .app-shell {
    width: 210mm;
    min-height: 297mm;
    margin: 0 !important;
    padding: 9mm 10mm 0;
    background: var(--print-bg) !important;
    background-image: none !important;
    box-shadow: none !important;
  }

  .input-section,
  .result-actions,
  .tabs,
  .properties-content {
    display: none !important;
  }

  .result-section {
    display: block !important;
    width: 100%;
    background: var(--print-bg) !important;
    background-image: none !important;
  }

  .result-section::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    background: var(--print-bg) !important;
  }

  .result-title,
  .report-shell,
  .chart-card,
  .properties-panel,
  .chart-stage {
    background: transparent !important;
    background-image: none !important;
  }

  .result-title {
    margin: 0 auto;
    padding: 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .result-title h2 {
    font-size: 28pt;
    color: var(--ink-deep);
    line-height: 0.9;
  }

  .result-mark {
    width: 27mm;
    margin-bottom: 1.5mm;
  }

  .chart-name {
    font-size: 23pt;
    color: var(--gold-deep);
    line-height: 0.92;
  }

  .result-title p {
    margin-top: 2.5mm;
    color: var(--muted);
    font-size: 10pt;
  }

  .report-shell {
    position: relative;
    display: block;
    min-height: 170mm;
    margin-top: 6mm;
    overflow: visible;
  }

  .bodygraph {
    width: 94mm;
    margin: 0 auto;
  }

  .chart-card {
    position: absolute;
    top: 0;
    left: 50%;
    width: 98mm;
    transform: translateX(-50%);
    min-width: 0;
  }

  .design-column {
    position: absolute;
    top: 7mm;
    left: 0;
    width: 36mm;
  }

  .personality-column {
    position: absolute;
    top: 7mm;
    right: 0;
    width: 36mm;
  }

  .activation-column h3 {
    margin-bottom: 3mm;
    font-size: 9pt;
    text-align: left;
  }

  .chart-copyright {
    margin-top: 2mm;
  }

  .properties-panel {
    position: relative;
    width: 100%;
    min-height: 297mm;
    margin: 0;
    padding-top: 10mm;
    break-before: page;
    page-break-before: always;
    background: var(--print-bg) !important;
  }

  .properties-panel h2 {
    margin-bottom: 8mm;
    color: var(--ink-deep);
    font-size: 30pt;
  }

  .activation-pill {
    grid-template-columns: 5mm minmax(0, 1fr);
    min-height: 5.8mm;
    padding: 0 1.8mm;
    font-size: 7.4pt;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .activation-list {
    gap: 1.7mm;
  }

  .planet-icon-wrap {
    width: 5mm;
    height: 5mm;
  }

  .planet-icon {
    width: 4mm;
    max-height: 4.5mm;
  }

  .property-row {
    grid-template-columns: 42mm 1fr;
    gap: 6mm;
    break-inside: avoid;
  }

  .property-row span {
    color: var(--gold-deep);
  }

  .property-row strong {
    color: var(--ink);
  }

  .print-properties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7mm 10mm;
    margin-top: 0;
    align-items: start;
  }

  .print-properties section:first-child {
    grid-column: 1;
  }

  .print-properties section:nth-child(2) {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .print-properties section:nth-child(3) {
    grid-column: 1;
  }

  .print-properties h3 {
    margin: 0 0 2mm;
    color: var(--ink-deep);
    font-family: var(--font-serif);
    font-size: 15pt;
    font-weight: 500;
  }

  .print-properties .property-row {
    margin-bottom: 1.6mm;
  }

  .chart-copyright {
    color: var(--muted);
    font-size: 8pt;
  }
}
