.ha-cost-calc{--calc-accent:#216ba2;--calc-hour:#64748b;--calc-fixed:#15803d;background:var(--ha-surface);border:1px solid var(--ha-border);border-radius:var(--ha-radius);padding:clamp(14px,3vw,26px);color:var(--ha-text);min-width:0}
.ha-cost-calc [hidden]{display:none!important}
.ha-cost-calc__field{margin:0 0 22px;min-width:0}
.ha-cost-calc__label,.ha-cost-calc__limits{display:flex;justify-content:space-between;align-items:baseline;gap:8px;flex-wrap:wrap}
.ha-cost-calc__label{font-weight:700;color:var(--ha-text-strong)}
.ha-cost-calc__value{font-size:1.25rem;font-weight:800;font-variant-numeric:tabular-nums;white-space:nowrap}
.ha-cost-calc__limits{font-size:.84rem;color:var(--ha-text-soft)}
.ha-cost-calc input[type=range]{display:block;width:100%;max-width:100%;height:44px;margin:5px 0;padding:0;accent-color:var(--calc-accent);cursor:pointer;background:transparent;box-shadow:none;border:0;touch-action:pan-y}
.ha-cost-calc input[type=range]:focus-visible,.ha-cost-calc button:focus-visible{outline:3px solid var(--calc-accent);outline-offset:3px}
.ha-cost-calc__results{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;border-top:1px solid var(--ha-border);padding-top:18px}
.ha-cost-calc__result{border:1px solid var(--ha-border);background:var(--ha-surface-soft);border-radius:10px;padding:12px;min-width:0;overflow-wrap:anywhere}
.ha-cost-calc__result strong{display:block;font-size:clamp(1.35rem,3vw,2rem);color:var(--ha-text-strong);font-variant-numeric:tabular-nums}
.ha-cost-calc__bars{margin:18px 0;display:grid;gap:8px;font-size:.9rem}
.ha-cost-calc__track{height:17px;background:var(--ha-surface-muted);border-radius:5px;overflow:hidden}
.ha-cost-calc__bar{height:100%;width:100%;transition:width .15s ease;background:var(--calc-hour);border-radius:5px}
.ha-cost-calc__bar--fixed{background:var(--calc-fixed)}
.ha-cost-calc__summary{font-weight:700;color:var(--ha-text-strong);margin:16px 0}
.ha-cost-calc__reset{width:100%;min-height:44px;border:1px solid var(--ha-border);background:var(--ha-surface-soft);color:var(--ha-text-strong);border-radius:8px;font-weight:700;cursor:pointer;padding:10px 14px}
.ha-cost-calc__reset:hover{border-color:var(--calc-accent)}
.ha-cost-calc__note{font-size:.88rem;color:var(--ha-text-soft)}
html[data-ha-theme="dark"] .ha-cost-calc{--calc-accent:#79b9ed;--calc-hour:#93a6bd;--calc-fixed:#4ade80}
@media(max-width:360px){.ha-cost-calc__results{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.ha-cost-calc__bar{transition:none}}

/* v0.1.97: compact layout; original markup and calculation remain compatible. */
.ha-cost-calc--compact{padding:clamp(10px,1.8vw,16px);container-type:inline-size}
.ha-cost-calc--compact [data-calc-interactive]>p:first-child{margin:0 0 8px;font-size:.92rem}
.ha-cost-calc__panel{position:sticky;top:8px;z-index:5;background:var(--ha-surface);padding:4px 0 8px;border-bottom:1px solid var(--ha-border);margin-bottom:10px;isolation:isolate}
.ha-cost-calc__panel .ha-cost-calc__results{border:0;padding:0;gap:8px;grid-template-columns:repeat(2,minmax(0,1fr))}
.ha-cost-calc__panel .ha-cost-calc__result{padding:7px 10px;font-size:.86rem;line-height:1.25}
.ha-cost-calc__panel .ha-cost-calc__result strong{font-size:clamp(1.2rem,3vw,1.7rem);line-height:1.3;margin-top:2px}
.ha-cost-calc__panel .ha-cost-calc__summary{margin:7px 0 0;font-size:.88rem;line-height:1.3;text-align:center}
.ha-cost-calc__fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 18px}
.ha-cost-calc__fields .ha-cost-calc__field{margin:0}
.ha-cost-calc__fields .ha-cost-calc__label{font-size:.92rem;gap:2px 8px}
.ha-cost-calc__fields .ha-cost-calc__value{font-size:1.02rem}
.ha-cost-calc--compact input[type=range]{margin:0;height:36px}
.ha-cost-calc__fields .ha-cost-calc__limits{font-size:.75rem;line-height:1.2}
.ha-cost-calc--compact .ha-cost-calc__bars{margin:10px 0;gap:3px;font-size:.78rem;line-height:1.2}
.ha-cost-calc--compact .ha-cost-calc__track{height:9px}
.ha-cost-calc--compact .ha-cost-calc__reset{width:auto;min-height:40px;padding:6px 12px;font-size:.88rem}
.ha-cost-calc--compact .ha-cost-calc__note{margin:8px 0 0;font-size:.78rem;line-height:1.35}
body.admin-bar .ha-cost-calc__panel{top:40px}
@container (max-width:450px){.ha-cost-calc__fields{grid-template-columns:1fr;gap:8px}.ha-cost-calc--compact input[type=range]{height:44px}.ha-cost-calc__panel .ha-cost-calc__result{padding:6px;font-size:.78rem}}
@media(max-width:980px){.ha-cost-calc__panel{top:76px}body.ha-mobile-header-hidden:not(.ha-nav-open) .ha-cost-calc__panel{top:6px}body.admin-bar .ha-cost-calc__panel{top:108px}body.admin-bar.ha-mobile-header-hidden:not(.ha-nav-open) .ha-cost-calc__panel{top:38px}.ha-cost-calc--compact input[type=range]{height:44px}}
@media(max-width:782px){body.admin-bar .ha-cost-calc__panel{top:122px}body.admin-bar.ha-mobile-header-hidden:not(.ha-nav-open) .ha-cost-calc__panel{top:52px}}
@media(max-width:600px){body.admin-bar .ha-cost-calc__panel{top:76px}body.admin-bar.ha-mobile-header-hidden:not(.ha-nav-open) .ha-cost-calc__panel{top:6px}}
