/* ==========================================================================
   JyotirVed Engine — Transit Moon Daily Action Predictor Redesign
   Synchronized with light (Sandalwood / Sky) & dark (Cosmic Midnight) themes
   ========================================================================== */

.tma-container {
  color: var(--ink, #0f172a);
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  background: var(--paper, #ffffff);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px 26px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

body.dark .tma-container {
  background: var(--paper, #0c1527);
  border-color: var(--line, rgba(223, 177, 91, 0.22));
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

/* ==========================================================================
   Header Bar
   ========================================================================== */
.tma-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.tma-header-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.tma-moon-squircle {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ea580c;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.08);
}

body.dark .tma-moon-squircle {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.tma-header-titles {
  display: flex;
  flex-direction: column;
}

.tma-title {
  font-family: var(--font-serif, "Cinzel", "Playfair Display", Georgia, serif);
  font-size: 22px;
  font-weight: 750;
  color: var(--ink, #0f172a);
  margin: 0 0 5px 0;
  line-height: 1.25;
  letter-spacing: -0.2px;
}

body.dark .tma-title {
  color: #f8fafc;
}

.tma-subtitle {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted, #64748b);
  margin: 0;
}

body.dark .tma-subtitle {
  color: #94a3b8;
}

.tma-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: #0284c7;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  white-space: nowrap;
}

body.dark .tma-date-pill {
  background: #0f1a2e;
  border-color: rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   4-Card KPI Ribbon
   ========================================================================== */
.tma-kpis-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

@media (max-width: 960px) {
  .tma-kpis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .tma-kpis-grid {
    grid-template-columns: 1fr;
  }
}

.tma-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: all 0.15s ease;
}

body.dark .tma-kpi-card {
  background: #0f1a2e;
  border-color: rgba(223, 177, 91, 0.18);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.tma-kpi-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

body.dark .tma-kpi-card:hover {
  border-color: rgba(223, 177, 91, 0.35);
}

.tma-kpi-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tma-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Icon box themes */
.tma-icon-moon {
  background: #e0f2fe;
  color: #0284c7;
}

body.dark .tma-icon-moon {
  background: rgba(2, 132, 199, 0.18);
  color: #38bdf8;
}

.tma-icon-lagna {
  background: #e0e7ff;
  color: #4f46e5;
}

body.dark .tma-icon-lagna {
  background: rgba(79, 70, 229, 0.18);
  color: #818cf8;
}

.tma-icon-natalmoon {
  background: #d1fae5;
  color: #059669;
}

body.dark .tma-icon-natalmoon {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

.tma-icon-strength {
  background: #fef3c7;
  color: #d97706;
}

body.dark .tma-icon-strength {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

.tma-kpi-meta {
  display: flex;
  flex-direction: column;
}

.tma-kpi-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.tma-label-moon {
  color: #0284c7;
}

body.dark .tma-label-moon {
  color: #38bdf8;
}

.tma-label-lagna {
  color: #4f46e5;
}

body.dark .tma-label-lagna {
  color: #818cf8;
}

.tma-label-natalmoon {
  color: #059669;
}

body.dark .tma-label-natalmoon {
  color: #34d399;
}

.tma-label-strength {
  color: #d97706;
}

body.dark .tma-label-strength {
  color: #fbbf24;
}

.tma-kpi-val {
  font-size: 16px;
  font-weight: 750;
  color: var(--ink, #0f172a);
}

body.dark .tma-kpi-val {
  color: #f1f5f9;
}

.tma-val-big {
  font-size: 18px;
  font-weight: 800;
}

.tma-val-strength {
  color: #ea580c;
  font-size: 18px;
  font-weight: 800;
}

body.dark .tma-val-strength {
  color: #fb923c;
}

.tma-kpi-zodiac {
  font-size: 26px;
  color: #0284c7;
  opacity: 0.9;
  line-height: 1;
  flex-shrink: 0;
  font-family: "Segoe UI Symbol", "Apple Color Emoji", sans-serif;
}

body.dark .tma-kpi-zodiac {
  color: #38bdf8;
}

/* ==========================================================================
   Hero Banner: Today's Practical Action Prediction
   ========================================================================== */
.tma-hero-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 55%, #ecfdf5 100%);
  border: 1px solid #bae6fd;
  border-radius: 16px;
  padding: 22px 26px 20px;
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
  box-shadow: 0 4px 18px rgba(2, 132, 199, 0.04);
}

body.dark .tma-hero-card {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.14) 0%, rgba(14, 165, 233, 0.08) 55%, rgba(16, 185, 129, 0.08) 100%);
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.tma-hero-watermark {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 140px;
  height: 140px;
  pointer-events: none;
  opacity: 0.28;
}

body.dark .tma-hero-watermark {
  opacity: 0.12;
}

.tma-hero-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.tma-hero-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #0284c7;
}

body.dark .tma-hero-label {
  color: #38bdf8;
}

.tma-hero-text {
  font-size: 13.5px;
  line-height: 1.65;
  color: #1e293b;
  position: relative;
  z-index: 1;
  max-width: 88%;
  margin: 0 0 16px 0;
}

body.dark .tma-hero-text {
  color: #f1f5f9;
}

.tma-dkp-ribbon {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(186, 230, 253, 0.85);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #475569;
  position: relative;
  z-index: 1;
}

body.dark .tma-dkp-ribbon {
  background: rgba(12, 21, 39, 0.85);
  border-color: rgba(56, 189, 248, 0.25);
  color: #cbd5e1;
}

.tma-dkp-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  color: #0284c7;
  padding: 2px 7px;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: 6px;
}

body.dark .tma-dkp-tag {
  background: rgba(2, 132, 199, 0.2);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

/* ==========================================================================
   Reference Cards (Lagna & Natal Moon)
   ========================================================================== */
.tma-refs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 22px;
}

@media (max-width: 860px) {
  .tma-refs-grid {
    grid-template-columns: 1fr;
  }
}

.tma-ref-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.dark .tma-ref-card {
  background: #0f1a2e;
  border-color: rgba(223, 177, 91, 0.18);
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.25);
}

.tma-ref-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

.tma-ref-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tma-spark-icon {
  color: #0284c7;
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
}

body.dark .tma-spark-icon {
  color: #38bdf8;
}

.tma-ref-title {
  font-family: var(--font-serif, "Cinzel", "Playfair Display", Georgia, serif);
  font-size: 17px;
  font-weight: 750;
  color: var(--ink, #0f172a);
  margin: 0;
}

body.dark .tma-ref-title {
  color: #f8fafc;
}

.tma-ref-pill {
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 11.5px;
  font-weight: 700;
  color: #0284c7;
  white-space: nowrap;
}

body.dark .tma-ref-pill {
  background: rgba(2, 132, 199, 0.18);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

/* Activated Field Box */
.tma-field-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

body.dark .tma-field-box {
  background: rgba(16, 28, 51, 0.6);
  border-color: rgba(255, 255, 255, 0.06);
}

.tma-field-label {
  color: #0284c7;
  font-size: 12.5px;
  font-weight: 750;
  min-width: 100px;
  flex-shrink: 0;
}

body.dark .tma-field-label {
  color: #38bdf8;
}

.tma-field-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: #334155;
}

body.dark .tma-field-text {
  color: #cbd5e1;
}

/* PAC Pills Row */
.tma-pac-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tma-pac-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

/* Lagna Placement: Amber */
.tma-pac-placement-lagna {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #d97706;
}

body.dark .tma-pac-placement-lagna {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

/* Moon Placement: Emerald */
.tma-pac-placement-moon {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #059669;
}

body.dark .tma-pac-placement-moon {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

/* Aspects: Blue */
.tma-pac-aspects {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
}

body.dark .tma-pac-aspects {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

/* Conjunction: Purple */
.tma-pac-conjunction {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  color: #7c3aed;
}

body.dark .tma-pac-conjunction {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(167, 139, 250, 0.3);
  color: #c084fc;
}

/* House Lord Box */
.tma-lord-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

body.dark .tma-lord-box {
  background: rgba(16, 28, 51, 0.6);
  border-color: rgba(255, 255, 255, 0.06);
}

.tma-lord-label {
  color: #0284c7;
  font-size: 12.5px;
  font-weight: 750;
  min-width: 80px;
  flex-shrink: 0;
}

body.dark .tma-lord-label {
  color: #38bdf8;
}

.tma-lord-text {
  font-size: 12.5px;
  font-weight: 600;
  color: #1e293b;
}

body.dark .tma-lord-text {
  color: #f1f5f9;
}

/* Formula Bar */
.tma-formula-box {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

body.dark .tma-formula-box {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}

.tma-formula-label {
  font-weight: 750;
  color: #1e293b;
  min-width: 60px;
  flex-shrink: 0;
}

body.dark .tma-formula-label {
  color: #f1f5f9;
}

.tma-formula-text {
  font-size: 12px;
  color: #475569;
  overflow-x: auto;
  white-space: nowrap;
}

body.dark .tma-formula-text {
  color: #94a3b8;
}

/* ==========================================================================
   Rule & Interpretation Safety Accordion
   ========================================================================== */
.tma-safety-details {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  overflow: hidden;
  transition: all 0.2s ease;
}

body.dark .tma-safety-details {
  background: #0f1a2e;
  border-color: rgba(223, 177, 91, 0.18);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.tma-safety-summary {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

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

.tma-safety-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tma-safety-title {
  font-family: var(--font-serif, "Cinzel", "Playfair Display", Georgia, serif);
  font-size: 16px;
  font-weight: 750;
  color: var(--ink, #0f172a);
}

body.dark .tma-safety-title {
  color: #f8fafc;
}

.tma-chevron {
  color: #64748b;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

body.dark .tma-chevron {
  color: #94a3b8;
}

.tma-safety-details[open] .tma-chevron {
  transform: rotate(180deg);
}

.tma-safety-body {
  padding: 16px 20px 18px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
}

body.dark .tma-safety-body {
  border-top-color: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}

.tma-safety-row {
  margin: 0;
}

.tma-safety-row b {
  color: var(--ink, #0f172a);
}

body.dark .tma-safety-row b {
  color: #f8fafc;
}
