:root {
  --bordeaux: #6B1F3A;
  --burgundy: #7A1F3D;
  --gold: #C59D28;
  --emerald: #1E6A4E;
  --red: #B33939;
  --charcoal: #333333;
  --line: #e3dde0;
  --bg: #f4f2f3;
  --sidebar-bg: #3d1225;
  --sidebar-hover: #55192f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--charcoal);
  background: var(--bg);
  line-height: 1.5;
}

/* =====================================================================
   APP SHELL (dashboard / kp / uranian pages)
   ===================================================================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 210px; flex: 0 0 210px;
  background: var(--sidebar-bg);
  color: #f2e6ec;
  display: flex; flex-direction: column;
  padding: 18px 0;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  font-weight: 700; font-size: 1.05rem; color: #fff;
  padding: 0 20px 16px; letter-spacing: .3px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  margin-bottom: 10px;
}
.nav { display: flex; flex-direction: column; flex: 1; }
.nav a {
  color: #e9d3dc; text-decoration: none; font-size: .92rem;
  padding: 11px 20px; border-left: 3px solid transparent;
}
.nav a:hover { background: var(--sidebar-hover); }
.nav a.active {
  background: var(--sidebar-hover); border-left-color: var(--gold);
  color: #fff; font-weight: 600;
}
.nav-divider {
  margin: 14px 20px 4px; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .5px; color: rgba(242,230,236,.45);
}
.nav-disabled {
  padding: 9px 20px; font-size: .88rem; color: rgba(242,230,236,.35);
  cursor: default; user-select: none;
}
.nav-newchart {
  margin: 14px 20px 0; text-align: center;
  background: var(--gold); color: #3d1225; text-decoration: none;
  padding: 9px 0; border-radius: 6px; font-weight: 700; font-size: .88rem;
}
.nav-newchart:hover { background: #d9b143; }

.content { flex: 1; padding: 24px 32px 40px; min-width: 0; }
.content-head { margin-bottom: 18px; }
.content-head h1 { margin: 0; color: var(--bordeaux); font-size: 1.5rem; }
.content-head p { margin: 4px 0 0; color: #8a7178; font-size: .88rem; }

/* Dashboard: chart + dasha side by side, filling the full width */
.dash-grid {
  display: flex; gap: 22px; align-items: stretch; flex-wrap: wrap;
}
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 22px; box-shadow: 0 1px 4px rgba(107,31,58,.06);
}
.panel h2 {
  color: var(--burgundy); margin: 0 0 12px; font-size: 1.05rem;
  border-bottom: 2px solid var(--gold); padding-bottom: 6px;
}
.chart-panel { flex: 1 1 480px; display: flex; flex-direction: column; }
.chart-holder { display: flex; justify-content: center; align-items: center; flex: 1; }
.chart-svg { width: 100%; max-width: 560px; height: auto; }

/* Rotate-to-Lagna: clickable houses + the active-Lagna readout */
.chart-hit { pointer-events: none; }
[data-rotatable] .chart-hit,
#kpChartCard .chart-hit { pointer-events: all; cursor: pointer; transition: fill .12s; }
[data-rotatable] .chart-hit:hover,
#kpChartCard .chart-hit:hover { fill: rgba(197, 157, 40, .14); }
.chart-rot-cap { display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 8px; font-size: .82rem; color: var(--bordeaux); flex-wrap: wrap; }
.chart-rot-cap b { color: #111; }
.crc-reset { border: 1px solid var(--gold); background: #fffdf5; color: var(--bordeaux);
  border-radius: 20px; padding: 2px 12px; font-size: .76rem; font-weight: 700; cursor: pointer; }
.crc-reset:hover { background: #fbf3da; }

/* Tajik / Varshphal */
.tj-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tj-nav { color: var(--bordeaux); font-weight: 700; text-decoration: none; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 20px; padding: 6px 16px; }
.tj-nav:hover { background: #faf3f6; border-color: var(--gold); }
.tj-year { text-align: center; }
.tj-y-main { font-size: 1.25rem; font-weight: 800; color: #2b2b2b; }
.tj-y-sub { font-size: .8rem; color: #8a7f83; margin-top: 2px; }
.tj-jump { text-align: center; margin: 8px 0 0; font-size: .82rem; }
.tj-jump a { color: var(--gold); font-weight: 700; text-decoration: none; }
.tj-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.tj-info { display: flex; flex-direction: column; gap: 3px; }
.tj-i-lab { font-size: .8rem; font-weight: 700; color: var(--bordeaux); }
.tj-i-val { font-size: 1.05rem; font-weight: 800; color: #2b2b2b; }
.tj-i-note { font-size: .76rem; color: #8a7f83; }
.tj-adh { display: flex; flex-wrap: wrap; gap: 10px; }
.tj-adh-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 14px;
  background: #faf6f8; border: 1px solid var(--line); border-radius: 10px; min-width: 150px; }
.tj-adh-role { font-size: .74rem; color: #8a7f83; }
.tj-adh-pl { font-size: 1rem; font-weight: 800; color: var(--bordeaux); }
.tj-note { font-size: .8rem; color: #8a7f83; margin: 12px 0 0; line-height: 1.5; }
.tj-varshesh { background: #fffaf0; border-color: var(--gold); }
.tj-varshesh .tj-i-val { color: #b8860b; }
tr.tj-win { background: #fffaf0; }
tr.tj-win td { font-weight: 700; }
.pv-cls { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: .72rem; font-weight: 700; }
.pv-powerful { background: #e2f3ea; color: #127a4f; }
.pv-ordinary { background: #f3edf0; color: #8a7f83; }
.pv-weak { background: #fbe7ea; color: #c0392b; }

/* Numerology */
.num-form { display: flex; flex-direction: column; gap: 10px; }
.num-lab { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; font-weight: 700; color: var(--bordeaux); }
.num-lab input, .num-lab select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; font-weight: 400; }
.num-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.num-btn { padding: 9px 22px; background: var(--bordeaux); color: #fff; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; }
.num-btn:hover { background: #5e1730; }
.num-live { font-size: .82rem; font-weight: 400; color: var(--emerald); min-height: 1em; }
.num-note { font-size: .78rem; color: #8a7f83; margin: 2px 0 0; }
.num-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.num-card { background: #faf6f8; border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; }
.nc-lab { font-size: .78rem; font-weight: 700; color: var(--bordeaux); }
.nc-big { font-size: 2.6rem; font-weight: 800; color: #2b2b2b; line-height: 1.1; margin: 4px 0; }
.nc-sub { font-size: .82rem; color: #8a7f83; }
.num-break { font-size: .86rem; margin: 12px 0 0; }
.num-break .nw { white-space: nowrap; }
.loshu-card { display: flex; flex-direction: column; align-items: center; }
.loshu { border-collapse: collapse; margin: 0 auto; }
.loshu td { width: 72px; height: 72px; border: 2px solid var(--gold); text-align: center; vertical-align: middle; font-size: 1.1rem; font-weight: 700; }
.loshu .ls-has { background: #fffaf0; color: var(--bordeaux); }
.loshu .ls-empty { background: #f6f2f4; }
.loshu .ls-nums { letter-spacing: 1px; }
.loshu .ls-dash { color: #d8cdd3; font-weight: 400; }
.num-missing { display: flex; flex-wrap: wrap; gap: 8px; }
.num-missing .miss { display: inline-block; width: 34px; height: 34px; line-height: 34px; text-align: center;
  background: #fbe7ea; color: #c0392b; border-radius: 8px; font-weight: 800; }
.num-arrows { display: flex; flex-direction: column; gap: 8px; }
.arrow { display: grid; grid-template-columns: 180px 1fr; gap: 10px; padding: 8px 12px; background: #faf6f8;
  border: 1px solid var(--line); border-radius: 8px; font-size: .86rem; }
.arrow-name { font-weight: 800; color: var(--bordeaux); }
.arrow-mean { color: #4a4247; }

/* Ayanamsa toggle in the content header */
.content-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ayan-toggle { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.ayan-lbl { font-size: .72rem; color: #8a7f83; font-weight: 700; margin-right: 2px; }
.ayan-btn { border: 1px solid var(--line); background: #fff; color: #8a7f83; cursor: pointer;
  padding: 4px 12px; border-radius: 20px; font-size: .78rem; font-weight: 700; }
.ayan-btn:hover { border-color: var(--gold); }
.ayan-btn.on { background: var(--bordeaux); color: #fff; border-color: var(--bordeaux); }

/* Login + admin (multi-user) */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 360px; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 30px 26px; box-shadow: 0 8px 30px rgba(61,18,37,.08); }
.login-brand { font-size: 1.7rem; font-weight: 800; color: var(--bordeaux); margin: 0; text-align: center; }
.login-brand span { color: var(--gold); }
.login-sub { text-align: center; color: #8a7f83; font-size: .78rem; margin: 4px 0 18px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; font-weight: 700; color: var(--bordeaux); }
.login-form input { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; }
.login-form button { padding: 10px; background: var(--bordeaux); color: #fff; border: none;
  border-radius: 8px; font-weight: 700; font-size: .95rem; cursor: pointer; margin-top: 4px; }
.login-form button:hover { background: #5e1730; }
.nav-user { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.15);
  display: flex; flex-direction: column; gap: 4px; font-size: .82rem; }
.nav-user .nu-name { color: #f3dbe4; font-weight: 700; }
.nav-user a { color: #e8c9d4; text-decoration: none; }
.nav-user a:hover { color: #fff; text-decoration: underline; }
.admin-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.admin-form input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: .9rem; }
.admin-form button, .pw-form button { padding: 8px 16px; background: var(--bordeaux); color: #fff;
  border: none; border-radius: 8px; font-weight: 700; cursor: pointer; }
.pw-form { display: inline-flex; gap: 6px; margin-left: 6px; }
.pw-form input { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; }
.btn-del { padding: 4px 12px; background: #c0392b; color: #fff; border: none; border-radius: 20px;
  font-size: .76rem; font-weight: 700; cursor: pointer; }
.alert.ok { background: #e2f3ea; color: #127a4f; border-color: #bfe0cd; }
.tj-asp { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: .74rem; font-weight: 700; }
.tj-asp.itha { background: #e6f4ec; color: var(--emerald); }
.tj-asp.ishra { background: #f3edf0; color: #8a7f83; }

/* Ashtakavarga */
.av-intro { display: flex; flex-direction: column; }
.av-ul { margin: 8px 0 0; padding-left: 18px; font-size: .86rem; line-height: 1.6; color: #4a4247; }
.av-ul li { margin-bottom: 4px; }
.av-note { font-size: .78rem; color: #8a7f83; margin: 10px 0 0; line-height: 1.5; }
.av-matrix th, .av-matrix td { text-align: center; }
.av-matrix th.av-lag { background: var(--gold); color: #fff; }
.av-cell.hi { background: #e2f3ea; color: #127a4f; font-weight: 700; }
.av-cell.lo { background: #fbe7ea; color: #c0392b; }
tr.av-sav td { border-top: 2px solid var(--gold); background: #fbf6ee; }
.av-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.av-mini { text-align: center; }
.av-mini-h { font-size: .95rem; font-weight: 800; color: var(--bordeaux); margin: 0 0 6px; }

/* Sade Sati */
.ss-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--line); }
.ss-head.ss-on { background: #fdecef; border-color: #f0b8c4; }
.ss-head.ss-dha { background: #fff7ed; border-color: #f0d9b8; }
.ss-head.ss-off { background: #e9f5ee; border-color: #bfe0cd; }
.ss-big { font-size: 1.1rem; font-weight: 800; color: #2b2b2b; }
.ss-sub { display: block; font-size: .82rem; color: #8a5a12; font-weight: 700; margin-top: 2px; }
.ss-meta { display: flex; flex-direction: column; gap: 2px; font-size: .84rem; color: #4a4247; text-align: right; }
.ss-timeline-wrap { margin-top: 14px; }
.ss-tl-title { font-size: .88rem; margin-bottom: 8px; }
tr.ss-now td { background: #fdecef; font-weight: 700; }
.meta { text-align: center; font-size: .88rem; margin: 10px 0 0; }
.panchang-strip {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0 0;
}
.ps-item {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: #fbf3f6; border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px; min-width: 84px;
}
.ps-l { font-size: .68rem; color: #8a7f83; text-transform: uppercase; letter-spacing: .4px; }
.ps-v { font-size: .84rem; font-weight: 700; color: var(--bordeaux); text-align: center; }
.legend {
  display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: center;
  margin-top: 12px; font-size: .78rem; color: #6b5860;
}
.legend span { display: flex; align-items: center; gap: 4px; }
.tri-up, .tri-down { width: 0; height: 0; display: inline-block; }
.tri-up { border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid var(--emerald); }
.tri-down { border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 8px solid var(--red); }

/* Dasha widget */
.dasha-panel { flex: 1 1 520px; min-width: 320px; display: flex; flex-direction: column; }
.dasha-now {
  background: #fbf3f6; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 16px; margin-bottom: 14px;
}
.now-row { display: flex; justify-content: space-between; font-size: .95rem; padding: 3px 0; }
.now-row .now-label { color: #7c6169; }
.now-row.small { justify-content: flex-end; font-size: .78rem; color: #9c8790; }
/* Dasha drill-down widget (Mahadasha -> Antardasha -> ... -> Prana) */
.dasha-drill { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.drill-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px; margin-bottom: 6px;
}
.crumbs { display: flex; align-items: center; flex-wrap: wrap; font-size: .86rem; }
.crumb {
  cursor: pointer; font-weight: 700; padding: 2px 4px; border-radius: 4px;
  color: var(--burgundy);
}
.crumb:hover { background: #f6eef1; text-decoration: underline; }
.crumb-sep { color: #c3b3ba; margin: 0 2px; }
.drill-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.drill-actions button {
  background: #f6eef1; color: var(--burgundy); border: 1px solid var(--line);
  border-radius: 5px; padding: 4px 9px; font-size: .8rem; font-weight: 700;
  cursor: pointer; width: auto; margin: 0;
}
.drill-actions button:hover:not(:disabled) { background: var(--burgundy); color: #fff; }
.drill-actions button:disabled { opacity: .4; cursor: default; }
.drill-actions button.now-btn { background: var(--gold); color: #3d1225; border-color: var(--gold); }
.drill-actions button.now-btn:hover { background: #d9b143; }
.drill-level-label {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .4px;
  color: #9c8790; margin: 4px 0 6px;
}
.drill-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.drill-table td { padding: 5px 7px; border-bottom: 1px solid #f2ecee; }
.drill-table td:first-child { width: 24px; }
.drill-table td:nth-child(2) { font-weight: 700; white-space: nowrap; }
.drill-table tr.drillable { cursor: pointer; }
.drill-table tr.drillable:hover td { background: #faf5f7; }
.drill-table tr.now td { background: #fdf2e9; }

/* Sections (KP / Uranian pages) */
.block { margin: 0 0 28px; }
.block h2 {
  color: var(--burgundy); margin: 0 0 14px; font-size: 1.1rem;
  border-bottom: 2px solid var(--gold); padding-bottom: 6px;
}
.block h2 .thin { font-weight: 400; font-size: .82rem; color: #9c8790; }

.tablescroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .86rem; background: #fff; }
th, td { padding: 7px 9px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: #f6eef1; color: var(--bordeaux); font-weight: 600; white-space: nowrap; }
td.num { text-align: center; }
td.sub { font-weight: 700; color: var(--bordeaux); }
td.pic { font-family: "Consolas", monospace; font-weight: 700; }
table.mini { max-width: 480px; }
table.mini td:first-child { color: #6b5860; width: 58%; }
.tag-good { background: var(--emerald); color: #fff; font-size: .7rem; padding: 1px 6px; border-radius: 8px; margin-left: 4px; }
.tag-bad { background: var(--red); color: #fff; font-size: .7rem; padding: 1px 6px; border-radius: 8px; margin-left: 4px; }

.script { border-left: 4px solid #ccc; padding: 8px 14px; margin: 10px 0; background: #fbfafa; border-radius: 0 6px 6px 0; }
.script p { margin: 6px 0 0; font-size: .9rem; }
.script-head { font-weight: 700; color: var(--charcoal); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.script-head .sl { font-weight: 400; font-size: .82rem; color: #7c7175; }
.badge { font-size: .72rem; padding: 2px 8px; border-radius: 10px; color: #fff; background: #999; }
.v-favourable { border-left-color: var(--emerald); }
.v-favourable .badge { background: var(--emerald); }
.v-challenged { border-left-color: var(--red); }
.v-challenged .badge { background: var(--red); }
.v-mixed { border-left-color: var(--gold); }
.v-mixed .badge { background: var(--gold); }
.v-neutral .badge { background: #999; }
.note { font-size: .86rem; color: #8a7f83; }

/* ===================== KP Analysis page (premium report) ===================== */
.rpt-section { margin: 0 0 30px; }
.rpt-h {
  color: var(--bordeaux); font-size: 1.15rem; margin: 0 0 12px;
  font-weight: 700; letter-spacing: .2px;
  display: flex; align-items: center; gap: 10px;
}
.rpt-h::before { content: ""; width: 5px; height: 20px; background: var(--gold); border-radius: 3px; }
.rpt-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; box-shadow: 0 2px 10px rgba(107,31,58,.06);
}
.chart-card .chart-holder { justify-content: center; align-items: center; }
.rpt-empty { color: #9c8790; font-size: .9rem; margin: 4px 0; }

/* Two charts side by side, equal width & height */
.chart-row { display: flex; gap: 20px; align-items: stretch; }
.chart-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.chart-col .chart-title {
  text-align: center; color: var(--burgundy); font-size: 1rem; margin: 0 0 12px;
  border-bottom: 2px solid var(--gold); padding-bottom: 6px;
}
.chart-col .chart-holder { flex: 1; display: flex; justify-content: center; align-items: center; }
@media (max-width: 760px) { .chart-row { flex-direction: column; } }

.rpt-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
.rpt-table.narrow { max-width: 520px; }
.rpt-table th {
  background: #f3e7ec; color: var(--bordeaux); font-weight: 700;
  text-align: left; padding: 11px 14px; white-space: nowrap; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .4px; border-bottom: 2px solid var(--gold);
}
.rpt-table th:first-child { border-top-left-radius: 10px; }
.rpt-table th:last-child { border-top-right-radius: 10px; }
.rpt-table td { padding: 11px 14px; border-bottom: 1px solid #efe6ea; vertical-align: top; }
.rpt-table tbody tr:nth-child(even) { background: #faf6f8; }
.rpt-table tbody tr:hover { background: #f6eef1; }
.rpt-table tbody tr:last-child td { border-bottom: none; }
.rpt-table .num { text-align: center; }
.rpt-table .strong { font-weight: 800; color: var(--bordeaux); font-size: 1.05rem; }
.rpt-table .pl-cell { font-weight: 700; }
.rpt-table .hs-cell { font-weight: 700; color: var(--bordeaux); letter-spacing: .3px; }
.rpt-table .reason { color: #9c8790; font-size: .8rem; }

/* KP Significator table: centered, stacked cells (name over houses) */
.sig-table th { text-align: center; text-transform: none; letter-spacing: 0; padding: 9px 14px; }
.sig-table th .th-main { display: block; font-weight: 800; font-size: .92rem; }
.sig-table th .th-sub { display: block; font-weight: 500; font-size: .68rem; color: #a58a95; margin-top: 2px; text-transform: uppercase; letter-spacing: .5px; }
.sig-table td { text-align: center; }
.sig-table .kc-pl { font-weight: 700; color: #2b2b2b; font-size: .95rem; }
.sig-table .kc-hs { color: var(--bordeaux); font-weight: 700; font-size: .8rem; margin-top: 1px; }
.sig-table .cnum { text-align: center; color: var(--bordeaux); font-weight: 700; font-size: .9rem; }

/* ===================== ASPECT & HITS ===================== */
.asp-filters { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.fgroup { display: inline-flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; box-shadow: 0 1px 3px rgba(107,31,58,.05); }
.fbtn { width: auto; margin: 0; background: transparent; color: #6b5860; border: none; padding: 6px 12px; font-size: .82rem; font-weight: 600; border-radius: 7px; cursor: pointer; }
.fbtn:hover { background: #f6eef1; }
.fbtn.active { background: var(--bordeaux); color: #fff; }

.rpt-table.matrix { font-size: .82rem; }
.rpt-table.matrix th.corner { background: #f3e7ec; }
.rpt-table.matrix thead th, .rpt-table.matrix th.rowh {
  background: #f3e7ec; color: var(--bordeaux); font-weight: 700; text-align: center;
  position: sticky; z-index: 3;
}
.rpt-table.matrix thead th { top: 0; }
.rpt-table.matrix th.rowh { left: 0; z-index: 4; }
.rpt-table.matrix td { text-align: center; padding: 6px 8px; border: 1px solid #efe6ea; white-space: nowrap; }
.rpt-table.matrix td.blank { background: #fcfafb; }
.hit { cursor: pointer; transition: background .1s; }
.hit .act { color: #a99ba1; font-weight: 400; font-size: .76rem; }   /* actual angle -- light */
.hit .exa { font-weight: 800; margin-left: 2px; }                    /* bracket aspect -- bold */
.hit.type-major .exa { color: var(--emerald); }
.hit.type-minor .exa { color: #7a3fa0; }
.hit .exa.hard { color: var(--red); }                               /* 90 & 180 -- red */
.hit.type-major { background: #eef7f0; }
.hit.type-minor { background: #f5f0f8; }
.hit:hover { background: var(--gold); }
.hit:hover .act { color: #6b4a54; }
.hit:hover .exa { color: #2a0d18; }
.hit:hover .exa.hard { color: #a01020; }
.hit.dim { background: #fcfafb !important; }
.hit.dim .act, .hit.dim .exa { visibility: hidden; }

.asp-modal { display: none; position: fixed; inset: 0; background: rgba(30,10,20,.55); z-index: 100; align-items: center; justify-content: center; padding: 20px; }
.asp-modal.open { display: flex; }
.asp-modal-box { background: #fff; border-radius: 14px; padding: 22px 24px; max-width: 420px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.4); position: relative; }
.asp-modal-box h3 { color: var(--bordeaux); margin: 0 0 14px; font-size: 1.15rem; border-bottom: 2px solid var(--gold); padding-bottom: 8px; }
.asp-close { position: absolute; right: 14px; top: 12px; width: auto; margin: 0; background: none; border: none; font-size: 1.6rem; color: #b08a97; cursor: pointer; padding: 0; }
.asp-close:hover { color: var(--red); }
.am-table { width: 100%; border-collapse: collapse; }
.am-table td { padding: 8px 6px; border-bottom: 1px solid #f2ecee; font-size: .9rem; }
.am-table td:first-child { color: #8a7f83; width: 48%; }
.am-table td:last-child { font-weight: 700; color: #2b2b2b; }
.am-table .ok { color: var(--emerald); }
.am-table .bad { color: var(--red); }

/* ===================== SHODASHVARGA ===================== */
.varga-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.varga-card {
  display: flex; flex-direction: column; gap: 2px; text-decoration: none;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; box-shadow: 0 1px 3px rgba(107,31,58,.05);
  transition: transform .08s, box-shadow .08s, border-color .08s;
}
.varga-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(107,31,58,.14); border-color: var(--gold); }
.varga-card.active { background: #6b1f3a; border-color: #6b1f3a; box-shadow: 0 4px 14px rgba(107,31,58,.3); }
.vc-n { font-weight: 800; color: var(--bordeaux); font-size: 1.05rem; }
.vc-sans { font-weight: 600; color: #2b2b2b; font-size: .82rem; }
.vc-area { font-size: .72rem; color: #8a7f83; }
.varga-card.active .vc-n { color: var(--gold); }
.varga-card.active .vc-sans { color: #fff; }
.varga-card.active .vc-area { color: #e7c9d3; }

.rpt-h .thin { font-weight: 400; font-size: .82rem; color: #9c8790; }
.rpt-table.stick thead th { position: sticky; top: 0; z-index: 2; }
.rpt-table.compact td { padding: 6px 10px; font-size: .86rem; }
.rpt-table .muted { color: #8a7f83; }
.rpt-table .small { font-size: .78rem; }
.rpt-table tr.changed { background: #fdf3e8; }
.rpt-table .yes { color: var(--gold); font-weight: 700; }
.rpt-table .no { color: #b7a7ae; }
.vg-tag { background: var(--emerald); color: #fff; font-size: .64rem; font-weight: 700; padding: 1px 5px; border-radius: 6px; vertical-align: middle; }

/* dignity badges */
.dig { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.dig-exalted { background: #e7f5ec; color: #127a4f; }
.dig-mooltrikona { background: #e7f5ec; color: #127a4f; }
.dig-own-sign { background: #eef4ff; color: #1565c0; }
.dig-great-friend { background: #eef7ee; color: #2e7d32; }
.dig-friend { background: #f4f9f4; color: #4a8a4a; }
.dig-neutral { background: #f2ecee; color: #7c7175; }
.dig-enemy { background: #fbeef0; color: #c04a5a; }
.dig-great-enemy { background: #fbe6e9; color: #b3283c; }
.dig-debilitated { background: #fbe6e9; color: #c62828; }

.stars { color: var(--gold); letter-spacing: 1px; }
.stars .star-off { color: #e2d3d9; }

.analysis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.an-h { color: var(--burgundy); font-size: .92rem; margin: 0 0 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.obs-list { display: flex; flex-direction: column; gap: 7px; }
.obs { display: flex; gap: 10px; font-size: .86rem; }
.obs-tag { flex: 0 0 auto; min-width: 130px; font-weight: 700; color: var(--bordeaux); }
.obs-val { color: #4a4045; }
.yoga-list { display: flex; flex-direction: column; gap: 8px; }
.yoga { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: .86rem; padding: 7px 10px; border-radius: 8px; background: #faf6f8; border: 1px solid var(--line); }
.yoga-name { font-weight: 700; color: #2b2b2b; }
.yoga-state { font-weight: 700; font-size: .78rem; }
.yoga.on .yoga-state { color: var(--emerald); }
.yoga.off .yoga-state { color: #b7a7ae; }
.yoga.cancelled { background: #fff7ed; border-color: #f0d9b8; }
.yoga.cancelled .yoga-state { color: #c07a12; }
.yoga-reason { grid-column: 1 / -1; font-size: .78rem; color: #8a7f83; }

/* birth-time / karmic warning banners */
.warn-banner { padding: 10px 14px; border-radius: 10px; font-size: .86rem; line-height: 1.45;
  margin-bottom: 10px; background: #fdecef; border: 1px solid #f3c6cf; color: #8a2330; }
.warn-banner:last-child { margin-bottom: 0; }
.warn-banner.soft { background: #fff7ed; border-color: #f0d9b8; color: #8a5a12; }
.warn-banner.gandanta { background: #f3eefc; border-color: #d9c8f0; color: #52307a; }
.warn-banner .gand { display: inline-block; margin: 2px 4px 0 0; padding: 2px 8px; border-radius: 20px;
  background: #ffffff; border: 1px solid #d9c8f0; font-size: .8rem; }
.warn-banner .gand.crit { background: #52307a; border-color: #52307a; color: #fff; font-weight: 700; }

/* strength score badge */
.score-badge { display: inline-block; min-width: 38px; text-align: center; padding: 1px 7px;
  border-radius: 20px; font-weight: 700; font-size: .8rem; background: #f3edf0;
  border: 1px solid var(--line); color: var(--bordeaux); cursor: help; }

/* BNN / Bhrigu Naadi */
.naadi-row { padding: 12px 0; border-bottom: 1px solid #efe6ea; }
.naadi-row:last-child { border-bottom: none; }
.naadi-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.naadi-planet { font-weight: 800; color: var(--bordeaux); font-size: 1rem; }
.naadi-pos { font-size: .82rem; color: #8a7f83; }
.naadi-chain { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nchip {
  display: inline-flex; align-items: baseline; gap: 4px;
  background: #faf6f8; border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 9px; font-size: .84rem; white-space: nowrap;
}
.nchip b { color: #2b2b2b; font-weight: 700; }
.nchip small { color: var(--bordeaux); font-weight: 600; font-size: .74rem; }
.nchip .ngati { font-style: normal; font-size: .8rem; }
.nchip .ngati.forward { color: var(--emerald); }
.nchip .ngati.retro { color: var(--red); }
.nchip.target { background: #6b1f3a; border-color: #6b1f3a; }
.nchip.target b { color: #fff; }
.nchip.target small { color: #f0d5b0; }
.nchip.lord { background: #fbf3e6; border-color: #e6d3ae; }
.nchip.lord small { color: #9c7c3a; }
.naadi-meet { margin-top: 8px; font-size: .8rem; font-weight: 600; }
.naadi-meet.meet { color: var(--emerald); }
.naadi-meet.exact { color: var(--bordeaux); }
.naadi-meet.nextcycle { color: #9c7c3a; }

/* Legend / reference key */
.legend-grid { display: flex; gap: 34px; flex-wrap: wrap; }
.legend-col { flex: 1 1 300px; min-width: 0; }
.legend-h {
  color: var(--burgundy); font-size: .82rem; margin: 0 0 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px; border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.legend-list { display: flex; flex-direction: column; gap: 9px; }
.legend-list > div { font-size: .86rem; color: #6b5860; line-height: 1.4; }
.lg-term { color: var(--bordeaux); font-weight: 700; }
.lg-ar { color: #c3b3ba; margin: 0 3px; }
.sig-table .conj-item + .conj-item { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #e6d9df; }
/* equal-width columns for the nakshatra tables */
.rpt-table.eqcol { table-layout: fixed; }
.rpt-table.eqcol td, .rpt-table.eqcol th { overflow-wrap: break-word; }

/* houses in brackets beside a lord name */
.hrep { color: var(--bordeaux); font-weight: 700; font-size: .82rem; }
/* no-star planet highlight (colour only, no explanation) */
.nostar { color: #b8860b; font-weight: 800; }
.indep {
  display: inline-block; background: var(--emerald); color: #fff;
  font-weight: 700; padding: 1px 10px; border-radius: 10px; font-size: .85rem;
}
.dash { color: #b7a7ae; }

/* Rahu / Ketu analysis table */
.node-table td { font-size: .86rem; }
.node-name { font-weight: 800; color: var(--bordeaux); font-size: 1rem; white-space: nowrap; }
.node-pl { font-weight: 700; color: #2b2b2b; }
.node-line { color: #6b5860; font-size: .82rem; margin-top: 1px; }
.node-conj + .node-conj { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #e6d9df; }
.node-conj .orb { color: #9c8790; font-size: .76rem; }

@media (max-width: 800px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; flex-direction: row; overflow-x: auto; padding: 10px; }
  .brand { display: none; }
  .nav { flex-direction: row; }
  .nav-divider, .nav-disabled { display: none; }
  .content { padding: 18px; }
}

/* =====================================================================
   INTAKE FORM (index.html) -- kept simple, no ornamentation
   ===================================================================== */
.wrap { max-width: 560px; margin: 0 auto; padding: 30px 16px 60px; }
.topbar { text-align: center; padding: 10px 0 6px; }
.topbar h1 { color: var(--bordeaux); margin: 0; font-size: 1.7rem; }
.topbar .sub { color: #8a6b74; margin: 6px 0 0; font-size: .9rem; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 22px 24px; margin: 16px 0; box-shadow: 0 1px 4px rgba(107,31,58,.08);
}
form.card label { display: block; margin: 12px 0 4px; font-weight: 600; font-size: .9rem; }
form.card input {
  width: 100%; padding: 9px 10px; border: 1px solid #d7cdd1; border-radius: 6px;
  font-size: 1rem; margin-top: 3px;
}
.row { display: flex; gap: 14px; }
.row label { flex: 1; }
button {
  margin-top: 18px; background: var(--bordeaux); color: #fff; border: none;
  padding: 12px 22px; font-size: 1.05rem; border-radius: 7px; cursor: pointer;
  width: 100%; font-weight: 600;
}
button:hover { background: var(--burgundy); }
.note { font-size: .82rem; color: #8a7f83; margin-top: 10px; }
.suggestions {
  border: 1px solid var(--line); border-top: none; border-radius: 0 0 6px 6px;
  max-height: 220px; overflow-y: auto; background: #fff;
}
.suggestion { padding: 8px 10px; cursor: pointer; font-size: .88rem; border-bottom: 1px solid #f2ecee; }
.suggestion:hover { background: #f6eef1; }
.alert {
  background: #fbeaec; border: 1px solid var(--red); color: #7a1b1b;
  padding: 12px 14px; border-radius: 8px; margin: 12px 0; font-size: .92rem;
}

/* Saved charts list on the intake page */
.saved-title, .form-title {
  color: var(--burgundy); margin: 0 0 4px; font-size: 1.1rem;
  border-bottom: 2px solid var(--gold); padding-bottom: 6px;
}
.form-title { margin-bottom: 8px; }
.saved-hint { font-size: .82rem; color: #8a7f83; margin: 6px 0 12px; }
.saved-list { display: flex; flex-direction: column; gap: 8px; }
.saved-item {
  display: flex; align-items: stretch;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.saved-item:hover { border-color: var(--gold); box-shadow: 0 1px 4px rgba(107,31,58,.08); }
.saved-open {
  flex: 1; display: flex; flex-direction: column; gap: 2px;
  padding: 10px 14px; text-decoration: none; color: var(--charcoal); min-width: 0;
}
.saved-open:hover { background: #f6eef1; }
.saved-name { font-weight: 700; color: var(--bordeaux); }
.saved-meta {
  font-size: .8rem; color: #8a7f83;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.saved-delform { display: flex; margin: 0; }
.saved-del {
  width: auto; margin: 0; border: none; border-left: 1px solid var(--line);
  background: #faf5f7; color: #b08a97; font-size: 1.3rem; line-height: 1;
  padding: 0 14px; cursor: pointer; border-radius: 0;
}
.saved-del:hover { background: var(--red); color: #fff; }

/* sidebar brand as a link */
a.brand { text-decoration: none; display: block; }
a.brand:hover { color: var(--gold); }

/* ===================== HOME / LAUNCHER (Horosoft-style) ===================== */
.home-body {
  background: radial-gradient(1200px 600px at 50% -10%, #4a1327 0%, #2a0d18 55%, #1c0710 100%);
  min-height: 100vh; padding: 30px 16px 50px;
}
.launcher {
  max-width: 720px; margin: 0 auto;
  background: #241019; border: 1px solid #5a2338; border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,.5); overflow: hidden;
}
.launcher-bar {
  background: linear-gradient(#7a1f3d, #5e1730); color: #f3dbe4;
  font-size: .82rem; padding: 7px 16px; letter-spacing: .3px;
  border-bottom: 1px solid #5a2338;
}
.launcher-inner { padding: 26px 30px 32px; }
.launcher-brand { text-align: center; position: relative; margin-bottom: 24px; }
.launcher-brand h1 {
  color: #fbeede; margin: 0; font-family: Georgia, "Times New Roman", serif;
  font-size: 2.1rem; font-weight: 700; letter-spacing: .5px;
}
.launcher-brand h1 span { color: var(--gold); }
.launcher-brand .tagline { color: #c79ba9; font-size: .85rem; margin: 8px 0 0; letter-spacing: 1px; }
.launcher-brand .ribbon {
  position: absolute; top: -26px; right: 6px;
  background: var(--gold); color: #2a0d18; font-weight: 800; font-size: .8rem;
  padding: 16px 9px 10px; border-radius: 3px 3px 0 0; line-height: 1;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
  box-shadow: 0 6px 12px rgba(0,0,0,.4);
}

.block-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 18px;
}
.block {
  display: flex; align-items: stretch; text-decoration: none;
  background: linear-gradient(#ffffff, #ece7ea);
  border: 1px solid #c7b3bd;
  border-radius: 8px; overflow: hidden; min-height: 62px;
  box-shadow: 0 3px 0 #7a1f3d, 0 6px 14px rgba(0,0,0,.35);
  transition: transform .08s, box-shadow .08s;
}
.block:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #7a1f3d, 0 10px 20px rgba(0,0,0,.45); }
.block:active { transform: translateY(1px); box-shadow: 0 2px 0 #7a1f3d, 0 4px 10px rgba(0,0,0,.35); }
.block-ic {
  position: relative; flex: 0 0 62px; width: 62px;
  background: linear-gradient(#8f2447, #6b1f3a); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.block-ic svg { width: 28px; height: 28px; }
.block-ic::after {
  content: ""; position: absolute; right: -11px; top: 0; bottom: 0; width: 12px;
  background: #6b1f3a; clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.block-label {
  flex: 1; display: flex; align-items: center; padding: 0 16px 0 24px;
  font-family: Georgia, "Times New Roman", serif; font-weight: 700;
  font-size: 1.35rem; color: #2b2b2b;
}

.home-saved {
  max-width: 720px; margin: 26px auto 0;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 22px; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.home-saved h2 {
  color: var(--burgundy); font-size: 1.15rem; margin: 0 0 4px;
  border-bottom: 2px solid var(--gold); padding-bottom: 6px;
}

@media (max-width: 560px) {
  .block-grid { grid-template-columns: 1fr; }
  .block-label { font-size: 1.2rem; }
}

/* ===================== PANCHANG ===================== */
.wrap.wide { max-width: 1000px; }
.panchang-form { padding-top: 14px; }
.panchang-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.pc {
  display: flex; flex-direction: column; gap: 2px;
  background: #fbf7f2; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px;
}
.pc-l { font-size: .76rem; color: #8a7f83; text-transform: uppercase; letter-spacing: .4px; }
.pc-v { font-weight: 700; color: var(--bordeaux); font-size: 1.05rem; }
.pc-v small { font-weight: 400; color: #8a7f83; }
.pc-warn { background: #fbeaec; border-color: #e7b8bf; }
.pc-warn .pc-v { color: var(--red); }

/* ===================== HINDU CALENDAR ===================== */
.cal-nav { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 6px 0 14px; }
.cal-nav h2 { color: var(--bordeaux); margin: 0; font-size: 1.3rem; }
.cal-arrow {
  text-decoration: none; color: #fff; background: var(--bordeaux);
  padding: 6px 14px; border-radius: 6px; font-size: .85rem; font-weight: 600;
}
.cal-arrow:hover { background: var(--burgundy); }
.cal-table { width: 100%; min-width: 640px; border-collapse: collapse; table-layout: fixed; }
.cal-table th {
  background: #f6eef1; color: var(--bordeaux); padding: 8px 4px; font-size: .82rem;
  border: 1px solid var(--line);
}
.cal-cell { border: 1px solid var(--line); vertical-align: top; padding: 6px; height: 78px; }
.cal-cell.empty { background: #faf7f8; }
.cal-day { font-weight: 700; color: var(--charcoal); font-size: .95rem; }
.cal-tithi { font-size: .72rem; color: var(--bordeaux); margin-top: 3px; line-height: 1.2; }
.cal-nak { font-size: .7rem; color: #8a7f83; line-height: 1.2; }

/* ===================== KP HORARY ===================== */
.horary-asc { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.horary-asc > div {
  display: flex; flex-direction: column; gap: 3px;
  background: #fbf7f2; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px;
}
.horary-asc .ha-l { font-size: .76rem; color: #8a7f83; text-transform: uppercase; letter-spacing: .4px; }
.horary-asc .ha-v { font-weight: 700; color: var(--bordeaux); font-size: 1.05rem; }
.horary-asc .ha-key { background: #eef7f0; border-color: #bfe0c9; }
.horary-asc .ha-key .ha-v { color: var(--emerald); }

@media (max-width: 600px) {
  .row { flex-direction: column; gap: 0; }
  /* Keep tithi/nakshatra visible -- the table scrolls horizontally instead
     (see .cal-table min-width). Hiding them left the calendar looking empty. */
}

/* ===================== MULTI-CHART WORKSPACE (MDI) ===================== */
.wsp-body { margin: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: #2a0d18; }
.wsp-restore {
  display: flex; align-items: center; gap: 12px; background: var(--gold); color: #2a0d18;
  padding: 7px 16px; font-size: .88rem; font-weight: 600;
}
.wsp-restore button { border: none; border-radius: 6px; padding: 5px 14px; cursor: pointer; font-weight: 700; font-size: .82rem; }
#restoreYes { background: var(--bordeaux); color: #fff; }
#restoreNo { background: rgba(0,0,0,.12); color: #2a0d18; }

.wsp-tabbar {
  display: flex; align-items: stretch; background: #24101a; height: 42px;
  flex: 0 0 auto; overflow-x: auto; overflow-y: hidden;
}
.wsp-tabbar::-webkit-scrollbar { height: 5px; }
.wsp-tabbar::-webkit-scrollbar-thumb { background: #55192f; }
.wsp-tab {
  display: flex; align-items: center; gap: 8px; background: #3d1225; color: #e9d3dc;
  border: none; border-right: 1px solid #55192f; padding: 0 10px 0 14px; cursor: pointer;
  white-space: nowrap; font-size: .85rem; font-family: inherit; flex: 0 0 auto; max-width: 210px;
}
.wsp-tab:hover { background: #4a1730; }
.wsp-tab.active { background: #f4f2f3; color: var(--bordeaux); }
.wsp-tab .t-ic { font-size: 1.05rem; }
.wsp-tab .t-body { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; overflow: hidden; }
.wsp-tab .t-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.wsp-tab .t-dob { font-size: .66rem; opacity: .75; }
.wsp-tab .t-x { font-size: 1.15rem; line-height: 1; opacity: .55; border-radius: 4px; padding: 0 5px; margin-left: 2px; }
.wsp-tab .t-x:hover { background: rgba(0,0,0,.18); opacity: 1; }
.wsp-tab.home { padding: 0 16px; }
.wsp-tab.home .t-name { font-weight: 700; }
.wsp-newtab {
  background: #24101a; color: #e9d3dc; border: none; font-size: 1.3rem; width: 42px;
  cursor: pointer; flex: 0 0 auto;
}
.wsp-newtab:hover { background: #3d1225; color: var(--gold); }

.wsp-frames { flex: 1; position: relative; background: #f4f2f3; }
.wsp-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: none; display: none; }
.wsp-frame.show { display: block; }

.saved-search {
  width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: .92rem; margin: 0 0 12px; box-sizing: border-box;
}

/* ===================== EDIT CLIENT DETAILS ===================== */
.ok-banner { background: #e7f5ec; border: 1px solid #b6e0c4; color: #127a4f; padding: 11px 16px; border-radius: 8px; margin: 12px 0; font-weight: 600; font-size: .9rem; }
.dup-warn .dup-actions { margin-top: 8px; display: flex; gap: 8px; }
.btn-sm { display: inline-block; text-decoration: none; background: var(--bordeaux); color: #fff; border: none; border-radius: 6px; padding: 6px 14px; font-size: .82rem; font-weight: 700; cursor: pointer; width: auto; }
.btn-sm:hover { background: var(--burgundy); }
.edit-layout { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.edit-list { flex: 0 0 260px; }
.edit-form { flex: 1 1 420px; min-width: 300px; }
.ec-list { display: flex; flex-direction: column; gap: 5px; max-height: 520px; overflow-y: auto; }
.ec-item { display: flex; flex-direction: column; gap: 1px; text-decoration: none; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--charcoal); }
.ec-item:hover { background: #f6eef1; border-color: var(--gold); }
.ec-item.active { background: #6b1f3a; border-color: #6b1f3a; }
.ec-item.active .ec-name { color: #fff; } .ec-item.active .ec-meta { color: #e7c9d3; }
.ec-name { font-weight: 700; color: var(--bordeaux); }
.ec-meta { font-size: .76rem; color: #8a7f83; }
.edit-form select, .edit-form textarea { width: 100%; padding: 9px 10px; border: 1px solid #d7cdd1; border-radius: 6px; font-size: 1rem; margin-top: 3px; font-family: inherit; }
.edit-form label { display: block; margin: 12px 0 4px; font-weight: 600; font-size: .9rem; }
.edit-form .form-title { margin-top: 20px; }
.audit { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.audit-h { color: var(--burgundy); font-size: .92rem; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .5px; }
.audit-row { display: grid; grid-template-columns: 120px 130px 1fr; gap: 8px; font-size: .82rem; padding: 5px 0; border-bottom: 1px dashed #efe6ea; }
.au-when { color: #9c8790; } .au-field { font-weight: 700; color: var(--bordeaux); } .au-change { color: #4a4045; }

/* KP Significator: compact existing columns to free space for the two timing
   columns. No row is coloured; the CURRENT Mahadasha / Antardasha is
   highlighted only inside its own timing cell (separately). */
.sig-table th { padding: 9px 9px; }              /* was 9px 14px -- tighter */
/* Independent Houses: only 1-2 badges -> narrow; header wraps to 2 lines */
.sig-table .col-indep { width: 62px; white-space: normal; padding-left: 6px; padding-right: 6px; }
.sig-table .kc-indep { width: 62px; }
.sig-table .col-nl,  .sig-table th:nth-child(3) { padding-left: 8px; padding-right: 8px; }
.sig-table .col-cnl, .sig-table .col-csl { width: 60px; padding-left: 6px; padding-right: 6px; }

/* Two timing columns: Mahadasha Ends / Antardasha Ends (DD-MM-YYYY) */
.sig-table .dend {
  white-space: nowrap; font-size: .82rem; font-weight: 700;
  color: #6b5860; font-variant-numeric: tabular-nums; width: 92px;
}
.sig-table .dend.dend-md {           /* current Mahadasha -- gold */
  background: #fff5e0; color: #8a6d1f; box-shadow: inset 0 0 0 2px var(--gold);
  border-radius: 6px;
}
.sig-table .dend.dend-ad {           /* current Antardasha -- emerald */
  background: #eaf6ee; color: var(--emerald); box-shadow: inset 0 0 0 2px var(--emerald);
  border-radius: 6px;
}

/* ===================== CLIENT PROFILE (notes / timeline / tags) ===================== */
.client-profile { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 20px; }
.client-profile .panel h2 { font-size: .95rem; }
.cp-empty { font-size: .82rem; color: #9c8790; margin: 8px 0 0; }

.ktag { display: inline-block; background: #6b1f3a; color: #fff; font-size: .74rem; font-weight: 700; padding: 3px 11px; border-radius: 12px; }
.ktag.ghost { background: #f6eef1; color: var(--bordeaux); cursor: pointer; border: 1px dashed #d9bfca; }
.ktag.ghost:hover { background: var(--gold); color: #2a0d18; border-color: var(--gold); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tags-form input[type=text] { width: 100%; padding: 8px 10px; border: 1px solid #d7cdd1; border-radius: 6px; font-size: .9rem; margin-bottom: 8px; }
.tags-form .btn-sm, .note-form .btn-sm, .event-form .btn-sm { width: auto; }

.note-form textarea { width: 100%; padding: 8px 10px; border: 1px solid #d7cdd1; border-radius: 6px; font-size: .9rem; font-family: inherit; margin-bottom: 8px; }
.note-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.note-item { background: #fbf7f2; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.note-head { display: flex; justify-content: space-between; align-items: center; }
.note-when { font-size: .72rem; color: #9c8790; }
.note-text { font-size: .88rem; color: #3b3237; white-space: pre-wrap; }
.inline-del { display: inline; margin: 0; }
.inline-del button { background: none; border: none; color: #c3a9b3; font-size: 1rem; cursor: pointer; padding: 0 4px; width: auto; margin: 0; }
.inline-del button:hover { color: var(--red); }

.event-form { display: flex; gap: 8px; flex-wrap: wrap; }
.event-form .ev-year { flex: 0 0 110px; padding: 8px 10px; border: 1px solid #d7cdd1; border-radius: 6px; font-size: .9rem; }
.event-form .ev-event { flex: 1; min-width: 150px; padding: 8px 10px; border: 1px solid #d7cdd1; border-radius: 6px; font-size: .9rem; }
.tl-list { margin-top: 14px; display: flex; flex-direction: column; }
.tl-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-left: 2px solid #e0cdd5; margin-left: 34px; position: relative; }
.tl-year { position: absolute; left: -44px; width: 38px; text-align: right; font-weight: 800; color: var(--bordeaux); font-size: .82rem; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); margin-left: -5.5px; flex: 0 0 auto; }
.tl-event { font-size: .88rem; color: #3b3237; flex: 1; }

/* ===================== RESEARCH ===================== */
.rs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.research-form select { width: 100%; padding: 8px 10px; border: 1px solid #d7cdd1; border-radius: 6px; font-size: .95rem; margin-top: 3px; }
.rs-detail { color: var(--bordeaux); }

/* ===================== TRANSIT ===================== */
.tw-btns { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tw-btns .btn-sm.on { background: var(--gold); color: #2a0d18; }
.hardred { color: var(--red); }

/* ===================== AI BRIEF ===================== */
.obs-tag.ok { color: var(--emerald); }
.obs-tag.bad { color: var(--red); }

/* ===================== PDF DESIGNER ===================== */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 8px 0 16px; }
.theme-card { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; border: 2px solid var(--line); border-radius: 10px; padding: 10px; }
.theme-card:has(input:checked) { border-color: var(--gold); box-shadow: 0 2px 10px rgba(197,157,40,.25); }
.theme-card input { display: none; }
.th-preview { width: 100%; height: 74px; border-radius: 6px; border: 1px solid #ddd; display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.th-band { display: block; height: 18px; border-radius: 3px; font-size: .7rem; font-weight: 700; text-align: center; line-height: 18px; }
.th-line { display: block; height: 5px; border-radius: 2px; width: 80%; }
.th-line.short { width: 55%; }
.th-name { font-size: .82rem; font-weight: 700; color: var(--charcoal); }

/* ===================== DASHA TIMELINE (interactive) ===================== */
.tlv-crumbs { display: flex; align-items: center; flex-wrap: wrap; font-size: .9rem; margin-bottom: 14px; }
.tlv-row { margin-bottom: 16px; }
.tlv-lab { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: #9c8790; margin-bottom: 4px; font-weight: 700; }
.tlv-bar { display: flex; width: 100%; height: 38px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.tlv-seg {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .74rem; font-weight: 700; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-shadow: 0 1px 2px rgba(0,0,0,.35);
  transition: filter .1s, transform .1s; min-width: 4px;
}
.tlv-seg:hover { filter: brightness(1.15); }
.tlv-seg.now { box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px var(--gold); }
.tlv-detail {
  margin-top: 6px; background: #fbf7f2; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 14px; font-size: .9rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.tlv-d-lord { color: #fff; font-weight: 800; padding: 2px 12px; border-radius: 10px; font-size: .82rem; text-shadow: 0 1px 2px rgba(0,0,0,.3); }

/* In-chart 'Edit Details' sidebar link + solo (single-client) edit layout */
.nav-edit { color: var(--gold) !important; font-weight: 600; }
.nav-edit:hover { background: var(--sidebar-hover); }
.edit-layout.solo { display: block; max-width: 640px; }
.edit-layout.solo .edit-form { width: 100%; }

/* ===================== SHADBALA ===================== */
.sb-bars { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.sb-bar-row { display: grid; grid-template-columns: 78px 1fr 54px; align-items: center; gap: 8px; }
.sb-bar-name { font-size: .82rem; font-weight: 700; color: var(--charcoal); }
.sb-bar-track { background: #efe7ea; border-radius: 6px; height: 16px; overflow: hidden; }
.sb-bar-fill { display: block; height: 100%; border-radius: 6px; }
.sb-bar-fill.strong { background: var(--emerald); }
.sb-bar-fill.weak { background: #c9a15a; }
.sb-bar-val { font-size: .78rem; text-align: right; color: #6b5860; font-weight: 700; }
.sb-summary { display: flex; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.sb-sum-item { flex: 1; display: flex; flex-direction: column; align-items: center;
  background: #fbf3f6; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.sb-sum-l { font-size: .7rem; text-transform: uppercase; letter-spacing: .4px; color: #8a7f83; }
.sb-sum-v { font-size: .95rem; font-weight: 800; }
.sb-sum-v.good { color: var(--emerald); }
.sb-sum-v.bad { color: var(--red); }
.th-sub2 { display: block; font-size: .64rem; font-weight: 400; color: #b09aa2; text-transform: none; letter-spacing: 0; }
.sb-table tr.sb-strong { background: #f2f9f4; }
.sb-table tr.sb-weakrow { background: #fdf5f4; }
.sb-pct { font-weight: 800; padding: 1px 7px; border-radius: 8px; }
.sb-pct.good { color: #fff; background: var(--emerald); }
.sb-pct.bad { color: #fff; background: var(--red); }
.sb-mini { font-size: .8rem; }
.sb-mini th { font-size: .74rem; }

/* ===================== KP chart -> divisional (varga) swap ===================== */
#kpChartCard { position: relative; }
.chart-hint { font-size: .68rem; font-weight: 400; color: var(--gold); letter-spacing: .2px; }
#kpChartHolder { transition: opacity .15s; cursor: pointer; }
.varga-menu {
  position: absolute; top: 46px; left: 50%; transform: translateX(-50%);
  z-index: 30; width: min(94%, 430px);
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 34px rgba(61,18,37,.28); padding: 12px;
}
.vm-head {
  font-size: .82rem; font-weight: 800; color: var(--bordeaux);
  border-bottom: 2px solid var(--gold); padding-bottom: 6px; margin-bottom: 10px;
}
.vm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.vm-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  text-align: left; background: #faf5f7; border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; cursor: pointer; font-size: .84rem;
  color: var(--charcoal); width: auto; margin: 0; line-height: 1.25;
}
.vm-item:hover { background: var(--burgundy); color: #fff; border-color: var(--burgundy); }
.vm-item:hover small { color: #f0d9e2; }
.vm-item b { color: var(--bordeaux); margin-right: 3px; }
.vm-item:hover b { color: var(--gold); }
.vm-item small { font-size: .68rem; color: #9c8790; }
.vm-item.vm-default { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 6px; background: #fff6e6; }
.vm-item.vm-default small { margin-left: auto; }

/* ===================== EDIT DETAILS — in-place modal ===================== */
.ed-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(40,12,24,.42); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
/* The [hidden] attribute must win over display:flex above, else the box is
   stuck open on page load and Cancel/Save can't visually close it. */
.ed-overlay[hidden] { display: none !important; }
.ed-box {
  background: #fff; border-radius: 14px; width: min(680px, 100%);
  box-shadow: 0 18px 50px rgba(61,18,37,.34); overflow: hidden;
}
.ed-head {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bordeaux); color: #fff; padding: 12px 18px;
  font-weight: 700; font-size: 1rem;
}
.ed-x { background: none; border: 0; color: #fff; font-size: 1.5rem; line-height: 1;
  cursor: pointer; width: auto; margin: 0; padding: 0 4px; }
.ed-body { display: flex; gap: 18px; padding: 18px; }
.ed-fields { flex: 1 1 300px; display: flex; flex-direction: column; gap: 12px; }
.ed-row { display: flex; gap: 10px; }
.ed-row .ed-lab { flex: 1; }
.ed-lab { display: flex; flex-direction: column; gap: 4px; font-size: .8rem;
  font-weight: 600; color: #6b5860; position: relative; }
.ed-lab input {
  padding: 9px 11px; border: 1px solid #d7cdd1; border-radius: 8px;
  font-size: .95rem; color: var(--charcoal); font-weight: 400;
}
.ed-lab input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(197,157,40,.2); }
.ed-sugg { position: absolute; top: 100%; left: 0; right: 0; z-index: 5;
  background: #fff; border: 1px solid var(--line); border-radius: 0 0 8px 8px;
  max-height: 190px; overflow-y: auto; box-shadow: 0 8px 20px rgba(61,18,37,.18); }
.ed-sg-item { padding: 7px 11px; font-size: .82rem; cursor: pointer; font-weight: 400; }
.ed-sg-item:hover { background: var(--burgundy); color: #fff; }
.ed-actions { display: flex; gap: 8px; margin-top: 4px; }
.ed-save, .ed-cancel { flex: 1; padding: 10px; border-radius: 8px; font-weight: 700;
  font-size: .9rem; cursor: pointer; border: 1px solid var(--line); margin: 0; }
.ed-save { background: var(--bordeaux); color: #fff; border-color: var(--bordeaux); }
.ed-save:hover { background: var(--burgundy); }
.ed-cancel { background: #f4eef1; color: #6b5860; }
.ed-cancel:hover { background: #e9dde3; }
.ed-msg { font-size: .8rem; color: var(--bordeaux); min-height: 1em; margin: 2px 0 0; text-align: center; }
.ed-preview { flex: 0 0 250px; display: flex; flex-direction: column; align-items: center;
  gap: 6px; border-left: 1px solid var(--line); padding-left: 18px; }
.ed-prev-chart { width: 100%; min-height: 220px; display: flex; align-items: center; justify-content: center; }
.ed-prev-chart svg { width: 100%; max-width: 240px; height: auto; }
.ed-prev-meta { font-size: .82rem; font-weight: 700; color: var(--bordeaux); margin: 0; text-align: center; }
.ed-prev-hint { font-size: .68rem; color: #9c8790; text-align: center; }
@media (max-width: 620px) {
  .ed-body { flex-direction: column; }
  .ed-preview { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 14px; flex-basis: auto; }
}

/* ===================== NOTES module ===================== */
.notes-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.note-input {
  width: 100%; border: 1px solid #d7cdd1; border-radius: 8px; padding: 11px 13px;
  font-family: inherit; font-size: .95rem; color: var(--charcoal); resize: vertical;
}
.note-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(197,157,40,.2); }
.note-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.note-save {
  background: var(--bordeaux); color: #fff; border: 0; border-radius: 8px;
  padding: 9px 20px; font-weight: 700; font-size: .9rem; cursor: pointer; width: auto; margin: 0;
}
.note-save:hover { background: var(--burgundy); }
.note-list { display: flex; flex-direction: column; gap: 10px; }
.note-item {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fbf7f2; border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 8px; padding: 11px 13px;
}
.note-body { flex: 1; min-width: 0; }
.note-when { font-size: .7rem; color: #9c8790; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.note-text { font-size: .95rem; color: var(--charcoal); white-space: pre-wrap; word-wrap: break-word; }
.note-del {
  background: none; border: 0; color: #c39; color: var(--red); font-size: 1.3rem; line-height: 1;
  cursor: pointer; width: auto; margin: 0; padding: 0 4px; opacity: .5;
}
.note-del:hover { opacity: 1; }

/* ===================== KP HORARY — app-shell look ===================== */
.nav-newhorary {
  margin: 14px 20px 0; text-align: center;
  background: var(--gold); color: #3d1225; text-decoration: none;
  padding: 9px 0; border-radius: 6px; font-weight: 700; font-size: .88rem;
}
.nav-newhorary:hover { background: #d9b143; }
.horary-intake .hi-row { display: flex; gap: 12px; flex-wrap: wrap; }
.horary-intake .hi-row label { flex: 1; min-width: 140px; }
.horary-intake label { display: block; margin-bottom: 12px; font-size: .82rem; font-weight: 600; color: #6b5860; }
.horary-intake input {
  width: 100%; padding: 9px 11px; border: 1px solid #d7cdd1; border-radius: 8px;
  font-size: .95rem; margin-top: 4px; font-weight: 400; color: var(--charcoal);
}
.horary-intake input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(197,157,40,.2); }
.horary-intake button {
  background: var(--bordeaux); color: #fff; border: 0; border-radius: 8px;
  padding: 10px 22px; font-weight: 700; font-size: .92rem; cursor: pointer; margin-top: 4px;
}
.horary-intake button:hover { background: var(--burgundy); }

/* ===================== PRASHNA — automated answer card ===================== */
.prashna-card { border-width: 2px; border-style: solid; }
.prashna-card.ans-yes { border-color: var(--emerald); background: #f2f9f4; }
.prashna-card.ans-no { border-color: var(--red); background: #fdf4f4; }
.prashna-card.ans-delay { border-color: var(--gold); background: #fffaf0; }
.prashna-q { font-size: 1.05rem; font-weight: 700; color: var(--charcoal); font-style: italic; margin-bottom: 10px; }
.prashna-verdict {
  display: inline-block; font-size: 1.6rem; font-weight: 800; letter-spacing: 1px;
  padding: 6px 26px; border-radius: 10px; color: #fff; margin-bottom: 14px;
}
.prashna-verdict.ans-yes { background: var(--emerald); }
.prashna-verdict.ans-no { background: var(--red); }
.prashna-verdict.ans-delay { background: var(--gold); color: #3d1225; }
.prashna-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px; margin-bottom: 12px;
}
.prashna-grid > div {
  display: flex; flex-direction: column; gap: 2px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
}
.pg-l { font-size: .68rem; text-transform: uppercase; letter-spacing: .4px; color: #8a7f83; }
.pg-v { font-size: .98rem; font-weight: 700; color: var(--bordeaux); }
.pg-pos { color: var(--emerald); }
.pg-neg { color: var(--red); }
.prashna-reason { font-size: .95rem; color: var(--charcoal); margin: 4px 0 0; line-height: 1.55; }
.prashna-note { font-size: .78rem; color: #8a7178; margin: 8px 0 0; }

/* Prashna answer — extra elements (snapshot, label, timing, footer) */
.prashna-head { font-size: .8rem; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: #8a7178; margin-bottom: 6px; }
.prashna-label { font-size: .95rem; font-weight: 700; color: var(--bordeaux); margin: -8px 0 14px; }
.prashna-snap {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px;
  background: rgba(255,255,255,.6); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 12px;
}
.prashna-snap > div { display: flex; flex-direction: column; gap: 1px; }
.ps-k { font-size: .66rem; text-transform: uppercase; letter-spacing: .4px; color: #9c8790; }
.ps-x { font-size: .95rem; font-weight: 700; color: var(--charcoal); }
.prashna-grid .pg-wide { grid-column: 1 / -1; }
.prashna-foot {
  font-size: .76rem; color: #6b5860; margin: 12px 0 0; padding-top: 10px;
  border-top: 1px dashed var(--line); font-style: italic;
}

/* Prashna strength engine — score, confidence, 4-fold breakdown, factors */
.prashna-strength { display: flex; gap: 12px; margin: 4px 0 14px; }
.pstr-score, .pstr-conf {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  border-radius: 10px; padding: 10px; color: #fff; border: 1px solid rgba(0,0,0,.06);
}
.pstr-score.ans-yes { background: var(--emerald); }
.pstr-score.ans-no { background: var(--red); }
.pstr-score.ans-delay { background: var(--gold); color: #3d1225; }
.pstr-conf.conf-high { background: var(--emerald); }
.pstr-conf.conf-medium { background: var(--gold); color: #3d1225; }
.pstr-conf.conf-low { background: #9c8790; }
.pstr-num { font-size: 1.5rem; font-weight: 800; letter-spacing: .5px; }
.pstr-lbl { font-size: .68rem; text-transform: uppercase; letter-spacing: .5px; opacity: .95; }
.pstr-table { max-width: 560px; margin-bottom: 12px; }
.pstr-table td.strong, .pstr-table .strong { font-weight: 700; color: var(--bordeaux); }
.pstr-table tr.pstr-total td { background: #f6eef1; font-weight: 800; color: var(--bordeaux); border-top: 2px solid var(--gold); }
.prashna-factors { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.pf-l { font-size: .78rem; font-weight: 700; color: #6b5860; }
.pf-chip { font-size: .74rem; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 3px 10px; color: #6b5860; }

/* Prashna ultra-advanced layers: CIT chain · Ruling Planets · Transit */
.prashna-adv { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 4px 0 12px; }
.padv-box { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.padv-h { font-size: .82rem; font-weight: 800; color: var(--bordeaux); margin-bottom: 6px; }
.padv-chain { font-size: .88rem; font-weight: 700; color: var(--charcoal); font-family: "Consolas", monospace; word-break: break-word; margin-bottom: 4px; }
.padv-sub { font-size: .8rem; color: #6b5860; margin-top: 2px; }
.conn-strong, .conn-high, .conn-veryhigh { color: var(--emerald); }
.conn-moderate, .conn-medium { color: var(--gold); }
.conn-weak, .conn-low { color: var(--red); }

/* KP Horary — single centered chart (chart view, no D1) */
.chart-holder.chart-single { max-width: 460px; margin: 0 auto; }

/* ===================== DAILY PANCHANG (Drik-style) ===================== */
.pan-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.pan-nav { display: flex; gap: 6px; }
.pan-nav .btn-sm.on { background: var(--gold); color: #2a0d18; }
.pan-form { display: flex; gap: 8px; align-items: center; position: relative; flex-wrap: wrap; }
.pan-form input[type=date], .pan-form input[type=text] { padding: 8px 10px; border: 1px solid #d7cdd1; border-radius: 7px; font-size: .9rem; }
.pan-form input[type=text] { min-width: 200px; }
.pan-form button { background: var(--bordeaux); color: #fff; border: 0; border-radius: 7px; padding: 8px 16px; font-weight: 700; cursor: pointer; }
.pan-form .suggestions { top: 100%; left: 0; }
.pan-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(135deg, #fbf3f6, #fff); }
.ph-d { font-size: 1.25rem; font-weight: 800; color: var(--bordeaux); }
.ph-s { font-size: .92rem; color: #7c6169; margin-top: 2px; }
.ph-samvat { display: flex; flex-direction: column; gap: 2px; text-align: right; font-size: .85rem; color: #6b5860; }
.ph-samvat b { color: var(--bordeaux); }
.pan-h { color: var(--burgundy); margin: 0 0 12px; font-size: 1.02rem; border-bottom: 2px solid var(--gold); padding-bottom: 6px; }
.pan-h.shubh { border-bottom-color: var(--emerald); color: var(--emerald); }
.pan-h.ashubh { border-bottom-color: var(--red); color: var(--red); }
.pan-diagram { display: flex; justify-content: center; }
.pan-svg { width: 100%; max-width: 720px; height: auto; }
.pan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.pan-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.pan-table td { padding: 8px 6px; border-bottom: 1px solid #f2ecee; vertical-align: top; }
.pan-table td.pk { color: #7c6169; width: 130px; font-weight: 600; white-space: nowrap; }
.pan-table b { color: var(--charcoal); }
.pk-till { display: block; font-size: .76rem; color: #9c8790; margin-top: 1px; }
.pan-table td.good { color: var(--emerald); font-weight: 700; }
.pan-table td.bad { color: var(--red); font-weight: 700; }
.lg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 3px -1px 8px; }

/* Panchang timeline chart + transitions table */
.pan-tl { width: 100%; max-width: 780px; height: auto; }
.trans-table thead th { background: #f6eef1; color: var(--bordeaux); font-size: .82rem; text-align: left; padding: 7px 8px; }
.trans-table tr.grp-first td { border-top: 2px solid var(--gold); }
.trans-table td { padding: 6px 8px; }

/* ===================== Hindu Calendar highlights ===================== */
.cal-day { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.cal-sp-badge { font-size: .58rem; font-weight: 800; padding: 1px 5px; border-radius: 6px;
  background: #efe7ea; color: #6b5860; text-transform: uppercase; letter-spacing: .2px; }
.cal-fest { font-size: .68rem; font-weight: 700; color: var(--red); line-height: 1.15; margin-top: 3px; }
/* special-day tints */
.cal-cell.sp-purnima { background: #fdf6e3; }
.cal-cell.sp-purnima .cal-sp-badge { background: var(--gold); color: #3d2a00; }
.cal-cell.sp-amavasya { background: #eceaee; }
.cal-cell.sp-amavasya .cal-sp-badge { background: #4a3a52; color: #fff; }
.cal-cell.sp-ekadashi { background: #eaf3fb; }
.cal-cell.sp-ekadashi .cal-sp-badge { background: #2f6db0; color: #fff; }
.cal-cell.sp-pradosh .cal-sp-badge, .cal-cell.sp-sankashti .cal-sp-badge,
.cal-cell.sp-masikshivaratri .cal-sp-badge { background: #7a6a2f; color: #fff; }
.cal-cell.has-fest { box-shadow: inset 0 -3px 0 var(--red); }
.cal-cell.today { outline: 2px solid var(--bordeaux); outline-offset: -2px; background: #fbeef2; }
.cal-cell.today .cal-day { color: var(--bordeaux); }
/* legend */
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 12px 0 4px; font-size: .78rem; color: #6b5860; }
.cal-legend span { display: flex; align-items: center; gap: 5px; }
.lg-sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid var(--line); }
.lg-sw.sp-purnima { background: var(--gold); }
.lg-sw.sp-amavasya { background: #4a3a52; }
.lg-sw.sp-ekadashi { background: #2f6db0; }
.lg-sw.has-fest { background: #fff; box-shadow: inset 0 -4px 0 var(--red); }
.lg-sw.today { background: #fbeef2; outline: 2px solid var(--bordeaux); outline-offset: -2px; }

/* Festival muhurat detail page */
.cal-fest { text-decoration: none; cursor: pointer; display: block; }
.cal-fest:hover { text-decoration: underline; }
.fest-muhurat .fest-time { font-weight: 800; color: var(--emerald); font-size: 1rem; font-variant-numeric: tabular-nums; }

/* Research: lagna lord + placement in results */
.rs-lag { font-size: .68rem; font-weight: 700; color: var(--emerald); background: #eaf6ee; padding: 1px 7px; border-radius: 8px; margin-left: 6px; }
.rs-place { color: #7c6169; font-size: .82rem; }

/* Case-type quick tags on dashboard */
.tag-sg-lbl { font-size: .68rem; text-transform: uppercase; letter-spacing: .4px; color: #9c8790; width: 100%; margin: 6px 0 2px; }
.ktag.ghost.case { border-color: #d9a7b3; color: var(--bordeaux); }
.ktag.ghost.case:hover { background: var(--bordeaux); color: #fff; }

/* ---- Free guest / self-signup (online) --------------------------------- */
.guest-bar { background: linear-gradient(90deg,#fff6e6,#ffe9c7); border: 1px solid #e9c37a;
  color: #7a4a00; padding: 10px 16px; border-radius: 10px; margin: 0 0 16px;
  font-size: .92rem; line-height: 1.45; }
.guest-bar b { color: var(--bordeaux); font-size: 1.02em; }

.login-alt { margin-top: 16px; font-size: .9rem; text-align: center; color: #6b5560; }
.login-alt a { color: var(--bordeaux); font-weight: 700; text-decoration: none; }
.login-alt a:hover { text-decoration: underline; }
.login-note { margin-top: 12px; font-size: .8rem; color: #7c6169; text-align: center; line-height: 1.55; }
.login-backbtn { display: inline-block; margin-top: 14px; color: var(--bordeaux); font-weight: 700; text-decoration: none; }
.login-backbtn:hover { text-decoration: underline; }
.login-form .opt { color: #9c8790; font-weight: 400; font-size: .8em; }

/* role badges + promote button in the admin Users table */
.role-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .62rem;
  font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.role-admin  { background: var(--bordeaux); color: #fff; }
.role-client { background: #eaf6ee; color: var(--emerald); }
.role-guest  { background: #fdeccd; color: #8a5a00; }
.btn-promote { background: var(--emerald); color: #fff; border: none; padding: 5px 11px;
  border-radius: 7px; font-size: .78rem; font-weight: 700; cursor: pointer; margin-right: 2px; }
.btn-promote:hover { filter: brightness(1.08); }
