/*
 * Adresseingabe — Stil zur Komponente in adresse-eingabe.js.
 * Wird NACH kalkuel.css eingebunden; nutzt dessen Tokens.
 * Geteilt zwischen internem AVG und Kunden-Produkt (byte-identisch).
 */
.ae-original[hidden] { display: none !important; }
/* Das alte Feld-Label wird von den vier Feldbeschriftungen ersetzt. */
label.ae-feldlabel[hidden] { display: none !important; }

.ae {
  --ae-ok: #15803d;
  --ae-warn: #b45309;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.ae-feld-strasse { position: relative; }

.ae .ae-suchfeld,
.ae .ae-input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong, #cfd4e0);
  border-radius: var(--radius, 8px);
  background: #fff;
  font: inherit;
  font-size: 14px;
}
.ae .ae-suchfeld:focus,
.ae .ae-input:focus {
  outline: none;
  border-color: var(--accent, #252E56);
  box-shadow: var(--focus-ring, 0 0 0 3px rgba(0,204,204,.22));
}
.ae .ae-suchfeld:focus-visible,
.ae .ae-input:focus-visible {
  outline: 2px solid var(--accent, #252E56);
  outline-offset: 1px;
}
.ae .ae-suchfeld:disabled,
.ae .ae-input:disabled,
.ae .ae-input[readonly] {
  background: #f8fafc;
  color: #475569;
}

.ae-liste {
  position: absolute;
  z-index: 50;
  left: 0;
  top: calc(100% + 2px);
  min-width: 100%;
  width: max-content;
  max-width: min(520px, 90vw);
  margin: 0;
  padding: 4px 0;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border-strong, #cfd4e0);
  border-radius: var(--radius, 8px);
  box-shadow: var(--shadow-md, 0 4px 14px rgba(15,23,42,.08));
}
.ae-liste[hidden] { display: none; }
.ae-option {
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.35;
  cursor: pointer;
}
.ae-option:hover { background: #f1f5f9; }
.ae-option.ae-aktiv,
.ae-option[aria-selected="true"] {
  background: var(--accent, #252E56);
  color: #fff;
}

.ae-hinweis {
  font-size: 12px;
  color: var(--label, #64748b);
  min-height: 0;
}
.ae-hinweis:empty { display: none; }

.ae-felder {
  display: grid;
  /* Zeile 1: Straße breit, Nr schmal · Zeile 2: PLZ schmal, Ort breit */
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  gap: 8px;
}
.ae-feld { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ae-feld-strasse { grid-column: 1 / 3; grid-row: 1; }
.ae-feld-hausnummer { grid-column: 3 / 4; grid-row: 1; }
.ae-feld-plz { grid-column: 1 / 2; grid-row: 2; }
.ae-feld-ort { grid-column: 2 / 4; grid-row: 2; }

.ae .ae-lbl {
  font-size: 12px;
  font-weight: 500;
  color: var(--label, #64748b);
  margin: 0;
}

.ae-statuszeile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 13px;
}
.ae-statuszeile:has(.ae-status:empty) { display: none; }
.ae-status { display: inline-flex; align-items: center; gap: 5px; }
.ae-status:focus { outline: none; }
.ae-status:focus-visible { outline: 2px solid var(--accent, #252E56); outline-offset: 2px; border-radius: 4px; }
.ae-sym { font-weight: 700; }
.ae[data-status="bestaetigt"] .ae-status { color: var(--ae-ok); }
.ae[data-status="warnung"] .ae-status,
.ae[data-status="nicht_verfuegbar"] .ae-status { color: var(--ae-warn); }
.ae[data-status="uebernommen"] .ae-status,
.ae[data-status="pruefung"] .ae-status { color: var(--label, #64748b); }

.ae-aktionen { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.ae .ae-aktion {
  min-height: 28px;
  padding: 3px 10px;
  border: 1px solid var(--border-strong, #cfd4e0);
  border-radius: var(--radius, 8px);
  background: #fff;
  color: var(--accent, #252E56);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.ae .ae-aktion:hover { border-color: var(--accent, #252E56); }
.ae .ae-aktion:focus-visible { outline: 2px solid var(--accent, #252E56); outline-offset: 2px; }
.ae .ae-aktion:disabled { opacity: .55; cursor: not-allowed; }

/* Pflichtfeld nicht ausgefüllt (Klasse „invalid" am Original) */
.ae.ae-invalid .ae-suchfeld,
.ae.ae-invalid .ae-input { border-color: var(--error, #dc2626) !important; }

/* In Zeilen-Layouts (Verwaltung) eine eigene volle Zeile */
.upload-row > .ae,
.sd-adresse-row > .ae { flex-basis: 100%; }

@media (max-width: 520px) {
  .ae-felder { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .ae-feld-strasse { grid-column: 1 / 3; grid-row: 1; }
  .ae-feld-hausnummer { grid-column: 1 / 2; grid-row: 2; }
  .ae-feld-plz { grid-column: 1 / 2; grid-row: 3; }
  .ae-feld-ort { grid-column: 2 / 3; grid-row: 3; }
}
