/* Sprint114 - Display cleanup, dark/light consistency, won amount helper */
:root,
html[data-theme="light"]{
  --j114-bg:#f6f8fc;
  --j114-bg2:#eef4fb;
  --j114-surface:#ffffff;
  --j114-surface2:#f1f5f9;
  --j114-text:#0b1220;
  --j114-muted:#64748b;
  --j114-line:#d8e0ec;
  --j114-primary:#1e5bff;
  --j114-primary2:#0f46d8;
  --j114-accent:#14b8a6;
  --j114-shadow:0 16px 44px rgba(15,23,42,.10);
}
html[data-theme="dark"]{
  --j114-bg:#07111f;
  --j114-bg2:#0b1628;
  --j114-surface:#0f1b2d;
  --j114-surface2:#14243a;
  --j114-surface3:#182b46;
  --j114-text:#f8fafc;
  --j114-muted:#cbd5e1;
  --j114-muted2:#94a3b8;
  --j114-line:#334155;
  --j114-primary:#4f83ff;
  --j114-primary2:#7aa2ff;
  --j114-accent:#2dd4bf;
  --j114-shadow:0 18px 50px rgba(0,0,0,.36);
}
html[data-theme="dark"],
html[data-theme="dark"] body{
  background:var(--j114-bg)!important;
  color:var(--j114-text)!important;
}

/* Global dark card/surface normalization. This is intentionally broad to prevent old white cards. */
html[data-theme="dark"] .page,
html[data-theme="dark"] .workspace,
html[data-theme="dark"] .calculator-workspace,
html[data-theme="dark"] #workspace,
html[data-theme="dark"] .premium-container,
html[data-theme="dark"] .hero,
html[data-theme="dark"] .hero-card,
html[data-theme="dark"] .section,
html[data-theme="dark"] .main-card,
html[data-theme="dark"] .standard-card,
html[data-theme="dark"] .tool-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .form-section,
html[data-theme="dark"] .field,
html[data-theme="dark"] .input-card,
html[data-theme="dark"] .result-card,
html[data-theme="dark"] .result-panel,
html[data-theme="dark"] .premium-result-panel,
html[data-theme="dark"] .consulting-result-card,
html[data-theme="dark"] .prep-docs-panel,
html[data-theme="dark"] .guide-box,
html[data-theme="dark"] .hub-next-links,
html[data-theme="dark"] .metric,
html[data-theme="dark"] .analysis-item,
html[data-theme="dark"] .check,
html[data-theme="dark"] .sim-box,
html[data-theme="dark"] .choice-card,
html[data-theme="dark"] details,
html[data-theme="dark"] summary,
html[data-theme="dark"] .diagnostic-intro-card,
html[data-theme="dark"] .input-quality-card,
html[data-theme="dark"] .desktop-compact-summary,
html[data-theme="dark"] .recent-mini-chip,
html[data-theme="dark"] .situation-section,
html[data-theme="dark"] .situation-card,
html[data-theme="dark"] .scenario,
html[data-theme="dark"] .scenario-section,
html[data-theme="dark"] .scenario-card,
html[data-theme="dark"] .scenario-panel,
html[data-theme="dark"] .m113-shell,
html[data-theme="dark"] .m113-hero,
html[data-theme="dark"] .m113-card,
html[data-theme="dark"] .m113-result,
html[data-theme="dark"] .m113-detail,
html[data-theme="dark"] .m113-field,
html[data-theme="dark"] .m113-panel,
html[data-theme="dark"] .m113-unit-cell,
html[data-theme="dark"] .m113-list-card,
html[data-theme="dark"] .m113-tip,
html[data-theme="dark"] .m113-group,
html[data-theme="dark"] .jg-mobile-shell,
html[data-theme="dark"] .jg-hero,
html[data-theme="dark"] .jg-card,
html[data-theme="dark"] .jg-tile,
html[data-theme="dark"] .jg-row,
html[data-theme="dark"] .jg-accordion,
html[data-theme="dark"] .jg-sheet,
html[data-theme="dark"] .jg-sheet-card,
html[data-theme="dark"] .jg-sheet-backdrop .jg-sheet{
  background:var(--j114-surface)!important;
  color:var(--j114-text)!important;
  border-color:var(--j114-line)!important;
  box-shadow:var(--j114-shadow)!important;
}

html[data-theme="dark"] .m113-field,
html[data-theme="dark"] .m113-kpi,
html[data-theme="dark"] .m113-compare div,
html[data-theme="dark"] .m113-mini-note,
html[data-theme="dark"] .m113-input-wrap,
html[data-theme="dark"] .input-unit-wrap,
html[data-theme="dark"] .situation-card i,
html[data-theme="dark"] .jg-icon,
html[data-theme="dark"] .jg-tag,
html[data-theme="dark"] .badge,
html[data-theme="dark"] .badges span,
html[data-theme="dark"] .m113-chip,
html[data-theme="dark"] .m113-unit-tabs button,
html[data-theme="dark"] .m113-tags button,
html[data-theme="dark"] .quick-row a,
html[data-theme="dark"] .quick-row button,
html[data-theme="dark"] .chip-row a,
html[data-theme="dark"] .chip-row button{
  background:var(--j114-surface2)!important;
  color:var(--j114-text)!important;
  border-color:var(--j114-line)!important;
}

html[data-theme="dark"] .m113-scenario,
html[data-theme="dark"] .scenario-card,
html[data-theme="dark"] .scenario{
  background:var(--j114-surface2)!important;
  color:var(--j114-text)!important;
  border-color:var(--j114-line)!important;
}
html[data-theme="dark"] .m113-scenario.is-active,
html[data-theme="dark"] .scenario-card.active,
html[data-theme="dark"] .scenario-card.selected,
html[data-theme="dark"] .scenario-card.is-active,
html[data-theme="dark"] .scenario.selected{
  background:linear-gradient(135deg,#122a45,#0f3b50)!important;
  border-color:var(--j114-accent)!important;
  color:var(--j114-text)!important;
  box-shadow:0 0 0 1px rgba(45,212,191,.25),0 12px 30px rgba(0,0,0,.32)!important;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] strong,
html[data-theme="dark"] label,
html[data-theme="dark"] .title,
html[data-theme="dark"] .value,
html[data-theme="dark"] .metric strong,
html[data-theme="dark"] .analysis-item strong,
html[data-theme="dark"] .situation-card strong,
html[data-theme="dark"] .m113-field label,
html[data-theme="dark"] .m113-kpi strong,
html[data-theme="dark"] .m113-detail summary,
html[data-theme="dark"] .jg-card strong,
html[data-theme="dark"] .jg-row strong{
  color:var(--j114-text)!important;
}
html[data-theme="dark"] p,
html[data-theme="dark"] small,
html[data-theme="dark"] .sub,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .desc,
html[data-theme="dark"] .field small,
html[data-theme="dark"] .work-head p,
html[data-theme="dark"] .situation-head p,
html[data-theme="dark"] .situation-card small,
html[data-theme="dark"] .m113-muted,
html[data-theme="dark"] .m113-card small,
html[data-theme="dark"] .m113-field small,
html[data-theme="dark"] .m113-detail-body,
html[data-theme="dark"] .m113-detail p,
html[data-theme="dark"] .m113-detail li,
html[data-theme="dark"] .m113-sub,
html[data-theme="dark"] .m113-kpi span,
html[data-theme="dark"] .jg-card span,
html[data-theme="dark"] .jg-card small,
html[data-theme="dark"] .jg-row small{
  color:var(--j114-muted)!important;
}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .search,
html[data-theme="dark"] .jg-search,
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .m113-input-wrap input,
html[data-theme="dark"] .m113-input-wrap select{
  background:var(--j114-surface3)!important;
  color:var(--j114-text)!important;
  border-color:var(--j114-line)!important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{color:var(--j114-muted2)!important;}
html[data-theme="dark"] .unit-suffix,
html[data-theme="dark"] .m113-unit{
  color:var(--j114-text)!important;
  background:transparent!important;
  border-color:var(--j114-line)!important;
}

/* Hide internal benchmark/debug wording surfaces if legacy scripts recreate them. */
.m113-card[data-benchmark-note],
.jg-benchmark-note,
.benchmark-copy,
.debug-panel,
.seo-qa-panel,
.ops-qa-panel,
.admin-qa-panel,
.qa-healthcheck-panel{
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
}

/* Human-readable won helper */
.jg-amount-helper,
.m113-amount-helper{
  margin-top:6px;
  color:var(--j114-muted);
  font-size:.78rem;
  line-height:1.4;
  font-weight:800;
  letter-spacing:-.02em;
  word-break:keep-all;
  overflow-wrap:anywhere;
}
html[data-theme="dark"] .jg-amount-helper,
html[data-theme="dark"] .m113-amount-helper{
  color:var(--j114-muted)!important;
}
.jg-amount-helper b,
.m113-amount-helper b{
  color:var(--j114-primary);
  font-weight:950;
}
html[data-theme="dark"] .jg-amount-helper b,
html[data-theme="dark"] .m113-amount-helper b{
  color:var(--j114-primary2)!important;
}

/* Mobile overflow guard */
@media(max-width:820px){
  html,body{max-width:100%!important;overflow-x:hidden!important;}
  .quick-row,.chip-row,.category-tabs,.tabs,.filter-row,.jg-tags,.jg-category-row{display:flex!important;max-width:100%!important;overflow-x:auto!important;scrollbar-width:none!important;white-space:nowrap!important;}
  .quick-row::-webkit-scrollbar,.chip-row::-webkit-scrollbar,.category-tabs::-webkit-scrollbar,.tabs::-webkit-scrollbar,.filter-row::-webkit-scrollbar,.jg-tags::-webkit-scrollbar,.jg-category-row::-webkit-scrollbar{display:none!important;}
  .tool-card h3,.tool-card small,.situation-card strong,.situation-card small,.m113-card h3,.m113-card p,.m113-field label,.m113-field small,.jg-card strong,.jg-card small{word-break:keep-all!important;overflow-wrap:anywhere!important;}
  .m113-fields,.m113-platform-grid,.m113-grid{grid-template-columns:1fr!important;}
  .m113-result{position:static!important;}
}
