/*
 * Oxygen Inverter & Battery Smart Calculator — frontend
 * Scoped to .oic-app so it never leaks into the theme. Brand colours arrive as CSS variables
 * (--oic-primary, --oic-on-primary, --oic-accent, --oic-cols) set on the root element.
 */

@font-face { font-family: "OIC Barlow"; src: url("../fonts/Barlow-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "OIC Barlow"; src: url("../fonts/Barlow-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "OIC Barlow"; src: url("../fonts/Barlow-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "OIC Barlow Condensed"; src: url("../fonts/BarlowSemiCondensed-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "OIC Barlow Condensed"; src: url("../fonts/BarlowSemiCondensed-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

.oic-app {
	--oic-primary: #0E5E4E;
	--oic-on-primary: #fff;
	--oic-accent: #F2A900;
	--oic-cols: 4;
	--oic-paper: #F5F7F6;
	--oic-surface: #FFFFFF;
	--oic-raised: #FFFFFF;
	--oic-ink: #1B2A27;
	--oic-ink-2: #3D4D49;
	--oic-muted: #5F6F6B;
	--oic-line: #DCE3E0;
	--oic-line-strong: #C3CEC9;
	--oic-tile: #EEF3F1;
	--oic-danger: #B42318;
	--oic-danger-bg: #FDF0EE;
	--oic-warn-bg: #FFF7E0;
	--oic-warn-ink: #6B4A00;
	--oic-ok: #16794C;
	--oic-select: color-mix(in srgb, var(--oic-primary) 8%, var(--oic-surface));
	--oic-shadow: 0 1px 2px rgba(27, 42, 39, .06), 0 4px 14px rgba(27, 42, 39, .05);
	--oic-r: 14px;
	--oic-r-sm: 9px;
	--oic-font: "OIC Barlow", "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Malayalam", "Malayalam Sangam MN", "Kohinoor Malayalam", sans-serif;
	--oic-font-num: "OIC Barlow Condensed", "OIC Barlow", system-ui, sans-serif;
	--oic-ease: cubic-bezier(.2, .7, .2, 1);

	box-sizing: border-box;
	color: var(--oic-ink);
	background: var(--oic-paper);
	font-family: var(--oic-font);
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	border-radius: var(--oic-r);
	padding: clamp(14px, 3vw, 32px);
	margin-left: auto;
	margin-right: auto;
	max-width: 1200px;
	text-align: left;
	container-type: inline-size;
	container-name: oic;
}
.oic-app[data-lang="ml_IN"] { line-height: 1.65; }
.oic-app *, .oic-app *::before, .oic-app *::after { box-sizing: inherit; }
.oic-app.oic-corners-soft { --oic-r: 8px; --oic-r-sm: 6px; }
.oic-app.oic-corners-square { --oic-r: 2px; --oic-r-sm: 2px; }

.oic-app[data-theme="dark"] {
	--oic-paper: #0F1716;
	--oic-surface: #16211F;
	--oic-raised: #1C2927;
	--oic-ink: #E7EFEC;
	--oic-ink-2: #C5D1CD;
	--oic-muted: #93A39E;
	--oic-line: #2A3936;
	--oic-line-strong: #3A4B47;
	--oic-tile: #E9F0ED;
	--oic-danger: #FF8A7A;
	--oic-danger-bg: #3A1D19;
	--oic-warn-bg: #3A2F12;
	--oic-warn-ink: #F6D58A;
	--oic-ok: #5BD69A;
	--oic-select: color-mix(in srgb, var(--oic-primary) 26%, var(--oic-surface));
	--oic-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.oic-app[data-theme="dark"] .oic-btn--primary,
.oic-app[data-theme="dark"] .oic-chip[aria-pressed="true"] { filter: brightness(1.12); }

:where(.oic-app) :where(h2, h3, h4, p, ol, ul, dl, dd, figure) { margin: 0; padding: 0; }
:where(.oic-app) :where(ol, ul) { list-style: none; }
:where(.oic-app) :where(button, input, select, textarea) { font: inherit; color: inherit; letter-spacing: normal; text-transform: none; }
:where(.oic-app) img { max-width: 100%; height: auto; display: block; }
:where(.oic-app) a { color: var(--oic-primary); }
.oic-app[data-theme="dark"] a { color: color-mix(in srgb, var(--oic-primary) 45%, #fff); }
.oic-app :focus-visible { outline: 3px solid color-mix(in srgb, var(--oic-primary) 55%, transparent); outline-offset: 2px; }
.oic-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.oic-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.oic-brand { display: flex; gap: 14px; align-items: center; min-width: 0; }
.oic-brand img { max-height: 44px; width: auto; }
.oic-title { font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2.05rem); line-height: 1.12; font-weight: 700; letter-spacing: -.01em; }
.oic-subtitle { color: var(--oic-muted); margin-top: 4px; font-size: .98rem; max-width: 60ch; }
.oic-tools { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.oic-seg { display: inline-flex; border: 1px solid var(--oic-line-strong); border-radius: 999px; padding: 2px; background: var(--oic-surface); }
.oic-seg button { border: 0; background: none; border-radius: 999px; padding: 5px 11px; font-size: .86rem; cursor: pointer; color: var(--oic-muted); min-height: 32px; }
.oic-seg button[aria-pressed="true"] { background: var(--oic-ink); color: var(--oic-paper); }
.oic-iconbtn { width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--oic-line-strong); background: var(--oic-surface); display: inline-grid; place-items: center; cursor: pointer; }
.oic-iconbtn svg { width: 18px; height: 18px; }

/* ---------- Step tracker (a real sequence, so it is numbered) ---------- */
.oic-steps { display: grid; grid-template-columns: repeat(var(--oic-step-count, 4), 1fr); gap: 6px; margin: 0 0 24px; counter-reset: oicstep; }
.oic-steps li { counter-increment: oicstep; }
.oic-steps button {
	width: 100%; display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
	border: 0; background: none; padding: 0; cursor: pointer; color: var(--oic-muted); text-align: left; font-size: .9rem;
}
.oic-steps button:disabled { cursor: default; }
.oic-steps button::before { content: ""; display: block; height: 4px; width: 100%; border-radius: 4px; background: var(--oic-line); transition: background .25s var(--oic-ease); }
.oic-steps .is-done button::before, .oic-steps .is-current button::before { background: var(--oic-primary); }
.oic-steps .is-current button { color: var(--oic-ink); font-weight: 600; }
.oic-steps button span::before { content: counter(oicstep) ". "; }

/* ---------- Generic blocks ---------- */
.oic-panel { background: var(--oic-surface); border: 1px solid var(--oic-line); border-radius: var(--oic-r); padding: clamp(16px, 2.6vw, 28px); }
.oic-h { font-size: 1.32rem; font-weight: 700; line-height: 1.2; margin-bottom: 6px; }
.oic-h:focus { outline: none; }
.oic-lead { color: var(--oic-muted); margin-bottom: 20px; max-width: 62ch; }
.oic-nav { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-top: 24px; flex-wrap: wrap; }
.oic-nav__end { display: flex; gap: 10px; margin-left: auto; }

.oic-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 46px; padding: 10px 20px; border-radius: var(--oic-r-sm);
	border: 1px solid var(--oic-line-strong); background: var(--oic-surface); color: var(--oic-ink);
	font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none; line-height: 1.2;
	transition: background-color .15s, border-color .15s, transform .1s;
}
.oic-btn:hover { border-color: var(--oic-ink-2); }
.oic-btn:active { transform: translateY(1px); }
.oic-btn[disabled] { opacity: .55; cursor: not-allowed; }
.oic-app .oic-btn--primary { background: var(--oic-primary); border-color: var(--oic-primary); color: var(--oic-on-primary); }
.oic-app .oic-btn--primary:hover { border-color: var(--oic-primary); background: color-mix(in srgb, var(--oic-primary) 88%, #000); }
.oic-btn--ghost { border-color: transparent; background: transparent; }
.oic-app .oic-btn--wa { background: #1B8F4A; border-color: #1B8F4A; color: #fff; }
.oic-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.oic-app a.oic-btn, .oic-app a.oic-btn:hover { text-decoration: none; }
.oic-app a.oic-btn--primary, .oic-app a.oic-btn--wa { color: #fff; }
.oic-app a.oic-btn:not(.oic-btn--primary):not(.oic-btn--wa) { color: var(--oic-ink); }

.oic-alert { border-radius: var(--oic-r-sm); padding: 12px 14px; font-size: .95rem; display: flex; gap: 10px; align-items: flex-start; }
.oic-alert + .oic-alert { margin-top: 8px; }
.oic-alert--error { background: var(--oic-danger-bg); color: var(--oic-danger); }
.oic-alert--warning { background: var(--oic-warn-bg); color: var(--oic-warn-ink); }
.oic-alert--info { background: var(--oic-tile); color: var(--oic-ink-2); }
.oic-app[data-theme="dark"] .oic-alert--info { background: var(--oic-raised); }
.oic-alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }

/* ---------- Form (step 1) ---------- */
.oic-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.oic-field { display: flex; flex-direction: column; gap: 6px; grid-column: span 2; }
.oic-field--half { grid-column: span 1; }
.oic-field label, .oic-field legend { font-weight: 600; font-size: .95rem; padding: 0; }
.oic-req { color: var(--oic-danger); margin-left: 2px; }
.oic-field input[type="text"], .oic-field input[type="tel"], .oic-field input[type="email"], .oic-field input[type="number"],
.oic-field input[type="date"], .oic-field select, .oic-field textarea, .oic-input {
	width: 100%; min-height: 48px; border: 1px solid var(--oic-line-strong); border-radius: var(--oic-r-sm);
	background: var(--oic-surface); padding: 10px 12px; font-size: 1rem; color: var(--oic-ink); box-shadow: none; margin: 0;
}
.oic-field textarea { min-height: 96px; resize: vertical; }
.oic-field input:focus, .oic-field select:focus, .oic-field textarea:focus, .oic-input:focus { border-color: var(--oic-primary); outline: 2px solid color-mix(in srgb, var(--oic-primary) 30%, transparent); outline-offset: 0; }
.oic-field input[readonly] { background: var(--oic-tile); color: var(--oic-muted); }
.oic-app[data-theme="dark"] .oic-field input[readonly] { background: var(--oic-raised); }
.oic-field.has-error input, .oic-field.has-error select, .oic-field.has-error textarea { border-color: var(--oic-danger); }
.oic-help { color: var(--oic-muted); font-size: .86rem; }
.oic-err { color: var(--oic-danger); font-size: .88rem; font-weight: 600; }
.oic-field fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.oic-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.oic-choice { position: relative; }
.oic-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.oic-choice span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid var(--oic-line-strong); border-radius: 999px; background: var(--oic-surface); cursor: pointer; }
.oic-choice input:checked + span { background: var(--oic-select); border-color: var(--oic-primary); color: var(--oic-ink); font-weight: 600; }
.oic-choice input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--oic-primary) 55%, transparent); outline-offset: 2px; }
.oic-check { display: flex; gap: 12px; align-items: flex-start; grid-column: span 2; font-size: .95rem; color: var(--oic-ink-2); cursor: pointer; }
.oic-check input { width: 22px; height: 22px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--oic-primary); }
.oic-consents { grid-column: span 2; display: grid; gap: 12px; padding-top: 6px; border-top: 1px solid var(--oic-line); margin-top: 4px; }
.oic-staffnote { display: flex; gap: 8px; align-items: center; color: var(--oic-muted); font-size: .9rem; margin-bottom: 16px; }
.oic-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Appliances (step 2) ---------- */
.oic-pick { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.oic-toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.oic-search { position: relative; }
.oic-search svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--oic-muted); pointer-events: none; }
.oic-search input { padding-left: 40px; }
.oic-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.oic-chips::-webkit-scrollbar { display: none; }
.oic-chip { flex-shrink: 0; border: 1px solid var(--oic-line-strong); background: var(--oic-surface); border-radius: 999px; padding: 6px 14px; min-height: 38px; cursor: pointer; font-size: .92rem; white-space: nowrap; color: var(--oic-ink-2); }
.oic-chip[aria-pressed="true"] { background: var(--oic-ink); border-color: var(--oic-ink); color: var(--oic-paper); }
.oic-chip .oic-count { font-family: var(--oic-font-num); margin-left: 6px; opacity: .75; }

/* At most --oic-cols columns, never narrower than 136px: 2 columns on phones, 1 on very narrow screens. */
.oic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(136px, calc((100% - (var(--oic-cols) - 1) * 12px) / var(--oic-cols))), 1fr)); gap: 12px; }
.oic-card {
	position: relative; display: flex; flex-direction: column; gap: 10px;
	background: var(--oic-surface); border: 1px solid var(--oic-line); border-radius: var(--oic-r);
	padding: 12px; transition: border-color .15s, background-color .15s;
}
.oic-card.is-on { border-color: var(--oic-primary); background: var(--oic-select); box-shadow: inset 0 0 0 1px var(--oic-primary); }
.oic-card__top { display: flex; gap: 10px; align-items: flex-start; }
.oic-tile { width: 52px; height: 52px; border-radius: var(--oic-r-sm); background: var(--oic-tile); display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.oic-tile img { width: 40px; height: 40px; object-fit: contain; }
.oic-tile img[src*="/uploads/"] { width: 100%; height: 100%; object-fit: cover; }
.oic-card__name { font-weight: 600; line-height: 1.25; font-size: .98rem; overflow-wrap: anywhere; }
.oic-card__w { color: var(--oic-muted); font-size: .88rem; margin-top: 2px; font-variant-numeric: tabular-nums; }
.oic-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.oic-flag { font-size: .74rem; padding: 1px 7px; border-radius: 5px; background: var(--oic-warn-bg); color: var(--oic-warn-ink); line-height: 1.6; }
.oic-flag--info { background: var(--oic-tile); color: var(--oic-ink-2); }
.oic-app[data-theme="dark"] .oic-flag--info { background: var(--oic-raised); }
.oic-card__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; margin-top: auto; }
.oic-card__foot .oic-line-w { margin-left: auto; }
.oic-qty { display: inline-flex; align-items: center; border: 1px solid var(--oic-line-strong); border-radius: 999px; background: var(--oic-surface); }
.oic-qty button { width: 44px; height: 44px; border: 0; background: none; border-radius: 999px; cursor: pointer; display: grid; place-items: center; color: var(--oic-ink); }
.oic-qty button:hover:not(:disabled) { background: var(--oic-tile); color: #1B2A27; }
.oic-qty button:disabled { opacity: .35; cursor: default; }
.oic-qty button svg { width: 18px; height: 18px; }
.oic-qty input { width: 38px; border: 0; text-align: center; font-family: var(--oic-font-num); font-weight: 700; font-size: 1.15rem; background: transparent; padding: 0; -moz-appearance: textfield; min-height: 0; }
.oic-qty input::-webkit-inner-spin-button, .oic-qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.oic-line-w { font-family: var(--oic-font-num); font-weight: 700; font-size: 1.05rem; color: var(--oic-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.oic-app[data-theme="dark"] .oic-line-w { color: color-mix(in srgb, var(--oic-primary) 40%, #fff); }
.oic-card:not(.is-on) .oic-line-w { visibility: hidden; }
.oic-adjust { border: 0; background: none; padding: 0; color: var(--oic-muted); font-size: .86rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; align-self: flex-start; }
.oic-card__more { display: grid; gap: 10px; padding-top: 10px; border-top: 1px dashed var(--oic-line-strong); }
.oic-card__more label { font-size: .86rem; font-weight: 600; display: block; margin-bottom: 4px; }
.oic-card__more .oic-input { min-height: 42px; }
.oic-card--custom { border-style: dashed; }
.oic-empty { grid-column: 1 / -1; padding: 28px; text-align: center; color: var(--oic-muted); border: 1px dashed var(--oic-line-strong); border-radius: var(--oic-r); }
.oic-addcustom { grid-column: 1 / -1; }
.oic-customform { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; align-items: end; }
.oic-customform .oic-check { grid-column: 1 / -1; }
.oic-customform__actions { grid-column: 1 / -1; display: flex; gap: 10px; }

/* ---------- The load meter (the signature element) ---------- */
.oic-meter { position: sticky; top: 16px; background: var(--oic-surface); border: 1px solid var(--oic-line); border-radius: var(--oic-r); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.oic-meter__label { color: var(--oic-muted); font-size: .9rem; font-weight: 600; }
.oic-readout { display: flex; align-items: baseline; gap: 6px; font-family: var(--oic-font-num); line-height: 1; font-variant-numeric: tabular-nums; }
.oic-readout__num { font-size: clamp(2.6rem, 2rem + 2vw, 3.4rem); font-weight: 700; letter-spacing: -.02em; }
.oic-readout__unit { font-size: 1.3rem; font-weight: 600; color: var(--oic-muted); }
.oic-readout__sub { color: var(--oic-muted); font-size: .92rem; margin-top: 6px; font-variant-numeric: tabular-nums; }
.oic-band { position: relative; display: flex; gap: 3px; padding-top: 14px; }
.oic-band__seg { flex: 1; min-width: 0; }
.oic-band__bar { height: 12px; border-radius: 3px; background: var(--oic-line); transition: background-color .25s var(--oic-ease); }
.oic-band__seg.is-past .oic-band__bar { background: color-mix(in srgb, var(--oic-primary) 35%, var(--oic-line)); }
.oic-band__seg.is-active .oic-band__bar { background: var(--oic-primary); }
.oic-band__seg:first-child .oic-band__bar { border-radius: 6px 3px 3px 6px; }
.oic-band__seg:last-child .oic-band__bar { border-radius: 3px 6px 6px 3px; }
.oic-band__tick { font-family: var(--oic-font-num); font-size: .78rem; color: var(--oic-muted); margin-top: 5px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oic-band__seg.is-active .oic-band__tick { color: var(--oic-ink); font-weight: 700; }
.oic-band__needle { position: absolute; top: 0; width: 2px; height: 30px; background: var(--oic-ink); transform: translateX(-1px); transition: left .35s var(--oic-ease); }
.oic-band__needle::before { content: ""; position: absolute; top: -1px; left: -4px; border: 5px solid transparent; border-top-color: var(--oic-ink); }
.oic-meter__hint { font-size: .92rem; color: var(--oic-ink-2); }
.oic-meter__hint strong { font-family: var(--oic-font-num); font-size: 1.05rem; }
.oic-sel { display: grid; gap: 6px; max-height: 240px; overflow: auto; border-top: 1px solid var(--oic-line); padding-top: 12px; }
.oic-sel li { display: flex; justify-content: space-between; gap: 10px; font-size: .92rem; }
.oic-sel li span:last-child { font-family: var(--oic-font-num); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.oic-sel__empty { color: var(--oic-muted); font-size: .92rem; }
.oic-meter .oic-btn { width: 100%; }
.oic-meter__toggle { display: none; }
.oic-meter.is-static { position: static; }

@media (prefers-reduced-motion: reduce) {
	.oic-app *, .oic-app *::before { transition: none !important; animation: none !important; }
}

/* ---------- Backup (step 3) ---------- */
.oic-hours { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.oic-hour { position: relative; }
.oic-hour input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.oic-hour span {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
	min-height: 84px; border: 1px solid var(--oic-line-strong); border-radius: var(--oic-r); background: var(--oic-surface); cursor: pointer;
}
.oic-hour b { font-family: var(--oic-font-num); font-size: 2rem; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.oic-hour small { color: var(--oic-muted); font-size: .86rem; }
.oic-hour input:checked + span { border-color: var(--oic-primary); background: var(--oic-select); box-shadow: inset 0 0 0 1px var(--oic-primary); }
.oic-hour input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--oic-primary) 55%, transparent); outline-offset: 2px; }
.oic-customhours { margin-top: 16px; max-width: 260px; }
.oic-backuphint { margin-top: 18px; color: var(--oic-muted); font-size: .94rem; }

/* ---------- Results (step 4) ---------- */
.oic-result { display: grid; gap: 18px; }
.oic-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; background: var(--oic-surface); border: 1px solid var(--oic-line); border-radius: var(--oic-r); }
.oic-fact { padding: 14px 18px; border-left: 1px solid var(--oic-line); min-width: 0; }
.oic-fact:first-child { border-left: 0; }
.oic-fact dt { color: var(--oic-muted); font-size: .86rem; }
.oic-fact dd { font-weight: 700; font-size: 1.12rem; margin-top: 2px; overflow-wrap: anywhere; }
.oic-fact dd.oic-num { font-family: var(--oic-font-num); font-size: 1.5rem; font-variant-numeric: tabular-nums; line-height: 1.15; }
.oic-fact small { display: block; color: var(--oic-muted); font-weight: 400; font-size: .84rem; font-family: var(--oic-font); }

.oic-system { background: var(--oic-surface); border: 1px solid var(--oic-line); border-radius: var(--oic-r); overflow: hidden; }
.oic-system.is-recommended { border-color: var(--oic-primary); box-shadow: var(--oic-shadow); }
.oic-system__head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--oic-line); }
.oic-label { display: inline-flex; align-items: center; gap: 6px; background: var(--oic-accent); color: #2A2100; border-radius: 999px; padding: 3px 12px; font-weight: 700; font-size: .86rem; }
.oic-label--plain { background: var(--oic-tile); color: var(--oic-ink-2); }
.oic-app[data-theme="dark"] .oic-label--plain { background: var(--oic-raised); color: var(--oic-ink-2); }
.oic-system__backup { display: flex; align-items: baseline; gap: 8px; }
.oic-system__backup b { font-family: var(--oic-font-num); font-size: 2.1rem; line-height: 1; font-variant-numeric: tabular-nums; }
.oic-system__backup span { color: var(--oic-muted); font-size: .92rem; }
.oic-system__body { display: grid; grid-template-columns: 1fr 1fr; }
.oic-prod { padding: 18px 20px; display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 16px; align-content: start; }
.oic-prod + .oic-prod { border-left: 1px solid var(--oic-line); }
.oic-prod .oic-tile { width: 84px; height: 84px; }
.oic-prod .oic-tile img { width: 64px; height: 64px; }
.oic-prod .oic-tile img[src*="/uploads/"] { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.oic-prod__kind { color: var(--oic-muted); font-size: .86rem; }
.oic-prod__name { font-weight: 700; font-size: 1.12rem; line-height: 1.25; }
.oic-prod__qty { font-family: var(--oic-font-num); color: var(--oic-primary); }
.oic-app[data-theme="dark"] .oic-prod__qty { color: color-mix(in srgb, var(--oic-primary) 40%, #fff); }
.oic-specs { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin-top: 10px; font-size: .93rem; grid-column: 1 / -1; }
.oic-specs dt { color: var(--oic-muted); }
.oic-specs dd { font-variant-numeric: tabular-nums; }
.oic-price { margin-top: 8px; font-family: var(--oic-font-num); font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.oic-stock { display: inline-block; font-size: .78rem; padding: 1px 8px; border-radius: 999px; background: var(--oic-warn-bg); color: var(--oic-warn-ink); margin-left: 6px; vertical-align: middle; }
.oic-system__foot { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; justify-content: space-between; padding: 14px 20px; background: color-mix(in srgb, var(--oic-tile) 55%, var(--oic-surface)); border-top: 1px solid var(--oic-line); }
.oic-app[data-theme="dark"] .oic-system__foot { background: var(--oic-raised); }
.oic-bankline { font-size: .95rem; color: var(--oic-ink-2); font-variant-numeric: tabular-nums; }
.oic-total { font-family: var(--oic-font-num); font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.oic-total small { font-family: var(--oic-font); font-size: .86rem; color: var(--oic-muted); font-weight: 400; margin-right: 8px; }
.oic-meets { display: inline-flex; gap: 6px; align-items: center; font-size: .9rem; font-weight: 600; color: var(--oic-ok); }
.oic-meets.is-short { color: var(--oic-danger); }
.oic-meets svg { width: 16px; height: 16px; }

.oic-details { border-top: 1px solid var(--oic-line); }
.oic-details summary { cursor: pointer; padding: 12px 20px; font-weight: 600; font-size: .95rem; list-style: none; display: flex; align-items: center; gap: 8px; }
.oic-details summary::-webkit-details-marker { display: none; }
.oic-details summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .2s; margin-right: 4px; }
.oic-details[open] summary::before { transform: rotate(45deg); }
.oic-details__body { padding: 0 20px 16px; font-size: .93rem; color: var(--oic-ink-2); display: grid; gap: 8px; }
.oic-checks { display: grid; gap: 6px; }
.oic-checks li { display: flex; gap: 8px; align-items: flex-start; }
.oic-checks svg { width: 16px; height: 16px; color: var(--oic-ok); flex-shrink: 0; margin-top: 3px; }
.oic-formula { font-family: var(--oic-font-num); background: var(--oic-tile); color: #1B2A27; padding: 8px 10px; border-radius: 6px; font-variant-numeric: tabular-nums; overflow-x: auto; }
.oic-trace { font-size: .86rem; color: var(--oic-muted); display: grid; gap: 4px; }
.oic-trace li::before { content: "– "; }

.oic-sectionhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 6px; }
.oic-sectionhead h3 { font-size: 1.12rem; font-weight: 700; }
.oic-alts { display: grid; gap: 10px; }
.oic-alt { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 14px 20px; align-items: center; background: var(--oic-surface); border: 1px solid var(--oic-line); border-radius: var(--oic-r); padding: 14px 18px; }
.oic-alt.is-chosen { border-color: var(--oic-primary); background: var(--oic-select); }
.oic-alt__name { font-weight: 600; line-height: 1.3; }
.oic-alt__name small { display: block; color: var(--oic-muted); font-weight: 400; font-size: .88rem; }
.oic-alt__nums { display: flex; gap: 18px; font-variant-numeric: tabular-nums; }
.oic-alt__nums b { display: block; font-family: var(--oic-font-num); font-size: 1.3rem; line-height: 1.1; }
.oic-alt__nums span { color: var(--oic-muted); font-size: .84rem; }
.oic-alt .oic-label { margin-bottom: 6px; }

.oic-notes { display: grid; gap: 8px; }
.oic-noresult { text-align: left; }
.oic-noresult .oic-h { margin-bottom: 8px; }

.oic-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 6px; }
.oic-actions .oic-spacer { flex: 1; }
.oic-remarks { display: grid; gap: 6px; }
.oic-remarks textarea { min-height: 70px; }
.oic-savedline { color: var(--oic-ok); font-weight: 600; font-size: .94rem; display: inline-flex; gap: 6px; align-items: center; }
.oic-disclaimer { color: var(--oic-muted); font-size: .86rem; max-width: 80ch; }
.oic-ref { color: var(--oic-muted); font-size: .9rem; font-variant-numeric: tabular-nums; }

/* ---------- Loading & errors ---------- */
.oic-loading { display: flex; align-items: center; gap: 12px; color: var(--oic-muted); padding: 30px 0; }
.oic-spinner { width: 22px; height: 22px; border: 3px solid var(--oic-line); border-top-color: var(--oic-primary); border-radius: 50%; animation: oic-spin .8s linear infinite; }
@keyframes oic-spin { to { transform: rotate(360deg); } }
.oic-busy { position: relative; min-height: 220px; display: grid; place-items: center; }
.oic-locked__msg { margin-bottom: 14px; font-size: 1.05rem; }

/* Result reveal: the single orchestrated motion moment. */
.oic-reveal > * { animation: oic-rise .45s var(--oic-ease) both; }
.oic-reveal > *:nth-child(2) { animation-delay: .06s; }
.oic-reveal > *:nth-child(3) { animation-delay: .12s; }
.oic-reveal > *:nth-child(n+4) { animation-delay: .16s; }
@keyframes oic-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive (container-based: the calculator adapts to the space the theme gives it) ---------- */
@container oic (max-width: 860px) {
	.oic-pick { grid-template-columns: minmax(0, 1fr); }
	.oic-meter { order: -1; top: 8px; z-index: 5; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 16px; padding: 14px 16px; }
	.oic-meter__label, .oic-band, .oic-meter__hint { grid-column: 1 / -1; }
	.oic-meter .oic-meter__label { display: none; }
	.oic-meter__main { min-width: 0; }
	.oic-readout__num { font-size: 2.2rem; }
	.oic-readout__sub { margin-top: 2px; font-size: .84rem; }
	.oic-meter .oic-btn { width: auto; }
	.oic-meter__toggle { display: inline-flex; grid-column: 1 / -1; justify-self: start; border: 0; background: none; padding: 0; color: var(--oic-muted); text-decoration: underline; text-underline-offset: 3px; font-size: .88rem; cursor: pointer; }
	.oic-meter .oic-sel { grid-column: 1 / -1; display: none; max-height: 34vh; }
	.oic-meter.is-open .oic-sel { display: grid; }
	.oic-meter .oic-band { padding-top: 12px; }
	.oic-facts { grid-template-columns: 1fr 1fr; }
	.oic-fact:nth-child(3) { border-left: 0; }
	.oic-fact:nth-child(n+3) { border-top: 1px solid var(--oic-line); }
	.oic-system__body { grid-template-columns: 1fr; }
	.oic-prod + .oic-prod { border-left: 0; border-top: 1px solid var(--oic-line); }
	.oic-alt { grid-template-columns: 1fr auto; }
	.oic-alt .oic-btn { grid-column: 1 / -1; }
}
@container oic (max-width: 600px) {
	.oic-head { flex-direction: column; }
	.oic-tools { align-self: stretch; justify-content: space-between; }
	.oic-form { grid-template-columns: 1fr; }
	.oic-field, .oic-field--half, .oic-check, .oic-consents { grid-column: span 1; }
	.oic-grid { gap: 8px; }
	.oic-card { padding: 10px; gap: 8px; }
	.oic-card__top { flex-direction: column; }
	.oic-tile { width: 44px; height: 44px; }
	.oic-tile img { width: 34px; height: 34px; }
	.oic-qty button { width: 40px; height: 44px; }
	.oic-qty input { width: 30px; }
	.oic-card__foot { flex-direction: column; align-items: stretch; }
	.oic-card__foot .oic-qty { justify-content: space-between; }
	.oic-card .oic-line-w { text-align: right; }
	.oic-customform { grid-template-columns: 1fr 1fr; }
	.oic-customform > :first-child { grid-column: 1 / -1; }
	.oic-nav .oic-btn { flex: 1; }
	.oic-nav__end { width: 100%; }
	.oic-steps button span { display: none; } /* The step heading below names the current step. */
	.oic-prod { grid-template-columns: 64px minmax(0, 1fr); padding: 16px; }
	.oic-prod .oic-tile { width: 64px; height: 64px; }
	.oic-prod .oic-tile img { width: 48px; height: 48px; }
	.oic-actions .oic-btn { flex: 1 1 calc(50% - 10px); }
	.oic-actions .oic-spacer { display: none; }
	.oic-system__head { padding: 14px 16px; }
	.oic-alt { grid-template-columns: 1fr; gap: 10px; }
	.oic-fact { padding: 12px 14px; }
	.oic-card__name { font-size: .94rem; }
}
@container oic (max-width: 290px) {
	.oic-card__top { flex-direction: row; }
	.oic-facts { grid-template-columns: 1fr; }
	.oic-fact { border-left: 0 !important; }
	.oic-fact + .oic-fact { border-top: 1px solid var(--oic-line); }
	.oic-actions .oic-btn { flex-basis: 100%; }
}
/* Phones: the load summary docks to the bottom of the screen. */
@media (max-width: 760px) {
	.oic-app { border-radius: 0; padding: 14px 12px; }
	.oic-meter:not(.is-static) {
		position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 9990;
		border-radius: var(--oic-r) var(--oic-r) 0 0; border-width: 1px 0 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
		box-shadow: 0 -6px 24px rgba(27, 42, 39, .14);
	}
	.oic-meter .oic-meter__hint { display: none; }
	.oic-meter.is-open .oic-meter__hint { display: block; }
	.oic-pick:not(.is-static) .oic-pick__main { padding-bottom: 170px; }
}
@media (max-width: 340px) {
	.oic-app { padding: 10px 8px; }
}

/* ---------- Print: only the recommendation ---------- */
@media print {
	body * { visibility: hidden; }
	.oic-app, .oic-app * { visibility: visible; }
	.oic-app { position: absolute; left: 0; top: 0; width: 100%; max-width: none; padding: 0; background: #fff !important; color: #000; --oic-paper: #fff; --oic-surface: #fff; --oic-raised: #fff; --oic-ink: #000; --oic-muted: #444; --oic-line: #bbb; }
	.oic-tools, .oic-steps, .oic-actions, .oic-remarks, .oic-alt .oic-btn, .oic-meter, .oic-noprint { display: none !important; }
	.oic-printonly { display: block !important; }
	.oic-details { border: 0; }
	.oic-details > .oic-details__body { display: grid !important; }
	.oic-system, .oic-alt, .oic-facts { break-inside: avoid; box-shadow: none !important; }
	.oic-reveal > * { animation: none !important; }
}
.oic-printonly { display: none; }
.oic-printlist { margin-top: 10px; columns: 2; font-size: .9rem; }
