:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #201c30;
  background: #f5f4f8;
  --muted: #57536a;
  --border: #dfdce7;
  --accent: #c2f47c;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: #4e326e; text-underline-offset: .22em; }
:focus-visible { outline: 3px solid #7950ba; outline-offset: 3px; }
.shell { width: min(1088px, calc(100% - 64px)); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 68px; }
.topbar a { display: inline-flex; align-items: center; min-height: 44px; font-size: .9rem; }
.brand { font-size: 1.25rem; font-weight: 800; letter-spacing: -.055em; }
.brand span { color: #664395; }

.intro { padding-block: 44px 30px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 5.5vw, 4.5rem); line-height: 1.02; letter-spacing: -.065em; font-weight: 780; }
.intro p { max-width: 560px; color: var(--muted); margin-top: 16px; line-height: 1.5; }
.calculator { display: grid; grid-template-columns: 1.21fr 1fr; gap: 16px; align-items: start; }
.inputs, .result { border-radius: 24px; min-width: 0; padding: 28px; }
.inputs { background: white; border: 1px solid var(--border); }
.inputs h2, .rules h2 { font-size: 1.375rem; letter-spacing: -.03em; }
.fields, .fee-block { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.fields { margin-top: 20px; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field label { font-size: .9rem; font-weight: 650; }
.fee-block { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
.fee-block .field:first-child { grid-column: 1 / -1; }
.listing { grid-column: 1 / -1; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 16px 18px 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.listing h2 { color: #201c30; font-size: 1.1rem; margin-bottom: 6px; }
.listing p + p { margin-top: 8px; }
.listing details { border-bottom: 0; }
.listing summary { padding-block: 12px; }
input, select { width: 100%; height: 46px; min-width: 0; border: 1px solid #c8c3d4; border-radius: 10px; background-color: #faf9fc; color: inherit; padding: 0 12px; font: inherit; }
input::placeholder { color: #625e73; font-size: .88rem; opacity: 1; }
select { appearance: none; padding-right: 34px; background: linear-gradient(45deg, transparent 50%, #57536a 50%) right 17px center / 5px 5px no-repeat, linear-gradient(135deg, #57536a 50%, transparent 50%) right 12px center / 5px 5px no-repeat, #faf9fc; }
.with-unit { position: relative; }
.with-unit input { padding-right: 32px; }
#cart-bonus { padding-right: 78px; }
.with-unit span { position: absolute; inset: 0 12px 0 auto; display: grid; place-items: center; pointer-events: none; color: var(--muted); font-size: .86rem; }
[aria-invalid="true"] { border-color: #b52e4b; }
.error { color: #a02443; line-height: 1.35; }

.result { background: #272139; color: #fff; border: 1px solid #272139; }
.result h2 { font-size: 1rem; font-weight: 650; color: #e3deef; }
.total { display: block; margin: 7px 0 8px; font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 750; line-height: 1.08; letter-spacing: -.06em; overflow-wrap: anywhere; }
.saving { color: var(--accent); font-weight: 650; min-height: 1.4em; }
.saving[data-negative] { color: #ffcfde; }
.meter { display: flex; gap: 3px; height: 7px; border-radius: 9px; overflow: hidden; background: #463e59; margin-block: 22px 10px; }
.meter span { width: 0; }
#meter-store { background: #a792ca; }
#meter-fee { background: #ede4fb; }
#meter-saving { background: var(--accent); }
.breakdown { margin: 0; }
.breakdown div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-block: 13px; border-bottom: 1px solid #514762; }
.breakdown dt { color: #e3deef; font-size: .9rem; }
.breakdown dd { margin: 0; text-align: right; font-weight: 650; overflow-wrap: anywhere; }
.result-note { color: #e3deef; font-size: .85rem; line-height: 1.5; margin-top: 14px; }

.rules { margin-block: 36px 0; }
.rules h2 { margin-bottom: 10px; }
details { border-bottom: 1px solid var(--border); }
summary { padding-block: 14px; cursor: pointer; font-weight: 650; }
details p { max-width: 70ch; margin-bottom: 14px; color: var(--muted); line-height: 1.55; }
details a { display: inline-flex; align-items: center; min-height: 44px; margin: 0 16px 10px 0; }
.footer { margin-block: 25px 28px; color: var(--muted); font-size: .85rem; }

@media (max-width: 810px) {
  .shell { width: min(640px, calc(100% - 32px)); }
  .calculator { grid-template-columns: 1fr; }
  .intro { padding-block: 28px 22px; }
  .wide-break { display: none; }
}

@media (max-width: 440px) {
  .topbar-inner { min-height: 52px; }
  .intro { padding-block: 21px 18px; }
  .intro p { margin-top: 10px; }
  .inputs, .result { padding: 16px; border-radius: 18px; }
  .fields { gap: 12px; margin-top: 12px; }
  #price-field, .fields .field:nth-child(2), #cart-field { grid-column: 1 / -1; }
  .fee-block { margin-top: 12px; padding-top: 12px; gap: 12px; }
  .fee-block .field { grid-column: 1 / -1; }
}
