.pws-config {
  --pws-color-white: #fff;
  --pws-color-primary: #b01322;
  --pws-color-primary-hover: #8e0f1b;
  --pws-color-text-main: #2a2b30;
  --pws-color-text-strong: #1f1f22;
  --pws-color-text-body: #5f6065;
  --pws-color-text-muted: #4d4f54;
  --pws-color-text-dark: #232429;
  --pws-color-text-input: #222;
  --pws-color-text-placeholder: #9a9ca3;
  --pws-color-text-tab: #8c8e94;
  --pws-color-border-soft: #dedfe3;
  --pws-color-border-input: #c6c8ce;
  --pws-color-border-tab: #d7d8de;
  --pws-color-icon: #7a7c82;
  --pws-color-surface-map: #f7f8fa;
  --pws-color-surface-tab: #f7f7fa;
  background: var(--pws-color-white);
}

/* Container and intro */
.pws-config .postwurfspezial-container {
  margin-top: 0;
  margin-bottom: 0;
  max-width: 1820px;
  padding: 0 32px 28px;
}

.pws-config .pws-intro {
  margin: 0 332px 10px 252px;
  padding-top: 18px;
}

.pws-config .pws-intro h1 {
  font-size: 20px;
  color: var(--pws-color-primary);
  margin: 0 0 8px;
  font-weight: 700;
  text-align: left;
  max-width: none;
  transform: translateY(-4px);
}

.pws-config .pws-intro p {
  font-size: 13.5px;
  color: var(--pws-color-text-body);
  max-width: none;
  margin: 0;
  text-align: left;
  line-height: 1.45;
}

/* Main layout */
.pws-config .pws-grid {
  grid-template-columns: 220px minmax(0, 1fr) 300px;
  gap: 32px;
  margin-top: 10px;
  align-items: start;
}

.pws-config .pws-right {
  align-self: start;
  padding: 18px 18px 20px 22px;
  border-left: 1px solid var(--pws-color-border-soft);
  background: linear-gradient(180deg, #fff 0%, #fbfbfc 100%);
}

.pws-config .pws-left,
.pws-config .pws-right {
  margin-top: -52px;
}

.pws-config .pws-left {
  padding-top: 18px;
}

/* Labels and base controls */
.pws-config .filter-label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  color: var(--pws-color-text-muted);
  font-weight: 600;
}

.pws-config .area-title {
  width: max-content;
  margin-left: 104px;
  text-align: left;
  transform: none;
}

.pws-config .pws-filter button {
  font-size: 14px;
  font-weight: 500;
  color: var(--pws-color-text-input);
  border-bottom: 1px solid var(--pws-color-border-soft);
}

.pws-config .pws-select {
  position: relative;
}

.pws-config .pws-select select {
  width: 100%;
  padding: 8px 22px 8px 0;
  border: none;
  border-bottom: 1px solid var(--pws-color-border-soft);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--pws-color-text-input);
  appearance: none;
  outline: none;
}

.pws-config .pws-number-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 0;
  border: none;
  border-bottom: 1px solid var(--pws-color-border-soft);
  background: transparent;
  color: var(--pws-color-text-input);
  font-size: 14px;
  font-weight: 500;
  outline: none;
}

.pws-config .pws-number-input:focus {
  border-bottom-color: var(--pws-color-primary);
}

.pws-config .pws-select::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--pws-color-icon);
  border-bottom: 2px solid var(--pws-color-icon);
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
}

/* Left column */
.pws-config .pws-left .pws-filter {
  margin-bottom: 26px;
}

.pws-config .pws-left .pws-delivery,
.pws-config .pws-left .pws-date {
  margin-bottom: 22px;
}

/* Preview and download */
.pws-config .pws-preview {
  margin-top: 8px;
}

.pws-config .preview-card {
  margin-top: 10px;
  border: 1px solid var(--pws-color-border-soft);
  border-radius: 6px;
  padding: 10px;
  background: var(--pws-color-white);
}

.pws-config .preview-card img {
  width: 100%;
  height: auto;
  display: block;
}

.pws-config .download-label {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--pws-color-text-strong);
}

.pws-config .btn-download {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 200px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--pws-color-primary);
  color: var(--pws-color-primary);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.pws-config .btn-download:hover {
  background: var(--pws-color-primary);
  color: var(--pws-color-white);
}

/* Radio and PLZ input */
.pws-config .radio-flex {
  display: flex;
  font-size: 13.5px;
  gap: 18px;
  margin-top: 6px;
  margin-bottom: 8px;
}

.pws-config .radio-option.has-line {
  display: grid;
  /* Label-Spalte auf 220px fixiert, damit das PLZ-Input exakt unter den
     Radio-Buttons der map-mode-Zeilen startet (gleiche Spaltenbreite). */
  grid-template-columns: 220px minmax(320px, 1fr) auto;
  align-items: center;
  column-gap: 18px;
  width: 100%;
  cursor: default;
}

.pws-config .map-mode > span,
.pws-config .plz-selective-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--pws-color-text-muted);
  width: 220px;
  margin: 0;
  padding: 0;
  text-align: left;
  justify-self: start;
}

.pws-config .plz-selective-label {
  white-space: nowrap;
}

.pws-config .radio-indicator {
  position: relative;
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.pws-config .radio-indicator::after {
  position: static;
  width: 8px;
  height: 8px;
  transform: none;
}

.pws-config .plz-inline-wrap {
  min-width: 0;
  max-width: none;
  display: inline-flex;
  border-bottom: 1px solid var(--pws-color-border-input);
}

.pws-config .plz-inline {
  width: 100%;
  padding: 2px 0 4px;
  border: none;
  font-size: 13px;
  color: var(--pws-color-text-main);
  background: transparent;
  position: static;
  opacity: 1;
  pointer-events: auto;
}

.pws-config .plz-inline::placeholder {
  color: var(--pws-color-text-placeholder);
}

.pws-config .plz-inline:focus {
  outline: none;
}

.pws-config .plz-inline-wrap:focus-within {
  border-bottom-color: var(--pws-color-primary);
}

.pws-config .plz-add-btn {
  margin-left: 0;
  height: 28px;
  padding: 0 18px;
  border-radius: 6px;
  border: 1px solid var(--pws-color-primary);
  background: var(--pws-color-primary);
  color: var(--pws-color-white);
  font-size: 12px;
  cursor: pointer;
}

.pws-config .plz-add-btn:hover {
  background: var(--pws-color-primary-hover);
}

.pws-config .pws-tooltip-loading {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pws-config .pws-tooltip-spinner {
  width: 0.8em;
  height: 0.8em;
  box-sizing: border-box;
  border: 1.5px solid rgba(42, 43, 48, 0.25);
  border-top-color: var(--pws-color-primary);
  border-radius: 50%;
  animation: pws-tooltip-spin 0.7s linear infinite;
}

@keyframes pws-tooltip-spin {
  to { transform: rotate(360deg); }
}
/* Map */
.pws-config .pws-tabs {
  gap: 16px;
  margin-bottom: 10px;
}

.pws-config .pws-tabs li {
  font-size: 11px;
  color: var(--pws-color-text-tab);
  min-width: 56px;
}

.pws-config .pws-map-wrap {
  position: relative;
  margin-top: 10px;
}

.pws-config .pws-map {
  width: 100%;
  height: 420px;
  border: 1px solid var(--pws-color-border-soft);
  border-radius: 6px;
  background: var(--pws-color-surface-map);
}

.pws-config .pws-map {
  border-radius: 4px;
}


.pws-config .pws-map-loading {
  position: absolute;
  inset: 0;
  z-index: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(1.5px);
  pointer-events: auto;
}

.pws-config .pws-map-loading.is-visible {
  display: flex;
}

.pws-config .pws-map-loading-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(92%, 360px);
  padding: 13px 18px;
  border: 1px solid rgba(176, 19, 34, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--pws-color-primary);
  box-shadow: 0 12px 34px rgba(42, 43, 48, 0.16);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.pws-config .pws-map-loading-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  box-sizing: border-box;
  border: 2px solid rgba(176, 19, 34, 0.22);
  border-top-color: var(--pws-color-primary);
  border-radius: 50%;
  animation: pws-tooltip-spin 0.7s linear infinite;
}
.pws-config .map-status {
  display: none;
  margin-top: 12px;
  margin-bottom: 0;
  padding: 9px 12px;
  border: 1px solid rgba(176, 19, 34, 0.22);
  border-radius: 4px;
  background: #fff7f8;
  color: var(--pws-color-primary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.pws-config .map-status.is-visible {
  display: block;
}

.pws-config .map-mode {
  margin-top: 0;
  display: grid;
  /* 220px = gleiche Label-Spaltenbreite wie .radio-option.has-line (PLZ-Zeile),
     damit Radio-Buttons und PLZ-Input linksbündig untereinander stehen. */
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
  column-gap: 18px;
  font-size: 12px;
  color: var(--pws-color-text-muted);
}

.pws-config .map-mode.basis-mode {
  margin-top: 8px;
}

.pws-config .mode-radio {
  display: grid;
  grid-template-columns: 150px 170px 130px;
  column-gap: 18px;
  align-items: center;
}

.pws-config .basis-mode .mode-radio {
  row-gap: 8px;
}

.pws-config .basis-mode {
  align-items: center;
}

.pws-config .basis-mode > span {
  padding-top: 0;
}

.pws-config .basis-mode .radio-line {
  min-width: max-content;
}

.pws-config .mode-radio label {
  margin-bottom: 0;
  white-space: nowrap;
}

.pws-config .map-mode:not(.basis-mode) .mode-radio .radio-line:nth-of-type(3) {
  display: none;
}

/* Right column and table */
.pws-config .summary-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--pws-color-text-main);
  margin-bottom: 14px;
}

.pws-config .selected-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 14px;
}

.pws-config .selected-tools input {
  min-width: 0;
  flex: 1 1 auto;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d9dbe2;
  border-radius: 4px;
  background: #fff;
  color: var(--pws-color-text-main);
  font-size: 12px;
  outline: none;
}

.pws-config .selected-tools input:focus {
  border-color: var(--pws-color-primary);
  box-shadow: 0 0 0 2px rgba(176, 19, 34, 0.08);
}

.pws-config .selected-tools button {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--pws-color-primary);
  border-radius: 4px;
  background: #fff;
  color: var(--pws-color-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.pws-config .selected-tools button:hover {
  background: #fff7f8;
}

.pws-config .pws-right table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.pws-config .pws-right thead,
.pws-config .pws-right tfoot {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.pws-config #plz-table-body {
  display: block;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.pws-config #plz-table-body tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.pws-config .pws-right th {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  padding: 0 0 10px;
  color: var(--pws-color-text-muted);
}

.pws-config .pws-right td {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  padding: 10px 0;
  vertical-align: middle;
  border-top: 1px solid #ececf0;
  color: var(--pws-color-text-main);
}

.pws-config .pws-right th:nth-child(1),
.pws-config .pws-right td:nth-child(1) {
  width: 86px;
  text-align: left;
}

.pws-config .pws-right th:nth-child(2),
.pws-config .pws-right td:nth-child(2) {
  width: 112px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pws-config .pws-right th:nth-child(3),
.pws-config .pws-right td:nth-child(3) {
  width: 42px;
  text-align: right;
}

.pws-config .pws-right tfoot td {
  border-top: 1px solid #ececf0;
  padding-top: 12px;
  padding-bottom: 10px;
}

.pws-config .pws-right tfoot tr:first-child td {
  border-top: 2px solid #777;
}

.pws-config .pws-right tfoot tr:last-child td {
  border-bottom: 2px solid #777;
}

.pws-config .pws-right tfoot td:first-child {
  color: var(--pws-color-text-muted);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
}

.pws-config .pws-right tfoot #plz-total {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pws-config #plz-table-body td[colspan="3"] {
  width: 100%;
  text-align: left;
  font-weight: 600;
}

.pws-config .pws-right .remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #d9dbe2;
  background: #fff;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.pws-config .pws-right .remove:hover {
  border-color: var(--pws-color-primary);
  background: #fff7f8;
}

/* Delivery and dates */
.pws-config .pws-delivery {
  margin-top: 0;
}

.pws-config .pws-delivery h2,
.pws-config .pws-date h2 {
  font-size: 12px;
  margin-bottom: 0;
  color: var(--pws-color-text-muted);
  font-weight: 600;
  line-height: 1.25;
}

.pws-config .pws-delivery h2 {
  margin-top: 0;
  margin-bottom: 10px;
}

.pws-config .pws-delivery .radio-line {
  margin-top: 6px;
}

.pws-config .pws-delivery .radio-line {
  margin-left: 0;
}

.pws-config .pws-date {
  margin-top: 38px;
}

.pws-config .date-caption {
  margin-top: 6px;
  font-size: 12px;
  color: var(--pws-color-text-body);
}

.pws-config .radio-line {
  font-size: 13.5px;
  font-weight: 400;
}

.pws-config .radio-line .radio-text {
  font-weight: 400;
}

.pws-config .radio-line input:checked + .radio-indicator + .radio-text {
  font-weight: 400;
  color: var(--pws-color-text-dark);
}

.pws-config .pws-date .date-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-top: 8px;
  font-size: 13px;
}

.pws-config .pws-date .date-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--pws-color-text-body);
}

.pws-config .pws-date .date-input {
  width: 170px;
  padding: 6px 38px 6px 10px;
  font-size: 12px;
  box-sizing: border-box;
}

.pws-config .date-input {
  width: 170px;
  border-radius: 4px;
}

.pws-config input[type="date"].date-input {
  background: var(--pws-color-white);
  padding-right: 38px;
}

.pws-config .date-error {
  margin-top: 8px;
  font-size: 12px;
  color: var(--pws-color-primary);
  min-height: 16px;
}

.pws-calendar {
  position: absolute;
  z-index: 10050;
  display: none;
  width: 278px;
  padding: 12px;
  background: var(--pws-color-white);
  border: 1px solid #d8dde5;
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(28, 35, 45, 0.16);
  box-sizing: border-box;
  font-family: inherit;
}

.pws-calendar.is-open {
  display: block;
}

.pws-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pws-calendar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--pws-color-text-dark);
  text-transform: capitalize;
}

.pws-calendar-nav {
  width: 30px;
  height: 30px;
  border: 1px solid #d8dde5;
  border-radius: 4px;
  background: var(--pws-color-white);
  color: var(--pws-color-text-dark);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.pws-calendar-nav:hover {
  border-color: var(--pws-color-primary);
  color: var(--pws-color-primary);
}

.pws-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.pws-calendar-weekday {
  padding: 4px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #747b86;
}

.pws-calendar-weekday.is-weekend {
  color: var(--pws-color-primary);
}

.pws-calendar-day {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--pws-color-text-dark);
  font-size: 12px;
  cursor: pointer;
}

.pws-calendar-day:hover:not(:disabled) {
  border-color: var(--pws-color-primary);
}

.pws-calendar-day.is-muted {
  color: #a9b0ba;
}

.pws-calendar-day.is-disabled {
  color: #c65d66;
}

.pws-calendar-day.is-disabled {
  background: #fff5f6;
  cursor: not-allowed;
  opacity: 0.72;
}

.pws-calendar-day.is-selected {
  background: var(--pws-color-primary);
  border-color: var(--pws-color-primary);
  color: var(--pws-color-white);
  font-weight: 700;
}

/* CTA */
.pws-config .btn-next {
  margin-top: 22px;
  border-radius: 4px;
  padding: 8px 22px;
  letter-spacing: 0;
  font-size: 13px;
  text-decoration: none;
}

.pws-config .pws-right .btn-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 114px;
  margin: 0;
  align-self: center;
}

.pws-config .pws-right .btn-next.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.pws-config .btn-next::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid var(--pws-color-white);
  margin-left: 12px;
}

/* Options */
.pws-config .pws-options {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--pws-color-border-soft);
  border-radius: 6px;
  background: var(--pws-color-white);
  font-size: 12.5px;
  color: var(--pws-color-text-body);
}

.pws-config .cost-summary {
  margin-top: 0;
  padding: 14px 0 0;
  border-top: none;
}

/* Warnzeile im tfoot: rote Meldung UNTER "erreichte Haushalte" (zwischen der Zeile
   und der unteren Abschlusslinie), wenn die Mindestmenge (5000 Haushalte) fehlt.
   Keine Linie zwischen "erreichte Haushalte" und der Meldung. */
.pws-config .pws-right tfoot .pws-households-warning-row td {
  color: var(--pws-color-primary);
  font-weight: 600;
  font-size: 12px;
  text-align: left;
  line-height: 1.3;
  border-top: none;
  padding-top: 0;
}
/* Untere Abschlusslinie immer unter der LETZTEN SICHTBAREN Zeile:
   - Warnung sichtbar (tfoot.has-hh-warning) -> Linie unter der Warnzeile
     (bestehende tr:last-child-Regel greift, da die Warnzeile das letzte DOM-Kind ist).
   - Warnung versteckt -> Linie unter "erreichte Haushalte" (vorletzte Zeile).
   Die Klasse wird per JS gesetzt (robuster als :has() fuer aeltere Browser). */
.pws-config .pws-right tfoot:not(.has-hh-warning) tr:nth-last-child(2) td {
  border-bottom: 2px solid #777;
}

.pws-config .cost-title {
  color: var(--pws-color-text-main);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: left;
}

.pws-config .cost-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  color: var(--pws-color-text-muted);
  font-size: 12px;
  margin-top: 10px;
}

.pws-config .cost-row strong {
  color: var(--pws-color-text-main);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.pws-config .cost-row-distribution {
  padding: 8px 0;
  border-top: none;
  border-bottom: 2px solid #777;
}

.pws-config .cost-row-distribution + .cost-row {
  margin-top: 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid #777;
}

.pws-config .cost-status {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-height: 16px;
  margin-top: 10px;
  color: var(--pws-color-text-muted);
  font-size: 11.5px;
  text-align: left;
}

.pws-config .cost-spinner {
  display: none;
  width: 1em;
  height: 1em;
  border: 2px solid rgba(176, 19, 34, 0.18);
  border-top-color: var(--pws-color-primary);
  border-radius: 50%;
  animation: pws-cost-spin 0.75s linear infinite;
}

.pws-config .cost-status.is-loading .cost-spinner {
  display: inline-block;
}

.pws-config .edition-balance {
  margin-top: 14px;
}

.pws-config .edition-balance-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  font-size: 11.5px;
  line-height: 1.25;
  color: var(--pws-color-text-muted);
  text-align: left;
}

/* "Differenz zwischen gewaehlter Auflage und erreichten Haushalten"-Zeile vorerst
   ausgeblendet (Wunsch 23.07.2026). REVERSIBEL: diesen Block entfernen. */
.pws-config .edition-balance-row {
  display: none;
}

.pws-config .edition-balance-row strong {
  color: var(--pws-color-text-main);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pws-config .edition-balance-row strong.is-shortfall {
  color: var(--pws-color-primary);
}

.pws-config .edition-balance-row strong.is-surplus {
  color: #2e9b50;
}

.pws-config .edition-auto-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--pws-color-text-muted);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

/* Immer-aktiver, gesperrter Zustand (22.07.2026): nicht klickbar wirken lassen. */
.pws-config .edition-auto-toggle.is-locked {
  cursor: default;
}

.pws-config .edition-auto-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pws-config .edition-auto-toggle i {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #e2e4e9;
  box-shadow: inset 0 0 0 1px #d3d6dd;
}

.pws-config .edition-auto-toggle i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s ease;
}

.pws-config .edition-auto-toggle input:checked + i {
  background: var(--pws-color-primary);
  box-shadow: inset 0 0 0 1px var(--pws-color-primary);
}

.pws-config .edition-auto-toggle input:checked + i::after {
  transform: translateX(18px);
}

.pws-config .edition-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}

.pws-config .btn-balance-edition {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--pws-color-primary);
  border-radius: 4px;
  background: #fff;
  color: var(--pws-color-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.pws-config .btn-balance-edition:hover {
  background: #fff7f8;
}

.pws-config .btn-balance-edition:disabled {
  opacity: 0.45;
  cursor: default;
}

/* "Auflage ausgleichen"-Button vorerst ausgeblendet (Wunsch 22.07.2026).
   REVERSIBEL: einfach diesen Block entfernen.
   Die .edition-actions-Zeile enthaelt auch den "Weiter"-Button; damit dieser
   rechtsbuendig bleibt, wird die Grid-Zeile auf eine Spalte umgestellt. */
.pws-config #pws-balance-edition {
  display: none;
}
.pws-config .edition-actions {
  grid-template-columns: auto;
  justify-content: end;
}

@keyframes pws-cost-spin {
  to {
    transform: rotate(360deg);
  }
}

.pws-config .filter-search {
  margin-bottom: 14px;
}

.pws-config .selected-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
  margin: 0 0 10px;
}

.pws-config .selected-filter-chips.is-empty {
  display: none;
}

.pws-config .selected-filter-chip {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  border: 1px solid rgba(176, 19, 34, 0.28);
  border-radius: 4px;
  background: #fff7f8;
  color: var(--pws-color-primary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.pws-config .selected-filter-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pws-config .selected-filter-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid rgba(176, 19, 34, 0.35);
  border-radius: 50%;
  background: var(--pws-color-white);
  color: var(--pws-color-primary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.pws-config .selected-filter-chip button:hover {
  background: var(--pws-color-primary);
  color: var(--pws-color-white);
}

.pws-config .filter-search input {
  width: 100%;
  border: 1px solid var(--pws-color-border-soft);
  border-radius: 6px;
  background: #f3f6fa;
  color: var(--pws-color-text-input);
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
}

.pws-config .filter-search input:focus {
  border-color: var(--pws-color-primary);
  background: var(--pws-color-white);
}

.pws-config .options-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.pws-config .options-tab {
  border: 1px solid var(--pws-color-border-tab);
  background: var(--pws-color-surface-tab);
  color: var(--pws-color-text-main);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.pws-config .options-tab.is-active {
  background: var(--pws-color-primary);
  border-color: var(--pws-color-primary);
  color: var(--pws-color-white);
}

.pws-config .options-panel {
  display: none;
  flex-direction: column;
  gap: 8px;
}

.pws-config .options-panel.is-active {
  display: flex;
}

.pws-config .filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 28px;
}

.pws-config .filter-card {
  min-width: 0;
}

.pws-config .filter-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--pws-color-primary);
  font-size: 13px;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--pws-color-border-soft);
}

.pws-config .filter-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--pws-color-primary);
  color: var(--pws-color-white);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.pws-config .filter-help::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  z-index: 1000;
  width: min(280px, 70vw);
  padding: 10px 12px;
  border-radius: 4px;
  background: var(--pws-color-text-main);
  color: var(--pws-color-white);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  transition: opacity 0.12s ease;
}

.pws-config .filter-help::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--pws-color-text-main);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.pws-config .filter-help:hover::after,
.pws-config .filter-help:focus::after,
.pws-config .filter-help:hover::before,
.pws-config .filter-help:focus::before {
  opacity: 1;
}

.filter-tooltip {
  position: absolute;
  z-index: 10000;
  max-width: 300px;
  padding: 10px 12px;
  border-radius: 4px;
  background: #2a2b30;
  color: #fff;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  transition: opacity 0.12s ease;
}

.filter-tooltip.is-visible {
  opacity: 1;
}

.pws-config .filter-options {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.pws-config .filter-loading,
.pws-config .filter-empty {
  color: var(--pws-color-text-muted);
  font-size: 13px;
}

.pws-config .pws-options .radio-line {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  column-gap: 10px;
  margin-top: 0;
}

.pws-config .pws-options .radio-indicator {
  margin-top: 1px;
}

.pws-config .pws-options .radio-text {
  line-height: 1.35;
  text-align: left;
}

.pws-config .pws-options .radio-line input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 1050px) {
  .pws-config .postwurfspezial-container {
    padding: 0 24px 100px;
  }

  .pws-config .pws-intro {
    margin: 0 0 18px;
    padding-top: 0;
  }

  .pws-config .pws-left,
  .pws-config .pws-right {
    margin-top: 0;
  }

  .pws-config .pws-grid {
    grid-template-columns: 1fr;
  }

  .pws-config .map-mode,
  .pws-config .radio-option.has-line {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }

  .pws-config .options-tabs,
  .pws-config .filter-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .pws-config .postwurfspezial-container {
    padding: 0 18px 80px;
  }
}

.pws-config .pws-map {
  height: clamp(620px, 62vh, 760px);
}

/* Compact left configuration panel */
.pws-config .pws-left {
  padding-top: 14px;
}

.pws-config .pws-left .pws-filter {
  margin-bottom: 18px;
}

.pws-config .pws-left .pws-delivery,
.pws-config .pws-left .pws-date {
  margin-bottom: 18px;
}

.pws-config .pws-delivery h2 {
  margin-bottom: 8px;
}

.pws-config .pws-delivery .radio-line {
  margin-top: 5px;
}

.pws-config .pws-date {
  margin-top: 24px;
}

.pws-config .pws-date .date-row {
  gap: 10px;
  margin-top: 7px;
}

.pws-config .pws-date .date-group {
  gap: 4px;
}

.pws-config .pws-date .date-input {
  padding: 5px 34px 5px 10px;
}

.pws-config .pws-preview {
  margin-top: 4px;
}

.pws-config .preview-card {
  margin-top: 8px;
  padding: 8px;
}

.pws-config .preview-card img {
  max-height: 180px;
  object-fit: contain;
}

.pws-config .download-label,
.pws-config .btn-download {
  margin-top: 8px;
}
