/* Warm tool surfaces. Load after each tool's existing styles.
   Paint only, except the neutral pre-coefficient note's compact typography/padding
   and restoring opacity on cube cards whose enable checkbox remains interactive.
   No table/layout, input behavior or visibility changes.
   V4 result lanes/graphs are owned by calcv4/ui-v2.css. Character images,
   rarity tokens, rank medals and their category colors retain their own rules. */
body.ui-maple-tools {
  --sl-bg: var(--maple-page);
  --sl-panel: var(--maple-surface);
  --sl-panel-2: var(--maple-panel);
  --sl-panel-3: #fffdf7;
  --sl-line: var(--maple-line);
  --sl-line-strong: #b78d58;
  --sl-text: var(--maple-text);
  --sl-muted: var(--maple-muted);
  --sl-muted-2: #6d5944;
  --sl-cyan: #356b74;
  --sl-mint: var(--maple-positive);
  --sl-gold: #8b5d16;
  --sl-red: #a33f37;
  --ec-bg: var(--maple-page);
  --ec-panel: var(--maple-surface);
  --ec-panel-2: var(--maple-panel);
  --ec-panel-3: #fffdf7;
  --ec-line: var(--maple-line);
  --ec-line-strong: #b78d58;
  --ec-text: var(--maple-text);
  --ec-muted: var(--maple-muted);
  --ec-muted-2: #6d5944;
  --ec-cyan: #356b74;
  --ec-mint: var(--maple-positive);
  --ec-gold: #8b5d16;
  --ec-red: #a33f37;
}
body.ui-maple-tools .profile-wizard-eyebrow { color: var(--maple-accent); }

/* Summon level calculator. Current/target rows remain distinct. */
body.ui-maple-tools :is(.summonTabs,.summonKpi) { background: var(--maple-surface); border-color: var(--maple-line); color: var(--maple-text); }
body.ui-maple-tools :is(.summonField>span,.summonForm__note,.summonKpi>span,.summonKpi>small) { color: var(--maple-muted); }
body.ui-maple-tools .summonNotice { background: #edf2df; border-color: #a7b789; }
body.ui-maple-tools .summonNotice strong { color: var(--maple-positive); }
body.ui-maple-tools .summonNotice span { color: #5f6b44; }
body.ui-maple-tools .summonNotice__badge { background: #fff7df; border-color: #c3a169; color: #7a5524 !important; }
body.ui-maple-tools .summonTabs button[aria-selected="true"] { color: var(--maple-accent); border-color: #c69c69; background: #ffedcb; box-shadow: inset 0 2px #d3974c; }
body.ui-maple-tools .summonTabs button[aria-selected="true"] small { color: #8a6436; }
body.ui-maple-tools :is(.summonTypePill, .summonSourcePill) { background: #eef2e4; border-color: #acb792; }
body.ui-maple-tools .summonSourcePill { background: #edf3ef; border-color: #a4b9ab; }
body.ui-maple-tools .summonField :is(input, select) { background-color: #fffdf7; color: var(--maple-text); border-color: var(--maple-line); }
body.ui-maple-tools .summonField :is(input, select):focus { box-shadow: 0 0 0 3px #a7793c1a; }
body.ui-maple-tools .summonForm__note { border-color: var(--maple-line); }
body.ui-maple-tools .summonForm__error { background: #fff0e8; color: #953d32; border-color: #c8957f; }
body.ui-maple-tools .summonKpi--hero { background: linear-gradient(#fff8e5, #f5e5bf); border-color: #c49b61; box-shadow: inset 0 2px #fff, 0 2px #ddc49a; }
body.ui-maple-tools .summonKpi > strong { color: var(--maple-text); }
body.ui-maple-tools .summonKpi--hero > strong { color: var(--maple-positive); }
body.ui-maple-tools .summonTable :is(th, td) { border-color: #e1d2b8; }
body.ui-maple-tools .summonTable th { background: var(--maple-panel); color: var(--maple-muted); }
body.ui-maple-tools .summonTable td { color: var(--maple-text); }
body.ui-maple-tools .summonTable tbody tr:nth-child(even) { background: #faf2e2; }
body.ui-maple-tools .summonTable tbody tr:hover { background: #f1e4c9; }
body.ui-maple-tools .summonTable tbody tr.is-selected { background: #edf1dd; }
body.ui-maple-tools .summonTable tbody tr.is-target { background: #e4edcf; }
body.ui-maple-tools .summonTable__badge { background: #d6e9be; color: #365c27; }
body.ui-maple-tools .summonTable__badge--current { background: #f8df9d; color: #735017; }
body.ui-maple-tools :is(.summonTable__muted, .summonTable__loading, .summonSource) { color: var(--maple-muted) !important; }
body.ui-maple-tools .summonInfoBody { color: var(--maple-text); }
body.ui-maple-tools .summonInfoBody strong { color: var(--maple-text); }
body.ui-maple-tools .summonInfoBody [data-method-note] { color: #526047; background: #eef1df; }

/* Cube / star-force. The off card's enable checkbox remains an active control. */
body.ui-maple-tools :is(.ec-tabs, .ec-segment, .ec-mode, .ec-target, .ec-tier-mode button, .ec-option-check, .ec-table-scroll, .ec-protect, .ec-source-item, .ec-source-notes p) { background: var(--maple-surface); border-color: var(--maple-line); color: var(--maple-text); }
body.ui-maple-tools :is(.ec-tab.active, .ec-segment button.active, .ec-mode button.active, .ec-tier-mode button.active) { background: #ffedcb; border-color: #c69c69; color: var(--maple-accent); box-shadow: inset 0 2px #d3974c; }
body.ui-maple-tools .ec-tab.active small { color: #8a6436; }
body.ui-maple-tools .ec-target:not(.off) { background: linear-gradient(#fff9e9, #faf0da); border-color: #c49b61; box-shadow: inset 0 2px #e7c487, 0 2px #ddc49a; }
body.ui-maple-tools .ec-target.off { opacity: 1; background: #f1e9da; border-color: #c5b89f; color: var(--maple-muted); }
body.ui-maple-tools .ec-target-no { background: #f2dfba; color: #7b5426; }
body.ui-maple-tools :is(.ec-field > span, .ec-option-group > strong, .ec-plan-wait, .ec-plan-cell summary, .ec-plan-breakdown, .ec-source-item code) { color: var(--maple-muted); }
body.ui-maple-tools .ec-select { background-color: #fffdf7; color: var(--maple-text); border-color: var(--maple-line); }
body.ui-maple-tools .ec-status { background: #edf2df; border-color: #a7b789; }
body.ui-maple-tools :is(.ec-option-check.selected, .ec-protect.on) { background: #e9f0d9; border-color: #9caf7b; }
body.ui-maple-tools :is(.ec-option-check b, .ec-basis strong, .ec-source-item strong) { color: var(--maple-text); }
body.ui-maple-tools :is(.ec-metric, .ec-metric.primary) { background: linear-gradient(#fffdf5, #f9edcf); border-color: #c9ab7b; box-shadow: inset 0 1px #fff, 0 2px #ddc49a; }
body.ui-maple-tools .ec-metric strong { color: var(--maple-text); }
body.ui-maple-tools .ec-metric.primary strong { color: var(--maple-positive); }
body.ui-maple-tools .ec-risk-metric { background: #fff8e9; }
body.ui-maple-tools .ec-risk-metric.destroy { background: #fff0e8; border-color: #c8957f; }
body.ui-maple-tools .ec-risk-metric.destroy strong { color: #963e32; }
body.ui-maple-tools .ec-risk-metric.down strong { color: #8c5c1f; }
body.ui-maple-tools .ec-star-summary .ec-card-body { background: #fffaf0; }
body.ui-maple-tools .enhanceCalc th { background: var(--maple-panel); color: var(--maple-muted); }
body.ui-maple-tools .enhanceCalc td { color: var(--maple-text); border-color: #e1d2b8; }
body.ui-maple-tools .enhanceCalc tbody tr:hover td { background: #f5ead5; }
body.ui-maple-tools .ec-plan-table tr.expected td { background: #f6ecd6; }
body.ui-maple-tools .ec-milestone-table tbody tr.selected { background: #e9f0d9; }
body.ui-maple-tools .ec-stage-table .changed { background: #edf2df; color: var(--maple-positive); }
body.ui-maple-tools .ec-preset button { background: #f8eacd; color: #765329; }
body.ui-maple-tools .ec-switch { background: #e5d6b9; border-color: #b9a07c; }
body.ui-maple-tools .ec-switch::after { background: #8e7b5e; }
body.ui-maple-tools .ec-protect.on .ec-switch { background: #dce9c8; }
body.ui-maple-tools .ec-warning { background: #fff2d1; border-color: #c6a46a; color: #80581f; }
body.ui-maple-tools .ec-mystic-warning { background: linear-gradient(#fff5d6, #f7e4b6); border-color: #bb8e40; box-shadow: inset 0 2px #fffaf0, 0 3px #ddc18a; }
body.ui-maple-tools .ec-mystic-warning span { background: #f3dda2; color: #80581f; }
body.ui-maple-tools .ec-mystic-warning strong { color: #79511a; }
body.ui-maple-tools .ec-mystic-warning p { color: #836436; }
body.ui-maple-tools :is(.ec-validation, .ec-error) { background: #fff0e8; color: #953d32; border-color: #c8957f; }
body.ui-maple-tools .ec-impossible { color: #953d32; }

/* Attack-speed / penetration: keep the two stat colors distinct. */
body.ui-maple-tools .dualStatGrid :is(.sideTitle, .explainBox, .example, .inputBox, .resultCard, .formula, .trace) { background: var(--maple-surface); border-color: var(--maple-line); color: var(--maple-text); }
body.ui-maple-tools .dualStatGrid :is(.sideTitle, .cardHead) { background: var(--maple-panel); }
body.ui-maple-tools .dualStatGrid :is(.explainBox p, .inputBox label, .optionHead, .optionNo, .resultLabel, .resultSub, .trace, .notice) { color: var(--maple-muted); }
body.ui-maple-tools .dualStatGrid .example b { color: var(--maple-text); }
body.ui-maple-tools .dualStatGrid .example strong { color: #8b5c1e; }
body.ui-maple-tools .dualStatGrid .easyNote { background: #fff2d1; color: #785d30; }
body.ui-maple-tools .dualStatGrid .resultCard { background: linear-gradient(#fffdf5, #f9edcf); box-shadow: inset 0 1px #fff, 0 2px #ddc49a; }
body.ui-maple-tools :is(.valueSpeed, .resultValue.speed, .speedSide .sideTitle span) { color: #326974; }
body.ui-maple-tools :is(.valuePierce, .resultValue.pierce, .pierceSide .sideTitle span) { color: var(--maple-positive); }
body.ui-maple-tools .dualStatGrid .explainLabel { color: var(--maple-accent); }
body.ui-maple-tools .dualStatGrid .statColumn.speedSide { border-color: var(--maple-line); }
body.ui-maple-tools .dualStatGrid .tableWrap :is(th, td) { border-color: #e1d2b8; }
body.ui-maple-tools .dualStatGrid .removeBtn { color: #855d47; background: #f6e9d4; border-color: #c4a680; }
body.ui-maple-tools .dualStatGrid .removeBtn:hover { color: #923b2e; border-color: #bb7860; }
body.ui-maple-tools .dualStatGrid .addBtn { color: #76502a; background: #f8e3ba; border-color: #bd9862; }

/* Calculator base sheets and static result cards. V4 result descendants are excluded. */
body.ui-maple-tools :is(.wire-column, .wire-card, .manual-track, .artifact-lab, .artifact-slot, .companion-note, .damage-node, .damage-base-lock, .damage-base-value, .base-factor, .damage-result, .damage-defense-control, .damage-breakdown, .damage-loadout-summary, .efficiency-damage-strip, .efficiency-damage-card, .manual-scenario-group, .manual-scenario-card) { background: var(--maple-surface); border-color: var(--maple-line); color: var(--maple-text); }
body.ui-maple-tools .damage-tree-panel:not([aria-labelledby="v4ValidationTitle"]) { background: linear-gradient(#fff9e9, #f5e8ce); border-color: var(--maple-line); box-shadow: 0 3px #dac39e; }
body.ui-maple-tools .damage-tree-panel:not([aria-labelledby="v4ValidationTitle"])::before { background: radial-gradient(circle at 18% 0, #f4dcad55, transparent 28rem); }
body.ui-maple-tools :is(.baseline-summary-card, .game-stat-column, .game-stat-sheet, .game-stat-profile-card, .game-stat-loadout-card, .game-stat-utility .status-box, .game-stat-utility .readout) { background: var(--maple-surface) !important; color: var(--maple-text); border-color: var(--maple-line) !important; }
body.ui-maple-tools :is(.wire-card-head, .manual-head, .game-stat-head, .game-stat-foot, .game-stat-utility, .damage-loadout-summary .game-stat-loadout-head, .manual-scenario-group > header) { background: var(--maple-panel); color: var(--maple-text); border-color: var(--maple-line); }
body.ui-maple-tools :is(.game-stat-head h2, .game-stat-profile-name, .game-stat-loadout-head strong, .wire-card-head strong, .manual-head strong, .baseline-summary-grid strong, .damage-node strong, .damage-base-value > strong, .base-factor > strong, .damage-result-title strong, .damage-condition-bar strong) { color: var(--maple-text); }
body.ui-maple-tools :is(.game-stat-head small, .game-stat-head > span, .game-stat-utility .status-box small, .game-stat-profile-state > span, .baseline-summary-grid > div, .companion-summary) { color: var(--maple-muted); }
body.ui-maple-tools :is(.baseline-summary-grid > div, .game-stat-profile-state > span, .game-stat-profile-card .baseline-summary-badge, .game-stat-artifact, .damage-loadout-summary .game-stat-artifact, .companion-summary) { background: #fbf2e0; border-color: var(--maple-line); }
body.ui-maple-tools .game-stat-artifact:not([class*="grade-"]) > b { background: #eddfc2; color: #75532e; }
body.ui-maple-tools :is(.damage-node.is-affected, .damage-base-lock.is-affected, .baseline-summary-badge.ready, .game-stat-profile-card .baseline-summary-badge.ready) { background: #edf2df; border-color: #a3b581 !important; color: var(--maple-positive); }
body.ui-maple-tools :is(.damage-node .node-delta, .damage-base-value .node-delta, .damage-output small, .manual-scenario-impact .pct, .efficiency-damage-route .pct) { background: #efe3ca; color: var(--maple-muted); }
body.ui-maple-tools :is(.damage-node .node-delta.positive, .damage-base-value .node-delta.positive, .damage-output small.positive, .manual-scenario-impact .pct.positive, .damage-range-values small.positive) { background: #e8f0d7; color: var(--maple-positive); }
body.ui-maple-tools :is(.damage-node .node-delta.negative, .damage-base-value .node-delta.negative, .damage-output small.negative, .manual-scenario-impact .pct.negative, .damage-range-values small.negative) { background: #fff0e8; color: #963e32; }
body.ui-maple-tools .base-factor.is-adjusted { background: #fff2d3; border-color: #c4a167; }
body.ui-maple-tools .base-factor.is-adjusted > span { color: #81591d; }
body.ui-maple-tools :is(.damage-split-label, .damage-condition-bar) { background: #f1e7f1; border-color: #c0a3c5; color: #745078; }
body.ui-maple-tools .defense-options button { background: #fff9eb; color: var(--maple-muted); }
body.ui-maple-tools .defense-options button.selected { background: #ffedcb; border-color: #b88443; color: var(--maple-accent); box-shadow: inset 0 -2px #c18b42; }
body.ui-maple-tools .defense-options button:hover:not(.selected) { color: var(--maple-accent); border-color: #b88443; }
body.ui-maple-tools .damage-defense-control > div:first-child span { color: var(--maple-muted); }
body.ui-maple-tools :is(#profileReadout, #profileReferenceReadout) .stat-card { background: var(--maple-surface); color: var(--maple-text); border-color: #e1d2b8 !important; }
body.ui-maple-tools :is(#profileReadout, #profileReferenceReadout) .game-stat-section-row { background: var(--maple-panel); color: var(--maple-text); border-color: var(--maple-line); }
body.ui-maple-tools :is(#profileReadout, #profileReferenceReadout) :is(.stat-card strong, .stat-name, .stat-value) { color: var(--maple-text); }
body.ui-maple-tools :is(#profileReadout, #profileReferenceReadout) .stat-card.is-changed { background: #edf2df; }
body.ui-maple-tools :is(#profileReadout, #profileReferenceReadout) .stat-state.change { background: #deebc7; color: var(--maple-positive); }
body.ui-maple-tools :is(#profileReadout, #profileReferenceReadout) .info-btn { background: #fff9e9; color: #86613a; border-color: var(--maple-line); }

/* Efficiency table surfaces; rank treatment is owned by stat-efficiency.css. */
body.ui-maple-tools #manualPane :is(.eff-input-guide, .eff-table-column, .manual-boundary) { background: var(--maple-surface); border-color: var(--maple-line); color: var(--maple-text); }
body.ui-maple-tools #manualPane :is(.eff-input-guide b, .eff-source-preview b) { color: var(--maple-text); }
body.ui-maple-tools #manualPane .manual-boundary > summary { color: var(--maple-text); }
body.ui-maple-tools #clearManual.btn.ghost { color: var(--maple-muted); }
body.ui-maple-tools #manualPane .scenario-eff-table :is(.stat-cell, .stat-name, .unit-eff-cell strong) { color: var(--maple-text); }
body.ui-maple-tools #manualPane .scenario-eff-table tbody tr:not(.eff-top-ranked) > td { background: var(--maple-surface); border-color: #e1d2b8; }
body.ui-maple-tools #manualPane .scenario-eff-table tbody tr:not(.eff-top-ranked):hover > td { background: #f8ecd6; }
body.ui-maple-tools #manualPane .scenario-eff-table .excluded-row:not(.eff-top-ranked) > td { background: #f4edde; }
body.ui-maple-tools #manualPane .scenario-eff-table .dps-only-row:not(.eff-top-ranked) > td { background: #fbf4e6; }
body.ui-maple-tools #manualPane :is(.unit-eff-cell.pending strong, .unit-eff-cell.neutral strong, .unit-eff-cell.excluded strong, .unit-eff-cell.dps-only strong) { color: var(--maple-muted); }
body.ui-maple-tools #manualPane .unit-eff-cell.positive strong { color: var(--maple-positive); }
body.ui-maple-tools #manualPane .unit-eff-cell.negative strong { color: #963e32; }
body.ui-maple-tools #manualPane :is(.info-btn, .table-preset) { background: #fff4dc; color: #805a2c; border-color: #c7ab80; }
body.ui-maple-tools #manualPane .table-preset:hover { background: #f8e7c3; border-color: #b68a50; }
body.ui-maple-tools #manualPane .table-preset:disabled { background: #f0e9db; border-color: #d1c2aa; color: var(--maple-muted); }
body.ui-maple-tools #manualPane .eff-input input:focus { border-color: #9b784b; box-shadow: 0 0 0 3px #b7976526; }
body.ui-maple-tools #manualPane :is(.eff-source-note, .eff-source-preview, .eff-source-preview small, .eff-rank-guide, .eff-column-title span, .eff-group-row small, .eff-input span) { color: var(--maple-muted); }
body.ui-maple-tools #manualPane .eff-rank-guide strong { color: #8a5a17; }
body.ui-maple-tools #manualPane :is(.eff-column-title, .scenario-eff-table thead th, .scenario-eff-table .eff-group-row th) { background: var(--maple-panel) !important; color: var(--maple-text) !important; border-color: var(--maple-line); }
body.ui-maple-tools #manualPane .eff-column-title.coverage-static { color: var(--maple-positive) !important; }
body.ui-maple-tools #manualPane .eff-column-title.coverage-conditional { color: var(--maple-accent) !important; }
body.ui-maple-tools #manualPane .eff-compact-row:focus-within { background: #f5e6c9; }

/* Photo/manual onboarding and compare dialogs. Existing art/rarity tokens are not recolored. */
body.ui-maple-tools :is(.profile-wizard-shell, .preset-recovery-card, .profile-edit-choice-card, .item-efficiency-shell, .v4i-dialog) { color-scheme: light; background: var(--maple-surface); color: var(--maple-text); border-color: var(--maple-line); box-shadow: inset 0 1px #fff, 0 5px #cbb08a, 0 22px 70px #5c402b38; }
body.ui-maple-tools :is(.profile-wizard, .preset-recovery-dialog, .profile-edit-choice-dialog, .item-efficiency-dialog, .v4i-dialog)::backdrop { background: #49352499; }
body.ui-maple-tools :is(.profile-wizard-foot, .item-efficiency-head, .item-efficiency-foot, .wizard-manual-head, .wizard-manual-group[open] > summary, .v4i-header, .v4i-footer, .v4i-tabs, .v4i-notice) { background: var(--maple-panel); color: var(--maple-text); border-color: var(--maple-line); }
body.ui-maple-tools :is(.profile-wizard-close, .profile-edit-choice-close, .item-efficiency-close, .wizard-slot-clear, .wizard-photo-edit, .v4i-close) { background: #f3e4c8; color: #805a34; border-color: #bea17c; }
body.ui-maple-tools :is(.wizard-preset-restore, .wizard-level-entry, .wizard-choice-panel, .wizard-equipped-column, .wizard-artifact-inventory-wrap, .wizard-artifact-editor, .wizard-companion-catalog, .wizard-companion-current, .wizard-companion-control, .wizard-preset-route, .wizard-companion-guide, .wizard-manual-group, .wizard-manual-note, .item-efficiency-input, .item-efficiency-summary, .item-efficiency-sample, .v4i-upload, .v4i-card, .v4i-context, .v4i-details, .v4i-sample, .v4i-empty, .v4i-companion-section, .v4i-skill-editor) { background: #fcf4e4; color: var(--maple-text); border-color: var(--maple-line); }
body.ui-maple-tools :is(.preset-recovery-code, .wizard-level-entry > .wizard-level-field, .wizard-manual-input, .wizard-manual-progress, .wizard-manual-field, .wizard-level-card, .wizard-equipped-slot, .wizard-artifact-slot-card, .wizard-artifact-slot-main, .wizard-input-method-card, .wizard-input-method-card.manual, .item-efficiency-photo, .item-efficiency-delta, .item-efficiency-ocr-debug pre, #v4DefenseReview .v4i-field) { background: #fffdf7; color: var(--maple-text); border-color: var(--maple-line); }
body.ui-maple-tools :is(.wizard-grade-card, .wizard-artifact-card) { background: #fff8eb; color: var(--maple-text); }
body.ui-maple-tools :is(.wizard-grade-card:hover, .wizard-grade-card.selected, .wizard-level-card:hover, .wizard-level-card.selected) { background: #fff0cf; box-shadow: 0 0 0 2px #b98c4a55; }
body.ui-maple-tools .wizard-job-name strong { color: #fff; }
body.ui-maple-tools .wizard-artifact-card em { background: #e4edcf; color: #3e622e; }
body.ui-maple-tools .wizard-star-button { background: #fff8e5; color: #8f651c; }
body.ui-maple-tools .wizard-star-button.selected { background: #ffe6aa; border-color: #be8b2d; }
body.ui-maple-tools :is(.wizard-preset-guide, .wizard-ready-gate, .wizard-ocr-correction) { background: #fff2d6; border-color: #c7a264; color: #805b28; }
body.ui-maple-tools .wizard-ocr-feedback { background: #fcf4e4; color: var(--maple-text); border-color: var(--maple-line); }
body.ui-maple-tools :is(.wizard-manual-field.ocr-review, .wizard-manual-field.ocr-recommended, .v4i-warning) { background: #fff2d6; border-color: #c7a264; color: #805b28; }
body.ui-maple-tools #profileWizard .wizard-manual-field.ocr-missing { background: #fff0ef; border-color: #b32932; }
body.ui-maple-tools :is(.wizard-manual-field.ocr-edited, .wizard-manual-field.ocr-read) { background: #edf2df; border-color: #a8b98b; }
body.ui-maple-tools :is(.wizard-manual-field > span:first-child small.required, .wizard-manual-field > span:first-child small.ocr-review, .wizard-manual-field > span:first-child small.ocr-recommended) { background: #f9e1a9; color: #80591b; }
body.ui-maple-tools #profileWizard .wizard-manual-field > span:first-child small.ocr-missing { background: #a62530; color: #fffaf4; }
body.ui-maple-tools :is(.wizard-manual-field > span:first-child small.ocr-read, .wizard-manual-field > span:first-child small.ocr-edited) { background: #e0eac8; color: var(--maple-positive); }
body.ui-maple-tools .wizard-manual-field > span:first-child small.optional { background: #eee3cc; color: var(--maple-muted); }
body.ui-maple-tools :is(.wizard-manual-field > span:first-child, .wizard-artifact-card strong, .wizard-section-label > strong, .wizard-companion-guide strong, .wizard-manual-group > summary, .wizard-input-method-card strong, .wizard-input-method-card.manual strong, .preset-recovery-card h2, .profile-edit-choice-card h2, .item-efficiency-head h2, .item-efficiency-photo-head strong, .v4i-header h2, .v4i-card h3, .v4i-card h4, .v4i-context strong, .v4i-details > summary, .v4i-upload strong, .v4i-ready strong, .v4i-sample > h3, .v4i-field, .v4i-check) { color: var(--maple-text); }
body.ui-maple-tools :is(.wizard-artifact-card small, .wizard-section-label > span, .wizard-manual-head p, .wizard-manual-note, .wizard-manual-field small, .wizard-preset-guide p, .wizard-preset-route, .wizard-level-copy > p, .preset-recovery-card p, .profile-edit-choice-card p, .item-efficiency-head p, .item-efficiency-photo-meta, .item-efficiency-review p, .v4i-header p, .v4i-header small, .v4i-footer > span, .v4i-field small, .v4i-help, .v4i-upload span, .v4i-upload > small, .v4i-equipped-label, .v4i-ready p, #v4DefenseReview small) { color: var(--maple-muted); }
body.ui-maple-tools :is(.wizard-level-entry kbd, .wizard-preset-guide kbd, .wizard-level-copy > span) { background: #eeddb9; color: #78552a; }
body.ui-maple-tools :is(.profile-edit-choice-grid > button, .preset-recovery-code button, .preset-recovery-confirm, .preset-restore-edit, .wizard-preset-restore button, .v4i-small, .v4i-secondary, .v4i-readout-edit, .v4-input-open) { background: #f8e8c8; color: #77512b; border-color: #bc9664; }
body.ui-maple-tools :is(.profile-edit-choice-grid > button:hover, .v4i-upload-actions > button:hover:not(:disabled)) { background: #ffedcb; color: var(--maple-accent); }
body.ui-maple-tools :is(.v4i-primary, .v4i-file-button, .v4i-ready > button, .game-stat-profile-card .btn.primary, .v4-comparison-actions #v4PromoteBaseline) { background: linear-gradient(#ffd28a, #f3ad57); color: #653514; border-color: #bb823c; }
body.ui-maple-tools .v4i-ready > button:hover:not(:disabled) { background: #ffcb79; }
body.ui-maple-tools .v4i-tabs button { color: var(--maple-muted); }
body.ui-maple-tools .v4i-tabs button[aria-selected="true"] { color: var(--maple-accent); background: #ffedcb; border-color: #c69c69; }
body.ui-maple-tools :is(.v4i-upload:focus-within, .v4i-upload:focus, .v4i-upload.is-armed) { background: #eef2df; border-color: #9bad7b; }
body.ui-maple-tools :is(.v4i-upload-surface:hover, .v4i-upload-surface:focus-visible, .v4i-upload.is-dragging .v4i-upload-surface, .v4i-upload .v4i-armed-state) { background: #e7efcf; color: var(--maple-positive); }
body.ui-maple-tools :is(.item-efficiency-photo[data-state="error"], .v4i-error) { background: #fff0ef; color: #8c202b; border-color: #b32932; box-shadow: inset 4px 0 #b32932; }
body.ui-maple-tools .item-efficiency-photo[data-state="error"] :is(.item-efficiency-photo-head span, .item-efficiency-photo-meta) { color: #953d32; }
body.ui-maple-tools .item-efficiency-photo[data-state="working"] { border-color: #ab8d52; }
body.ui-maple-tools .item-efficiency-photo[data-state="working"] .item-efficiency-photo-head span { color: #815e2c; }
body.ui-maple-tools .item-efficiency-delta.up { background: #edf2df; color: var(--maple-positive); }
body.ui-maple-tools .item-efficiency-delta.down { background: #fff0e8; color: #953d32; }
body.ui-maple-tools .item-efficiency-remove { background: #fff1dc; border-color: #c0976d; color: #8a4b30; }
body.ui-maple-tools :is(.item-efficiency-remove:hover, .item-efficiency-remove:focus-visible) { background: #f5d5c3; color: #913c31; }
body.ui-maple-tools .v4i-danger { color: #9b4237; border-color: #c8957f; }
body.ui-maple-tools :is(.wizard-level-copy label, .wizard-input-method-card > b, .v4i-overview-row > h3, .game-stat-profile-main strong, .game-stat-profile-state strong, .v4i-companion-cell h3) { color: var(--maple-text); }
body.ui-maple-tools :is(.wizard-input-method-card > p, .v4i-overview-meta, .game-stat-profile-main small, .v4i-companion-portrait > b, .v4i-icon-slot > small, .v4i-icon-slot > span:last-child, .v4i-skill-toolbar, .v4i-drop-hint, .v4i-sample p) { color: var(--maple-muted); }
body.ui-maple-tools :is(.wizard-choice-panel > span, .v4i-skill-page > h3, .v4i-sample > summary, .wizard-input-method-card.manual > span) { color: var(--maple-purple, #755098); }
body.ui-maple-tools .wizard-input-method-card > span { color: var(--maple-accent); }
body.ui-maple-tools #profilePhotos :is(.photo-card, .photo-meta) { background: var(--maple-panel); color: var(--maple-text); border-color: var(--maple-line); }
body.ui-maple-tools :is(.wire-wrap, .profile-wizard, .item-efficiency-dialog) .btn { background: #f8e8c8; color: #77512b; border-color: #bc9664; }
body.ui-maple-tools :is(.wire-wrap, .profile-wizard, .item-efficiency-dialog) .btn.primary { background: linear-gradient(#ffd28a, #f3ad57); color: #653514; border-color: #bb823c; }
body.ui-maple-tools :is(.wire-wrap, .profile-wizard, .item-efficiency-dialog) .btn.gold { background: #ffe4a3; color: #785119; border-color: #c89c44; }
body.ui-maple-tools :is(.wire-wrap, .profile-wizard, .item-efficiency-dialog) .btn.violet { background: #eee1f3; color: #715184; border-color: #ba9cc8; }
body.ui-maple-tools :is(.wire-wrap, .profile-wizard, .item-efficiency-dialog) .btn:hover:not(:disabled) { box-shadow: inset 0 0 0 1px #a97a3d55; }
body.ui-maple-tools :is(.wire-wrap, .profile-wizard) .tooltip { background: #fff7e5; color: var(--maple-text); border-color: #bea06b; box-shadow: 0 9px 24px #72512a33; }
body.ui-maple-tools :is(.wire-wrap, .profile-wizard) .tooltip::after { border-top-color: #fff7e5; }
body.ui-maple-tools :is(.wire-wrap, .profile-wizard) .tooltip p { color: var(--maple-muted); }
body.ui-maple-tools .wire-wrap .dropzone kbd { background: #f0e1c3; color: #785a35; }
/* Required to beat legacy input !important rules; opacity/disabled behavior stays native. */
body.ui-maple-tools :is(.summonField, .v4i-dialog, #v4DefenseReview) input[aria-invalid="true"],
body.ui-maple-tools .wizard-manual-input input.invalid { border-color: #b0523d !important; background-color: #fff0e8 !important; box-shadow: 0 0 0 1px #b0523d; }

/* V4 preset ribbons and editor cards only; no result/graph/timeline selectors. */
body.ui-maple-tools :is(.v4-loadout-band, .v4i-artifact-tile, .v4i-preset-switch button, .v4i-icon-slot, .v4i-skill-choices button, .v4-comparison-bar, .v4-rebase-progress) { background: var(--maple-surface); border-color: var(--maple-line); color: var(--maple-text); }
body.ui-maple-tools .v4-comparison-bar small { color: var(--maple-muted); }
/* Companion grade-specific borders must remain visible on the lighter card. */
body.ui-maple-tools .v4i-companion-cell { background: var(--maple-surface); color: var(--maple-text); }
body.ui-maple-tools .v4i-artifact-icon { background: #f3e4c8; color: var(--maple-muted); }
body.ui-maple-tools :is(.v4-loadout-band > header, .v4-loadout-band > .v4-loadout-actions, .v4i-overview-companions > div, .v4i-readout-pair article, .v4i-readout-companions > div) { background: var(--maple-panel); color: var(--maple-text); border-color: var(--maple-line); }
body.ui-maple-tools :is(.v4-loadout-actions > button, .v4i-overview-meta button, .v4i-skill-readout-head button, .v4-comparison-bar button) { background: #f8e8c8; color: #77512b; border-color: #bc9664; }
body.ui-maple-tools .v4-loadout-actions > button:hover { background: #ffedcb; color: var(--maple-accent); }
body.ui-maple-tools :is(.v4i-companion-cell:first-child, .v4i-overview-companions > div:first-child, .v4i-preset-switch button[aria-pressed="true"], .v4i-artifact-tile[aria-pressed="true"], .v4i-skill-choices button[aria-pressed="true"], .v4i-icon-slot.is-selected, .v4i-baseline-badge) { background: #e8efda; color: var(--maple-positive); border-color: #9caf7c; }
body.ui-maple-tools :is(.v4i-overview-companions strong, .v4i-overview-pair strong, .v4i-overview-artifacts strong, .v4i-readout h3, .v4i-readout-pair article > strong, .v4i-readout-companions strong, .v4i-companion-cell h4, .v4i-artifact-tile strong, .v4i-skill-readout-head h3, .v4i-skill-readout-head strong, .v4i-icon-slot strong) { color: var(--maple-text); }
body.ui-maple-tools :is(.v4i-overview-companions small, .v4i-overview-companions span, .v4i-overview-pair small, .v4i-overview-pair em, .v4i-overview-artifacts small, .v4i-overview-artifacts em, .v4i-readout-meta, .v4i-readout-pair article > small, .v4i-readout-pair article > span, .v4i-readout-companions small, .v4i-readout-companions span, .v4i-companion-cell label, .v4i-artifact-tile small) { color: var(--maple-muted); }
body.ui-maple-tools .v4i-readout-options li { color: var(--maple-text); border-color: #e1d2b8; }
body.ui-maple-tools .v4i-readout-options strong { color: var(--maple-positive); }
body.ui-maple-tools .v4i-readout-options small { color: var(--maple-muted); }

/* V4 baseline/readout copy: explicit leaves also cover the legacy ID rules.
   Color-only rules do not reveal sections or change visually hidden notes. */
body.ui-maple-tools :is(.game-stat-empty strong, .skill-profile-identity strong) { color: var(--maple-text) !important; }
body.ui-maple-tools :is(.game-stat-empty span, .game-stat-utility > summary, .v4-duration-note, .base-factor > small, .damage-node-kicker > span, .damage-condition-bar > span) { color: var(--maple-muted) !important; }
body.ui-maple-tools .baseline-summary-badge { color: var(--maple-muted) !important; }
body.ui-maple-tools .baseline-summary-badge.ready { color: var(--maple-positive) !important; }
body.ui-maple-tools .skill-profile-identity { background: var(--maple-surface); border-color: var(--maple-line); }
body.ui-maple-tools #skillDamagePanel :is(.skill-base-summary, .skill-base-summary-card) { background: var(--maple-surface); border-color: var(--maple-line); }
body.ui-maple-tools #skillDamagePanel .skill-base-summary-card.common { background: #edf2df; border-color: #a3b581; }
body.ui-maple-tools #skillDamagePanel :is(.skill-base-summary-head h3, .skill-base-summary-note strong, .skill-pre-values > strong) { color: var(--maple-text) !important; }
body.ui-maple-tools #skillDamagePanel :is(.skill-base-summary-note, .skill-base-summary-card > p, .skill-pre-metric > small, .skill-pre-values > span, .skill-pre-values > i) { color: var(--maple-muted) !important; }
body.ui-maple-tools #skillDamagePanel .skill-base-summary-card h4 { color: var(--maple-accent) !important; }
body.ui-maple-tools #skillDamagePanel .skill-base-summary-card.common h4 { color: var(--maple-positive) !important; }
body.ui-maple-tools #skillDamagePanel :is(.skill-base-summary-card.skill h4, .skill-pre-metric > small.boss) { color: #8b5d16 !important; }
body.ui-maple-tools #skillDamagePanel .skill-pre-values > em { background: #efe3ca; border-color: var(--maple-line); color: var(--maple-muted); }
body.ui-maple-tools #skillDamagePanel .skill-pre-values > em.positive { background: #e8f0d7; border-color: #a3b581; color: var(--maple-positive); }
body.ui-maple-tools #skillDamagePanel .skill-pre-values > em.negative { background: #fff0e8; border-color: #c8957f; color: #963e32; }

/* Static one-hit verification, separate from the V4 battle graph/results.
   The source table uses ID + !important cell paint; match only those surfaces. */
body.ui-maple-tools #skillDamagePanel { background: var(--maple-surface); border-color: var(--maple-line); color: var(--maple-text); box-shadow: 0 3px #dac39e; }
body.ui-maple-tools #skillDamagePanel :is(.skill-damage-head, .skill-section-head) { background: var(--maple-panel); border-color: var(--maple-line); }
body.ui-maple-tools #skillDamagePanel :is(.skill-level-strip, .skill-result-section, .skill-buff-section) { background: var(--maple-surface); border-color: var(--maple-line); }
body.ui-maple-tools #skillDamagePanel :is(.skill-damage-head h2, .skill-section-head h3, .skill-row-name strong, .skill-buff-row > strong, .skill-buff-effect-name, .skill-buff-after, .skill-damage-route > strong) { color: var(--maple-text); }
body.ui-maple-tools #skillDamagePanel :is(.skill-section-head > span, .skill-row-name small, .skill-row-name em, .skill-target-label, .skill-damage-route > span, .skill-damage-route > i, .skill-buff-row > span, .skill-buff-row > strong small, .skill-buff-effect-name small, .skill-buff-before, .skill-buff-values > i, .skill-buff-before small, .skill-buff-after small, .skill-buff-context, .skill-buff-columns > span, .skill-buff-effect > .skill-buff-note) { color: var(--maple-muted); }
body.ui-maple-tools #skillDamagePanel :is(.skill-result-section, .skill-buff-section) > .skill-section-head > span { color: var(--maple-muted); }
body.ui-maple-tools #skillDamagePanel .skill-damage-kicker { color: var(--maple-accent); }
body.ui-maple-tools #skillDamagePanel :is(.skill-data-status, .skill-level-chip, .skill-event-structure > b) { background: #fff1d3; border-color: #c6a676; color: #805b28; }
body.ui-maple-tools #skillDamagePanel :is(.skill-level-chip b, .skill-event-structure) { color: #805b28; }
body.ui-maple-tools #skillDamagePanel .skill-local-bonuses > span { background: #edf2df; border-color: #adba94; color: #496736; }
body.ui-maple-tools #skillDamagePanel .skill-empty { color: var(--maple-muted); border-color: var(--maple-line); }
body.ui-maple-tools #skillDamagePanel .skill-table-scroll { scrollbar-color: #b5976f #f3e7d0; }
body.ui-maple-tools #skillDamagePanel .skill-damage-table :is(thead th, .skill-group-row th) { background: var(--maple-panel) !important; color: var(--maple-text) !important; border-color: var(--maple-line) !important; }
body.ui-maple-tools #skillDamagePanel .skill-damage-table thead th:nth-child(2) { color: var(--maple-accent) !important; }
body.ui-maple-tools #skillDamagePanel .skill-damage-table thead th:nth-child(3) { color: #805b28 !important; }
body.ui-maple-tools #skillDamagePanel .skill-damage-table thead th:nth-child(4) { color: var(--maple-positive) !important; }
body.ui-maple-tools #skillDamagePanel .skill-damage-table .skill-result-row > :is(th, td) { background: var(--maple-surface) !important; border-color: #e1d2b8 !important; color: var(--maple-text) !important; }
body.ui-maple-tools #skillDamagePanel .skill-damage-table .skill-result-row:nth-child(odd) > :is(th, td) { background: #fbf2e1 !important; }
body.ui-maple-tools #skillDamagePanel .skill-damage-table .skill-result-row:hover > :is(th, td) { background: #f6e7cc !important; }
body.ui-maple-tools #skillDamagePanel .skill-damage-table .skill-result-row { border-bottom-color: var(--maple-line); }
body.ui-maple-tools #skillDamagePanel .skill-damage-table .skill-result-row > td::before { color: var(--maple-accent); }
body.ui-maple-tools #skillDamagePanel .skill-damage-table .skill-result-row > td:nth-child(3)::before { color: #805b28; }
body.ui-maple-tools #skillDamagePanel .skill-damage-table .skill-result-row > td:nth-child(4)::before { color: var(--maple-positive); }
body.ui-maple-tools #skillDamagePanel .skill-damage-table :is(.skill-unresolved-row > th, .skill-unresolved-row > td, .skill-empty-row td) { background: #f4edde !important; border-color: #e1d2b8 !important; color: var(--maple-muted) !important; }
body.ui-maple-tools #skillDamagePanel #skillBaseDamageResult .skill-result-row > :is(th, td) { background: #edf2df !important; border-color: #bac6a2 !important; }
body.ui-maple-tools #skillDamagePanel #skillBaseDamageResult .skill-result-row:hover > :is(th, td) { background: #e5edcf !important; }
body.ui-maple-tools #skillDamagePanel #skillBaseDamageResult .skill-result-row > th { box-shadow: inset 4px 0 #8ca863; }
body.ui-maple-tools #skillDamagePanel #skillBaseDamageResult .skill-row-name strong { color: var(--maple-positive); }
body.ui-maple-tools #skillDamagePanel #skillBaseDamageResult .skill-row-name em { color: #5a6a49; }
body.ui-maple-tools #skillDamagePanel :is(.skill-damage-metric + .skill-damage-metric, .skill-buff-row, .skill-buff-columns, .skill-buff-effect + .skill-buff-effect) { border-color: #e1d2b8; }
body.ui-maple-tools #skillDamagePanel :is(.skill-damage-route > em, .skill-buff-change) { background: #efe3ca; border-color: var(--maple-line); color: var(--maple-muted); }
body.ui-maple-tools #skillDamagePanel .skill-buff-row > em { background: #e8f0d7; border-color: #a3b581; color: var(--maple-positive); }
body.ui-maple-tools #skillDamagePanel :is(.skill-damage-metric.positive .skill-damage-route > em, .skill-base-comparison > em.positive, .skill-buff-change.positive) { background: #e8f0d7; border-color: #a3b581; color: var(--maple-positive) !important; }
body.ui-maple-tools #skillDamagePanel :is(.skill-damage-metric.negative .skill-damage-route > em, .skill-base-comparison > em.negative, .skill-buff-change.negative) { background: #fff0e8; border-color: #c8957f; color: #963e32 !important; }
body.ui-maple-tools #skillDamagePanel .skill-buff-change.neutral { color: var(--maple-muted) !important; }
body.ui-maple-tools #skillDamagePanel .skill-item-compare-slot { background: #fbf3e3; border-color: var(--maple-line); color: var(--maple-muted); }
body.ui-maple-tools #skillDamagePanel .skill-item-compare-slot :is(span, strong, p) { color: var(--maple-muted); }
/* This is an instruction about the stage of the calculation, not an input error. */
body.ui-maple-tools #skillDamagePanel .skill-coefficient-warning { padding: 12px 14px; border-width: 1px; border-left-width: 3px; border-color: #c6ab7d; background: #fff4dd; color: var(--maple-text); }
body.ui-maple-tools #skillDamagePanel .skill-coefficient-warning strong { color: #805b28; font-size: var(--ui-type-l3-size, 16px); font-weight: 700; line-height: 1.4; }
body.ui-maple-tools #skillDamagePanel .skill-coefficient-warning p { color: var(--maple-muted); font-size: var(--ui-type-l4-size, 14px); font-weight: 400; line-height: 1.65; }
body.ui-maple-tools #skillDamagePanel .skill-coefficient-flow a { color: var(--maple-accent); }
body.ui-maple-tools #skillDamagePanel .skill-coefficient-flow span { color: var(--maple-muted); }
body.ui-maple-tools #skillDamagePanel .skill-coefficient-flow svg { filter: drop-shadow(0 3px 9px #a3753520); }
body.ui-maple-tools #skillDamagePanel .skill-coefficient-flow a:hover { color: #853e20; }
body.ui-maple-tools #skillDamagePanel .skill-coefficient-flow a:focus-visible { outline-color: #9b784b; }

/* Restore and preset helper copy must inherit the light card, not old blue/white. */
body.ui-maple-tools .wizard-preset-restore strong { color: var(--maple-text) !important; }
body.ui-maple-tools :is(.wizard-preset-restore > div > span, .v4-loadout-band > header > span, #v4SkillReadout .v4i-help, .v4i-readout-empty, .v4i-companion-toolbar .v4i-field > span, .v4i-companion-readonly .v4i-companion-portrait > span) { color: var(--maple-muted) !important; }
body.ui-maple-tools :is(.wizard-preset-guide > strong, .wizard-preset-guide > span b, .wizard-manual-note strong, .v4i-companion-section > h3) { color: var(--maple-text) !important; }
body.ui-maple-tools :is(.wizard-preset-guide > span, .wizard-manual-note > span) { color: var(--maple-muted) !important; }
body.ui-maple-tools .wizard-preset-guide > strong em { color: #8b5d16 !important; }

/* Original job artwork stays on .wizard-job-art. Only its backing/overlay changes. */
body.ui-maple-tools :is(.wizard-job-card, .wizard-selected-job) { background: #ead9b9; border-color: #c3a37a; color: var(--maple-text); box-shadow: 0 3px 0 #d8bd98, 0 8px 20px #70502b1a; }
body.ui-maple-tools :is(.wizard-job-card, .wizard-selected-job) > .wizard-job-art { background-color: #ead9b9; }
body.ui-maple-tools .wizard-job-card::after { background: linear-gradient(90deg, #fffaf0fc 0%, #fffaf0f5 25%, #fffaf0b8 48%, #f3e7d026 68%, #f3e7d000 80%); }
body.ui-maple-tools .wizard-selected-job::after { background: linear-gradient(90deg, #fffaf0fa, #fffaf0c7 42%, #f3e7d014); }
body.ui-maple-tools .wizard-job-name { text-shadow: 0 1px 2px #fffaf0; }
body.ui-maple-tools :is(.wizard-job-name strong, .wizard-selected-job strong) { color: #593a25 !important; }
body.ui-maple-tools :is(.wizard-job-name small, .wizard-selected-job small) { color: #714b18; }
body.ui-maple-tools .wizard-selected-job em { color: var(--maple-muted); }
body.ui-maple-tools .wizard-job-card:hover { border-color: #a98450; }
body.ui-maple-tools :is(.wizard-job-card, .wizard-selected-job):focus-visible { outline-color: #805d31; }
body.ui-maple-tools .wizard-job-card.selected { border-color: #7d9667; box-shadow: 0 0 0 2px #9caf7c80, 0 3px 0 #c2cba9, inset 0 0 18px #dde7cc33; }
body.ui-maple-tools .wizard-job-check { background: #e3ebd7; border-color: #7d9667; color: var(--maple-positive); }

/* Dynamic tool states: selectors come from the current renderers. */
body.ui-maple-tools .summonField :is(input, select):disabled { background-color: #ece4d6 !important; color: #8a7b67 !important; }
body.ui-maple-tools .summonField option:disabled { color: #8a7b67; }
body.ui-maple-tools .ec-select:focus { border-color: #a77a43; box-shadow: 0 0 0 2px #a7793c1a; }
body.ui-maple-tools .ec-protect.on .ec-switch::after { background: var(--maple-positive); }
body.ui-maple-tools .dualStatGrid :is(.card, .tableWrap) { background: var(--maple-surface); border-color: var(--maple-line); color: var(--maple-text); }
body.ui-maple-tools .dualStatGrid .tableWrap th { background: var(--maple-panel); color: var(--maple-muted); }
body.ui-maple-tools .dualStatGrid .tableWrap tbody tr:hover td { background: #f5ead5; }
body.ui-maple-tools .dualStatGrid .numInput:focus { border-color: #a77a43; box-shadow: 0 0 0 2px #a7793c1a; }

/* OCR/manual stages. Status colors stay separate from ordinary helper copy. */
body.ui-maple-tools :is(.profile-wizard-eyebrow, .wizard-input-method-copy > span, .wizard-manual-head > div > span, .wizard-manual-input em, .preset-recovery-kicker) { color: var(--maple-accent); }
body.ui-maple-tools :is(.wizard-capture-copy > span, .wizard-review-head > div > span) { color: var(--maple-purple); }
body.ui-maple-tools :is(.preset-recovery-code strong, .wizard-potential-row label, .wizard-ocr-correction-copy strong) { color: var(--maple-text); }
body.ui-maple-tools :is(.preset-recovery-card > small, .wizard-ocr-correction-copy span, .wizard-companion-guide > p, .wizard-level-select > em, .manual-scenario-route span, .manual-scenario-route i) { color: var(--maple-muted); }
body.ui-maple-tools :is(.preset-recovery-status, .wizard-upload-preview span, .wizard-manual-progress.ready strong) { color: var(--maple-positive); }
body.ui-maple-tools :is(.wizard-manual-progress strong, .wizard-ready-gate > span) { color: #8b5d16; }
body.ui-maple-tools .wizard-companion-guide > span { background: #f3e4c8; color: #805a34; }
body.ui-maple-tools .wizard-companion-current small { color: #8b5d16; }
body.ui-maple-tools .profile-wizard-progress { background: #e9dcc3; }
body.ui-maple-tools .profile-wizard-progress > span { background: linear-gradient(90deg, #c58c47, #977448, #638045); box-shadow: 0 0 12px #a77a4326; }
body.ui-maple-tools .wizard-manual-input:focus-within { border-color: #a77a43; box-shadow: 0 0 0 2px #a7793c1a; }
body.ui-maple-tools .wizard-manual-field.ocr-read { border-color: #9baaa0; }
body.ui-maple-tools :is(.wizard-manual-field.ocr-review, .wizard-manual-field.ocr-recommended) { box-shadow: inset 3px 0 #bd8d31; }
body.ui-maple-tools .wizard-manual-field.ocr-missing { box-shadow: inset 4px 0 #b32932; }
body.ui-maple-tools .wizard-manual-field.ocr-edited { box-shadow: inset 3px 0 #789854; }
body.ui-maple-tools .profile-wizard.is-manual-entry .profile-wizard-content::-webkit-scrollbar-thumb { background-color: #b9a07c; }
body.ui-maple-tools :is(.wire-wrap, .profile-wizard, .item-efficiency-dialog) .dropzone { background: #fbf2e0; border-color: #c3a57a; }
body.ui-maple-tools :is(.wire-wrap, .profile-wizard, .item-efficiency-dialog) .dropzone:is(.armed, .drag, .active) { background: #edf2df; border-color: #9bad7b; box-shadow: 0 0 0 3px #9caf7c1a; }
body.ui-maple-tools :is(.wire-wrap, .profile-wizard, .item-efficiency-dialog) .dropzone.armed .armed-state { background: #e0eac8; border-color: #a3b581; color: var(--maple-positive); }
body.ui-maple-tools :is(.wire-wrap, .profile-wizard, .item-efficiency-dialog) .dropzone-icon { background: #f0dfbc; color: #805a34; }
body.ui-maple-tools :is(.wire-wrap, .profile-wizard, .item-efficiency-dialog) .dropzone kbd { background: #f0e1c3; color: #785a35; }
body.ui-maple-tools :is(.wire-wrap, .profile-wizard, .item-efficiency-dialog) .status-note { background: #f7efdf; border-color: #c3af8d; color: var(--maple-muted); }
body.ui-maple-tools :is(.wire-wrap, .profile-wizard, .item-efficiency-dialog) .status-note.success { background: #edf2df; border-color: #a3b581; color: var(--maple-positive); }
body.ui-maple-tools :is(.wire-wrap, .profile-wizard, .item-efficiency-dialog) .status-note.warn { background: #fff2d6; border-color: #c7a264; color: #805b28; }
body.ui-maple-tools :is(.wire-wrap, .profile-wizard, .item-efficiency-dialog) .status-note.error { background: #fff0ef; border-color: #b32932; color: #8c202b; box-shadow: inset 4px 0 #b32932; }
body.ui-maple-tools :is(.wire-wrap, .profile-wizard, .item-efficiency-dialog) .status-note.error strong { color: #963e32; }
body.ui-maple-tools :is(.wire-wrap, .profile-wizard, .item-efficiency-dialog) .ocr-debug { background: #fff8e9; border-color: var(--maple-line); color: var(--maple-text); }
body.ui-maple-tools .photo-status { background: #fff7e8f5; border-color: #c3a57a; color: var(--maple-muted); }
body.ui-maple-tools .photo-status.ok { color: var(--maple-positive); }
body.ui-maple-tools .photo-status.wait { color: #8b5d16; }
body.ui-maple-tools .photo-status.sending { color: #356b74; }
body.ui-maple-tools .photo-status.error { color: #963e32; }
body.ui-maple-tools .runtime-pill.ok { background: #edf2df; border-color: #a3b581; color: var(--maple-positive); }
body.ui-maple-tools .runtime-pill.warn { background: #fff2d6; border-color: #c7a264; color: #805b28; }
body.ui-maple-tools :is(#profileReadout, #profileReferenceReadout) .stat-card-label { color: var(--maple-muted); }
body.ui-maple-tools :is(.manual-scenario-route strong, .damage-tree-summary span, .damage-split-head span) { color: var(--maple-text); }
body.ui-maple-tools .damage-client-order span { background: #f7efdf; color: var(--maple-muted); }
body.ui-maple-tools .damage-client-order b { background: #f0dfbc; color: #805a34; }

/* The companion-specific old illustration frame uses the same cream overlay. */
body.ui-maple-tools .wizard-selected-companion { background: #ead9b9; border-color: #c3a37a; color: var(--maple-text); }
body.ui-maple-tools .wizard-selected-companion::after { background: linear-gradient(90deg, #fffaf0fa, #fffaf0c7 43%, #f3e7d014); }
body.ui-maple-tools .wizard-selected-companion > .wizard-job-art { background-color: #ead9b9; }
body.ui-maple-tools .wizard-selected-companion strong { color: #593a25; }

/* Shared V4 settings: companion, ability, artifact, potion and skill tabs. */
body.ui-maple-tools :is(.v4-start-conditions > summary, .v4i-skill-deck h4) { color: var(--maple-text); }
body.ui-maple-tools .v4i-dialog :is(button, input, select, summary):focus-visible { outline-color: #805d31; }
body.ui-maple-tools :is(.v4-input-open, .v4i-readout-edit, .v4i-readout summary, .v4i-preset-switch button, .v4i-artifact-tile, .v4i-skill-choices button, .v4i-icon-slot, .v4i-companion-strip, .v4i-overview-companions):focus-visible { outline-color: #805d31; }
body.ui-maple-tools .v4i-icon-slot:hover { outline-color: #a98450; border-color: #a98450; }
body.ui-maple-tools .v4i-artifact-tile[type="button"]:hover { border-color: #a98450; }
body.ui-maple-tools .v4i-artifact-tile[aria-pressed="true"] { box-shadow: inset 0 0 0 1px #7d9667; }
body.ui-maple-tools .v4i-artifact-pair > .v4i-card:first-child { border-color: #b59a75; }
body.ui-maple-tools .v4i-artifact-pair > .v4i-card:last-child { border-color: #9caf7c; }
body.ui-maple-tools .v4i-skill-icon { background: #f3e4c8; color: #805a34; }
body.ui-maple-tools .v4i-skill-icon[data-job-step="3"] { background: #eee3f3; }
body.ui-maple-tools .v4i-skill-icon[data-job-step="4"] { background: #f5e8c5; }
body.ui-maple-tools :is(.v4i-artifact-stars, .v4i-ability-option .v4i-fixed-unit) { color: #8b5d16; }
body.ui-maple-tools .v4i-ability-warning { color: #805b28; }
body.ui-maple-tools .v4i-ability-warning span { color: var(--maple-muted); }
body.ui-maple-tools .v4i-readout-equipped > span { background: #f7efdf; }
body.ui-maple-tools .v4i-readout-equipped small { color: var(--maple-muted); }
body.ui-maple-tools .v4i-companion-strip, body.ui-maple-tools .v4i-overview-companions { scrollbar-color: #b99a73 #f3e7d0; }
body.ui-maple-tools .v4-comparison-bar .is-applied { color: var(--maple-positive); }
body.ui-maple-tools .v4-validation-cover { background: linear-gradient(135deg, #fff4d9, #f3e7d0); border-color: #c7a264; color: #8b5d16; }
body.ui-maple-tools .v4-validation-cover p { color: #805b28; }
body.ui-maple-tools .v4-validation-cover strong { color: var(--maple-muted); }
body.ui-maple-tools .v4-validation-cover .v4-connection-check p { color: var(--maple-muted); }
body.ui-maple-tools .v4-connection-check button { background: #f8e8c8; color: #77512b; border-color: #bc9664; }
body.ui-maple-tools .v4-connection-check button:hover:not(:disabled) { background: #ffedcb; color: var(--maple-accent); }
body.ui-maple-tools .v4-connection-check button:focus-visible { outline-color: #805d31; }
body.ui-maple-tools #v4ConnectionStatus[data-state="error"] { background: #fff0e8; border-color: #c8957f; color: #963e32; }

/* OCR review: unresolved required values are errors; inferred/recommended values
   keep the amber review state. Reference-only results and valid zero stay neutral. */
body.ui-maple-tools :is(.wizard-ocr-correction[data-ocr-state="error"], .wizard-manual-group[data-ocr-state="error"] > summary, .v4i-review-summary, .v4i-notice[data-state="error"]) { background: #fff0ef; border-color: #b32932; color: #8c202b; box-shadow: inset 4px 0 #b32932; }
body.ui-maple-tools :is(.wizard-ocr-correction[data-ocr-state="error"], .v4i-review-summary, .v4i-notice[data-state="error"]) :is(strong, span, p) { color: #8c202b; }
body.ui-maple-tools .wizard-manual-group[data-ocr-state="error"] > summary > b { background: #a62530; color: #fffaf4; border-color: #a62530; }
body.ui-maple-tools :is(.wizard-manual-field.ocr-missing > small, .ocr-field-reason, .v4i-review-reason) { display: block; color: #8c202b; font-size: 12px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
body.ui-maple-tools :is(.item-efficiency-review-panels label[data-ocr-state="error"], .v4i-field[data-ocr-state="error"]) { border-radius: 8px; outline: 2px solid #b32932; outline-offset: 3px; background: #fff0ef; }
body.ui-maple-tools :is(.item-efficiency-review-panels textarea[aria-invalid="true"], .v4i-dialog :is(input,select)[aria-invalid="true"], .wizard-manual-input input.invalid) { border-color: #b32932 !important; background-color: #fff0ef !important; color: #6f2027 !important; box-shadow: 0 0 0 1px #b32932; }
body.ui-maple-tools :is(.v4i-option, .v4i-companion-cell, .v4i-upload)[data-ocr-state="error"] { background: #fff0ef; border-color: #b32932; box-shadow: inset 4px 0 #b32932; }
body.ui-maple-tools .v4i-review-summary { margin: 10px 16px; padding: 10px 12px; border: 1px solid #b32932; border-radius: 10px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
body.ui-maple-tools .v4i-review-summary[hidden] { display: none; }
body.ui-maple-tools .item-efficiency-photo[data-state="error"] .item-efficiency-photo-head > span { padding: 4px 7px; border-radius: 5px; background: #a62530; color: #fffaf4; }

body.ui-maple-tools .item-efficiency-review { color: var(--maple-text); }
body.ui-maple-tools .item-efficiency-review :is(summary, .item-efficiency-review-panels label > strong) { color: var(--maple-text); }
body.ui-maple-tools .item-efficiency-review-panels label[data-ocr-state="error"] > strong { color: #8c202b; }
body.ui-maple-tools #profileWizard .wizard-manual-field.ocr-missing > [data-manual-help] { color: #8c202b; }
body.ui-maple-tools #profileWizard .wizard-manual-field.ocr-missing .wizard-manual-input { border-color: #b32932; box-shadow: 0 0 0 1px #b32932; }
