
/* Sprint115 - final theme surface fix for calculator detail areas.
   Purpose: remove remaining light cards inside dark mode and normalize scenario/result/policy cards.
   This file is intentionally loaded last and uses high-specificity overrides. */
:root{
  --j115-bg:#f6f8fc;
  --j115-surface:#ffffff;
  --j115-surface2:#f1f5f9;
  --j115-surface3:#eaf0f7;
  --j115-text:#0b1220;
  --j115-muted:#64748b;
  --j115-muted2:#94a3b8;
  --j115-line:#d8e0ec;
  --j115-primary:#1e5bff;
  --j115-primary2:#0f4bdc;
  --j115-accent:#14b8a6;
  --j115-warn:#f59e0b;
  --j115-danger:#ef4444;
  --j115-shadow:0 16px 40px rgba(15,23,42,.09);
}
html[data-theme="dark"],html.dark{
  --j115-bg:#07111f;
  --j115-surface:#0f1b2d;
  --j115-surface2:#14243a;
  --j115-surface3:#1b2d49;
  --j115-text:#f8fafc;
  --j115-muted:#cbd5e1;
  --j115-muted2:#94a3b8;
  --j115-line:#334155;
  --j115-primary:#4f83ff;
  --j115-primary2:#2563eb;
  --j115-accent:#2dd4bf;
  --j115-warn:#fbbf24;
  --j115-danger:#fb7185;
  --j115-shadow:0 18px 48px rgba(0,0,0,.35);
}
html[data-theme="dark"] body,html.dark body{
  background:var(--j115-bg)!important;
  color:var(--j115-text)!important;
}
/* Keep the calculator canvas coherent in both themes. */
#workspace,.workspace,.calculator-workspace,.page,.wrap,main{
  color:var(--j115-text);
}
html[data-theme="dark"] #workspace,html.dark #workspace,
html[data-theme="dark"] .workspace,html.dark .workspace,
html[data-theme="dark"] .calculator-workspace,html.dark .calculator-workspace,
html[data-theme="dark"] .page,html.dark .page,
html[data-theme="dark"] main,html.dark main{
  background:var(--j115-bg)!important;
  color:var(--j115-text)!important;
}
/* Generic detail card surfaces. */
html[data-theme="light"] .form-section,
html[data-theme="light"] .result-panel,
html[data-theme="light"] .consulting-result-card,
html[data-theme="light"] .policy-result,
html[data-theme="light"] .eligibility-banner,
html[data-theme="light"] .metric,
html[data-theme="light"] .analysis-item,
html[data-theme="light"] .check,
html[data-theme="light"] .prep-docs-panel,
html[data-theme="light"] .prep-row,
html[data-theme="light"] .guide-box,
html[data-theme="light"] .hub-next-links,
html[data-theme="light"] .input-quality-card,
html[data-theme="light"] .desktop-compact-summary>div,
html[data-theme="light"] .standard-card,
html[data-theme="light"] .input-group,
html[data-theme="light"] .advanced-fields,
html[data-theme="light"] .field,
html[data-theme="light"] .m113-card,
html[data-theme="light"] .m113-result,
html[data-theme="light"] .m113-detail,
html[data-theme="light"] .m113-field,
html[data-theme="light"] .m113-group,
html[data-theme="light"] .m113-unit-cell,
html[data-theme="light"] .m113-kpi{
  background:var(--j115-surface)!important;
  color:var(--j115-text)!important;
  border-color:var(--j115-line)!important;
}
html[data-theme="dark"] .form-section,html.dark .form-section,
html[data-theme="dark"] .result-panel,html.dark .result-panel,
html[data-theme="dark"] .consulting-result-card,html.dark .consulting-result-card,
html[data-theme="dark"] .policy-result,html.dark .policy-result,
html[data-theme="dark"] .eligibility-banner,html.dark .eligibility-banner,
html[data-theme="dark"] .metric,html.dark .metric,
html[data-theme="dark"] .analysis-item,html.dark .analysis-item,
html[data-theme="dark"] .check,html.dark .check,
html[data-theme="dark"] .prep-docs-panel,html.dark .prep-docs-panel,
html[data-theme="dark"] .prep-row,html.dark .prep-row,
html[data-theme="dark"] .guide-box,html.dark .guide-box,
html[data-theme="dark"] .hub-next-links,html.dark .hub-next-links,
html[data-theme="dark"] .input-quality-card,html.dark .input-quality-card,
html[data-theme="dark"] .desktop-compact-summary>div,html.dark .desktop-compact-summary>div,
html[data-theme="dark"] .standard-card,html.dark .standard-card,
html[data-theme="dark"] .input-group,html.dark .input-group,
html[data-theme="dark"] .advanced-fields,html.dark .advanced-fields,
html[data-theme="dark"] .field,html.dark .field,
html[data-theme="dark"] .m113-card,html.dark .m113-card,
html[data-theme="dark"] .m113-result,html.dark .m113-result,
html[data-theme="dark"] .m113-detail,html.dark .m113-detail,
html[data-theme="dark"] .m113-field,html.dark .m113-field,
html[data-theme="dark"] .m113-group,html.dark .m113-group,
html[data-theme="dark"] .m113-unit-cell,html.dark .m113-unit-cell,
html[data-theme="dark"] .m113-kpi,html.dark .m113-kpi{
  background:var(--j115-surface)!important;
  color:var(--j115-text)!important;
  border-color:var(--j115-line)!important;
  box-shadow:var(--j115-shadow)!important;
}
/* Policy matching result cards: the remaining light boxes were here. */
.policy-card-grid{display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));}
.consulting-result-card{display:grid;gap:12px;padding:18px;border-radius:24px;border:1px solid var(--j115-line);background:var(--j115-surface);color:var(--j115-text);}
.card-badge-row{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;}
.priority-badge,.fit-badge{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:7px 10px;font-size:.78rem;font-weight:950;border:1px solid var(--j115-line);background:var(--j115-surface2);color:var(--j115-text);}
.fit-badge.bad,.priority-badge.bad{color:#b91c1c;background:#fff1f2;border-color:#fecdd3;}
.fit-badge.warn,.priority-badge.warn{color:#92400e;background:#fffbeb;border-color:#fde68a;}
.fit-badge.ok,.priority-badge.ok{color:#047857;background:#ecfdf5;border-color:#a7f3d0;}
html[data-theme="dark"] .fit-badge.bad,html.dark .fit-badge.bad,html[data-theme="dark"] .priority-badge.bad,html.dark .priority-badge.bad{color:#fecdd3;background:rgba(239,68,68,.16);border-color:rgba(248,113,113,.38);}
html[data-theme="dark"] .fit-badge.warn,html.dark .fit-badge.warn,html[data-theme="dark"] .priority-badge.warn,html.dark .priority-badge.warn{color:#fde68a;background:rgba(245,158,11,.16);border-color:rgba(251,191,36,.36);}
html[data-theme="dark"] .fit-badge.ok,html.dark .fit-badge.ok,html[data-theme="dark"] .priority-badge.ok,html.dark .priority-badge.ok{color:#a7f3d0;background:rgba(20,184,166,.14);border-color:rgba(45,212,191,.36);}
.card-title-area h4{margin:0 0 4px;color:var(--j115-text)!important;}
.card-title-area span{color:var(--j115-muted)!important;font-weight:800;}
.policy-number-box{display:grid;grid-template-columns:1fr;gap:8px;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important;}
.policy-number-box>div{padding:13px;border-radius:16px;background:var(--j115-surface2)!important;border:1px solid var(--j115-line)!important;color:var(--j115-text)!important;box-shadow:none!important;text-align:center;}
.policy-number-box small{display:block;color:var(--j115-muted)!important;font-weight:900;margin-bottom:5px;}
.policy-number-box strong{display:block;color:var(--j115-text)!important;font-size:1.05rem!important;line-height:1.2;}
.policy-card-note{color:var(--j115-muted)!important;line-height:1.6;margin:2px 0 0;}
.policy-detail-btn{border:0;border-radius:16px;background:linear-gradient(135deg,var(--j115-primary),var(--j115-primary2))!important;color:#fff!important;padding:13px 14px;font-weight:950;cursor:pointer;}
/* Scenario areas: light should not use navy cards except active state; dark should not use white wrappers. */
.scenario-section{background:var(--j115-surface)!important;color:var(--j115-text)!important;border:1px solid var(--j115-line)!important;border-radius:24px!important;}
.scenario-section h3{color:var(--j115-text)!important;}
.scenario-grid{display:grid;gap:10px;}
.scenario,.scenario-card,.m113-scenario{background:var(--j115-surface2)!important;color:var(--j115-text)!important;border:1px solid var(--j115-line)!important;border-radius:18px!important;box-shadow:none!important;}
.scenario strong,.scenario-card strong,.m113-scenario strong{color:var(--j115-text)!important;}
.scenario span,.scenario-card span,.m113-scenario span{color:var(--j115-muted)!important;}
.scenario.active,.scenario.selected,.scenario.is-active,.scenario-card.active,.scenario-card.selected,.scenario-card.is-active,.m113-scenario.is-active{background:linear-gradient(135deg,var(--j115-primary),var(--j115-primary2))!important;color:#fff!important;border-color:transparent!important;box-shadow:0 12px 28px rgba(30,91,255,.24)!important;}
.scenario.active strong,.scenario.selected strong,.scenario.is-active strong,.scenario-card.active strong,.scenario-card.selected strong,.scenario-card.is-active strong,.m113-scenario.is-active strong{color:#fff!important;}
.scenario.active span,.scenario.selected span,.scenario.is-active span,.scenario-card.active span,.scenario-card.selected span,.scenario-card.is-active span,.m113-scenario.is-active span{color:rgba(255,255,255,.82)!important;}
/* Input tabs and field groups */
.mobile-step-nav button,.tabs .tab{background:var(--j115-surface2)!important;color:var(--j115-text)!important;border:1px solid var(--j115-line)!important;border-radius:999px!important;}
.mobile-step-nav button.active,.tabs .tab.on{background:linear-gradient(135deg,var(--j115-primary),var(--j115-primary2))!important;color:#fff!important;border-color:transparent!important;}
.input-group-head strong,.input-group-head span,.advanced-fields summary strong,.advanced-fields summary span{color:var(--j115-text)!important;}
.input-group-head span,.advanced-fields summary span{color:var(--j115-muted)!important;}
.input-unit-wrap,.m113-input-wrap{background:var(--j115-surface3)!important;color:var(--j115-text)!important;border-color:var(--j115-line)!important;}
.input-unit-wrap input,.input-unit-wrap select,.m113-input-wrap input,.m113-input-wrap select{background:transparent!important;color:var(--j115-text)!important;}
.unit-suffix,.m113-unit{color:var(--j115-text)!important;background:transparent!important;border-color:var(--j115-line)!important;}
/* Result and helper text */
.result-heading,.result-panel h3,.policy-result h3,.m113-result h3{color:var(--j115-text)!important;}
.metric span,.analysis-item span,.check span,.result-panel p,.result-panel small,.m113-sub,.m113-detail-body,.prep-row small{color:var(--j115-muted)!important;}
.metric strong,.analysis-item strong,.check strong{color:var(--j115-text)!important;}
/* Remove any leftover white islands in dark mode. */
html[data-theme="dark"] .policy-number-box>div,html.dark .policy-number-box>div,
html[data-theme="dark"] .summary-card,html.dark .summary-card,
html[data-theme="dark"] .summary-card>div,html.dark .summary-card>div,
html[data-theme="dark"] .result-box,html.dark .result-box,
html[data-theme="dark"] .premium-detail,html.dark .premium-detail,
html[data-theme="dark"] .course-box,html.dark .course-box,
html[data-theme="dark"] .criteria-box,html.dark .criteria-box{
  background:var(--j115-surface2)!important;
  color:var(--j115-text)!important;
  border-color:var(--j115-line)!important;
}
/* Mobile last-mile: avoid huge blank patches and keep all calculator cards readable. */
@media(max-width:820px){
  .policy-card-grid{grid-template-columns:1fr!important;}
  .consulting-result-card{padding:16px!important;border-radius:22px!important;}
  .policy-number-box{grid-template-columns:1fr!important;}
  .scenario-grid{grid-template-columns:1fr!important;}
  .scenario,.scenario-card,.m113-scenario{padding:14px 15px!important;min-width:0!important;width:100%!important;}
  .form-section,.result-panel,.consulting-result-card,.m113-card,.m113-result{max-width:100%!important;overflow:hidden!important;}
  .policy-detail-btn{width:100%!important;}
}
