/* CalcuTools Phase 1 UX hardening. Safe additive overrides. */

html{color-scheme:light;}
html[data-theme="dark"]{color-scheme:dark;}

/* Keyboard access */
:where(a,button,input,select,textarea,[tabindex]):focus-visible{outline:3px solid #2563eb!important;outline-offset:3px!important;}

/* Prevent horizontal overflow from calculator cards/tables on mobile */
html,body{max-width:100%;overflow-x:hidden;}
img,svg,video,canvas{max-width:100%;}

/* Form controls: preserve readability across legacy/new components */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{background:#0f172a!important;color:#e2e8f0!important;border-color:#475569!important;}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{color:#94a3b8!important;}
html[data-theme="dark"] table{color:#e2e8f0;}
html[data-theme="dark"] th{background:#1e293b!important;color:#cbd5e1!important;}
html[data-theme="dark"] td{border-color:#334155!important;}

/* Common white surfaces that frequently escape legacy dark-mode selectors */
html[data-theme="dark"] .card,
html[data-theme="dark"] .calc-card,
html[data-theme="dark"] .results-box,
html[data-theme="dark"] .result-metric,
html[data-theme="dark"] .quick-summary,
html[data-theme="dark"] .related-section,
html[data-theme="dark"] .seo-article,
html[data-theme="dark"] .faq-item,
html[data-theme="dark"] .action-panel{background:#111827!important;color:#e2e8f0!important;border-color:#334155!important;}
html[data-theme="dark"] .seo-article p,
html[data-theme="dark"] .seo-article li,
html[data-theme="dark"] .card p,
html[data-theme="dark"] .calc-card p{color:#cbd5e1!important;}

/* Tables and scrollable comparison blocks */
.ct-table-wrap, .table-wrap, .comparison-table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;}

/* Respect reduced-motion preferences */
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important;}*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;}}
