
:root {
  --rank-S: #fbbf24;   /* 金 */
  --rank-A: #ec4899;   /* ピンク */
  --rank-B: #ef4444;   /* 赤 */
  --rank-C: #f59e0b;   /* 黄・オレンジ */
  --rank-D: #ca8a04;   /* 黄土色 */
  --rank-E: #84cc16;   /* 黄緑 */
  --rank-F: #3b82f6;   /* 青 */
  --rank-G: #6b7280;   /* 灰色 */
}

/* === Phase15 coreConceptPanel === */
.coreConceptPanel {
  border-color: #fbbf24 !important;
  border-width: 2px !important;
}
.coreConceptPanel .guideBadge {
  background: #fbbf24 !important;
  color: #0f274a !important;
  border-color: #fbbf24 !important;
}
.coreConceptPanel h2 {
  color: #fde68a !important;
}
.principlesPanel {
  border-color: #38bdf8 !important;
}
.principlesList {
  margin: 12px 0 0 0 !important;
  padding: 0 !important;
  list-style: none !important;
  counter-reset: principle-counter !important;
}
.principlesList li {
  counter-increment: principle-counter !important;
  margin: 0 0 10px 0 !important;
  padding: 8px 12px 8px 40px !important;
  position: relative !important;
  background: rgba(56, 189, 248, 0.08) !important;
  border-left: 3px solid #38bdf8 !important;
  border-radius: 4px !important;
  color: #f8fbff !important;
  line-height: 1.5 !important;
}
.principlesList li::before {
  content: "P" counter(principle-counter) !important;
  position: absolute !important;
  left: 10px !important;
  top: 8px !important;
  font-weight: bold !important;
  color: #38bdf8 !important;
  font-size: 0.9em !important;
}
.principlesList li b {
  color: #fde68a !important;
  font-weight: 600 !important;
}
html[data-theme="light"] .principlesList li {
  background: #f0f9ff !important;
  color: #1f2937 !important;
  border-left-color: #0284c7 !important;
}
html[data-theme="light"] .principlesList li b {
  color: #075985 !important;
}
html[data-theme="light"] .coreConceptPanel {
  background: #fffbeb !important;
  color: #1f2937 !important;
  border-color: #f59e0b !important;
}
html[data-theme="light"] .coreConceptPanel h2,
html[data-theme="light"] .coreConceptPanel p,
html[data-theme="light"] .coreConceptPanel strong,
html[data-theme="light"] .coreConceptPanel small,
html[data-theme="light"] .coreConceptPanel li {
  color: #1f2937 !important;
}
html[data-theme="light"] .coreConceptPanel .guideBadge {
  background: #f59e0b !important;
  color: #fffbeb !important;
  border-color: #f59e0b !important;
}
html[data-theme="light"] .coreConceptPanel .miraiSafetyNote {
  color: #1f2937 !important;
}

:root {
  font-family: "Segoe UI", "Yu Gothic UI", "Hiragino Sans", sans-serif;
  color: #17211c;
  background:
    radial-gradient(circle at 12% 6%, rgba(23, 219, 255, .18), transparent 28%),
    radial-gradient(circle at 92% 16%, rgba(255, 91, 168, .16), transparent 25%),
    #f5f2ea;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

.authView {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.authPanel {
  width: min(560px, 100%);
}

.authPanel input {
  width: 100%;
  margin-top: 8px;
}

/* Authentication uses the same light, readable surface in either saved theme. */
html body .authView .authPanel {
  color-scheme: light;
  background: #fff !important;
  color: #17211c !important;
}
html body .authView .authPanel .sectionHeader {
  flex-wrap: wrap;
  gap: 8px;
}
html body .authView .authPanel h1 {
  font-size: clamp(24px, 6vw, 32px);
}
html body .authView .authPanel label,
html body .authView .authPanel p,
html body .authView .authPanel span {
  color: #334155 !important;
}
html body .authView .authPanel .miraiSafetyNote {
  background: #edf5f1 !important;
  border-color: #32725b;
}
html body .authView .authPanel input {
  background: #fff !important;
  color: #17211c !important;
  border-color: #64748b !important;
  min-height: 44px;
  font-size: 16px;
  padding: 10px;
}
html body .authView .authPanel input::placeholder {
  color: #526171 !important;
}
html body .authView .authPanel .command {
  min-height: 44px;
  font-size: 16px;
}

[data-tax-record-export] { margin: 12px 0; }
[data-tax-record-export] button { min-height: 44px; }
[data-tax-print-sheet] { display: none; }
@media print {
  html:has(body.taxRecordPrinting) { background: #fff !important; }
  body.taxRecordPrinting > :not([data-tax-print-sheet]) { display: none !important; }
  html body.taxRecordPrinting { background: #fff !important; color: #111 !important; }
  html body.taxRecordPrinting [data-tax-print-sheet] { display: block; font: 11pt/1.6 sans-serif; }
  [data-tax-print-sheet] h1 { font-size: 20pt; margin: 0 0 8pt; }
  [data-tax-print-sheet] h2 { font-size: 14pt; margin: 16pt 0 6pt; break-after: avoid; }
  [data-tax-print-sheet] table { width: 100%; table-layout: fixed; border-collapse: collapse; }
  [data-tax-print-sheet] th, [data-tax-print-sheet] td { border: 1px solid #888; padding: 6pt; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
  [data-tax-print-sheet] tr { break-inside: avoid; }
  [data-tax-print-sheet] p { overflow-wrap: anywhere; }
}

/* Critical UI rebuild overrides: keep all tabs readable and compact. */
body,
.view,
.panel,
.advisorCard,
.itemCard,
.metric,
.sourceStatusTable div,
.tradeStartSummary div,
.candidateRuleGrid div,
.planFocusGrid div,
.payrollView label {
  color: #0f172a !important;
}

.panel,
.advisorCard,
.itemCard,
.metric,
.sourceStatusTable div,
.tradeStartSummary div,
.candidateRuleGrid div,
.planFocusGrid div,
.payrollView label {
  background: rgba(255, 255, 255, 0.94) !important;
}

.panel h2,
.panel h3,
.panel h4,
.sectionHeader h2,
.titleRow h1,
.itemCard strong,
.sourceStatusTable strong,
.tradeStartSummary strong,
.candidateRuleGrid span,
.planFocusGrid strong,
.metric strong,
.metric span,
.payrollView input,
.payrollView select,
.payrollView textarea {
  color: #0b1220 !important;
}

.panel small,
.panel span,
.panel p,
.status,
.simulationNote,
.miraiSafetyNote,
.guidePanel small {
  color: #334155 !important;
}

.tabBar {
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  gap: 4px !important;
  padding: 5px 6px calc(5px + env(safe-area-inset-bottom)) !important;
  background: rgba(10, 20, 40, 0.96) !important;
}

.tabBar button {
  min-width: 0 !important;
  min-height: 48px !important;
  padding: 4px 2px !important;
  border-radius: 10px !important;
  font-size: 15px !important;
  color: #e5f0ff !important;
  background: rgba(15, 23, 42, 0.72) !important;
}

.tabBar button span {
  display: block !important;
  margin-top: 2px !important;
  font-size: 10px !important;
  line-height: 1.05 !important;
  color: #e5f0ff !important;
}

.tabBar button.active {
  background: #0b74ff !important;
  color: #fff !important;
}

.remoteReadOnlyBanner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 12px 16px;
  padding: 10px 14px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 10px;
  background: rgba(254, 243, 199, 0.85);
  color: #78350f;
  font-size: 0.95rem;
  line-height: 1.4;
}
.remoteReadOnlyBanner strong {
  font-size: 1rem;
  color: #7c2d12;
}
.remoteReadOnlyBanner span {
  font-weight: 500;
}
.remoteReadOnlyBanner small {
  color: #92400e;
  font-size: 0.82rem;
}

.remoteReadOnlyHeader {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  background: rgba(254, 243, 199, 0.96);
  border-bottom: 1px solid rgba(245, 158, 11, 0.6);
  box-shadow: 0 2px 6px rgba(120, 53, 15, 0.08);
  color: #7c2d12;
  font-size: 0.92rem;
  line-height: 1.35;
}
.remoteReadOnlyHeaderInner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: min(1040px, 100%);
  margin: 0 auto;
}
.remoteReadOnlyHeader strong {
  font-size: 0.98rem;
  color: #7c2d12;
}
.remoteReadOnlyHeader span {
  font-weight: 500;
  color: #78350f;
}
.remoteReadOnlyHeader small {
  color: #92400e;
  font-size: 0.78rem;
}
@media (max-width: 480px) {
  .remoteReadOnlyHeader {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
  .remoteReadOnlyHeader strong { font-size: 0.92rem; }
  .remoteReadOnlyHeader small { font-size: 0.72rem; }
}

.remoteReadOnlyDisabled {
  opacity: 0.55;
  cursor: not-allowed !important;
}

.miraiSummaryHero {
  display: grid;
  grid-template-columns: minmax(92px, 140px) 1fr;
  align-items: center;
  gap: 16px;
}

.miraiSummaryHero .mascot {
  width: 100%;
  min-height: 110px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #0f172a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.miraiSummaryHero .mascot img {
  width: min(118px, 90%);
  height: auto;
  display: block;
}

.miraiFrameworkGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.miraiFrameworkGrid article,
.miraiFailSafeList article {
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #101b31;
  padding: 12px;
}

.miraiFrameworkGrid article strong,
.miraiFrameworkGrid article span,
.miraiFrameworkGrid article small {
  display: block;
}

.miraiFrameworkGrid article span {
  margin-top: 4px;
  font-weight: 800;
}

.miraiSectionGrid > div,
.miraiSummaryStats > div {
  min-width: 0;
}

.miraiSummaryPanel .cardActions {
  flex-wrap: wrap;
}

@media (max-width: 520px) {
  .miraiSummaryHero {
    grid-template-columns: 1fr;
  }

  .miraiFrameworkGrid {
    grid-template-columns: 1fr;
  }

  .tabBar button {
    font-size: 12px !important;
  }

  .tabBar button span {
    font-size: 9px !important;
  }
}

.rankBadge,
.rankBadge.mini {
  display: inline-grid !important;
  min-width: 34px !important;
  height: 34px !important;
  place-items: center !important;
  border: 2px solid #0b1220 !important;
  border-radius: 8px !important;
  color: #0b1220 !important;
  font-weight: 900 !important;
  font-size: 20px !important;
  box-shadow: 0 2px 0 #0b1220 !important;
}

.rankBadge.rank-S, .rankBadge.rank-Splus, .rankBadge.rank-Splusplus { background: #ffd84d !important; }
.rankBadge.rank-A { background: #ff5bc8 !important; }
.rankBadge.rank-B { background: #ff3b30 !important; color: #fff !important; }
.rankBadge.rank-C { background: #ffb02e !important; }
.rankBadge.rank-D { background: #c99720 !important; }
.rankBadge.rank-E { background: #8bdc2f !important; }
.rankBadge.rank-F { background: #2f80ed !important; color: #fff !important; }
.rankBadge.rank-G { background: #9ca3af !important; color: #fff !important; }

.incomeBars,
.holdingPriceGrid,
.planFocusGrid {
  display: grid;
  gap: 10px;
}

.incomeBarRow {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #ffffff;
}

.incomeBarRow header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.incomeBarStack {
  display: grid;
  gap: 3px;
}

.incomeBarStack i {
  display: block;
  height: 8px;
  border-radius: 999px;
  min-width: 2px;
}

.incomeBarStack .gross { background: #14b8a6; }
.incomeBarStack .net { background: #2563eb; }
.incomeBarStack .deduct { background: #ef4444; }
.incomeBarStack .bonus { background: #f59e0b; }
.incomeBarStack .tax { background: #7c3aed; }
.incomeBarStack .benefit { background: #22c55e; }

.candidateMetaGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
  margin-top: 8px;
}

.candidateMetaGrid em {
  font-style: normal;
  color: #1e293b;
  background: #eaf2ff;
  border-radius: 8px;
  padding: 5px 7px;
  font-size: 12px;
}

.planFocusGrid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.planFocusGrid div {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
}

.planFocusGrid small {
  font-weight: 800;
  color: #1d4ed8 !important;
}

.holdingPricePanel .sourceStatusTable div small,
.finalTradeCandidatesPanel .sourceStatusTable div small,
.employeeStockDecisionPanel .candidatePriceState em {
  color: #1f2937 !important;
}

.liveSymbolPanel {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #f8fbff;
}

.liveSymbolGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 8px;
}

.liveSymbolGrid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #ffffff;
}

.liveSymbolGrid small {
  font-weight: 800;
  color: #1d4ed8 !important;
}

.liveSymbolGrid strong,
.liveSymbolGrid span,
.liveProviderTags span {
  overflow-wrap: anywhere;
}

.liveSymbolActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.liveSymbolActions .command[aria-busy="true"] {
  cursor: progress;
  filter: saturate(1.2);
}

@media (max-width: 720px) {
  .tabBar button {
    min-height: 44px !important;
    font-size: 13px !important;
  }

  .tabBar button span {
    font-size: 9px !important;
  }

  .metricsGrid,
  .planFocusGrid,
  .candidateMetaGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .payrollView .formGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .payrollView .formGrid .wide {
    grid-column: 1 / -1;
  }

  .liveSymbolGrid {
    grid-template-columns: 1fr;
  }

  .liveSymbolActions .command {
    width: 100%;
  }

  .dashboardQuickGrid,
  .dashboardFreshnessGrid,
  .dashboardChartGrid {
    grid-template-columns: 1fr !important;
  }

  .dashboardTrendChart svg {
    height: 118px;
  }
}

@media (max-width: 430px) {
  .tabBar {
    gap: 3px !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  .tabBar button {
    border-radius: 8px !important;
    font-size: 12px !important;
  }

  .tabBar button span {
    font-size: 8px !important;
  }
}

/* Display rescue final override: this must stay after legacy critical blocks. */
.tabBar {
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  gap: 2px !important;
  overflow: hidden !important;
}

.tabBar button {
  display: grid !important;
  place-items: center !important;
  min-width: 0 !important;
  padding: 4px 1px !important;
  font-size: 0 !important;
  white-space: nowrap !important;
  text-shadow: none !important;
}

.tabBar button span {
  margin: 0 !important;
  max-width: 100% !important;
  color: #f8fbff !important;
  font-size: clamp(8px, 2.25vw, 12px) !important;
  line-height: 1.05 !important;
  font-weight: 900 !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

.compactGuide summary em,
.compactGuide summary::before,
.compactGuide summary::after,
.foldPanel > summary::before,
.foldPanel > summary::after {
  content: none !important;
  display: none !important;
}

.compactGuide:not([open]) .guideIntro,
.compactGuide:not([open]) .guideGrid,
.compactGuide:not([open]) .guideCaution,
.foldPanel:not([open]) .foldBody,
.candidateDetailFold:not([open]) > :not(summary),
.firstTradeCandidatesPanel:not([open]) > :not(summary),
.incomeCategory:not([open]) > :not(summary) {
  display: none !important;
}

.guidePanel,
.miraiTabHint {
  background: #0f274a !important;
  color: #f8fbff !important;
  border-color: #38bdf8 !important;
}

.guidePanel b,
.guidePanel strong,
.guidePanel h2,
.guidePanel h3,
.guidePanel p,
.guidePanel li,
.guidePanel small,
.miraiTabHint p {
  color: #f8fbff !important;
}

.priceStatusPanel .tradeStartSummary div strong,
.priceStatusPanel .sourceStatusTable div strong,
.finalTradeCandidatesPanel .sourceStatusTable div strong,
.employeeStockDecisionPanel .candidateRuleGrid div strong,
.holdingPricePanel .sourceStatusTable div strong,
.sourceStatusTable div strong,
.tradeStartSummary div strong,
.candidateRuleGrid div strong,
.candidateReasonGrid div strong,
.ms2MemoGrid div strong,
.metricGrid div b,
.planFocusGrid div strong {
  color: #0b1220 !important;
  text-shadow: none !important;
}

.priceStatusPanel .tradeStartSummary div span,
.priceStatusPanel .tradeStartSummary div small,
.priceStatusPanel .sourceStatusTable div span,
.priceStatusPanel .sourceStatusTable div small,
.finalTradeCandidatesPanel .sourceStatusTable div span,
.finalTradeCandidatesPanel .sourceStatusTable div small,
.employeeStockDecisionPanel .candidateRuleGrid div span,
.employeeStockDecisionPanel .candidateRuleGrid div small,
.holdingPricePanel .sourceStatusTable div span,
.holdingPricePanel .sourceStatusTable div small,
.sourceStatusTable div span,
.sourceStatusTable div small,
.tradeStartSummary div span,
.tradeStartSummary div small,
.candidateRuleGrid div span,
.candidateRuleGrid div small,
.candidateReasonGrid div span,
.candidateReasonGrid div small,
.ms2MemoGrid div span,
.ms2MemoGrid div small,
.metricGrid div span,
.metricGrid div small,
.planFocusGrid div span,
.planFocusGrid div small,
.incomeBarRow span,
.incomeBarRow small {
  color: #172033 !important;
  text-shadow: none !important;
}

/* v0.2 readability full fix: final dark, readable, non-overflowing UI. */
html[data-theme="dark"] body,
html[data-theme="dark"] .view {
  background: #07111f !important;
  color: #eef6ff !important;
}

html[data-theme="dark"] .panel,
html[data-theme="dark"] .advisorCard,
html[data-theme="dark"] .itemCard,
html[data-theme="dark"] .metric,
html[data-theme="dark"] .sourceStatusTable div,
html[data-theme="dark"] .tradeStartSummary div,
html[data-theme="dark"] .candidateRuleGrid div,
html[data-theme="dark"] .candidateReasonGrid div,
html[data-theme="dark"] .planFocusGrid div,
html[data-theme="dark"] .payrollView label,
html[data-theme="dark"] .incomeBarRow,
html[data-theme="dark"] .stockScoreCard,
html[data-theme="dark"] .firstTradeCandidateCard,
html[data-theme="dark"] .manualCandidateCard,
html[data-theme="dark"] .fileRow {
  background: #101b2d !important;
  border-color: #2d4262 !important;
  color: #eef6ff !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}

html[data-theme="dark"] .panel h1,
html[data-theme="dark"] .panel h2,
html[data-theme="dark"] .panel h3,
html[data-theme="dark"] .panel h4,
html[data-theme="dark"] .sectionHeader h2,
html[data-theme="dark"] .titleRow h1,
html[data-theme="dark"] .itemCard strong,
html[data-theme="dark"] .sourceStatusTable strong,
html[data-theme="dark"] .tradeStartSummary strong,
html[data-theme="dark"] .candidateRuleGrid strong,
html[data-theme="dark"] .candidateRuleGrid span,
html[data-theme="dark"] .candidateReasonGrid strong,
html[data-theme="dark"] .planFocusGrid strong,
html[data-theme="dark"] .metric strong,
html[data-theme="dark"] .metric span,
html[data-theme="dark"] .stockScoreHeader h4,
html[data-theme="dark"] .fileRow span,
html[data-theme="dark"] .payrollView input,
html[data-theme="dark"] .payrollView select,
html[data-theme="dark"] .payrollView textarea {
  color: #f8fbff !important;
}

html[data-theme="dark"] .panel small,
html[data-theme="dark"] .panel span,
html[data-theme="dark"] .panel p,
html[data-theme="dark"] .status,
html[data-theme="dark"] .simulationNote,
html[data-theme="dark"] .miraiSafetyNote,
html[data-theme="dark"] .guidePanel small,
html[data-theme="dark"] .sourceStatusTable small,
html[data-theme="dark"] .sourceStatusTable span,
html[data-theme="dark"] .tradeStartSummary small,
html[data-theme="dark"] .tradeStartSummary span,
html[data-theme="dark"] .candidateRuleGrid small,
html[data-theme="dark"] .candidateReasonGrid small,
html[data-theme="dark"] .fileRow small,
html[data-theme="dark"] .incomeBarRow small,
html[data-theme="dark"] .candidateMetaGrid em,
html[data-theme="dark"] .candidateMetaGrid span {
  color: #d8e7f7 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

html[data-theme="dark"] .miraiSafetyNote,
html[data-theme="dark"] .simulationNote,
html[data-theme="dark"] .status {
  background: rgba(14, 33, 56, .78) !important;
  border-color: #345579 !important;
}

html[data-theme="dark"] .sourceStatusTable {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

html[data-theme="dark"] .sourceStatusTable div,
html[data-theme="dark"] .compactHealthGrid div,
html[data-theme="dark"] .dataQualityPanel .sourceStatusTable div {
  display: grid;
  grid-template-columns: 1fr !important;
  gap: 6px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.dashboardTrendChart,
.payrollLineChart {
  display: grid;
  gap: 8px;
}

.chartHeader,
.chartAxisLabels,
.chartLegend,
.trendMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
}

.chartHeader small,
.chartAxisLabels span,
.chartLegend span,
.chartLegend small {
  color: #d8e7f7 !important;
  font-weight: 800;
}

.chartLegend i {
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, .45);
}

html[data-theme="dark"] .dashboardTrendChart svg,
html[data-theme="dark"] .payrollLineChart svg {
  background: #0b1628;
  border: 1px solid #2d4262;
  border-radius: 10px;
  min-height: 150px;
}

.payrollDocSummary,
.holdingPriceFilters,
.payrollDocFilters,
.payrollChartTabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0;
}

.payrollDocSummary span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #12233b;
  border: 1px solid #315170;
  color: #eaf4ff !important;
  font-weight: 900;
  font-size: 12px;
}

.payrollDetailItemList {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.payrollDetailItemRow {
  display: grid;
  grid-template-columns: minmax(92px, .8fr) minmax(120px, 1.4fr) minmax(96px, .8fr) minmax(112px, .9fr) auto;
  gap: 8px;
  align-items: center;
}

.stockAnalysisSections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.stockAnalysisSections div,
.manualCandidateDetails {
  background: #0b1628 !important;
  border: 1px solid #2d4262;
  border-radius: 8px;
  padding: 9px;
}

.stockAnalysisSections p {
  margin: 4px 0 0;
  color: #eaf4ff !important;
}

.candidateJudgementDate {
  grid-column: 1 / -1;
  border-color: #60a5fa !important;
}

html[data-theme="dark"] .candidateMetaGrid em {
  background: #0b2545 !important;
  border: 1px solid #315170;
}

html[data-theme="dark"] .brandLogo {
  background: #081323 !important;
  color: #f8fbff !important;
  border-color: #60a5fa !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 4px 12px rgba(0, 0, 0, .28);
}

html[data-theme="dark"] .brandLogo.dc,
html[data-theme="dark"] .brandLogo.kinden {
  color: #06111f !important;
}

html[data-theme="dark"] .command,
html[data-theme="dark"] .iconButton {
  background: #2563eb !important;
  color: #ffffff !important;
  border: 1px solid #60a5fa !important;
}

html[data-theme="dark"] .command.ghost {
  background: #14243a !important;
  color: #eaf4ff !important;
  border-color: #456483 !important;
}

.command[aria-busy="true"],
.iconButton[aria-busy="true"],
.loadingStatus {
  animation: busyPulse 1s ease-in-out infinite;
}

@keyframes busyPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.22); }
}

@media (max-width: 720px) {
  html[data-theme="dark"] .sourceStatusTable,
  .stockAnalysisSections {
    grid-template-columns: 1fr;
  }

  .stockSearchRow {
    grid-template-columns: 1fr;
  }

  .payrollDetailItemRow {
    grid-template-columns: 1fr;
  }

  .chartHeader,
  .chartAxisLabels,
  .chartLegend,
  .trendMeta {
    display: grid;
    grid-template-columns: 1fr;
  }
}

.sourceStatusTable div,
.tradeStartSummary div,
.candidateRuleGrid div,
.candidateReasonGrid div,
.ms2MemoGrid div,
.planFocusGrid div,
.metricGrid div,
.incomeBarRow,
.payrollCoreFields label,
.categoryGrid label {
  background: #ffffff !important;
  color: #0b1220 !important;
  border-color: #b7c6d9 !important;
}

.monthlyStepGrid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 9px !important;
}

.wizardStep {
  display: grid !important;
  grid-template-columns: auto auto minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 8px !important;
}

.powerRank {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
}

.powerRank > b {
  color: #0b1220 !important;
  font-size: 13px !important;
}

.payrollCoreFields,
.categoryGrid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  grid-column: 1 / -1 !important;
}

.incomeCategory {
  grid-column: 1 / -1 !important;
  border: 1px solid #bfdbfe !important;
  border-radius: 12px !important;
  padding: 8px !important;
  background: #f8fbff !important;
}

.abilityTag.neutral {
  background: #e8f1ff !important;
  color: #0b2c5f !important;
  border-color: #93c5fd !important;
}

.abilityTag.neutral small {
  color: #243447 !important;
}

.priceApiTagList .abilityTag.neutral,
.tagList .abilityTag.neutral {
  background: #e8f1ff !important;
  color: #0b2c5f !important;
  border-color: #93c5fd !important;
}

.priceApiTagList .abilityTag.neutral small,
.tagList .abilityTag.neutral small {
  color: #243447 !important;
}

/* Phase1 dark-mode cleanup: remove white-card regressions without changing data logic. */
.compactGuide summary .openCloseLabel {
  display: inline-flex !important;
  min-width: 42px;
  justify-content: flex-end;
  color: #e0f2fe !important;
  font-weight: 900;
  font-style: normal;
}

.compactGuide[open] .openCloseLabel .openText,
.compactGuide:not([open]) .openCloseLabel .closeText {
  display: none !important;
}

.manualBasicsPanel,
.manualBasicsPanel .guideIntro,
.manualBasicsPanel .manualTable div,
.guidePanel .guideIntro,
.guidePanel .guideStep {
  background: #102746 !important;
  color: #f8fbff !important;
  border-color: #38bdf8 !important;
}

.manualBasicsPanel b,
.manualBasicsPanel strong,
.manualBasicsPanel span,
.manualBasicsPanel p,
.manualBasicsPanel h2,
.guidePanel .guideIntro *,
.guidePanel .guideStep * {
  color: #f8fbff !important;
}

.sourceStatusTable div,
.tradeStartSummary div,
.candidateRuleGrid div,
.candidateReasonGrid div,
.ms2MemoGrid div,
.planFocusGrid div,
.metricGrid div,
.incomeBarRow,
.payrollCoreFields label,
.categoryGrid label,
.stockScoreCard,
.firstTradeCandidateCard,
.candidateDetailFold,
.incomeCategory,
.policyPanel,
.allocationRow,
.monthlyInvestmentReview,
.holdingPricePanel .sourceStatusTable div,
.ioSectionPanel .tradeStartSummary div {
  background: #101b2d !important;
  color: #f8fbff !important;
  border-color: #2f74c0 !important;
}

.sourceStatusTable div strong,
.sourceStatusTable div span,
.sourceStatusTable div small,
.tradeStartSummary div strong,
.tradeStartSummary div span,
.tradeStartSummary div small,
.candidateRuleGrid div strong,
.candidateRuleGrid div span,
.candidateRuleGrid div small,
.candidateReasonGrid div strong,
.candidateReasonGrid div span,
.candidateReasonGrid div small,
.ms2MemoGrid div strong,
.ms2MemoGrid div span,
.ms2MemoGrid div small,
.planFocusGrid div strong,
.planFocusGrid div span,
.planFocusGrid div small,
.metricGrid div b,
.metricGrid div span,
.metricGrid div small,
.incomeBarRow strong,
.incomeBarRow span,
.incomeBarRow small,
.payrollCoreFields label,
.categoryGrid label,
.incomeCategory summary,
.candidateDetailFold summary,
.firstTradeCandidateCard strong,
.firstTradeCandidateCard span,
.firstTradeCandidateCard small,
.stockScoreCard strong,
.stockScoreCard span,
.stockScoreCard small {
  color: #f8fbff !important;
  text-shadow: none !important;
}

.metric strong,
.summaryMeta b,
.barLabel strong,
.homeAmount,
.metricsGrid .metric strong {
  color: #f8fbff !important;
  font-weight: 950 !important;
  text-shadow: 0 1px 0 #000 !important;
}

.rankBadge,
.rankBadge.small,
.rankBadge.mini {
  color: #ffffff !important;
  -webkit-text-stroke: 1px #07111f;
  text-shadow: 0 2px 0 #07111f, 1px 0 0 #07111f, -1px 0 0 #07111f !important;
}

.abilityTag {
  min-height: 28px;
  align-items: center;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
  text-shadow: none !important;
}

.abilityTag.neutral,
.tagList .abilityTag.neutral {
  background: #17436e !important;
  color: #eaf6ff !important;
  border-color: #38bdf8 !important;
}

.abilityTag.neutral small,
.tagList .abilityTag.neutral small {
  color: #dbeafe !important;
}

/* PHASE2_FORCE_FINAL_READABILITY */
body .manualBasicsPanel .manualTable div,
body .metric,
body .scorePanel,
body .scoreRow,
body .holdingPricePanel .sourceStatusTable div,
body .finalTradeCandidatesPanel .sourceStatusTable div,
body .firstTradeCandidateCard,
body .candidateDetailFold,
body .candidateRuleGrid div,
body .candidateReasonGrid div,
body .ms2MemoGrid div,
body .marketMemoSummaryPanel,
body .ipoWatchSummaryPanel,
body .highPriceWatchPanel,
body .tradeCompactFold,
body .manualTradeLogPanel,
body .tradeStartPanel,
body .tradingRulesPanel,
body .payrollRecordPanel,
body .payrollRecordPanel label,
body .payrollCoreFields label,
body .categoryGrid label,
body .incomeCategory,
body .planFocusPanel,
body .planFocusGrid div,
body .simulationPanel,
body .investmentSimulationPanel,
body .policyPanel,
body .allocationRow,
body .ioSectionPanel,
body .ioSectionPanel .tradeStartSummary div {
  background: #101b2d !important;
  color: #f8fbff !important;
  border-color: #38bdf8 !important;
  box-shadow: none !important;
}

body .manualBasicsPanel .manualTable div *,
body .metric *,
body .scorePanel *,
body .scoreRow *,
body .holdingPricePanel .sourceStatusTable div *,
body .finalTradeCandidatesPanel .sourceStatusTable div *,
body .firstTradeCandidateCard *,
body .candidateDetailFold *,
body .candidateRuleGrid div *,
body .candidateReasonGrid div *,
body .ms2MemoGrid div *,
body .marketMemoSummaryPanel *,
body .ipoWatchSummaryPanel *,
body .highPriceWatchPanel *,
body .tradeCompactFold *,
body .manualTradeLogPanel *,
body .tradeStartPanel *,
body .tradingRulesPanel *,
body .payrollRecordPanel *,
body .payrollRecordPanel label *,
body .payrollCoreFields label *,
body .categoryGrid label *,
body .incomeCategory *,
body .planFocusPanel *,
body .planFocusGrid div *,
body .simulationPanel *,
body .investmentSimulationPanel *,
body .policyPanel *,
body .allocationRow *,
body .ioSectionPanel *,
body .ioSectionPanel .tradeStartSummary div *,
body .finalTradeCandidatesPanel .miraiSafetyNote {
  color: #f8fbff !important;
  text-shadow: none !important;
}

body .metric strong,
body .metric b,
body .summaryMeta b,
body .barLabel strong,
body .amount,
body .currency,
body [data-money] {
  color: #ffffff !important;
  font-weight: 950 !important;
  text-shadow: 0 1px 0 #000 !important;
}

body .rankBadge,
body .rankBadge.small,
body .rankBadge.mini {
  color: #ffffff !important;
  -webkit-text-stroke: 1px #07111f;
  text-shadow: 0 2px 0 #07111f, 1px 0 0 #07111f, -1px 0 0 #07111f !important;
}

body .abilityTag.neutral,
body .tagList .abilityTag.neutral {
  background: #17436e !important;
  color: #eaf6ff !important;
  border-color: #38bdf8 !important;
}

body .abilityTag.neutral *,
body .tagList .abilityTag.neutral * {
  color: #dbeafe !important;
}

body .simulationNote,
body .simulationNote *,
body .planFocusGrid strong,
body .planFocusGrid div strong,
body .planFocusPanel strong,
body .investmentSimulationPanel strong {
  color: #f8fbff !important;
  text-shadow: none !important;
}

/* Phase8B final tab count override. */
.tabBar {
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
}

/* Phase8B: Mirai summary is centralized on Home, so bottom navigation has 8 tabs. */
.tabBar {
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
}

/* PRICE_RELIABILITY_EMERGENCY_READABILITY */
body .liveSymbolPanel,
body .liveSymbolGrid > div,
body .allStockPriceStatusPanel .sourceStatusTable > div,
body .candidatePriceState,
body .payrollDetailItemRow,
body .payrollLineChart,
body .dashboardTrendChart {
  background: #0b1424 !important;
  color: #eef6ff !important;
  border: 1px solid #2f5f86 !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28) !important;
}

body .liveSymbolPanel *,
body .liveSymbolGrid > div *,
body .allStockPriceStatusPanel .sourceStatusTable > div *,
body .candidatePriceState *,
body .payrollDetailItemRow *,
body .payrollLineChart *,
body .dashboardTrendChart * {
  color: #eef6ff !important;
}

body .liveSymbolGrid small,
body .candidatePriceState small,
body .allStockPriceStatusPanel small,
body .payrollLineChart .status,
body .dashboardTrendChart small,
body .chartAxisLabels,
body .chartLegend small {
  color: #c7d9ee !important;
  opacity: 1 !important;
}

body .candidatePriceState em,
body .allStockPriceStatusPanel .sourceStatusTable small,
body .liveSymbolGrid span {
  color: #dbeafe !important;
  line-height: 1.55 !important;
  overflow-wrap: anywhere;
}

body .chartTick {
  fill: #dbeafe !important;
  font-size: 4px;
  font-weight: 800;
}

body .trendGrid {
  stroke: rgba(203, 213, 225, 0.42) !important;
  stroke-width: 0.65 !important;
}

body .trendLine {
  stroke: #38bdf8 !important;
  stroke-width: 1.8 !important;
  fill: none !important;
}

body .trendPoint {
  fill: #f8fbff !important;
  stroke: #0b1424 !important;
  stroke-width: 0.7 !important;
}

body .command.busy,
body button[aria-busy="true"],
body button:disabled {
  cursor: progress !important;
  filter: brightness(1.18) saturate(1.2);
  outline: 2px solid rgba(56, 189, 248, 0.75);
}

body .priceReliabilityWarning,
body .payrollConfirmedOnlyNote {
  color: #f8fbff !important;
  background: rgba(14, 35, 58, 0.92) !important;
  border-color: #38bdf8 !important;
}

.allStockPriceStatusPanel .stockMarketSummaryGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.allStockPriceStatusPanel .stockMarketSummaryGrid div,
.allStockPriceStatusPanel .sourceStatusTable div {
  background: #101b2d !important;
  color: #f8fbff !important;
  border: 1px solid #2f74c0 !important;
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.allStockPriceStatusPanel .stockMarketSummaryGrid strong,
.allStockPriceStatusPanel .stockMarketSummaryGrid span,
.allStockPriceStatusPanel .sourceStatusTable strong,
.allStockPriceStatusPanel .sourceStatusTable span,
.allStockPriceStatusPanel .sourceStatusTable small {
  color: #f8fbff !important;
  text-shadow: none !important;
}

.allStockPriceStatusPanel .sourceStatusTable {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.allStockPriceStatusPanel .filterChips,
.allStockPriceStatusPanel .listControl {
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 520px) {
  .allStockPriceStatusPanel .stockMarketSummaryGrid,
  .allStockPriceStatusPanel .sourceStatusTable {
    grid-template-columns: 1fr;
  }
}

/* V0_2_PHASE3_ASSET_DASHBOARD_POLISH */
.dashboardReviewPanel {
  display: grid;
  gap: 12px;
  border-color: #38bdf8 !important;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, .98), rgba(8, 18, 36, .98)) !important;
}

.dashboardQuickGrid,
.dashboardFreshnessGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dashboardQuickGrid article,
.dashboardFreshnessGrid div,
.dashboardClassChips span,
.miraiDashboardNote {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(56, 189, 248, .72);
  border-radius: 8px;
  background: #101b2d;
  color: #f8fbff;
}

.dashboardQuickGrid span,
.dashboardFreshnessGrid strong,
.dashboardClassChips b {
  display: block;
  color: #dbeafe !important;
  font-size: 12px;
  font-weight: 900;
}

.dashboardQuickGrid strong {
  display: block;
  margin-top: 5px;
  color: #ffffff !important;
  font-size: clamp(17px, 2.2vw, 24px);
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 0 #000;
}

.dashboardQuickGrid small,
.dashboardFreshnessGrid small,
.miraiDashboardNote li {
  display: block;
  margin-top: 6px;
  color: #cbd5e1 !important;
  font-size: 12px;
  line-height: 1.45;
}

.dashboardFreshnessGrid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboardFreshnessGrid div {
  display: grid;
  gap: 6px;
  align-content: start;
}

.dashboardFreshnessGrid .abilityTag {
  justify-self: start;
  min-height: 25px;
  padding: 3px 8px;
  font-size: 12px;
}

.dashboardClassChips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboardClassChips span {
  flex: 1 1 130px;
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 900;
}

.miraiDashboardNote strong {
  display: block;
  margin-bottom: 6px;
  color: #67e8f9 !important;
  font-size: 15px;
}

.dashboardChartComparePanel {
  display: grid;
  gap: 12px;
  border-color: #22c55e !important;
  background:
    radial-gradient(circle at 8% 0%, rgba(34, 197, 94, .14), transparent 34%),
    linear-gradient(135deg, rgba(8, 18, 32, .98), rgba(15, 23, 42, .98)) !important;
}

.dashboardChartGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dashboardChartGrid > article {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(34, 197, 94, .46);
  border-radius: 8px;
  background: #101b2d;
  color: #f8fbff;
}

.dashboardChartGrid > article > strong {
  display: block;
  margin-bottom: 8px;
  color: #bbf7d0 !important;
  font-size: 14px;
}

.dashboardTrendChart {
  display: grid;
  gap: 8px;
}

.dashboardTrendChart svg {
  display: block;
  width: 100%;
  height: 142px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 7px;
  background: #07111f;
}

.dashboardTrendChart .trendGrid {
  stroke: rgba(148, 163, 184, .2);
  stroke-width: .7;
}

.dashboardTrendChart .trendLine {
  fill: none;
  stroke: #38bdf8;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, .35));
}

.dashboardTrendChart .trendPoint {
  fill: #fbbf24;
  stroke: #020617;
  stroke-width: 1.4;
}

.trendMeta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #dbeafe;
  font-size: 12px;
}

.trendMeta strong,
.goodText {
  color: #7dd3fc !important;
}

.badText {
  color: #fca5a5 !important;
}

.comparisonRows,
.dashboardClassBars {
  display: grid;
  gap: 8px;
}

.comparisonRows > div,
.dashboardClassBars > div,
.dashboardEmptyState {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 7px;
  background: #0b1220;
}

.comparisonRows span,
.dashboardClassBars span,
.dashboardEmptyState small {
  display: block;
  color: #cbd5e1 !important;
  font-size: 12px;
  line-height: 1.45;
}

.comparisonRows b,
.dashboardClassBars b,
.dashboardEmptyState strong {
  display: block;
  margin: 3px 0;
  color: #f8fafc !important;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.dashboardClassBars i {
  display: block;
  height: 10px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, .22);
}

.dashboardClassBars em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #22c55e);
}

.miraiDashboardNote ul {
  margin: 0;
  padding-left: 18px;
}

/* V0_2_PHASE4_INCOME_TAX_UX_POLISH */
.payrollWorkflowPanel {
  display: grid;
  gap: 12px;
}

.payrollWorkflowSteps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.payrollWorkflowSteps article {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(56, 189, 248, .72);
  border-radius: 8px;
  background: #101b2d;
  color: #f8fbff;
}

.payrollWorkflowSteps article > b {
  width: 28px;
  min-width: 28px;
  justify-content: center;
}

.payrollWorkflowSteps strong {
  display: block;
  margin-top: 8px;
  color: #ffffff !important;
  font-size: 14px;
}

.payrollWorkflowSteps small,
.payrollStateLegend small,
.payrollConfirmedOnlyNote {
  color: #cbd5e1 !important;
  line-height: 1.45;
}

.payrollStateLegend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.payrollCandidateRow,
.payrollRecordRow {
  align-items: stretch;
}

.payrollCandidateRow > div:first-child,
.payrollRecordRow > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.payrollRowActions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.payrollRowActions .abilityTag {
  min-height: 26px;
  padding: 3px 8px;
  font-size: 12px;
}

.payrollEmptyState {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px dashed rgba(56, 189, 248, .7);
  border-radius: 8px;
  background: rgba(15, 23, 42, .82);
  color: #f8fbff;
}

.payrollEmptyState strong {
  color: #ffffff !important;
}

.payrollEmptyState small {
  color: #cbd5e1 !important;
}

.payrollRecordPanel .status.wide {
  grid-column: 1 / -1;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid rgba(56, 189, 248, .6);
  border-radius: 8px;
  background: rgba(15, 23, 42, .72);
}

@media (max-width: 860px) {
  .payrollWorkflowSteps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .payrollWorkflowSteps {
    grid-template-columns: 1fr;
  }
  .payrollRowActions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .dashboardQuickGrid,
  .dashboardFreshnessGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .dashboardQuickGrid article,
  .dashboardFreshnessGrid div,
  .miraiDashboardNote {
    padding: 9px;
  }
}

@media (max-width: 430px) {
  .dashboardQuickGrid,
  .dashboardFreshnessGrid {
    grid-template-columns: 1fr;
  }
  .dashboardQuickGrid strong {
    font-size: 18px;
  }
  .dashboardClassChips span {
    flex-basis: 100%;
  }
}

.compactHealthGrid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.dataQualityPanel .sourceStatusTable {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.dataQualityPanel .sourceStatusTable div {
  min-width: 0;
}

.dataQualityPanel small,
.dataQualityPanel span {
  overflow-wrap: anywhere;
}

.dataQualityCards div {
  border-color: rgba(56, 189, 248, 0.34) !important;
}

.manualCandidateList {
  display: grid;
  gap: 8px;
}

.manualCandidateCard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 8px;
  background: rgba(8, 18, 34, 0.82);
}

.manualCandidateCard div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.manualCandidateCard small {
  overflow-wrap: anywhere;
}

.manualFixPreviewCard {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(250, 204, 21, 0.38);
  border-radius: 8px;
  background: rgba(14, 25, 42, 0.94);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.manualFixPreviewCard h3,
.manualFixPreviewCard p {
  margin: 0;
}

.manualFixPreviewCard .sourceStatusTable {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

@media (max-width: 520px) {
  .manualCandidateCard {
    grid-template-columns: 1fr;
  }
}

.compactHealthGrid div,
.monthlyOperationStep {
  border: 1px solid rgba(125, 211, 252, 0.28);
  background: rgba(8, 18, 34, 0.82);
  border-radius: 8px;
}

.compactHealthGrid div {
  display: grid;
  gap: 6px;
}

.monthlyOperationSteps {
  display: grid;
  gap: 8px;
}

.monthlyReportControls {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto auto auto;
  gap: 10px;
  align-items: end;
  margin: 10px 0 12px;
}

.monthlyReportControls label {
  display: grid;
  gap: 5px;
  color: #f8fbff;
  font-weight: 800;
}

.monthlyReportControls .checkLabel {
  align-self: center;
  margin: 0;
}

.monthlyOperationStep {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
}

.monthlyOperationStep div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.monthlyOperationStep small {
  overflow-wrap: anywhere;
}

@media (max-width: 520px) {
  .monthlyReportControls {
    grid-template-columns: 1fr;
  }

  .monthlyOperationStep {
    grid-template-columns: 1fr;
  }
}

/* PHASE4_5_6_IO_PLAN_MARKET */
body .investmentMiniPanel,
body .investmentMiniPanel .investmentMiniGrid div,
body .investmentMiniPanel .miraiDecisionGrid div,
body .investmentMiniPanel .investmentSimulation,
body .externalFactsPanel,
body .externalFactsPanel .sourceStatusTable div,
body .ioSectionPanel,
body .ioSectionPanel .tradeStartSummary div,
body .ioSectionPanel .foldPanel {
  background: #0b1220 !important;
  color: #f8fbff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 3px 0 #06101f, inset 0 0 0 1px rgba(56, 189, 248, 0.16) !important;
}

body .investmentMiniPanel *,
body .externalFactsPanel *,
body .ioSectionPanel *,
body .ioSectionPanel .foldPanel * {
  color: #f8fbff !important;
  text-shadow: none !important;
}

body .investmentMiniPanel strong,
body .externalFactsPanel strong,
body .ioSectionPanel strong {
  color: #ffffff !important;
  font-weight: 950 !important;
}

body .investmentMiniPanel .investmentSettingsForm,
body .investmentMiniPanel [data-save-investment-plan-settings],
body .priceStatusPanel,
body .manualPriceForm {
  display: none !important;
}

.simulationLineChart .chartTarget {
  stroke: #7dd3fc !important;
  stroke-width: 2 !important;
  stroke-dasharray: none !important;
}

.simulationLineChart .chartTargetLabel {
  fill: #dbeafe !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}

.simulationGrid {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)) !important;
}

html body p.simulationNote,
html body .panel p.simulationNote,
html body .planFocusGrid div strong,
html body .planFocusPanel .planFocusGrid div strong,
html body .tradeStartSummary div strong,
html body .priceStatusPanel .tradeStartSummary div strong {
  color: #f8fbff !important;
  text-shadow: none !important;
}

/* PHASE3_TRADING_CANDIDATE_CARD_REBUILD */
body .finalTradeCandidatesPanel,
body .firstTradeCandidatesPanel,
body .tradeCompactFold {
  background: #0b1220 !important;
  color: #f8fbff !important;
  border-color: #38bdf8 !important;
}

body .tradingCandidateList,
body .firstTradeCandidateGrid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
  gap: 10px !important;
  align-items: stretch !important;
}

body .firstTradeCandidateCard,
body .finalCandidateCard {
  display: grid !important;
  gap: 9px !important;
  padding: 12px !important;
  background: linear-gradient(145deg, #101b2d, #0f274a) !important;
  color: #f8fbff !important;
  border: 1px solid #38bdf8 !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .28) !important;
}

body .firstTradeCandidateCard header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 8px !important;
  align-items: start !important;
}

body .firstTradeCandidateCard header strong,
body .firstTradeCandidateCard header span,
body .finalCandidateCard header strong,
body .finalCandidateCard header span,
body .candidatePriceLine,
body .candidateMiraiNote {
  color: #f8fbff !important;
}

.priceDataBadge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  background: rgba(15, 23, 42, 0.8);
  color: #e5e7eb !important;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.priceDataBadge b {
  color: inherit !important;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
}

.priceDataBadge.rt {
  border-color: rgba(34, 197, 94, 0.62);
  background: rgba(20, 83, 45, 0.72);
}

.priceDataBadge.eod {
  border-color: rgba(96, 165, 250, 0.62);
  background: rgba(30, 64, 175, 0.68);
}

.priceDataBadge.manual {
  border-color: rgba(251, 191, 36, 0.64);
  background: rgba(146, 64, 14, 0.62);
}

.priceDataBadge.staleFail {
  border-color: rgba(148, 163, 184, 0.58);
  background: rgba(71, 85, 105, 0.7);
}

body .tradeDirectionPill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 24px !important;
  max-width: 150px !important;
  padding: 4px 8px !important;
  white-space: normal !important;
  line-height: 1.15 !important;
  color: #ffffff !important;
  background: #0b74ff !important;
  border: 1px solid #93c5fd !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  text-align: center !important;
}

body .candidateScoreRow {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
}

body .candidateScoreRow span {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 22px !important;
  padding: 3px 7px !important;
  color: #f8fbff !important;
  background: #172554 !important;
  border: 1px solid #38bdf8 !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  line-height: 1.15 !important;
}

body .candidateScoreGrid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

body .candidateScoreGrid > div {
  display: grid !important;
  place-items: center !important;
  min-height: 58px !important;
  padding: 7px !important;
  background: #111c2f !important;
  border: 1px solid #2dd4bf !important;
  border-radius: 10px !important;
  color: #f8fbff !important;
}

body .candidateScoreGrid small,
body .candidateScoreGrid span {
  color: #dbeafe !important;
  font-weight: 800 !important;
  text-align: center !important;
}

body .rankBadge,
body .rankBadge.small,
body .rankBadge.mini,
body .candidateScoreGrid .rankBadge {
  display: inline-grid !important;
  place-items: center !important;
  min-width: 34px !important;
  min-height: 34px !important;
  color: #ffffff !important;
  font-weight: 950 !important;
  text-align: center !important;
  -webkit-text-stroke: 1px #07111f !important;
  text-shadow: 0 2px 0 #07111f, 1px 0 0 #07111f, -1px 0 0 #07111f !important;
}

body .candidateMetaGrid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px !important;
  margin: 0 !important;
}

body .candidateMetaGrid em {
  display: grid !important;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr) !important;
  gap: 6px !important;
  align-items: center !important;
  padding: 7px 8px !important;
  min-height: 30px !important;
  background: #0f1a2c !important;
  color: #f8fbff !important;
  border: 1px solid #334155 !important;
  border-radius: 8px !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
}

body .candidateMetaGrid b,
body .candidateMetaGrid span {
  color: #f8fbff !important;
  font-style: normal !important;
  min-width: 0 !important;
}

body .candidateMetaGrid b {
  color: #93c5fd !important;
  font-weight: 900 !important;
}

body .candidateDetailFold,
body .candidateDetailFold[open],
body .ms2OrderBrief,
body .ms2OrderMemo,
body .candidatePriceState {
  background: #0f172a !important;
  color: #f8fbff !important;
  border: 1px solid #38bdf8 !important;
  border-radius: 12px !important;
}

body .candidateDetailFold summary,
body .ms2OrderMemo summary {
  color: #ffffff !important;
  font-weight: 950 !important;
  text-align: left !important;
}

body .candidateRuleGrid,
body .candidateReasonGrid,
body .ms2MemoGrid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

body .candidateRuleGrid div,
body .candidateReasonGrid div,
body .ms2MemoGrid div,
body .candidatePriceState {
  min-height: 0 !important;
  padding: 8px !important;
  background: #101b2d !important;
  color: #f8fbff !important;
  border: 1px solid #334155 !important;
  border-radius: 10px !important;
}

body .candidateRuleGrid small,
body .candidateReasonGrid small,
body .ms2MemoGrid small,
body .candidatePriceState small {
  color: #93c5fd !important;
  font-weight: 900 !important;
}

body .candidateRuleGrid span,
body .candidateReasonGrid span,
body .ms2MemoGrid span,
body .candidatePriceState em {
  color: #f8fbff !important;
  font-style: normal !important;
  line-height: 1.35 !important;
}

html body .firstTradeCandidatesPanel > summary,
html body .firstTradeCandidatesPanel > summary *,
html body .firstTradeCandidatesPanel p.miraiSafetyNote,
html body .candidateDetailFold p.miraiSafetyNote,
html body .candidateDetailFold p.candidateMiraiNote,
html body .ms2OrderMemo p.miraiSafetyNote,
html body .finalTradeCandidatesPanel p.miraiSafetyNote,
html body .tradeCompactFold p.miraiSafetyNote,
html body .tradeCompactFold .priceStatusPanel p.miraiSafetyNote,
html body .tradeCompactFold .priceStatusPanel .sourceStatusTable div strong,
html body .tradeCompactFold .priceStatusPanel .sourceStatusTable div span,
html body .tradeCompactFold .priceStatusPanel .sourceStatusTable div small {
  color: #f8fbff !important;
  text-shadow: none !important;
}

body .candidateReasonGrid .tagList,
body .candidatePriceState .tagList {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
}

body .candidateReasonGrid .abilityTag,
body .candidatePriceState .abilityTag {
  min-height: 24px !important;
  padding: 4px 7px !important;
  border-radius: 999px !important;
  line-height: 1.15 !important;
  white-space: normal !important;
}

@media (max-width: 430px) {
  body .tradingCandidateList,
  body .firstTradeCandidateGrid,
  body .candidateRuleGrid,
  body .candidateReasonGrid,
  body .ms2MemoGrid,
  body .candidateMetaGrid {
    grid-template-columns: 1fr !important;
  }

  body .firstTradeCandidateCard header {
    grid-template-columns: 1fr !important;
  }

  body .tradeDirectionPill {
    justify-self: start !important;
    max-width: 100% !important;
  }
}

/* PHASE2_COLOR_READABILITY_FINAL */
.manualBasicsPanel .manualTable div,
.metric,
.scorePanel,
.scoreRow,
.holdingPricePanel .sourceStatusTable div,
.finalTradeCandidatesPanel .sourceStatusTable div,
.firstTradeCandidateCard,
.candidateDetailFold,
.candidateRuleGrid div,
.candidateReasonGrid div,
.ms2MemoGrid div,
.marketMemoSummaryPanel,
.ipoWatchSummaryPanel,
.highPriceWatchPanel,
.tradeCompactFold,
.manualTradeLogPanel,
.tradeStartPanel,
.tradingRulesPanel,
.payrollRecordPanel,
.payrollRecordPanel label,
.payrollCoreFields label,
.categoryGrid label,
.incomeCategory,
.planFocusPanel,
.planFocusGrid div,
.simulationPanel,
.investmentSimulationPanel,
.policyPanel,
.allocationRow,
.ioSectionPanel,
.ioSectionPanel .tradeStartSummary div {
  background: linear-gradient(180deg, #12243d 0%, #0b1628 100%) !important;
  color: #f8fbff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 3px 0 #06101f, inset 0 0 0 1px rgba(56, 189, 248, 0.18) !important;
}

.manualBasicsPanel .manualTable div *,
.metric *,
.scorePanel *,
.scoreRow *,
.holdingPricePanel .sourceStatusTable div *,
.finalTradeCandidatesPanel .sourceStatusTable div *,
.firstTradeCandidateCard *,
.candidateDetailFold *,
.candidateRuleGrid div *,
.candidateReasonGrid div *,
.ms2MemoGrid div *,
.marketMemoSummaryPanel *,
.ipoWatchSummaryPanel *,
.highPriceWatchPanel *,
.tradeCompactFold *,
.manualTradeLogPanel *,
.tradeStartPanel *,
.tradingRulesPanel *,
.payrollRecordPanel *,
.incomeCategory *,
.planFocusPanel *,
.planFocusGrid div *,
.simulationPanel *,
.investmentSimulationPanel *,
.policyPanel *,
.allocationRow *,
.ioSectionPanel *,
.ioSectionPanel .tradeStartSummary div * {
  color: #f8fbff !important;
  text-shadow: none !important;
}

.panel p,
.panel small,
.panel span,
.helpText,
.status,
.simulationNote,
.miraiSafetyNote,
.guideCaution,
.candidateMiraiNote,
.sectionHeader span {
  color: #dbeafe !important;
}

.metric strong,
.summaryMeta b,
.barLabel strong,
.diffTable strong,
.incomeBarRow b,
.planFocusGrid strong,
.sourceStatusTable strong,
.tradeStartSummary strong,
.candidateRuleGrid strong,
.candidateReasonGrid strong {
  color: #ffffff !important;
  font-weight: 950 !important;
  text-shadow: 0 1px 0 #000, 0 0 8px rgba(56, 189, 248, 0.28) !important;
}

.rankBadge,
.rankBadge.small,
.rankBadge.mini,
.rankLegendCompact .rankBadge {
  color: #ffffff !important;
  -webkit-text-stroke: 1.2px #020617 !important;
  text-shadow: 0 2px 0 #020617, 1px 0 0 #020617, -1px 0 0 #020617, 0 0 8px rgba(0,0,0,.45) !important;
}

.abilityTag {
  color: #ffffff !important;
  border-color: rgba(255,255,255,.72) !important;
  text-shadow: 0 1px 0 #020617 !important;
  box-shadow: 0 2px 0 #020617 !important;
}

.abilityTag.plus {
  background: #0969da !important;
}

.abilityTag.minus {
  background: #dc2626 !important;
}

.abilityTag.neutral,
.tagList .abilityTag.neutral {
  background: #17436e !important;
  color: #ffffff !important;
}

.abilityTag small,
.abilityTag.neutral small,
.tagList .abilityTag.neutral small {
  color: #e5f3ff !important;
}

input,
select,
textarea {
  background: #071426 !important;
  color: #f8fbff !important;
  border-color: #38bdf8 !important;
}

input::placeholder,
textarea::placeholder {
  color: #93c5fd !important;
}

.holdingPricePanel .sourceStatusTable div span,
.holdingPricePanel .sourceStatusTable div small,
.finalTradeCandidatesPanel .sourceStatusTable div span,
.finalTradeCandidatesPanel .sourceStatusTable div small,
.priceStatusPanel .tradeStartSummary div span,
.priceStatusPanel .tradeStartSummary div small,
.rebalancePremisePanel span,
.rebalancePremisePanel small,
.panel.priceStatusPanel .tradeStartSummary div span,
.panel.priceStatusPanel .tradeStartSummary div small,
.finalTradeCandidatesPanel .miraiSafetyNote,
.stockResultList .status {
  color: #f8fbff !important;
}

.payrollRecordPanel label.wide,
.payrollRecordPanel .wide,
.formGrid label.wide {
  background: #101b2d !important;
  color: #f8fbff !important;
  border-color: #38bdf8 !important;
}

@media (max-width: 430px) {
  .tabBar button span {
    font-size: clamp(7px, 2.15vw, 9px) !important;
  }

  .payrollCoreFields,
  .categoryGrid,
  .payrollView .formGrid,
  .metricsGrid,
  .planFocusGrid {
    grid-template-columns: 1fr !important;
  }

  .wizardStep {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }

  .wizardStep input {
    grid-row: span 2;
  }
}
/* EOF neutral tag contrast */
.abilityTag.neutral {
  background: #e8f1ff !important;
  color: #0b2c5f !important;
  border-color: #93c5fd !important;
}

.abilityTag.neutral small {
  color: #243447 !important;
}

/* Display rescue: keep the PDF/browser view readable without touching data logic. */
body,
button,
input,
select,
textarea,
.tabBar button,
.panel,
.advisorCard,
.itemCard,
.guidePanel,
.foldPanel {
  letter-spacing: 0 !important;
  text-shadow: none !important;
}

.tabBar {
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  gap: 2px !important;
  overflow: hidden !important;
}

.tabBar button {
  display: grid !important;
  place-items: center !important;
  min-width: 0 !important;
  padding: 4px 1px !important;
  font-size: 0 !important;
  white-space: nowrap !important;
}

.tabBar button span {
  margin: 0 !important;
  max-width: 100% !important;
  color: #f8fbff !important;
  font-size: clamp(8px, 2.25vw, 12px) !important;
  line-height: 1.05 !important;
  font-weight: 900 !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

.compactGuide {
  padding: 8px 10px !important;
}

.compactGuide summary {
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  gap: 8px !important;
}

.compactGuide summary em,
.compactGuide summary::before,
.compactGuide summary::after,
.foldPanel > summary::before,
.foldPanel > summary::after {
  content: none !important;
  display: none !important;
}

.compactGuide:not([open]) .guideIntro,
.compactGuide:not([open]) .guideGrid,
.compactGuide:not([open]) .guideCaution,
.foldPanel:not([open]) .foldBody,
.candidateDetailFold:not([open]) > :not(summary),
.firstTradeCandidatesPanel:not([open]) > :not(summary) {
  display: none !important;
}

.guidePanel,
.miraiTabHint {
  background: #0f274a !important;
  color: #f8fbff !important;
  border-color: #38bdf8 !important;
}

.guidePanel b,
.guidePanel strong,
.guidePanel h2,
.guidePanel h3,
.guidePanel p,
.guidePanel li,
.guidePanel small,
.miraiTabHint p {
  color: #f8fbff !important;
}

.panel small,
.panel .helpText,
.panel .simulationNote,
.panel .miraiSafetyNote,
.panel .sectionHeader span,
.panel .summaryMeta span,
.panel .candidateMiraiNote,
.sourceStatusTable small,
.tradeStartSummary small,
.candidateRuleGrid small,
.candidateReasonGrid small,
.ms2MemoGrid small,
.incomeBarRow small {
  color: #243447 !important;
}

.sourceStatusTable div,
.tradeStartSummary div,
.candidateRuleGrid div,
.candidateReasonGrid div,
.ms2MemoGrid div,
.planFocusGrid div,
.metricGrid div,
.incomeBarRow,
.payrollCoreFields label,
.categoryGrid label {
  background: #ffffff !important;
  color: #0b1220 !important;
  border-color: #b7c6d9 !important;
}

.sourceStatusTable span,
.tradeStartSummary span,
.candidateRuleGrid span,
.candidateReasonGrid span,
.ms2MemoGrid span,
.metricGrid span,
.planFocusGrid span,
.incomeBarRow span,
.candidatePriceState em {
  color: #172033 !important;
}

.monthlyStepGrid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 9px !important;
}

.wizardStep {
  display: grid !important;
  grid-template-columns: auto auto minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 8px !important;
  min-height: 0 !important;
}

.wizardStep .stepNo {
  white-space: nowrap !important;
}

.powerRank {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
}

.powerRank > b {
  color: #0b1220 !important;
  font-size: 13px !important;
}

.candidateScoreGrid strong.powerScore,
.candidateScoreGrid strong {
  display: inline-flex !important;
  align-items: center !important;
}

.firstTradeCandidatesPanel > summary,
.candidateDetailFold > summary,
.incomeCategory > summary {
  cursor: pointer !important;
  color: #0b1220 !important;
  font-weight: 900 !important;
}

.candidateDetailFold {
  margin-top: 8px !important;
  border: 1px solid #bfdbfe !important;
  border-radius: 10px !important;
  padding: 8px !important;
  background: #f8fbff !important;
}

.payrollCoreFields,
.categoryGrid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  grid-column: 1 / -1 !important;
}

.incomeCategory {
  grid-column: 1 / -1 !important;
  border: 1px solid #bfdbfe !important;
  border-radius: 12px !important;
  padding: 8px !important;
  background: #f8fbff !important;
}

.incomeCategory:not([open]) > :not(summary) {
  display: none !important;
}

.priceErrorFold,
.priceUnsupportedFold,
.tradeCompactFold,
.usageMonthlyFold,
.referenceMetricPanel {
  background: #ffffff !important;
  color: #0b1220 !important;
}

.priceStatusPanel .tradeStartSummary div strong,
.priceStatusPanel .sourceStatusTable div strong,
.finalTradeCandidatesPanel .sourceStatusTable div strong,
.employeeStockDecisionPanel .candidateRuleGrid div strong,
.holdingPricePanel .sourceStatusTable div strong {
  color: #0b1220 !important;
}

.priceStatusPanel .tradeStartSummary div span,
.priceStatusPanel .tradeStartSummary div small,
.priceStatusPanel .sourceStatusTable div span,
.priceStatusPanel .sourceStatusTable div small,
.finalTradeCandidatesPanel .sourceStatusTable div span,
.finalTradeCandidatesPanel .sourceStatusTable div small,
.employeeStockDecisionPanel .candidateRuleGrid div span,
.employeeStockDecisionPanel .candidateRuleGrid div small,
.holdingPricePanel .sourceStatusTable div span,
.holdingPricePanel .sourceStatusTable div small {
  color: #172033 !important;
}

@media (max-width: 430px) {
  .tabBar button span {
    font-size: clamp(7px, 2.15vw, 9px) !important;
  }

  .view {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .panel,
  .advisorCard,
  .itemCard {
    padding: 9px !important;
    margin-top: 8px !important;
  }

  .payrollCoreFields,
  .categoryGrid,
  .payrollView .formGrid,
  .metricsGrid,
  .planFocusGrid {
    grid-template-columns: 1fr !important;
  }

  .wizardStep {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }

  .wizardStep input {
    grid-row: span 2;
  }
}

/* Fastlane visual polish: dark-mode contrast and payroll tab */
html[data-theme="dark"] .panel,
html[data-theme="dark"] .itemCard,
body.dark-mode .panel,
body.dark-mode .itemCard {
  background: #111827 !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}
html[data-theme="dark"] .panel h1,
html[data-theme="dark"] .panel h2,
html[data-theme="dark"] .panel h3,
html[data-theme="dark"] .panel h4,
html[data-theme="dark"] .panel strong,
html[data-theme="dark"] .panel b,
body.dark-mode .panel h1,
body.dark-mode .panel h2,
body.dark-mode .panel h3,
body.dark-mode .panel h4,
body.dark-mode .panel strong,
body.dark-mode .panel b {
  color: #f8fafc !important;
}
html[data-theme="dark"] .panel small,
html[data-theme="dark"] .panel span,
html[data-theme="dark"] .status,
body.dark-mode .panel small,
body.dark-mode .panel span,
body.dark-mode .status {
  color: #dbeafe !important;
}
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
  background: #0b1220 !important;
  color: #f8fafc !important;
  border-color: #475569 !important;
}
.payrollBars { display: grid; gap: 10px; }
.payrollBarRow {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: rgba(15, 23, 42, .65);
}
.payrollBarRow small { grid-column: 1 / -1; }
.powerScore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #f8fafc !important;
}

.uploadState {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  margin: 10px 0;
  border: 1px solid rgba(125, 211, 252, .28);
  border-radius: 10px;
  background: rgba(15, 23, 42, .72);
  color: #f8fafc;
}
.uploadState strong,
.uploadState small { overflow-wrap: anywhere; }
.uploadState span { color: #bae6fd; font-weight: 900; }
.uploadState small { color: #dbeafe; font-weight: 800; }
.payrollDocList { display: grid; gap: 8px; margin-top: 10px; }
.payrollDocList .fileRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 8px;
  background: rgba(2, 6, 23, .42);
  color: #f8fafc;
}
.payrollDocList .fileRow span,
.payrollDocList .fileRow small { overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .uploadState,
  .payrollDocList .fileRow { grid-template-columns: 1fr; }
}
.candidatePriceState em {
  display: block;
  margin-top: 6px;
  color: #fef3c7;
  font-style: normal;
  font-weight: 800;
}
@media (max-width: 520px) {
  .payrollBarRow { grid-template-columns: 1fr; }
  .tabBar { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .tabBar button { font-size: 12px !important; }
  .tabBar button span { font-size: 8px !important; }
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; overflow-x: hidden; }
button, input, select { font: inherit; }

#app { min-height: 100vh; padding-bottom: 84px; }
#app:has(.remoteReadOnlyHeader) { padding-top: 76px; }
#app:has(.remoteReadOnlyHeader) .remoteReadOnlyHeader { margin-top: -76px; }
.view { width: min(1040px, 100%); margin: 0 auto; padding: 18px 14px 24px; }
.titleRow { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 4px 0 18px; }
.titleRow h1 { margin: 0; font-size: 30px; line-height: 1.1; letter-spacing: 0; }
.eyebrow { margin: 0 0 4px; color: #56645d; font-size: 13px; font-weight: 800; }
.date { padding: 8px 10px; border-radius: 6px; color: #223b32; background: #e7f4ea; font-size: 13px; font-weight: 800; }

.scoreHero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 3px solid #1b2630;
  border-radius: 8px;
  background: #fffefa;
  box-shadow: 0 8px 0 #1b2630;
}

.scoreHero::before,
.inkPanel::before {
  content: "";
  position: absolute;
  inset: auto -20px -30px auto;
  width: 150px;
  height: 100px;
  border-radius: 54% 46% 62% 38%;
  background: rgba(20, 216, 255, .22);
  transform: rotate(-18deg);
}

.rankHero { display: flex; align-items: center; gap: 14px; }
.rankHero h1 { margin: 0; font-size: 30px; letter-spacing: 0; }
.rankHero p { margin: 4px 0 0; color: #36473d; font-weight: 800; }

.rankBadge {
  display: inline-grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 3px solid #1b2630;
  border-radius: 8px;
  color: #111;
  font-size: 42px;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 2px rgba(255,255,255,.55);
  box-shadow: inset 0 -8px rgba(0,0,0,.13), 0 4px 0 #1b2630;
}

.rankBadge.small {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  font-size: 24px;
  border-width: 2px;
  border-radius: 6px;
  box-shadow: inset 0 -5px rgba(0,0,0,.14);
}

.rank-S { background: linear-gradient(145deg, #fff3a6, #f5b829 58%, #a96a08); }
.rank-Splus { background: linear-gradient(145deg, #dbeafe, #38bdf8 45%, #2563eb 72%, #1e3a8a); color: #f8fafc; text-shadow: 0 2px rgba(0,0,0,.35); }
.rank-Splusplus { background: linear-gradient(145deg, #fef3c7, #60a5fa 38%, #8b5cf6 70%, #4c1d95); color: #f8fafc; text-shadow: 0 2px rgba(0,0,0,.38); }
.rank-A { background: linear-gradient(145deg, #ffd4ec, #ff65b5 58%, #bf2077); }
.rank-B { background: linear-gradient(145deg, #ffb0a8, #f04438 58%, #a91518); color: white; text-shadow: 0 2px rgba(0,0,0,.35); }
.rank-C { background: linear-gradient(145deg, #fff37a, #ff9f1c 60%, #b25a00); }
.rank-D { background: linear-gradient(145deg, #efd277, #b48723 60%, #735012); }
.rank-E { background: linear-gradient(145deg, #dcff7a, #90d236 60%, #4d841b); }
.rank-F { background: linear-gradient(145deg, #a7ddff, #2d7dff 60%, #16458c); color: white; text-shadow: 0 2px rgba(0,0,0,.35); }
.rank-G { background: linear-gradient(145deg, #e0e0e0, #8f969f 60%, #555b63); color: white; text-shadow: 0 2px rgba(0,0,0,.35); }

.tagCloud { display: flex; flex-wrap: wrap; gap: 8px; align-content: start; }
.abilityTag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 2px solid #1b2630;
  border-radius: 6px;
  background: #eef7ff;
  color: #1b2630;
  font-weight: 900;
  box-shadow: 0 3px 0 #1b2630;
}
.abilityTag.plus { background: #d9ecff; color: #0b4fad; }
.abilityTag.minus { background: #ffe2e2; color: #b42318; }
.abilityTag.neutral { background: #e1f0ff; }

.advisorCard {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 3px solid #1b2630;
  border-radius: 8px;
  background: linear-gradient(135deg, #fffefa, #eefbff);
  box-shadow: 0 6px 0 #1b2630;
}
.mascot { display: grid; place-items: end center; min-height: 132px; border-radius: 8px; background: #111827; overflow: hidden; }
.mascot svg,
.mascot img { width: 100%; height: 100%; object-fit: contain; display: block; }
.advisorText h2 { margin: 0 0 8px; font-size: 20px; }
.advisorText, .advisorText * { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.advisorText ul { margin: 0; padding-left: 18px; color: #2c3b33; line-height: 1.55; }
.advisorText li + li { margin-top: 5px; }

.scorePanel h2 { margin-bottom: 10px; }
.scoreTable { display: grid; gap: 8px; }
.rankLegendCompact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.rankLegendCompact span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 8px;
  border: 2px solid #1b2630;
  border-radius: 6px;
  background: #fffefa;
  font-size: 12px;
  font-weight: 900;
}
.rankBadge.mini {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  font-size: 15px;
  border-width: 2px;
  box-shadow: inset 0 -3px rgba(0,0,0,.14);
}
.scoreRow {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 2px solid #d8ded7;
  border-radius: 8px;
  background: #fffefa;
}
.scoreRow strong { display: block; font-size: 15px; }
.scoreRow small { display: block; margin-top: 2px; color: #69746d; line-height: 1.35; }
.scoreRow b { font-size: 14px; text-align: right; white-space: nowrap; }

.metricsGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.metric { min-height: 92px; padding: 14px; border: 2px solid #dce1da; border-radius: 8px; background: #fffefa; }
.metric span { display: block; margin-bottom: 10px; color: #617065; font-size: 13px; font-weight: 800; }
.metric strong { display: block; overflow-wrap: anywhere; font-size: 21px; }
.metric.primary { border-color: #1b2630; background: #eaf6ec; box-shadow: 0 4px 0 #1b2630; }
.metric.good strong { color: #0c7a43; }
.metric.bad strong { color: #b73b3b; }

.panel, .itemCard {
  position: relative;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #dfe2dc;
  border-radius: 8px;
  background: #fffefa;
}
.panel h2 { margin: 0 0 12px; font-size: 18px; }
.bars, .stack, .noteList, .historyList { display: grid; gap: 10px; }
.barLabel, .historyList div { display: flex; justify-content: space-between; gap: 12px; color: #3e4a43; font-size: 14px; }
.barTrack { height: 10px; overflow: hidden; border-radius: 999px; background: #e6e0d6; border: 1px solid #d1c8bb; }
.barTrack span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #14d8ff, #ffcf24, #ff5ba8); }
.inkPanel { overflow: hidden; border: 2px solid #1b2630; }

.itemHeader { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.itemHeader strong { display: block; font-size: 17px; }
.itemHeader span { display: block; margin-top: 4px; color: #66746b; font-size: 13px; }
.formGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
label { display: grid; gap: 5px; color: #5a685f; font-size: 12px; font-weight: 800; }
label.wide { grid-column: 1 / -1; }
input, textarea, select { width: 100%; min-height: 42px; border: 1px solid #cfd8d1; border-radius: 6px; padding: 9px 10px; background: #fbfaf6; color: #17211c; }
textarea { min-height: 84px; line-height: 1.5; resize: vertical; }
.assetFilters { display: grid; gap: 10px; }
.filterChips { display: flex; flex-wrap: wrap; gap: 8px; }
.listControl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.listControl .status { min-width: 0; }
.chip {
  min-height: 34px;
  border: 2px solid #1b2630;
  border-radius: 6px;
  background: #fffefa;
  color: #1b2630;
  font-weight: 900;
}
.chip.active { background: #d9ecff; color: #0b4fad; }

.command, .iconButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: #235f4a;
  color: white;
  font-weight: 900;
}
.command { width: 100%; margin-top: 12px; }
.command.large { min-height: 48px; }
.command.ghost { border: 1px solid #cad6cf; background: #eef4ef; color: #224e3f; }
.command.danger { background: #d9342b; color: #fff; }
.command.compactCommand { width: auto; min-height: 42px; margin-top: 0; padding: 0 14px; white-space: nowrap; }
.command[disabled],
.iconButton[disabled],
button[aria-busy="true"] {
  opacity: .9;
  cursor: wait !important;
  filter: saturate(1.15) brightness(1.08);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .34), 0 0 18px rgba(34, 211, 238, .28);
  position: relative;
}

.command[aria-busy="true"]::before,
.iconButton[aria-busy="true"]::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: buttonBusySpin .72s linear infinite;
}

@keyframes buttonBusySpin {
  to { transform: rotate(360deg); }
}
.iconButton { width: 42px; flex: 0 0 42px; font-size: 22px; }
.cardActions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, .35fr);
  gap: 8px;
}
.cardActions .command { margin-top: 12px; }
.titleActions { display: flex; align-items: center; gap: 8px; }
.assetTitle { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 10px; min-width: 0; }
.assetTitle div { min-width: 0; }
.brandLogo {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 34px;
  border: 2px solid #1b2630;
  border-radius: 7px;
  background: #f3f6f7;
  color: #1b2630;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0;
}
.brandLogo.rakuten { background: #d71920; color: #fff; }
.brandLogo.smbc { background: #00856f; color: #fff; }
.brandLogo.nomura { background: #a21d21; color: #fff; }
.brandLogo.dc { background: #24c6dc; color: #10253b; }
.brandLogo.kinden { background: #f7c948; color: #182234; }
.brandLogo.us { background: #1e62d0; color: #fff; }
.toggle { position: relative; width: 48px; height: 28px; flex: 0 0 48px; border: 0; border-radius: 999px; background: #ccd2cb; }
.toggle span { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: white; transition: transform 150ms ease; }
.toggle.on { background: #2f8d68; }
.toggle.on span { transform: translateX(20px); }

.denseItem {
  padding: 0;
  overflow: hidden;
}
.denseItem summary {
  list-style: none;
}
.denseItem summary::-webkit-details-marker {
  display: none;
}
.itemSummary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 10px;
  cursor: pointer;
}
.itemSummary strong {
  display: block;
  color: #17211c;
  font-size: 15px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.itemSummary span {
  display: block;
  margin-top: 2px;
  color: #66746b;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summaryMeta {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 88px;
}
.summaryMeta b {
  color: #006dff;
  font-size: 14px;
  white-space: nowrap;
}
.summaryMeta span {
  margin: 0;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e7f4ea;
  color: #235f4a;
  font-size: 10px;
}
.itemEditor {
  padding: 0 10px 10px;
  border-top: 1px solid #e1e6df;
}
.miniControl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  color: #3e4a43;
  font-size: 12px;
  font-weight: 900;
}
.foldPanel {
  padding: 0;
  overflow: hidden;
}
.foldPanel > summary {
  cursor: pointer;
  list-style: none;
  min-height: 42px;
  padding: 9px 10px;
}
.foldPanel > summary::-webkit-details-marker { display: none; }
.foldPanel > summary h2 { margin: 0; }
.foldPanel > summary span::after {
  content: " / 開く";
  color: #5b6a62;
}
.foldPanel[open] > summary span::after {
  content: " / 閉じる";
}
.foldBody {
  padding: 0 10px 10px;
  border-top: 1px solid #e1e6df;
}

.actionPanel { display: grid; gap: 10px; }
.status { margin: 0; color: #55645b; font-size: 14px; line-height: 1.55; }
.status.error { color: #b42318; font-weight: 900; }
.importActions { display: grid; gap: 10px; }
.importActions .command { margin-top: 0; }
.importSummaryGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.importMetric small { display: block; margin-top: 8px; color: #69746d; font-size: 12px; font-weight: 800; }
.sectionHeader { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sectionHeader h2 { margin: 0; }
.sectionHeader span { color: #69746d; font-size: 12px; font-weight: 900; white-space: nowrap; }
.nextReviewPanel p { margin: 0 0 12px; color: #3f4d45; font-size: 13px; line-height: 1.55; font-weight: 800; }
.nextReviewActions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.noteList article { padding: 12px; border-radius: 6px; background: #f5f3ed; }
.noteList, .noteList article { min-width: 0; }
.noteList strong, .noteList span { display: block; }
.noteList p { margin: 6px 0; color: #34443b; line-height: 1.55; overflow-wrap: anywhere; }
.noteList span { color: #69766e; font-size: 12px; }

.sourceSummaryList { display: grid; gap: 10px; }
.sourceSummaryRow {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 2px solid #d8ded7;
  border-radius: 8px;
  background: #fffefa;
}
.sourceSummaryRow strong { display: block; color: #24322b; overflow-wrap: anywhere; }
.sourceSummaryRow span { display: block; margin-top: 3px; color: #69746d; font-size: 12px; font-weight: 800; overflow-wrap: anywhere; }
.sourceSummaryRow dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
.sourceSummaryRow dl div {
  min-width: 0;
  padding: 8px;
  border-radius: 6px;
  background: #f5f3ed;
}
.sourceSummaryRow dt { margin: 0 0 3px; color: #69746d; font-size: 11px; font-weight: 900; }
.sourceSummaryRow dd { margin: 0; color: #24322b; font-size: 14px; font-weight: 900; overflow-wrap: anywhere; }

.fileList { display: grid; gap: 10px; }
.fileRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  padding: 10px;
  border: 2px solid #d8ded7;
  border-radius: 8px;
  background: #fffefa;
}
.fileRow strong { display: block; overflow-wrap: anywhere; }
.fileRow span { display: block; margin-top: 3px; color: #69746d; font-size: 12px; font-weight: 800; overflow-wrap: anywhere; }
.fileRow p { grid-column: 1 / -1; margin: 0; color: #34443b; line-height: 1.45; }
.pill {
  align-self: start;
  padding: 5px 8px;
  border: 2px solid #1b2630;
  border-radius: 6px;
  background: #eef4ef;
  color: #1b2630;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.pill.ok { background: #e7ffd2; }
.pill.warn { background: #fff1bd; }
.pill.muted { background: #edf0f2; color: #59646d; }

.ocrReview {
  border-color: #1b72ff;
  background: linear-gradient(135deg, #eef9ff 0%, #fffefa 100%);
}
.ocrReview .sectionHeader span {
  display: inline-flex;
  padding: 5px 8px;
  border: 2px solid #1b2630;
  border-radius: 6px;
  background: #fff1bd;
  color: #1b2630;
}
.ocrLayout { display: grid; gap: 12px; }
.ocrPreview {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border: 2px solid #1b2630;
  border-radius: 8px;
  background: #fff;
}
.ocrFacts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}
.ocrFacts div { min-width: 0; padding: 9px; border-radius: 6px; background: #fff; border: 1px solid #d8ded7; }
.ocrFacts dt { margin: 0 0 3px; color: #69746d; font-size: 11px; font-weight: 900; }
.ocrFacts dd { margin: 0; color: #24322b; font-weight: 900; overflow-wrap: anywhere; }
.ocrForm { display: grid; gap: 10px; margin-top: 12px; }
.ocrButtons { display: grid; gap: 8px; }
.ocrButtons .command { margin-top: 0; }

.policyGrid, .operationGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.checkLabel {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid #cfd8d1;
  border-radius: 6px;
  background: #fbfaf6;
  color: #17211c;
}
.checkLabel input { width: 18px; min-height: 18px; }
.monthlyPanel { border: 2px solid #1b2630; background: linear-gradient(135deg, #eefbff, #fffefa); box-shadow: 0 3px 0 #1b2630; }
.progressTrack { height: 10px; overflow: hidden; border: 1px solid #1b2630; border-radius: 999px; background: #e6e0d6; }
.progressTrack span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1b72ff, #21c76f, #ffca28); }
.monthlyForm { display: grid; gap: 8px; margin-top: 10px; }
.monthlySteps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.monthlyStep {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 48px;
  padding: 7px;
  border: 1px solid #d8ded7;
  border-radius: 7px;
  background: #fff;
}
.monthlyStep input { width: 18px; min-height: 18px; }
.monthlyStep strong { display: block; color: #17211c; font-size: 13px; line-height: 1.2; }
.monthlyStep small { display: block; margin-top: 2px; color: #66746b; font-size: 11px; line-height: 1.25; }
.monthlyWizard { padding-bottom: 92px; }
.monthlyHero { align-items: center; }
.monthlyWizardPanel { margin-top: 12px; border: 2px solid #1b2630; background: linear-gradient(135deg, #f7fbff, #fffefa); box-shadow: 0 3px 0 #1b2630; padding: 14px; }
.monthlyWizardPanel .miraiLine { background: #f0f7ff; border-left: 4px solid #4f8bd6; padding: 8px 12px; margin: 0 0 10px; font-size: 14px; }
.wizardProgress { position: relative; height: 14px; background: #e7eef5; border: 1px solid #b6c4d2; border-radius: 6px; overflow: hidden; margin: 8px 0; }
.wizardProgressBar { background: linear-gradient(90deg, #4f8bd6, #6ad48b); height: 100%; transition: width .25s ease; }
.wizardProgressLabel { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); font-size: 11px; color: #1b2630; }
.wizardStepList { list-style: none; margin: 8px 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 6px; }
.wizardStep { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid #c5d2dd; border-radius: 6px; background: #fbfdff; }
.wizardStepNo { font-weight: 700; color: #1b2630; }
.wizardStepTitle { font-size: 13px; }
.wizardStepStatus { font-size: 11px; color: #4f5b69; }
.wizardStepDone { background: #e6f6e8; border-color: #6ad48b; }
.wizardStepWarn { background: #fff3e0; border-color: #f3a454; }
.wizardStepActive { background: #e6f0ff; border-color: #4f8bd6; }
.wizardStepPending { opacity: 0.85; }
.wizardActions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wizardMonthLabel { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.wizardRemoteNote { margin-top: 6px; color: #4f5b69; font-size: 11px; }
@media (max-width: 480px) {
  .monthlyWizardPanel { padding: 10px; }
  .wizardStep { grid-template-columns: 24px 1fr; }
  .wizardStepStatus { grid-column: 2; text-align: left; }
  .wizardActions { flex-direction: column; align-items: stretch; }
  .wizardActions .command { width: 100%; }
}
.monthInputs,
.monthlyActions,
.monthlyFacts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.monthInputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.monthlyStepGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.wizardStep {
  display: grid;
  grid-template-columns: 18px 54px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 58px;
  padding: 8px;
  border: 2px solid #1b2630;
  border-radius: 7px;
  background: #fffefa;
  box-shadow: 0 3px 0 #1b2630;
}
.wizardStep.done { background: #eaf8ff; border-color: #0b72f0; }
.wizardStep input { width: 16px; min-height: 16px; }
.wizardStep .stepNo { color: #0b72f0; font-size: 11px; font-weight: 900; }
.wizardStep strong { display: block; font-size: 13px; line-height: 1.2; color: #17211c; }
.wizardStep small { display: block; margin-top: 2px; font-size: 11px; line-height: 1.25; color: #526257; }
.wizardStep.tone-warn:not(.done) { background: #fff2cf; }
.wizardStep.tone-good.done { background: #e5f4ff; }
.monthlyFacts div {
  min-width: 0;
  padding: 9px;
  border: 2px solid #1b2630;
  border-radius: 7px;
  background: #fff;
}
.monthlyFacts b,
.monthlyFacts span,
.monthlyFacts small { display: block; overflow-wrap: anywhere; }
.monthlyFacts b { color: #1b2630; font-size: 12px; font-weight: 900; }
.monthlyFacts span { margin-top: 3px; color: #0b72f0; font-size: 15px; font-weight: 900; }
.monthlyFacts small { margin-top: 3px; color: #526257; font-size: 11px; line-height: 1.35; }
.monthlyInvestmentReview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #2e4662;
  border-radius: 14px;
  background: #162233;
  color: #e6edf7;
  padding: 12px;
}
.monthlyInvestmentReview b,
.monthlyInvestmentReview span,
.monthlyInvestmentReview small { display: block; overflow-wrap: anywhere; }
.monthlyInvestmentReview b { color: #f1f5f9; font-size: 13px; font-weight: 900; }
.monthlyInvestmentReview span { margin-top: 3px; color: #9fd3ff; font-size: 16px; font-weight: 900; }
.monthlyInvestmentReview small { margin-top: 4px; color: #c2cfdd; font-size: 12px; line-height: 1.45; }
.monthlyTransferNote {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #314967;
  border-radius: 12px;
  background: #111c2c;
  color: #cbd7e5;
  font-size: 12px;
  line-height: 1.45;
}
.loanTransferPanel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(120px, .55fr) minmax(160px, .85fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #314967;
  border-radius: 14px;
  background: #111c2c;
  color: #d4dfeb;
}
.loanTransferPanel strong,
.loanTransferPanel p,
.loanTransferPanel small { overflow-wrap: anywhere; }
.loanTransferPanel p {
  margin: 4px 0 0;
  color: #aebdca;
  font-size: 12px;
  line-height: 1.45;
}
.loanTransferPanel small {
  grid-column: 1 / -1;
  color: #aebdca;
  font-size: 12px;
  line-height: 1.45;
}
.diffTable {
  display: grid;
  gap: 6px;
}
.diffTable > div {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border-radius: 7px;
  background: #fffefa;
  border: 1px solid #d8ded7;
}
.diffTable .diffHead { background: #1b2630; color: #fff; font-size: 12px; font-weight: 900; }
.diffTable span,
.diffTable strong,
.diffTable b { min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.diffGood b { color: #0b72f0; }
.diffBad b { color: #e3273b; }
.command.secondary { background: #fffefa; color: #1b2630; border: 2px solid #1b2630; }
.miniHistory { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.miniHistory span { padding: 3px 6px; border-radius: 999px; background: #e7f4ea; color: #235f4a; font-size: 11px; font-weight: 900; }
.allocationList, .proposalList, .rebalanceList, .checkList { display: grid; gap: 10px; }
.allocationRow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid #2b3a50;
  border-radius: 8px;
  background: #0f172a;
  color: #dbe3ee;
}
.allocationRow label {
  color: #cbd5e1;
  font-weight: 800;
}
.allocationRow input {
  border-color: #334155;
  background: #08111f;
  color: #f1f5f9;
}
.allocationRow input:focus {
  border-color: #67e8f9;
  box-shadow: 0 0 0 2px rgba(103, 232, 249, .16);
}
.allocationRow .checkLabel {
  border-color: #334155;
  background: #111827;
  color: #e5e7eb;
}
.allocationRow .checkLabel input {
  width: 18px;
  min-height: 18px;
}
.proposalCard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 2px solid #1b2630;
  border-radius: 8px;
  background: linear-gradient(135deg, #eef9ff, #fffefa);
  box-shadow: 0 4px 0 #1b2630;
}
.proposalCard.blocked { background: #fff0f0; }
.proposalCard span, .proposalCard small { display: block; color: #69746d; font-size: 12px; font-weight: 800; line-height: 1.45; }
.proposalCard strong { display: block; margin: 4px 0; color: #17211c; font-size: 16px; overflow-wrap: anywhere; }
.proposalCard b { color: #0b6bcb; white-space: nowrap; }
.proposalCard .risk { color: #b42318; }
.investmentMiniPanel {
  border: 2px solid #26384d;
  background: #151d26;
  color: #e6edf3;
  box-shadow: 0 3px 0 #0b1118;
}
.investmentMiniPanel .sectionHeader h2,
.investmentMiniPanel .sectionHeader span { color: #f1f5f9; }
.investmentMiniGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.investmentMiniGrid div {
  min-height: 104px;
  padding: 10px;
  border: 1px solid #33485f;
  border-radius: 7px;
  background: #101721;
}
.investmentMiniGrid span,
.investmentMiniGrid small {
  display: block;
  color: #a9b8c8;
  line-height: 1.35;
}
.investmentMiniGrid strong {
  display: block;
  margin: 7px 0;
  color: #f8fafc;
  font-size: 18px;
  overflow-wrap: anywhere;
}
.investmentMonthlyLink {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #33485f;
  border-radius: 7px;
  background: #0f1720;
}
.investmentMonthlyLink p,
.miraiSafetyNote {
  margin: 0;
  color: #d2dde9;
  line-height: 1.55;
}
.investmentSettingsForm {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.investmentSettingsForm label { color: #c5d3e0; }
.investmentSettingsForm input,
.investmentSettingsForm textarea,
.investmentSettingsForm select {
  border-color: #33485f;
  background: #0f1720;
  color: #edf4fb;
}
.investmentSettingsForm .command { align-self: end; }
.investmentSimulation {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #33485f;
  border-radius: 7px;
  background: #0f1720;
}
.investmentSimulation h3 { margin: 0; font-size: 16px; color: #f1f5f9; }
.simulationGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.simulationGrid article {
  padding: 10px;
  border: 1px solid #33485f;
  border-radius: 7px;
  background: #101721;
}
.simulationGrid span,
.simulationGrid small {
  display: block;
  color: #a9b8c8;
  line-height: 1.35;
}
.simulationGrid strong {
  display: block;
  margin: 6px 0;
  color: #f8fafc;
  font-size: 17px;
  overflow-wrap: anywhere;
}
.simulationNote {
  margin: 8px 0 0;
  color: #d2dde9;
  line-height: 1.5;
}
.investmentLogicPanel {
  border: 1px solid #253244;
  background: #101821;
}
.logicGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.logicCard {
  min-width: 0;
  padding: 12px;
  border: 1px solid #2b3a50;
  border-radius: 7px;
  background: #111827;
  color: #dbe3ee;
}
.logicCard span,
.logicCard small {
  display: block;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.45;
}
.logicCard strong {
  display: block;
  margin: 5px 0;
  color: #f1f5f9;
  font-size: 17px;
  overflow-wrap: anywhere;
}
.logicMiniList {
  margin: 0;
  padding-left: 1.1rem;
  color: #e5e7eb;
  font-size: 12px;
  line-height: 1.55;
}
.logicMiniList li + li {
  margin-top: 3px;
}
.miraiSafetyNote {
  margin-top: 10px;
  padding: 10px;
  border-left: 4px solid #6aa7d8;
  border-radius: 6px;
  background: #111c28;
}
.rebalanceRow {
  padding: 11px;
  border: 1px solid #2b3a50;
  border-radius: 8px;
  background: #111827;
  color: #dbe3ee;
}
.rebalanceMeta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 900;
}
.rebalanceMeta b.plus { color: #7dd3fc; }
.rebalanceMeta b.minus { color: #fca5a5; }
.checkList {
  margin: 0;
  padding-left: 20px;
  color: #24322b;
  line-height: 1.55;
  font-weight: 800;
}

.transactionList { display: grid; gap: 8px; }
.transactionRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #d8ded7;
  border-radius: 8px;
  background: #fffefa;
}
.transactionRow.needsReview { border-color: #1b72ff; background: #eef9ff; }
.transactionRow div { min-width: 0; }
.transactionRow span,
.transactionRow small {
  display: block;
  color: #69746d;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.transactionRow strong { display: block; margin: 3px 0; color: #24322b; overflow-wrap: anywhere; }
.transactionRow b { color: #0c7a43; white-space: nowrap; }
.transactionRow b.expense { color: #b73b3b; }

.guidePanel {
  margin: 0 0 16px;
  padding: 14px;
  border: 2px solid #1b2630;
  border-radius: 8px;
  background: linear-gradient(135deg, #f2fbff 0%, #fffefa 100%);
  box-shadow: 0 4px 0 #1b2630;
}
.compactGuide { padding: 0; }
.compactGuide summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  min-width: 0;
  overflow-wrap: anywhere;
}
.compactGuide summary::-webkit-details-marker { display: none; }
.compactGuide summary > div {
  min-width: 0;
}
.compactGuide summary b {
  display: block;
  color: #17211c;
  font-size: 16px;
  font-weight: 900;
  overflow-wrap: anywhere;
}
.compactGuide summary small {
  display: block;
  margin-top: 3px;
  color: #34443b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.compactGuide summary em {
  padding: 4px 8px;
  border: 2px solid #1b2630;
  border-radius: 6px;
  background: #ffca28;
  color: #17211c;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}
.compactGuide[open] summary em { font-size: 0; }
.compactGuide[open] summary em::before { content: "閉じる"; font-size: 12px; }
.compactGuide[open] .guideIntro,
.compactGuide[open] .guideGrid,
.compactGuide[open] .guideCaution {
  margin-left: 14px;
  margin-right: 14px;
}
.compactGuide[open] .guideCaution { margin-bottom: 14px; }
.guideIntro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}
.guideIntro h2 {
  margin: 2px 0 6px;
  color: #17211c;
  font-size: 20px;
  line-height: 1.25;
}
.guideIntro p {
  margin: 0;
  color: #34443b;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
}
.guideBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 2px solid #1b2630;
  border-radius: 6px;
  background: #1b72ff;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.guideGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.guideStep {
  min-width: 0;
  padding: 10px;
  border: 2px solid #d8ded7;
  border-radius: 8px;
  background: #fff;
}
.guideStep strong {
  display: inline-flex;
  margin-bottom: 7px;
  padding: 4px 8px;
  border: 2px solid #1b2630;
  border-radius: 6px;
  background: #ffca28;
  color: #17211c;
  font-size: 13px;
  font-weight: 900;
}
.guideStep ul,
.manualSteps {
  margin: 0;
  padding-left: 18px;
  color: #24322b;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}
.manualSteps {
  display: grid;
  gap: 4px;
  font-size: 14px;
}
.guideCaution {
  margin: 12px 0 0;
  padding: 10px;
  border: 2px solid #ff3b30;
  border-radius: 8px;
  background: #fff1f0;
  color: #8a1f17;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.5;
}
.manualTable {
  display: grid;
  gap: 8px;
}
.manualTable div {
  display: grid;
  grid-template-columns: 74px 96px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid #d8ded7;
  border-radius: 8px;
  background: #fff;
}
.manualTable b {
  display: inline-flex;
  justify-content: center;
  padding: 5px 6px;
  border: 2px solid #1b2630;
  border-radius: 6px;
  background: #16c7e8;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}
.manualTable strong {
  color: #17211c;
  font-size: 14px;
  font-weight: 900;
}
.manualTable span {
  color: #34443b;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}
.actionGlossary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.actionGlossary article {
  padding: 10px;
  border: 2px solid #d8ded7;
  border-radius: 8px;
  background: #fff;
}
.actionGlossary strong {
  display: block;
  margin-bottom: 4px;
  color: #17211c;
  font-size: 14px;
  font-weight: 900;
}
.actionGlossary p,
.helpText {
  margin: 0;
  color: #34443b;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.tabBar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  box-sizing: border-box;
  padding: 0 max(0px, calc((100vw - 1100px) / 2)) env(safe-area-inset-bottom);
  border-top: 2px solid #1b2630;
  background: rgba(255, 254, 250, 0.97);
  backdrop-filter: blur(12px);
}
.tabBar button { display: grid; place-items: center; gap: 4px; min-height: 66px; border: 0; color: #607167; background: transparent; font-size: 15px; font-weight: 900; text-align: center; }
.tabBar button span { font-size: 10px; }
.tabBar button.active { color: #1f6449; background: #e7ffd2; }

@media (max-width: 420px) {
  .guideIntro { grid-template-columns: 1fr; }
  .guideBadge { justify-self: start; }
  .guideGrid { grid-template-columns: 1fr; }
  .manualTable div { grid-template-columns: 1fr; align-items: start; }
  .manualTable b { justify-content: flex-start; width: max-content; max-width: 100%; }
  .actionGlossary { grid-template-columns: 1fr; }
  .monthlySteps { grid-template-columns: 1fr; }
  .monthInputs, .monthlyActions, .monthlyFacts, .monthlyStepGrid, .monthlyInvestmentReview { grid-template-columns: 1fr; }
  .wizardStep { grid-template-columns: 18px 48px minmax(0, 1fr); min-height: 52px; }
  .diffTable > div { grid-template-columns: 0.9fr 1.1fr 1.1fr 1fr; padding: 7px 6px; }
  .diffTable span, .diffTable strong, .diffTable b { font-size: 10px; }
  .cardActions { grid-template-columns: 1fr; }
  .cardActions .command.danger { margin-top: 0; }
  .advisorCard { grid-template-columns: 1fr; }
  .mascot { min-height: 172px; }
  .mascot img { max-height: 168px; }
  .rankBadge { width: 64px; height: 64px; font-size: 36px; }
  .scoreRow { grid-template-columns: 44px minmax(0, 1fr); }
  .scoreRow b { grid-column: 2; text-align: left; }
  .importSummaryGrid { grid-template-columns: 1fr; }
  .fileRow { grid-template-columns: 1fr; }
  .pill { justify-self: start; }
  .transactionRow { grid-template-columns: 1fr; }
  .transactionRow b { white-space: normal; }
  .sourceSummaryRow dl { grid-template-columns: 1fr; }
  .ocrFacts { grid-template-columns: 1fr; }
  .policyGrid, .operationGrid, .allocationRow, .investmentMiniGrid, .investmentMonthlyLink, .investmentSettingsForm, .simulationGrid, .logicGrid { grid-template-columns: 1fr; }
  .proposalCard { grid-template-columns: 1fr; }
  .proposalCard b { white-space: normal; }
  .titleActions { flex-wrap: wrap; justify-content: flex-end; }
  .ocrButtons { grid-template-columns: 1fr; }
  .sectionHeader { align-items: flex-start; flex-direction: column; }
  .sectionHeader span { white-space: normal; }
  .nextReviewActions { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .assetVisualGrid {
    grid-template-columns: 1fr;
  }
  .assetLegend div {
    grid-template-columns: 12px minmax(0, 1fr) auto;
  }
  .assetLegend b {
    grid-column: 2 / -1;
  }
  .simulationLineChart svg {
    height: 190px;
  }
}

@media (min-width: 740px) {
  .view { padding: 28px 24px 36px; }
  .scoreHero { grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); align-items: center; }
  .advisorCard { grid-template-columns: 170px minmax(0, 1fr); }
  .mascot svg { width: 160px; }
  .rankLegendCompact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .metricsGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .importActions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .importSummaryGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sourceSummaryRow { grid-template-columns: minmax(180px, .8fr) minmax(0, 1.6fr); align-items: center; }
  .sourceSummaryRow dl { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .ocrLayout { grid-template-columns: minmax(260px, .85fr) minmax(0, 1fr); align-items: start; }
  .ocrForm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ocrButtons { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .itemCard.compact { margin-top: 0; }
}

@media (max-width: 640px) {
  .guideGrid { grid-template-columns: 1fr; }
  .actionGlossary { grid-template-columns: 1fr; }
  .guideIntro { grid-template-columns: 1fr; }
  .guideBadge { justify-self: start; }
  .view { padding-left: 10px; padding-right: 10px; overflow-x: hidden; }
  .panel, .itemCard, .advisorCard { max-width: 100%; }
  .advisorCard { grid-template-columns: 1fr; }
  .mascot { min-height: 172px; }
  .mascot img { max-height: 168px; }
  .advisorText h2 { font-size: 18px; line-height: 1.35; }
  .policyGrid, .allocationRow, .investmentMiniGrid, .investmentMonthlyLink, .investmentSettingsForm, .simulationGrid, .monthlyInvestmentReview, .loanTransferPanel { grid-template-columns: 1fr; }
  .proposalCard { grid-template-columns: 1fr; }
  .proposalCard b { white-space: normal; }
}

/* Compact redesign: keep lists scannable and open detail editors only when needed. */
.view { padding-top: 10px; padding-bottom: 14px; }
.titleRow { margin: 2px 0 8px; gap: 8px; }
.titleRow h1 { font-size: 24px; }
.eyebrow { margin-bottom: 2px; font-size: 11px; }
.date { padding: 5px 8px; font-size: 11px; }
.scoreHero { gap: 8px; padding: 10px; border-width: 2px; box-shadow: 0 4px 0 #1b2630; }
.rankHero { gap: 9px; }
.rankHero h1 { font-size: 22px; }
.rankHero p { font-size: 13px; }
.rankBadge { width: 54px; height: 54px; font-size: 30px; border-width: 2px; box-shadow: inset 0 -5px rgba(0,0,0,.13), 0 3px 0 #1b2630; }
.rankBadge.small { width: 34px; height: 34px; flex-basis: 34px; font-size: 18px; }
.rankBadge.mini { width: 24px; height: 24px; flex-basis: 24px; font-size: 13px; }
.tagCloud { gap: 5px; }
.abilityTag { min-height: 26px; padding: 3px 7px; border-width: 1px; font-size: 12px; box-shadow: 0 2px 0 #1b2630; }
.advisorCard { grid-template-columns: 76px minmax(0, 1fr); gap: 8px; margin-top: 8px; padding: 9px; border-width: 2px; box-shadow: 0 3px 0 #1b2630; }
.mascot { min-height: 76px; }
.advisorText h2 { margin-bottom: 4px; font-size: 16px; }
.advisorText ul { padding-left: 16px; font-size: 12px; line-height: 1.35; }
.advisorText li + li { margin-top: 2px; }
.metricsGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.metric { min-height: 58px; padding: 8px; border-radius: 6px; }
.metric span { margin-bottom: 4px; font-size: 11px; }
.metric strong { font-size: 15px; line-height: 1.2; }
.panel, .itemCard { margin-top: 8px; padding: 9px; border-radius: 7px; }
.denseItem { padding: 0; }
.panel h2 { margin-bottom: 7px; font-size: 16px; }
.bars, .stack, .noteList, .historyList { gap: 6px; }
.scoreTable { gap: 5px; }
.scoreRow { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 7px; padding: 7px; border-width: 1px; }
.scoreRow strong { font-size: 13px; }
.scoreRow small { font-size: 11px; }
.scoreRow b { font-size: 12px; }
.rankLegendCompact { gap: 5px; }
.rankLegendCompact span { min-height: 28px; padding: 4px 6px; border-width: 1px; font-size: 11px; }
.assetFilters { gap: 6px; }
.filterChips { gap: 5px; }
.chip { min-height: 28px; padding: 2px 7px; border-width: 1px; font-size: 12px; }
.formGrid { gap: 7px; }
label { gap: 3px; font-size: 11px; }
input, textarea, select { min-height: 34px; padding: 6px 8px; border-radius: 5px; font-size: 13px; }
textarea { min-height: 58px; }
.command, .iconButton { min-height: 34px; border-radius: 5px; font-size: 13px; }
.command { margin-top: 8px; }
.command.large { min-height: 40px; }
.command.compactCommand { min-height: 34px; padding: 0 10px; }
.iconButton { width: 36px; flex-basis: 36px; font-size: 18px; }
.brandLogo { width: 38px; height: 28px; border-width: 1px; font-size: 10px; }
.assetTitle { grid-template-columns: 38px minmax(0, 1fr); gap: 7px; }
.toggle { width: 42px; height: 24px; flex-basis: 42px; }
.toggle span { top: 3px; left: 3px; width: 18px; height: 18px; }
.toggle.on span { transform: translateX(18px); }
.compactGuide { margin-bottom: 8px; }
.compactGuide summary { min-height: 44px; padding: 8px 10px; min-width: 0; overflow-wrap: anywhere; }
.compactGuide summary b { font-size: 14px; }
.compactGuide summary small { font-size: 11px; white-space: normal; overflow-wrap: anywhere; }
.guidePanel { box-shadow: 0 3px 0 #1b2630; }
.guideIntro h2 { font-size: 16px; }
.guideIntro p, .guideStep ul, .manualSteps, .guideCaution, .actionGlossary p, .helpText { font-size: 12px; line-height: 1.4; }
.tabBar button { min-height: 56px; font-size: 14px; }
.tabBar button span { font-size: 9px; }

/* Browser theme controls. Excel output keeps its own colors. */
html[data-theme="dark"] {
  color: #d7e0ea;
  background:
    radial-gradient(circle at 12% 6%, rgba(39, 80, 112, .12), transparent 28%),
    radial-gradient(circle at 92% 16%, rgba(65, 58, 90, .10), transparent 24%),
    #080b10;
}
html[data-theme="dark"] body { background: #080b10; color: #d6dee8; }
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] label,
html[data-theme="dark"] .itemHeader span,
html[data-theme="dark"] .barLabel,
html[data-theme="dark"] .historyList div,
html[data-theme="dark"] .helpText { color: #9ba8b6; }
html[data-theme="dark"] .date,
html[data-theme="dark"] .chip,
html[data-theme="dark"] .command.secondary {
  border-color: #273243;
  background: #111824;
  color: #d3dde8;
}
html[data-theme="dark"] .scoreHero,
html[data-theme="dark"] .advisorCard,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .itemCard,
html[data-theme="dark"] .rankLegendCompact span,
html[data-theme="dark"] .scoreRow,
html[data-theme="dark"] .metric,
html[data-theme="dark"] .denseItem summary,
html[data-theme="dark"] .foldPanel > summary,
html[data-theme="dark"] .guidePanel,
html[data-theme="dark"] .manualTable div,
html[data-theme="dark"] .actionGlossary article,
html[data-theme="dark"] .compactGuide,
html[data-theme="dark"] .transactionRow,
html[data-theme="dark"] .ocrFacts div,
html[data-theme="dark"] .monthlyPanel,
html[data-theme="dark"] .wizardStep,
html[data-theme="dark"] .monthlyFacts div,
html[data-theme="dark"] .diffTable > div,
html[data-theme="dark"] .investmentMiniPanel,
html[data-theme="dark"] .proposalCard,
html[data-theme="dark"] .loanTransferPanel {
  border-color: #253244;
  background: #111824;
  color: #d6dee8;
  box-shadow: none;
}
html[data-theme="dark"] .advisorCard,
html[data-theme="dark"] .monthlyPanel,
html[data-theme="dark"] .operationPanel,
html[data-theme="dark"] .investmentMiniGrid div,
html[data-theme="dark"] .loanTransferPanel {
  background: linear-gradient(135deg, #111824, #0b1018);
}
html[data-theme="dark"] .advisorText ul,
html[data-theme="dark"] .rankHero p,
html[data-theme="dark"] .scoreRow small,
html[data-theme="dark"] .metric span,
html[data-theme="dark"] .itemSummary span,
html[data-theme="dark"] .monthlyFacts small,
html[data-theme="dark"] .wizardStep small,
html[data-theme="dark"] .diffTable span,
html[data-theme="dark"] .simulationNote,
html[data-theme="dark"] .miraiSafetyNote,
html[data-theme="dark"] .loanTransferPanel p,
html[data-theme="dark"] .loanTransferPanel small {
  color: #a8b4c2;
}
html[data-theme="dark"] .advisorText h2,
html[data-theme="dark"] .panel h2,
html[data-theme="dark"] .scoreRow strong,
html[data-theme="dark"] .itemSummary strong,
html[data-theme="dark"] .monthlyFacts b,
html[data-theme="dark"] .wizardStep strong,
html[data-theme="dark"] .investmentMiniGrid strong,
html[data-theme="dark"] .sectionHeader h2,
html[data-theme="dark"] .loanTransferPanel strong {
  color: #e7edf4;
}
html[data-theme="dark"] .metric.primary,
html[data-theme="dark"] .wizardStep.done {
  border-color: #2d4a63;
  background: #142536;
}
html[data-theme="dark"] .wizardStep.tone-warn:not(.done),
html[data-theme="dark"] .pill.warn {
  background: #2a2418;
  color: #dfcc9a;
}
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  border-color: #27384d;
  background: #0b111b;
  color: #e2e9f1;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #738296; }
html[data-theme="dark"] .command { background: #25614f; color: #edf8f4; }
html[data-theme="dark"] .command.ghost { border-color: #27384d; background: #111824; color: #d3dde8; }
html[data-theme="dark"] .command.danger { background: #762a31; color: #f8eeee; }
html[data-theme="dark"] .tabBar {
  border-color: #1d2633;
  background: rgba(8, 11, 16, .97);
}
html[data-theme="dark"] .tabBar button { color: #8f9cab; }
html[data-theme="dark"] .tabBar button.active { color: #d8eee5; background: #12291f; }
html[data-theme="dark"] .barTrack { border-color: #1d2633; background: #0b111b; }
html[data-theme="dark"] .mascot { background: #080b10; }
html[data-theme="dark"] .brandLogo { border-color: #1d2633; }
.themeToggle {
  position: fixed;
  right: 12px;
  bottom: 86px;
  z-index: 20;
  min-width: 74px;
  min-height: 42px;
  border: 1px solid #27384d;
  border-radius: 999px;
  background: #111824;
  color: #d3dde8;
  font-weight: 900;
  box-shadow: 0 8px 24px rgba(0,0,0,.24);
}
html[data-theme="light"] .themeToggle {
  border-color: #cfd8d1;
  background: #fbfaf6;
  color: #1b2630;
}

/* Final dark-mode enforcement: keep the local browser UI genuinely dark even when older fixed light colors exist above. */
html[data-theme="dark"],
body[data-theme="dark"],
body.dark-mode {
  color-scheme: dark;
  background: #080b10 !important;
  color: #d6dee8 !important;
}
body[data-theme="dark"] #app,
body.dark-mode #app,
body[data-theme="dark"] .view,
body.dark-mode .view {
  background: transparent !important;
}
body[data-theme="dark"] .scoreHero,
body[data-theme="dark"] .advisorCard,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .itemCard,
body[data-theme="dark"] .metric,
body[data-theme="dark"] .scoreRow,
body[data-theme="dark"] .denseItem,
body[data-theme="dark"] .denseItem summary,
body[data-theme="dark"] .foldPanel,
body[data-theme="dark"] .foldPanel > summary,
body[data-theme="dark"] .foldBody,
body[data-theme="dark"] .guidePanel,
body[data-theme="dark"] .manualTable div,
body[data-theme="dark"] .actionGlossary article,
body[data-theme="dark"] .compactGuide,
body[data-theme="dark"] .transactionRow,
body[data-theme="dark"] .ocrReview,
body[data-theme="dark"] .ocrFacts div,
body[data-theme="dark"] .checkLabel,
body[data-theme="dark"] .monthlyPanel,
body[data-theme="dark"] .monthlyStep,
body[data-theme="dark"] .wizardStep,
body[data-theme="dark"] .monthlyFacts div,
body[data-theme="dark"] .diffTable > div,
body[data-theme="dark"] .investmentMiniPanel,
body[data-theme="dark"] .investmentMiniGrid div,
body[data-theme="dark"] .proposalCard,
body[data-theme="dark"] .loanTransferPanel,
body.dark-mode .scoreHero,
body.dark-mode .advisorCard,
body.dark-mode .panel,
body.dark-mode .itemCard,
body.dark-mode .metric,
body.dark-mode .scoreRow,
body.dark-mode .denseItem,
body.dark-mode .denseItem summary,
body.dark-mode .foldPanel,
body.dark-mode .foldPanel > summary,
body.dark-mode .foldBody,
body.dark-mode .guidePanel,
body.dark-mode .manualTable div,
body.dark-mode .actionGlossary article,
body.dark-mode .compactGuide,
body.dark-mode .transactionRow,
body.dark-mode .ocrReview,
body.dark-mode .ocrFacts div,
body.dark-mode .checkLabel,
body.dark-mode .monthlyPanel,
body.dark-mode .monthlyStep,
body.dark-mode .wizardStep,
body.dark-mode .monthlyFacts div,
body.dark-mode .diffTable > div,
body.dark-mode .investmentMiniPanel,
body.dark-mode .investmentMiniGrid div,
body.dark-mode .proposalCard,
body.dark-mode .loanTransferPanel {
  border-color: #253244 !important;
  background: #111824 !important;
  color: #d6dee8 !important;
  box-shadow: none !important;
}
body[data-theme="dark"] .advisorCard,
body[data-theme="dark"] .monthlyPanel,
body[data-theme="dark"] .operationPanel,
body[data-theme="dark"] .investmentMiniGrid div,
body[data-theme="dark"] .loanTransferPanel,
body.dark-mode .advisorCard,
body.dark-mode .monthlyPanel,
body.dark-mode .operationPanel,
body.dark-mode .investmentMiniGrid div,
body.dark-mode .loanTransferPanel {
  background: linear-gradient(135deg, #111824, #0b1018) !important;
}
body[data-theme="dark"] input,
body[data-theme="dark"] textarea,
body[data-theme="dark"] select,
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
  border-color: #27384d !important;
  background: #0b111b !important;
  color: #e2e9f1 !important;
}
body[data-theme="dark"] .tabBar,
body.dark-mode .tabBar {
  border-color: #1d2633 !important;
  background: rgba(8, 11, 16, .97) !important;
}
body[data-theme="dark"] .tabBar button,
body.dark-mode .tabBar button {
  color: #8f9cab !important;
  background: transparent !important;
}
body[data-theme="dark"] .tabBar button.active,
body.dark-mode .tabBar button.active {
  color: #d8eee5 !important;
  background: #12291f !important;
}
body[data-theme="dark"] .diffTable .diffHead,
body.dark-mode .diffTable .diffHead {
  background: #0b111b !important;
  color: #dce5ee !important;
}
body[data-theme="dark"] .command,
body.dark-mode .command {
  background: #25614f !important;
  color: #edf8f4 !important;
}
body[data-theme="dark"] .command.secondary,
body[data-theme="dark"] .command.ghost,
body.dark-mode .command.secondary,
body.dark-mode .command.ghost {
  border-color: #27384d !important;
  background: #111824 !important;
  color: #d3dde8 !important;
}
body[data-theme="dark"] .pill.warn,
body[data-theme="dark"] .wizardStep.tone-warn:not(.done),
body.dark-mode .pill.warn,
body.dark-mode .wizardStep.tone-warn:not(.done) {
  background: #2a2418 !important;
  color: #dfcc9a !important;
}
body[data-theme="dark"] .themeToggle,
body.dark-mode .themeToggle {
  border-color: #2b3b50 !important;
  background: #101824 !important;
  color: #d7e0ea !important;
}

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] .titleRow h1,
body[data-theme="dark"] .sectionHeader h2,
body[data-theme="dark"] .advisorText h2,
body[data-theme="dark"] .itemSummary strong,
body[data-theme="dark"] .monthlyStep strong,
body[data-theme="dark"] .wizardStep strong,
body[data-theme="dark"] .compactGuide summary b,
body[data-theme="dark"] .guideIntro h2,
body[data-theme="dark"] .guideStep h3,
body[data-theme="dark"] .sourceSummaryRow strong,
body[data-theme="dark"] .sourceSummaryRow dd,
body[data-theme="dark"] .ocrFacts dd,
body[data-theme="dark"] .transactionRow strong,
body[data-theme="dark"] .proposalCard strong,
body[data-theme="dark"] .manualSteps strong,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode .titleRow h1,
body.dark-mode .sectionHeader h2,
body.dark-mode .advisorText h2,
body.dark-mode .itemSummary strong,
body.dark-mode .monthlyStep strong,
body.dark-mode .wizardStep strong,
body.dark-mode .compactGuide summary b,
body.dark-mode .guideIntro h2,
body.dark-mode .guideStep h3,
body.dark-mode .sourceSummaryRow strong,
body.dark-mode .sourceSummaryRow dd,
body.dark-mode .ocrFacts dd,
body.dark-mode .transactionRow strong,
body.dark-mode .proposalCard strong,
body.dark-mode .manualSteps strong {
  color: #edf3f8 !important;
}

body[data-theme="dark"] p,
body[data-theme="dark"] li,
body[data-theme="dark"] label,
body[data-theme="dark"] .advisorText ul,
body[data-theme="dark"] .noteList p,
body[data-theme="dark"] .fileRow p,
body[data-theme="dark"] .guideIntro p,
body[data-theme="dark"] .guideStep ul,
body[data-theme="dark"] .manualSteps,
body[data-theme="dark"] .guideCaution,
body[data-theme="dark"] .actionGlossary p,
body[data-theme="dark"] .compactGuide,
body.dark-mode p,
body.dark-mode li,
body.dark-mode label,
body.dark-mode .advisorText ul,
body.dark-mode .noteList p,
body.dark-mode .fileRow p,
body.dark-mode .guideIntro p,
body.dark-mode .guideStep ul,
body.dark-mode .manualSteps,
body.dark-mode .guideCaution,
body.dark-mode .actionGlossary p,
body.dark-mode .compactGuide {
  color: #cfd8e3 !important;
}

body[data-theme="dark"] .eyebrow,
body[data-theme="dark"] .helpText,
body[data-theme="dark"] .rankHero p,
body[data-theme="dark"] .scoreRow small,
body[data-theme="dark"] .metric span,
body[data-theme="dark"] .itemHeader span,
body[data-theme="dark"] .itemSummary span,
body[data-theme="dark"] .summaryMeta span,
body[data-theme="dark"] .sectionHeader span,
body[data-theme="dark"] .monthlyStep small,
body[data-theme="dark"] .wizardStep small,
body[data-theme="dark"] .monthlyFacts small,
body[data-theme="dark"] .sourceSummaryRow span,
body[data-theme="dark"] .sourceSummaryRow dt,
body[data-theme="dark"] .fileRow span,
body[data-theme="dark"] .noteList span,
body[data-theme="dark"] .proposalCard span,
body[data-theme="dark"] .proposalCard small,
body[data-theme="dark"] .transactionRow span,
body[data-theme="dark"] .compactGuide summary small,
body[data-theme="dark"] .compactGuide summary em,
body[data-theme="dark"] .barLabel,
body[data-theme="dark"] .historyList div,
body[data-theme="dark"] .status,
body.dark-mode .eyebrow,
body.dark-mode .helpText,
body.dark-mode .rankHero p,
body.dark-mode .scoreRow small,
body.dark-mode .metric span,
body.dark-mode .itemHeader span,
body.dark-mode .itemSummary span,
body.dark-mode .summaryMeta span,
body.dark-mode .sectionHeader span,
body.dark-mode .monthlyStep small,
body.dark-mode .wizardStep small,
body.dark-mode .monthlyFacts small,
body.dark-mode .sourceSummaryRow span,
body.dark-mode .sourceSummaryRow dt,
body.dark-mode .fileRow span,
body.dark-mode .noteList span,
body.dark-mode .proposalCard span,
body.dark-mode .proposalCard small,
body.dark-mode .transactionRow span,
body.dark-mode .compactGuide summary small,
body.dark-mode .compactGuide summary em,
body.dark-mode .barLabel,
body.dark-mode .historyList div,
body.dark-mode .status {
  color: #b8c4d0 !important;
}

body[data-theme="dark"] .monthlyFacts span,
body[data-theme="dark"] .wizardStep .stepNo,
body[data-theme="dark"] .miniHistory span,
body[data-theme="dark"] .chip.active,
body[data-theme="dark"] .metric.good strong,
body[data-theme="dark"] .transactionRow b,
body.dark-mode .monthlyFacts span,
body.dark-mode .wizardStep .stepNo,
body.dark-mode .miniHistory span,
body.dark-mode .chip.active,
body.dark-mode .metric.good strong,
body.dark-mode .transactionRow b {
  color: #86d6b2 !important;
}

body[data-theme="dark"] .summaryMeta,
body[data-theme="dark"] .summaryMeta span,
body[data-theme="dark"] .foldPanel > summary span,
body[data-theme="dark"] .foldPanel > summary span::after,
body[data-theme="dark"] .compactGuide summary em,
body[data-theme="dark"] .sectionHeader > span,
body[data-theme="dark"] .date,
body[data-theme="dark"] .pill,
body[data-theme="dark"] .chip,
body[data-theme="dark"] .miniHistory span,
body[data-theme="dark"] .tabBar button,
body[data-theme="dark"] .tabBar button span,
body.dark-mode .summaryMeta,
body.dark-mode .summaryMeta span,
body.dark-mode .foldPanel > summary span,
body.dark-mode .foldPanel > summary span::after,
body.dark-mode .compactGuide summary em,
body.dark-mode .sectionHeader > span,
body.dark-mode .date,
body.dark-mode .pill,
body.dark-mode .chip,
body.dark-mode .miniHistory span,
body.dark-mode .tabBar button,
body.dark-mode .tabBar button span {
  color: #d8e2ec !important;
  font-weight: 900 !important;
}

body[data-theme="dark"] .summaryMeta,
body[data-theme="dark"] .date,
body[data-theme="dark"] .pill,
body[data-theme="dark"] .chip,
body[data-theme="dark"] .miniHistory span,
body.dark-mode .summaryMeta,
body.dark-mode .date,
body.dark-mode .pill,
body.dark-mode .chip,
body.dark-mode .miniHistory span {
  border-color: #34465c !important;
  background: #162131 !important;
}

body[data-theme="dark"] .summaryMeta span,
body[data-theme="dark"] .sectionHeader > span,
body[data-theme="dark"] .foldPanel > summary span,
body.dark-mode .summaryMeta span,
body.dark-mode .sectionHeader > span,
body.dark-mode .foldPanel > summary span {
  font-size: 12px !important;
}

body[data-theme="dark"] .foldPanel > summary span::after,
body[data-theme="dark"] .compactGuide summary em,
body.dark-mode .foldPanel > summary span::after,
body.dark-mode .compactGuide summary em {
  color: #e5edf5 !important;
}

body[data-theme="dark"] .tabBar button.active,
body[data-theme="dark"] .tabBar button.active span,
body.dark-mode .tabBar button.active,
body.dark-mode .tabBar button.active span {
  color: #f0fff7 !important;
}

@media (max-width: 420px) {
  #app { padding-bottom: 66px; }
  .view { padding: 8px 7px 12px; }
  .metricsGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric strong { font-size: 13px; }
  .advisorCard { grid-template-columns: 64px minmax(0, 1fr); }
  .mascot { min-height: 64px; }
  .mascot img { max-height: 84px; }
  .itemSummary { min-height: 50px; padding: 7px 8px; }
  .summaryMeta { min-width: 76px; }
  .summaryMeta b { font-size: 12px; }
  .summaryMeta span { font-size: 11px; }
  .itemSummary strong { font-size: 13px; }
  .itemSummary span { font-size: 11px; }
  .tabBar button { min-height: 52px; }
}

body[data-theme="dark"] .summaryMeta span,
body[data-theme="dark"] .itemSummary span,
body[data-theme="dark"] .tabBar button span,
body[data-theme="dark"] .compactGuide summary small,
body[data-theme="dark"] .compactGuide summary em,
body.dark-mode .summaryMeta span,
body.dark-mode .itemSummary span,
body.dark-mode .tabBar button span,
body.dark-mode .compactGuide summary small,
body.dark-mode .compactGuide summary em {
  font-size: max(11px, .72rem) !important;
  line-height: 1.25 !important;
}

body[data-theme="dark"] .summaryMeta b,
body[data-theme="dark"] .summaryMeta span,
body[data-theme="dark"] .pill,
body[data-theme="dark"] .chip,
body[data-theme="dark"] .sectionHeader > span,
body[data-theme="dark"] .foldPanel > summary span,
body[data-theme="dark"] .foldPanel > summary span::after,
body.dark-mode .summaryMeta b,
body.dark-mode .summaryMeta span,
body.dark-mode .pill,
body.dark-mode .chip,
body.dark-mode .sectionHeader > span,
body.dark-mode .foldPanel > summary span,
body.dark-mode .foldPanel > summary span::after {
  text-shadow: 0 1px 0 rgba(0,0,0,.45);
}

/* Visible small labels in the actual DOM: fold summaries, asset summaries, pills, and bottom nav. */
html[data-theme="dark"] .summaryMeta,
html[data-theme="dark"] .summaryMeta span,
html[data-theme="dark"] .itemSummary span,
html[data-theme="dark"] .foldPanel > summary.sectionHeader > span,
html[data-theme="dark"] .foldPanel > summary.sectionHeader > span::after,
html[data-theme="dark"] .compactGuide summary small,
html[data-theme="dark"] .compactGuide summary em,
html[data-theme="dark"] .sectionHeader > span,
html[data-theme="dark"] .pill,
html[data-theme="dark"] .chip,
html[data-theme="dark"] .tabBar button,
html[data-theme="dark"] .tabBar button span {
  color: #e2ebf3 !important;
  opacity: 1 !important;
  font-weight: 900 !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .5);
}

html[data-theme="dark"] .summaryMeta,
html[data-theme="dark"] .pill,
html[data-theme="dark"] .chip {
  border-color: #3c5068 !important;
  background: #172234 !important;
}

html[data-theme="dark"] .summaryMeta span {
  color: #f2fbf6 !important;
  border: 1px solid #4d6a5f !important;
  background: #1f342c !important;
  box-shadow: inset 0 0 0 1px rgba(215, 255, 240, .08);
  letter-spacing: 0;
}

html[data-theme="dark"] .foldPanel > summary.sectionHeader > span::after,
html[data-theme="dark"] .compactGuide summary em {
  color: #d7fff0 !important;
}

html[data-theme="dark"] .tabBar button {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .tabBar button.active,
html[data-theme="dark"] .tabBar button.active span {
  color: #f0fff7 !important;
}

/* Remaining dark-mode contrast sweep: Excel memo/history cards and readable small labels. */
html[data-theme="dark"] .noteList article,
html[data-theme="dark"] .historyList div,
html[data-theme="dark"] .sourceSummaryRow,
html[data-theme="dark"] .fileRow,
html[data-theme="dark"] .ocrFacts div,
html[data-theme="dark"] .transactionRow,
body[data-theme="dark"] .noteList article,
body[data-theme="dark"] .historyList div,
body[data-theme="dark"] .sourceSummaryRow,
body[data-theme="dark"] .fileRow,
body[data-theme="dark"] .ocrFacts div,
body[data-theme="dark"] .transactionRow,
body.dark-mode .noteList article,
body.dark-mode .historyList div,
body.dark-mode .sourceSummaryRow,
body.dark-mode .fileRow,
body.dark-mode .ocrFacts div,
body.dark-mode .transactionRow {
  border: 1px solid #2b3a50 !important;
  background: #111827 !important;
  color: #dbe3ee !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .noteList strong,
html[data-theme="dark"] .historyList strong,
html[data-theme="dark"] .sourceSummaryRow strong,
html[data-theme="dark"] .sourceSummaryRow dd,
html[data-theme="dark"] .fileRow strong,
html[data-theme="dark"] .ocrFacts dd,
html[data-theme="dark"] .transactionRow strong,
body[data-theme="dark"] .noteList strong,
body[data-theme="dark"] .historyList strong,
body[data-theme="dark"] .sourceSummaryRow strong,
body[data-theme="dark"] .sourceSummaryRow dd,
body[data-theme="dark"] .fileRow strong,
body[data-theme="dark"] .ocrFacts dd,
body[data-theme="dark"] .transactionRow strong,
body.dark-mode .noteList strong,
body.dark-mode .historyList strong,
body.dark-mode .sourceSummaryRow strong,
body.dark-mode .sourceSummaryRow dd,
body.dark-mode .fileRow strong,
body.dark-mode .ocrFacts dd,
body.dark-mode .transactionRow strong {
  color: #f1f5f9 !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .noteList p,
html[data-theme="dark"] .fileRow p,
html[data-theme="dark"] .transactionRow p,
body[data-theme="dark"] .noteList p,
body[data-theme="dark"] .fileRow p,
body[data-theme="dark"] .transactionRow p,
body.dark-mode .noteList p,
body.dark-mode .fileRow p,
body.dark-mode .transactionRow p {
  color: #dbe3ee !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .noteList span,
html[data-theme="dark"] .historyList span,
html[data-theme="dark"] .sourceSummaryRow span,
html[data-theme="dark"] .sourceSummaryRow dt,
html[data-theme="dark"] .fileRow span,
html[data-theme="dark"] .ocrFacts dt,
html[data-theme="dark"] .transactionRow span,
body[data-theme="dark"] .noteList span,
body[data-theme="dark"] .historyList span,
body[data-theme="dark"] .sourceSummaryRow span,
body[data-theme="dark"] .sourceSummaryRow dt,
body[data-theme="dark"] .fileRow span,
body[data-theme="dark"] .ocrFacts dt,
body[data-theme="dark"] .transactionRow span,
body.dark-mode .noteList span,
body.dark-mode .historyList span,
body.dark-mode .sourceSummaryRow span,
body.dark-mode .sourceSummaryRow dt,
body.dark-mode .fileRow span,
body.dark-mode .ocrFacts dt,
body.dark-mode .transactionRow span {
  color: #cbd5e1 !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .foldBody,
body[data-theme="dark"] .foldBody,
body.dark-mode .foldBody {
  border-top-color: #2b3a50 !important;
  background: #0f172a !important;
}

html[data-theme="dark"] .actionPanel,
body[data-theme="dark"] .actionPanel,
body.dark-mode .actionPanel {
  background: #111827 !important;
}

.marketMonitorPanel,
.themeWatchPanel {
  border-color: #253244;
  background: #111824;
}

.marketMonitorGrid,
.themeCardList,
.alertList,
.researchList,
.kioxiaChecklist {
  display: grid;
  gap: 10px;
}

.marketMonitorGrid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.marketMonitorGrid div,
.alertCard,
.researchCard,
.themeCard,
.kioxiaCheckCard {
  min-width: 0;
  padding: 12px;
  border: 1px solid #2b3a50;
  border-radius: 7px;
  background: #111827;
  color: #dbe3ee;
}

.alertCard,
.researchCard,
.themeCard,
.kioxiaCheckCard {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.alertCard span,
.researchCard span,
.themeCard span,
.kioxiaCheckCard span,
.alertCard small,
.researchCard small,
.themeCard small,
.kioxiaCheckCard small {
  display: block;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.45;
}

.alertCard strong,
.researchCard strong,
.themeCard strong,
.kioxiaCheckCard strong {
  display: block;
  margin: 4px 0;
  color: #f1f5f9;
  overflow-wrap: anywhere;
}

.alertCard p,
.researchCard p,
.themeCard p,
.kioxiaCheckCard p {
  margin: 4px 0;
  color: #dbe3ee;
}

.alertCard.done,
.researchCard.done,
.kioxiaCheckCard.done {
  opacity: 0.82;
}

.themeCardList {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.marketMemoCard,
.themeCard,
.kioxiaCheckCard {
  box-shadow: none;
}

.themeChecklist strong {
  color: #f1f5f9;
}

.themeChecklist span {
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.45;
}

.miraiDecisionSummaryPanel,
.assetVisualPanel {
  border-color: #29445a;
  background: #0f172a;
}

.miraiDecisionGrid,
.assetVisualGrid,
.concentrationGrid,
.holdingRankList {
  display: grid;
  gap: 10px;
}

.miraiDecisionGrid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.miraiDecisionGrid > div,
.concentrationGrid > div,
.holdingRankList > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid #2b3a50;
  border-radius: 7px;
  background: #111827;
  color: #dbe3ee;
}

.miraiDecisionGrid span,
.concentrationGrid span,
.holdingRankList span,
.assetLegend span,
.assetLegend b {
  display: block;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.45;
}

.miraiDecisionGrid strong,
.concentrationGrid strong,
.holdingRankList strong {
  display: block;
  margin: 4px 0;
  color: #f1f5f9;
  overflow-wrap: anywhere;
}

.miraiDecisionGrid small,
.concentrationGrid small {
  color: #cbd5e1;
  line-height: 1.45;
}

.miraiTodaySummary {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #2b3a50;
  border-radius: 7px;
  background: #111827;
  color: #dbe3ee;
}

.assetVisualGrid {
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  align-items: center;
}

.assetDonutWrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
}

.assetDonut {
  width: min(210px, 58vw);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px #2b3a50, 0 10px 24px rgba(0, 0, 0, 0.28);
}

.assetDonutCenter {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44%;
  aspect-ratio: 1;
  border: 1px solid #2b3a50;
  border-radius: 50%;
  background: #0b111b;
  text-align: center;
}

.assetDonutCenter strong {
  color: #f1f5f9;
  font-size: 14px;
}

.assetDonutCenter span {
  color: #cbd5e1;
  font-size: 11px;
}

.assetLegend {
  display: grid;
  gap: 8px;
}

.assetLegend div {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid #26384d;
  border-radius: 7px;
  background: #111827;
}

.assetLegend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.holdingRankList .barTrack {
  margin-top: 8px;
  height: 12px;
}

.simulationLineChart {
  margin: 10px 0;
  padding: 12px;
  border: 1px solid #2b3a50;
  border-radius: 7px;
  background: #0b111b;
}

.simulationLineChart svg {
  display: block;
  width: 100%;
  height: 220px;
}

.simulationLineChart .chartAxis {
  stroke: #334155;
  stroke-width: 2;
}

.simulationLineChart .chartTarget {
  stroke: #fbbf24;
  stroke-width: 2;
  stroke-dasharray: 6 6;
}

.simulationLineChart .chartLine {
  fill: none;
  stroke: #60a5fa;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.simulationLineChart circle {
  fill: #93c5fd;
  stroke: #0b111b;
  stroke-width: 2;
}

.simulationLineChart text {
  fill: #dbe3ee;
  font-size: 12px;
  font-weight: 800;
}

.simulationLineChart p {
  margin: 8px 0 0;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.5;
}

.policyPanel input,
.policyPanel textarea,
.policyPanel select {
  background: #0f172a;
  color: #e5e7eb;
  border-color: #2b3a50;
}

.stockIntelligencePanel {
  border-color: #29445a;
}

.stockSearchBox {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  color: #dbe3ee;
}

.stockSearchRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.stockSearchRow .command {
  min-height: 44px;
  min-width: 96px;
}

.stockSearchBox input {
  width: 100%;
  box-sizing: border-box;
  background: #0f172a;
  color: #e5e7eb;
  border: 1px solid #2b3a50;
  border-radius: 7px;
  padding: 11px 12px;
}

.stockResultList,
.stockReasonGrid,
.scoreTriplet,
.stockMetaGrid,
.recoveryGrid,
.tradingRuleGrid,
.phaseGrid {
  display: grid;
  gap: 10px;
}

.stockResultList {
  margin-top: 12px;
}

.stockResultMetaGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.stockResultMetaGrid div {
  background: #0c1728;
  border: 1px solid #29445a;
  border-radius: 7px;
  padding: 8px;
  min-width: 0;
}

.stockResultMetaGrid small,
.stockResultMetaGrid strong {
  display: block;
  color: #f8fbff;
  overflow-wrap: anywhere;
}

.stockResultMetaGrid small {
  color: #cbd5e1;
  margin-bottom: 4px;
}

.stockPriceStateBox {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.stockPriceStateBox div {
  background: #071827;
  border: 1px solid #2f74c0;
  border-radius: 7px;
  padding: 9px;
  min-width: 0;
}

.stockPriceStateBox small,
.stockPriceStateBox strong,
.stockPriceStateBox span {
  display: block;
  overflow-wrap: anywhere;
}

.stockPriceStateBox small {
  color: #cbd5e1;
}

.stockPriceStateBox strong {
  color: #f8fbff;
  margin: 3px 0;
}

.webResearchLinks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
  color: #cbd5e1;
}

.webResearchLinks a {
  color: #e8f3ff;
  background: #12345a;
  border: 1px solid #3d7ec4;
  border-radius: 7px;
  padding: 7px 10px;
  text-decoration: none;
}

.webResearchLinks span {
  font-size: 0.86rem;
}

.stockAnalysisSections div p {
  line-height: 1.65;
}

.symbolMasterStatusPanel {
  margin: 10px 0;
  border: 1px solid #29445a;
  border-radius: 7px;
  padding: 10px;
  background: #0b1628;
}

.symbolMasterStatusPanel .listControl {
  align-items: center;
}

.symbolMasterProviderGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.symbolMasterProviderGrid div {
  border: 1px solid #2f74c0;
  border-radius: 7px;
  background: #101b2d;
  padding: 8px;
  min-width: 0;
}

.symbolMasterProviderGrid strong,
.symbolMasterProviderGrid span,
.symbolMasterProviderGrid small {
  display: block;
  color: #f8fbff;
  overflow-wrap: anywhere;
}

.symbolMasterProviderGrid small {
  color: #dbeafe;
}

.stockResultCard {
  border: 1px solid #2b3a50;
  background: #111827;
  border-radius: 7px;
  padding: 12px;
  color: #dbe3ee;
}

.ipoWatchPanel {
  border: 1px solid #31516b;
  background: #0b1220;
  border-radius: 7px;
  padding: 12px;
  margin-top: 12px;
}

.stockResultHeader {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.stockResultHeader span,
.stockResultHeader small,
.stockMetaGrid span,
.scoreTriplet span,
.scoreTriplet small {
  display: block;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.45;
}

.stockResultHeader strong,
.scoreTriplet strong,
.stockMetaGrid strong {
  color: #f1f5f9;
  overflow-wrap: anywhere;
}

.scoreTriplet,
.stockMetaGrid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
}

.stockMetaGrid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.scoreTriplet > div,
.stockMetaGrid > div,
.recoveryGrid > div,
.tradingRuleGrid > div,
.phaseGrid > div {
  border: 1px solid #26364b;
  background: #0f172a;
  border-radius: 7px;
  padding: 10px;
}

.scoreBadgeLine {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.analysisPending {
  display: inline-block;
  border: 1px solid #36506f;
  background: #152238;
  color: #dbe3ee;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
}

.stockDefaultDashboard {
  display: grid;
  gap: 12px;
}

.activeTradingPanel {
  border: 1px solid #2b3a50;
  background: #0b1220;
  border-radius: 7px;
  padding: 12px;
}

.recoveryGrid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tradingRuleGrid,
.phaseGrid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.recoveryGrid span,
.tradingRuleGrid span,
.phaseGrid span,
.sourceStatusTable span {
  display: block;
  color: #cbd5e1;
  font-size: 12px;
}

.recoveryGrid strong,
.tradingRuleGrid strong,
.phaseGrid strong,
.sourceStatusTable strong {
  display: block;
  color: #f1f5f9;
  margin: 3px 0;
}

.recoveryGrid small,
.tradingRuleGrid small,
.phaseGrid small,
.sourceStatusTable small {
  display: block;
  color: #b8c4d3;
  line-height: 1.45;
}

.milestoneList {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.stockRankLegend {
  margin-top: 10px;
}

.milestoneList span {
  border: 1px solid #31516b;
  background: #102235;
  color: #dbeafe;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
}

.firstTradeCandidatesPanel,
.manualTradeLogPanel {
  border-color: #29445a;
  background: #0b1220;
}

.tradeStartSummary,
.tradeLogKpiGrid,
.candidateScoreGrid,
.candidateRuleGrid,
.candidateReasonGrid {
  display: grid;
  gap: 8px;
}

.tradeStartSummary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 10px 0;
}

.tradeStartSummary > div,
.tradeLogKpiGrid > div,
.candidateScoreGrid > div,
.candidateRuleGrid > div,
.candidateReasonGrid > div {
  border: 1px solid #26364b;
  background: #0f172a;
  border-radius: 7px;
  padding: 10px;
}

.tradeStartSummary strong,
.tradeLogKpiGrid strong,
.firstTradeCandidateCard strong {
  color: #f1f5f9;
}

.tradeStartSummary span,
.tradeLogKpiGrid span,
.candidateRuleGrid span {
  display: block;
  color: #dbe3ee;
  line-height: 1.45;
}

.candidatePriceState .tagList {
  margin: 4px 0;
}

.candidatePriceState em {
  display: block;
  color: #b8c4d3;
  font-style: normal;
  line-height: 1.45;
}

.tradeStartSummary small,
.tradeLogKpiGrid small,
.candidateScoreGrid small,
.candidateRuleGrid small,
.candidateReasonGrid small {
  display: block;
  color: #b8c4d3;
  line-height: 1.45;
}

.firstTradeCandidateGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.firstTradeCandidateCard {
  border: 1px solid #2b3a50;
  background: #101827;
  border-radius: 8px;
  padding: 12px;
  color: #dbe3ee;
  display: grid;
  gap: 10px;
}

.firstTradeCandidateCard header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.firstTradeCandidateCard header span {
  display: block;
  color: #b8c4d3;
  font-size: 12px;
  margin-top: 2px;
}

.tradeDirectionPill {
  border: 1px solid #2f5d75;
  background: #102235;
  color: #d7f8ff;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.candidateScoreRow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.candidateScoreRow span {
  border: 1px solid #2b3a50;
  background: #0b1220;
  color: #dbeafe;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}

.candidateScoreGrid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.candidateRuleGrid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.candidateReasonGrid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.candidateReasonGrid ul {
  margin: 6px 0 0 18px;
  padding: 0;
  color: #dbe3ee;
  line-height: 1.5;
}

.candidateMiraiNote {
  border: 1px solid #31516b;
  background: #102235;
  color: #dbeafe;
  border-radius: 7px;
  padding: 9px;
  margin: 0;
  line-height: 1.55;
}

.ms2OrderMemo {
  border: 1px solid #2b3a50;
  background: #0f172a;
  border-radius: 9px;
  padding: 10px;
}

.ms2OrderBrief {
  border: 1px solid #31516b;
  background: #0f1724;
  border-radius: 9px;
  padding: 10px;
}

.compactSectionHeader {
  margin: 2px 0 8px;
}

.compactSectionHeader h4 {
  margin: 0;
  color: #f1f5f9;
  font-size: 14px;
}

.ms2OrderMemo summary {
  cursor: pointer;
  color: #e5e7eb;
  font-weight: 800;
}

.ms2MemoGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.ms2MemoGrid.compact {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-top: 6px;
}

.ms2MemoGrid div {
  display: grid;
  gap: 3px;
  border: 1px solid #26364b;
  background: #111827;
  border-radius: 8px;
  padding: 9px;
}

.ms2MemoGrid small {
  color: #aeb8c6;
  font-weight: 800;
}

.ms2MemoGrid span {
  color: #dbe3ee;
  line-height: 1.45;
}

.tradeLogKpiGrid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 10px;
}

.manualTradeLogForm {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.manualTradeLogForm label {
  display: grid;
  gap: 5px;
  color: #dbe3ee;
  font-size: 13px;
  font-weight: 700;
}

.manualTradeLogForm input,
.manualTradeLogForm select,
.manualTradeLogForm textarea {
  width: 100%;
  border: 1px solid #2b3a50;
  background: #0f172a;
  color: #e5e7eb;
  border-radius: 7px;
  padding: 9px;
}

.manualTradeLogForm input::placeholder,
.manualTradeLogForm textarea::placeholder {
  color: #9fb0c2;
}

.manualTradeLogForm .wide,
.tradeLogActionRow {
  grid-column: 1 / -1;
}

.tradeLogActionRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: #b8c4d3;
}

.tradeLogActionRow button[disabled] {
  border: 1px solid #334155;
  background: #111827;
  color: #94a3b8;
  cursor: not-allowed;
}

.tradeLogRecentList {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.tradeLogRecentList h4 {
  margin: 0;
  color: #e5e7eb;
}

.tradeLogRecentList article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #2b3a50;
  border-radius: 12px;
  background: #111827;
}

.tradeLogRecentList span,
.tradeLogRecentList small {
  color: #cbd5e1;
}

.sourceStatusTable {
  display: grid;
  gap: 8px;
}

.sourceStatusTable div {
  display: grid;
  grid-template-columns: minmax(92px, .8fr) minmax(74px, .55fr) minmax(0, 2fr);
  gap: 8px;
  align-items: start;
  border: 1px solid #26364b;
  background: #0f172a;
  border-radius: 7px;
  padding: 9px;
}

.tagList {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.tagList span {
  border: 1px solid #2b3a50;
  background: #102235;
  color: #cbd5e1;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
}

.stockReasonGrid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stockReasonGrid > div {
  background: #0f172a;
  border: 1px solid #26364b;
  border-radius: 7px;
  padding: 10px;
}

.stockReasonGrid h3 {
  margin: 0 0 6px;
  font-size: 13px;
  color: #f1f5f9;
}

.stockReasonGrid ul {
  margin: 0;
  padding-left: 18px;
  color: #dbe3ee;
  font-size: 13px;
}

@media (max-width: 720px) {
  .marketMonitorGrid {
    grid-template-columns: 1fr;
  }

  .alertCard,
  .researchCard,
  .themeCard,
  .kioxiaCheckCard {
    display: grid;
  }

  .themeCardList {
    grid-template-columns: 1fr;
  }

  .stockResultHeader,
  .scoreTriplet,
  .stockMetaGrid,
  .stockReasonGrid,
  .recoveryGrid,
  .tradingRuleGrid,
  .phaseGrid,
  .sourceStatusTable div {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px), print {
  .firstTradeCandidateGrid {
    grid-template-columns: 1fr !important;
  }

  .firstTradeCandidateCard {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .tradeStartSummary,
  .tradeLogKpiGrid,
  .candidateScoreGrid,
  .candidateRuleGrid,
  .candidateReasonGrid,
  .ms2MemoGrid,
  .ms2MemoGrid.compact {
    grid-template-columns: 1fr;
  }
}
/* Final UI simplification: trade modes, DC toggle, IO merge, and guide contrast. */
.segmentedSwitch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}
.segmentedSwitch button {
  border: 1px solid #2b3a50;
  border-radius: 8px;
  background: #0f172a;
  color: #dbeafe;
  padding: 10px 12px;
  font-weight: 900;
}
.segmentedSwitch button.active {
  border-color: #67e8f9;
  background: linear-gradient(135deg, #12314a, #211b45);
  color: #f0fdff;
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .35);
}
.tradeModeSwitch {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.candidateGroupTitle {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin: 14px 0 8px;
  padding: 10px 12px;
  border: 1px solid #2b3a50;
  border-radius: 8px;
  background: #0f172a;
}
.candidateGroupTitle h4 { margin: 0; color: #f1f5f9; }
.candidateGroupTitle span { color: #c4b5fd; font-size: 12px; font-weight: 800; }
.priceStatusPanel,
.referenceMetricPanel,
.ioSectionPanel,
.finalTradeCandidatesPanel {
  border-color: #31516b;
  background: #0b1220;
}
.netWorthModeSwitch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.miraiTabHint {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #29445a;
  border-radius: 12px;
  background: linear-gradient(135deg, #0b1727, #111827);
  color: #dbeafe;
}
.miraiTabHint img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid #5eead4;
  background: #08111f;
}
.miraiTabHint p {
  margin: 0;
  line-height: 1.45;
}
.guidePanel,
html[data-theme="dark"] .guidePanel,
body.dark-mode .guidePanel {
  border-color: #29445a !important;
  background: #0b1220 !important;
  color: #dbe3ee !important;
}
.guidePanel summary { color: #f1f5f9; }
.guideStep {
  min-height: 100%;
  background: #101827 !important;
  border-color: #2b3a50 !important;
}
.guideCaution {
  border: 1px solid #7f3f3f;
  border-radius: 8px;
  background: rgba(127, 29, 29, .18);
  color: #fecaca !important;
  padding: 10px;
}
.simulationLineChart svg { min-height: 240px; }
@media (max-width: 420px), print {
  .firstTradeCandidateGrid { grid-template-columns: 1fr !important; }
  .simulationLineChart svg { min-height: 240px; height: 260px !important; }
}

@media (max-width: 420px) {
  #app {
    padding-bottom: 78px;
  }

  .tabBar {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    min-height: 62px;
    padding: 4px 2px max(5px, env(safe-area-inset-bottom));
  }

  .tabBar button {
    min-height: 50px !important;
    padding: 4px 2px !important;
    gap: 2px;
    font-size: 12px !important;
  }

  .tabBar button span {
    font-size: 8px !important;
    line-height: 1.1;
  }

  .segmentedSwitch {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .segmentedSwitch button {
    min-height: 42px;
    padding: 8px 5px;
    font-size: 12px;
    line-height: 1.2;
  }

  .netWorthModeSwitch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assetVisualGrid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .assetDonutWrap {
    min-height: 238px;
  }

  .assetDonut {
    width: min(260px, 72vw);
    margin: 0 auto;
  }

  .assetLegend {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .assetLegend div {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 9px;
  }

  .assetLegend i {
    flex: 0 0 10px;
    margin-top: 0;
  }

  .assetLegend strong,
  .assetLegend span,
  .assetLegend b {
    line-height: 1.25;
  }

  .assetLegend strong {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    color: #f1f5f9;
    word-break: keep-all;
    overflow-wrap: normal;
  }

  .assetLegend span,
  .assetLegend b {
    flex: 0 0 auto;
    font-size: 12px;
    white-space: nowrap;
  }

  .miraiTabHint {
    gap: 8px;
    padding: 8px 9px;
    border-radius: 10px;
  }

  .miraiTabHint img {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }

  .miraiTabHint p {
    font-size: 12px;
    line-height: 1.4;
  }

  .candidateGroupTitle {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 9px 10px;
  }

  .firstTradeCandidateCard {
    padding: 10px;
  }

  .firstTradeCandidateCard header,
  .sourceStatusTable div,
  .tradeStartSummary,
  .tradeLogKpiGrid,
  .candidateScoreGrid,
  .candidateRuleGrid,
  .candidateReasonGrid,
  .ms2MemoGrid,
  .ms2MemoGrid.compact {
    grid-template-columns: 1fr !important;
  }

  .ioSectionPanel .cardActions {
    grid-template-columns: 1fr;
  }

  .ioSectionPanel .command,
  .priceStatusPanel .command {
    width: 100%;
    justify-content: center;
  }
}

/* Final critical contrast and compact-tab override. */
body, .view, .panel, .advisorCard, .itemCard, .metric, .sourceStatusTable div, .tradeStartSummary div, .candidateRuleGrid div, .planFocusGrid div, .payrollView label {
  color: #0f172a !important;
}

.panel, .advisorCard, .itemCard, .metric, .sourceStatusTable div, .tradeStartSummary div, .candidateRuleGrid div, .planFocusGrid div, .payrollView label {
  background: rgba(255, 255, 255, 0.96) !important;
}

.panel h2, .panel h3, .panel h4, .sectionHeader h2, .titleRow h1, .itemCard strong, .sourceStatusTable strong, .tradeStartSummary strong, .candidateRuleGrid span, .planFocusGrid strong, .metric strong, .metric span, .payrollView input, .payrollView select, .payrollView textarea {
  color: #0b1220 !important;
}

.panel small, .panel span, .panel p, .status, .simulationNote, .miraiSafetyNote, .guidePanel small {
  color: #334155 !important;
}

.tabBar {
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  gap: 4px !important;
  padding: 5px 6px calc(5px + env(safe-area-inset-bottom)) !important;
  background: rgba(10, 20, 40, 0.96) !important;
}

.tabBar button {
  min-width: 0 !important;
  min-height: 48px !important;
  padding: 4px 2px !important;
  border-radius: 10px !important;
  font-size: 15px !important;
  color: #e5f0ff !important;
  background: rgba(15, 23, 42, 0.72) !important;
}

.tabBar button span {
  display: block !important;
  margin-top: 2px !important;
  font-size: 10px !important;
  line-height: 1.05 !important;
  color: #e5f0ff !important;
}

.tabBar button.active {
  background: #0b74ff !important;
  color: #fff !important;
}

.rankBadge, .rankBadge.mini {
  display: inline-grid !important;
  min-width: 34px !important;
  height: 34px !important;
  place-items: center !important;
  border: 2px solid #0b1220 !important;
  border-radius: 8px !important;
  color: #0b1220 !important;
  font-weight: 900 !important;
  font-size: 20px !important;
  box-shadow: 0 2px 0 #0b1220 !important;
}

.rankBadge.rank-S, .rankBadge.rank-Splus, .rankBadge.rank-Splusplus { background: #ffd84d !important; }
.rankBadge.rank-A { background: #ff5bc8 !important; }
.rankBadge.rank-B { background: #ff3b30 !important; color: #fff !important; }
.rankBadge.rank-C { background: #ffb02e !important; }
.rankBadge.rank-D { background: #c99720 !important; }
.rankBadge.rank-E { background: #8bdc2f !important; }
.rankBadge.rank-F { background: #2f80ed !important; color: #fff !important; }
.rankBadge.rank-G { background: #9ca3af !important; color: #fff !important; }

.incomeBars, .holdingPriceGrid, .planFocusGrid {
  display: grid;
  gap: 10px;
}

.incomeBarRow {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #ffffff;
}

.incomeBarRow header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.incomeBarStack {
  display: grid;
  gap: 3px;
}

.incomeBarStack i {
  display: block;
  height: 8px;
  border-radius: 999px;
  min-width: 2px;
}

.incomeBarStack .gross { background: #14b8a6; }
.incomeBarStack .net { background: #2563eb; }
.incomeBarStack .deduct { background: #ef4444; }
.incomeBarStack .bonus { background: #f59e0b; }
.incomeBarStack .tax { background: #7c3aed; }
.incomeBarStack .benefit { background: #22c55e; }

.candidateMetaGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
  margin-top: 8px;
}

.candidateMetaGrid em {
  font-style: normal;
  color: #1e293b;
  background: #eaf2ff;
  border-radius: 8px;
  padding: 5px 7px;
  font-size: 12px;
}

.planFocusGrid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.planFocusGrid div {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
}

.planFocusGrid small {
  font-weight: 800;
  color: #1d4ed8 !important;
}

.holdingPricePanel .sourceStatusTable div small, .finalTradeCandidatesPanel .sourceStatusTable div small, .employeeStockDecisionPanel .candidatePriceState em {
  color: #1f2937 !important;
}

@media (max-width: 720px) {
  .tabBar button {
    min-height: 44px !important;
    font-size: 13px !important;
  }

  .tabBar button span {
    font-size: 9px !important;
  }

  .metricsGrid, .planFocusGrid, .candidateMetaGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .payrollView .formGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .payrollView .formGrid .wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  .tabBar {
    gap: 3px !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  .tabBar button {
    border-radius: 8px !important;
    font-size: 12px !important;
  }

  .tabBar button span {
    font-size: 8px !important;
  }
}
/* EOF display rescue marker */
/* Display rescue final override: keep this after all legacy blocks. */
.tabBar {
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  gap: 2px !important;
  overflow: hidden !important;
}

.tabBar button {
  display: grid !important;
  place-items: center !important;
  min-width: 0 !important;
  padding: 4px 1px !important;
  font-size: 0 !important;
  text-shadow: none !important;
  white-space: nowrap !important;
}

.tabBar button span {
  margin: 0 !important;
  max-width: 100% !important;
  color: #f8fbff !important;
  font-size: clamp(8px, 2.25vw, 12px) !important;
  line-height: 1.05 !important;
  font-weight: 900 !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

.compactGuide summary em,
.compactGuide summary::before,
.compactGuide summary::after,
.foldPanel > summary::before,
.foldPanel > summary::after {
  content: none !important;
  display: none !important;
}

.compactGuide:not([open]) .guideIntro,
.compactGuide:not([open]) .guideGrid,
.compactGuide:not([open]) .guideCaution,
.foldPanel:not([open]) .foldBody,
.candidateDetailFold:not([open]) > :not(summary),
.firstTradeCandidatesPanel:not([open]) > :not(summary),
.incomeCategory:not([open]) > :not(summary) {
  display: none !important;
}

.guidePanel,
.miraiTabHint {
  background: #0f274a !important;
  color: #f8fbff !important;
  border-color: #38bdf8 !important;
}

.guidePanel b,
.guidePanel strong,
.guidePanel h2,
.guidePanel h3,
.guidePanel p,
.guidePanel li,
.guidePanel small,
.miraiTabHint p {
  color: #f8fbff !important;
}

.priceStatusPanel .tradeStartSummary div strong,
.priceStatusPanel .sourceStatusTable div strong,
.finalTradeCandidatesPanel .sourceStatusTable div strong,
.employeeStockDecisionPanel .candidateRuleGrid div strong,
.holdingPricePanel .sourceStatusTable div strong,
.sourceStatusTable div strong,
.tradeStartSummary div strong,
.candidateRuleGrid div strong,
.candidateReasonGrid div strong,
.ms2MemoGrid div strong,
.metricGrid div b,
.planFocusGrid div strong {
  color: #0b1220 !important;
  text-shadow: none !important;
}

.priceStatusPanel .tradeStartSummary div span,
.priceStatusPanel .tradeStartSummary div small,
.priceStatusPanel .sourceStatusTable div span,
.priceStatusPanel .sourceStatusTable div small,
.finalTradeCandidatesPanel .sourceStatusTable div span,
.finalTradeCandidatesPanel .sourceStatusTable div small,
.employeeStockDecisionPanel .candidateRuleGrid div span,
.employeeStockDecisionPanel .candidateRuleGrid div small,
.holdingPricePanel .sourceStatusTable div span,
.holdingPricePanel .sourceStatusTable div small,
.sourceStatusTable div span,
.sourceStatusTable div small,
.tradeStartSummary div span,
.tradeStartSummary div small,
.candidateRuleGrid div span,
.candidateRuleGrid div small,
.candidateReasonGrid div span,
.candidateReasonGrid div small,
.ms2MemoGrid div span,
.ms2MemoGrid div small,
.metricGrid div span,
.metricGrid div small,
.planFocusGrid div span,
.planFocusGrid div small,
.incomeBarRow span,
.incomeBarRow small {
  color: #172033 !important;
  text-shadow: none !important;
}

.sourceStatusTable div,
.tradeStartSummary div,
.candidateRuleGrid div,
.candidateReasonGrid div,
.ms2MemoGrid div,
.planFocusGrid div,
.metricGrid div,
.incomeBarRow,
.payrollCoreFields label,
.categoryGrid label {
  background: #ffffff !important;
  color: #0b1220 !important;
  border-color: #b7c6d9 !important;
}

.monthlyStepGrid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 9px !important;
}

.wizardStep {
  display: grid !important;
  grid-template-columns: auto auto minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 8px !important;
}

.powerRank {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
}

.powerRank > b {
  color: #0b1220 !important;
  font-size: 13px !important;
}

.payrollCoreFields,
.categoryGrid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  grid-column: 1 / -1 !important;
}

.incomeCategory {
  grid-column: 1 / -1 !important;
  border: 1px solid #bfdbfe !important;
  border-radius: 12px !important;
  padding: 8px !important;
  background: #f8fbff !important;
}

@media (max-width: 430px) {
  .tabBar button span {
    font-size: clamp(7px, 2.15vw, 9px) !important;
  }

  .payrollCoreFields,
  .categoryGrid,
  .payrollView .formGrid,
  .metricsGrid,
  .planFocusGrid {
    grid-template-columns: 1fr !important;
  }

  .wizardStep {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }

  .wizardStep input {
    grid-row: span 2;
  }
}
/* END contrast marker */
.abilityTag.neutral {
  background: #e8f1ff !important;
  color: #0b2c5f !important;
  border-color: #93c5fd !important;
}

.abilityTag.neutral small {
  color: #243447 !important;
}
/* PHASE1_DARKMODE_FINAL */
.compactGuide summary .openCloseLabel {
  display: inline-flex !important;
  min-width: 42px;
  justify-content: flex-end;
  color: #e0f2fe !important;
  font-weight: 900;
  font-style: normal;
}

.compactGuide[open] .openCloseLabel .openText,
.compactGuide:not([open]) .openCloseLabel .closeText {
  display: none !important;
}

.manualBasicsPanel,
.manualBasicsPanel .guideIntro,
.manualBasicsPanel .manualTable div,
.guidePanel .guideIntro,
.guidePanel .guideStep {
  background: #102746 !important;
  color: #f8fbff !important;
  border-color: #38bdf8 !important;
}

.manualBasicsPanel b,
.manualBasicsPanel strong,
.manualBasicsPanel span,
.manualBasicsPanel p,
.manualBasicsPanel h2,
.guidePanel .guideIntro *,
.guidePanel .guideStep * {
  color: #f8fbff !important;
}

.sourceStatusTable div,
.tradeStartSummary div,
.candidateRuleGrid div,
.candidateReasonGrid div,
.ms2MemoGrid div,
.planFocusGrid div,
.metricGrid div,
.incomeBarRow,
.payrollCoreFields label,
.categoryGrid label,
.stockScoreCard,
.firstTradeCandidateCard,
.candidateDetailFold,
.incomeCategory,
.policyPanel,
.allocationRow,
.monthlyInvestmentReview,
.holdingPricePanel .sourceStatusTable div,
.ioSectionPanel .tradeStartSummary div {
  background: #101b2d !important;
  color: #f8fbff !important;
  border-color: #2f74c0 !important;
}

.sourceStatusTable div strong,
.sourceStatusTable div span,
.sourceStatusTable div small,
.tradeStartSummary div strong,
.tradeStartSummary div span,
.tradeStartSummary div small,
.candidateRuleGrid div strong,
.candidateRuleGrid div span,
.candidateRuleGrid div small,
.candidateReasonGrid div strong,
.candidateReasonGrid div span,
.candidateReasonGrid div small,
.ms2MemoGrid div strong,
.ms2MemoGrid div span,
.ms2MemoGrid div small,
.planFocusGrid div strong,
.planFocusGrid div span,
.planFocusGrid div small,
.metricGrid div b,
.metricGrid div span,
.metricGrid div small,
.incomeBarRow strong,
.incomeBarRow span,
.incomeBarRow small,
.payrollCoreFields label,
.categoryGrid label,
.incomeCategory summary,
.candidateDetailFold summary,
.firstTradeCandidateCard strong,
.firstTradeCandidateCard span,
.firstTradeCandidateCard small,
.stockScoreCard strong,
.stockScoreCard span,
.stockScoreCard small {
  color: #f8fbff !important;
  text-shadow: none !important;
}

.metric strong,
.summaryMeta b,
.barLabel strong,
.metricsGrid .metric strong {
  color: #f8fbff !important;
  font-weight: 950 !important;
  text-shadow: 0 1px 0 #000 !important;
}

.rankBadge,
.rankBadge.small,
.rankBadge.mini {
  color: #ffffff !important;
  -webkit-text-stroke: 1px #07111f;
  text-shadow: 0 2px 0 #07111f, 1px 0 0 #07111f, -1px 0 0 #07111f !important;
}

.abilityTag {
  min-height: 28px;
  align-items: center;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
  text-shadow: none !important;
}

.abilityTag.neutral,
.tagList .abilityTag.neutral {
  background: #17436e !important;
  color: #eaf6ff !important;
  border-color: #38bdf8 !important;
}

.abilityTag.neutral small,
.tagList .abilityTag.neutral small {
  color: #dbeafe !important;
}
/* PHASE2_FORCE_FINAL_READABILITY */
body .titleRow,
body .titleRow *,
body .metricsGrid,
body .metricsGrid *,
body .stack,
body .stack *,
body .titleActions,
body .titleActions *,
body .segmentedSwitch,
body .segmentedSwitch *,
body .miniControl,
body .miniControl *,
body .brandLogo {
  color: #f8fbff !important;
}

body .manualBasicsPanel .manualTable div,
body .metric,
body .scorePanel,
body .scoreRow,
body .holdingPricePanel .sourceStatusTable div,
body .finalTradeCandidatesPanel .sourceStatusTable div,
body .firstTradeCandidateCard,
body .candidateDetailFold,
body .candidateRuleGrid div,
body .candidateReasonGrid div,
body .ms2MemoGrid div,
body .marketMemoSummaryPanel,
body .ipoWatchSummaryPanel,
body .highPriceWatchPanel,
body .tradeCompactFold,
body .manualTradeLogPanel,
body .tradeStartPanel,
body .tradingRulesPanel,
body .payrollRecordPanel,
body .payrollRecordPanel label,
body .payrollCoreFields label,
body .categoryGrid label,
body .incomeCategory,
body .planFocusPanel,
body .planFocusGrid div,
body .simulationPanel,
body .investmentSimulationPanel,
body .policyPanel,
body .allocationRow,
body .ioSectionPanel,
body .ioSectionPanel .tradeStartSummary div {
  background: #101b2d !important;
  color: #f8fbff !important;
  border-color: #38bdf8 !important;
  box-shadow: none !important;
}

body .manualBasicsPanel .manualTable div *,
body .metric *,
body .scorePanel *,
body .scoreRow *,
body .holdingPricePanel .sourceStatusTable div *,
body .finalTradeCandidatesPanel .sourceStatusTable div *,
body .firstTradeCandidateCard *,
body .candidateDetailFold *,
body .candidateRuleGrid div *,
body .candidateReasonGrid div *,
body .ms2MemoGrid div *,
body .marketMemoSummaryPanel *,
body .ipoWatchSummaryPanel *,
body .highPriceWatchPanel *,
body .tradeCompactFold *,
body .manualTradeLogPanel *,
body .tradeStartPanel *,
body .tradingRulesPanel *,
body .payrollRecordPanel *,
body .payrollRecordPanel label *,
body .payrollCoreFields label *,
body .categoryGrid label *,
body .incomeCategory *,
body .planFocusPanel *,
body .planFocusGrid div *,
body .simulationPanel *,
body .investmentSimulationPanel *,
body .policyPanel *,
body .allocationRow *,
body .ioSectionPanel *,
body .ioSectionPanel .tradeStartSummary div *,
body .finalTradeCandidatesPanel .miraiSafetyNote,
body .planFocusGrid strong {
  color: #f8fbff !important;
  text-shadow: none !important;
}

body .metric strong,
body .metric b,
body .summaryMeta b,
body .barLabel strong,
body .amount,
body .currency,
body [data-money] {
  color: #ffffff !important;
  font-weight: 950 !important;
  text-shadow: 0 1px 0 #000 !important;
}

body .rankBadge,
body .rankBadge.small,
body .rankBadge.mini {
  color: #ffffff !important;
  -webkit-text-stroke: 1px #07111f;
  text-shadow: 0 2px 0 #07111f, 1px 0 0 #07111f, -1px 0 0 #07111f !important;
}

body .abilityTag.neutral,
body .tagList .abilityTag.neutral {
  background: #17436e !important;
  color: #eaf6ff !important;
  border-color: #38bdf8 !important;
}

body .abilityTag.neutral *,
body .tagList .abilityTag.neutral * {
  color: #dbeafe !important;
}
/* PHASE2_LAST_WORD_READABILITY */
body .simulationNote,
body .simulationNote *,
body .planFocusGrid strong,
body .planFocusGrid div strong,
body .planFocusPanel strong,
body .investmentSimulationPanel strong {
  color: #f8fbff !important;
  text-shadow: none !important;
}

/* Phase8B final tab count override. */
.tabBar {
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
}

/* Phase8B Home consolidation: Mirai summary lives on Home and uses dark cards. */
.miraiHomeSummaryPanel,
.miraiHomeSummaryPanel * {
  color: #eaf2ff !important;
  text-shadow: none !important;
}

.miraiHomeSummaryPanel {
  background: linear-gradient(135deg, #08111f, #10233d) !important;
  border: 1px solid rgba(125, 211, 252, 0.36) !important;
  box-shadow: 0 18px 42px rgba(2, 8, 23, 0.28) !important;
}

.miraiHomeHero {
  display: grid;
  grid-template-columns: minmax(132px, 190px) 1fr;
  gap: 16px;
  align-items: center;
}

.miraiHomeHero .mascot {
  display: grid;
  min-height: 168px;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 16px;
  background: radial-gradient(circle at top, rgba(59, 130, 246, 0.2), rgba(2, 8, 23, 0.96));
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.78), 0 12px 26px rgba(2, 8, 23, 0.26);
  margin: 0;
  padding: 10px;
}

.miraiHomeHero .mascot img {
  width: min(156px, 92%);
  height: auto !important;
  max-height: none !important;
  object-fit: contain;
  display: block;
  border: 1px solid rgba(226, 232, 240, 0.18);
  border-radius: 12px;
  background: #0f172a;
}

.miraiHomeImageTrial figcaption {
  margin-top: 8px;
  color: #cfe6ff !important;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.miraiPriorityBox,
.miraiReliabilityRules {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(125, 211, 252, 0.32);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.74);
}

.miraiImprovementPanel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(251, 191, 36, 0.34);
  border-radius: 14px;
  background: rgba(12, 20, 35, 0.82);
}

.miraiImprovementSummary {
  margin-top: 10px;
}

.miraiImprovementGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.miraiImprovementTask {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.86);
}

.miraiImprovementTask header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.miraiImprovementTask header strong {
  overflow-wrap: anywhere;
}

.miraiImprovementTask header span {
  display: inline-grid;
  min-width: 34px;
  min-height: 30px;
  place-items: center;
  border-radius: 999px;
  background: #b45309;
  color: #fff7ed !important;
  font-weight: 950;
}

.miraiImprovementTask dl {
  display: grid;
  gap: 7px;
  margin: 10px 0;
}

.miraiImprovementTask dl div {
  display: grid;
  gap: 3px;
}

.miraiImprovementTask dt {
  color: #bfdbfe !important;
  font-size: 0.78rem;
  font-weight: 900;
}

.miraiImprovementTask dd {
  margin: 0;
  color: #eaf2ff !important;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.miraiImprovementTask small,
.miraiImprovementPanel .status {
  color: #dbeafe !important;
  overflow-wrap: anywhere;
}

.miraiHomeRows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.miraiHomeRow {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.82);
}

.miraiHomeRow header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.miraiHomeRow header b {
  display: inline-grid;
  min-width: 42px;
  min-height: 34px;
  place-items: center;
  border-radius: 10px;
  background: #0b74ff;
  font-weight: 950;
}

.miraiHomeRowBody {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.miraiHomeRowBody small,
.miraiReliabilityRules span,
.miraiPriorityBox span {
  overflow-wrap: anywhere;
  line-height: 1.45;
}

@media (max-width: 520px) {
  .miraiHomeHero,
  .miraiPriorityBox,
  .miraiReliabilityRules {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .miraiHomeHero .mascot {
    min-height: auto;
    padding: 10px;
  }

  .miraiHomeHero .mascot img {
    width: min(132px, 58vw);
    height: auto !important;
    max-height: none !important;
  }

  .miraiHomeRows {
    grid-template-columns: 1fr;
  }

  .miraiImprovementGrid {
    grid-template-columns: 1fr;
  }
}

/* Phase14R3 status-only current-price missing UI. */
.missingPriceStatusPanel,
.missingPriceStatusPanel * {
  color: #eaf2ff !important;
  text-shadow: none !important;
}

.missingPriceStatusPanel {
  background: linear-gradient(135deg, #07111f, #13223a) !important;
  border: 1px solid rgba(45, 212, 191, 0.34) !important;
  box-shadow: 0 16px 34px rgba(2, 8, 23, 0.24) !important;
}

.statusOnlySummaryGrid,
.statusOnlyProviderGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.statusOnlySummaryGrid > div,
.statusOnlyProviderGrid > article {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.84);
}

.statusOnlySummaryGrid strong,
.statusOnlyProviderGrid strong {
  display: block;
  color: #bfdbfe !important;
  font-weight: 950;
}

.statusOnlySummaryGrid span,
.statusOnlySummaryGrid small,
.statusOnlyProviderGrid li,
.statusOnlyTaskFold summary {
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.statusOnlyProviderGrid header {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}

.statusOnlyProviderGrid ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 18px;
}

.statusOnlyTaskFold {
  margin-top: 12px;
}

@media (max-width: 520px) {
  .statusOnlySummaryGrid,
  .statusOnlyProviderGrid {
    grid-template-columns: 1fr;
  }
}

/* Phase11B Trading tab safe review UI. */
.tradingModeSummaryPanel {
  border-color: rgba(125, 211, 252, 0.28);
  background: linear-gradient(135deg, #0b1727, #121826);
}

.tradingModeSummaryPanel p {
  margin: 0;
  color: #dbeafe;
  font-weight: 850;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.todayTradingChecklistPanel {
  border-color: rgba(34, 211, 238, 0.45);
  background: linear-gradient(135deg, #071527, #102033);
}

.todayTradingChecklistGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.todayTradingChecklistGrid article {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.84);
}

.todayTradingChecklistGrid article.plus {
  border-color: rgba(96, 165, 250, 0.46);
}

.todayTradingChecklistGrid article.neutral {
  border-color: rgba(251, 191, 36, 0.42);
}

.todayTradingChecklistGrid article.minus {
  border-color: rgba(248, 113, 113, 0.48);
}

.todayTradingChecklistGrid b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #22d3ee;
  color: #04111f;
  font-weight: 950;
}

.todayTradingChecklistGrid strong,
.todayTradingChecklistGrid span,
.todayTradingChecklistGrid small,
.todayTradingChecklistGrid em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.todayTradingChecklistGrid strong {
  color: #bfdbfe !important;
  font-weight: 950;
}

.todayTradingChecklistGrid span {
  margin-top: 4px;
  color: #f8fafc !important;
  font-weight: 900;
}

.todayTradingChecklistGrid small,
.todayTradingChecklistGrid em {
  margin-top: 5px;
  color: #dbeafe !important;
  font-style: normal;
  line-height: 1.45;
}

@media (max-width: 620px) {
  .todayTradingChecklistGrid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding-bottom: 4px;
  }

  .todayTradingChecklistGrid article {
    flex: 0 0 min(270px, 82vw);
    scroll-snap-align: start;
  }
}

.tradingSafeReviewPanel,
.tradingSafeReviewPanel * {
  color: #eaf2ff !important;
  text-shadow: none !important;
}

.tradingSafeReviewPanel {
  background: linear-gradient(135deg, #07111f, #102033) !important;
  border: 1px solid rgba(125, 211, 252, 0.34) !important;
  box-shadow: 0 16px 34px rgba(2, 8, 23, 0.25) !important;
}

.tradingReviewSummaryGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.tradingReviewSummaryGrid > div,
.tradingReviewSectionGrid > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.84);
}

.tradingReviewSummaryGrid strong,
.tradingReviewSectionGrid small {
  display: block;
  color: #bfdbfe !important;
  font-weight: 950;
}

.tradingReviewSummaryGrid span,
.tradingReviewSectionGrid span {
  display: block;
  margin-top: 4px;
  color: #f8fafc !important;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.tradingReviewSummaryGrid small,
.tradingReviewSectionGrid em {
  display: block;
  margin-top: 5px;
  color: #dbeafe !important;
  font-style: normal;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.tradingReviewFilters {
  margin: 10px 0 12px;
}

.tradingModeSelector {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.76);
}

.tradingModeSelector strong,
.tradingModeChecklistHeader strong {
  display: block;
  color: #bfdbfe !important;
  font-weight: 950;
}

.tradingModeSelector span,
.tradingModeChecklistHeader span {
  display: block;
  margin-top: 4px;
  color: #e0f2fe !important;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.tradingModeSelector p,
.tradingModeChecklist .status {
  margin: 0;
  color: #dbeafe !important;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.tradingModeChips {
  margin: 0;
}

.tradingGateNote {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-radius: 10px;
  background: rgba(14, 116, 144, 0.16);
  color: #e0f2fe !important;
  font-weight: 850;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.tradingReviewCards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  max-height: min(760px, 62vh);
  overflow: auto;
  padding-right: 4px;
}

.tradingReviewCard {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 14px;
  background: rgba(8, 15, 28, 0.94);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.75);
}

.tradingReviewCard header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.tradingReviewCard header strong {
  display: block;
  color: #f8fafc !important;
  font-size: 1rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.tradingReviewCard header span {
  display: block;
  margin-top: 4px;
  color: #dbeafe !important;
  font-size: 0.86rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.decisionPill {
  display: inline-grid;
  min-width: 62px;
  min-height: 34px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.26);
  font-size: 0.9rem;
  font-weight: 950;
  white-space: nowrap;
}

.tradingCardPrimaryStatus {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.72);
}

.tradingCardPrimaryStatus span,
.tradingCardPrimaryStatus strong {
  display: inline-grid;
  min-height: 28px;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.tradingCardPrimaryStatus span {
  background: rgba(14, 116, 144, 0.34);
  color: #e0f2fe !important;
}

.tradingCardPrimaryStatus strong {
  background: rgba(127, 29, 29, 0.72);
  color: #fee2e2 !important;
}

.tradingCardPrimaryStatus small {
  min-width: 0;
  color: #dbeafe !important;
  font-weight: 850;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.decisionPill.plus {
  background: rgba(20, 83, 45, 0.86);
  color: #dcfce7 !important;
}

.decisionPill.neutral {
  background: rgba(120, 53, 15, 0.88);
  color: #ffedd5 !important;
}

.decisionPill.minus {
  background: rgba(127, 29, 29, 0.88);
  color: #fee2e2 !important;
}

.tradingReviewSectionGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.tradingReviewTags {
  margin-top: 10px;
}

.tradingRouteDiagnosticLine {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 10px;
  background: rgba(14, 116, 144, 0.14);
}

.tradingRouteDiagnosticLine > div {
  min-width: 0;
}

.tradingRouteDiagnosticLine small {
  display: block;
  color: #bfdbfe !important;
  font-size: 0.74rem;
  font-weight: 950;
}

.tradingRouteDiagnosticLine span {
  display: block;
  margin-top: 2px;
  color: #f8fafc !important;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.tradingManualFetchGate {
  display: grid;
  grid-template-columns: minmax(220px, max-content) 1fr;
  gap: 8px 12px;
  align-items: center;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.52);
}

.tradingManualFetchGate label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.tradingManualFetchGate span,
.tradingManualFetchGate small {
  color: #dbeafe !important;
  overflow-wrap: anywhere;
}

.tradingManualFetchGate small {
  grid-column: 1 / -1;
}

.tradingManualFetchActions {
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 8px;
}

.tradingManualFetchActions .status {
  margin: 0;
  overflow-wrap: anywhere;
}

.providerConnectionGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.providerConnectionCard {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.42);
}

.providerConnectionCard header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.providerConnectionCard span {
  font-weight: 800;
}

.providerConnectionCard small,
.providerConnectionCard span {
  overflow-wrap: anywhere;
}

.tradingModeChecklist {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.5);
}

.tradingModeChecklistGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.tradingModeChecklistGrid > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.72);
}

.tradingModeChecklistGrid small {
  display: block;
  color: #bfdbfe !important;
  font-weight: 950;
}

.tradingModeChecklistGrid span {
  display: block;
  margin-top: 4px;
  color: #f8fafc !important;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.tradingModeChecklistGrid em {
  display: block;
  margin-top: 5px;
  color: #dbeafe !important;
  font-style: normal;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.tradingReviewTaskFold {
  margin-top: 10px;
}

.tradingReviewTaskFold summary {
  color: #bfdbfe !important;
  font-weight: 900;
  cursor: pointer;
}

.tradingReviewTaskFold[open] {
  max-height: min(620px, 58vh);
  overflow: auto;
  padding-right: 4px;
}

.tradingStyleFold .tradingModeChecklist {
  margin-top: 10px;
}

.holdingsSummaryPanel .sectionHeader {
  align-items: start;
}

.holdingsGrid {
  display: grid;
  gap: 8px;
  max-height: min(300px, 34vh);
  overflow: auto;
  padding-right: 4px;
}

.holdingsRow {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) repeat(3, minmax(118px, 0.7fr));
  gap: 8px;
  align-items: stretch;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.62);
}

.holdingsRow > div {
  min-width: 0;
}

.holdingsRow strong,
.holdingsRow span,
.holdingsRow small {
  display: block;
  overflow-wrap: anywhere;
}

.holdingsRow small {
  color: #bfdbfe !important;
  font-weight: 950;
}

.holdingsRow .plAmount {
  color: #f8fafc !important;
}

.holdingsRow.profit {
  border-left: 4px solid #22c55e;
}

.holdingsRow.loss {
  border-left: 4px solid #ef4444;
}

.holdingsRow.even {
  border-left: 4px solid #94a3b8;
}

.priceAlertGrid {
  display: grid;
  gap: 8px;
  max-height: min(280px, 32vh);
  overflow: auto;
  padding-right: 4px;
}

.priceAlertRow {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(112px, 0.5fr) minmax(220px, 1.1fr);
  gap: 8px;
  align-items: stretch;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.62);
}

.priceAlertRow.warning {
  border-left: 4px solid #f59e0b;
}

.priceAlertRow.danger {
  border-left: 4px solid #ef4444;
}

.priceAlertRow > div {
  min-width: 0;
}

.priceAlertRow strong,
.priceAlertRow span,
.priceAlertRow small {
  display: block;
  overflow-wrap: anywhere;
}

.priceAlertRow small {
  color: #bfdbfe !important;
  font-weight: 950;
}

.firstTradeCandidatesPanel[open] .firstTradeCandidateGrid {
  max-height: min(720px, 62vh);
  overflow: auto;
  padding-right: 4px;
}

.finalTradeCandidatesPanel .tradingCandidateList {
  grid-template-columns: 1fr !important;
  align-items: start !important;
  max-height: min(680px, 58vh);
  overflow: auto;
  padding-right: 4px;
}

.finalTradeCandidatesPanel .finalCandidateCard {
  min-width: 0 !important;
  width: 100% !important;
}

.judgmentNoteForm {
  min-width: 0;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.62);
}

.judgmentNoteIntro {
  margin: 0 0 8px;
  color: #f8fafc !important;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.judgmentNoteFields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.judgmentNoteFields label {
  min-width: 0;
  color: #bfdbfe !important;
  font-weight: 900;
}

.judgmentNoteFields input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin-top: 4px;
}

.judgmentNoteActionRow,
.candidateActionButtons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.brokerCheckList {
  min-width: 0;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.62);
  overflow-wrap: anywhere;
}

.brokerCheckList p {
  margin: 0 0 8px;
}

.brokerCheckList ol {
  margin: 0 0 8px 20px;
  padding: 0;
}

.brokerCheckList li {
  margin: 3px 0;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .holdingsGrid {
    max-height: min(310px, 36vh);
  }

  .holdingsRow {
    grid-template-columns: 1fr 1fr;
    padding: 8px;
  }

  .holdingsRow > div:first-child {
    grid-column: 1 / -1;
  }

  .priceAlertGrid {
    max-height: min(300px, 34vh);
  }

  .priceAlertRow {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .finalTradeCandidatesPanel .tradingCandidateList {
    max-height: min(580px, 52vh);
  }

  .judgmentNoteFields {
    grid-template-columns: 1fr;
  }
}

.dynamicTradeCandidateCard .candidatePriceLine {
  margin: 10px 0;
}

.timeframeDecisionGrid span {
  display: block;
  margin-top: 4px;
  color: #dbeafe !important;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.3;
}

.tradeCandidateBasis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.tradeCandidateBasis > div {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.62);
}

.tradeCandidateBasis small,
.tradeCandidateBasis span {
  display: block;
  overflow-wrap: anywhere;
}

.tradeCandidateBasis small {
  color: #bfdbfe !important;
  font-weight: 950;
}

.tradeCandidateBasis span {
  margin-top: 4px;
  color: #f8fafc !important;
  font-weight: 850;
  line-height: 1.35;
}

.candidateSafetyGate {
  display: grid;
  grid-template-columns: minmax(130px, 0.6fr) minmax(150px, 0.8fr) minmax(220px, 1.4fr);
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-left: 4px solid #22c55e;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.66);
}

.candidateSafetyGate.stopped {
  border-left-color: #f59e0b;
}

.candidateSafetyGate > div {
  min-width: 0;
}

.candidateSafetyGate small,
.candidateSafetyGate strong,
.candidateSafetyGate span {
  display: block;
  overflow-wrap: anywhere;
}

.candidateSafetyGate small {
  color: #bfdbfe !important;
  font-weight: 950;
}

.candidateSafetyGate strong,
.candidateSafetyGate span {
  color: #f8fafc !important;
  font-weight: 900;
  line-height: 1.35;
}

@media (max-width: 640px) {
  .candidateSafetyGate {
    grid-template-columns: 1fr;
  }
}

.nisaFrameSummaryPanel {
  border-color: rgba(59, 130, 246, 0.38);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.9));
}

.nisaFrameGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.nisaFrameGrid > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
}

.nisaFrameGrid small,
.nisaFrameGrid strong,
.nisaFrameGrid span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.nisaFrameGrid small {
  color: #bfdbfe;
  font-weight: 900;
}

.nisaFrameGrid strong {
  margin-top: 4px;
  color: #f8fafc;
  font-weight: 950;
  font-size: 1.05rem;
}

.nisaFrameGrid span {
  margin-top: 5px;
  color: #dbeafe;
  line-height: 1.45;
  font-weight: 800;
}

@media (max-width: 720px) {
  .nisaFrameGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .nisaFrameGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .nisaFrameGrid > div {
    padding: 8px;
  }
}

.tradingReviewTask {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.88);
}

.tradingReviewTask strong {
  color: #f8fafc !important;
}

.tradingReviewTask small,
.tradingReviewEmpty,
.tradingSafeReviewPanel .status {
  color: #dbeafe !important;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.tradingReviewCard.empty p {
  color: #dbeafe !important;
  margin: 0;
}

@media (max-width: 420px) {
  .tradingReviewSummaryGrid,
  .tradingReviewCards,
  .tradingReviewSectionGrid,
  .tradingModeChecklistGrid,
  .tradingRouteDiagnosticLine,
  .tradingManualFetchGate {
    grid-template-columns: 1fr !important;
  }

  .tradingReviewCard {
    padding: 12px;
  }

  .tradingReviewCards {
    max-height: min(360px, 42vh);
  }

  .tradingSafeReviewPanel {
    max-height: 74vh;
    overflow: auto;
  }

  .tradingReviewCard header {
    display: grid;
  }

  .tradingCardPrimaryStatus {
    grid-template-columns: 1fr 1fr;
  }

  .tradingCardPrimaryStatus small {
    grid-column: 1 / -1;
  }

  .decisionPill {
    justify-self: start;
  }
}


/* === Phase17 スマホ向け ランク判定の根拠details === */
@media (max-width: 640px) {
  .candidateDetailFold[open] > .tradeCandidateBasis.expanded {
    max-height: 50vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .candidateDetailFold .tradeCandidateBasis.expanded > div > ul {
    margin: 4px 0 0 0 !important;
    padding-left: 16px !important;
  }
  .candidateDetailFold .tradeCandidateBasis.expanded > div > ul > li {
    font-size: 12px !important;
    line-height: 1.4 !important;
    margin: 2px 0 !important;
  }
  .dataHealthNote {
    font-size: 12px !important;
    padding: 6px 8px !important;
    margin: 4px 0 !important;
  }
  .tradeModeLegend {
    flex-direction: column !important;
    gap: 4px !important;
  }
  .tradeModeLegendItem {
    font-size: 11px !important;
  }
  .rankGuideTable > div {
    font-size: 12px !important;
    padding: 4px 0 !important;
  }
  .principlesList li {
    font-size: 12px !important;
    padding: 6px 10px 6px 36px !important;
  }
  .miraiDecisionCaption {
    font-size: 12px !important;
    padding: 6px !important;
  }
}

/* === Phase18 データ健全度バッジ (色付き帯) === */
.dataHealthNote {
  margin: 8px 0 !important;
  padding: 8px 12px !important;
  border-left: 4px solid #94a3b8 !important;
  background: #f8fafc !important;
  border-radius: 4px !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
}
.dataHealthNote b {
  font-weight: 600 !important;
}
.dataHealth-良好 {
  border-left-color: #10b981 !important;
  background: #f0fdf4 !important;
}
.dataHealthNote:has(b) {
  display: block;
}
.dataHealth-部分的 {
  border-left-color: #f59e0b !important;
  background: #fffbeb !important;
}
.dataHealth-不足 {
  border-left-color: #94a3b8 !important;
  background: #f1f5f9 !important;
}
.uncertaintyNote,
.candidateChangeNote {
  display: grid;
  gap: 3px;
  margin: 7px 0 !important;
  padding: 8px 12px !important;
  border-left: 4px solid #94a3b8 !important;
  border-radius: 4px !important;
  background: #f8fafc !important;
  color: #334155 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}
.uncertaintyNote b,
.candidateChangeNote b {
  font-size: 12px;
  color: #0f172a !important;
}
.uncertaintyNote span,
.candidateChangeNote span {
  color: #334155 !important;
  font-weight: 800 !important;
  line-height: 1.4 !important;
}
.uncertainty-low {
  border-left-color: #22c55e !important;
  background: #f0fdf4 !important;
}
.uncertainty-medium {
  border-left-color: #f59e0b !important;
  background: #fffbeb !important;
}
.uncertainty-high {
  border-left-color: #ef4444 !important;
  background: #fef2f2 !important;
}
.candidateChange-new {
  border-left-color: #3b82f6 !important;
  background: #eff6ff !important;
}
.candidateChange-improved {
  border-left-color: #10b981 !important;
  background: #ecfdf5 !important;
}
.candidateChange-watch {
  border-left-color: #f97316 !important;
  background: #fff7ed !important;
}
.candidateChange-same {
  border-left-color: #94a3b8 !important;
  background: #f8fafc !important;
}
.extractionLegend {
  margin: 8px 0 !important;
  padding: 8px 12px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  color: #475569 !important;
}
.extractionLegend strong {
  display: inline-block;
  margin-right: 8px;
  color: #1e293b;
  font-size: 13px;
}
.extractionLegend span,
.extractionLegend small {
  display: inline-block;
  margin-right: 12px;
}
.rankGuideSummaryPanel {
  margin: 8px 0 !important;
  padding: 6px 12px !important;
  background: #fffbeb !important;
  border: 1px solid #fde68a !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  color: #78350f !important;
}
.rankGuideSummaryPanel summary {
  cursor: pointer;
  font-weight: 600;
  color: #92400e;
}
.rankGuideInline {
  margin-top: 6px;
  padding: 4px 0;
}
.rankGuideInline p {
  margin: 4px 0;
}
.rankGuideInline .rt,
.rankGuideInline .eod,
.rankGuideInline .manual,
.rankGuideInline .staleFail {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: bold;
  font-size: 11px;
}
.rankGuideInline .rt { background: #10b981; color: white; }
.rankGuideInline .eod { background: #3b82f6; color: white; }
.rankGuideInline .manual { background: #f59e0b; color: white; }
.rankGuideInline .staleFail { background: #6b7280; color: white; }


/* === Phase20 chip font-size === */
.filterChip,
.tradeModeChips .chip,
[data-trade-mode-legend] {
  font-size: 13px !important;
}
@media (max-width: 640px) {
  .filterChip,
  .tradeModeChips .chip {
    font-size: 14px !important;
    padding: 6px 10px !important;
  }
}

/* === Phase26 final readability override for candidate note bands === */
html[data-theme="dark"] .firstTradeCandidateCard .dataHealthNote,
html[data-theme="dark"] .firstTradeCandidateCard .uncertaintyNote,
html[data-theme="dark"] .firstTradeCandidateCard .candidateChangeNote,
body .firstTradeCandidateCard .dataHealthNote,
body .firstTradeCandidateCard .uncertaintyNote,
body .firstTradeCandidateCard .candidateChangeNote {
  color: #334155 !important;
  text-shadow: none !important;
}

html[data-theme="dark"] .firstTradeCandidateCard .dataHealthNote b,
html[data-theme="dark"] .firstTradeCandidateCard .uncertaintyNote b,
html[data-theme="dark"] .firstTradeCandidateCard .candidateChangeNote b,
body .firstTradeCandidateCard .dataHealthNote b,
body .firstTradeCandidateCard .uncertaintyNote b,
body .firstTradeCandidateCard .candidateChangeNote b {
  color: #0f172a !important;
  text-shadow: none !important;
}

html[data-theme="dark"] .firstTradeCandidateCard .dataHealthNote span,
html[data-theme="dark"] .firstTradeCandidateCard .uncertaintyNote span,
html[data-theme="dark"] .firstTradeCandidateCard .candidateChangeNote span,
body .firstTradeCandidateCard .dataHealthNote span,
body .firstTradeCandidateCard .uncertaintyNote span,
body .firstTradeCandidateCard .candidateChangeNote span {
  color: #334155 !important;
  text-shadow: none !important;
}

/* P4: pay item 4-state value badges */
.payrollDetailItemRow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  border: 1px solid #2d4262;
  border-radius: 6px;
  padding: 8px;
  margin: 6px 0;
  background: rgba(255, 255, 255, 0.02);
}
.payrollDetailItemHeader {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) minmax(112px, 1fr) minmax(120px, 1fr);
  gap: 6px;
}
.payrollDetailItemBody {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.payrollDetailItemBody label { display: grid; gap: 2px; font-size: 0.78rem; }
.payrollDetailItemBody input,
.payrollDetailItemBody select { width: 100%; }
.payrollValueStateBadge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid currentColor;
}
.payrollValueStateBadge[data-value-state="manual"] { color: #38bdf8; }
.payrollValueStateBadge[data-value-state="ocr"] { color: #fbbf24; background: rgba(251,191,36,0.08); }
.payrollValueStateBadge[data-value-state="ocr_corrected"] { color: #34d399; background: rgba(52,211,153,0.08); }
.payrollValueStateBadge[data-value-state="unread"] { color: #f87171; background: rgba(248,113,113,0.10); }
.payrollValueStateBadge[data-value-state="zero"] { color: #94a3b8; }
.payrollValueStateBadge[data-value-state="absent"] { color: #cbd5e1; background: rgba(203,213,225,0.08); }
.payrollDetailItemRow.sensitive {
  border-color: #f87171 !important;
  background: rgba(248,113,113,0.05);
}
.payrollSensitiveNote {
  grid-column: 1 / -1;
  color: #fecaca;
  background: rgba(248,113,113,0.10);
  border: 1px solid #f87171;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.82rem;
  margin: 4px 0;
}
.payrollReconciliationPanel { border-color: #1e3a5f; }
.payrollReconciliationGrid {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 6px 0;
}
.payrollReconciliationWarnings {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 4px;
}
.payrollReconciliationWarnings li {
  background: rgba(251,191,36,0.10);
  border: 1px solid #fbbf24;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.82rem;
  color: #fde68a;
}
.payrollSensitivePanel { border-color: #5b2424; }
.payrollSensitiveList {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 0.85rem;
  color: #fecaca;
  display: grid;
  gap: 2px;
}
@media (max-width: 720px) {
  .payrollDetailItemHeader { grid-template-columns: 1fr; }
  .payrollDetailItemBody { grid-template-columns: 1fr; }
}

/* P4-Q3: payroll candidate selection state */
.payrollCandidateRow {
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.payrollCandidateRow:hover { background: rgba(96, 165, 250, 0.10); }
.payrollCandidateRow:focus { outline: 2px solid #60a5fa; outline-offset: 2px; }
.payrollCandidateRow.payrollCandidateSelected {
  border: 2px solid #60a5fa !important;
  background: rgba(96, 165, 250, 0.18);
}
.payrollSelectedTag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #60a5fa;
  color: #0b1628;
  font-weight: 700;
  font-size: 0.72rem;
}

.payrollTestCount {
  color: #f97316;
  font-weight: 700;
}
.payrollDeletionPanel {
  border: 1px dashed #f97316;
  background: rgba(249, 115, 22, 0.05);
}
.payrollDeletionList {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}
.payrollDeletionItem {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(249, 115, 22, 0.25);
}
.payrollDeletionItem:last-child { border-bottom: none; }
.payrollDeletionItem .payrollDeletionName {
  display: block;
  font-weight: 700;
  color: #f97316;
}

/* P4-Q2: manual current price dialog */
.manualCurrentPriceDialog {
  border: 2px solid #38bdf8;
  background: rgba(56, 189, 248, 0.05);
}
.tradingStateBucketGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
}
.tradingStateBucketGrid span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.10);
  color: #0b1628;
  font-size: 0.78rem;
}
.tradingStateBucketGrid strong { color: #1d4ed8; }

.manualCurrentPriceActions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 6px 0;
}
.manualCurrentPriceActions .status { font-size: 0.78rem; }

/* Keep the device's explicit consent readable and adjacent to its checkbox. */
[data-push-device] label { display:flex;align-items:center;gap:10px;font-size:1rem;line-height:1.5;margin:12px 0; }
[data-push-device] input[type="checkbox"] { width:22px;height:22px;min-height:22px;flex:0 0 22px;margin:0; }

/* Rebuilt daily path: three usable destinations, without changing the legacy nav. */
.tabBar[hidden] { display:none !important; }
.tabBar[data-mode="daily"] { grid-template-columns:repeat(3,minmax(0,1fr)) !important; }
.tabBar[data-mode="daily"] button { min-height:48px !important; }
.tabBar[data-mode="daily"] button span { font-size:14px !important;line-height:1.4 !important; }
[data-schedule-checks] label { display:flex;align-items:center;gap:10px;line-height:1.5;margin:12px 0; }
[data-schedule-checks] label:has(input[type="date"]) { flex-direction:column;align-items:stretch; }
[data-schedule-checks] input[type="checkbox"] { width:22px;height:22px;min-height:22px;flex:0 0 22px;margin:0; }
[data-schedule-checks] button { min-height:44px; }
.financeRatioLayout { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;align-items:start; }
.financeRatioLayout > * { min-width:0;overflow-wrap:anywhere; }
.financeRatioLayout fieldset { border:1px solid #dce2e9;border-radius:6px;padding:12px;margin:0 0 12px;min-width:0; }
.financeRatioLayout legend { font-weight:600;padding:0 4px; }
.financeRatioLayout .productCheck { display:flex;align-items:flex-start;gap:8px; }
.financeRatioLayout input[type="checkbox"] { flex:0 0 auto; }
.financeRatioLayout dl { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin:16px 0; }
.financeRatioLayout dd { margin:0;text-align:right; }
.financeRatioLayout details { margin-top:16px; }
.financeRatioLayout small { overflow-wrap:anywhere; }
.financeThemeLayout { margin-top:16px; }
.financeThemeLayout details[data-theme-part] { border-bottom:1px solid #e0e5eb;padding-bottom:4px;margin-top:8px; }
.financeThemeLayout details[data-theme-part] > summary { font-weight:600;min-height:44px;cursor:pointer; }
.financeThemeLayout input:not([type="checkbox"]),.financeThemeLayout select { max-width:100%;min-width:0; }
.financeThemeLayout fieldset { margin-top:12px; }
.financeThemeLayout [data-theme-locked] { opacity:1;color:#455468;background:#f4f6f8; }
.financeThemeLayout [hidden] { display:none; }
[data-recheck-history-view] { min-width:0;overflow-wrap:anywhere; }
[data-recheck-history-view] summary { min-height:44px;padding:10px 0;cursor:pointer; }
[data-recheck-history-row] { border-bottom:1px solid #e0e5eb; }
.cashScenarioResults { width:100%;table-layout:fixed; }
.cashScenarioResults th,.cashScenarioResults td { overflow-wrap:anywhere;white-space:normal; }
.cashScenarioResults small { display:block;font-weight:400; }
[data-cash-scenarios] summary { min-height:44px;padding:10px 0;cursor:pointer; }
[data-cash-scenarios] .financeFields { gap:12px; }
[data-scenario-income] { border-bottom:1px solid #e0e5eb;padding:8px 0; }
[data-scenario-income-label] { grid-column:1/-1; }
@media(max-width:700px) { .financeRatioLayout { grid-template-columns:minmax(0,1fr);gap:20px; } }
:root.sessionLocked #app,
:root.sessionLocked .tabBar { display: none !important; }
[data-session-cover] { min-height: 100dvh; background: #f6f7f9; color: #182331; padding: 24px; }
[data-session-cover] .panel { max-width: 560px; margin: 12vh auto 0; background: white; }
[data-session-cover] button { margin: 8px 8px 0 0; }
.authPanel .authRemember { display:flex; align-items:center; gap:10px; font-size:16px; min-height:44px; }
.authPanel .authRemember input { width:22px; min-width:22px; height:22px; min-height:22px; margin:0; padding:0; }
