@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Manrope:wght@500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --bg: #080d19;
  --panel: #0d1525;
  --panel-hover: #121c30;
  --card: #0e1728;
  --border: #1e2c42;
  --border-subtle: #162234;
  --border-focus: #3d5578;
  --text: #e6edf8;
  --text-muted: #8899b2;
  --text-faint: #566782;
  --accent: #d7ba80;
  --accent-soft: rgba(215, 186, 128, 0.12);
  --accent-border: rgba(215, 186, 128, 0.35);
  --teal: #68c7a2;
  --teal-soft: rgba(104, 199, 162, 0.12);
  --line: #1e2c42;
  --muted: #8899b2;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   1. Compact Sticky Top Header & Active Subject Bar
   ========================================================================== */

.topbar {
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 13, 25, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.top-left {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 800 19px 'Manrope', system-ui;
  color: var(--text);
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--accent);
  width: 34px;
  height: 34px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 9px;
}

.brand-title {
  letter-spacing: -0.02em;
}

.brand-accent {
  color: var(--accent);
}

/* Active Subject Bar & Precision Group */
.subject-bar-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.timing-precision-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(215, 186, 128, 0.08);
  border: 1px solid rgba(215, 186, 128, 0.28);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.timing-precision-badge::before {
  content: "✦";
  font-size: 10px;
  color: var(--accent);
}

.timing-precision-badge.verified {
  background: rgba(104, 199, 162, 0.1);
  border-color: rgba(104, 199, 162, 0.35);
  color: #8be0bc;
}
.timing-precision-badge.verified::before {
  content: "✓";
  color: #8be0bc;
}

.timing-precision-badge.coarse {
  background: rgba(235, 168, 76, 0.1);
  border-color: rgba(235, 168, 76, 0.3);
  color: #f0be72;
}
.timing-precision-badge.coarse::before {
  content: "◎";
  color: #f0be72;
}

/* Active Subject Bar (Single Line Pill) */
.subject-pill {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  background: #0d1525;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  color: #cdd8eb;
  min-width: 0;
}

.subject-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px rgba(104, 199, 162, 0.7);
  flex-shrink: 0;
}

.subject-text {
  font-weight: 500;
  letter-spacing: -0.01em;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.switch-profile-btn {
  background: rgba(215, 186, 128, 0.08);
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  color: var(--accent);
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.switch-profile-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #fff;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  flex-shrink: 0;
}

.environment {
  letter-spacing: 1.2px;
  color: var(--text-faint);
  font-weight: 600;
  font-size: 10px;
}

.status {
  border: 1px solid var(--border);
  padding: 6px 11px;
  border-radius: 16px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  background: #0c1322;
}

.status i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8b9bae;
  margin-right: 7px;
}

.status.online i {
  background: var(--teal);
  box-shadow: 0 0 10px rgba(104, 199, 162, 0.5);
}

.status.online {
  color: #a0d6c2;
}

/* ==========================================================================
   2. Slide-Over Birth Profile Drawer (Modal)
   ========================================================================== */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(4, 8, 16, 0.75);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: opacity 0.2s ease;
}

.birth-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(440px, 94vw);
  z-index: 70;
  background: #0d1525;
  border-right: 1px solid var(--border);
  box-shadow: 16px 0 48px rgba(0, 0, 0, 0.7);
  transform: translateX(-105%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
  visibility: hidden;
  display: flex;
  flex-direction: column;
}

.birth-drawer.open,
body.drawer-open .birth-drawer,
.workspace:not(.profile-collapsed) .birth-drawer {
  transform: translateX(0);
  visibility: visible;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: #0b1220;
}

.drawer-header h2 {
  font: 600 18px 'Manrope', system-ui;
  margin: 4px 0 0;
  color: var(--text);
}

.close-drawer-btn {
  font-size: 24px;
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  transition: all 0.16s ease;
}

.close-drawer-btn:hover {
  color: #fff;
  border-color: var(--border-focus);
  background: #141f33;
}

.drawer-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 40px;
}

.sidebar-intro p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 16px;
}

.preset-button {
  width: 100%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: #e4ca99;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  transition: background 0.16s ease;
}

.preset-button:hover {
  background: rgba(215, 186, 128, 0.2);
}

label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #92a2ba;
  margin: 14px 0 6px;
}

input, select {
  width: 100%;
  min-width: 0;
  background: #090e18;
  border: 1px solid #233249;
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
  transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(215, 186, 128, 0.5);
  outline-offset: 1px;
  border-color: var(--accent);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-help {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.5;
  margin-top: 5px;
}

.location-search {
  position: relative;
}

.city-suggestions {
  position: absolute;
  z-index: 40;
  top: 100%;
  left: 0;
  right: 0;
  background: #111a2c;
  border: 1px solid #324460;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  max-height: 220px;
  overflow-y: auto;
  margin-top: 4px;
}

.city-suggestions button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #1c2a40;
  color: #d8e0f3;
  background: transparent;
  font-size: 12px;
  line-height: 1.4;
}

.city-suggestions button:hover,
.city-suggestions button:focus {
  background: #1e2c45;
}

.text-button {
  background: transparent;
  border: 1px solid #2b3a50;
  color: #adc1e6;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  margin-top: 8px;
  transition: all 0.15s;
}

.text-button:hover {
  background: #141f33;
  color: #fff;
}

.manual-overrides {
  margin-top: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  background: #090e18;
}

.manual-overrides summary {
  font-size: 11px;
  color: #a4b4ce;
  cursor: pointer;
  font-weight: 500;
}

.manual-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  margin: 10px 0;
}

.manual-toggle input {
  width: auto;
}

.save-profile {
  margin-top: 20px;
  width: 100%;
  justify-content: center;
}

.profile-note {
  font-size: 10px;
  color: var(--text-faint);
  line-height: 1.6;
  margin-top: 6px;
}

.geo-attribution {
  font-size: 10px;
  color: var(--text-faint);
  line-height: 1.6;
  margin-top: 24px;
}

/* Retrospective Rectification Section */
.rectify-section {
  margin-top: 18px;
  background: rgba(13, 21, 37, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease;
  padding: 0;
}

.rectify-section:hover,
.rectify-section[open] {
  border-color: rgba(215, 186, 128, 0.35);
}

.rectify-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  user-select: none;
  background: rgba(13, 21, 37, 0.8);
}

.rectify-summary::-webkit-details-marker {
  display: none;
}

.rectify-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rectify-title::before {
  content: "⚙";
  font-size: 12px;
  color: var(--accent);
}

.rectify-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(215, 186, 128, 0.1);
  color: var(--accent);
  border: 1px solid rgba(215, 186, 128, 0.2);
}

.rectify-body {
  padding: 0 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.rectify-body .field-help {
  margin: 10px 0 14px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
}

.milestone-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.milestone-row {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 10px;
  align-items: flex-end;
  background: rgba(8, 13, 25, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
}

@media (max-width: 480px) {
  .milestone-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.milestone-field label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.milestone-select,
.milestone-month {
  width: 100%;
  background: #090e18;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 6px 10px;
  font-size: 11px;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.milestone-select:focus,
.milestone-month:focus {
  border-color: var(--accent);
  outline: none;
}

.rectify-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.rectify-btn {
  background: rgba(215, 186, 128, 0.12) !important;
  border: 1px solid var(--accent-border) !important;
  color: var(--accent) !important;
  font-weight: 600;
  padding: 7px 14px !important;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 11px !important;
}

.rectify-btn:hover:not(:disabled) {
  background: var(--accent-soft) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}

.rectify-status {
  font-size: 11px;
  color: var(--text-muted);
}

.rectify-feedback {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(104, 199, 162, 0.08);
  border: 1px solid rgba(104, 199, 162, 0.25);
  font-size: 11px;
  line-height: 1.5;
  color: #a4ecd0;
}

.geo-attribution a {
  text-decoration: underline;
}

.sidebar-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.tiny-orbit {
  color: var(--accent);
  font-size: 22px;
}

.sidebar-footer strong {
  font-size: 11px;
  font-weight: 600;
  display: block;
}

.sidebar-footer p {
  font-size: 10px;
  color: var(--text-faint);
  margin: 2px 0 0;
}

/* ==========================================================================
   3. Two-Column Desktop Workspace
   ========================================================================== */

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 740px);
  justify-content: center;
  gap: 36px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px 24px 60px;
  min-height: calc(100vh - 64px);
  box-sizing: border-box;
}

/* Left Rail (320px sticky, clean & airy) */
.left-rail {
  position: sticky;
  top: 88px;
  height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  box-sizing: border-box;
}

.left-rail::-webkit-scrollbar {
  width: 4px;
}

.left-rail::-webkit-scrollbar-thumb {
  background: #1c273a;
  border-radius: 4px;
}

.birth-chart-card {
  background: #0d1525;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  position: relative;
  box-sizing: border-box;
}

.chart-header .eyebrow {
  font-size: 9px;
  letter-spacing: 1.8px;
  font-weight: 700;
  color: var(--accent);
}

.chart-header h2 {
  font: 600 17px 'Manrope', system-ui;
  margin: 6px 0 4px;
  color: var(--text);
}

.chart-header p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.kundali {
  width: 100%;
  max-width: 280px;
  margin: 14px auto 4px;
  min-height: 200px;
  display: grid;
  place-items: center;
  text-align: center;
  box-sizing: border-box;
  overflow: hidden;
}

.kundali svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  overflow: hidden;
}

.chart-house {
  fill: #090f1b;
  stroke: #8a7648;
  stroke-width: 1.2;
  cursor: pointer;
  transition: fill 0.15s ease;
}

.chart-house:hover,
.chart-house:focus {
  fill: rgba(226, 179, 78, 0.12);
  outline: none;
}

.chart-sign {
  font-family: system-ui;
  font-size: 10px;
  fill: #ad9a70;
  pointer-events: none;
}

.planet-badge {
  fill: #222e47;
  stroke: #4d5f7d;
  stroke-width: 0.35;
  cursor: pointer;
  transition: filter 0.15s ease, stroke 0.15s ease;
}

g[data-planet]:hover .planet-badge,
g[data-planet]:focus .planet-badge {
  filter: drop-shadow(0 0 6px rgba(226, 179, 78, 0.65));
  stroke: #e2b34e;
}

.planet-badge.sun, .planet-badge.mars { fill: #482f32; }
.planet-badge.moon, .planet-badge.venus { fill: #33304a; }
.planet-badge.jupiter { fill: #413824; }
.planet-badge.mercury { fill: #1d362e; }

.planet-label {
  font-family: system-ui;
  font-size: 7.5px;
  font-weight: 600;
  fill: #e2e8f5;
  pointer-events: none;
}

.chart-tooltip {
  position: absolute;
  bottom: 12px;
  left: 14px;
  right: 14px;
  padding: 10px 14px;
  background: rgba(13, 22, 38, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(226, 179, 78, 0.35);
  border-radius: 8px;
  font-size: 11.5px;
  color: #edf3fc;
  z-index: 10;
  pointer-events: none;
  line-height: 1.5;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

/* Domain Navigation Pills (Left Rail) */
.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rail-nav-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-faint);
  margin-bottom: 4px;
  padding-left: 2px;
}

.domain-pills {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.domain-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #0d1525;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: #b3c2d8;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
}

.domain-pill:hover {
  background: #141f33;
  border-color: #31425b;
  color: #fff;
  transform: translateX(2px);
}

.domain-pill span {
  color: var(--accent);
  font-size: 13px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.rail-footer {
  margin-top: auto;
  padding-top: 10px;
}

.dasha-rail-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  background: #121a2c;
  border: 1px solid #293a52;
  border-radius: 8px;
  color: #cbd8ee;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.dasha-rail-btn:hover {
  background: #18243c;
  border-color: var(--accent);
  color: #fff;
}

.dasha-rail-btn span {
  color: var(--accent);
}

/* ==========================================================================
   4. Main Reading Canvas (max-width 740px)
   ========================================================================== */

.canvas-main {
  max-width: 740px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Conversational Prompt Card */
.query-card {
  background: linear-gradient(135deg, #10192b, #0d1424);
  border: 1px solid #23344d;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  margin-bottom: 24px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.query-card:focus-within {
  border-color: #3b5275;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.32);
}

.section-heading {
  padding: 16px 20px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.section-heading h2 {
  font: 600 15px 'Manrope', system-ui;
  color: #d1dced;
  margin: 0;
}

.keyboard-hint {
  font-size: 11px;
  color: var(--text-faint);
}

textarea {
  resize: vertical;
  border: 0;
  background: transparent;
  color: var(--text);
  width: calc(100% - 40px);
  margin: 8px 20px;
  min-height: 56px;
  line-height: 1.6;
  font-size: 15px;
  outline: none;
}

textarea::placeholder {
  color: #5d6f8a;
}

.query-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px 16px;
  border-top: 1px solid #162234;
}

.query-bottom > span {
  font-size: 11px;
  color: var(--text-faint);
}

.primary {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  background: var(--accent);
  color: #101622;
  border: 1px solid #e2cb9b;
  border-radius: 7px;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.18s ease;
}

.primary:hover {
  background: #e7d1a5;
  box-shadow: 0 2px 14px rgba(215, 186, 128, 0.28);
}

/* Empty State & First-Time Welcome Card */
.empty-state {
  text-align: center;
  padding: 48px 20px 54px;
  background: #0d1525;
  border: 1px dashed #202d42;
  border-radius: 12px;
  margin-bottom: 24px;
}

.welcome-card {
  text-align: left;
  padding: 34px 30px 36px;
  background: #0d1525;
  border: 1px solid rgba(226, 179, 78, 0.22);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent);
  background: rgba(226, 179, 78, 0.08);
  border: 1px solid rgba(226, 179, 78, 0.22);
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 14px;
}

.welcome-glyph {
  font-size: 11px;
}

.welcome-title {
  font: 600 20px 'Manrope', system-ui;
  margin: 0 0 10px;
  color: #edf3fc;
}

.welcome-subtitle {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 0 22px;
}

.quick-start-box {
  margin: 18px 0 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-start-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--text-faint);
}

.quick-start-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.starter-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: rgba(21, 34, 56, 0.65);
  border: 1px solid rgba(77, 95, 125, 0.35);
  border-radius: 8px;
  color: #dbe5f5;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.starter-chip:hover {
  background: rgba(29, 46, 75, 0.9);
  border-color: rgba(226, 179, 78, 0.45);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.starter-chip .chip-icon {
  font-size: 13px;
  color: var(--accent);
  flex-shrink: 0;
}

.starter-chip .chip-text {
  flex: 1;
}

.welcome-card .empty-tags {
  justify-content: flex-start;
  margin-top: 18px;
  border-top: 1px solid #162234;
  padding-top: 18px;
}

.empty-glyph {
  font-size: 32px;
  color: #556680;
  line-height: 1;
}

.empty-state h3 {
  font: 600 17px 'Manrope', system-ui;
  margin: 14px 0 8px;
  color: #e1ebf7;
}

.empty-state p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 440px;
  margin: 0 auto;
}

.empty-tags {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 24px;
  letter-spacing: 0.5px;
}

/* Loading State with Shimmer Animation */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.loading {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  margin: 20px 0;
  background: linear-gradient(90deg, #0e1627 25%, #15223a 50%, #0e1627 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite linear;
  border: 1px solid #23344d;
  border-radius: 10px;
}

.spinner {
  width: 22px;
  height: 22px;
  flex: none;
  border: 2px solid #2d3c52;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.loading strong {
  font-size: 13px;
  font-weight: 600;
  color: #e4edf8;
}

.loading p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 0;
}

/* Error Alert */
.error {
  padding: 14px 18px;
  margin-bottom: 20px;
  border: 1px solid #7a3c3c;
  background: rgba(84, 30, 30, 0.35);
  color: #f0c3c3;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
}

/* ==========================================================================
   5. Results Dossier & Editorial Reading Canvas
   ========================================================================== */

.result-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 10px 0 16px;
}

.result-heading h2 {
  font: 600 20px 'Manrope', system-ui;
  margin: 4px 0 2px;
  color: #eaf1fa;
}

.result-heading p {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
}

.mode-badge {
  font-size: 9px;
  padding: 5px 10px;
  border-radius: 16px;
  border: 1px solid #29463d;
  color: #8ed2bb;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.mode-badge.fallback {
  color: #d6ba83;
  border-color: #55442a;
}

/* Streamed Human Answer Card */
.narrative-card {
  background: #0e1728;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px 30px;
  margin-bottom: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.narrative-card.streaming {
  border-color: rgba(215, 186, 128, 0.55);
  box-shadow: 0 0 32px rgba(215, 186, 128, 0.1);
}

.executive-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 18px;
}

.executive-header h3 {
  font: 600 17px 'Manrope', system-ui;
  margin: 0;
  color: #e8edf6;
}

.verdict-badge {
  background: var(--teal-soft);
  border: 1px solid rgba(104, 199, 162, 0.35);
  border-radius: 16px;
  color: #92d6bf;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* Editorial Typography for Answers */
.executive-answer {
  font-size: 16px;
  line-height: 1.75;
  color: #edf3fc;
  margin: 0 0 16px;
  font-weight: 400;
}

.prose-reading {
  font-size: 15px;
  line-height: 1.8;
  color: #cad7eb;
}

.prose-reading p {
  margin: 0 0 16px;
}

.prose-reading strong {
  color: #fff;
  font-weight: 600;
}

.prose-reading em {
  color: #e4ca99;
  font-style: italic;
}

.prose-reading h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 22px 0 10px;
}

.prose-reading ul {
  list-style: disc;
  padding-left: 20px;
  margin: 0 0 16px;
}

.prose-reading li {
  margin-bottom: 8px;
}

/* Interactive Conversational Follow-Up Chips */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.followup-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.followup-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #121b2d;
  border: 1px solid #26364e;
  border-radius: 20px;
  color: #c9d5eb;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  line-height: 1.4;
  text-align: left;
}

.followup-chip span {
  color: var(--accent);
  font-size: 11px;
}

.followup-chip:hover {
  background: #19263e;
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 14px rgba(215, 186, 128, 0.16);
  transform: translateY(-1px);
}

.followup-chip:active {
  transform: scale(0.98);
}

/* Timing Trajectory Chart */
.window-panel {
  background: #0d1525;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  margin: 24px 0;
  box-sizing: border-box;
}

.window-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.window-heading .eyebrow {
  font-size: 9px;
  letter-spacing: 1.8px;
  font-weight: 700;
  color: var(--accent);
}

.window-panel > p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 8px 0 16px;
}

.trajectory {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 14px 0;
  overflow: hidden;
  box-sizing: border-box;
}

.trajectory svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 150px;
  overflow: hidden;
}

.plot-grid {
  stroke: #223249;
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.plot-label {
  font: 11px system-ui;
  fill: #7e91ac;
}

.trajectory-point {
  fill: #a9beea;
  stroke: #090e18;
  stroke-width: 1;
  cursor: crosshair;
}

.trajectory-point:not(.peak-dot) {
  opacity: 0.25;
}

.trajectory-point:hover,
.trajectory-point:focus {
  opacity: 1;
  stroke: var(--accent);
  stroke-width: 3;
  outline: none;
}

.peak-dot {
  fill: var(--accent);
  filter: drop-shadow(0 0 6px rgba(215, 186, 128, 0.7));
}

.trajectory-tooltip {
  position: absolute;
  z-index: 20;
  width: 280px;
  max-width: calc(100% - 8px);
  padding: 10px 12px;
  background: rgba(14, 22, 38, 0.94);
  border: 1px solid rgba(234, 179, 8, 0.5);
  border-radius: 7px;
  color: #f1dfaa;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  font-size: 11px;
  line-height: 1.5;
}

.trajectory-hint {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.6;
  margin: 8px 0 0;
}

.quarterly-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
  box-sizing: border-box;
}

.quarter-card {
  padding: 12px 14px;
  background: #090f1d;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quarter-card strong {
  font-size: 12px;
  color: #c7d4e5;
}

.quarter-card span {
  font-size: 11px;
  color: #aebfd6;
}

.quarter-card small {
  font-size: 10px;
  color: var(--text-faint);
}

.quarter-card.peak {
  border-color: rgba(215, 186, 128, 0.45);
  background: rgba(215, 186, 128, 0.05);
}

/* Remove 3 redundant stacked reference cards so canvas breathes */
#macro-windows,
#early-windows {
  display: none !important;
}

/* Progressive Disclosure Drawers (Progressive Disclosure) */
.audit-card {
  background: #0d1525;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 16px 0;
  overflow: hidden;
  box-sizing: border-box;
}

.audit-card summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 500;
  color: #cbd6e8;
  transition: background 0.16s ease;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.audit-card summary::-webkit-details-marker {
  display: none;
}

.audit-card summary:hover {
  background: #111a2d;
  color: #fff;
}

.audit-icon {
  color: var(--accent);
  font-size: 18px;
  margin-right: 10px;
}

.summary-hint {
  font-size: 10px;
  color: var(--text-faint);
}

.summary-hint b {
  font-size: 14px;
  font-weight: 400;
  color: var(--accent);
  margin-left: 10px;
}

.audit-content {
  border-top: 1px solid var(--border-subtle);
  padding: 20px 22px;
  box-sizing: border-box;
  overflow-x: hidden;
}

.audit-intro {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0 0 18px;
}

.practical-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.practical-grid h4, .strategy h4 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #88cbb7;
  margin: 0 0 10px;
}

.practical-grid .frictions h4 {
  color: #d49b99;
}

.practical-grid ul, .strategy ol {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.8;
  color: #bdcbdc;
}

.practical-grid li, .strategy li {
  margin-bottom: 8px;
}

.strategy {
  padding-top: 18px;
}

.strategy h4 {
  color: #e1c78e;
}

.strategy ol {
  list-style: decimal;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.diagnostic {
  background: #090e18;
  border: 1px solid #1c2738;
  padding: 12px 14px;
  border-radius: 7px;
  font-size: 11px;
  color: #afbdd1;
  line-height: 1.7;
}

.diagnostic strong {
  display: block;
  color: #dec89e;
  font-size: 10px;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}

.result-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card, .clocks-card {
  background: #090f1d;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.metric-card {
  text-align: center;
  padding: 18px;
}

.card-label {
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--text-faint);
  font-weight: 700;
}

.gauge {
  --score: 0;
  --gauge: #d7ba80;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  padding: 8px;
  background: conic-gradient(var(--gauge) calc(var(--score) * 1%), #1d2738 0);
  margin: 18px auto 10px;
  transform: rotate(-90deg);
}

.gauge > div {
  background: #090f1d;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transform: rotate(90deg);
}

.gauge strong {
  font: 700 32px 'Manrope', system-ui;
  letter-spacing: -1.5px;
}

.gauge span {
  font-size: 9px;
  color: #baa47d;
  margin-top: 2px;
}

.metric-card p {
  font-size: 11px;
  color: var(--text-faint);
  margin: 6px 0 0;
}

.clocks-card {
  padding: 20px;
}

.clocks-card h3 {
  font: 600 15px 'Manrope', system-ui;
  margin: 8px 0 16px;
  color: var(--text);
}

.clock-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--text-faint);
  margin: 14px 0 8px;
  font-weight: 700;
}

.pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 7px 11px;
  background: #121c2e;
  border: 1px solid #23334c;
  border-radius: 6px;
  font-size: 11px;
}

.pill small {
  font-size: 8px;
  color: #9cb0ce;
  letter-spacing: 1px;
  font-weight: 700;
}

.pill.yogini {
  border-color: #2a453b;
  background: #11231f;
  color: #a4cebe;
}

.layer {
  display: grid;
  grid-template-columns: 26px 1fr 67px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid #162235;
}

.layer .number {
  font-size: 10px;
  color: var(--text-faint);
}

.layer .name {
  font-size: 11px;
  color: #a7b9d3;
}

.layer .value {
  text-align: right;
  font-size: 11px;
  color: #dfc292;
  font-variant-numeric: tabular-nums;
}

.layer .track {
  height: 3px;
  background: #1a2538;
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.layer .track i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.raw {
  margin-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.raw summary {
  padding: 12px 0;
  font-size: 11px;
  color: var(--text-faint);
  cursor: pointer;
}

pre {
  overflow: auto;
  max-height: 300px;
  padding: 14px;
  border-radius: 7px;
  background: #080d17;
  font-size: 10px;
  color: #8da1b6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.elapsed {
  display: block;
  color: var(--text-faint);
  font-size: 10px;
  letter-spacing: 0.4px;
  margin-top: 14px;
}

.result-footnote {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.6;
  margin: 14px 0 24px;
}

/* ==========================================================================
   6. Dasha Explorer Drawer
   ========================================================================== */

.dasha-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 16, 0.75);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 60;
}

.dasha-drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(460px, 94vw);
  z-index: 65;
  background: #0d1525;
  border-left: 1px solid var(--border);
  padding: 24px;
  overflow-y: auto;
  transform: translateX(102%);
  visibility: hidden;
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.26s;
  box-sizing: border-box;
}

.dasha-drawer.open {
  transform: translateX(0);
  visibility: visible;
}

.dasha-drawer > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dasha-drawer h2 {
  font: 600 20px 'Manrope', system-ui;
  margin: 6px 0 0;
  color: var(--text);
}

.dasha-drawer header button {
  font-size: 22px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: #131c2e;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.active-dasha {
  border: 1px solid rgba(104, 127, 197, 0.35);
  border-radius: 10px;
  background: rgba(40, 57, 103, 0.25);
  padding: 16px;
  font-size: 14px;
  line-height: 1.7;
  text-transform: capitalize;
  color: #d1dcff;
  margin-top: 18px;
}

.dasha-drawer > p {
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-faint);
  margin: 12px 0 20px;
}

.dasha-period {
  border: 1px solid #1e2c44;
  border-left: 3px solid var(--lord-color);
  border-radius: 7px;
  margin: 8px 0;
  background: #0a1120;
}

.dasha-period summary {
  padding: 11px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  list-style: none;
}

.dasha-period summary strong {
  color: var(--lord-color);
  text-transform: capitalize;
  font-size: 12px;
}

.dasha-period summary > span {
  font-size: 9px;
  color: #8da2be;
}

.dasha-period.ad {
  margin: 6px 8px;
  background: #080d19;
}

.dasha-period.pd {
  margin: 4px 6px;
  border-left-width: 2px;
  background: #060a14;
}

.dasha-period.pd summary {
  padding: 8px 6px;
}

.dasha-period.pd strong {
  font-size: 11px;
}

.active-badge {
  font-size: 8px;
  color: #92d6bf;
  background: rgba(54, 81, 71, 0.45);
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.5px;
}

.main-footer {
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 24px 0 10px;
  font-size: 9px;
  color: var(--text-faint);
  letter-spacing: 0.8px;
}

.main-footer b {
  color: var(--accent);
  margin: 0 6px;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* ==========================================================================
   7. Mobile Viewport Hardening (max-width: 768px, 412px, 375px)
   ========================================================================== */

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    padding: 24px 16px 50px;
  }
}

@media (max-width: 768px) {
  .topbar {
    height: 58px;
    padding: 0 14px;
  }

  .top-left {
    gap: 12px;
  }

  .brand {
    font-size: 17px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    font-size: 17px;
  }

  .subject-pill {
    padding: 4px 8px;
    font-size: 11px;
    gap: 6px;
    max-width: calc(100vw - 120px);
  }

  .timing-precision-badge {
    display: none;
  }

  .subject-text {
    max-width: 160px;
  }

  .switch-profile-btn {
    padding: 2px 7px;
    font-size: 10px;
  }

  .environment {
    display: none;
  }

  .status {
    padding: 4px 8px;
    font-size: 10px;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    padding: 16px 14px 40px;
    gap: 20px;
  }

  .left-rail {
    position: static;
    height: auto;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .birth-chart-card {
    padding: 16px;
  }

  .kundali {
    max-width: 100%;
    min-height: 160px;
  }

  .domain-pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .domain-pill {
    padding: 8px 10px;
    font-size: 11px;
  }

  .canvas-main {
    max-width: 100%;
  }

  .query-card > .section-heading {
    padding: 14px 16px 4px;
  }

  textarea {
    width: calc(100% - 32px);
    margin: 6px 16px;
    font-size: 16px; /* Prevents auto-zoom on iOS */
  }

  .query-bottom {
    padding: 6px 16px 12px;
  }

  .narrative-card {
    padding: 18px 16px;
  }

  .executive-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .executive-answer {
    font-size: 15px;
  }

  .prose-reading {
    font-size: 14px;
  }

  .window-panel {
    padding: 16px 14px;
  }

  .quarterly-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .diagnostic-grid {
    grid-template-columns: 1fr;
  }

  .practical-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .audit-card summary {
    padding: 14px 16px;
    font-size: 12px;
  }

  .audit-content {
    padding: 16px;
  }

  .summary-hint {
    display: none;
  }

  .followup-chips {
    flex-direction: column;
    gap: 8px;
  }

  .followup-chip {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 380px) {
  .subject-text {
    max-width: 110px;
  }

  .domain-pills {
    grid-template-columns: 1fr;
  }

  .quarterly-grid {
    grid-template-columns: 1fr;
  }
}
