.er-page {
  --er-bg: #FFF9E8;
  --er-surface: #FFFDF5;
  --er-soft: #F7E8A4;
  --er-accent: #E9D37B;
  --er-olive: #59624A;
  --er-ink: #2E2A23;
  --er-muted: #6F6A5F;
  --er-line: rgba(46, 42, 35, 0.12);
  --er-shadow: 0 18px 48px rgba(46, 42, 35, 0.08);
  --er-radius-lg: 34px;
  --er-radius-md: 24px;

  width: 100%;
  color: var(--er-ink);
  background: var(--er-bg);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-sizing: border-box;
}

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

.er-page button {
  font: inherit;
}

.er-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(54px, 7vw, 96px) 0 clamp(64px, 8vw, 112px);
}

.er-intro {
  max-width: 860px;
  margin: 0 auto clamp(34px, 5vw, 58px);
  text-align: center;
}

.er-eyebrow {
  margin: 0 0 14px;
  color: var(--er-olive);
  font-size: 0.82rem;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.er-title {
  margin: 0;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(2.25rem, 5vw, 4.8rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: var(--er-ink);
}

.er-lead {
  max-width: 720px;
  margin: 22px auto 0;
  color: var(--er-muted);
  font-size: clamp(1.04rem, 1.5vw, 1.22rem);
  line-height: 1.7;
}

.er-app {
  display: grid;
  gap: clamp(28px, 4vw, 44px);
}

.er-picker {
  padding: clamp(28px, 4vw, 46px);
  border: 1px solid var(--er-line);
  border-radius: var(--er-radius-lg);
  background: var(--er-surface);
  box-shadow: var(--er-shadow);
}

.er-picker-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.er-picker-heading {
  margin: 0;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.25;
}

.er-selected-count {
  margin: 0;
  color: var(--er-muted);
  font-size: 0.94rem;
  white-space: nowrap;
}

.er-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.er-category {
  position: relative;
  min-height: 96px;
  padding: 20px 18px;
  border: 1px solid var(--er-line);
  border-radius: 22px;
  background: var(--er-bg);
  color: var(--er-ink);
  text-align: left;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.er-category:hover {
  transform: translateY(-2px);
  border-color: rgba(89, 98, 74, 0.34);
  box-shadow: 0 10px 26px rgba(46, 42, 35, 0.07);
}

.er-category[aria-pressed="true"] {
  border-color: var(--er-olive);
  background: var(--er-soft);
  box-shadow: inset 0 0 0 1px var(--er-olive);
}


.er-category-name {
  display: block;
  padding-right: 24px;
  font-weight: 800;
  font-size: clamp(0.92rem, 1.35vw, 1rem);
  line-height: 1.25;
  white-space: nowrap;
}

.er-category-meta {
  display: block;
  margin-top: 8px;
  color: var(--er-muted);
  font-size: 0.86rem;
  line-height: 1.3;
}


.er-category-check {
  position: absolute;
  top: 17px;
  right: 17px;
  width: 18px;
  height: 18px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  opacity: 0.45;
}

.er-category[aria-pressed="true"] .er-category-check {
  opacity: 1;
}

.er-category[aria-pressed="true"] .er-category-check::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.er-picker-note {
  margin: 18px 0 0;
  color: var(--er-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.er-question-card {
  position: relative;
  display: flex;
  min-height: clamp(330px, 42vw, 470px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(36px, 7vw, 78px);
  border: 1px solid var(--er-line);
  border-radius: var(--er-radius-lg);
  background:
    radial-gradient(circle at 12% 16%, rgba(247, 232, 164, 0.58), transparent 28%),
    radial-gradient(circle at 89% 78%, rgba(233, 211, 123, 0.28), transparent 26%),
    var(--er-surface);
  box-shadow: var(--er-shadow);
  text-align: center;
}

.er-question-card::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(89, 98, 74, 0.12);
  border-radius: 24px;
  pointer-events: none;
}

.er-question-label {
  position: relative;
  z-index: 1;
  margin: 0 0 20px;
  color: var(--er-olive);
  font-size: 0.79rem;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.er-question {
  position: relative;
  z-index: 1;
  max-width: 910px;
  margin: 0;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(1.55rem, 3.4vw, 2.85rem);
  line-height: 1.32;
  letter-spacing: -0.026em;
  color: var(--er-ink);
  text-wrap: balance;
  transition: opacity 150ms ease, transform 150ms ease;
}

.er-question.is-changing {
  opacity: 0;
  transform: translateY(6px);
}

.er-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: center;
}

.er-progress-wrap {
  min-width: 0;
}

.er-progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}

.er-progress-label,
.er-progress-status {
  margin: 0;
  color: var(--er-muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.er-progress-status {
  text-align: right;
}

.er-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(89, 98, 74, 0.12);
}

.er-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--er-olive);
  transition: width 220ms ease;
}

.er-draw {
  min-width: 190px;
  min-height: 58px;
  padding: 16px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--er-olive);
  color: #FFFFFF;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(89, 98, 74, 0.2);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.er-draw:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(89, 98, 74, 0.24);
}

.er-draw:active:not(:disabled) {
  transform: translateY(0);
}

.er-draw:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  box-shadow: none;
}

.er-category:focus-visible,
.er-draw:focus-visible {
  outline: 3px solid rgba(89, 98, 74, 0.34);
  outline-offset: 4px;
}


.er-js-check {
  margin: -18px 0 0;
  color: var(--er-muted);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: center;
}

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

@media (max-width: 900px) {
  .er-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .er-controls {
    grid-template-columns: 1fr;
  }

  .er-draw {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .er-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 42px;
  }

  .er-picker {
    padding: 22px;
    border-radius: 26px;
  }

  .er-picker-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
  }

  .er-category-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .er-category {
    min-height: 78px;
    padding: 17px;
    border-radius: 18px;
  }

  .er-category-name {
    white-space: nowrap;
    font-size: 0.98rem;
  }

  .er-question-card {
    min-height: 350px;
    padding: 42px 27px;
    border-radius: 26px;
  }

  .er-question-card::before {
    inset: 12px;
    border-radius: 19px;
  }

  .er-progress-copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .er-progress-status {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .er-category,
  .er-question,
  .er-progress-bar,
  .er-draw {
    transition: none !important;
  }
}

/* Poprawki: izolacja przycisków od motywu i zawijanie na małych ekranach. */
.er-page button { appearance: none; text-transform: none; letter-spacing: normal; }
.er-page [hidden] { display: none !important; }
.er-page .er-category-name { white-space: normal; overflow-wrap: anywhere; }
.er-page .er-category:disabled { cursor: wait; }
.er-page .er-category:disabled:hover { transform: none; box-shadow: none; }
.er-page .er-question { overflow-wrap: anywhere; }
.er-page .er-shell { padding-top: clamp(32px, 5vw, 60px); padding-bottom: 48px; }
.er-page .er-intro { margin-bottom: 28px; }
.er-page .er-title { font-size: clamp(2rem, 4.2vw, 3.6rem); }
.er-page .er-lead { margin-top: 16px; }
.er-page .er-app { gap: 24px; }
.er-page .er-picker { padding: clamp(20px, 3vw, 32px); }
.er-page .er-question-card { min-height: 300px; padding: clamp(30px, 5vw, 56px); }
.er-page .er-js-check { margin: 0; padding: 12px 16px; border: 1px solid var(--er-line); border-radius: 14px; }
@media (max-width: 560px) {
  .er-page .er-category { min-height: 70px; padding: 14px 17px; }
  .er-page .er-category-meta { margin-top: 5px; }
  .er-page .er-question-card { min-height: 260px; padding: 34px 24px; }
}

