:root {
  --rsd-accent: #2d6bc4;
  --rsd-surface: #ffffff;
  --rsd-ink: #1a1d21;
  --rsd-muted: #6b7280;
  --rsd-line: #e3e6ea;
  --rsd-ground: #f5f6f8;
  --rsd-radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--rsd-ground);
  color: var(--rsd-ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.widget { max-width: 1080px; margin: 20px auto; padding: 0 16px; }

/* --- pasek języka --- */

.langbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }

.lang {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--rsd-muted);
}

.lang select {
  font: inherit;
  padding: 3px 6px;
  border: 1px solid var(--rsd-line);
  border-radius: 7px;
  background: var(--rsd-surface);
  color: var(--rsd-ink);
}

/* --- wskaźnik kroków --- */

.steps {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 9px 12px;
  border-radius: var(--rsd-radius);
  background: var(--rsd-surface);
  border: 1px solid var(--rsd-line);
  font-size: 13px;
  color: var(--rsd-muted);
}

.step-no {
  display: grid;
  place-items: center;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: var(--rsd-line);
  color: var(--rsd-ink);
  font-size: 12px;
  font-weight: 600;
}

.step[aria-current="step"] { border-color: var(--rsd-accent); color: var(--rsd-ink); }
.step[aria-current="step"] .step-no { background: var(--rsd-accent); color: #fff; }
.step[data-done="true"] .step-no { background: #cfe0f7; }

/* --- układ --- */

.panes {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 760px) { .panes { grid-template-columns: 1fr; } }

.pane {
  background: var(--rsd-surface);
  border: 1px solid var(--rsd-line);
  border-radius: var(--rsd-radius);
  padding: 18px;
}

.block-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--rsd-muted);
}

.block-title-spaced { margin-top: 22px; }
.block-lead { margin: -4px 0 14px; color: var(--rsd-muted); font-size: 14px; }

/* --- siatka kształtów --- */

.shape-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}

.shape {
  border: 1.5px solid var(--rsd-line);
  border-radius: var(--rsd-radius);
  background: var(--rsd-surface);
  padding: 6px 6px 4px;
  cursor: pointer;
  text-align: center;
  transition: border-color .12s, box-shadow .12s;
}

.shape:hover { border-color: var(--rsd-accent); }

.shape[aria-pressed="true"] {
  border-color: var(--rsd-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rsd-accent) 18%, transparent);
}

.shape svg { width: 100%; height: auto; display: block; }
.shape-name { display: block; margin-top: 4px; font-size: 12px; color: var(--rsd-muted); }

/* --- suwaki --- */

.field {
  margin-bottom: 5px;
  padding: 4px 8px 6px;
  margin-left: -8px;
  margin-right: -8px;
  border-radius: 8px;
  border-left: 2px solid transparent;
  transition: background-color .12s, border-color .12s;
}

/* Pole i jego linia wymiarowa na rysunku zapalają się razem — to jedno wskazanie w dwóch
   miejscach, a nie dwa niezależne podświetlenia. */
.field.is-active {
  background: color-mix(in srgb, var(--rsd-accent) 8%, transparent);
  border-left-color: var(--rsd-accent);
}

.fields-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--rsd-muted);
}

.field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
  font-size: 13px;
}

.field-value { font-variant-numeric: tabular-nums; color: var(--rsd-muted); }
.field input[type="range"] { width: 100%; accent-color: var(--rsd-accent); }

/* --- zestawy --- */

.set {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  margin-bottom: 9px;
  border: 1.5px solid var(--rsd-line);
  border-radius: var(--rsd-radius);
  background: var(--rsd-surface);
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.set:hover { border-color: var(--rsd-accent); }

.set[aria-pressed="true"] {
  border-color: var(--rsd-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rsd-accent) 18%, transparent);
}

.set-swatch { width: 26px; height: 26px; border-radius: 7px; flex: none; border: 1px solid rgba(0,0,0,.14); }
.set-name { font-weight: 600; font-size: 14px; }
.set-desc { margin-top: 2px; font-size: 13px; color: var(--rsd-muted); }

/* --- formularz --- */

.form-row { display: block; margin-bottom: 12px; font-size: 13px; }
.form-row span { display: block; margin-bottom: 4px; color: var(--rsd-muted); }

.form-row input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--rsd-line);
  border-radius: 8px;
  font: inherit;
}

.form-row input:focus { outline: 2px solid var(--rsd-accent); outline-offset: -1px; }

.form-check { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--rsd-muted); }
.form-check input { margin-top: 3px; accent-color: var(--rsd-accent); }

.form-error { margin: 10px 0 0; color: #b3261e; font-size: 13px; }

.sent {
  padding: 14px;
  border-radius: var(--rsd-radius);
  background: #e8f5ec;
  border: 1px solid #b6ddc4;
  font-size: 14px;
}

/* --- widok --- */

.pane-view { position: relative; }

#scene {
  width: 100%;
  height: 330px;
  display: block;
  border-radius: var(--rsd-radius);
  background: linear-gradient(#fbfcfd, #eef1f5);
  cursor: grab;
  touch-action: none;
}

#scene:active { cursor: grabbing; }

.hint {
  position: absolute;
  top: 26px; right: 30px;
  font-size: 12px;
  color: var(--rsd-muted);
  pointer-events: none;
}

.toggles { display: flex; gap: 16px; margin-top: 10px; }
.toggle { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--rsd-muted); cursor: pointer; }
.toggle input { accent-color: var(--rsd-accent); }

.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--rsd-muted); }
.legend-item { display: flex; gap: 6px; align-items: center; }
.legend-swatch { width: 14px; height: 3px; border-radius: 2px; }

.warn {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff4e5;
  border: 1px solid #f0d0a0;
  font-size: 13px;
}

.summary { margin-top: 12px; }

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--rsd-line);
}

.summary-label { font-size: 13px; color: var(--rsd-muted); }
.summary-value { font-variant-numeric: tabular-nums; }
.summary-price { font-size: 22px; font-weight: 650; }

/* --- nawigacja --- */

.nav { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

.btn {
  padding: 10px 20px;
  border-radius: var(--rsd-radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary { background: var(--rsd-accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary[disabled] { opacity: .5; cursor: default; filter: none; }
.btn-ghost { background: transparent; border-color: var(--rsd-line); color: var(--rsd-ink); }
.btn-ghost:hover { border-color: var(--rsd-accent); }

.is-busy { opacity: .55; transition: opacity .15s; }

/* --- wizytówka (kontrakt §5) --- */

.card {
  background: var(--rsd-surface);
  border: 1px solid var(--rsd-line);
  border-radius: var(--rsd-radius);
  padding: 28px 24px;
  text-align: center;
}

.card-logo { max-height: 64px; max-width: 70%; margin: 0 auto 14px; display: block; }
.card-name { margin: 0; font-size: 20px; font-weight: 600; }
.card-note { margin: 8px 0 0; color: var(--rsd-muted); }

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}

/* .btn jest napisany dla <button>; na wizytówce akcje są linkami (tel:, mailto:, https:). */
.card-actions .btn { display: inline-flex; align-items: center; text-decoration: none; }
