/* ==========================================================================
   Regina Caeli - chormarki.pl
   Tokeny, reset, layout, sekcje, Strefa Chórzysty.
   Mobile-first; rozszerzenia w @media (min-width: …).
   Promienie: kontrolki 2px, panele/karty 4px (jedna skala dla całej strony).
   ========================================================================== */

:root {
  --navy:       #0d1b3e;
  --navy-mid:   #162347;
  --navy-light: #1e305e;
  --gold:       #c9a84c;   /* tylko na granacie (kontrast 7.4:1) */
  --gold-light: #e2c97e;
  --gold-pale:  #f5e9c8;
  --gold-deep:  #7a5f16;   /* złoty na jasnym tle (kontrast >= 5.6:1) */
  --cream:      #faf7f0;
  --white:      #ffffff;
  --text:       #0d1b3e;
  --muted:      #4d5b72;   /* >= 5:1 na kremie i bieli */
  --line:       rgba(13, 27, 62, .12);
  --line-gold:  rgba(201, 168, 76, .28);
  --error:      #b42318;
  --ok:         #166534;

  --font-body: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;

  --radius-ctl:  2px;
  --radius-box:  4px;
  --shadow-box:  0 12px 40px rgba(13, 27, 62, .10);
  --ease:        cubic-bezier(.16, 1, .3, 1);
  --nav-h:       68px;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  background: var(--cream);
  color: var(--text);
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; }
a, button, input, textarea, label { touch-action: manipulation; }

[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.skip-link {
  position: absolute;
  top: -100px; left: 1rem;
  z-index: 300;
  background: var(--gold);
  color: var(--navy);
  padding: .6rem 1rem;
  border-radius: var(--radius-ctl);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --------------------------------------------------------------------------
   NAWIGACJA
   -------------------------------------------------------------------------- */

#navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  border-bottom: 1px solid var(--line-gold);
}

.nav-inner {
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-logo {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--gold-light);
  text-decoration: none;
  line-height: 1.05;
  padding: .75rem 0;
}
.nav-logo span {
  display: block;
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 400;
  letter-spacing: .06em;
  color: rgba(255, 255, 255, .72);
  margin-top: .15rem;
}

#nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-ctl);
  color: var(--gold-light);
  cursor: pointer;
}
#nav-toggle svg { width: 22px; height: 22px; }
#nav-toggle .icon-close { display: none; }
#nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
#nav-toggle[aria-expanded="true"] .icon-close { display: block; }

#nav-menu {
  flex-basis: 100%;
  display: none;
  padding-bottom: 1rem;
}
#nav-menu.open { display: block; }

#nav-menu ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
#nav-menu a:not(.btn-chorzysta) {
  display: block;
  padding: .75rem .25rem;
  color: rgba(255, 255, 255, .88);
  text-decoration: none;
  font-size: .95rem;
  letter-spacing: .02em;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
#nav-menu a:not(.btn-chorzysta):hover { color: var(--gold-light); }

.btn-chorzysta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: .75rem;
  border: 1.5px solid var(--gold);
  color: var(--gold-light);
  font-weight: 500;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: .6rem 1.1rem;
  border-radius: var(--radius-ctl);
  transition: background .25s, color .25s;
}
.btn-chorzysta:hover { background: var(--gold); color: var(--navy); }

@media (min-width: 768px) {
  #nav-toggle { display: none; }
  #nav-menu { flex-basis: auto; display: block; padding: 0; }
  #nav-menu ul { flex-direction: row; align-items: center; gap: 1rem; }
  #nav-menu a:not(.btn-chorzysta) { padding: .75rem .4rem; border: 0; }
  .btn-chorzysta { margin: 0; }
}

/* --------------------------------------------------------------------------
   HERO
   TODO: zdjęcie chóru jako tło (images/hero.jpg, ok. 1920x1080) - patrz index.html
   -------------------------------------------------------------------------- */

#hero {
  background: var(--navy);
  color: var(--white);
  min-height: 80vh;
  min-height: 80svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.25rem 5rem;
}

.hero-inner { max-width: 760px; }

.hero-title {
  font-size: clamp(3.4rem, 10vw, 6rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--white);
  padding-bottom: .1em;
}
.hero-title em { font-style: italic; color: var(--gold-light); }

.hero-sub {
  font-family: var(--font-head);
  font-size: clamp(1.15rem, 2.6vw, 1.55rem);
  font-style: italic;
  color: rgba(255, 255, 255, .8);
  max-width: 34ch;
  margin: .6rem auto 2.2rem;
  line-height: 1.4;
}

.btn-cta {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  font-weight: 600;
  font-size: .88rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: .95rem 2.4rem;
  border-radius: var(--radius-ctl);
  transition: background .25s, transform .2s;
}
.btn-cta:hover { background: var(--gold-light); }
.btn-cta:active { transform: translateY(1px); }

/* --------------------------------------------------------------------------
   SEKCJE - wspólne
   -------------------------------------------------------------------------- */

.section { padding: 4.5rem 0; }
.section-alt { background: var(--white); }

.section-title {
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  color: var(--navy);
  margin-bottom: 1rem;
}
.section-title.center { text-align: center; }

.gold-line {
  width: 48px; height: 2px;
  background: var(--gold);
  margin: 0 0 1.5rem;
}
.gold-line.center { margin-left: auto; margin-right: auto; }

.lead {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 60ch;
  margin-bottom: 1.5rem;
}

.narrow { max-width: 720px; }

@media (min-width: 768px) {
  .section { padding: 6rem 0; }
}

/* --------------------------------------------------------------------------
   PRÓBY / ŚPIEWAJ Z NAMI
   -------------------------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: start;
}

.points {
  list-style: none;
  margin: 0; padding: 0;
  border-top: 1px solid var(--line);
}
.points li { padding: 1.3rem 0; border-bottom: 1px solid var(--line); }
.points h3 { font-size: 1.45rem; margin-bottom: .3rem; }
.points p { color: var(--muted); font-size: .95rem; max-width: 52ch; }

.schedule {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius-box);
  padding: 2rem 1.75rem;
}
.schedule h3 {
  font-size: 1.1rem;
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}
.schedule-when {
  font-family: var(--font-head);
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 700;
  line-height: 1;
  color: var(--white);
  margin-bottom: 1rem;
}
.schedule-when span { color: var(--gold-light); }
.schedule-where {
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, .88);
  padding-left: 1rem;
  border-left: 2px solid var(--gold);
  margin-bottom: 1.4rem;
}
.schedule-map {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: -.6rem 0 .8rem;
  color: var(--gold-light);
  font-size: .9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.schedule-map:hover { color: var(--white); }
.schedule-note {
  font-size: .9rem;
  color: rgba(255, 255, 255, .78);
}

@media (min-width: 900px) {
  .split { grid-template-columns: 3fr 2fr; gap: 4rem; }
  .schedule { position: sticky; top: calc(var(--nav-h) + 1.5rem); }
}

/* --------------------------------------------------------------------------
   O NAS
   -------------------------------------------------------------------------- */

.prose p { color: var(--muted); max-width: 64ch; margin-bottom: 1rem; }

.quote {
  margin: 2.5rem 0 0;
  padding: 1.75rem 0 0;
  border-top: 1px solid var(--line-gold);
  max-width: 64ch;
}
.quote p {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-style: italic;
  line-height: 1.35;
  color: var(--navy);
  margin-bottom: .6rem;
}
.quote p span { color: var(--muted); font-size: 1.2rem; }
.quote cite {
  font-style: normal;
  font-size: .82rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* --------------------------------------------------------------------------
   DYRYGENCI
   -------------------------------------------------------------------------- */

.directors {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 760px;
  margin: 2rem auto 0;
}

.director {
  background: var(--white);
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-box);
  overflow: hidden;
}

.director-photo {
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, var(--navy-light), var(--navy));
  display: grid;
  place-items: center;
}
.director-photo span {
  font-family: var(--font-head);
  font-size: 6rem;
  font-weight: 700;
  color: rgba(201, 168, 76, .35);
  line-height: 1;
}
.director-photo img { width: 100%; height: 100%; object-fit: cover; }

.director-info { padding: 1.5rem 1.5rem 1.75rem; }
.director-info h3 { font-size: 1.75rem; margin-bottom: .2rem; }
.director-role {
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: .8rem;
}
.director-info p:not(.director-role) { font-size: .93rem; color: var(--muted); }

@media (min-width: 640px) {
  .directors { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

/* --------------------------------------------------------------------------
   KONTAKT / FORMULARZ
   -------------------------------------------------------------------------- */

.form { display: flex; flex-direction: column; gap: 1.2rem; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}
@media (min-width: 560px) { .form-grid { grid-template-columns: 1fr 1fr; } }

.form-field { display: flex; flex-direction: column; gap: .4rem; }
.form-field label {
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--navy);
}
.form-field label .optional { text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 400; }

.form-field input,
.form-field textarea {
  background: var(--cream);
  border: 1px solid rgba(13, 27, 62, .25);
  padding: .8rem 1rem;
  border-radius: var(--radius-ctl);
  font: inherit;
  font-size: .95rem;
  color: var(--navy);
  min-height: 44px;
  transition: border-color .2s;
  resize: vertical;
}
.form-field input:focus,
.form-field textarea:focus { border-color: var(--gold-deep); outline-offset: 0; }
.form.was-validated :invalid { border-color: var(--error); }
.form-help { font-size: .82rem; color: var(--muted); }

.rodo-note {
  font-size: .8rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 64ch;
}
.rodo-note a { color: var(--gold-deep); }

.btn-submit {
  align-self: flex-start;
  background: var(--navy);
  color: var(--gold-light);
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .95rem 2.4rem;
  min-height: 48px;
  border: none;
  border-radius: var(--radius-ctl);
  cursor: pointer;
  transition: background .25s;
}
.btn-submit:hover { background: var(--navy-light); }
.btn-submit:active { transform: translateY(1px); }

/* --------------------------------------------------------------------------
   STOPKA
   -------------------------------------------------------------------------- */

footer {
  background: var(--navy);
  border-top: 1px solid var(--line-gold);
  padding: 2.5rem 0;
  color: rgba(255, 255, 255, .78);
  font-size: .86rem;
  line-height: 1.6;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}
footer strong { color: var(--gold-light); font-weight: 500; }
.footer-links { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; color: rgba(255, 255, 255, .78); text-decoration: none; }
.footer-links a:hover { color: var(--gold-light); }
.footer-copy { font-size: .8rem; color: rgba(255, 255, 255, .62); }

/* --------------------------------------------------------------------------
   STRONY POMOCNICZE (sukces, polityka)
   -------------------------------------------------------------------------- */

.page { min-height: 70vh; padding: 4rem 0; }
.page h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: 1rem; }
.page h2 { font-size: 1.35rem; margin: 2rem 0 .5rem; }
.page p, .page li { color: var(--muted); max-width: 68ch; margin-bottom: .75rem; }
.page a { color: var(--gold-deep); }
.page .btn-cta { margin-top: 1rem; }

/* --------------------------------------------------------------------------
   STREFA CHÓRZYSTY
   -------------------------------------------------------------------------- */

#panel-view { min-height: 100vh; background: var(--cream); }
body.panel-mode #navbar,
body.panel-mode footer { display: none; }
body.panel-mode .panel-header { position: sticky; top: 0; z-index: 100; }

.panel-header {
  background: var(--navy);
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--line-gold);
}
.panel-header .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.panel-title {
  font-size: 1.6rem;
  color: var(--white);
  margin-right: auto;
}
.panel-title span { color: var(--gold-light); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 44px;
  border: 1px solid var(--line-gold);
  color: var(--gold-light);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: .45rem .9rem;
  border-radius: var(--radius-ctl);
  background: transparent;
  cursor: pointer;
  transition: background .2s;
}
.btn-ghost:hover { background: rgba(201, 168, 76, .15); }

.panel-body { padding-top: 2rem; padding-bottom: 4rem; }
.panel-section { margin-bottom: 3rem; }
.panel-section-title { font-size: 1.75rem; margin-bottom: .5rem; }

.liturgia-date {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--navy);
  margin: .25rem 0 .1rem;
}
.liturgia-meta {
  font-size: .95rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
}
.liturgia-meta strong { color: var(--navy); font-weight: 500; }

.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.status {
  font-size: .9rem;
  color: var(--muted);
  font-style: italic;
  padding: 1.25rem 0;
}
.status.error { color: var(--error); font-style: normal; }
.btn-retry {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-left: .6rem;
  padding: .3rem .9rem;
  background: transparent;
  border: 1px solid var(--navy);
  border-radius: var(--radius-ctl);
  color: var(--navy);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn-retry:hover { background: var(--navy); color: var(--gold-light); }

/* Tabele */
.rc-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--line);
  font-size: .9rem;
}
.rc-table thead th {
  background: var(--navy);
  color: var(--gold-light);
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .85rem 1rem;
  text-align: left;
  white-space: nowrap;
}
.rc-table tbody tr { border-bottom: 1px solid var(--line); }
.rc-table tbody tr:last-child { border-bottom: none; }
#libraryTable tbody tr:hover { background: var(--gold-pale); }
.rc-table td { padding: .7rem 1rem; color: var(--text); vertical-align: middle; }
.rc-table td.title-cell {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
}
#libraryTable th:first-child,
#libraryTable td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: inherit;
}
#libraryTable thead th:first-child { background: var(--navy); }
#libraryTable tbody td:first-child { background: var(--white); box-shadow: 1px 0 0 var(--line); }
#libraryTable tbody tr:hover td:first-child { background: var(--gold-pale); }
.rc-table td.muted { color: var(--muted); }

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  min-height: 44px;
  margin: -.6rem 0;
}
.sort-btn svg { width: 14px; height: 14px; }
.sort-btn .icon-sorted { display: none; }
th[aria-sort="ascending"] .sort-btn .icon-unsorted,
th[aria-sort="descending"] .sort-btn .icon-unsorted { display: none; }
th[aria-sort="ascending"] .sort-btn .icon-sorted,
th[aria-sort="descending"] .sort-btn .icon-sorted { display: block; }
th[aria-sort="descending"] .sort-btn .icon-sorted { transform: rotate(180deg); }

.btn-play {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--navy);
  border: none;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  color: var(--gold-light);
  transition: background .2s;
}
.btn-play svg { width: 18px; height: 18px; }
.btn-play:hover { background: var(--navy-light); }

.btn-pdf {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-deep);
  border: 1px solid var(--gold-deep);
  padding: .3rem .8rem;
  border-radius: var(--radius-ctl);
  text-decoration: none;
  transition: background .2s, color .2s;
}
.btn-pdf:hover { background: var(--gold-deep); color: var(--white); }

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

/* Filtr „Mój głos" (segmented control na radio) */
.voice-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.voice-filter legend {
  float: left;
  padding: 0;
  margin-right: .5rem;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--navy);
}
.voice-filter label { position: relative; }
.voice-filter input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.voice-filter span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .4rem .9rem;
  border: 1px solid rgba(13, 27, 62, .25);
  border-radius: var(--radius-ctl);
  background: var(--white);
  color: var(--navy);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.voice-filter input:checked + span { background: var(--navy); color: var(--gold-light); border-color: var(--navy); }
.voice-filter input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 3px; }
.voice-filter label:hover span { border-color: var(--navy); }

#libraryTable[data-voice="sopran"] [data-col]:not([data-col="sopran"]),
#libraryTable[data-voice="alt"]    [data-col]:not([data-col="alt"]),
#libraryTable[data-voice="tenor"]  [data-col]:not([data-col="tenor"]),
#libraryTable[data-voice="bas"]    [data-col]:not([data-col="bas"]) { display: none; }

.lit-play { display: inline-flex; align-items: center; margin: -.4rem 0 -.4rem .6rem; vertical-align: middle; }

/* Wyszukiwarka */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin: .75rem 0 1rem;
}
.search-wrapper { position: relative; width: 100%; max-width: 340px; }
.search-wrapper input {
  width: 100%;
  min-height: 44px;
  background: var(--white);
  border: 1px solid rgba(13, 27, 62, .25);
  padding: .65rem 1rem .65rem 2.5rem;
  border-radius: var(--radius-ctl);
  font: inherit;
  font-size: .92rem;
  color: var(--navy);
}
.search-wrapper input:focus { border-color: var(--gold-deep); outline-offset: 0; }
.search-wrapper svg {
  position: absolute;
  left: .8rem; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.no-results { text-align: center; padding: 2rem; color: var(--muted); font-style: italic; }

/* Bramka hasła */
.pw-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(9, 14, 32, .6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.pw-card {
  background: var(--white);
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-box);
  padding: 2.5rem 2rem 2rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 30px 80px rgba(9, 14, 32, .45);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.pw-lock-icon {
  width: 56px; height: 56px;
  background: var(--navy);
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto .5rem;
  color: var(--gold-light);
  border: 2px solid var(--line-gold);
}
.pw-lock-icon svg { width: 24px; height: 24px; }
.pw-card h2 { font-size: 1.8rem; }
.pw-card p { font-size: .88rem; color: var(--muted); }
.pw-card label {
  display: block;
  text-align: left;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--navy);
  margin-top: .5rem;
}
.pw-hint { font-size: .82rem; color: var(--muted); }
.pw-back { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; font-size: .85rem; color: var(--gold-deep); margin-top: .25rem; }
.pw-card input {
  width: 100%;
  min-height: 48px;
  background: var(--cream);
  border: 1.5px solid rgba(13, 27, 62, .25);
  padding: .8rem 1rem;
  border-radius: var(--radius-ctl);
  font: inherit;
  font-size: 1rem;
  color: var(--navy);
  text-align: center;
  letter-spacing: .15em;
}
.pw-card input:focus { border-color: var(--gold-deep); outline-offset: 0; }
.pw-card input.error,
.pw-card input[aria-invalid="true"] { border-color: var(--error); }
.pw-card input.error { animation: shake .35s ease; }
.pw-error-msg { font-size: .82rem; color: var(--error); min-height: 1.2rem; }
.pw-btn {
  width: 100%;
  min-height: 48px;
  background: var(--navy);
  color: var(--gold-light);
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-ctl);
  cursor: pointer;
  transition: background .25s;
}
.pw-btn:hover { background: var(--navy-light); }
.pw-btn:disabled { opacity: .6; cursor: wait; }

#panel-blurred {
  filter: blur(14px);
  transition: filter .5s ease;
}
#panel-blurred.unlocked { filter: none; }

/* Wspólny feedback dotyku dla przycisków w panelu */
.btn-ghost:active, .btn-pdf:active, .btn-play:active, .pw-btn:active, .btn-retry:active, .btn-audio-download:active { transform: translateY(1px); }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* Odtwarzacz (natywny <dialog>) */
#audio-modal {
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-box);
  padding: 0;
  width: min(440px, calc(100vw - 2rem));
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 30px 80px rgba(9, 14, 32, .6);
}
#audio-modal::backdrop {
  background: rgba(9, 14, 32, .6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.audio-card { padding: 1.5rem 1.6rem 1.4rem; }
.audio-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .5rem;
}
.audio-card-tytul { font-size: 1.4rem; font-weight: 700; color: var(--white); line-height: 1.2; }
.audio-card-glos {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: .3rem;
}
.btn-audio-close {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  border: none;
  color: rgba(255, 255, 255, .8);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s;
}
.btn-audio-close svg { width: 18px; height: 18px; }
.btn-audio-close:hover { background: rgba(255, 255, 255, .2); color: var(--white); }
#audio-player { width: 100%; margin: 1rem 0; }
.audio-fallback { font-size: .85rem; color: var(--gold-light); margin-bottom: .75rem; }
.audio-fallback a { color: inherit; }
.btn-audio-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  min-height: 44px;
  background: rgba(201, 168, 76, .15);
  border: 1px solid rgba(201, 168, 76, .45);
  color: var(--gold-light);
  font-weight: 500;
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .6rem;
  border-radius: var(--radius-ctl);
  text-decoration: none;
  transition: background .2s;
}
.btn-audio-download svg { width: 18px; height: 18px; }
.btn-audio-download:hover { background: rgba(201, 168, 76, .28); }

@media (max-width: 640px) {
  .rc-table { font-size: .82rem; }
  .rc-table td, .rc-table thead th { padding: .6rem .6rem; }
}

/* --------------------------------------------------------------------------
   MOTION: wejście sekcji sterowane przewijaniem (czyste CSS, bez JS).
   Przeglądarki bez wsparcia pokazują treść statycznie.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal-up linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 35%;
    }
  }
  @keyframes reveal-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
