/* ==========================================================================
   Lage-Kachel („Siri, Lage“) – unter der Kurznotiz
   ========================================================================== */
.lage-card {
  --lage-gruen: #10b981;
  --lage-gelb: #f5b82e;
  --lage-rot: #ff2a5c;
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.lage-card::before {            /* feiner Farbschein der Ampelstufe oben links */
  content: "";
  position: absolute;
  inset: -40% auto auto -20%;
  width: 60%;
  height: 120%;
  background: radial-gradient(closest-side, var(--lage-schein, transparent), transparent);
  opacity: .16;
  pointer-events: none;
}
.lage-s-gruen { --lage-schein: var(--lage-gruen); }
.lage-s-gelb { --lage-schein: var(--lage-gelb); }
.lage-s-rot { --lage-schein: var(--lage-rot); }

.lage-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
}
.lage-kopf-titel {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.lage-titel {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}
.lage-kopf-info {
  font-size: .8rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.lage-status { font-size: .76rem; color: var(--text-secondary); }
.lage-status-err {
  color: #fb7185;
  max-width: 34ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lage-kopf-aktionen { display: flex; gap: 6px; flex: none; }
.lage-icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, .05);
  color: var(--text-primary);
  font-size: .95rem;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .12s ease;
}
.lage-icon-btn:hover { background: rgba(255, 255, 255, .1); border-color: var(--border-highlight); }
.lage-icon-btn:active { transform: scale(.94); }
.lage-icon-btn:disabled { opacity: .45; cursor: default; }
.lage-icon-btn:focus-visible, .lage-btn:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }

.lage-body {
  display: grid;
  grid-template-columns: minmax(205px, 232px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  position: relative;
}
.lage-ampelbox {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--border-subtle);
}
.lage-ampel { width: 40px; height: auto; flex: none; }
.lage-ampeltext { min-width: 0; }
.lage-urteil {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.1;
}
.lage-fenster { font-size: .78rem; color: var(--text-secondary); margin-top: 2px; }
.lage-gruende {
  list-style: none;
  margin: 5px 0 0;
  padding: 0;
  font-size: .73rem;
  line-height: 1.35;
  color: var(--text-secondary);
}
.lage-gruende li + li { margin-top: 2px; }

.lage-zeilen {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 1120px) {
  .lage-zeilen {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}
.lage-z {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--border-subtle);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.lage-z dt {
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.lage-z dd { margin: 0; font-size: .82rem; font-weight: 500; color: var(--text-primary); line-height: 1.3; }
.lage-z dd span { display: block; }
.lage-z dd span.lage-huau { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--border-subtle); }
.lage-z dd small { display: block; font-size: .71rem; font-weight: 400; color: var(--text-secondary); margin-top: 2px; line-height: 1.3; }

.lage-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
  background: var(--text-muted);
}
.s-gruen { color: var(--lage-gruen); }
.s-gelb { color: var(--lage-gelb); }
.s-rot { color: var(--lage-rot); }
.lage-dot.s-gruen { background: var(--lage-gruen); }
.lage-dot.s-gelb { background: var(--lage-gelb); }
.lage-dot.s-rot { background: var(--lage-rot); }

/* Noch nicht eingerichtet */
.lage-leer-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}
.lage-leer-inner .lage-ampel { width: 30px; opacity: .8; }
.lage-leer-inner > div { flex: 1; min-width: 0; }
.lage-leer-text { margin: 2px 0 0; font-size: .82rem; color: var(--text-secondary); }
.lage-btn {
  flex: none;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  font: 600 .86rem var(--font-sans);
  cursor: pointer;
}
.lage-btn-primary { background: var(--accent-primary); border-color: transparent; color: #fff; }

html[data-theme="light"] .lage-icon-btn,
html[data-theme="light"] .lage-z { background: rgba(15, 23, 42, .035); }
html[data-theme="light"] .s-gelb { color: #b7791f; }

@media (max-width: 760px) {
  .lage-body { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .lage-zeilen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .lage-card { padding: 12px 12px 14px; }
  .lage-zeilen { gap: 6px; }
  .lage-z { padding: 7px 8px; }
  .lage-z dd { font-size: .8rem; }
  .lage-z dd small { font-size: .7rem; }
  .lage-z:last-child { grid-column: 1 / -1; }   /* Versys über die ganze Breite */
  .lage-ampel { width: 38px; }
  .lage-urteil { font-size: 1.3rem; }
  .lage-leer-inner { flex-wrap: wrap; gap: 10px; }
  .lage-leer-inner .lage-btn { width: 100%; }
  .lage-kopf-info { white-space: normal; }
}
@media (max-width: 340px) {
  .lage-zeilen { grid-template-columns: minmax(0, 1fr); }
}

/* Einrichten-Fenster: Stimme */
.lage-stimme-label { display: block; margin: 14px 0 6px; font-size: .8rem; font-weight: 600; color: var(--text-secondary); }
.lage-stimme-wrap { display: flex; gap: 8px; align-items: stretch; }
.lage-stimme-select { flex: 1; min-width: 0; appearance: auto; cursor: pointer; }
.lage-stimme-hinweis { margin: 6px 0 0; font-size: .74rem; line-height: 1.4; color: var(--text-muted); }

/* Eingeklappt (iPhone): eine Zeile, Tippen öffnet */
.lage-eingeklappt { padding: 0; gap: 0; }
.lage-zu {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.lage-zu:active { opacity: .75; }
.lage-zu:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: -2px; border-radius: var(--radius-xl); }
.lage-mini-ampel {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px;
  border-radius: 8px;
  background: linear-gradient(90deg, #2a3142, #141925);
  border: 1px solid rgba(255, 255, 255, .12);
  flex: none;
}
.lage-mini-ampel i { width: 9px; height: 9px; border-radius: 50%; opacity: .18; }
.lage-mini-ampel .r { background: var(--lage-rot); }
.lage-mini-ampel .y { background: var(--lage-gelb); }
.lage-mini-ampel .g { background: var(--lage-gruen); }
.lage-mini-ampel i.an { opacity: 1; box-shadow: 0 0 8px currentColor; }
.lage-mini-ampel .r.an { color: var(--lage-rot); }
.lage-mini-ampel .y.an { color: var(--lage-gelb); }
.lage-mini-ampel .g.an { color: var(--lage-gruen); }
.lage-zu-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lage-zu-zeile { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.lage-zu-urteil { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.lage-zu-service { font-size: .78rem; font-weight: 600; }
.lage-zu-info { font-size: .76rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lage-zu-pfeil { font-size: 1.6rem; line-height: 1; color: var(--text-muted); flex: none; transform: translateY(-1px); }

/* Aufgeklappt (iPhone): Tippen auf die Kachel klappt direkt wieder ein */
.lage-offen-klappbar {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Eingeklappte Zeile v2.4.3: Tageszusammenfassung + Motorrad-Kärtchen statt Ampel */
.lage-zu-datum { font-size: .78rem; color: var(--text-muted); }
.lage-zu-info {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--text-secondary);
  font-size: .8rem;
  line-height: 1.35;
}
.lage-zu-chips { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.lage-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, .05);
  font-size: .74rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.lage-chip .lage-dot { margin-right: 0; }
html[data-theme="light"] .lage-chip { background: rgba(15, 23, 42, .04); }
.lage-ampel-label { font-size: .68rem; font-weight: 600; color: var(--text-muted); margin-bottom: 1px; }
