/* ---------- Protokoll & Status (ui/activity.js) ---------- */
dialog.modal.act-modal {
  max-width: min(900px, calc(100vw - 24px));
}
.dlg.act {
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto; /* auf kleinen Bildschirmen scrollt das ganze Fenster */
  gap: 12px;
}
.act-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

/* Statusfeld: Kacheln */
.act-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px;
}
.act-tile {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 0;
}
.act-tile-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 13.5px;
}
.act-line {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.act-line:first-of-type {
  color: var(--text);
}
.act-note {
  font-size: 12.5px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--accent-weak);
  color: var(--accent-text);
}

/* Filter und Suche */
.act-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
.act-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.act-chip {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 11px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.act-chip:hover {
  background: var(--hover);
}
.act-chip.on {
  background: var(--accent-weak);
  border-color: var(--accent);
  color: var(--accent-text);
}
.dlg .act-search {
  width: 170px;
  padding: 5px 10px;
  font-size: 13px;
}

/* Liste */
.act-list {
  flex: 1 1 auto;
  min-height: 160px;
  max-height: 44vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.act-day {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 4px 12px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}
.act-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 12px 7px 10px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  font-size: 13px;
}
.act-row:last-child {
  border-bottom: 0;
}
.act-row.warn {
  border-left-color: #f5a623;
}
.act-row.bad {
  border-left-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 7%, transparent);
}
.act-time {
  flex: none;
  width: 58px;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--muted);
  padding-top: 2px;
}
.act-badge {
  flex: none;
  width: 92px;
  text-align: center;
  font-size: 11px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 999px;
  background: var(--hover);
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.act-badge[data-src='ki'] {
  background: #ede4fb;
  color: #6d3fc0;
}
.act-badge[data-src='server'],
.act-badge[data-src='import'] {
  background: var(--accent-weak);
  color: var(--accent-text);
}
.act-badge[data-src='geraet'] {
  background: #dff3e6;
  color: #1f7a45;
}
.act-badge[data-src='nachbar'] {
  background: #fdf0d6;
  color: #94620a;
}
:root[data-theme='dark'] .act-badge[data-src='ki'] {
  background: #33264f;
  color: #c9b3f5;
}
:root[data-theme='dark'] .act-badge[data-src='geraet'] {
  background: #1d3a2a;
  color: #8fd8ac;
}
:root[data-theme='dark'] .act-badge[data-src='nachbar'] {
  background: #44361a;
  color: #f1c97a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .act-badge[data-src='ki'] {
    background: #33264f;
    color: #c9b3f5;
  }
  :root:not([data-theme='light']) .act-badge[data-src='geraet'] {
    background: #1d3a2a;
    color: #8fd8ac;
  }
  :root:not([data-theme='light']) .act-badge[data-src='nachbar'] {
    background: #44361a;
    color: #f1c97a;
  }
}
.act-text {
  flex: 1 1 auto;
  min-width: 0;
}
.act-msg {
  overflow-wrap: anywhere;
}
.act-text small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}
.act-open {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--accent-text);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
}
.act-open:hover {
  background: var(--hover);
}
.act-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.act-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 560px) {
  .act-tiles {
    grid-template-columns: 1fr;
  }
  .act-list {
    flex: none;
    max-height: 55vh;
    max-height: 55dvh;
  }
  .act-row {
    flex-wrap: wrap;
    gap: 4px 8px;
  }
  .act-text {
    flex-basis: 100%;
  }
  .act-badge {
    width: auto;
  }
  .dlg .act-search {
    width: 100%;
  }
}
