.csw{
  box-sizing: border-box;
  --csw-paper: #14161B;
  --csw-card: #1D2027;
  --csw-ink: #EDEBE4;
  --csw-ink-soft: #A9AEB8;
  --csw-line: #33363F;
  --csw-steel: #7C9BB8;
  --csw-steel-dark: #5C7C99;
  --csw-gold: #E0BB4A;
  --csw-gold-dark: #C9A227;
  --csw-gold-ink: #251C05;
  --csw-good: #5CC79A;

  font-family: "Source Sans Pro", Arial, sans-serif;
  color: var(--csw-ink);
  width: 100%;
  background: var(--csw-paper);
  border-radius: 0;
  padding: 20px;
}

.csw *{ box-sizing: border-box; }

.csw-form{ display: block; }

/* ---------- Sekcja ---------- */

.csw-section{
  background: var(--csw-card);
  border: 1px solid var(--csw-line);
  border-radius: 14px;
  padding: 20px 20px 22px;
  margin-bottom: 14px;
}
.csw-section:last-of-type{ margin-bottom: 0; }

.csw-section-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.csw-title{
  font-family: "Roboto Condensed", Arial, sans-serif;
  font-weight: 600;
  font-size: 16px;
  margin: 0;
  color: var(--csw-ink);
}

.csw-hint{
  font-size: 12.5px;
  color: var(--csw-ink-soft);
  white-space: nowrap;
}

/* ---------- Suwaki: cena / wiek ---------- */

.csw-slider-row{ margin-bottom: 18px; }
.csw-slider-row:last-child{ margin-bottom: 0; }

.csw-slider-label{
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--csw-ink-soft);
  margin-bottom: 8px;
}
.csw-slider-value{
  font-weight: 600;
  color: var(--csw-ink);
  font-variant-numeric: tabular-nums;
}

.csw-range{
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--csw-line);
  outline: none;
  margin: 0;
}
.csw-range::-webkit-slider-thumb{
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--csw-steel);
  border: 3px solid var(--csw-card);
  box-shadow: 0 0 0 1px var(--csw-steel);
  cursor: pointer;
  margin-top: -8px;
}
.csw-range::-moz-range-thumb{
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--csw-steel);
  border: 3px solid var(--csw-card);
  box-shadow: 0 0 0 1px var(--csw-steel);
  cursor: pointer;
}
.csw-range::-moz-range-track{ height: 4px; border-radius: 2px; background: var(--csw-line); }
.csw-range:focus-visible{ outline: 2px solid var(--csw-steel); outline-offset: 4px; }

/* ---------- Wielkość: siatka kafelków ---------- */

.csw-chip-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.csw-chip-input{
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.csw-chip{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px 10px;
  border: 1px solid var(--csw-line);
  border-radius: 10px;
  background: transparent;
  color: var(--csw-ink);
  font-size: 12.5px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.csw-chip svg{
  width: 22px;
  height: 22px;
  color: var(--csw-ink-soft);
  transition: color .15s ease;
}
.csw-chip:hover{ border-color: var(--csw-steel); }

.csw-chip-input:checked + .csw-chip{
  border-color: var(--csw-steel);
  background: var(--csw-steel);
  color: #fff;
}
.csw-chip-input:checked + .csw-chip svg{ color: #fff; }
.csw-chip-input:focus-visible + .csw-chip{
  outline: 2px solid var(--csw-steel);
  outline-offset: 2px;
}

/* ---------- Napęd / skrzynia: pigułki ---------- */

.csw-subgroup{ margin-bottom: 14px; }
.csw-subgroup:last-child{ margin-bottom: 0; }
.csw-subgroup-label{
  font-size: 12px;
  color: var(--csw-ink-soft);
  margin: 0 0 8px;
}

.csw-pill-row{ display: flex; flex-wrap: wrap; gap: 8px; }

.csw-pill-input{
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.csw-pill{
  display: inline-block;
  padding: 9px 14px;
  border: 1px solid var(--csw-line);
  border-radius: 999px;
  background: transparent;
  color: var(--csw-ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.csw-pill:hover{ border-color: var(--csw-gold-dark); }

.csw-pill-input:checked + .csw-pill{
  border-color: var(--csw-gold-dark);
  background: var(--csw-gold);
  color: var(--csw-gold-ink);
}
.csw-pill-input:focus-visible + .csw-pill{
  outline: 2px solid var(--csw-steel);
  outline-offset: 2px;
}
.csw-pill.is-disabled{
  opacity: .35;
  pointer-events: none;
}

/* ---------- Pasek wyników + CTA (zawiera też link resetu) ---------- */

.csw-resultbar{
  background: var(--csw-card);
  border: 1px solid var(--csw-line);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.csw-reset{
  background: none;
  border: none;
  font-size: 12.5px;
  color: var(--csw-ink-soft);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  order: -1;
  margin-right: auto;
}
.csw-reset:hover{ color: var(--csw-ink); }

.csw-result{
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.csw-result-num{
  display: inline-block;
  min-width: 6ch;
  font-family: "Roboto Condensed", Arial, sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--csw-good);
  font-variant-numeric: tabular-nums;
  transition: opacity .15s ease;
}
.csw-result-num.is-loading{ opacity: .5; }
.csw-result-label{ font-size: 11.5px; color: var(--csw-ink-soft); }

.csw-cta{
  flex: 0 0 auto;
  background: var(--csw-steel);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-family: "Roboto Condensed", Arial, sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}
.csw-cta:hover{ background: var(--csw-steel-dark); }
.csw-cta:active{ transform: scale(.98); }
.csw-cta:focus-visible{ outline: 2px solid var(--csw-gold); outline-offset: 3px; }

@media (max-width: 420px){
  .csw-resultbar{ justify-content: center; }
  .csw-reset{ order: 0; flex: 1 0 100%; margin-right: 0; text-align: center; }
}