:root{
  --bg:#f4f7f8; --surface:#ffffff; --ink:#1d2b33; --muted:#5c6f78;
  --line:#d9e2e6; --accent:#0e6c77; --accent-soft:#e3f0f2;
  --radius:10px; --focus:0 0 0 3px rgba(14,108,119,.28);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--ink);
  font:15px/1.45 "Segoe UI",system-ui,-apple-system,Roboto,"Helvetica Neue",Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}
header.app{
  max-width:720px; margin:0 auto; padding:22px 16px 6px;
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
}
header.app h1{
  font-size:26px; font-weight:600; letter-spacing:.2px; margin:0;
  display:flex; align-items:center; gap:10px;
}
header.app h1 .logo{
  width:32px; height:32px; display:block;
  border-radius:7px; box-shadow:0 1px 3px rgba(29,43,51,.25);
}
main{max-width:720px; margin:0 auto; padding:10px 16px 30px}

.card{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
  padding:14px 16px 16px; box-shadow:0 1px 2px rgba(29,43,51,.05); overflow:hidden;
}
.card h2{
  margin:-14px -16px 12px; padding:8px 16px 7px;
  font-size:13px; font-weight:700; letter-spacing:.6px; text-transform:uppercase;
  background:var(--accent-soft); color:var(--accent); border-bottom:1px solid var(--line);
}
.stack>.card+.card{margin-top:14px}

/* dezenter Hinweistext in den H2-Zeilen */
.card h2 .h2hint{
  font-style:normal; font-weight:400; font-size:12px;
  letter-spacing:normal; text-transform:none;
  color:var(--muted); margin-left:10px; white-space:nowrap;
}

/* collapsible introduction */
.intro{margin-bottom:16px}
.intro h2{
  /* auto 1fr auto: Titel+Hinweis bekommen so viel Platz wie nötig, der Pfeil bleibt rechts
     (mit 1fr auto 1fr bekam die Titelspalte nur die halbe Breite → zu früher Umbruch) */
  display:grid; grid-template-columns:auto 1fr auto; align-items:center;
  cursor:pointer; user-select:none;
}
.intro h2 > span{grid-column:1; grid-row:1; justify-self:start}
#btnInstall{
  grid-column:2; grid-row:1; justify-self:center;
  appearance:none; cursor:pointer; font:inherit;
  font-size:13px; font-weight:600; letter-spacing:normal; text-transform:none;
  color:var(--ink); background:var(--surface);
  border:1px solid var(--line); border-radius:6px; padding:3px 10px; line-height:1.3;
}
#btnInstall:hover{border-color:var(--accent); color:var(--accent)}
#btnInstall:focus-visible{outline:none; box-shadow:var(--focus)}
#introToggle{
  grid-column:3; grid-row:1; justify-self:end;
  appearance:none; border:0; background:transparent; cursor:pointer;
  color:inherit; font-size:32px; padding:0 4px;
  transition:transform .15s;
  height:16px; line-height:0; display:flex; align-items:center;
}
.intro.collapsed #introToggle{transform:rotate(-90deg)}
.intro.collapsed #introBody{display:none}
.intro.collapsed h2{margin-bottom:-16px; border-bottom:0}
#introToggle:focus-visible{outline:none; box-shadow:var(--focus); border-radius:4px}
.intro p{margin:0 0 8px; font-size:14.5px}
.intro p:last-child{margin-bottom:0}
.intro a{color:var(--accent)}
.intro p.hint{
  margin-top:10px; padding-top:9px; border-top:1px solid var(--line);
  color:var(--muted); font-size:13.5px;
}

.note{color:var(--muted); font-size:13px; margin:10px 0 0}

/* toolbar buttons */
.toolbar{display:flex; gap:10px; flex-wrap:wrap}
.filebar{align-items:center}
.filebar .fileinfo{margin:0; overflow-wrap:anywhere}
.toolbar button{
  appearance:none; font:inherit; font-weight:600; cursor:pointer;
  color:var(--ink); border:1px solid #b3c2c9; border-radius:8px; padding:9px 18px;
  background:linear-gradient(#ffffff, #e9eff2);
  box-shadow:0 1px 2px rgba(29,43,51,.18), inset 0 1px 0 #fff;
}
.toolbar button:hover:enabled{
  border-color:var(--accent); color:var(--accent);
  background:linear-gradient(#ffffff, #e0edef);
}
.toolbar button:active:enabled{
  transform:translateY(1px); background:#e4ebee;
  box-shadow:inset 0 1px 3px rgba(29,43,51,.22);
}
.toolbar button:disabled{opacity:.5; cursor:default}
.toolbar button:focus-visible{outline:none; box-shadow:var(--focus)}

/* search */
.searchrow{position:relative; margin-bottom:10px}
.searchrow input{
  width:100%; font:inherit; padding:8px 38px 8px 12px;
  border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--ink);
}
.searchrow input:focus{outline:none; box-shadow:var(--focus); border-color:var(--accent)}
.searchrow input::-webkit-search-cancel-button{display:none}
#btnClearSearch{
  position:absolute; right:4px; top:50%; transform:translateY(-50%);
  appearance:none; border:0; background:transparent; cursor:pointer;
  font-size:22px; line-height:1; padding:4px 8px; color:var(--muted);
}
#btnClearSearch:hover{color:var(--accent)}

/* result table */
.result .tablewrap{max-height:60vh; overflow:auto; margin:0 -4px; padding:0 4px}
table{border-collapse:collapse; width:100%; font-variant-numeric:tabular-nums}
th{
  text-align:left; font-size:12.5px; letter-spacing:.4px; text-transform:uppercase;
  color:var(--muted); border-bottom:2px solid var(--line); padding:4px 8px 6px;
  position:sticky; top:0; background:var(--surface); z-index:1;
}
td{border-bottom:1px solid var(--line); padding:8px 8px; font-size:14.5px}
tbody tr{cursor:pointer}
tbody tr:hover td{background:var(--accent-soft)}
tbody tr:active td{background:#d3e7ea}
td.c-name{font-weight:600}
td.c-ort{color:var(--muted)}
.empty td{color:var(--muted); cursor:default; text-align:center; padding:18px 8px}
.empty:hover td{background:transparent}

/* detail view */
.detail h2{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
#btnBack{
  appearance:none; cursor:pointer; font:inherit;
  font-size:13px; font-weight:600; letter-spacing:normal; text-transform:none;
  color:var(--ink); background:var(--surface);
  border:1px solid var(--line); border-radius:6px; padding:3px 12px; line-height:1.4;
  display:flex; align-items:center; gap:8px;
  margin:-4px 0;  /* verhindert, dass der Button die H2-Zeile höher macht */
}
#btnBack .bicon{
  /* Dasselbe Dreieck wie in der Einführung-Zeile (#introToggle), nur mit Spitze nach links gedreht;
     gleiche Technik gegen Höhenzuwachs: begrenzte Höhe + line-height:0 */
  font-size:32px; height:16px; line-height:0;
  display:flex; align-items:center;
  transform:rotate(90deg);
}
#btnBack:hover{border-color:var(--accent); color:var(--accent)}
#btnBack:focus-visible{outline:none; box-shadow:var(--focus)}

.d-head{display:flex; gap:14px; align-items:flex-start; margin-bottom:6px}
.d-photo{
  width:150px; height:150px; flex:none; border-radius:10px; object-fit:cover;
  border:1px solid var(--line); box-shadow:0 1px 3px rgba(29,43,51,.18); background:var(--accent-soft);
}
.d-headtext{min-width:0}
.d-name{font-size:20px; font-weight:600; line-height:1.25; overflow-wrap:anywhere}
.d-sub{color:var(--muted); font-size:14px; margin-top:2px; overflow-wrap:anywhere}
.d-groups{margin-top:8px; display:flex; gap:6px; flex-wrap:wrap}
.d-groups span{
  background:var(--accent-soft); color:var(--accent); border:1px solid var(--line);
  border-radius:999px; padding:2px 10px; font-size:12.5px; font-weight:600;
}

.d-section{margin-top:14px}
.d-section h3{
  margin:0 0 4px; font-size:12.5px; font-weight:700; letter-spacing:.5px;
  text-transform:uppercase; color:var(--muted);
  border-bottom:1px solid var(--line); padding-bottom:3px;
}
.d-row{display:flex; gap:12px; padding:5px 0; border-bottom:1px solid #eef3f5; align-items:baseline}
.d-row:last-child{border-bottom:0}
.d-row .lbl{flex:0 0 152px; color:var(--muted); font-size:13px}
.d-row .val{min-width:0; overflow-wrap:anywhere; white-space:pre-wrap}
.d-row .val a{color:var(--accent); text-decoration:none; font-weight:600}
.d-row .val a:hover{text-decoration:underline}

footer{
  max-width:720px; margin:0 auto; padding:8px 16px 26px; color:var(--muted); font-size:13px;
  display:flex; gap:8px; flex-wrap:wrap; align-items:center;
}
footer a{color:var(--accent); text-decoration:none}
footer a:hover{text-decoration:underline}

#toast{
  position:fixed; left:50%; bottom:26px; transform:translateX(-50%) translateY(20px);
  background:var(--ink); color:#fff; padding:9px 16px; border-radius:8px; font-size:14px;
  opacity:0; pointer-events:none; transition:opacity .2s, transform .2s; max-width:90vw;
}
#toast.show{opacity:1; transform:translateX(-50%) translateY(0)}
@media (prefers-reduced-motion:reduce){ #toast{transition:none} }

@media (max-width:480px){
  .d-row{flex-direction:column; gap:0}
  .d-row .lbl{flex:none}
  td.c-ort{max-width:110px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
}
