/* ===================================================
   Birth Chart Generator — Professional UI Refresh
   =================================================== */

:root {
  --bg: #eef2f9;
  --bg-accent: #dde5f3;
  --surface: #ffffff;
  --surface-soft: #f8fafe;
  --surface-strong: #f1f5fb;

  --primary: #0f4fa8;
  --primary-dark: #0b3d83;
  --primary-soft: #e6eefb;
  --accent: #c17b2d;

  --text: #1b2430;
  --text-secondary: #4b5a70;
  --text-muted: #6f7f95;

  --border: #d6deea;
  --border-strong: #c4d0df;
  --focus: #2a78eb;

  --lagna-bg: #fff4df;
  --lagna-border: #d09a47;
  --center-bg: #f3f7fd;
  --chart-border: #2e3d55;

  --current-dasha: #e8f0ff;

  --shadow-sm: 0 6px 18px rgba(18, 44, 84, 0.08);
  --shadow-md: 0 16px 36px rgba(18, 44, 84, 0.14);
  --shadow-lg: 0 26px 56px rgba(18, 44, 84, 0.2);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --sun: #e8892b;
  --moon: #346fd0;
  --mars: #bd3f31;
  --mercury: #2a845f;
  --jupiter: #cf7a2d;
  --venus: #a9489a;
  --saturn: #566174;
  --rahu: #365aa6;
  --ketu: #8f3840;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: 'Noto Sans Sinhala', 'Noto Sans', sans-serif;
  background:
    radial-gradient(circle at 12% 8%, #f8fbff 0, #f8fbff 180px, transparent 180px),
    radial-gradient(circle at 86% 12%, #f6f0e5 0, #f6f0e5 170px, transparent 170px),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-accent) 100%);
}

.hidden {
  display: none !important;
}

.si-text,
.planet-si-label,
.center-rashi-btn,
.center-rashi-lbl,
.center-time,
.panchanga-label,
.panchanga-value,
.nakshatra-label,
.nakshatra-value,
.dasha-name,
.dasha-dates,
.section-title,
.chart-title,
.tab-btn,
.birth-info-summary,
.nakshatra-item,
.planet-table th,
.planet-table td {
  font-family: 'Noto Sans Sinhala', 'Noto Serif Sinhala', 'Iskoola Pota',
    'Abhaya Libre', 'Malithi Web', sans-serif !important;
}

/* ===================================================
   FORM SECTION
   =================================================== */
.form-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.2rem 1rem;
  background:
    linear-gradient(140deg, rgba(9, 34, 69, 0.95) 0%, rgba(11, 68, 136, 0.93) 52%, rgba(16, 84, 164, 0.9) 100%),
    radial-gradient(circle at 22% 22%, rgba(255, 255, 255, 0.15), transparent 48%),
    radial-gradient(circle at 78% 82%, rgba(255, 255, 255, 0.1), transparent 42%);
}

.form-card {
  width: 100%;
  max-width: 640px;
  padding: 2.2rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.93));
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(4px);
}

.lang-switcher {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-bottom: 1.2rem;
}

.lang-btn {
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  background: #fff;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.lang-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.lang-btn.active {
  border-color: var(--primary);
  background: linear-gradient(160deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 8px 16px rgba(15, 79, 168, 0.28);
}

.form-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.form-logo {
  width: 68px;
  height: 68px;
  margin: 0 auto 0.7rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 2.2rem;
  color: var(--primary-dark);
  background: linear-gradient(145deg, #fff2db, #ffe8c4);
  border: 1px solid #edcd9e;
  box-shadow: 0 10px 22px rgba(172, 121, 48, 0.3);
  animation: spin 22s linear infinite;
}

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

.form-header h1 {
  margin: 0;
  font-family: 'Noto Serif Sinhala', serif;
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  font-weight: 700;
  color: #14253f;
}

.form-header p {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.gender-row {
  margin-bottom: 1.15rem;
}

.gender-label,
.form-group label {
  display: block;
  margin-bottom: 0.42rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.gender-options {
  display: flex;
  gap: 0.7rem;
}

.gender-opt {
  cursor: pointer;
}

.gender-opt input[type='radio'] {
  display: none;
}

.gender-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 0.52rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 700;
  transition: 0.2s ease;
}

.gender-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.gender-opt input[type='radio']:checked + .gender-chip {
  border-color: transparent;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 79, 168, 0.3);
}

.form-grid-2,
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group input,
.time-select,
.location-search-wrap input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: 0.94rem;
  padding: 0.62rem 0.74rem;
  transition: 0.2s ease;
}

.form-group input:focus,
.time-select:focus,
.location-search-wrap input:focus {
  outline: none;
  border-color: var(--focus);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(42, 120, 235, 0.14);
}

.time-row {
  display: flex;
  align-items: center;
  gap: 0.28rem;
}

.time-select {
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.ampm-select {
  flex: 0 0 82px;
  min-width: 82px;
  font-weight: 700;
}

.time-sep {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 700;
}

.location-group {
  position: relative;
  margin-bottom: 0.95rem;
}

.location-search-wrap {
  display: flex;
  align-items: stretch;
}

.location-search-wrap input {
  border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.search-icon-btn {
  border: 1px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: linear-gradient(160deg, var(--primary), var(--primary-dark));
  color: #fff;
  min-width: 48px;
  font-size: 1rem;
  cursor: pointer;
  transition: filter 0.2s ease;
}

.search-icon-btn:hover {
  filter: brightness(1.07);
}

.location-suggestions {
  position: absolute;
  top: calc(100% - 0.05rem);
  left: 0;
  right: 0;
  z-index: 200;
  max-height: 215px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-md);
}

.suggestion-item {
  padding: 0.64rem 0.85rem;
  border-bottom: 1px solid #edf2f9;
  font-size: 0.87rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.suggestion-item:last-child {
  border-bottom: 0;
}

.suggestion-item:hover {
  background: #edf4ff;
}

.location-status {
  min-height: 1.2em;
  margin-top: 0.35rem;
  font-size: 0.79rem;
  color: var(--text-muted);
}

.location-status.ok {
  color: #1f7f49;
}

.location-status.err {
  color: #bf263d;
}

.location-status.loading {
  color: var(--primary);
}

.preset-locations {
  margin-bottom: 1.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
  align-items: center;
}

.preset-label {
  width: 100%;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
}

.preset-btn {
  border: 1px solid #b7cae5;
  border-radius: 999px;
  background: #fff;
  color: var(--primary-dark);
  font: inherit;
  font-size: 0.81rem;
  font-weight: 700;
  padding: 0.36rem 0.82rem;
  cursor: pointer;
  transition: 0.2s ease;
}

.preset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.submit-btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 0.95rem;
  background: linear-gradient(150deg, var(--primary), var(--primary-dark));
  color: #fff;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  cursor: pointer;
  box-shadow: 0 14px 24px rgba(13, 62, 126, 0.3);
  transition: 0.2s ease;
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(13, 62, 126, 0.37);
}

.submit-btn:active {
  transform: translateY(0);
}

.btn-icon {
  font-size: 1.16rem;
}

/* ===================================================
   RESULT SECTION
   =================================================== */
.result-section {
  min-height: 100vh;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  gap: 0.9rem;
  align-items: center;
  padding: 0.78rem 1rem;
  color: #fff;
  background: linear-gradient(120deg, #0d3f84, #1257ae 60%, #1868be);
  box-shadow: 0 10px 24px rgba(8, 37, 78, 0.3);
}

.back-btn,
.print-btn {
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.back-btn:hover,
.print-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.birth-info-summary {
  flex: 1;
  text-align: center;
  line-height: 1.4;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.tab-nav {
  display: flex;
  gap: 0.15rem;
  padding: 0.4rem 0.5rem 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  padding: 0.74rem 1rem;
  transition: 0.2s ease;
}

.tab-btn:hover {
  color: var(--primary);
  background: #f3f7fd;
}

.tab-btn.active {
  color: var(--primary-dark);
  background: var(--surface-soft);
  border-bottom-color: var(--primary);
}

.tab-content {
  max-width: 1220px;
  margin: 0 auto;
  padding: 1.6rem 1rem;
}

.chart-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 1.35rem;
}

.chart-wrapper,
.planet-table-wrapper,
.panchanga-grid,
.lagna-details-grid,
.dasha-timeline,
.nakshatra-detail-grid {
  background: linear-gradient(180deg, #ffffff, #fdfefe);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.chart-wrapper,
.planet-table-wrapper {
  padding: 1rem;
}

.chart-title {
  margin: 0 0 0.7rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  font-family: 'Noto Serif Sinhala', serif;
}

.chart-meta {
  margin: -0.2rem 0 0.9rem;
  padding: 0.42rem 0.6rem;
  border-radius: 8px;
  border: 1px solid #dde6f2;
  background: #f5f9ff;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.45;
  font-size: 0.9rem;
  font-weight: 600;
}

.south-indian-chart {
  width: 100%;
  aspect-ratio: 1 / 1;
}

.chart-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  border: 2px solid var(--chart-border);
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
}

.chart-cell,
.center-cell {
  border: 1px solid var(--chart-border);
  position: relative;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.chart-cell {
  padding: 6px 4px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.lagna-cell {
  background: var(--lagna-bg) !important;
  border-color: var(--lagna-border) !important;
}

.center-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #f8f9ff 0%, #eef3fb 100%);
}

.center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  padding: 4px;
}

/* Lagna rashi PNG icon in center */
.center-rashi-png {
  width: 60px;
  height: 60px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}

/* Rashi name label below the icon */
.center-rashi-lbl {
  font-family: 'Noto Serif Sinhala', serif;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: 0.01em;
  line-height: 1.1;
}

/* Birth time — small, below rashi name */
.center-time {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.cell-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 2;
  line-height: 1;
}

.cell-corner.corner-tl { top: 4px; left: 4px; align-items: flex-start; }
.cell-corner.corner-tr { top: 4px; right: 4px; align-items: flex-end; }
.cell-corner.corner-bl { bottom: 4px; left: 4px; align-items: flex-start; }
.cell-corner.corner-br { bottom: 4px; right: 4px; align-items: flex-end; }
.cell-corner.corner-t { top: 4px; left: 50%; transform: translateX(-50%); align-items: center; }
.cell-corner.corner-b { bottom: 4px; left: 50%; transform: translateX(-50%); align-items: center; }
.cell-corner.corner-l { top: 50%; left: 4px; transform: translateY(-50%); align-items: flex-start; }
.cell-corner.corner-r { top: 50%; right: 4px; transform: translateY(-50%); align-items: flex-end; }

.house-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #c8d2e0;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 800;
}

.cell-planets {
  width: 100%;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.planet-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  align-items: center;
}

.planet-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* Outer (modern) planets shown smaller and in brackets like APK */
.planet-chip-outer .planet-full-name {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.75;
}

.planet-full-name {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-align: center;
}

.planet-svg {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

.planet-si-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.1;
  white-space: nowrap;
}

.retro-mark {
  margin-left: 1px;
  font-size: 0.5rem;
  opacity: 0.75;
}

.retro-badge {
  margin-left: 2px;
  font-size: 0.64rem;
  color: #7b8697;
  font-style: italic;
}

.cell-diag {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.house-half {
  position: absolute;
  z-index: 1;
  max-width: 46%;
  max-height: 46%;
  overflow: visible;
  padding: 2px 3px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.house-half.hh-ul { top: 9px; left: 9px; align-items: center; }
.house-half.hh-lr { bottom: 9px; right: 9px; align-items: center; }
.house-half.hh-ur { top: 9px; right: 9px; align-items: center; }
.house-half.hh-ll { bottom: 9px; left: 9px; align-items: center; }

.house-half .cell-planets { width: 100%; gap: 2px; margin-top: 2px; overflow: visible; }
.house-half .house-num { width: 15px; height: 15px; font-size: 0.58rem; }
.house-half .planet-row { gap: 2px; }
.house-half .planet-chip { gap: 2px; padding: 0; }
.house-half .planet-svg { width: 12px; height: 12px; }
.house-half .planet-si-label { font-size: 0.54rem; }
.house-half .planet-full-name {
  font-size: 0.72rem;
  line-height: 1.08;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.house11-fix .house-half.hh-lr {
  top: auto;
  right: 7px;
  bottom: 7px;
  justify-content: flex-end;
  align-items: flex-end;
  max-height: 56%;
}

.house11-fix .house-half.hh-lr .house-num,
.house11-fix .house-half.hh-lr .cell-rashi-lbl {
  align-self: flex-end;
}

.house11-fix .house-half.hh-lr .cell-planets {
  order: -1;
  margin-top: 0;
  margin-bottom: 8px;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
}

.house11-fix .house-half.hh-lr .planet-row {
  justify-content: flex-start;
}

.cell-rashi-lbl {
  font-family: 'Noto Serif Sinhala', serif;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.house-half .cell-rashi-lbl {
  max-width: 100%;
  font-size: 0.54rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===================================================
   TABLES AND CONTENT BLOCKS
   =================================================== */
.section-title {
  margin: 0 0 0.9rem;
  padding-left: 0.65rem;
  border-left: 3px solid var(--primary);
  color: var(--text);
  font-family: 'Noto Serif Sinhala', serif;
  font-size: 1.08rem;
  font-weight: 800;
}

.planet-table-wrapper {
  overflow-x: auto;
}

.planet-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
}

.planet-table th {
  background: linear-gradient(160deg, var(--primary), var(--primary-dark));
  color: #fff;
  text-align: left;
  padding: 0.56rem 0.62rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  position: sticky;
  top: 0;
}

.planet-table th:first-child {
  border-top-left-radius: 10px;
}

.planet-table th:last-child {
  border-top-right-radius: 10px;
}

.planet-table td {
  padding: 0.5rem 0.62rem;
  border-bottom: 1px solid #ebf0f7;
}

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

.planet-table tr:hover td {
  background: #e9f2ff;
}

.table-planet-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}

.table-planet-icon .planet-svg {
  width: 18px;
  height: 18px;
}

.table-planet-name {
  font-size: 0.88rem;
  font-weight: 700;
  vertical-align: middle;
}

.panchanga-container,
.nakshatra-container {
  max-width: 760px;
  margin: 0 auto;
}

.dasha-container {
  max-width: 860px;
  margin: 0 auto;
}

.panchanga-grid,
.lagna-details-grid,
.nakshatra-detail-grid {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.panchanga-item {
  display: grid;
  grid-template-columns: 170px 22px 1fr;
  align-items: baseline;
  padding: 0.35rem 0;
  border-bottom: 1px solid #eef2f8;
}

.panchanga-item:last-child {
  border-bottom: 0;
}

.panchanga-label {
  color: var(--text-secondary);
  font-size: 0.89rem;
  font-weight: 700;
}

.panchanga-sep {
  color: var(--text-muted);
  text-align: center;
}

.panchanga-value {
  color: var(--text);
  font-size: 0.9rem;
}

.panchanga-inauspicious {
  color: #d32f2f;
  font-weight: 600;
}

.panchanga-pada-badge {
  display: inline-block;
  margin-left: 0.5rem;
  background: #e8f0fe;
  color: #1a56db;
  font-size: 0.78rem;
  padding: 0.1rem 0.45rem;
  border-radius: 20px;
  font-weight: 600;
}

.pancha-description-block {
  background: #faf8f5;
  border-left: 3px solid #c09a5a;
  border-radius: 0 8px 8px 0;
  padding: 0.85rem 1rem;
  margin: 1rem 0 0.5rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.pancha-desc-line {
  margin: 0;
}

.pancha-graha-block {
  background: #faf8f5;
  border-left: 3px solid #c09a5a;
  border-radius: 0 8px 8px 0;
  padding: 0.85rem 1rem;
  margin: 0.5rem 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.9;
}

.pancha-graha-line {
  display: block;
}

.pancha-dasha-balance {
  background: #f0f4ff;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0 1rem;
  font-size: 0.88rem;
  color: #1a56db;
  font-weight: 500;
}

.dasha-timeline {
  padding: 0.92rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dasha-trend-note {
  margin: -0.2rem 0 0.65rem;
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.dasha-trend-wrap {
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.dasha-trend-chart {
  min-width: 720px;
  background: #fbfdff;
  border: 1px solid #e7edf7;
  border-radius: 12px;
  padding: 0.65rem 0.75rem 0.55rem;
}

.dasha-trend-scale {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
  font-size: 0.76rem;
  font-weight: 700;
}

.dasha-trend-bad {
  color: #b52b2b;
}

.dasha-trend-good {
  color: #197b3d;
}

.dasha-trend-svg {
  width: 100%;
  height: 220px;
  display: block;
}

.dasha-trend-zero {
  stroke: #b9c7db;
  stroke-width: 1.2;
  stroke-dasharray: 4 3;
}

.dasha-trend-now-line {
  stroke: var(--primary);
  stroke-width: 1.4;
  stroke-dasharray: 3 2;
}

.dasha-trend-now-text {
  fill: var(--primary);
  font-size: 10px;
  font-weight: 700;
}

.dasha-trend-axis-labels text {
  fill: #7d8ca2;
  font-size: 10px;
  font-weight: 600;
}

.dasha-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border-left: 3px solid transparent;
  border-radius: 10px;
  padding: 0.58rem 0.75rem;
  transition: 0.15s ease;
}

.dasha-item.dasha-past {
  opacity: 0.55;
}

.dasha-item.dasha-current {
  border-left-color: var(--primary);
  background: var(--current-dasha);
}

.dasha-item:hover {
  background: #f3f8ff;
}

.dasha-item.dasha-current:hover {
  background: #deebff;
}

.dasha-planet {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Noto Serif Sinhala', serif;
  font-size: 0.9rem;
  font-weight: 700;
}

.dasha-marker {
  color: #b4bccc;
  font-size: 0.65rem;
}

.dasha-marker.marker-active {
  color: var(--primary);
}

.dasha-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
  flex-shrink: 0;
}

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

.dasha-name {
  font-size: 0.88rem;
  font-weight: 700;
}

.current-badge {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.64rem;
  color: #fff;
  background: var(--primary);
}

.dasha-dates {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.vidasha-item .dasha-planet {
  font-size: 0.82rem;
}

.nakshatra-item {
  display: grid;
  grid-template-columns: 28px 150px 20px 1fr;
  align-items: baseline;
  border-bottom: 1px solid #eef2f8;
  padding: 0.3rem 0;
  font-size: 0.88rem;
}

.nakshatra-item:last-child {
  border-bottom: 0;
}

.nakshatra-num {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.nakshatra-label {
  color: var(--text-secondary);
  font-weight: 700;
}

.nakshatra-sep {
  color: var(--text-muted);
  text-align: center;
}

.nakshatra-value {
  color: var(--text);
}

.nakshatra-extra {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 900px) {
  .chart-container {
    grid-template-columns: 1fr;
  }

  .tab-content {
    padding: 1.25rem 0.85rem;
  }
}

@media (max-width: 800px) {
  .form-grid,
  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .form-card {
    padding: 1.7rem 1.1rem;
  }

  .planet-svg {
    width: 14px;
    height: 14px;
  }

  .planet-si-label {
    font-size: 0.62rem;
  }

  .planet-chip {
    padding: 1px 5px;
  }

  .planet-full-name {
    font-size: 0.86rem;
  }

  .house-half .planet-full-name {
    font-size: 0.64rem;
  }

  .center-rashi-png {
    width: 42px;
    height: 42px;
  }

  .center-rashi-lbl {
    font-size: 0.7rem;
  }

  .center-time {
    font-size: 0.65rem;
  }

  .house-num {
    width: 15px;
    height: 15px;
    font-size: 0.62rem;
  }

  .birth-info-summary {
    font-size: 0.76rem;
  }
}

@media (max-width: 560px) {
  .form-section {
    padding: 1rem 0.55rem;
  }

  .form-logo {
    width: 58px;
    height: 58px;
    font-size: 2rem;
  }

  .tab-btn {
    padding: 0.63rem 0.8rem;
    font-size: 0.84rem;
  }

  .top-bar {
    flex-wrap: wrap;
  }

  .dasha-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .panchanga-item {
    grid-template-columns: 122px 16px 1fr;
  }

  .nakshatra-item {
    grid-template-columns: 22px 112px 16px 1fr;
  }
}

/* ===================================================
   PRINT
   =================================================== */
@media print {
  .top-bar,
  .tab-nav,
  .back-btn,
  .print-btn {
    display: none !important;
  }

  body,
  .result-section {
    background: #fff;
  }

  .tab-content {
    display: block !important;
    page-break-inside: avoid;
  }

  .chart-container {
    grid-template-columns: 1fr 1fr;
  }

  body {
    font-size: 11px;
  }
}

/* ===================================================
   SCROLLBAR
   =================================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #edf2f8;
}

::-webkit-scrollbar-thumb {
  background: #b6c3d6;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9daec6;
}

/* ===================================================
   YOGA TAB
   =================================================== */

.yoga-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* Summary badge */
.yoga-summary {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.yoga-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 0.45rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.yoga-count-num {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
}

/* No yogas message */
.yoga-none {
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 2rem 0;
}

/* Yoga card list */
.yoga-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.yoga-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--border-strong);
  transition: box-shadow 0.2s;
}

.yoga-card:hover {
  box-shadow: var(--shadow-md);
}

.yoga-card.yoga-strong {
  border-left-color: #1a7a3c;
  background: linear-gradient(135deg, #f0fff5 0%, #fff 100%);
}

.yoga-card.yoga-moderate {
  border-left-color: #d07e10;
  background: linear-gradient(135deg, #fffbf0 0%, #fff 100%);
}

.yoga-card.yoga-mild {
  border-left-color: #5c7ea8;
  background: linear-gradient(135deg, #f5f8ff 0%, #fff 100%);
}

.yoga-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.yoga-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  background: var(--bg-accent);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.yoga-name {
  font-size: 1.05rem;
  font-weight: 700;
  flex: 1;
}

.yoga-strength {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.yoga-strength-strong {
  background: #d4f0de;
  color: #1a7a3c;
}

.yoga-strength-moderate {
  background: #fde8c8;
  color: #a35b00;
}

.yoga-strength-mild {
  background: #dce8fa;
  color: #2656a0;
}

.yoga-desc {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* ── Yoga card: weak variant ──────────────────────────────────────────────── */
.yoga-card.yoga-weak {
  border-left-color: #9e3535;
  background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
}

.yoga-strength-verystrong {
  background: #b6f0cc;
  color: #0a5c2a;
}

.yoga-strength-weak {
  background: #ffd6d6;
  color: #7a1a1a;
}

/* ── Navamsa quality panel ────────────────────────────────────────────────── */
.yoga-navamsa-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface-strong);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}

.nav-panel-label {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.2rem;
}

.nav-planet {
  font-weight: 600;
}

.nav-arrow {
  color: var(--text-muted);
}

.nav-rashi {
  font-weight: 600;
  color: var(--text);
}

.nav-quality-badge {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.nav-vargottama  { background: #d4f0de; color: #0a5c2a; border: 1px solid #8fd8ae; }
.nav-exalted     { background: #dce8fa; color: #1a4d9e; border: 1px solid #a0bff0; }
.nav-friendly    { background: #eaf6e4; color: #2e6b20; border: 1px solid #a8d89a; }
.nav-neutral     { background: #f0f2f5; color: #4b5a70; border: 1px solid #cdd5df; }
.nav-enemy       { background: #fde8c8; color: #8a4400; border: 1px solid #f0c080; }
.nav-debilitated { background: #ffd6d6; color: #7a1a1a; border: 1px solid #f0a0a0; }

.nav-vargo-star {
  color: #d4a000;
  font-size: 1rem;
  line-height: 1;
}

/* ── Nekatha (Nakshatra Reading) Tab ─────────────────────────────────────── */

.nekatha-container {
  max-width: 740px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

.nekatha-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.nekatha-title-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nekatha-nak-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.nekatha-nak-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.nekatha-nak-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.nekatha-nak-lord {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.nekatha-pada-badge {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.nekatha-loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.nekatha-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0 0.5rem;
}

.nekatha-positive-title {
  background: #e6f7ec;
  color: #1a6e35;
}

.nekatha-caution-title {
  background: #fff4e0;
  color: #8a5200;
}

.nekatha-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
  font-size: 0.97rem;
  line-height: 1.6;
}

.nekatha-item-positive {
  background: var(--surface);
  border: 1px solid #c8e6d0;
}

.nekatha-item-caution {
  background: #fffaf2;
  border: 1px solid #f0d898;
}

.nekatha-icon {
  flex-shrink: 0;
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

.nekatha-item-positive .nekatha-icon { color: #2a9150; }
.nekatha-item-caution  .nekatha-icon { color: #c07800; }

.nekatha-text {
  color: var(--text);
}

.nekatha-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

@media (max-width: 600px) {
  .nekatha-title-row { flex-wrap: wrap; }
  .nekatha-pada-badge { margin-top: 0.25rem; }
}

/* ── Yoga Reading (Nitya Yoga from APK) ──────────────────────────────────── */
.yoga-reading {
  margin-bottom: 1.5rem;
}

.yoga-reading-loading {
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.yoga-reading-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.6rem 0.8rem;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.yoga-reading-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.yoga-reading-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

/* ── Graha Yoga APK Predictions ──────────────────────────────────────────── */
.yoga-apk-definition {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0 0 0.6rem 0;
  padding: 0.4rem 0.6rem;
  border-left: 3px solid var(--border);
  background: var(--surface);
  border-radius: 0 4px 4px 0;
}

.yoga-apk-predictions {
  padding: 0;
  margin: 0;
}

.yoga-pred-section {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.yoga-pred-item {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.9rem;
  padding: 0.3rem 0.5rem;
  border-radius: 5px;
}

.yoga-pred-positive .yoga-pred-item {
  background: #f0faf4;
  border: 1px solid #c3e6d0;
}

.yoga-pred-caution .yoga-pred-item {
  background: #fffaf2;
  border: 1px solid #f0d898;
}

.yoga-pred-icon {
  flex-shrink: 0;
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.yoga-pred-positive .yoga-pred-icon { color: #2a9150; }
.yoga-pred-caution  .yoga-pred-icon { color: #c07800; }

.yoga-pred-text {
  color: var(--text);
  line-height: 1.4;
}

/* ── Thorathuru (Details) Tab ─────────────────────────────────────────────── */

.thorathuru-container {
  max-width: 740px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

.thorathuru-list {
  margin-top: 1rem;
}

.thorathuru-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.thorathuru-row:nth-child(even) {
  background: var(--surface);
}

.thorathuru-label {
  flex: 0 0 auto;
  min-width: 175px;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.thorathuru-value {
  flex: 1;
  color: var(--text);
  font-size: 0.92rem;
  word-break: break-all;
}

.thorathuru-highlight {
  color: #e65100;
  font-weight: 600;
}

.thorathuru-danger {
  color: #c62828;
  font-weight: 600;
}

@media (max-width: 480px) {
  .thorathuru-row {
    flex-direction: column;
    gap: 0.1rem;
  }
  .thorathuru-label {
    min-width: unset;
    font-size: 0.78rem;
  }
}
