/* ============================================================================
 * Matrix Destiny Calculators — styles (v1.2.1)
 * Documented palette (docs/calculator-ui-palette.md):
 *   Midnight navy  #11152B  (prominent sections, active tab, chart backdrop)
 *   Indigo         #4F46A5  (primary accent, numbers, links)
 *   Violet         #8067D8  (secondary accent, focus rings)
 *   Gold           #D9B66F  (restrained highlight: key chart points, primary CTA)
 *   Ivory          #FAF8F3  (form + panel surfaces)
 *   Body text      #303447  ·  Muted #6B7080  ·  White #FFFFFF
 *   Error surface  #FDECEC  ·  Error text/border #A12626 / #F3B3B3
 * ========================================================================== */

.mdc-wrap {
  --mdc-navy: #11152B;
  --mdc-indigo: #4F46A5;
  --mdc-violet: #8067D8;
  --mdc-gold: #D9B66F;
  --mdc-ivory: #FAF8F3;
  --mdc-body: #303447;
  --mdc-muted: #6B7080;
  --mdc-radius: 14px;
  color: var(--mdc-body);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  max-width: 980px;
  margin: 0 auto;
}

/* ---------- mode selector: segmented pill control ---------- */
.mdc-tabs {
  display: flex;
  gap: 6px;
  background: rgba(79, 70, 165, .07);
  border: 1.5px solid rgba(79, 70, 165, .16);
  border-radius: 999px;
  padding: 5px;
  margin-bottom: 28px;
}
.mdc-tab {
  appearance: none;
  flex: 1 1 0;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 12px 18px;
  min-height: 48px;
  font-size: 15px;
  font-weight: 600;
  color: var(--mdc-muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.mdc-tab:hover { color: var(--mdc-indigo); }
.mdc-tab:focus-visible {
  outline: 2px solid var(--mdc-violet);
  outline-offset: 2px;
}
.mdc-tab-active {
  background: var(--mdc-navy);
  color: #fff;
  box-shadow: 0 4px 14px rgba(17, 21, 43, .25);
}
.mdc-tab-active:hover { color: #fff; }

/* ---------- forms ---------- */
.mdc-form {
  background: var(--mdc-ivory);
  border: 1px solid rgba(79, 70, 165, .18);
  border-radius: var(--mdc-radius);
  padding: 28px;
  box-shadow: 0 10px 30px rgba(17, 21, 43, .07);
}
.mdc-field { margin-bottom: 18px; }
.mdc-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--mdc-navy);
}
.mdc-input {
  width: 100%;
  max-width: 340px;
  padding: 12px 14px;
  min-height: 48px;
  font-size: 16px;
  border: 1.5px solid rgba(79, 70, 165, .28);
  border-radius: 10px;
  background: #fff;
  color: var(--mdc-navy);
}
.mdc-input:focus {
  outline: 2px solid var(--mdc-violet);
  outline-offset: 1px;
  border-color: var(--mdc-violet);
}
.mdc-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
}
.mdc-legend {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mdc-navy);
  margin-bottom: 7px;
  padding: 0;
}
.mdc-dob-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 420px;
}
.mdc-dob-grid .mdc-field { margin-bottom: 0; }
.mdc-dob-grid .mdc-input { max-width: none; text-align: center; }

.mdc-error {
  background: #fdecec;
  border: 1px solid #f3b3b3;
  border-left: 4px solid #a12626;
  color: #a12626;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 0 0 16px;
  font-size: 14.5px;
  font-weight: 500;
}
.mdc-error:focus { outline: 2px solid #a12626; }

/* ---------- buttons ---------- */
.mdc-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 13px 30px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--mdc-gold), #c79f52);
  color: var(--mdc-navy);
  box-shadow: 0 6px 18px rgba(217, 182, 111, .35);
  transition: transform .12s ease, box-shadow .12s ease;
}
.mdc-btn:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(217, 182, 111, .45); }
.mdc-btn:active { transform: translateY(0); }
.mdc-btn-secondary {
  background: #fff;
  color: var(--mdc-indigo);
  border: 1.5px solid rgba(79, 70, 165, .35);
  box-shadow: none;
}
.mdc-btn-secondary:hover { box-shadow: 0 4px 12px rgba(79, 70, 165, .15); }
.mdc-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ---------- results ---------- */
.mdc-results { margin-top: 36px; }
.mdc-results-title {
  font-size: 26px;
  color: var(--mdc-navy);
  margin: 0 0 20px;
}
.mdc-chart-wrap {
  background: radial-gradient(1200px 600px at 50% 0%, #1b2140 0%, var(--mdc-navy) 70%);
  border-radius: var(--mdc-radius);
  padding: 18px;
  margin-bottom: 28px;
  box-shadow: 0 14px 40px rgba(17, 21, 43, .28);
}
.mdc-chart-svg { width: 100%; height: auto; display: block; max-width: 640px; margin: 0 auto; }

.mdc-result-section {
  background: #fff;
  border: 1px solid rgba(79, 70, 165, .14);
  border-radius: var(--mdc-radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  scroll-margin-top: 96px;
}
.mdc-section-title {
  font-size: 18px;
  color: var(--mdc-navy);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(217, 182, 111, .35);
}
.mdc-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  background: rgba(217, 182, 111, .18);
  color: #8a6a2c;
  border: 1px solid rgba(217, 182, 111, .6);
  border-radius: 999px;
  padding: 3px 10px;
  vertical-align: middle;
}
.mdc-tail-seq {
  font-size: 30px;
  font-weight: 800;
  color: var(--mdc-indigo);
  letter-spacing: 2px;
  margin: 4px 0 14px;
}
.mdc-note { font-size: 14px; color: var(--mdc-muted); margin: 10px 0 0; }
.mdc-disclaimer {
  font-size: 13px;
  color: var(--mdc-muted);
  border-left: 3px solid var(--mdc-gold);
  padding-left: 12px;
  margin: 24px 0 0;
}
.mdc-share-note { font-size: 13.5px; color: var(--mdc-indigo); min-height: 20px; }

.mdc-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.mdc-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--mdc-muted);
  padding: 8px 10px;
  border-bottom: 2px solid rgba(79, 70, 165, .2);
}
.mdc-table td { padding: 9px 10px; border-bottom: 1px solid rgba(79, 70, 165, .1); }
.mdc-td-num { font-weight: 800; color: var(--mdc-indigo); font-size: 17px; }
.mdc-td-arcana { color: var(--mdc-body); }
.mdc-td-label { color: var(--mdc-body); }
.mdc-total-row td { border-top: 2px solid rgba(79, 70, 165, .25); font-weight: 700; }

.mdc-arcana-list { margin: 0; }
.mdc-arcana-list dt { font-weight: 700; color: var(--mdc-navy); margin-top: 12px; }
.mdc-arcana-list dd { margin: 4px 0 0; font-size: 14.5px; color: var(--mdc-body); }

.mdc-stub-card {
  background: var(--mdc-ivory);
  border: 1px dashed rgba(79, 70, 165, .4);
  border-radius: var(--mdc-radius);
  padding: 28px;
}

/* ---------- children form: boy/girl radios + result extras ---------- */
.mdc-radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
.mdc-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid rgba(79, 70, 165, .28);
  border-radius: 999px;
  padding: 10px 18px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  color: var(--mdc-navy);
  cursor: pointer;
}
.mdc-radio input {
  accent-color: var(--mdc-indigo);
  width: 17px;
  height: 17px;
  margin: 0;
  cursor: pointer;
}
.mdc-results-sub {
  font-size: 15px;
  color: var(--mdc-muted);
  margin: -10px 0 20px;
}
.mdc-reading-head {
  font-size: 16px;
  color: var(--mdc-navy);
  margin: 0 0 8px;
}
.mdc-reading {
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

/* ---------- results: empty state + section navigation ---------- */
.mdc-empty {
  border: 1.5px dashed rgba(79, 70, 165, .35);
  background: var(--mdc-ivory);
  color: var(--mdc-muted);
  border-radius: var(--mdc-radius);
  padding: 26px 22px;
  text-align: center;
  font-size: 14.5px;
}
.mdc-result-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding: 10px;
  background: rgba(250, 248, 243, .96);
  border: 1px solid rgba(79, 70, 165, .14);
  border-radius: var(--mdc-radius);
  position: sticky;
  top: 12px;
  z-index: 5;
}
.mdc-nav-chip {
  font-size: 13px;
  font-weight: 600;
  color: var(--mdc-indigo);
  background: #fff;
  border: 1.5px solid rgba(79, 70, 165, .25);
  border-radius: 999px;
  padding: 7px 13px;
  text-decoration: none;
}
.mdc-nav-chip:hover {
  border-color: var(--mdc-violet);
  color: var(--mdc-navy);
}
.mdc-nav-chip:focus-visible {
  outline: 2px solid var(--mdc-violet);
  outline-offset: 2px;
}

/* ---------- privacy note ---------- */
.mdc-privacy-note { font-size: 13px; color: var(--mdc-muted); margin-top: 18px; }

/* ---------- responsive ---------- */
@media (max-width: 768px) {
  .mdc-form { padding: 24px 20px; }
  .mdc-result-section { padding: 20px; }
}
@media (max-width: 640px) {
  .mdc-form { padding: 20px 16px; }
  .mdc-tab {
    padding: 10px 6px;
    min-height: 44px;
    font-size: 13.5px;
    text-align: center;
  }
  .mdc-results-title { font-size: 22px; }
  .mdc-tail-seq { font-size: 24px; }
  .mdc-chart-wrap { padding: 8px; }
  .mdc-result-nav { top: 8px; }
  .mdc-btn { width: 100%; }
  .mdc-actions .mdc-btn { width: auto; flex: 1 1 auto; }
}

/* ---------- print ---------- */
@media print {
  .mdc-tabs, .mdc-form, .mdc-actions, .mdc-share-note, .mdc-result-nav, .mdc-empty { display: none !important; }
  .mdc-wrap { max-width: none; }
  .mdc-chart-wrap {
    background: #fff !important;
    box-shadow: none;
    border: 1px solid #ccc;
  }
  .mdc-result-section { break-inside: avoid; box-shadow: none; }
}

/* ---------- 1.2.3: result header + chart/Health Map pairing (appended only; no existing rule changed) ---------- */
.mdc-result-head { margin-bottom: 20px; }
.mdc-result-head .mdc-results-title { margin-bottom: 8px; }
.mdc-dob-badge {
  display: inline-block;
  margin: 0;
  padding: 4px 14px;
  border: 1px solid rgba(217, 182, 111, .6);
  border-radius: 999px;
  background: rgba(217, 182, 111, .16);
  color: var(--mdc-navy, #11152B);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
}
.mdc-chart-health-grid { display: block; margin-bottom: 28px; }
.mdc-chart-health-grid .mdc-chart-wrap { margin-bottom: 20px; }
.mdc-chart-health-grid .mdc-result-section { margin-bottom: 0; }
@media (min-width: 1024px) {
  .mdc-chart-health-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }
  .mdc-chart-health-grid .mdc-chart-wrap { margin-bottom: 0; }
}
@media print {
  .mdc-chart-health-grid { display: block; }
}

/* ---------- 1.2.4: centered chart-panel header + dark Health Map card (appended only) ---------- */
.mdc-chart-head { text-align: center; padding: 8px 8px 16px; }
.mdc-chart-name {
  color: #FFFFFF;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  line-height: 1.15;
  margin: 0 0 10px;
}
.mdc-chart-pill {
  display: inline-block;
  margin: 2px 4px;
  padding: 5px 16px;
  border: 1px solid rgba(217, 182, 111, .65);
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .06em;
}
.mdc-born-label { color: #D9B66F; font-weight: 800; letter-spacing: .14em; margin-right: 8px; }
.mdc-chart-sub { color: #C7C2E4; font-size: 14px; margin: 10px 0 0; }
/* Health Map card goes dark to match the chart panel (grid context only). */
.mdc-chart-health-grid .mdc-result-section {
  background: radial-gradient(1200px 600px at 50% 0%, #1b2140 0%, #11152B 70%);
  border-color: rgba(217, 182, 111, .28);
  color: #FAF8F3;
}
.mdc-chart-health-grid .mdc-section-title { color: #D9B66F; }
.mdc-chart-health-grid .mdc-table th { color: #C7C2E4; }
.mdc-chart-health-grid .mdc-table td { border-bottom-color: rgba(255, 255, 255, .12); color: #E5E7EB; }
.mdc-chart-health-grid .mdc-table td:nth-child(2) { color: #E8C87E; }
.mdc-chart-health-grid .mdc-table td:nth-child(3) { color: #93C5FD; }
.mdc-chart-health-grid .mdc-table td:nth-child(4) { color: #FFFFFF; }
.mdc-chart-health-grid .mdc-total-row td { border-top-color: rgba(217, 182, 111, .45); }
.mdc-chart-health-grid .mdc-note { color: #C7C2E4; }
@media print {
  .mdc-chart-name { color: #11152B; }
  .mdc-chart-pill { color: #11152B; background: none; border-color: #999; }
  .mdc-born-label { color: #7a5f14; }
  .mdc-chart-sub { color: #333; }
  .mdc-chart-health-grid .mdc-result-section { background: #fff !important; color: #11152B; border-color: #ccc; }
  .mdc-chart-health-grid .mdc-section-title { color: #11152B; }
  .mdc-chart-health-grid .mdc-table th,
  .mdc-chart-health-grid .mdc-table td,
  .mdc-chart-health-grid .mdc-note { color: #11152B; }
}

/* ---------- 1.2.5: Detailed 22 Arcana Report (Personal only, appended only) ---------- */
.mdc-report-section {
  background: radial-gradient(1200px 600px at 50% 0%, #1b2140 0%, #11152B 70%);
  border-color: rgba(217, 182, 111, .28);
  color: #FAF8F3;
}
.mdc-report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.mdc-report-eyebrow { color: #D9B66F; font-size: 12px; letter-spacing: .18em; font-weight: 700; margin: 0 0 6px; }
.mdc-report-section .mdc-section-title { color: #FFFFFF; margin: 0; }
.mdc-report-clear { flex-shrink: 0; }
.mdc-report-glance { border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; padding: 16px; margin-top: 16px; background: rgba(255, 255, 255, .04); }
.mdc-report-summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.mdc-report-summary::-webkit-details-marker { display: none; }
.mdc-report-summary-text { flex: 1 1 auto; min-width: 0; }
.mdc-report-summary-title { display: block; font-size: 18px; font-weight: 700; color: #FFFFFF; }
.mdc-report-summary-sub { display: block; font-size: 14px; color: #C7C2E4; }
.mdc-report-chevron { color: #D9B66F; font-size: 18px; transition: transform .2s; }
.mdc-report-glance[open] .mdc-report-chevron { transform: rotate(180deg); }
.mdc-report-circle { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1.5px solid #D9B66F; background: rgba(0, 0, 0, .25); color: #FFFFFF; font-weight: 800; flex-shrink: 0; }
.mdc-report-circle-sm { width: 36px; height: 36px; font-size: 15px; }
.mdc-report-circle-lg { width: 56px; height: 56px; font-size: 22px; background: #D9B66F; color: #11152B; }
.mdc-report-cards { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 16px; }
@media (min-width: 640px) { .mdc-report-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .mdc-report-cards { grid-template-columns: repeat(4, 1fr); } }
.mdc-report-card { display: flex; align-items: center; gap: 10px; text-align: left; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; padding: 12px; cursor: pointer; color: #FAF8F3; }
.mdc-report-card.is-active { border-color: #D9B66F; background: rgba(217, 182, 111, .12); }
.mdc-report-card.is-active .mdc-report-circle { background: #D9B66F; color: #11152B; }
.mdc-report-card-num { color: #D9B66F; font-size: 13px; font-weight: 700; }
.mdc-report-card-label { flex: 1 1 auto; font-size: 14px; font-weight: 600; line-height: 1.3; }
.mdc-report-topic { margin-top: 20px; }
.mdc-report-topic-label { color: #D9B66F; font-size: 12px; letter-spacing: .18em; font-weight: 700; margin: 0 0 12px; }
.mdc-report-topic-head { display: flex; align-items: center; gap: 14px; }
.mdc-report-topic-title { color: #FFFFFF; font-size: 20px; margin: 0; }
.mdc-report-framing { color: #C7C2E4; font-style: italic; }
.mdc-report-essay { color: #E5E7EB; line-height: 1.65; }
.mdc-report-section .mdc-disclaimer { color: #C7C2E4; }
@media print {
  .mdc-report-section { background: #fff !important; color: #11152B !important; border-color: #ccc !important; }
  .mdc-report-section .mdc-section-title, .mdc-report-summary-title, .mdc-report-topic-title, .mdc-report-card-label { color: #11152B !important; }
  .mdc-report-summary-sub, .mdc-report-framing, .mdc-report-section .mdc-disclaimer { color: #444 !important; }
  .mdc-report-essay { color: #222 !important; }
  .mdc-report-circle { border-color: #11152B !important; color: #11152B !important; background: #fff !important; }
  .mdc-report-circle-lg { background: #11152B !important; color: #fff !important; }
}

/* ---------- 1.2.6: 27-report selector system (Personal only, appended only) ---------- */
.mdc-report-layout { display: block; margin-top: 16px; }
@media (min-width: 1024px) {
  .mdc-report-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
  .mdc-report-detail { position: sticky; top: 16px; }
}
.mdc-report-selector-toggle { display: flex; justify-content: space-between; align-items: center; width: 100%; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16); border-radius: 12px; padding: 12px 14px; color: #FAF8F3; font-weight: 700; cursor: pointer; margin-bottom: 12px; }
@media (min-width: 1024px) { .mdc-report-selector-toggle { display: none; } }
@media (max-width: 1023px) {
  .mdc-report-selector-col:not(.is-open) .mdc-report-selector { display: none; }
  .mdc-report-selector-col.is-open .mdc-report-selector-toggle .mdc-report-chevron { transform: rotate(180deg); }
}
.mdc-report-selector { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 1024px) { .mdc-report-selector { max-height: 75vh; overflow-y: auto; padding-right: 4px; } }
.mdc-report-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; padding: 10px 12px; cursor: pointer; color: #FAF8F3; }
.mdc-report-item.is-active { border-color: #D9B66F; background: rgba(217, 182, 111, .12); }
.mdc-report-item.is-active .mdc-report-circle { background: #D9B66F; color: #11152B; }
.mdc-report-circle-xs { width: 30px; height: 30px; font-size: 13px; margin-top: 2px; }
.mdc-report-item-text { flex: 1 1 auto; min-width: 0; }
.mdc-report-item-title { display: block; font-size: 14px; font-weight: 700; line-height: 1.3; }
.mdc-report-item-desc { display: block; font-size: 12.5px; color: #C7C2E4; line-height: 1.4; margin-top: 2px; }
.mdc-report-pending-tag { flex-shrink: 0; font-size: 11px; font-weight: 700; color: #C7C2E4; border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: 3px 8px; margin-top: 2px; white-space: nowrap; }
.mdc-report-detail { min-width: 0; border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; padding: 16px; background: rgba(255, 255, 255, .04); margin-top: 16px; }
@media (min-width: 1024px) { .mdc-report-detail { margin-top: 0; } }
.mdc-report-detail-title { color: #FFFFFF; font-size: 20px; margin: 0 0 6px; }
.mdc-report-detail-desc { color: #C7C2E4; margin: 0 0 12px; }
.mdc-report-section .mdc-note { color: #C7C2E4; }
.mdc-report-section .mdc-table th { color: #C7C2E4; }
.mdc-report-section .mdc-table td { color: #E5E7EB; border-bottom-color: rgba(255, 255, 255, .12); }
.mdc-report-section .mdc-table td:nth-child(2) { color: #E8C87E; }
.mdc-report-section .mdc-table td:nth-child(3) { color: #FFFFFF; }
.mdc-report-essay-h { color: #D9B66F; font-size: 16px; margin: 20px 0 4px; }
.mdc-report-status { border: 1px dashed rgba(217, 182, 111, .5); border-radius: 12px; padding: 12px 14px; color: #E8C87E; font-weight: 600; }
.mdc-report-related { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 20px; }
.mdc-report-related-label { color: #C7C2E4; font-size: 13px; font-weight: 700; }
.mdc-report-chip { background: transparent; border: 1px solid #D9B66F; color: #D9B66F; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; font-weight: 600; }
@media print {
  .mdc-report-detail, .mdc-report-item { background: #fff !important; border-color: #ccc !important; }
  .mdc-report-detail-title, .mdc-report-item-title { color: #11152B !important; }
  .mdc-report-detail-desc, .mdc-report-item-desc, .mdc-report-section .mdc-note { color: #444 !important; }
  .mdc-report-section .mdc-table td { color: #222 !important; }
  .mdc-report-section .mdc-table td:nth-child(2) { color: #11152B !important; }
}

/* ---------- 1.2.7: 27-report accordion rows (Personal only, appended only) ---------- */
.mdc-report-accordion { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.mdc-report-accordion-item { border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px; background: rgba(255, 255, 255, .04); overflow: hidden; }
.mdc-report-accordion-head { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; background: transparent; border: 0; padding: 14px 16px; cursor: pointer; color: #FAF8F3; }
.mdc-report-accordion-head .mdc-report-circle { flex-shrink: 0; width: 44px; height: 44px; font-size: 18px; margin-top: 0; }
.mdc-report-accordion-head .mdc-report-pending-tag { margin-top: 10px; }
.mdc-report-accordion-head .mdc-report-item-text { flex: 1 1 auto; min-width: 0; }
.mdc-report-accordion-head .mdc-report-item-title { font-size: 17px; }
.mdc-report-accordion-head .mdc-report-item-desc { font-size: 13.5px; }
.mdc-report-accordion-head .mdc-report-chevron { flex-shrink: 0; width: 28px; height: 28px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #C7C2E4; margin-top: 8px; transition: transform .2s ease; }
.mdc-report-accordion-head[aria-expanded="true"] .mdc-report-chevron { transform: rotate(180deg); }
.mdc-report-accordion-body { display: none; padding: 16px; border-top: 1px solid rgba(255, 255, 255, .10); }
.mdc-report-accordion-body.is-open { display: block; }
@media print {
  .mdc-report-accordion-body { display: block !important; }
  .mdc-report-accordion-item { background: #fff !important; border-color: #ccc !important; }
  .mdc-report-accordion-head { color: #11152B !important; }
  .mdc-report-accordion-head .mdc-report-item-desc { color: #444 !important; }
}

/* ---------- 1.2.9: calculation loading overlay (appended only) ---------- */
.mdc-loader-overlay { position: fixed; inset: 0; z-index: 99999; background: rgba(17, 21, 43, .94); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 1; transition: opacity .32s ease; }
.mdc-loader-overlay.is-fading { opacity: 0; }
.mdc-loader-card { width: 100%; max-width: 420px; background: #171a2e; border: 1px solid rgba(217, 182, 111, .35); border-radius: 24px; padding: 32px 28px 28px; text-align: center; color: #FAF8F3; box-shadow: 0 24px 64px rgba(0, 0, 0, .5); }
.mdc-loader-ring { position: relative; width: 84px; height: 84px; margin: 0 auto 20px; }
.mdc-loader-ring svg { width: 84px; height: 84px; display: block; }
.mdc-loader-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; color: #FAF8F3; }
.mdc-loader-eyebrow { color: #D9B66F; letter-spacing: .18em; font-size: 12px; font-weight: 700; margin: 0 0 8px; }
.mdc-loader-heading { font-family: Cinzel, serif; font-size: 30px; line-height: 1.2; margin: 0 0 4px; color: #FFFFFF; }
.mdc-loader-for { color: #D9B66F; font-style: italic; font-size: 17px; margin: 0 0 4px; }
.mdc-loader-opening { color: #9aa0b4; font-size: 14px; margin: 0 0 16px; }
.mdc-loader-bar { height: 6px; background: rgba(255, 255, 255, .12); border-radius: 999px; overflow: hidden; margin: 16px 0 20px; }
.mdc-loader-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, #D9B66F, #FACC15); border-radius: 999px; transition: width .3s ease; }
.mdc-loader-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.mdc-loader-step { display: flex; align-items: center; gap: 10px; color: #8b90a7; font-size: 15px; }
.mdc-loader-step.is-done { color: #EDEDF2; }
.mdc-loader-check { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .25); display: flex; align-items: center; justify-content: center; font-size: 13px; color: #fff; }
.mdc-loader-step.is-done .mdc-loader-check { background: #22c55e; border-color: #22c55e; }
.mdc-loader-note { color: #8b90a7; font-size: 13px; margin: 20px 0 0; }
@media print { .mdc-loader-overlay { display: none !important; } }

/* ---------- 1.3.0: reading-accordion eyebrows (Children + Compatibility, appended only) ---------- */
.mdc-report-accordion-head .mdc-report-item-eyebrow { display: block; font-size: 11px; letter-spacing: .14em; color: #9aa0b4; font-weight: 700; margin-bottom: 2px; }

/* ---------- 1.3.4: children age banner + chart/detail-panel pairing (appended only; no existing rule changed) ---------- */
.mdc-child-banner {
  display: flex;
  gap: 18px;
  align-items: center;
  background: radial-gradient(1200px 600px at 50% 0%, #1b2140 0%, var(--mdc-navy) 70%);
  border-radius: var(--mdc-radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 14px 40px rgba(17, 21, 43, .28);
}
.mdc-child-banner-circle {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  line-height: 72px;
  text-align: center;
  border: 2px solid var(--mdc-gold);
  border-radius: 50%;
  color: #fff;
  font-size: 30px;
  font-weight: 800;
}
.mdc-child-banner-band {
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 4px;
}
.mdc-child-banner-note {
  color: rgba(250, 248, 243, .72);
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0;
}
.mdc-chart-panel-grid { display: block; margin-bottom: 28px; }
.mdc-chart-panel-grid .mdc-chart-wrap { margin-bottom: 20px; }
@media (min-width: 1024px) {
  .mdc-chart-panel-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }
  .mdc-chart-panel-grid .mdc-chart-wrap { margin-bottom: 0; }
}
@media print {
  .mdc-chart-panel-grid { display: block; }
}
.mdc-child-panel {
  background: radial-gradient(1200px 600px at 50% 0%, #1b2140 0%, var(--mdc-navy) 70%);
  border-radius: var(--mdc-radius);
  padding: 22px 24px;
  box-shadow: 0 14px 40px rgba(17, 21, 43, .28);
  color: var(--mdc-ivory);
}
.mdc-child-panel-eyebrow {
  display: block;
  color: var(--mdc-gold);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.mdc-child-panel-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.mdc-child-panel-circle {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: 50%;
  background: var(--mdc-ivory);
  color: var(--mdc-navy);
  font-size: 17px;
  font-weight: 800;
}
.mdc-child-panel-name { color: #fff; font-size: 20px; font-weight: 800; }
.mdc-child-panel-tagline { color: rgba(250, 248, 243, .85); font-size: 15.5px; margin: 0 0 12px; }
.mdc-child-panel-body .mdc-reading { color: rgba(250, 248, 243, .92); }
.mdc-child-panel-body .mdc-tail-seq { color: #fff; }
.mdc-child-panel-body .mdc-note { color: rgba(250, 248, 243, .72); }
.mdc-child-panel-best-title { color: #fff; font-size: 17px; font-weight: 800; margin: 16px 0 8px; }
.mdc-child-panel-best { margin: 0; padding-left: 20px; color: rgba(250, 248, 243, .92); }
.mdc-child-panel-best li { margin-bottom: 8px; line-height: 1.55; }

/* ---------- 1.3.5: Personal health panel restyle (appended only; numbers unchanged) ---------- */
.mdc-health-panel .mdc-section-title { text-align: center; letter-spacing: 1.6px; text-transform: uppercase; border-bottom: none; padding-bottom: 0; }
.mdc-health-formula { text-align: center; color: #C7C2E4; font-size: 14px; margin: 0 0 14px; }
.mdc-health-chakra { display: block; font-weight: 700; color: #FFFFFF; }
.mdc-health-part { display: block; font-size: 13px; color: #C7C2E4; font-weight: 400; }
.mdc-chart-health-grid .mdc-health-panel .mdc-table td:nth-child(2) { color: #93C5FD; }
.mdc-chart-health-grid .mdc-health-panel .mdc-table td:nth-child(3) { color: #E8C87E; }
.mdc-chart-health-grid .mdc-health-panel .mdc-table td:nth-child(4) { color: #FFFFFF; font-weight: 800; }
@media print {
  .mdc-health-panel .mdc-health-part, .mdc-health-panel .mdc-health-formula { color: #333; }
}

/* ---------- 1.3.6: dark reading-section support + Children panel stretch (appended only) ---------- */
.mdc-report-section .mdc-tail-seq { color: #E8C87E; }
@media (min-width: 1024px) {
  .mdc-chart-panel-grid { align-items: stretch; }
  .mdc-child-panel-wrap { display: flex; }
  .mdc-child-panel { height: 100%; box-sizing: border-box; }
}

/* ---------- 1.3.9: report header at phone width (appended only) ---------- */
/* At <=640px the global .mdc-btn { width: 100% } rule (meant for form and
   action buttons) also hit the CLEAR button in the report header, so the
   flex-row header collapsed its titles column and the "MATRIX DESTINY"
   eyebrow stacked one letter per line. Resetting the button to its natural
   width and letting the header wrap restores the row without touching any
   existing rule, desktop layout, or other button. */
@media (max-width: 640px) {
  .mdc-report-head { flex-wrap: wrap; }
  .mdc-report-clear { width: auto; }
}

/* ---------- 1.3.10: report subtitle (appended only) ---------- */
.mdc-report-subtitle { color: #C7C2E4; font-size: 14px; margin: 6px 0 0; }

/* ---------- 1.3.12: responsive tables + Glance 3+1 cards (appended only) ---------- */
/* A table that is genuinely wider than its section scrolls inside its own
   .mdc-table-scroll container (see tableScroll in calculator.js) instead
   of pushing the page sideways; ordinary tables are unchanged. The
   min-width resets keep grid/flex children from forcing overflow. */
.mdc-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mdc-result-section { min-width: 0; }
.mdc-report-card { min-width: 0; }
.mdc-report-card-label { min-width: 0; }
@media (max-width: 640px) {
  .mdc-table { font-size: 14px; }
  .mdc-table th, .mdc-table td { padding: 7px 6px; overflow-wrap: break-word; }
  .mdc-td-num { font-size: 15px; }
  .mdc-result-section { padding: 20px 16px; }
}
@media (max-width: 400px) {
  .mdc-table { font-size: 13.5px; }
  .mdc-table th, .mdc-table td { padding: 6px 5px; }
}
/* Glance cards: 01, 02, 03 share one row at desktop widths and 04 wraps
   to the next row. This appended rule supersedes the earlier 1024px
   4-column rule without editing it. (The wrap caps at 980px, so no wider
   breakpoint would ever trigger a 4-in-a-row layout.) Below 1024px the
   existing 2-column (640px+) and stacked (below 640px) layouts stand. */
@media (min-width: 1024px) { .mdc-report-cards { grid-template-columns: repeat(3, 1fr); } }

/* ---------- 1.3.13: chart+map grid + Key Areas light theme (appended only) ---------- */
/* Chart + Relationship Map share one grid: side-by-side at >=1024px,
   stacked below that (the chart SVG scales to its container width).
   Mirrors the chart+Health pair pattern; no existing rule is edited. */
.mdc-chart-map-grid { display: block; margin-bottom: 20px; }
.mdc-chart-map-grid .mdc-chart-wrap { margin-bottom: 20px; }
.mdc-chart-map-grid .mdc-result-section { margin-bottom: 0; min-width: 0; }
@media (min-width: 1024px) {
  .mdc-chart-map-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }
  .mdc-chart-map-grid .mdc-chart-wrap { margin-bottom: 0; }
}
/* 1.3.15: the seven 1.3.13 Key Areas light overrides above are DELETED
   (approved dark adaptation). Key Areas now carries .mdc-report-section,
   so the shared dark accordion styles apply unchanged. One scoped rule
   below covers the navy body headings on dark — see stage-B test. */

/* ---------- 1.3.14: deep-link landing offset (appended only) ---------- */
/* A hash-driven jump to the calculator must clear the sticky site
   header so the tab bar and heading are fully visible. Matches the
   96px convention already used by .mdc-result-section. */
.mdc-wrap { scroll-margin-top: 96px; }

/* ---------- 1.3.15: Key Areas dark adaptation (appended only) ---------- */
/* Key Areas now carries .mdc-report-section (dark), so the shared dark
   accordion styles apply. This ONE scoped rule covers the navy
   "N — Arcana" body headings, which would otherwise be invisible on
   the dark gradient (stage-A test: heading resolved to navy #11152B
   on the #11152B→#1b2140 gradient). White matches the dark-section
   heading treatment. Pending bodies need no rule (light-gold status,
   light essay, ivory body text all read on dark). */
.mdc-key-areas .mdc-reading-head { color: #FFFFFF; }

/* ---------- 1.3.16: D5-a gradient proof (appended only; no existing rule changed) ---------- */
/* Chart panel gradient top stop #1b2140 -> #161B33 (dark-theme audit 2026-10-25): lifts purple
   node fill #9333EA vs panel top from 2.92 to 3.15. Bottom stop (var(--mdc-navy) = #11152B),
   size, position, radius, padding, margin, shadow untouched. Applies to Personal/Compat/
   Children chart panels only (shared .mdc-chart-wrap class); report/health/child gradients
   deliberately unchanged. The @media print white rule (!important) is unaffected. */
.mdc-chart-wrap { background: radial-gradient(1200px 600px at 50% 0%, #161B33 0%, var(--mdc-navy) 70%); }
