:root {
  color-scheme: light;
  --ink: #17241f;
  --muted: #65736d;
  --line: #d8e1dd;
  --brand: #cf0038;
  --brand-dark: #a9002e;
  --green: #00796b;
  --ground: #edf2ef;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  color: var(--ink);
  background: var(--ground);
}

button, input { font: inherit; }

.customer-cost-app {
  position: relative;
  isolation: isolate;
  width: min(100%, 760px);
  padding: clamp(26px, 5vw, 50px);
  overflow: hidden;
  background: rgba(255, 255, 255, .86);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(23, 36, 31, .12);
}

.customer-cost-app > :not(.inopower-watermark) {
  position: relative;
  z-index: 1;
}

.inopower-watermark {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: 165%;
  height: 165%;
  background-image: var(--inopower-watermark, none);
  background-repeat: repeat;
  background-position: center;
  background-size: 260px auto;
  transform: translate(-50%, -50%) rotate(-45deg);
  opacity: .065;
  filter: grayscale(.35) saturate(.8);
  pointer-events: none;
  user-select: none;
}

.app-heading { margin-bottom: 28px; text-align: center; }
.app-heading p { margin: 0 0 7px; color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.app-heading h1 { margin: 0; font-size: clamp(27px, 5vw, 42px); line-height: 1.06; letter-spacing: -.035em; }

.input-card {
  padding: clamp(22px, 4vw, 34px);
  background: rgba(255, 255, 255, .66);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.input-card h2 { margin: 0 0 24px; font-size: 16px; }

.slider-control { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 21px; font-size: 15px; font-weight: 750; }
.slider-control:first-of-type { margin-top: 0; }
.slider-control output { color: var(--brand-dark); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; margin: 9px 0 2px; accent-color: var(--brand); cursor: pointer; }
input[type="range"]:focus-visible, button:focus-visible, input[type="checkbox"]:focus-visible + i { outline: 3px solid rgba(207, 0, 56, .28); outline-offset: 3px; }
.slider-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }

.simple-choice { margin: 27px 0 0; padding: 23px 0 0; border: 0; border-top: 1px solid var(--line); }
.simple-choice legend { float: left; width: 100%; margin-bottom: 11px; padding: 0; font-size: 15px; font-weight: 750; }
.simple-choice legend + * { clear: both; }
.choice-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 5px; background: #edf2ef; border-radius: 12px; }
.choice-buttons button { min-height: 44px; color: var(--muted); background: transparent; border: 0; border-radius: 9px; font-weight: 750; cursor: pointer; }
.choice-buttons button[aria-pressed="true"] { color: white; background: var(--ink); box-shadow: 0 4px 12px rgba(23, 36, 31, .2); }
.simple-choice small { display: block; margin-top: 8px; color: var(--muted); text-align: center; }
.dispatch-note { max-width: 680px; margin: 13px auto 0; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center; }

.tank-toggle { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; padding-top: 23px; border-top: 1px solid var(--line); cursor: pointer; }
.tank-toggle > span { display: grid; gap: 3px; }
.tank-toggle small { color: var(--muted); }
.tank-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.tank-toggle i { position: relative; flex: 0 0 48px; width: 48px; height: 28px; background: #cbd5d0; border-radius: 999px; transition: background .18s ease; }
.tank-toggle i::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; background: white; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: transform .18s ease; }
.tank-toggle input:checked + i { background: var(--green); }
.tank-toggle input:checked + i::after { transform: translateX(20px); }

.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.result-card {
  position: relative;
  overflow: hidden;
  min-height: 158px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 25px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.result-card--saving { border-top: 4px solid var(--brand); }
.result-card > span { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.result-card strong {
  margin: 8px 0 5px;
  font-size: clamp(25px, 4vw, 34px);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.result-card--saving strong { color: var(--brand-dark); }
.result-card small {
  color: var(--muted);
  line-height: 1.4;
  transition: opacity 0.2s ease;
}

/* Subtle loading indicator on card bottom */
.result-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--brand) 50%, transparent 100%);
  opacity: 0;
  transform: translateX(-100%);
  transition: opacity 0.25s ease;
}

.customer-cost-app.is-calculating .result-card::after {
  opacity: 1;
  animation: cardLoadingShimmer 1.1s infinite ease-in-out;
}

.customer-cost-app.is-calculating .result-card strong {
  opacity: 0.8;
}

@keyframes cardLoadingShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.source-note { margin-top: 20px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.source-note summary { color: var(--ink); font-weight: 750; cursor: pointer; }
.source-note p { margin: 9px 0 0; }
.source-note ul { margin: 5px 0 0; padding-left: 22px; }
.source-note li + li { margin-top: 3px; }
.custom-case-contact { margin: 13px 0 0; color: var(--ink); font-size: 12px; font-weight: 750; line-height: 1.5; }

.customer-cost-app.is-calculating .result-card strong {
  opacity: 0.7;
}

@media (max-width: 580px) {
  body { padding: 10px; }
  .customer-cost-app { padding: 24px 16px; border-radius: 18px; }
  .input-card { padding: 21px 17px; }
  .result-grid { grid-template-columns: 1fr; }
  .result-card { min-height: 132px; }
}

@media print {
  body { display: block; padding: 0; background: white; }
  .customer-cost-app { width: 100%; box-shadow: none; border: 0; }
}
