/* ==========================================================================
   Age Activation Redesign
   Synchronized with light (Sandalwood/Sky) & dark (Cosmic Midnight) themes
   ========================================================================== */

/* Strict pane isolation */
#ageactivation:not(.active),
.pane.aa-root:not(.active) {
  display: none !important;
}

.aa-root {
  color: var(--ink);
  padding: 4px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: var(--font-sans);
}

/* ==========================================================================
   1. Header Card
   ========================================================================== */
.aa-header-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 24px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
body.dark .aa-header-card {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.aa-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.aa-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  flex-shrink: 0;
}
body.dark .aa-header-icon {
  background: rgba(223, 177, 91, 0.15);
  color: var(--gold2);
}

.aa-header-titles h1 {
  margin: 0 0 3px;
  font-size: 22px;
  font-weight: 750;
  color: var(--ink);
  letter-spacing: -0.2px;
}
.aa-header-titles p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
}

.aa-header-settings-btn {
  background: var(--paper2, #fbf8f2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 8px 16px 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  color: var(--ink);
}
.aa-header-settings-btn:hover {
  border-color: var(--gold);
  background: var(--paper);
  box-shadow: 0 3px 12px rgba(223, 177, 91, 0.15);
  transform: translateY(-1px);
}
.aa-header-settings-icon {
  font-size: 19px;
  color: #2563eb;
  display: flex;
  align-items: center;
}
body.dark .aa-header-settings-icon {
  color: var(--gold2);
}
.aa-header-settings-text {
  display: flex;
  flex-direction: column;
}
.aa-header-settings-text strong {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.aa-header-settings-text small {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.2;
}
.aa-header-settings-arrow {
  font-size: 14px;
  color: var(--muted);
  margin-left: 4px;
}

/* ==========================================================================
   2. Top Metrics Row (6 KPI Cards)
   ========================================================================== */
.aa-metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1280px) {
  .aa-metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .aa-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .aa-metrics-grid {
    grid-template-columns: 1fr;
  }
}

.aa-metric-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 124px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.aa-metric-card:hover {
  border-color: rgba(223, 177, 91, 0.4);
  transform: translateY(-1px);
}

.aa-metric-top {
  display: flex;
  align-items: center;
  gap: 9px;
}
.aa-metric-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.icon-blue {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}
.icon-cyan {
  background: rgba(6, 182, 212, 0.1);
  color: #0891b2;
}
.icon-purple {
  background: rgba(168, 85, 247, 0.1);
  color: #9333ea;
}
.icon-green {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}
.icon-amber {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}
.icon-rose {
  background: rgba(244, 63, 94, 0.1);
  color: #e11d48;
}
body.dark .icon-blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
body.dark .icon-cyan { background: rgba(6, 182, 212, 0.2); color: #38bdf8; }
body.dark .icon-purple { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
body.dark .icon-green { background: rgba(16, 185, 129, 0.2); color: #34d399; }
body.dark .icon-amber { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
body.dark .icon-rose { background: rgba(244, 63, 94, 0.2); color: #fb7185; }

.aa-metric-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.aa-metric-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.aa-metric-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.aa-metric-number {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}
.aa-metric-unit {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
}

/* Status Badges */
.aa-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2.5px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.3;
}
.pill-active-green {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
body.dark .pill-active-green {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}
.pill-active-amber {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}
body.dark .pill-active-amber {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}
.pill-active-blue {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}
body.dark .pill-active-blue {
  background: rgba(59, 130, 246, 0.16);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.35);
}
.pill-active-purple {
  background: #faf5ff;
  color: #7c3aed;
  border: 1px solid #e9d5ff;
}
body.dark .pill-active-purple {
  background: rgba(168, 85, 247, 0.16);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.35);
}

.aa-metric-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
  margin: 0;
}

/* ==========================================================================
   3. Section 01: Current Age Snapshot Card
   ========================================================================== */
.aa-snapshot-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 22px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
body.dark .aa-snapshot-card {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.aa-sec-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.aa-sec-num {
  font-size: 13px;
  font-weight: 750;
  color: #2563eb;
  letter-spacing: 0.2px;
  min-width: 20px;
}
body.dark .aa-sec-num {
  color: var(--gold2);
}
.aa-sec-icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.aa-sec-titles h2 {
  margin: 0 0 2px;
  font-size: 16.5px;
  font-weight: 750;
  color: var(--ink);
  letter-spacing: -0.1px;
}
.aa-sec-titles p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* 3-Column Layout */
.aa-snapshot-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}
@media (max-width: 1024px) {
  .aa-snapshot-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Col 1: BCP Annual Activation */
.aa-snapshot-col-bcp {
  background: var(--paper2, #faf7f2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.aa-bcp-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.aa-bcp-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
body.dark .aa-bcp-icon-circle {
  background: rgba(223, 177, 91, 0.18);
  color: var(--gold2);
}
.aa-bcp-eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.aa-bcp-heading {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin: 4px 0 6px;
}
.aa-bcp-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.aa-bcp-keywords {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.35;
  margin: 4px 0;
}
.aa-bcp-narrative {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}
.aa-btn-pac {
  align-self: flex-start;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 7px 15px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  margin-top: 4px;
}
.aa-btn-pac:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
body.dark .aa-btn-pac {
  background: var(--gold);
  color: #171513;
}
body.dark .aa-btn-pac:hover {
  background: var(--gold2);
  box-shadow: 0 4px 12px rgba(223, 177, 91, 0.3);
}

/* Col 2: Key Themes */
.aa-snapshot-col-themes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.aa-col-title {
  font-size: 13.5px;
  font-weight: 750;
  color: var(--ink);
  margin: 0 0 4px;
}
.aa-themes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.aa-theme-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.aa-theme-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}
.aa-theme-info strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.aa-theme-info small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

/* Col 3: Age in Context */
.aa-snapshot-col-context {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.aa-carousel-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.aa-carousel-nav {
  width: 28px;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--paper2);
  color: var(--ink);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.aa-carousel-nav:hover {
  background: var(--paper);
  border-color: var(--gold);
}
.aa-carousel-chips {
  display: flex;
  gap: 6px;
  flex: 1;
}
.aa-step-chip {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 8px;
  padding: 5px 2px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.aa-step-chip:hover {
  border-color: var(--gold);
  background: var(--paper2);
}
.aa-step-chip.active {
  border-color: #2563eb;
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 0 1px #2563eb inset;
}
body.dark .aa-step-chip.active {
  border-color: var(--gold2);
  background: rgba(223, 177, 91, 0.12);
  box-shadow: 0 0 0 1px var(--gold2) inset;
}
.aa-step-age {
  font-size: 13px;
  font-weight: 750;
  color: var(--ink);
  line-height: 1.2;
}
.aa-step-house {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.1;
}

.aa-info-callout {
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink);
  line-height: 1.4;
}
body.dark .aa-info-callout {
  background: rgba(223, 177, 91, 0.08);
  border-color: rgba(223, 177, 91, 0.25);
}
.aa-info-icon {
  color: #2563eb;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}
body.dark .aa-info-icon {
  color: var(--gold2);
}

.aa-quick-links-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.aa-quick-links-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}
.aa-quick-links-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.aa-btn-outline {
  flex: 1;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.aa-btn-outline:hover {
  border-color: var(--gold);
  background: var(--paper2);
  transform: translateY(-1px);
}

/* ==========================================================================
   4. Sections 02–10: Accordion Cards
   ========================================================================== */
.aa-accordion-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.aa-accordion-card:hover {
  border-color: rgba(223, 177, 91, 0.35);
}

.aa-accordion-summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  background: var(--paper);
  transition: background 0.15s ease;
  gap: 12px;
}
.aa-accordion-summary::-webkit-details-marker {
  display: none;
}
.aa-accordion-summary:hover {
  background: var(--paper2);
}

.aa-acc-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}
.aa-acc-title-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.aa-acc-title {
  font-size: 14px;
  font-weight: 750;
  color: var(--ink);
  letter-spacing: -0.1px;
}
.aa-acc-sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.aa-acc-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.aa-acc-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
}
body.dark .aa-acc-badge {
  background: var(--paper2);
  color: var(--muted);
  border-color: var(--line);
}
.aa-chevron {
  color: var(--muted);
  transition: transform 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.aa-accordion-card[open] .aa-chevron {
  transform: rotate(180deg);
}

.aa-accordion-body {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line-subtle);
  animation: aaFadeIn 0.2s ease;
}
@keyframes aaFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   5. Inner Tables and Cards in Accordions
   ========================================================================== */
.aa-scope-box {
  background: var(--paper2);
  border-left: 3px solid #2563eb;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 12px;
}
body.dark .aa-scope-box {
  border-left-color: var(--gold2);
}

.aa-rule-card {
  background: var(--paper2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
  margin-bottom: 10px;
}
.aa-rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.aa-rule-head strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.aa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.aa-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 10.5px;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  letter-spacing: 0.3px;
}
.aa-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-subtle);
  color: var(--ink);
  vertical-align: top;
}
.aa-table tr:hover {
  background: var(--paper2);
}
.aa-table tr.aa-current-row {
  background: rgba(59, 130, 246, 0.08);
}
body.dark .aa-table tr.aa-current-row {
  background: rgba(223, 177, 91, 0.12);
}
