/* Rataskop: arkusz stylów aplikacji demo. Źródło prawdy: docs/design/projekt.md */

/* ---------- fonty (lokalnie, SIL OFL 1.1; bez zapytań do Google) ---------- */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../assets/fonts/instrument-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../assets/fonts/instrument-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../assets/fonts/newsreader-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../assets/fonts/newsreader-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;

  /* tła */
  --page: #ECE9E1;
  --paper: #F6F4EF;
  --surface: #FFFFFF;

  /* linie */
  --line: #E3DFD5;
  --line-strong: #CFC9BC;
  --line-field: #878D86;

  /* tekst */
  --ink: #14211A;
  --ink-2: #545E57;
  --ink-3: #626A64;

  /* zieleń (Śląsk Wrocław) */
  --green-900: #0B4A2C;
  --green-800: #006B33;
  --green-700: #00843D;
  --green-400: #3DBA6F;
  --green-50: #EAF3EC;

  /* błąd: rdza, nie czerwień */
  --warn-700: #8A3A10;
  --warn-50: #FBEFE6;

  /* typografia */
  --serif: "Newsreader", "Source Serif 4", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* odstępy */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;

  /* promienie */
  --r-field: 6px;
  --r-btn: 10px;
  --r-drop: 16px;
  --r-sheet: 20px;
  --r-card: 20px;

  /* cienie: tylko karta na desktopie i arkusz */
  --shadow-card: 0 1px 0 rgba(20,33,26,.04), 0 12px 32px -18px rgba(20,33,26,.22);
  --shadow-sheet: 0 -12px 40px -20px rgba(0,0,0,.4);
  --scrim: rgba(20,33,26,.38);

  /* ruch */
  --ease: cubic-bezier(.2,.7,.2,1);

  /* układ */
  --gutter: 20px;
  --card-width: 440px;
  --pad-left: calc(var(--gutter) + env(safe-area-inset-left, 0px));
  --pad-right: calc(var(--gutter) + env(safe-area-inset-right, 0px));
}

@media (max-width: 359.98px) {
  :root { --gutter: 16px; }
}

/* ---------- podstawy ---------- */

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

html.is-sheet-open { overflow: hidden; }

h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
svg { display: block; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--green-900); outline-offset: 3px; }
[tabindex="-1"]:focus-visible { outline: none; }

/* ---------- liczby ---------- */

.num {
  font-family: var(--serif);
  font-variant-numeric: lining-nums tabular-nums;
}
.num .dec { font-variant-numeric: lining-nums proportional-nums; }
.num .cur {
  font-family: var(--sans);
  font-size: .5em;
  font-weight: 500;
  letter-spacing: 0;
}

/* ---------- karta aplikacji ---------- */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  min-height: 56px;
  padding: max(var(--s3), env(safe-area-inset-top, 0px)) var(--pad-right) 0 var(--pad-left);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-name {
  font: 500 20px/1 var(--serif);
  letter-spacing: -.005em;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-left: -6px;
  padding: 0 var(--s2) 0 2px;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.back svg { width: 20px; height: 20px; }

.demo-pill {
  padding: 2px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .02em;
  cursor: default;
}

.screens {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.screen {
  display: flex;
  flex: 1;
  flex-direction: column;
}
.screen.is-entering { animation: screen-in 200ms var(--ease); }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: var(--s3) var(--pad-right) var(--s5) var(--pad-left);
}

/* akcje przyklejone do dołu (wynik, szczegóły) */
.actions {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: var(--s3);
  padding: var(--s4) var(--pad-right) calc(var(--s4) + env(safe-area-inset-bottom, 0px)) var(--pad-left);
  background: var(--paper);
}
/* zanik nad akcjami: poza ich wysokością, żeby nie zabierał miejsca treści */
.actions::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: var(--s5);
  background: linear-gradient(to bottom, rgba(246,244,239,0), var(--paper));
  pointer-events: none;
}

@media (max-width: 599.98px) {
  /* ostatnia linia treści może wyjechać ponad przyklejone akcje */
  .screen[data-screen-name="wynik"] .content { padding-bottom: var(--s6); }
}

/* ---------- typografia ekranów ---------- */

.eyebrow {
  margin-bottom: var(--s3);
  color: var(--green-800);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.title {
  margin-bottom: var(--s4);
  font: 400 34px/1.12 var(--serif);
  font-variation-settings: "opsz" 60;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.title-details { font-size: 30px; margin-bottom: var(--s5); }
.title-details + .details-note { margin: calc(var(--s3) * -1) 0 var(--s5); font-size: 12px; }

.lead {
  margin-bottom: var(--s6);
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.5;
}
.lead-tight { margin-bottom: var(--s5); }

.fineprint {
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.45;
}
.fineprint-bottom {
  margin-top: auto;
  padding-top: var(--s6);
  text-align: center;
  font-size: 12px;
}
.fineprint-center {
  margin-top: var(--s3);
  text-align: center;
  font-size: 12px;
}

/* ---------- przyciski ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: var(--s3) var(--s5);
  border: 0;
  border-radius: var(--r-btn);
  font: 600 16px/1.2 var(--sans);
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 120ms var(--ease), box-shadow 120ms var(--ease);
}
.btn svg { width: 20px; height: 20px; flex: none; }

.btn-primary { background: var(--green-700); color: #fff; }
.btn-primary:active { background: var(--green-800); }

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

@media (hover: hover) {
  .btn-primary:hover { background: var(--green-800); }
  .btn-secondary:hover { box-shadow: inset 0 0 0 1px var(--ink-3); }
  .link:hover, .help summary:hover { color: var(--green-900); }
  .direct a:hover .direct-value { color: var(--green-800); }
}

.link {
  justify-self: center;
  min-height: 44px;
  padding: 0 var(--s2);
  border: 0;
  background: none;
  color: var(--green-800);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-restart {
  align-self: center;
  margin-top: var(--s4);
}

/* ---------- start: upload ---------- */

.upload { display: grid; gap: var(--s3); }

.upload-hint {
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}
.hint-pointer, .hint-dragging { display: none; }

.file-error {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  margin-bottom: var(--s4);
  padding: 14px var(--s4);
  border-radius: var(--r-btn);
  background: var(--warn-50);
  color: var(--warn-700);
  font-size: 15px;
  line-height: 1.45;
}
.file-error:empty { display: none; }
.file-error svg { width: 18px; height: 18px; margin-top: 2px; }
.file-error strong { font-weight: 600; }

.privacy {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: var(--s3);
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.privacy svg { width: 22px; height: 22px; margin-top: 1px; color: var(--green-800); }
.privacy p { font-size: 15px; line-height: 1.5; }
.privacy strong { font-weight: 600; }

.help { margin-top: var(--s3); }
.help summary {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 44px;
  font-size: 15px;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}
.help summary::-webkit-details-marker { display: none; }
.help summary::before {
  content: "";
  width: 7px;
  height: 7px;
  margin: 0 var(--s1) 0 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}
.help[open] summary::before { transform: rotate(45deg); }
.help p {
  padding: 0 0 var(--s2) 36px;
  color: var(--ink-2);
  font-size: 15px;
}

/* ---------- odczyt ---------- */

.file-row {
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: 28px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.file-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-row.is-removed .file-name { color: var(--ink-3); font-weight: 400; }
.file-size {
  flex: none;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  padding-bottom: var(--s5);
}
.step:last-child { padding-bottom: 0; }
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 32px;
  bottom: var(--s1);
  left: 13.5px;
  width: 1px;
  background: var(--line-strong);
}

.step-dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: #fff;
}
.step-dot svg { width: 15px; height: 15px; opacity: 0; transition: opacity 150ms ease; }

.step[data-state="active"] .step-dot {
  border-color: var(--green-700);
  border-right-color: transparent;
  animation: spin 1s linear infinite;
}
.step[data-state="done"] .step-dot { border-color: var(--green-700); background: var(--green-700); }
.step[data-state="done"] .step-dot svg { opacity: 1; }

@keyframes spin { to { transform: rotate(360deg); } }

.step-text { display: grid; gap: 2px; padding-top: 3px; }
.step-title { font-weight: 500; transition: color 150ms ease; }
.step-desc { color: var(--ink-2); font-size: 14px; }
.step[data-state="pending"] .step-title { color: var(--ink-3); }

/* ---------- wynik ---------- */

.confirmation {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-bottom: var(--s5);
  color: var(--green-800);
  font-size: 14px;
  font-weight: 500;
}
.confirmation svg { width: 18px; height: 18px; flex: none; }

.rate-label { margin-bottom: 2px; color: var(--ink-2); font-size: 15px; }
.rate-value { font-size: 30px; line-height: 1.15; color: var(--ink-2); }

.rate-now { padding-bottom: 18px; }
.rate-new { padding-top: 18px; border-top: 1px solid var(--line); }
.rate-new .rate-label { color: var(--ink); font-weight: 500; }

.rate-hero {
  font-size: 52px;
  line-height: 1.05;
  color: var(--green-900);
  letter-spacing: -.015em;
  font-variation-settings: "opsz" 72;
}
@media (max-width: 359.98px) {
  .rate-hero { font-size: clamp(42px, 13.5vw, 52px); }
}

.bars { display: grid; gap: 6px; margin-top: 14px; }
.bars span { display: block; height: 6px; border-radius: 3px; }
.bar-now { background: var(--line-strong); }
.bar-new {
  width: 0;
  background: var(--green-700);
  transition: width 500ms var(--ease);
}
.bar-new.is-filled { width: var(--ratio, 100%); }

.savings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: var(--s5);
  padding: var(--s4) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.savings p { display: grid; gap: 2px; }
.savings p + p { padding-left: var(--s4); border-left: 1px solid var(--line); }
.savings-value {
  color: var(--green-900);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.15;
}
.savings-label { color: var(--ink-2); font-size: 14px; }

.context {
  margin-top: var(--s4);
  color: var(--ink-2);
  font-size: 15px;
}
.context + .fineprint { margin-top: var(--s2); }

/* ---------- szczegóły ---------- */

.section-title {
  margin-bottom: var(--s1);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.details { margin-bottom: var(--s6); border-top: 1px solid var(--line); }
.details div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s4);
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.details dt { color: var(--ink-2); font-size: 15px; }
.details dd {
  font: 400 18px/1.3 var(--serif);
  text-align: right;
}
.details dd small {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font: 400 12px/1.4 var(--sans);
}
.details-offer dd { color: var(--green-900); }
.details .cur { font-size: 13px; }
.details + .fineprint { margin-top: calc(var(--s3) * -1); }

/* ---------- arkusz kontaktu ---------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--scrim);
  opacity: 0;
  transition: opacity 200ms ease;
}
.scrim.is-open { opacity: 1; }

.sheet {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 11;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px var(--pad-right) calc(18px + env(safe-area-inset-bottom, 0px)) var(--pad-left);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-sheet);
  transform: translateY(100%);
  transition: transform 240ms var(--ease);
}
.sheet.is-open { transform: none; }
.sheet.is-closing { transition-duration: 180ms; transition-timing-function: ease-in; }
.scrim.is-closing { transition-duration: 180ms; }

.sheet-grip {
  display: block;
  width: 40px;
  height: 4px;
  margin: 0 auto 18px;
  border-radius: 2px;
  background: var(--line-strong);
}

.sheet-close {
  position: absolute;
  top: 6px;
  right: calc(var(--pad-right) - 12px);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-2);
  cursor: pointer;
}
.sheet-close svg { width: 22px; height: 22px; }

.sheet-title {
  margin: 0 var(--s7) var(--s2) 0;
  font: 500 26px/1.2 var(--serif);
  text-wrap: balance;
}
.sheet-lead { margin-bottom: 20px; color: var(--ink-2); font-size: 15px; }

.direct { margin-bottom: var(--s5); border-top: 1px solid var(--line); }
.direct li { border-bottom: 1px solid var(--line); }
.direct a {
  display: grid;
  grid-template-columns: 20px 1fr 18px;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 10px 0;
  color: var(--ink);
  text-decoration: none;
}
.direct-icon { width: 20px; height: 20px; color: var(--green-800); }
.direct-chevron { width: 18px; height: 18px; color: var(--ink-3); }
.direct-text { display: grid; }
.direct-label { color: var(--ink-3); font-size: 13px; line-height: 1.35; }
.direct-value { font-weight: 500; line-height: 1.35; transition: color 120ms ease; }

.form-title {
  margin-bottom: var(--s3);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
}

.field { display: grid; gap: 6px; margin-bottom: var(--s4); }
.field label { font-size: 14px; font-weight: 500; line-height: 1.3; }
.field input:not([type="checkbox"]) {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--s3);
  border: 1px solid var(--line-field);
  border-radius: var(--r-field);
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
}
.field input:not([type="checkbox"]):focus-visible {
  outline: none;
  border-color: var(--green-900);
  box-shadow: inset 0 0 0 1px var(--green-900);
}
.field input[aria-invalid="true"]:not([type="checkbox"]) {
  border-color: var(--warn-700);
  box-shadow: inset 0 0 0 1px var(--warn-700);
}

.field-error { color: var(--warn-700); font-size: 13px; line-height: 1.4; }
.field-error:empty { display: none; }

.field-check { gap: 0; }
.check {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: var(--s3);
  min-height: 44px;
  color: var(--ink-2);
  cursor: pointer;
}
.check span { font-size: 14px; font-weight: 400; line-height: 1.4; }
.check input {
  appearance: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 1px solid var(--line-field);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
}
.check input::after {
  content: "";
  width: 6px;
  height: 11px;
  margin-top: -2px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) scale(0);
}
.check input:checked { border-color: var(--green-700); background: var(--green-700); }
.check input:checked::after { transform: rotate(45deg) scale(1); }
.check input[aria-invalid="true"] { border-color: var(--warn-700); box-shadow: inset 0 0 0 1px var(--warn-700); }
.check input:focus-visible { outline: 2px solid var(--green-900); outline-offset: 3px; }

.callback .btn { margin-top: var(--s2); }

.thanks { padding-top: var(--s2); }
.thanks-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: var(--s4);
  border-radius: 50%;
  background: var(--green-700);
  color: #fff;
}
.thanks-mark svg { width: 22px; height: 22px; }
.thanks .sheet-lead { margin-bottom: var(--s5); }

/* ---------- desktop i tablet: ta sama karta, wyśrodkowana ---------- */

@media (min-width: 600px) {
  :root { --gutter: 28px; }

  body { background: var(--page); }

  .app {
    width: calc(100% - 2 * var(--s6));
    max-width: var(--card-width);
    min-height: 0;
    margin: clamp(32px, 8vh, 64px) auto;
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
  }

  .bar { padding-top: var(--s4); }
  .content { padding-top: var(--s4); padding-bottom: 0; }
  .fineprint-bottom { padding-bottom: var(--s6); }

  /* akcje dalej przyklejone do dołu okna, gdy karta jest wyższa od niego;
     dolne rogi jak karta, bo tło akcji leży na jej krawędzi */
  .actions {
    padding-top: var(--s4);
    padding-bottom: 28px;
    border-radius: 0 0 var(--r-card) var(--r-card);
  }
  .actions::before { height: var(--s4); }
  /* miejsce pod zanikiem, żeby nie przygaszał ostatniej linii nieprzewiniętej treści */
  .content:has(+ .actions) { padding-bottom: var(--s4); }

  /* na desktopie panel z oddechem, jak karta, nie przyklejony do krawędzi okna */
  .sheet {
    --sheet-gap: clamp(32px, 8vh, 64px);
    right: auto;
    bottom: var(--sheet-gap);
    left: 50%;
    width: min(var(--card-width), calc(100% - 2 * var(--s6)));
    max-height: calc(100dvh - 2 * var(--sheet-gap));
    padding-top: var(--s5);
    padding-bottom: var(--s5);
    border-radius: var(--r-sheet);
    transform: translate(-50%, calc(100% + var(--sheet-gap)));
  }
  .sheet.is-open { transform: translate(-50%, 0); }
  .sheet-grip { display: none; }
  .sheet-close { top: 10px; }
}

/* ---------- szeroki desktop: zielony pas z kontekstem + ta sama karta ---------- */

.stage { display: none; }

@media (min-width: 1024px) {
  :root {
    --stage-w: clamp(440px, 46vw, 860px);
    --stage-accent: #7DDBA0; /* 6,2:1 na --green-900 */
  }

  body {
    display: grid;
    grid-template-columns: var(--stage-w) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
  }

  .stage {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    height: 100vh;
    height: 100dvh;
    padding: var(--s7) clamp(48px, 6vw, 112px);
    background: var(--green-900);
    color: #fff;
  }
  .stage-inner { width: 100%; max-width: 520px; }

  .stage-eyebrow {
    margin-bottom: var(--s5);
    color: var(--stage-accent);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .stage-title {
    margin-bottom: var(--s5);
    font: 400 clamp(36px, 3.4vw, 52px)/1.1 var(--serif);
    font-variation-settings: "opsz" 72;
    letter-spacing: -.015em;
    text-wrap: balance;
  }
  .stage-lead {
    max-width: 44ch;
    color: rgba(255,255,255,.78);
    font-size: 17px;
    line-height: 1.55;
    text-wrap: pretty;
  }

  /* motyw z logo: wiersze harmonogramu, ostatnie z niższą ratą */
  .ledger {
    margin: var(--s7) 0 var(--s6);
    border-top: 1px solid rgba(255,255,255,.16);
    font-size: 15px;
  }
  .ledger-head, .ledger-row {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: var(--s4);
    padding: 11px 0;
    border-bottom: 1px solid rgba(255,255,255,.16);
  }
  .ledger-head {
    color: rgba(255,255,255,.6);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .ledger-row {
    color: rgba(255,255,255,.62);
    font-family: var(--serif);
    font-variant-numeric: lining-nums tabular-nums;
  }
  .ledger-row span:last-child { text-align: right; }
  .ledger-row.is-new { color: #fff; }
  .ledger-row.is-new span:last-child { color: var(--stage-accent); font-weight: 500; }

  .stage-foot {
    color: rgba(255,255,255,.66);
    font-size: 14px;
  }

  .app { align-self: center; }

  /* arkusz kontaktu wyśrodkowany nad kolumną karty, nie nad całym oknem */
  .sheet { left: calc(var(--stage-w) + (100% - var(--stage-w)) / 2); }
}

@media (min-width: 1024px) and (max-height: 679.98px) {
  .ledger { display: none; }
}

/* przeciąganie pliku: tylko z myszką i na szerszym ekranie */
@media (min-width: 600px) and (hover: hover) and (pointer: fine) {
  .upload {
    padding: var(--s4);
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--r-drop);
    background: var(--surface);
    transition: border-color 120ms ease, background-color 120ms ease;
  }
  .hint-touch { display: none; }
  .hint-pointer { display: inline; }

  .app.is-dragging .upload {
    padding: calc(var(--s4) - .5px);
    border: 2px solid var(--green-700);
    background: var(--green-50);
  }
  .app.is-dragging .hint-pointer,
  .app.is-dragging .file-error { display: none; }
  .app.is-dragging .hint-dragging { display: inline; color: var(--green-800); font-weight: 500; }
}

/* ---------- ograniczony ruch ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .step[data-state="active"] .step-dot {
    animation: none;
    border-right-color: var(--green-700);
  }
}
