*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
button, a, label, input, summary { touch-action: manipulation; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.6 var(--font-body); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 500; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); line-height: 1.1; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); line-height: 1.2; }
h3 { font-size: 1.25rem; line-height: 1.3; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--text-muted); }
.small { font-size: 14px; }

/* Przyciski */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--h-control); padding: 0 24px; border: 1px solid transparent; border-radius: var(--radius-control); background: var(--cta); color: var(--on-cta); font: 600 16px/1.2 var(--font-body); text-decoration: none; cursor: pointer; transition: background-color .15s; }
.btn:hover { background: var(--cta-hover); }
.btn:active { background: var(--cta-active); }
.btn-ghost { background: transparent; border-color: var(--field-border); color: var(--text); }
@media (hover: hover) { .btn-ghost:hover { background: var(--surface-raised); } }
.btn-ghost:active { background: var(--surface); }
.btn-small { min-height: var(--h-control); padding: 0 16px; font-size: 15px; }
.btn-wide { width: 100%; }
.btn[disabled] { background: var(--surface-raised); color: var(--disabled); cursor: not-allowed; }
.btn.is-loading { pointer-events: none; }
.spinner { display: none; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Karty */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 24px; }
.card-link { display: flex; flex-direction: column; gap: 4px; height: 100%; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.card-link:hover { border-color: var(--field-border); transform: translateY(-2px); }
.card-link strong { font-weight: 600; }
.card-link span { color: var(--text-muted); font-size: 14px; line-height: 1.45; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--surface-raised); color: var(--text); font-size: 13px; }

/* Pola */
label, .label { display: block; margin-bottom: 6px; font-weight: 500; }
.field { margin-bottom: 20px; }
.input { display: block; width: 100%; min-height: var(--h-control); padding: 10px 14px; background: var(--surface); border: 1px solid var(--field-border); border-radius: var(--radius-control); color: var(--text); font: 400 16px/1.5 var(--font-body); }
textarea.input { min-height: 96px; resize: vertical; }
.input::placeholder { color: var(--text-muted); }
.input:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.has-error .input { border-color: var(--error); }
.hint, .counter { color: var(--text-muted); font-size: 14px; }
.counter { display: block; text-align: right; font-variant-numeric: tabular-nums; }
.err { display: flex; gap: 6px; margin: 6px 0 0; color: var(--error); font-size: 14px; }
.err::before { content: "⚠"; }
.ok { color: var(--success); }
.ok::before { content: "✓ "; }
.check { display: flex; gap: 12px; align-items: flex-start; min-height: var(--h-control); margin-bottom: 10px; font-weight: 400; cursor: pointer; }
.check input { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--cta); }

/* Kafelek wyboru */
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice { position: relative; display: block; margin: 0; cursor: pointer; font-weight: 400; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice-body { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; height: 100%; padding: 10px 34px 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-control); line-height: 1.3; transition: border-color .15s; }
.choice-body b { font-weight: 600; font-size: 15px; }
.choice-body small { color: var(--text-muted); font-size: 14px; }
.choice:hover .choice-body { border-color: var(--field-border); }
.choice input:focus-visible + .choice-body { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice input:checked + .choice-body { border: 2px solid var(--cta); padding: 9px 33px 9px 13px; }
.choice input:checked + .choice-body::after { content: "✓"; position: absolute; top: 8px; right: 12px; color: var(--cta); font-weight: 700; }

/* Odtwarzacz */
.player { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--surface-raised); border-radius: var(--radius-card); }
.play { flex: none; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: var(--bg); cursor: pointer; }
.play::before { content: ""; width: 0; height: 0; margin-left: 3px; border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent currentColor; }
.play.is-playing::before { width: 12px; height: 14px; margin: 0; border-width: 0 4px; border-color: currentColor; }
.play[disabled] { background: var(--line); color: var(--disabled); cursor: not-allowed; }
.wave { flex: 1; display: flex; align-items: center; gap: 3px; height: 40px; min-width: 0; overflow: hidden; }
.wave i { flex: 1 1 3px; min-width: 2px; max-width: 5px; border-radius: 2px; background: var(--field-border); height: 30%; }
.wave i:nth-child(5n+1) { height: 48%; } .wave i:nth-child(5n+2) { height: 78%; } .wave i:nth-child(5n+3) { height: 100%; } .wave i:nth-child(5n+4) { height: 62%; } .wave i:nth-child(7n) { height: 36%; } .wave i:nth-child(11n) { height: 88%; }
.wave i.is-played { background: var(--cta); }
.is-playing-wave i { animation: pulse 1.1s ease-in-out infinite alternate; }
.is-playing-wave i:nth-child(3n) { animation-delay: .2s; } .is-playing-wave i:nth-child(3n+1) { animation-delay: .45s; }
@keyframes pulse { to { transform: scaleY(.65); } }
.time { flex: none; color: var(--text-muted); font-size: 14px; font-variant-numeric: tabular-nums; }

/* Pasek postępu konfiguratora */
.progress-label { display: flex; justify-content: space-between; align-items: center; min-height: 28px; margin-bottom: 4px; color: var(--text-muted); font-size: 14px; }
.progress-track { height: 6px; margin-bottom: 14px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress-fill { display: block; height: 100%; background: var(--cta); border-radius: 3px; }
.progress-fill.s1 { width: 33.34%; } .progress-fill.s2 { width: 66.67%; } .progress-fill.s3 { width: 100%; }

/* Akordeon */
.faq { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; gap: 16px; align-items: center; min-height: 56px; padding: 12px 0; font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; color: var(--accent); font-size: 24px; line-height: 1; }
.faq[open] summary::after { content: "–"; }
.faq p { color: var(--text-muted); }

/* Listy i komunikaty */
.ticks li { position: relative; padding-left: 26px; margin-bottom: 8px; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.notice { padding: 12px 16px; background: var(--surface-raised); border-left: 3px solid var(--accent); border-radius: 8px; font-size: 15px; }
.notice-err { border-left-color: var(--error); }

/* Lejek */
.rail { display: grid; grid-template-rows: repeat(2, auto); grid-auto-flow: column; grid-auto-columns: max-content; gap: 10px; margin-inline: calc(var(--gutter) * -1); padding: 4px var(--gutter); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
/* Na komputerze bez przewijania na boki: wszystkie kafelki widać od razu. */
@media (min-width: 901px) { .rail { display: flex; flex-wrap: wrap; margin-inline: 0; padding: 4px 0; overflow-x: visible; } }
.rail::-webkit-scrollbar { display: none; }
.rail .choice { flex: 0 0 auto; scroll-snap-align: center; min-width: 132px; max-width: 200px; }
.rail .choice-body { min-height: 48px; padding: 6px 30px 6px 12px; }
/* Niski telefon: bez opisów stylów, żeby krok 1 mieścił się bez przewijania. */
@media (max-height: 700px) and (max-width: 900px) {
  .rail .choice-style small { display: none; }
  .funnel .choices .choice-body { min-height: 48px; }
}
.rail .choice-style { width: 188px; }
.choice-style .choice-body { flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; min-height: 52px; }
.choice-text { display: flex; flex-direction: column; min-width: 0; }
.play-small { position: relative; z-index: 1; width: 48px; height: 48px; }
.bar { display: block; height: 3px; margin-top: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--cta); transform: scaleX(var(--done, 0)); transform-origin: left; }
.back { display: inline-flex; align-items: center; min-height: var(--h-control); color: var(--text); text-decoration: none; }
.step-title { font-size: clamp(1.5rem, 6vw, 2.25rem); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { min-height: var(--h-control); padding: 0 14px; border: 1px solid var(--field-border); border-radius: 999px; background: transparent; color: var(--text); font: 500 15px/1 var(--font-body); cursor: pointer; }
.chip:hover { background: var(--surface-raised); }
.more { margin-bottom: 16px; }
.more summary { display: flex; align-items: center; min-height: var(--h-control); color: var(--link); cursor: pointer; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "+ "; white-space: pre; }
.more[open] summary::before { content: "– "; }
.reassure { padding: 12px 14px; background: var(--surface); border-radius: var(--radius-control); font-size: 14px; color: var(--text-muted); }
.wizard-bar { position: fixed; inset: auto 0 var(--keyboard) 0; z-index: 30; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.wizard-bar .btn { display: flex; max-width: var(--narrow); margin-inline: auto; }
.bar-note { margin: 0 0 6px; max-width: var(--narrow); margin-inline: auto; color: var(--text-muted); font-size: 14px; line-height: 1.3; }
.wizard-bar-order .btn { margin-bottom: 6px; }
.bar-note b { color: var(--text); }
.bar-spacer { height: 110px; }
.song-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.order-check { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; padding: 10px 14px; }
.order-check p { margin: 0; }
.order-check a { display: inline-flex; align-items: center; min-height: var(--h-control); flex: none; }
.price-promo { margin: 0 0 4px; }
.badge-promo { background: var(--surface-raised); color: var(--text); border: 1px solid var(--field-border); }
.price-old { color: var(--text-muted); font-size: .6em; font-weight: 400; margin-right: 6px; }
.price-law { margin: 0 0 8px; color: var(--text); font-size: 15px; }
.price-start { margin: 0; color: var(--text-muted); font-size: 15px; }
.price-all { margin: 0 0 8px; color: var(--text-muted); font-size: 15px; }
.hero-express { margin: 8px 0 0; padding: 8px 12px; background: var(--surface-raised); border-radius: var(--radius-control); font-size: 0.9375rem; }
.hero-price .price { margin: 12px 0 4px; font-size: 32px; }
.order-price .price { margin: 0 0 4px; font-size: 26px; }
.choice[hidden], .field[hidden] { display: none; }
[data-save-status] { min-height: 1.5em; }
.req { color: var(--error); font-weight: 600; }
.lyrics-label { font-size: 1rem; margin: 20px 0 8px; }
.lyrics-row { margin-bottom: 10px; }
.lyrics-line { font-size: 17px; }
.syl { display: block; font-size: 0.8125rem; color: var(--text-muted); margin-top: 2px; }
.syl.is-off { color: var(--error); font-weight: 600; }
.lyrics-ask { margin: 16px 0; }
.lyrics-ask summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.lyrics-actions { display: grid; gap: 8px; margin-top: 12px; }
.lyrics-proposal { margin: 0 0 6px; padding: 8px 12px; border-radius: var(--radius-control); }
.lyrics-proposal.is-changed { background: var(--surface-raised); font-weight: 600; }
.lyrics-proposal .hint { display: block; font-weight: 400; }
.lyrics-view { white-space: pre-wrap; font: 400 17px/1.6 var(--font-body); background: var(--surface); border-radius: var(--radius-control); padding: 16px; }
.status { display: grid; gap: 8px; margin: 0 0 20px; }
.status li { padding-left: 26px; position: relative; color: var(--text-muted); }
.status li::before { content: "○"; position: absolute; left: 0; }
.status li.is-done { color: var(--text); }
.status li.is-done::before { content: "✓"; color: var(--success); }
.status li[aria-current] { font-weight: 600; }
.draft-banner[hidden] { display: none; }
.draft-banner { background: var(--surface-raised); border-bottom: 1px solid var(--line); padding-block: 8px; }
.draft-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.funnel .draft-banner { display: none; }
.funnel .cookie { bottom: calc(69px + var(--keyboard) + env(safe-area-inset-bottom)); }
.funnel:has(.wizard-bar-order) .cookie { bottom: calc(190px + var(--keyboard) + env(safe-area-inset-bottom)); }
.pre { white-space: pre-line; }
