/* ============================================================
   HOROSCOPE SUBVIEW — Sourashtra Matrimony
   Extracted from rasi-nakshatra-calculator.html
   Scoped to avoid bleeding into main app styles.
   Note: --saffron, --maroon, --paper etc. are unique to this
   section and do not conflict with the main app's CSS vars.
============================================================ */

/* Horoscope-specific design tokens (shared with horoscope modal) */
#subview-horoscope,
#modal-horoscope,
.horo-theme {
  --saffron: #c8892e;
  --saffron-lt: #f3dfb2;
  --saffron-tint: #fcf6eb;
  --maroon: #731818;
  --maroon-dark: #4d0e0e;
  --maroon-tint: #fcf1ef;
  --gold: #d4af37;
  --ink: #1e1915;
  --muted: #6b5c50;
  --paper: #fbf7f0;
  --card: #ffffff;
  --rule: #e8dbca;
  --rule-gold: #d9b85c;
  --good: #256f46;
  --good-tint: #eaf5ef;
  --warn: #b8692a;
  --warn-tint: #fef4ea;
  --bad: #931d1d;
  --bad-tint: #fdf0ef;
  --font-tamil: 'Noto Serif Tamil', 'Lora', Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --horo-radius: 16px;
  --horo-radius-sm: 8px;
  --horo-shadow: 0 2px 10px rgba(100, 40, 15, 0.08);
  --horo-shadow-lg: 0 8px 26px rgba(100, 40, 15, 0.12);
  font-size: 14px;
}

/* Universal border-box to eliminate horizontal margin/padding blowout on mobile */
#subview-horoscope,
#subview-horoscope *,
#modal-horoscope,
#modal-horoscope *,
.horo-theme,
.horo-theme * {
  box-sizing: border-box;
}

@media (min-width: 768px) {
  #subview-horoscope,
  #modal-horoscope,
  .horo-theme {
    font-size: 15px;
  }
}

/* Subview wrapper */
#subview-horoscope {
  background: var(--paper);
  min-height: calc(100vh - 60px);
  overflow-y: auto;
  overflow-x: hidden;
}

/* TOP LANGUAGE BAR — hidden in main app (main app controls language) */
#subview-horoscope .lang-bar {
  display: none;
}

/* HOROSCOPE HEADER */
#subview-horoscope header {
  background: linear-gradient(135deg, var(--maroon) 0%, #521010 50%, #852020 100%);
  color: #fdf8f2;
  text-align: center;
  padding: 2rem 1.25rem 1.75rem;
  position: relative;
  overflow: hidden;
  /* Reset main app header styles */
  display: block;
  height: auto;
  box-shadow: none;
}
#subview-horoscope header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5 L35 25 L55 25 L40 37 L45 57 L30 45 L15 57 L20 37 L5 25 L25 25 Z' fill='none' stroke='rgba(255,215,100,0.06)' stroke-width='1'/%3E%3C/svg%3E") repeat;
  pointer-events: none;
}
#subview-horoscope .header-om {
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 1;
  margin-bottom: 0.25rem;
  opacity: 0.95;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
#subview-horoscope header h1 {
  font-family: var(--font-tamil);
  font-size: clamp(1.2rem, 4.5vw, 1.9rem);
  margin: 0 0 0.75rem;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 6px rgba(0,0,0,0.35);
  font-weight: 700;
  color: #fdf8f2;
  background: none;
  -webkit-text-fill-color: unset;
  line-height: 1.35;
}
#subview-horoscope header h1 .divider { color: var(--saffron-lt); margin: 0 0.4rem; }

#subview-horoscope .header-deco {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  opacity: 0.65;
}
#subview-horoscope .header-deco::before, #subview-horoscope .header-deco::after {
  content: '';
  display: block;
  height: 1px;
  width: 40px;
  background: linear-gradient(to right, transparent, var(--saffron-lt));
}
#subview-horoscope .header-deco::after { background: linear-gradient(to left, transparent, var(--saffron-lt)); }
#subview-horoscope .header-deco-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--saffron-lt); }

/* MODE SWITCHER TABS — FLUID RESPONSIVE */
#subview-horoscope .mode-tabs {
  display: flex;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.25rem;
  gap: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
#subview-horoscope .mode-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.55rem 0.5rem;
  border-radius: 999px;
  font-size: clamp(0.78rem, 2.5vw, 0.9rem);
  font-weight: 600;
  font-family: var(--font-tamil);
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
}
#subview-horoscope .mode-tab.active {
  background: var(--saffron);
  color: #181410;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
#subview-horoscope .mode-tab:hover:not(.active) { background: rgba(255, 255, 255, 0.15); color: #fff; }

/* MAIN CONTAINER — RESPONSIVE PADDING */
#subview-horoscope main {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 0.65rem 4rem;
  display: block;
  overflow: visible;
  height: auto;
}
@media (min-width: 640px) {
  #subview-horoscope main { padding: 2rem 1.5rem 5rem; }
}

/* CARDS */
#subview-horoscope .card {
  background: var(--card);
  border-radius: var(--horo-radius);
  padding: 1.25rem;
  box-shadow: var(--horo-shadow);
  border: 1px solid var(--rule);
  margin-bottom: 1.25rem;
}
@media (min-width: 640px) {
  #subview-horoscope .card { padding: 1.6rem; }
}

#subview-horoscope .card-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}
#subview-horoscope .card-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--saffron-tint);
  color: var(--saffron);
  flex-shrink: 0;
}
#subview-horoscope .card-title {
  font-family: var(--font-tamil);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--maroon);
  margin: 0;
}
#subview-horoscope .bride-card { border-top: 4px solid #8b3a3a; }
#subview-horoscope .groom-card { border-top: 4px solid #2f5233; }
#subview-horoscope .bride-card .card-icon { background: #fdf0ee; color: #8b3a3a; }
#subview-horoscope .groom-card .card-icon { background: #eef5ef; color: #2f5233; }

/* FORMS — scoped to avoid conflicting with main app form-control */
#subview-horoscope .forms-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  #subview-horoscope .forms-grid { grid-template-columns: 1fr 1fr; }
}

#subview-horoscope label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0.9rem 0 0.35rem;
  font-family: var(--font-tamil);
}
#subview-horoscope label:first-of-type { margin-top: 0; }

#subview-horoscope input,
#subview-horoscope select {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--horo-radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: #fffdfa;
  color: var(--ink);
  transition: border-color 0.18s, box-shadow 0.18s;
  -webkit-appearance: none;
  appearance: none;
}
#subview-horoscope input:focus,
#subview-horoscope select:focus {
  outline: none;
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px rgba(200, 137, 46, 0.18);
}
#subview-horoscope select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%236b5e52' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.3rem;
  cursor: pointer;
}
#subview-horoscope .coord-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
#subview-horoscope .hint { font-size: 0.78rem; color: #847264; margin-top: 0.4rem; line-height: 1.45; }

/* OPTIONAL TOGGLE */
#subview-horoscope .optional-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 42px;
  background: none;
  border: 1.5px dashed var(--rule);
  border-radius: var(--horo-radius-sm);
  padding: 0.55rem 0.9rem;
  margin-top: 0.9rem;
  font-size: 0.82rem;
  color: var(--saffron);
  font-family: var(--font-tamil);
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.horo-theme .optional-toggle:hover { background: var(--saffron-tint); border-color: var(--saffron); }
.horo-theme .optional-toggle .chevron { margin-left: auto; font-size: 0.75rem; transition: transform 0.2s; }
.horo-theme .optional-toggle.open .chevron { transform: rotate(180deg); }

/* MAIN ACTION BUTTON */
.horo-theme .calc-button-wrap { text-align: center; margin: 1.75rem 0; }
.horo-theme .calc-btn {
  background: linear-gradient(135deg, var(--maroon) 0%, #541111 100%);
  color: #fdf8f2;
  border: none;
  min-height: 50px;
  padding: 0.85rem 2.6rem;
  font-size: 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-tamil);
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 18px rgba(115, 24, 24, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  max-width: 360px;
}
.horo-theme .calc-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(115, 24, 24, 0.42); }
.horo-theme .calc-btn:active { transform: translateY(0); }

.horo-theme .error-msg {
  color: var(--bad);
  text-align: center;
  font-size: 0.92rem;
  margin-top: 0.85rem;
  display: none;
  padding: 0.65rem 1rem;
  background: var(--bad-tint);
  border-radius: var(--horo-radius-sm);
  border: 1px solid #e9b3b0;
  font-family: var(--font-tamil);
}

/* 4 ESSENTIAL ITEMS SUMMARY */
.horo-theme .result-summary {
  background: linear-gradient(135deg, var(--maroon) 0%, #541111 100%);
  border-radius: var(--horo-radius);
  padding: 1.4rem 1.25rem;
  color: #fdf8f2;
  box-shadow: var(--horo-shadow-lg);
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}
@media (min-width: 640px) {
  .horo-theme .result-summary { padding: 1.6rem 1.5rem; }
}
.horo-theme .result-summary::after {
  content: '☽';
  position: absolute;
  right: 1rem;
  top: 0.6rem;
  font-size: 4.5rem;
  opacity: 0.08;
  font-family: serif;
  pointer-events: none;
}
.horo-theme .result-summary h3 {
  font-family: var(--font-tamil);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--saffron-lt);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.horo-theme .summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .horo-theme .summary-grid { gap: 1rem; }
}
.horo-theme .summary-item {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.75rem 0.9rem;
  border-radius: var(--horo-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.horo-theme .s-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--font-tamil);
  margin-bottom: 0.2rem;
}
.horo-theme .s-value {
  font-family: var(--font-tamil);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--saffron-lt);
  word-break: break-word;
}

/* CHART TOGGLE / VIEW TABS ON MOBILE */
.horo-theme .chart-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 0.85rem;
}
@media (min-width: 600px) {
  .horo-theme .chart-pair { grid-template-columns: 1fr 1fr; gap: 1.25rem; }
}
.horo-theme .chart-block h4 {
  font-family: var(--font-tamil);
  font-size: 1rem;
  text-align: center;
  margin: 0 0 0.65rem;
  color: var(--maroon);
  font-weight: 700;
}

/* INSIGHT BANNERS */
.horo-theme .insight-banner {
  border-radius: var(--horo-radius);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  border: 1px solid var(--rule);
}
.horo-theme .insight-banner.good { background: var(--good-tint); border-color: #b2d9c4; }
.horo-theme .insight-banner.warn { background: var(--warn-tint); border-color: #f0c090; }
.horo-theme .insight-banner.bad { background: var(--bad-tint); border-color: #e9b3b0; }
.horo-theme .insight-icon { font-size: 1.7rem; flex-shrink: 0; line-height: 1; }
.horo-theme .insight-title {
  font-family: var(--font-tamil);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}
.horo-theme .insight-banner.good .insight-title { color: var(--good); }
.horo-theme .insight-banner.warn .insight-title { color: var(--warn); }
.horo-theme .insight-banner.bad .insight-title { color: var(--bad); }
.horo-theme .insight-body {
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.55;
  margin: 0;
  font-family: var(--font-tamil);
}

/* TABLE CARDS */
.horo-theme .table-card {
  background: var(--card);
  border-radius: var(--horo-radius);
  border: 1px solid var(--rule);
  box-shadow: var(--horo-shadow);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.horo-theme .table-card-header {
  background: var(--saffron-tint);
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.horo-theme .table-card-header h3 {
  font-family: var(--font-tamil);
  font-size: 1rem;
  font-weight: 700;
  color: var(--maroon);
  margin: 0;
}
/* ============================================================
   RESPONSIVE TABLES (LAPTOP & MOBILE RELATIVE ASPECT RATIO)
============================================================ */
.horo-theme .table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--saffron-lt) transparent;
}
.horo-theme .table-responsive::-webkit-scrollbar {
  height: 5px;
}
.horo-theme .table-responsive::-webkit-scrollbar-thumb {
  background: var(--saffron-lt);
  border-radius: 4px;
}

/* Visibility Helpers */
.horo-theme .mobile-only { display: none; }
.horo-theme .desktop-only { display: table-cell; }

/* ── 1. MATCH MAKING & DOSHAM CHECK TABLES ── */
.horo-theme table.matrix-match {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.horo-theme table.matrix-match th {
  text-align: left;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  font-family: var(--font-tamil);
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  background: #faf7f0;
  white-space: nowrap;
}
.horo-theme table.matrix-match td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #f0e8d8;
  vertical-align: top;
  font-family: var(--font-tamil);
}
.horo-theme table.matrix-match tr:last-child td { border-bottom: none; }
.horo-theme table.matrix-match tr:hover td { background: #fffdf9; }

/* Desktop table columns */
.horo-theme table.matrix-match th.col-num,
.horo-theme table.matrix-match td.col-num { width: 36px; text-align: center; }
.horo-theme table.matrix-match th.col-info,
.horo-theme table.matrix-match td.col-info { min-width: 160px; }
.horo-theme table.matrix-match th.col-detail,
.horo-theme table.matrix-match td.col-detail { min-width: 220px; }
.horo-theme table.matrix-match th.col-result,
.horo-theme table.matrix-match td.col-result { width: 120px; text-align: center; white-space: nowrap; }

/* ── 2. MULTI-COLUMN ANALYSIS TABLES (Sevvai Dosham Desktop) ── */
.horo-theme table.matrix-scroll {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.horo-theme table.matrix-scroll th {
  text-align: left;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-tamil);
  padding: 0.6rem 0.65rem;
  border-bottom: 1px solid var(--rule);
  background: #faf7f0;
  white-space: nowrap;
}
.horo-theme table.matrix-scroll td {
  padding: 0.6rem 0.65rem;
  border-bottom: 1px solid #f0e8d8;
  vertical-align: middle;
  font-family: var(--font-tamil);
}

/* Mobile Card-Row Transformation (< 768px) */
@media (max-width: 768px) {
  .horo-theme .desktop-only,
  .horo-theme td.desktop-only,
  .horo-theme th.desktop-only,
  .horo-theme td.col-detail,
  .horo-theme th.col-detail,
  .horo-theme table.matrix-match td.col-detail,
  .horo-theme table.matrix-match th.col-detail {
    display: none !important;
  }
  .horo-theme .mobile-only {
    display: block !important;
  }

  /* Scope horoscope subview to eliminate double padding on mobile */
  #subview-horoscope main {
    padding: 0.75rem 0 3.5rem;
    max-width: 100%;
  }

  #subview-horoscope header {
    border-radius: var(--horo-radius, 14px);
    padding: 1.4rem 1rem 1.25rem;
    margin-bottom: 1rem;
  }

  #subview-horoscope header h1 {
    font-size: clamp(1.05rem, 4vw, 1.35rem);
    margin-bottom: 0.5rem;
  }

  #subview-horoscope .header-om {
    font-size: 1.8rem;
  }

  #subview-horoscope .mode-tabs {
    max-width: 100%;
  }

  #subview-horoscope .mode-tab {
    padding: 0.45rem 0.35rem;
    font-size: 0.76rem;
  }

  /* Sub-mode tabs (Simple vs Detailed) */
  .horo-theme .sub-mode-tabs {
    border-radius: 12px;
    padding: 3px;
    gap: 4px;
    margin-bottom: 1rem;
    max-width: 100%;
  }

  .horo-theme .sub-mode-tab {
    border-radius: 9px;
    padding: 0.45rem 0.35rem;
    font-size: 0.74rem;
    line-height: 1.25;
  }

  /* Form cards in Match Making */
  #subview-horoscope .card {
    padding: 1.15rem;
    border-radius: 16px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(90, 50, 20, 0.05);
  }

  #subview-horoscope .card-header {
    margin-bottom: 0.75rem;
    gap: 0.5rem;
  }

  #subview-horoscope .card-icon {
    width: 32px;
    height: 32px;
    font-size: 1.05rem;
  }

  #subview-horoscope .card-title {
    font-size: 0.98rem;
  }

  #subview-horoscope label {
    font-size: 0.78rem;
    margin: 0.65rem 0 0.25rem;
  }

  #subview-horoscope input,
  #subview-horoscope select {
    min-height: 42px;
    padding: 0.5rem 0.75rem;
    font-size: 0.88rem;
    border-radius: 8px;
  }

  /* Calculate button */
  .horo-theme .calc-button-wrap {
    margin: 1.25rem 0;
  }

  .horo-theme .calc-btn {
    min-height: 44px;
    padding: 0.7rem 1.8rem;
    font-size: 0.96rem;
  }

  /* Score banner & results */
  .horo-theme .score-banner {
    padding: 1.35rem 1rem;
    border-radius: 20px;
    margin-bottom: 1.25rem;
  }

  .horo-theme .score-ring {
    width: 76px;
    height: 76px;
    margin-bottom: 0.6rem;
  }

  .horo-theme .score-number {
    font-size: 1.7rem;
  }

  .horo-theme .score-verdict {
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
  }

  .horo-theme .score-detail {
    font-size: 0.82rem;
    line-height: 1.45;
  }

  /* ── MOBILE NATIVE CARD LIST TRANSFORMATION FOR TABLE-CARD ── */
  .horo-theme .table-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    margin-bottom: 1.4rem !important;
  }

  .horo-theme .table-card.match-results-card {
    background: #FFFFFF !important;
    border: 1px solid var(--rule) !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
    padding: 0.95rem 1rem !important;
    margin-bottom: 1.25rem !important;
    overflow: hidden !important;
  }

  .horo-theme .table-card.match-results-card .table-card-header {
    background: transparent !important;
    border: none !important;
    padding: 0 0 0.5rem 0 !important;
    margin-bottom: 0.4rem !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
  }

  .horo-theme .match-row-item {
    padding: 0.6rem 0 !important;
    gap: 0.55rem !important;
  }

  .horo-theme .match-row-item.has-desc {
    padding: 0.65rem 0 !important;
    gap: 0.25rem !important;
  }

  .horo-theme .match-row-item:not(.has-desc) {
    align-items: center !important;
  }

  .horo-theme .match-row-header {
    gap: 0.4rem !important;
  }

  .horo-theme .match-row-name {
    font-size: 0.86rem !important;
  }

  .horo-theme .match-row-num {
    width: 1.35rem !important;
    font-size: 0.86rem !important;
  }

  .horo-theme .match-row-desc {
    font-size: 0.78rem !important;
    line-height: 1.4 !important;
  }

  .horo-theme .match-row-status {
    font-size: 0.8rem !important;
  }

  .horo-theme .table-card-header {
    background: transparent !important;
    border: none !important;
    padding: 0.25rem 0.25rem 0.65rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
  }

  .horo-theme .table-card-header h3 {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: var(--maroon) !important;
    margin: 0 !important;
  }

  .horo-theme .table-responsive {
    overflow: visible !important;
  }

  .horo-theme table.matrix-match,
  .horo-theme table.matrix-scroll {
    display: block !important;
    width: 100% !important;
    border: none !important;
  }

  .horo-theme table.matrix-match thead,
  .horo-theme table.matrix-scroll thead {
    display: none !important;
  }

  .horo-theme table.matrix-match tbody,
  .horo-theme table.matrix-scroll tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    width: 100% !important;
  }

  /* ── CARD FORMAT FOR 10 PORUTHAMS & MAJOR DOSHAM CHECKS ── */
  .horo-theme table.matrix-match tr {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.65rem !important;
    background: #ffffff !important;
    border: 1px solid #ebdcc8 !important;
    border-radius: 16px !important;
    padding: 0.95rem 1rem !important;
    box-shadow: 0 2px 8px rgba(90, 50, 20, 0.05) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
  }

  .horo-theme table.matrix-match tr:active {
    transform: scale(0.99) !important;
  }

  /* Number Badge */
  .horo-theme table.matrix-match td.col-num {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    background: #fdf2e4 !important;
    color: var(--maroon) !important;
    border-radius: 7px !important;
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    margin: 0.1rem 0 0 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(197, 71, 54, 0.15) !important;
    flex-shrink: 0 !important;
  }

  .horo-theme table.matrix-match td.col-info {
    display: block !important;
    flex: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
  }

  .horo-theme table.matrix-match .porutham-card-header {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }

  .horo-theme table.matrix-match .porutham-title-group {
    flex: 1 !important;
    min-width: 0 !important;
  }

  .horo-theme table.matrix-match .porutham-name {
    display: block !important;
    font-size: 0.93rem !important;
    font-weight: 700 !important;
    color: var(--maroon) !important;
    line-height: 1.35 !important;
    padding-right: 0 !important;
  }

  .horo-theme table.matrix-match div.porutham-sub:not(.mobile-only) {
    display: block !important;
    font-size: 0.74rem !important;
    color: var(--muted) !important;
    margin-top: 0.2rem !important;
    margin-bottom: 0.2rem !important;
    padding-right: 0 !important;
  }

  .horo-theme table.matrix-match .porutham-pill-mobile {
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    box-shadow: none !important;
  }

  .horo-theme table.matrix-match td.col-detail,
  .horo-theme table.matrix-match th.col-detail,
  .horo-theme table.matrix-match td.col-result.desktop-only,
  .horo-theme table.matrix-match th.col-result {
    display: none !important;
  }

  /* Legacy fallback if col-result is rendered without desktop-only */
  .horo-theme table.matrix-match td.col-result:not(.desktop-only) {
    display: none !important;
  }

  /* Mobile Explanation Text — Authentic Vedic Parchment Callout Chip */
  .horo-theme table.matrix-match .mobile-only.porutham-callout,
  .horo-theme table.matrix-match div.porutham-sub.porutham-callout,
  .horo-theme table.matrix-match .porutham-callout {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 0.55rem !important;
    font-size: 0.81rem !important;
    line-height: 1.45 !important;
    color: #4A3B32 !important;
    text-align: left !important;
    word-wrap: break-word !important;
    white-space: normal !important;
    background: #FAF6F0 !important;
    border-radius: 10px !important;
    border-left: 3.5px solid var(--saffron) !important;
    padding: 0.55rem 0.75rem !important;
    box-shadow: inset 0 0 0 1px rgba(230, 199, 156, 0.2) !important;
  }

  /* ── CARD FORMAT FOR SEVVAI DOSHAM TABLE ── */
  .horo-theme table.matrix-scroll tr {
    display: block !important;
    position: relative !important;
    background: #ffffff !important;
    border: 1px solid #ebdcc8 !important;
    border-radius: 16px !important;
    padding: 0.95rem 1rem !important;
    box-shadow: 0 2px 8px rgba(90, 50, 20, 0.05) !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .horo-theme table.matrix-scroll td {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.35rem 0 !important;
    border: none !important;
    font-size: 0.82rem !important;
    line-height: 1.4 !important;
    text-align: right !important;
  }

  /* Reference Header Row (Card Title) */
  .horo-theme table.matrix-scroll td:nth-child(1) {
    display: block !important;
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    color: var(--maroon) !important;
    border-bottom: 1px solid #f0e6d6 !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    padding-right: 80px !important;
    text-align: left !important;
  }

  /* Top-Right Status Pill */
  .horo-theme table.matrix-scroll td:nth-child(5) {
    position: absolute !important;
    top: 0.85rem !important;
    right: 0.85rem !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 !important;
    border: none !important;
    z-index: 2 !important;
  }
  .horo-theme table.matrix-scroll td:nth-child(5)::before {
    display: none !important;
  }

  /* Middle row labels */
  .horo-theme table.matrix-scroll td::before {
    font-weight: 700 !important;
    color: var(--muted) !important;
    font-size: 0.76rem !important;
    flex-shrink: 0 !important;
    margin-right: 0.75rem !important;
    text-align: left !important;
  }

  /* Exemption & Reason: Full-width row */
  .horo-theme table.matrix-scroll td:nth-child(4) {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    text-align: right !important;
    width: 100% !important;
  }

  .horo-theme table.matrix-scroll .exemption-note {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 0.45rem !important;
    padding: 0.6rem 0.85rem !important;
    background: #faf6f0 !important;
    border-radius: 8px !important;
    border-left: 3.5px solid var(--saffron) !important;
    font-size: 0.78rem !important;
    line-height: 1.45 !important;
    color: #44372c !important;
    text-align: left !important;
    word-wrap: break-word !important;
    white-space: normal !important;
  }

  /* English & Tamil pseudo labels for matrix-scroll */
  .horo-theme #matrix-body td:nth-child(2)::before { content: "House / ஸ்தானம்:"; }
  .horo-theme #matrix-body td:nth-child(3)::before { content: "Dosham? / தோஷமா?:"; }
  .horo-theme #matrix-body td:nth-child(4)::before { content: "Exemption / நிவர்த்தி:"; }
}

body.lang-ta .horo-theme #matrix-body td:nth-child(2)::before { content: "ஸ்தானம்:"; }
body.lang-ta .horo-theme #matrix-body td:nth-child(3)::before { content: "தோஷமா?:"; }
body.lang-ta .horo-theme #matrix-body td:nth-child(4)::before { content: "தோஷ நிவர்த்தி:"; }

/* COMPACT ACTION BUTTON: Open in Full Horoscope Tab */
.horo-theme .btn-link-full-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: linear-gradient(135deg, var(--maroon) 0%, #541111 100%);
  color: #fdf8f2;
  border: none;
  padding: 0.55rem 1.25rem;
  font-size: 0.86rem;
  font-family: var(--font-tamil);
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(115, 24, 24, 0.22);
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  margin: 0 auto;
}
.horo-theme .btn-link-full-tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(115, 24, 24, 0.32);
}
.horo-theme .btn-link-full-tab:active {
  transform: translateY(0);
}

/* STATUS PILLS */
.horo-theme .pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  font-family: var(--font-tamil);
  border: 1px solid transparent;
}
.horo-theme .pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.horo-theme .pill.good { background: var(--good-tint); color: var(--good); border-color: rgba(37, 111, 70, 0.22); }
.horo-theme .pill.good::before { background: var(--good); }
.horo-theme .pill.bad { background: var(--bad-tint); color: var(--bad); border-color: rgba(147, 29, 29, 0.22); }
.horo-theme .pill.bad::before { background: var(--bad); }
.horo-theme .pill.warn { background: var(--warn-tint); color: var(--warn); border-color: rgba(184, 105, 42, 0.22); }
.horo-theme .pill.warn::before { background: var(--warn); }
.horo-theme .pill.neutral { background: #f0ece4; color: #7a6e62; border-color: rgba(122, 110, 98, 0.2); }
.horo-theme .pill.neutral::before { background: #a39b8a; }

/* SCORE BANNER - App Theme */
.horo-theme .score-banner {
  border-radius: 16px;
  padding: 1.4rem 1.15rem;
  text-align: center;
  border: 1px solid var(--rule);
  background: #FFFFFF;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}
.horo-theme .score-banner.good {
  background: linear-gradient(180deg, #F0FDF4 0%, #FFFFFF 100%);
  border-color: rgba(34, 197, 94, 0.35);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.08);
}
.horo-theme .score-banner.warn {
  background: linear-gradient(180deg, #FFFBEB 0%, #FFFFFF 100%);
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.08);
}
.horo-theme .score-banner.bad {
  background: linear-gradient(180deg, #FEF2F2 0%, #FFFFFF 100%);
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.08);
}
.horo-theme .score-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin: 0 auto 0.75rem;
  position: relative;
  background: #FFFFFF;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.horo-theme .score-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3.5px solid var(--rule);
}
.horo-theme .score-banner.good .score-ring::before { border-color: #16A34A; }
.horo-theme .score-banner.warn .score-ring::before { border-color: #D97706; }
.horo-theme .score-banner.bad .score-ring::before { border-color: #DC2626; }

.horo-theme .score-number { font-family: var(--font-body); font-size: 1.85rem; font-weight: 800; line-height: 1; }
.horo-theme .score-of { font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.horo-theme .score-banner.good .score-number { color: #16A34A; }
.horo-theme .score-banner.warn .score-number { color: #D97706; }
.horo-theme .score-banner.bad .score-number { color: #DC2626; }
.horo-theme .score-verdict { font-family: var(--font-tamil); font-size: 1.15rem; font-weight: 700; margin: 0 0 0.35rem; }
.horo-theme .score-banner.good .score-verdict { color: #15803D; }
.horo-theme .score-banner.warn .score-verdict { color: #B45309; }
.horo-theme .score-banner.bad .score-verdict { color: #B91C1C; }
.horo-theme .score-detail { font-size: 0.84rem; color: #57534E; margin: 0; font-family: var(--font-tamil); line-height: 1.5; }

.horo-theme .score-couple-pill {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 0.85rem;
  background: #F5F5F4;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--ink);
  font-family: var(--font-tamil);
}

/* MATCH RESULTS ROWS - Plain Text & Mobile Friendly */
.horo-theme .match-results-card {
  background: #FFFFFF;
  border-radius: 16px;
  border: 1px solid var(--rule);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  margin-bottom: 1.25rem;
  padding: 1.1rem 1.15rem;
  overflow: hidden;
}

.horo-theme .match-rows-list {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.horo-theme .match-row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.horo-theme .match-row-item:last-child {
  border-bottom: none;
  padding-bottom: 0.25rem;
}

.horo-theme .match-row-item.has-desc {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  padding: 0.75rem 0.25rem;
}

.horo-theme .match-row-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  width: 100%;
}

.horo-theme .match-row-item.has-desc .match-row-name {
  flex: 1;
  min-width: 0;
  display: block;
}

.horo-theme .match-row-item:not(.has-desc) .match-row-name {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.horo-theme .match-row-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.35;
  margin: 0;
}

.horo-theme .match-row-num {
  flex-shrink: 0;
  width: 1.45rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--maroon);
  line-height: inherit;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}

.horo-theme .match-row-text {
  flex: 1;
  min-width: 0;
  line-height: inherit;
}

.horo-theme .match-row-desc {
  font-size: 0.8rem;
  color: #57534E;
  line-height: 1.45;
  margin: 0;
}

.horo-theme .match-row-status {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.84rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.horo-theme .match-row-status.status-good {
  color: #16A34A; /* clean emerald green */
}

.horo-theme .match-row-status.status-bad {
  color: #DC2626; /* clean red */
}

.horo-theme .match-row-status.status-info {
  color: #6B7280; /* muted grey */
  font-size: 0.78rem;
  font-weight: 600;
}

/* Footer disclaimer */
.horo-theme .horo-footer {
  margin-top: 1.5rem;
  padding: 1rem 0.5rem;
  text-align: center;
  background: transparent;
}

.horo-theme .horo-footer-text {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* MISCELLANEOUS */
.horo-theme .porutham-name { font-weight: 700; color: var(--maroon); font-size: 0.88rem; }
.horo-theme .porutham-sub { font-size: 0.76rem; color: var(--muted); margin-top: 0.15rem; line-height: 1.4; }
.horo-theme .exemption-note { font-size: 0.75rem; color: var(--good); margin-top: 0.2rem; font-weight: 600; }
.horo-theme .strategy-box {
  background: linear-gradient(135deg, var(--saffron-tint), #fff);
  border: 1.5px solid var(--saffron-lt);
  border-radius: var(--horo-radius);
  padding: 1.15rem 1.25rem;
  font-size: 0.88rem;
  color: var(--ink);
  margin-bottom: 1.25rem;
  font-family: var(--font-tamil);
  line-height: 1.55;
}
.horo-theme .strategy-box strong { color: var(--maroon); }

.horo-theme .sub-mode-tabs {
  display: flex;
  width: 100%;
  max-width: 480px;
  margin: 0 auto 1.25rem;
  background: #ede3d2;
  border-radius: 999px;
  padding: 0.25rem;
  gap: 0.2rem;
}
.horo-theme .sub-mode-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.5rem 0.4rem;
  border-radius: 999px;
  font-size: clamp(0.74rem, 2.4vw, 0.84rem);
  font-weight: 600;
  font-family: var(--font-tamil);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
}
.horo-theme .sub-mode-tab.active { background: var(--maroon); color: #fdf8f2; font-weight: 700; }
.horo-theme .sub-mode-tab:hover:not(.active) { background: rgba(115, 24, 24, 0.08); }

.horo-theme footer {
  text-align: center;
  padding: 2rem 1.25rem;
  font-size: 0.78rem;
  color: #847264;
  border-top: 1px solid var(--rule);
  background: var(--saffron-tint);
  font-family: var(--font-tamil);
  line-height: 1.6;
}
.horo-theme .na-note { color: #847264; font-style: italic; font-size: 0.82rem; }
.horo-theme .person-label-bride { color: #8b3a3a; }
.horo-theme .person-label-groom { color: #2f5233; }

@keyframes horoFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.horo-theme #results,
.horo-theme #match-results { animation: horoFadeUp 0.35s ease; }

/* ============================================================
   WIZARD STEP 6 — JATHAGAM SECTION
============================================================ */
.jathagam-section {
  border: 1.5px solid #e8d5c0;
  border-radius: 14px;
  padding: 1.25rem;
  background: #fffdf9;
  margin-top: 1.25rem;
}
.jathagam-section > label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  color: #3a1f0f;
  margin-bottom: 0.35rem;
}
.jathagam-section .recommended-tag {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #E05A47;
  color: #fff;
  padding: 0.18rem 0.55rem;
  border-radius: 20px;
}
.jathagam-section .field-hint {
  font-size: 0.82rem;
  color: #6b5c50;
  margin-bottom: 1rem;
}
.jathagam-mode-toggle {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}
@media (max-width: 520px) {
  .jathagam-mode-toggle {
    flex-direction: column;
    gap: 0.5rem;
  }
}
.jmode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid #d4c5b6;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.jmode-btn span:first-child { font-size: 1.4rem; flex-shrink: 0; }
.jmode-btn strong { display: block; font-size: 0.85rem; color: #3a1f0f; }
.jmode-btn small { display: block; font-size: 0.72rem; color: #6b5c50; line-height: 1.35; }
.jmode-btn.active {
  border-color: #c8892e;
  background: #fdf6ea;
  box-shadow: 0 0 0 2px #c8892e33;
}
.jmode-btn.active strong { color: #7a4a00; }
#jathagam-detailed-fields label,
#jathagam-simple-fields label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: #4a3020;
  margin: 0.75rem 0 0.3rem;
}
#jathagam-detailed-fields input,
#jathagam-detailed-fields select,
#jathagam-simple-fields select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid #d4c5b6;
  border-radius: 10px;
  font-size: 0.88rem;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
#jathagam-detailed-fields input:focus,
#jathagam-detailed-fields select:focus,
#jathagam-simple-fields select:focus {
  border-color: #c8892e;
}
.form-row-2 { display: flex; gap: 0.75rem; }
.form-col { flex: 1; }
.coord-row { display: flex; gap: 0.5rem; }
.coord-row input { flex: 1; }
.jathagam-section .hint {
  font-size: 0.75rem;
  color: #8b7a6a;
  margin-top: 0.35rem;
}

/* ============================================================
   HOROSCOPE COMPATIBILITY CTA CARD (Profile Detail View)
============================================================ */
.horo-compat-cta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
  background: linear-gradient(135deg, rgba(200, 137, 46, 0.08) 0%, rgba(224, 90, 71, 0.08) 100%);
  border: 1px dashed rgba(200, 137, 46, 0.45);
  border-radius: var(--radius-lg, 16px);
  transition: var(--transition, all 0.25s ease);
}

.horo-compat-cta:hover {
  border-color: #c8892e;
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(200, 137, 46, 0.12) 0%, rgba(224, 90, 71, 0.12) 100%);
}

.horo-compat-cta-icon {
  font-size: 2rem;
  flex-shrink: 0;
  line-height: 1;
}

.horo-compat-cta-text {
  flex: 1;
  min-width: 0;
}

.horo-compat-cta-text h4 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  font-weight: 700;
  background: linear-gradient(135deg, #b8771b 0%, #E05A47 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.horo-compat-cta-text p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-sub, #44403C);
  line-height: 1.4;
}

.horo-compat-cta-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-horo-compat {
  background: linear-gradient(135deg, #d9822b 0%, #c0392b 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm, 8px);
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(217, 130, 43, 0.25);
  transition: var(--transition, all 0.25s ease);
  white-space: nowrap;
}

.btn-horo-compat:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 130, 43, 0.35);
}

.btn-horo-jathagam {
  background: #ffffff;
  color: #b8771b;
  border: 1.5px solid #d9822b;
  border-radius: var(--radius-sm, 8px);
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition, all 0.25s ease);
  white-space: nowrap;
}

.btn-horo-jathagam:hover {
  background: #fdf3e7;
  color: #8f5407;
}

/* ============================================================
   HOROSCOPE MODAL (RESPONSIVE FOR LAPTOP & MOBILE)
============================================================ */
#modal-horoscope {
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.horo-modal-card {
  background: #fff;
  border-radius: 16px;
  max-height: 88vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  max-width: 820px;
  margin: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.22);
  animation: modalScaleIn 0.25s ease-out;
}
@keyframes modalScaleIn {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Mobile bottom sheet view (< 768px) */
@media (max-width: 767px) {
  #modal-horoscope {
    padding: 0;
    align-items: flex-end;
  }
  .horo-modal-card {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
    margin: 0;
    animation: slideUpModal 0.28s ease-out;
  }
  @keyframes slideUpModal {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
}
.horo-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid #f0e8d8;
}
.horo-modal-header-info { display: flex; align-items: center; gap: 0.75rem; }
.horo-modal-icon { font-size: 1.8rem; }
.horo-modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #2a1505;
}
.horo-modal-subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: #7a5c20;
}
.horo-modal-tabs {
  display: flex;
  border-bottom: 1.5px solid #f0e8d8;
  background: #fffdf9;
  padding: 0 1.25rem;
  gap: 0;
}
.horo-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 0.75rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #8b7a6a;
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.horo-tab.active {
  color: #c8892e;
  border-bottom-color: #c8892e;
}
.horo-tab-panel {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1rem 2rem;
}
.horo-modal-note {
  font-size: 0.78rem;
  color: #7a5c20;
  background: #fdf8ee;
  border-left: 3px solid #e8c97c;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  margin: 0.5rem 0 1rem;
}
.horo-no-astro-prompt {
  text-align: center;
  padding: 2rem 1rem;
  color: #5a3500;
}
.horo-no-astro-prompt h4 { margin: 0.5rem 0; font-size: 1rem; }
.horo-no-astro-prompt p { font-size: 0.85rem; color: #7a5c20; margin: 0.5rem 0 1.25rem; }

/* ============================================================
   WIZARD — Calculate Button & Jathagam Preview Card
============================================================ */
.btn-calc-jathagam {
  width: 100%;
  margin-top: 1rem;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, #c8892e, #a06a18);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: opacity 0.2s, transform 0.1s;
}
.btn-calc-jathagam:hover { opacity: 0.92; transform: translateY(-1px); }
.btn-calc-jathagam:active { transform: translateY(0); }

.wiz-jathagam-preview {
  margin-top: 1rem;
  background: linear-gradient(135deg, #fffdf6, #fdf5e2);
  border: 1.5px solid #e8c97c;
  border-radius: 12px;
  padding: 1rem 1.1rem 0.85rem;
  animation: horoFadeUp 0.3s ease;
}
.wiz-jathagam-preview h4 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #5a3500;
}
.wiz-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.wiz-preview-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.wiz-preview-label {
  font-size: 0.72rem;
  color: #8b6a30;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wiz-preview-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: #3a1f0f;
  font-family: 'Noto Serif Tamil', serif;
}

/* Pill badges usable outside #subview-horoscope (e.g. wizard preview) */
.pill.good { background: #eaf5ef; color: #256f46; border: 1px solid #a8dbbf; }
.pill.warn { background: #fef4ea; color: #b8692a; border: 1px solid #f5c98a; }
.pill.bad  { background: #fdf0ef; color: #931d1d; border: 1px solid #f5b8b8; }
.pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ============================================================
   TAMIL OPTICAL TYPOGRAPHY CALIBRATION FOR HOROSCOPE
   Scales down Tamil text (~18%) so it optically matches English
   and prevents table column bursting, kattam overflow, and oversized text
============================================================ */
body.lang-ta .horo-theme .score-verdict {
  font-size: 0.98rem;
  line-height: 1.3;
}

body.lang-ta .horo-theme .score-detail {
  font-size: 0.78rem;
  line-height: 1.45;
}

body.lang-ta .horo-theme table.matrix-match .porutham-name {
  font-size: 0.78rem;
  line-height: 1.3;
}

body.lang-ta .horo-theme table.matrix-match .porutham-sub {
  font-size: 0.68rem;
  line-height: 1.35;
}

body.lang-ta .horo-theme table.matrix-match th,
body.lang-ta .horo-theme table.matrix-match td {
  font-size: 0.74rem;
}

body.lang-ta .horo-theme table.matrix-scroll th,
body.lang-ta .horo-theme table.matrix-scroll td {
  font-size: 0.70rem;
  padding: 0.45rem 0.35rem;
}

body.lang-ta .horo-modal-title {
  font-size: 0.98rem;
}

body.lang-ta .horo-modal-subtitle {
  font-size: 0.72rem;
}

body.lang-ta .horo-tab {
  font-size: 0.76rem;
}

body.lang-ta .horo-compat-cta-text h4 {
  font-size: 0.92rem;
}

body.lang-ta .horo-compat-cta-text p {
  font-size: 0.76rem;
}

body.lang-ta .btn-horo-compat,
body.lang-ta .btn-horo-jathagam {
  font-size: 0.74rem;
}

body.lang-ta .wiz-jathagam-preview h4 {
  font-size: 0.82rem;
}

body.lang-ta .wiz-preview-item {
  font-size: 0.74rem;
}

body.lang-ta .pill {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
}

body.lang-ta .horo-theme .sub-mode-tab {
  font-size: 0.68rem;
  line-height: 1.25;
}

body.lang-ta .horo-theme .table-card-header h3 {
  font-size: 0.82rem;
}

body.lang-ta #subview-horoscope input,
body.lang-ta #subview-horoscope select {
  font-size: 0.82rem;
}

/* Horoscope Detail Card in Profile View */
.horoscope-detail-card {
  border-left: 4px solid #d9822b;
  position: relative;
  overflow: hidden;
}

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

.horo-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(217, 130, 43, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.horo-card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted, #718096);
  margin-top: 0.15rem;
}

.horo-card-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color, #e2e8f0);
}

@media (max-width: 480px) {
  .horo-card-actions {
    flex-direction: column;
  }
  .horo-card-actions .btn {
    width: 100%;
    text-align: center;
  }
}



