/* Log-Suche (ACP), views/logsearch.js. Eigene Datei, damit panel.css frei für andere Bereiche bleibt. */

.ls-wrap { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 16px; align-items: start; }
.ls-wrap:has(.ls-drawer:not([hidden])) { grid-template-columns: 236px minmax(0, 1fr) minmax(340px, 420px); }

/* Linke Spalte: Log-Arten */
.ls-rail { position: sticky; top: calc(var(--top-h) + 12px); max-height: calc(100vh - var(--top-h) - 28px); display: flex; flex-direction: column;
  background: var(--pane); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.ls-rail-head { display: flex; align-items: center; padding: 14px 14px 10px; font: 600 14px/1 var(--f-head); letter-spacing: 0.02em; }
.ls-rail-head .spacer { flex: 1; }
.ls-rail-x, .ls-rail-btn { display: none; }
.ls-rail-body { overflow-y: auto; padding: 0 8px 12px; scrollbar-width: thin; }
.ls-rg h3 { margin: 14px 8px 4px; font: 600 10.5px/1 var(--f-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--tx-4); }
.ls-rg ul, .ls-acts { list-style: none; margin: 0; padding: 0; }
.ls-ri-row { display: flex; align-items: center; }
.ls-ri, .ls-ra { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; width: 100%; background: transparent; border: 0;
  border-radius: var(--r-xs); color: var(--tx-2); cursor: pointer; text-align: left; }
.ls-ri { padding: 7px 8px; font: 500 13.5px/1.2 var(--f-body); }
.ls-ri .ic { width: 15px; height: 15px; color: var(--tx-3); }
.ls-ri-lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-ri b, .ls-ra b { font: 500 11.5px/1 var(--f-mono); color: var(--tx-4); }
.ls-ri:hover, .ls-ra:hover { background: var(--s-2); color: var(--tx); }
.ls-ri.in { color: var(--tx); }
.ls-ri.on, .ls-ra.on { background: var(--s-2); color: var(--tx); box-shadow: inset 2px 0 0 var(--accent); }
.ls-ri.on b, .ls-ra.on b { color: var(--accent-hi); }
.ls-ri.zero { color: var(--tx-4); }
.ls-ri.off .ls-ri-lbl { text-decoration: line-through; color: var(--tx-4); }
.ls-all { margin-top: 2px; font-weight: 600; color: var(--tx); }
.ls-caret, .ls-caret-pad { flex: none; width: 20px; height: 26px; }
.ls-caret { display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; padding: 0; color: var(--tx-4); cursor: pointer; border-radius: var(--r-xs); }
.ls-caret:hover { color: var(--tx); }
.ls-caret .ic { width: 13px; height: 13px; transition: transform 0.15s; }
.ls-caret.open .ic { transform: rotate(90deg); }
.ls-rg .ls-acts { margin: 2px 0 6px 29px; border-left: 1px solid var(--line); }
.ls-ra { padding: 5px 8px 5px 10px; border-radius: 0 var(--r-xs) var(--r-xs) 0; }
.ls-ra span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 12.5px/1.2 var(--f-mono); }

/* Suchleiste */
.ls-bar { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 6px 0 14px; background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: var(--r-sm); }
.ls-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.ls-bar > .ic { width: 18px; height: 18px; color: var(--tx-3); flex: none; }
.ls-input { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: 0; color: var(--tx);
  font: 500 14px/1 var(--f-mono); letter-spacing: 0.01em; }
form.ls-bar .ls-input { border: 0; background: transparent; box-shadow: none; padding: 0; border-radius: 0; }
.ls-input::placeholder { color: var(--tx-4); }

.ls-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.ls-tools .spacer { flex: 1; }
.ls-custom { display: inline-flex; align-items: center; gap: 8px; }
.ls-custom[hidden] { display: none; }
.ls-date { height: 34px; background: var(--in); border: 1px solid var(--line-2); border-radius: var(--r-sm); color: var(--tx);
  padding: 0 8px; font: 500 13px/1 var(--f-mono); color-scheme: dark; }

.ls-help { margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--dash); border-radius: var(--r-sm); background: var(--in); }
.ls-help[hidden] { display: none; }
.ls-help p { margin: 0 0 10px; }
.ls-examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
.ls-ex { display: flex; gap: 10px; align-items: baseline; text-align: left; background: transparent; border: 1px solid transparent;
  border-radius: var(--r-xs); padding: 5px 8px; color: var(--tx-2); cursor: pointer; font: 13px/1.3 var(--f-body); }
.ls-ex:hover { border-color: var(--line-2); background: var(--s-2); }
.ls-ex code { font: 600 12.5px/1.3 var(--f-mono); color: var(--accent-hi); white-space: nowrap; }

.ls-main { display: grid; gap: 14px; min-width: 0; }
.ls-main > .panel:first-child { overflow: visible; position: relative; z-index: 5; }
.ls-bar .btn.icon.on, .ls-tools .btn.on { color: var(--accent-hi); background: var(--accent-wash); }
.ls-tools .btn[hidden] { display: none; }

/* Gespeicherte Suchen: Menü statt Chip-Zeile */
.ls-menu-wrap { position: relative; }
.ls-menu { position: absolute; z-index: 40; top: calc(100% + 6px); right: 0; width: min(360px, 86vw); max-height: 360px; overflow-y: auto;
  padding: 6px; background: var(--pane); border: 1px solid var(--line-2); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); }
.ls-menu[hidden] { display: none; }
.ls-mi { display: flex; align-items: center; gap: 4px; border-radius: var(--r-xs); }
.ls-mi:hover { background: var(--s-2); }
.ls-mi-go { flex: 1; min-width: 0; display: grid; gap: 3px; text-align: left; background: transparent; border: 0; padding: 8px 10px;
  color: var(--tx); cursor: pointer; font: 600 13px/1.2 var(--f-body); }
.ls-mi-go code { font: 12px/1.3 var(--f-mono); color: var(--tx-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-mi-empty { margin: 0; padding: 10px; }

.ls-q { padding: 8px 10px; background: var(--in); border: 1px solid var(--line); border-radius: var(--r-xs); overflow-wrap: anywhere; }

/* Ergebnis-Kopf + Kategorien */
.ls-rhead { display: flex; align-items: baseline; gap: 12px; padding: 14px 16px 0; }
.ls-status { font: 600 15px/1.2 var(--f-head); letter-spacing: 0.02em; color: var(--tx); }
.ls-status.err { color: var(--red-hi); font-size: 13.5px; }
.ls-range { margin-left: auto; white-space: nowrap; }
/* Tabelle */
.ls-results { border-top: 0; }
.ls-table th { padding: 10px 16px; }
.ls-table td { padding: 9px 16px; font-size: 13.5px; white-space: nowrap; border-bottom-color: rgba(255, 255, 255, 0.04); }
.ls-day td { padding: 14px 16px 6px; font: 600 11px/1 var(--f-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--tx-4);
  background: transparent; border-bottom: 1px solid var(--line); }
.ls-row { cursor: pointer; }
.ls-row:hover td { background: var(--s-2); }
.ls-row.sel td { background: var(--accent-wash); }
.ls-row.hot td:first-child { box-shadow: inset 2px 0 0 var(--red); }
.ls-row.sel td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.ls-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ls-time { width: 1%; font: 500 12.5px/1 var(--f-mono); color: var(--tx-3); }
.ls-ev { width: 1%; }
.ls-ev, .ls-who { white-space: nowrap; }
.ls-ev > * { vertical-align: middle; }
.ls-ev-txt { display: inline-flex; flex-direction: column; gap: 3px; margin-left: 10px; vertical-align: middle; }
.ls-ev .tag.ls-sev { margin-left: 10px; font-size: 10.5px; padding: 2px 6px; }
.ls-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tx-4); vertical-align: middle; }
.ls-dot.sev-1 { background: var(--ice-hi); }
.ls-dot.sev-2 { background: var(--warn); }
.ls-dot.sev-3 { background: #ff9a3d; box-shadow: 0 0 0 3px rgba(255, 154, 61, 0.15); }
.ls-dot.sev-4 { background: var(--red); box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.2); }
.ls-arrow { margin: 0 8px; color: var(--tx-4); }
.ls-table td.ls-detail { white-space: normal; min-width: 240px; width: 100%; }
.ls-msg { color: var(--tx-2); overflow-wrap: anywhere; }
td.ls-detail > * + * { margin-left: 10px; }
.ls-person { display: inline-flex; align-items: baseline; gap: 5px; }
.ls-src { font: 500 11px/1 var(--f-mono); color: var(--tx-4); }

/* anklickbare Werte */
.lsv { display: inline; background: transparent; border: 0; padding: 1px 3px; margin: 0 -3px; border-radius: var(--r-xs);
  color: inherit; font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.lsv:hover { background: var(--accent-wash); color: var(--accent-hi); box-shadow: inset 0 -1px 0 var(--accent-glow); }
.lsv:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lsv.bare { padding: 0; margin: 0; }
.lsv.bare:hover { background: transparent; box-shadow: none; filter: brightness(1.25); }
.lsv.cat { font: 500 11.5px/1 var(--f-body); color: var(--tx-4); }
.lsv.act { font: 500 13px/1 var(--f-mono); color: var(--tx); }
.lsv.mono { font-family: var(--f-mono); font-size: 12.5px; }
.lsv.amt { font-family: var(--f-mono); color: var(--ok); }
.lsv.item { font-family: var(--f-mono); color: var(--gold); }

/* Stufen */
.tag.ls-sev.sev-0 { color: var(--tx-3); }
.tag.ls-sev.sev-1 { color: var(--ice-hi); border-color: var(--ice-line); background: var(--ice-soft); }
.tag.ls-sev.sev-2 { color: var(--warn); border-color: rgba(255, 138, 61, 0.4); background: var(--warn-soft); }
.tag.ls-sev.sev-3 { color: #ff9a3d; border-color: rgba(255, 154, 61, 0.45); background: rgba(255, 154, 61, 0.12); }
.tag.ls-sev.sev-4 { color: #fff; border-color: var(--red); background: var(--red); }

/* Detail-Leiste */
.ls-drawer { position: sticky; top: calc(var(--top-h) + 12px); max-height: calc(100vh - var(--top-h) - 28px); display: flex; flex-direction: column;
  background: var(--pane); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.ls-drawer[hidden] { display: none; }
.ls-dhead { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2); font: 600 15px/1 var(--f-head); letter-spacing: 0.04em; }
.ls-dhead .spacer { flex: 1; }
.ls-dbody { padding: 14px 16px 18px; overflow-y: auto; display: grid; gap: 16px; align-content: start; }
.ls-dmsg { margin: 0; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.ls-sec h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; font: 600 12px/1 var(--f-display); letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--tx-3); }
.ls-sec h3 .ic { width: 14px; height: 14px; }
.ls-sec h3 .btn { margin-left: auto; }
.ls-sec .ev-grid { grid-template-columns: 1fr; }
.ls-people { display: grid; gap: 10px; }
.ls-pcard { border: 1px solid var(--line-2); border-radius: var(--r-sm); background: rgba(0, 0, 0, 0.18); padding: 12px; display: grid; gap: 10px; }
.ls-ptitle { font: 600 11px/1 var(--f-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.ls-pbtns { display: flex; flex-wrap: wrap; gap: 6px; }
.ls-pbtns .btn .ic { width: 13px; height: 13px; }
.ls-pbtns .ls-discord { border-color: rgba(88, 101, 242, 0.5); color: #b3baff; }
.ls-pbtns .ls-discord:hover { background: rgba(88, 101, 242, 0.16); }
.ls-json { margin: 0; max-height: 320px; overflow: auto; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-xs); font: 12px/1.5 var(--f-mono); color: var(--tx-2); white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 1400px) {
  .ls-wrap:has(.ls-drawer:not([hidden])) { grid-template-columns: 236px minmax(0, 1fr); }
  .ls-drawer { position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); max-height: none; border-radius: 0; }
}
@media (max-width: 1100px) {
  .ls-wrap, .ls-wrap:has(.ls-drawer:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  .ls-rail-btn, .ls-rail-x { display: inline-flex; }
  .ls-rail { position: fixed; z-index: 61; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); max-height: none; border-radius: 0;
    transform: translateX(-105%); transition: transform 0.18s; box-shadow: var(--shadow-lg); }
  .ls-wrap.rail-open .ls-rail { transform: none; }
  .ls-drawer { position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); max-height: none; border-radius: 0; }
}
@media (max-width: 720px) {
  .ls-tools .spacer { display: none; }
  .ls-rail { bottom: var(--tab-h); }
  .ls-table td, .ls-ev, .ls-who { white-space: normal; }
  .ls-table tr.ls-row { grid-template-columns: auto 1fr !important; align-items: center; }
  .ls-table td::before { display: none !important; }
  .ls-time { order: 0; }
  .ls-ev { order: 1; }
  .ls-who { grid-column: 1 / -1; order: 2; }
  .ls-table td.ls-detail { grid-column: 1 / -1; order: 3; max-width: none; min-width: 0; }
  .ls-table td.ls-detail:empty { display: none; }
  .ls-table tr.ls-day { display: block !important; padding: 0 !important; }
  .ls-day td { padding: 14px 14px 6px !important; display: block; }
  .ls-range { display: none; }
  .ls-row.hot td:first-child, .ls-row.sel td:first-child { box-shadow: none; }
  .ls-row.hot { box-shadow: inset 3px 0 0 var(--red); }
  .ls-drawer { bottom: var(--tab-h); }
}

/* Graffiti-Foto im Log-Detail */
.ls-photo { display: block; max-width: 100%; max-height: 320px; border-radius: 6px; border: 1px solid var(--line, rgba(255,255,255,.1)); margin-top: 6px; object-fit: contain; background: #000; }
