/* Migiem jako faktura: papier na atramencie, ząbkowana krawędź z ikony aplikacji, dwa kolory druku
   i zielony tylko tam, gdzie KSeF coś przyjął. Ruch w czystym CSS (CSP nie wpuszcza skryptów). */

:root {
  color-scheme: light;
  --ink: #161615;
  --paper: #f6f5f1;
  --sheet: #ffffff;
  --tone: #e9e7e1;
  --muted: #64635e;
  --ink-muted: #a9a7a0;
  --accent: #1d7348;
  --accent-soft: #e3f0e7;
  --late: #bc3424;
  --due: #94570a;

  --t-xl: clamp(56px, 10.5vw, 168px);
  --t-l: clamp(36px, 5vw, 76px);
  --t-m: clamp(21px, 1.8vw, 28px);
  --t-body: 18px;
  --t-s: 14px;

  --margin: clamp(16px, 2.2vw, 32px);
  --gap: clamp(24px, 4vw, 64px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --teeth-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12'%3E%3Cpath d='M0 0h24L12 12z' fill='%23f6f5f1'/%3E%3C/svg%3E");
  --teeth-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12'%3E%3Cpath d='M0 12h24L12 0z' fill='%23f6f5f1'/%3E%3C/svg%3E");
}

body.home {
  background: var(--ink);
  color: var(--ink);
  font-size: var(--t-body);
  line-height: 1.5;
}

.home h1,
.home h2,
.home h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0;
  text-wrap: balance;
}

.home p {
  margin: 0;
}

.frame {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: var(--margin);
}

/* Jeden kształt przycisku na całej stronie: pełna pigułka, płaski kolor. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 24px 8px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-body);
  letter-spacing: -0.02em;
  text-decoration: none;
  transition: transform 0.3s var(--ease), background-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  background: #34332f;
}

.btn:active {
  transform: scale(0.96);
}

.btn svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.btn.light {
  background: var(--paper);
  color: var(--ink);
}

.btn.light:hover {
  background: var(--tone);
}

/* ---------- 1. Faktura ---------- */

.hero {
  padding-block: var(--margin) calc(var(--margin) + 12px);
}

.inv {
  position: relative;
  width: 100%;
  margin-inline: auto;
  background: var(--paper);
  padding: clamp(20px, 3.4vw, 48px);
  padding-bottom: clamp(28px, 3.4vw, 48px);
}

.inv::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 12px;
  background: var(--teeth-down) 0 0 / 24px 12px repeat-x;
}

.inv-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: clamp(32px, 5vw, 64px);
  font-size: var(--t-s);
}

.inv-top .brand {
  font-size: var(--t-body);
}

.inv-top .no {
  color: var(--muted);
}

.inv-top nav {
  display: contents;
}

.inv-top .links {
  display: flex;
  gap: 4px;
  margin-right: -10px;
}

.inv-top .links a {
  padding: 10px;
  text-decoration: none;
  font-size: var(--t-s);
  font-weight: 500;
}

.inv-top .links a:hover {
  text-decoration: underline;
}

.inv-body {
  display: grid;
  gap: 40px clamp(40px, 6vw, 96px);
}

.inv h1 {
  font-size: var(--t-l);
  margin-bottom: clamp(20px, 2.4vw, 32px);
}

@media (min-width: 960px) {
  .inv-body {
    grid-template-columns: 1.15fr 1fr;
    align-items: end;
  }

  .inv-side {
    display: grid;
    gap: 32px;
  }
}

.parties {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 8px clamp(24px, 5vw, 72px);
  margin: 0 0 clamp(48px, 5vw, 64px);
  font-size: var(--t-s);
}

.parties dt {
  color: var(--muted);
}

.parties dd {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

/* Prawdziwa tabela pozycji, więc linie zostają. */
.items {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.items th {
  text-align: left;
  font-weight: 400;
  font-size: var(--t-s);
  color: var(--muted);
  padding: 0 0 10px;
  border-bottom: 2px solid var(--ink);
}

.items td {
  padding: 14px 0;
  border-bottom: 1px solid #d9d7d0;
  vertical-align: baseline;
}

.items .r {
  text-align: right;
}

.items td.r {
  font-weight: 600;
  white-space: nowrap;
}

.items .q {
  color: var(--muted);
  padding-inline: 16px;
  white-space: nowrap;
}


.total p {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.total span {
  font-size: var(--t-body);
  color: var(--muted);
}

.total b {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-l);
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.seal {
  display: flex;
  justify-content: flex-end;
  align-items: end;
  gap: 16px;
  text-align: right;
}

.qr {
  position: relative;
  width: 132px;
  height: 132px;
  padding: 10px;
  background: var(--sheet);
  border-radius: 14px;
}

.qr img {
  display: block;
  width: 100%;
  height: 100%;
}

/* Logo w polu, które generator QR zostawił puste. */
.qr .qr-logo {
  position: absolute;
  inset: 0;
  width: 30px;
  height: 30px;
  margin: auto;
  border-radius: 7px;
}

.seal p {
  font-size: var(--t-s);
  color: var(--muted);
  max-width: 9em;
  line-height: 1.35;
}

.stamp {
  position: absolute;
  right: clamp(20px, 6vw, 88px);
  top: clamp(96px, 7.6vw, 112px);
  padding: 10px 18px;
  border: 3px solid var(--accent);
  border-radius: 10px;
  color: var(--accent);
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-m);
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-align: center;
  transform: rotate(-8deg);
}

.stamp small {
  display: block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: var(--t-s);
  letter-spacing: 0;
}

@media (max-width: 759px) {
  .inv-top .no {
    display: none;
  }

  .parties {
    grid-template-columns: 1fr 1fr;
  }

  .parties div:last-child {
    display: none;
  }

  .items .q {
    display: none;
  }

  .seal {
    display: none;
  }

  .stamp {
    position: static;
    width: max-content;
    margin: 28px 8px 4px auto;
    font-size: 21px;
    padding: 8px 14px;
  }

  .stores .btn {
    flex: 1 1 140px;
    padding-inline: 12px;
    font-size: 16px;
    white-space: nowrap;
  }
}

/* ---------- 2. Od NIP-u do przelewu ---------- */

.flow {
  background: var(--paper);
  padding-block: clamp(80px, 9vw, 128px) clamp(56px, 6vw, 96px);
}

.flow > .frame > h2 {
  font-size: var(--t-l);
  margin-bottom: clamp(48px, 6vw, 96px);
  max-width: 12em;
}

.story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--gap);
  row-gap: 64px;
  view-timeline-name: --story;
}

.plates,
.steps {
  display: contents;
}

.plate {
  grid-column: 1;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--tone);
  container-type: inline-size;
}

.plate:nth-child(1) { grid-row: 1; }
.plate:nth-child(2) { grid-row: 2; }
.plate:nth-child(3) { grid-row: 3; }
.plate:nth-child(4) { grid-row: 4; }

.step {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.step:nth-child(1) { grid-row: 1; }
.step:nth-child(2) { grid-row: 2; }
.step:nth-child(3) { grid-row: 3; }
.step:nth-child(4) { grid-row: 4; }

.step h3 {
  font-size: var(--t-l);
}

.step p {
  max-width: 26em;
}

@media (max-width: 799px) {
  .story {
    grid-template-columns: 1fr;
    row-gap: 24px;
  }

  .plate,
  .step {
    grid-column: 1;
  }

  .plate:nth-child(1) { grid-row: 1; }
  .step:nth-child(1) { grid-row: 2; }
  .plate:nth-child(2) { grid-row: 3; }
  .step:nth-child(2) { grid-row: 4; }
  .plate:nth-child(3) { grid-row: 5; }
  .step:nth-child(3) { grid-row: 6; }
  .plate:nth-child(4) { grid-row: 7; }
  .step:nth-child(4) { grid-row: 8; }

  .step {
    padding-bottom: 48px;
  }

  .app {
    font-size: 4.3cqi;
    margin-top: 2.4em;
  }
}

/* Ekran aplikacji w kadrze: bez ramki telefonu, przycięty dołem. Jednostki w em, więc skaluje się z kadrem. */
.app {
  width: 22em;
  margin: 3.2em auto 0;
  min-height: 30em;
  padding: 1.1em 1em 2em;
  border-radius: 2.2em 2.2em 0 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 3.6cqi;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.app-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.85em;
  letter-spacing: -0.035em;
  margin: 0.3em 0 0.6em;
}

.app-title svg {
  width: 0.7em;
  height: 0.7em;
}

.a-card {
  background: var(--sheet);
  border-radius: 0.9em;
  padding: 0.75em 0.9em;
  margin-bottom: 0.5em;
  font-size: 0.92em;
}

.a-label {
  color: var(--muted);
  font-size: 0.78em;
  margin-bottom: 0.25em;
}

.a-field {
  display: flex;
  align-items: center;
  gap: 0.4em;
  background: #eeede8;
  border-radius: 0.6em;
  padding: 0.55em 0.7em;
  margin-bottom: 0.6em;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.a-field small {
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
}

.caret {
  width: 0.09em;
  height: 1.1em;
  background: var(--ink);
}

.a-strong {
  font-weight: 600;
}

.a-sub {
  color: var(--muted);
  font-size: 0.82em;
}

.a-ok svg {
  width: 0.9em;
  height: 0.9em;
}

.a-ok {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  margin-top: 0.5em;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78em;
  font-weight: 500;
}

.a-pair {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.a-button {
  margin-top: 0.8em;
  padding: 0.8em;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  font-weight: 600;
  font-size: 0.92em;
}

.a-button.soft {
  margin-top: 0.4em;
  background: var(--tone);
  color: var(--ink);
}

.done {
  text-align: center;
  padding-top: 1.6em;
}

.done .tick {
  width: 3.6em;
  height: 3.6em;
  margin: 0 auto 0.8em;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
}

.done .tick svg {
  width: 1.8em;
  height: 1.8em;
}

.done h4 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.6em;
  letter-spacing: -0.03em;
  margin: 0 0 0.2em;
}

.done .a-card {
  text-align: left;
  margin-top: 1.4em;
}

.done .a-card div:last-child {
  font-weight: 500;
  word-break: break-all;
}

.a-label-row {
  color: var(--muted);
  font-size: 0.78em;
}

.a-big {
  font-family: var(--display);
  font-weight: 600;
  font-size: 2.3em;
  letter-spacing: -0.045em;
  line-height: 1.1;
  margin-bottom: 0.15em;
}

.a-hint {
  color: var(--muted);
  font-size: 0.78em;
  margin-bottom: 0.9em;
}

.a-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0.2em;
  border-radius: 0.75em;
  background: var(--tone);
  margin-bottom: 0.9em;
  font-size: 0.74em;
  color: var(--muted);
  text-align: center;
}

.a-seg span {
  padding: 0.45em 0;
  border-radius: 0.6em;
}

.a-seg .on {
  background: var(--sheet);
  color: var(--ink);
  font-weight: 500;
}

.a-list {
  background: var(--sheet);
  border-radius: 0.9em;
  padding-left: 0.9em;
}

.a-row {
  display: grid;
  grid-template-columns: 1fr auto 1.1em;
  align-items: center;
  gap: 0.1em 0.6em;
  padding: 0.65em 0.8em 0.65em 0;
  font-size: 0.85em;
}

.a-row + .a-row {
  border-top: 1px solid #ebe9e3; /* taste-skill-ignore: separator inside the app's own list */
}

.a-row .amt {
  font-weight: 600;
}

.a-row .meta {
  grid-column: 1 / 3;
  font-size: 0.82em;
  color: var(--muted);
}

.a-row .dot {
  grid-row: 1 / 3;
  grid-column: 3;
  width: 1.1em;
  height: 1.1em;
  border-radius: 50%;
  border: 0.1em solid #a8a7a1;
}

.a-row.paid .meta b { color: var(--accent); font-weight: 500; }
.a-row.paid .dot { border: 0; background: var(--accent); }
.a-row.late .meta b { color: var(--late); font-weight: 500; }
.a-row.late .dot { border-color: var(--late); }
.a-row.due .meta b { color: var(--due); font-weight: 500; }

/* ---------- 3. Daty ---------- */

.dates {
  padding-block: clamp(72px, 9vw, 128px);
}

.receipt {
  position: relative;
  width: min(760px, calc(100% - 20px));
  margin-inline: auto;
  background: var(--paper);
  padding: clamp(40px, 6vw, 72px) clamp(20px, 6vw, 72px);
}

.receipt::before,
.receipt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 12px;
}

.receipt::before {
  bottom: 100%;
  background: var(--teeth-up) 0 0 / 24px 12px repeat-x;
}

.receipt::after {
  top: 100%;
  background: var(--teeth-down) 0 0 / 24px 12px repeat-x;
}

.receipt h2 {
  font-size: var(--t-l);
  text-align: center;
  margin-bottom: 16px;
}

.receipt .note {
  text-align: center;
  font-size: var(--t-s);
  color: var(--muted);
  margin-bottom: 40px;
}

/* Jedna żywa rzecz: wybierasz, ile sprzedajesz, a kartka zaznacza Twój termin. Bez skryptu, przez :has(). */
.pick {
  border: 0;
  margin: 0 0 48px;
  padding: 24px;
  background: var(--tone);
  text-align: center;
}

.pick legend {
  float: left;
  width: 100%;
  margin-bottom: 16px;
  font-weight: 600;
}

.pick .opts {
  clear: both;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--paper);
}

.pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pick label {
  padding: 12px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pick label:hover {
  background: var(--tone);
}

.pick input:checked + label {
  background: var(--ink);
  color: var(--paper);
}

.pick input:focus-visible + label {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.line {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  font-variant-numeric: tabular-nums;
}

/* Oś to perforacja paragonu: okrągłe kropki, nie linia. */
.line::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: calc(40% + 2px);
  border-left: 6px dotted #c9c7bf;
}

.line li {
  position: relative;
  display: grid;
  grid-template-columns: 40% 1fr;
  column-gap: 36px;
  padding-block: 18px;
}

.line li::before {
  content: "";
  position: absolute;
  left: calc(40% - 5px);
  top: 26px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 6px var(--paper); /* taste-skill-ignore: a paper ring that cuts the perforation, not a shadow */
  transition: background-color 0.3s ease, transform 0.4s var(--ease);
}

.line time {
  text-align: right;
  padding-right: 24px;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-m);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.line .what {
  font-weight: 600;
  font-size: var(--t-m);
  font-family: var(--display);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.line .sub {
  color: var(--muted);
  font-size: 16px;
  margin-top: 4px;
}

.line .you {
  display: none;
  justify-self: start;
  margin-top: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--paper);
  font-size: var(--t-s);
  font-weight: 600;
}

.line .later::before {
  background: var(--paper);
  border: 3px dashed #a8a7a1;
}

.line .later time,
.line .later .what {
  color: var(--muted);
}

.dates:has(#m-small:checked) .e-2027::before,
.dates:has(#m-big:checked) .e-2026::before {
  background: var(--accent);
  transform: scale(1.3);
}

.dates:has(#m-small:checked) .e-2027 .you,
.dates:has(#m-big:checked) .e-2026 .you {
  display: block;
}

.dates:has(#m-small:checked) .e-2027 time,
.dates:has(#m-big:checked) .e-2026 time {
  color: var(--accent);
}

.receipt .close {
  margin-top: 48px;
  text-align: center;
}

.receipt .close a {
  font-weight: 600;
  text-underline-offset: 0.25em;
}

@media (max-width: 599px) {
  .line::before {
    left: 9px;
  }

  .line li {
    grid-template-columns: 1fr;
    padding-left: 44px;
  }

  .line li::before {
    left: 2px;
    top: 22px;
  }

  .line time {
    text-align: left;
    padding-right: 0;
  }

  .pick label {
    padding: 12px 14px;
  }
}

/* ---------- 4. Pytanie ---------- */

.ask {
  overflow-x: clip;
  padding-inline: var(--margin);
  background: var(--paper);
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding-block: 32px 24px;
  text-align: center;
}

.ask h2 {
  display: contents;
}

.ask h2 span {
  display: block;
  order: 1;
  font-size: var(--t-xl);
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.ask h2 span:last-child {
  order: 3;
}

.ask .mid {
  order: 2;
  align-self: center;
  display: grid;
  justify-items: center;
  gap: 20px;
  padding-block: clamp(48px, 6vw, 88px);
}

.ask .or {
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 56px);
}

.ask .or span {
  color: var(--muted);
}

.ask .btn {
  min-width: 220px;
}

.ask .mid p {
  color: var(--muted);
}

@media (max-width: 599px) {
  .ask h2 span {
    font-size: 12vw;
  }

  .ask .or {
    flex-direction: column;
    gap: 12px;
  }

  .ask .btn {
    min-width: 72vw;
  }
}

/* ---------- 5. Stopka: znak z klocków ---------- */

.foot {
  color: var(--paper);
  padding-block: clamp(64px, 8vw, 120px) 32px;
}

.mark {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 4px;
  height: 34svh;
  min-height: 180px;
  margin-bottom: 56px;
}

.mark span {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-xl);
  line-height: 0.8;
  letter-spacing: -0.04em;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.mark span:nth-child(2) { height: 72%; }
.mark span:nth-child(3) { height: 88%; }
.mark span:nth-child(4) { height: 62%; }
.mark span:nth-child(5) { height: 94%; }
.mark span:nth-child(6) { height: 80%; background: var(--accent); color: var(--paper); }

.foot-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px var(--gap);
  font-size: 16px;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
}

.foot nav a,
.foot p a {
  color: var(--paper);
  text-underline-offset: 0.25em;
}

.foot nav a {
  padding-block: 6px;
}

.foot .legal {
  color: var(--ink-muted);
  max-width: 34em;
  justify-self: end;
  text-align: right;
}

@media (max-width: 759px) {
  .foot .legal {
    justify-self: start;
    text-align: left;
  }
}

.foot-end {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  color: var(--ink-muted);
  font-size: var(--t-s);
}

.foot-end .btn {
  min-height: 44px;
  padding: 6px 20px;
  font-size: 16px;
}

@media (max-width: 759px) {
  .mark {
    height: 22svh;
    min-height: 120px;
  }

  .mark span {
    font-size: 15vw;
  }

  .foot-row {
    grid-template-columns: 1fr;
  }
}

/* ---------- Ruch ---------- */

@media (prefers-reduced-motion: no-preference) {
  /* Faktura „wychodzi z drukarki”: kartka, potem wiersze, kwota i na końcu pieczątka KSeF. */
  .inv {
    animation: print 1s var(--ease) both;
  }

  .inv h1,
  .parties,
  .items tbody tr,
  .total,
  .seal {
    animation: rise 0.8s var(--ease) both;
  }

  .inv h1 { animation-delay: 0.15s; }
  .parties { animation-delay: 0.25s; }
  .items tbody tr:nth-child(1) { animation-delay: 0.35s; }
  .items tbody tr:nth-child(2) { animation-delay: 0.42s; }
  .items tbody tr:nth-child(3) { animation-delay: 0.49s; }
  .items tbody tr:nth-child(4) { animation-delay: 0.56s; }
  .total { animation-delay: 0.4s; }
  .seal { animation-delay: 0.7s; }

  .stamp {
    animation: stamp 0.5s 1.05s cubic-bezier(0.3, 0, 0.2, 1) both;
  }

  .caret {
    animation: blink 1.1s steps(1) infinite;
  }

  @keyframes print {
    from { opacity: 0; transform: translateY(-48px); }
  }

  @keyframes rise {
    from { opacity: 0; transform: translateY(20px); }
  }

  @keyframes stamp {
    from { opacity: 0; transform: rotate(-8deg) scale(1.6); }
  }

  @keyframes blink {
    50% { opacity: 0; }
  }

  @supports (animation-timeline: view()) {
    .flow > .frame > h2,
    .step h3,
    .step p,
    .receipt h2,
    .receipt .note,
    .pick,
    .line li,
    .ask .mid,
    .mark span,
    .foot-row {
      animation: rise linear forwards;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }

    .step p,
    .receipt .note { animation-range: entry 8% entry 78%; }
    .line li:nth-child(2) { animation-range: entry 6% entry 76%; }
    .line li:nth-child(3) { animation-range: entry 12% entry 82%; }
    .line li:nth-child(4) { animation-range: entry 18% entry 88%; }
    .mark span:nth-child(2n) { animation-range: entry 8% entry 78%; }
    .mark span:nth-child(3n) { animation-range: entry 16% entry 86%; }

    .ask h2 span {
      animation: push linear both;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }

    .ask h2 span:last-child {
      animation-name: push-back;
    }

    @keyframes push {
      from { transform: translateX(-8%); }
      to { transform: translateX(8%); }
    }

    @keyframes push-back {
      from { transform: translateX(8%); }
      to { transform: translateX(-8%); }
    }
  }

  /* Ruch podpisowy: kadr z aplikacją stoi, a kroki przewijają się obok i podmieniają ekran. */
  @supports (animation-timeline: view()) {
    @media (min-width: 800px) {
      .plates {
        display: grid;
        grid-column: 1;
        grid-row: 1 / 5;
        position: sticky;
        top: max(24px, calc(50svh - min(41vw, 84svh, 650px) / 2));
        align-self: start;
      }

      .plate:nth-child(n) {
        grid-area: 1 / 1;
        width: min(100%, 84svh);
        animation: linear both;
        animation-timeline: --story;
        animation-range: contain 0% contain 100%;
      }

      .plate:nth-child(1) { animation-name: p1; }
      .plate:nth-child(2) { animation-name: p2; }
      .plate:nth-child(3) { animation-name: p3; }
      .plate:nth-child(4) { animation-name: p4; }

      .story {
        row-gap: 0;
      }

      .step {
        min-height: 84svh;
      }

      /* Okna się nie nakładają: w każdej chwili widać jeden ekran. */
      @keyframes p1 {
        0%, 14% { opacity: 1; visibility: visible; transform: none; }
        15%, 100% { opacity: 0; visibility: hidden; transform: scale(0.97); }
      }

      @keyframes p2 {
        0%, 14% { opacity: 0; visibility: hidden; transform: translateY(32px); }
        17%, 49% { opacity: 1; visibility: visible; transform: none; }
        50%, 100% { opacity: 0; visibility: hidden; transform: scale(0.97); }
      }

      @keyframes p3 {
        0%, 50% { opacity: 0; visibility: hidden; transform: translateY(32px); }
        53%, 85% { opacity: 1; visibility: visible; transform: none; }
        86%, 100% { opacity: 0; visibility: hidden; transform: scale(0.97); }
      }

      @keyframes p4 {
        0%, 86% { opacity: 0; visibility: hidden; transform: translateY(32px); }
        89%, 100% { opacity: 1; visibility: visible; transform: none; }
      }
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .caret {
    opacity: 1;
  }
}

.a-seg.two {
  grid-template-columns: 1fr 1fr;
}
