@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --ink: #18243a;
  --muted: #758198;
  --line: #e6ebf2;
  --blue: #3266d3;
  --blue-dark: #244da8;
  --blue-soft: #edf3ff;
  --amber: #a95516;
  --amber-soft: #fff7e9;
  --surface: #fff;
  --page: #f2f6fc;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: radial-gradient(ellipse at 15% 0%, #e8f0ff 0, transparent 42%), var(--page);
  color: var(--ink);
}
button, input { font: inherit; }
.shell { width: min(1160px, calc(100% - 44px)); margin: 0 auto; padding: 34px 0 22px; }
.page-header { display: flex; align-items: center; gap: 17px; margin: 0 0 25px; }
.brand-mark { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 17px; color: white; background: linear-gradient(145deg, #4579e7, #234da9); box-shadow: 0 9px 20px #3266d333; font: 800 28px Manrope, sans-serif; }
.eyebrow { margin: 0 0 4px; color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: .085em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font: 800 clamp(22px, 3vw, 30px)/1.2 Manrope, 'Segoe UI', sans-serif; letter-spacing: -.035em; }
.subtitle { margin: 0; color: var(--muted); font-size: 14px; }
.tariff-strip { display: flex; align-items: center; gap: 22px; margin-bottom: 22px; padding: 16px 19px; border: 1px solid #e0e8f5; border-radius: 16px; background: #ffffffdc; box-shadow: 0 4px 14px #28497808; }
.tariff-item { display: flex; align-items: center; gap: 11px; min-width: 0; }
.tariff-item span:last-child { display: grid; gap: 2px; }
.tariff-item strong { font-size: 13px; font-weight: 700; }
.tariff-item small { color: var(--muted); font-size: 12px; }
.tariff-icon { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 11px; font-size: 19px; font-weight: 800; }
.electricity-icon { color: #9b6000; background: #fff0ce; }
.water-icon { color: #2865bc; background: #e7f1ff; }
.current-badge { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; padding: 8px 11px; border-radius: 20px; color: #28614b; background: #eaf8f0; white-space: nowrap; font-size: 11px; font-weight: 700; }
.current-badge span { width: 7px; height: 7px; border-radius: 100%; background: #3ba66d; }
.calculator-layout { display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); gap: 20px; align-items: start; }
.card { border: 1px solid #e5eaf1; border-radius: 18px; background: var(--surface); box-shadow: 0 10px 30px #263c5a0b, 0 2px 5px #263c5a08; }
.input-card, .results-card { padding: 23px; }
.section-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 23px; }
.section-icon { display: grid; place-items: center; width: 39px; height: 39px; flex: 0 0 39px; border-radius: 12px; color: var(--blue); background: var(--blue-soft); font-size: 12px; font-weight: 800; }
.section-heading h2 { margin: 0 0 3px; font: 750 17px/1.25 Manrope, sans-serif; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
fieldset { min-width: 0; margin: 0 0 22px; padding: 0; border: 0; }
legend { width: 100%; margin: 0 0 12px; padding: 0 0 9px; border-bottom: 1px solid var(--line); color: #48566c; font-size: 12px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.field-grid { display: grid; grid-template-columns: 1fr; gap: 13px; }
.meter-grid { grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 6px; color: #44516a; font-size: 13px; font-weight: 600; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input { width: 100%; height: 44px; padding: 0 66px 0 12px; border: 1px solid #dce3ed; border-radius: 10px; outline: none; background: #fbfcfe; color: var(--ink); transition: border-color .15s, box-shadow .15s, background .15s; font-size: 16px; font-weight: 600; }
.input-wrap input:focus { border-color: #7398ea; background: #fff; box-shadow: 0 0 0 3px #3266d31a; }
.input-wrap input::placeholder { color: #a6afbd; font-weight: 400; }
.unit { position: absolute; right: 12px; color: #909aac; pointer-events: none; font-size: 11px; font-weight: 500; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2px; }
.button { min-height: 42px; padding: 0 15px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 700; transition: transform .12s, background .12s; }
.button:active { transform: translateY(1px); }
.button-primary { color: #fff; background: var(--blue); }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { border-color: var(--line); color: #59667b; background: #fff; }
.button-secondary:hover { background: #f7f9fc; }
.form-note { min-height: 17px; margin: 8px 0 0; color: #b34242; font-size: 12px; }
.results-heading { margin-bottom: 18px; }
.results-icon { color: #31835b; background: #eaf8f0; }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 39px; color: #58657a; font-size: 13px; }
.summary-row strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.utility-summary { min-height: 45px; margin-top: 4px; padding: 0 11px; border-radius: 10px; color: #344258; font-size: 14px; font-weight: 700; }
.utility-summary span { display: inline-flex; align-items: center; gap: 8px; }
.utility-summary i { font-style: normal; font-size: 19px; }
.electricity-summary { background: #fff8e9; }
.electricity-summary i { color: #b17408; }
.water-summary { background: #eff6ff; }
.water-summary i { color: #3570c0; }
.grand-total { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 17px; padding: 17px 15px; border: 1px solid #dfe8ff; border-radius: 13px; background: linear-gradient(100deg, #f3f6ff, #edf2ff); color: #293f7d; font-size: 15px; font-weight: 800; }
.grand-total strong { font: 800 clamp(20px, 3vw, 25px)/1 Manrope, sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.detail-block { margin-top: 12px; padding: 14px 15px; border-radius: 13px; }
.electricity-detail { color: #794515; background: var(--amber-soft); }
.water-detail { color: #244d95; background: #eff5ff; }
.detail-block h3 { margin: 0 0 10px; font: 750 13px/1.45 Manrope, sans-serif; }
.detail-block h3 span { font: inherit; }
.detail-lines { display: grid; gap: 6px; }
.detail-line { margin: 0; color: inherit; font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.detail-total { display: flex; justify-content: space-between; gap: 10px; margin: 9px 0 0; padding-top: 8px; border-top: 1px solid currentColor; border-color: #00000018; color: inherit; font-size: 12px; font-weight: 800; }
.detail-total strong { white-space: nowrap; }
.tariff-footnote { margin: 13px 1px 0; color: #8a94a5; font-size: 10px; line-height: 1.45; }
footer { padding: 17px 2px 0; color: #8d98a9; text-align: center; font-size: 11px; }

@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 560px); padding-top: 23px; }
  .page-header { align-items: flex-start; gap: 12px; margin-bottom: 18px; }
  .brand-mark { width: 45px; height: 45px; flex-basis: 45px; border-radius: 14px; font-size: 23px; }
  h1 { font-size: 22px; }
  .subtitle { font-size: 12px; line-height: 1.45; }
  .tariff-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 10px; padding: 13px; }
  .tariff-item { align-items: flex-start; gap: 8px; }
  .tariff-icon { flex-basis: 29px; height: 29px; font-size: 16px; }
  .tariff-item strong { font-size: 11px; line-height: 1.35; }
  .tariff-item small { font-size: 10px; line-height: 1.4; }
  .current-badge { grid-column: 1 / -1; justify-self: start; margin-left: 0; padding: 6px 9px; }
  .calculator-layout { grid-template-columns: 1fr; gap: 15px; }
  .input-card, .results-card { padding: 18px; }
  .section-heading { margin-bottom: 18px; }
  .meter-grid { grid-template-columns: 1fr; }
  .grand-total { padding: 15px 13px; }
  .grand-total strong { font-size: 21px; }
  .detail-block { padding: 13px; }
}

@media print {
  body { min-width: 0; background: white; }
  .shell { width: 100%; max-width: none; padding: 0; }
  .form-actions, .form-note, footer { display: none !important; }
  .calculator-layout { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card { box-shadow: none; border-color: #ccd2dc; break-inside: avoid; }
  .tariff-strip { box-shadow: none; }
}
