/* TT-DB — Reiter im Bereich Wartung (Chat „Mangel-Datenbank", 18.11.2026). Aussehen wie der Rest der App:
   weiße Kacheln auf hellem Grau, Blau nur für Aktionen, Farben je Art aus unserer Palette. */

/* Reiterleiste: TT-DB gehört seit 26.11.2026 zu Vorbereitung (Schlüssel „haus", Philip: „bei allen in den Bereich
   Vorbereitung"), dort meist als Kachel (kacheln.js); in Wartung und Auto nie. Muster wie voice.css. */
body[data-bereich="haus"] nav.reiter:has(#reiter-ttdb:not([hidden])) { display: inline-flex !important; }
body[data-bereich="haus"] nav.reiter > #reiter-ttdb:not([hidden]) { display: inline-block !important; order: 1; }
body[data-bereich="mast"] #reiter-ttdb, body[data-bereich="auto"] #reiter-ttdb { display: none !important; }

.tt-seite { max-width: 860px; margin: 0 auto; padding-bottom: 7rem; }

/* Farben je Art (Hintergrund · Schrift · Punkt) */
.tt-f-rot    { --tt-bg: var(--rot-grund);  --tt-fg: var(--schlecht-text); --tt-pk: #ff3b30; }
.tt-f-gelb   { --tt-bg: var(--warn-grund); --tt-fg: var(--warn-text);     --tt-pk: #ffb800; }
.tt-f-blau   { --tt-bg: #e8f1ff;           --tt-fg: #0a5bd3;              --tt-pk: var(--akzent); }
.tt-f-lila   { --tt-bg: #f3ecfb;           --tt-fg: #6b3fa0;              --tt-pk: #af52de; }
.tt-f-orange { --tt-bg: #fff0e0;           --tt-fg: #a5520a;              --tt-pk: #ff9500; }
.tt-f-gruen  { --tt-bg: var(--gut-grund);  --tt-fg: var(--gut-text);      --tt-pk: var(--gut); }
.tt-f-grau   { --tt-bg: var(--grund);      --tt-fg: var(--text);          --tt-pk: var(--leise); }

/* Kopf: Titel + Umschalter Suche · Katalog · Eingang */
.tt-kopf { padding: .9rem 1rem .8rem; margin-bottom: .9rem; }
.tt-kopf-zeile { display: flex; align-items: center; gap: .6rem; }
.tt-titel { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tt-titel .nr { font-weight: 600; font-size: 1.05rem; letter-spacing: -.2px; }
.tt-titel .leise { font-size: .8rem; }
.tt-ki-marke { flex: none; font-size: .75rem; font-weight: 600; color: var(--akzent); background: #e8f1ff; border-radius: 99px; padding: 3px 9px; }
.tt-segment { display: flex; background: var(--grund); border-radius: 10px; padding: 2px; margin-top: .75rem; }
.tt-segment button { flex: 1; border-radius: 8px; background: none; color: var(--text); padding: .45rem .3rem; font-size: .9rem; }
.tt-segment button[aria-pressed="true"] { background: var(--flaeche); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.tt-segment button[hidden] { display: none; }
.tt-zahl:not(:empty) { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: var(--akzent);
  color: #fff; font-size: .72rem; font-weight: 600; line-height: 18px; }

/* Suchfeld */
.tt-suchfeld { display: flex; align-items: center; gap: .4rem; background: var(--flaeche); border: 1px solid var(--kachelrand);
  border-radius: 14px; padding: .2rem .3rem .2rem .8rem; }
.tt-suchfeld:focus-within { border-color: var(--akzent); }
.tt-suchfeld > svg { width: 20px; height: 20px; color: var(--leise); flex: none; }
.tt-suchfeld input { flex: 1; min-width: 0; background: none; padding: .75rem 0; font-size: 16px; }
.tt-suchfeld input::-webkit-search-cancel-button { display: none; }
.tt-suchfeld input:focus-visible { outline: none; }      /* der Rahmen des Felds zeigt den Fokus schon */
.tt-leeren { width: 34px; height: 34px; padding: 0; flex: none; background: none; color: var(--leise); display: flex; align-items: center; justify-content: center; }
.tt-leeren svg { width: 18px; height: 18px; }
.tt-mikro { width: 42px; height: 42px; padding: 0; flex: none; border-radius: 12px; background: var(--akzent); color: #fff;
  display: flex; align-items: center; justify-content: center; }
.tt-mikro svg { width: 20px; height: 20px; }
.tt-mikro.hoert { background: var(--schlecht); animation: tt-puls 1.2s ease-in-out infinite; }
.tt-mikro[hidden], .tt-leeren[hidden] { display: none; }
@keyframes tt-puls { 50% { opacity: .55; } }
.tt-pulsiert { animation: tt-puls 1.2s ease-in-out infinite; }
.tt-sprachfehler { color: var(--schlecht-text); font-size: .85rem; margin: .4rem .2rem 0; }
#tt-filterzeile { margin: .6rem .2rem 0; font-size: .9rem; display: flex; align-items: center; gap: .4rem; }
#tt-filterzeile[hidden] { display: none; }
.tt-filterchip { display: inline-flex; align-items: center; gap: 4px; background: var(--akzent); color: #fff; padding: .3rem .4rem .3rem .75rem; font-size: .82rem; }
.tt-filterchip svg { width: 14px; height: 14px; }

/* Startseite der Suche */
.tt-ab { font-size: .78rem; font-weight: 600; color: var(--leise); text-transform: uppercase; letter-spacing: .4px; margin: 1.3rem .2rem .5rem; }
.tt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tt-chips small { color: var(--leise); font-weight: 400; margin-left: 2px; }
.tt-chip { background: var(--flaeche); color: var(--text); border: 1px solid var(--rand); padding: .3rem .75rem; font-size: .88rem; font-weight: 400; }
.tt-art-knopf { display: inline-flex; align-items: center; gap: 7px; background: var(--tt-bg); color: var(--tt-fg); padding: .45rem .85rem; font-size: .9rem; }
.tt-art-knopf i, .tt-art i, .tt-tun i, .tt-punkt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tt-pk); flex: none; }
.tt-punkt { margin-right: 5px; vertical-align: 1px; }
.tt-gruppe { padding: 0; overflow: hidden; }
.tt-zeile { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: .8rem; text-align: left; border-radius: 0;
  background: none; color: var(--text); font-weight: 400; padding: .7rem 1rem; border-bottom: .5px solid var(--rand); }
.tt-zeile:last-child { border-bottom: 0; }
.tt-zeile:hover { background: var(--grund); }

/* Ticketverwalter (KI) */
.tt-ki-box { margin: .9rem 0; padding: .8rem; border-radius: 16px; background: #eef4ff; border: 1px solid #cfe0ff; }
.tt-ki-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; font-size: .9rem; }
.tt-ki-name { font-size: .7rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; background: var(--akzent); color: #fff;
  border-radius: 6px; padding: 2px 7px; }
.tt-ki-hinweis { margin: .5rem .2rem 0; font-size: .9rem; }
.tt-ki-box > .tt-karte { margin-top: .7rem; }
.tt-rot { color: var(--schlecht-text); }

/* Die Karte, die der Monteur vor Ort sieht */
.tt-anzahl { font-size: .88rem; margin: .9rem .2rem .5rem; }
.tt-karte { padding: 0; overflow: hidden; margin-bottom: .75rem; }
.tt-k-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; padding: .85rem 1.1rem .2rem; }
.tt-schlag { font-weight: 600; color: var(--akzent); }
.tt-nr { font-size: .8rem; }
.tt-bild { margin: 0; padding: .1rem 1.1rem .8rem; font-size: 1.02rem; font-weight: 500; line-height: 1.35; white-space: pre-line; }
.tt-tun { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; padding: .65rem 1.1rem; background: var(--tt-bg); color: var(--tt-fg); }
.tt-tun i { width: 10px; height: 10px; }
.tt-tun strong { font-weight: 600; font-size: .93rem; flex: 1; min-width: 12rem; }
.tt-tun-prio { font-size: .8rem; color: var(--text); display: inline-flex; align-items: center; gap: 5px; }
.tt-dl { margin: 0; padding: .65rem 1.1rem .7rem; display: flex; flex-direction: column; gap: .45rem; }
.tt-dl div { display: flex; gap: .8rem; }
.tt-dl dt { flex: none; width: 10.5rem; font-size: .75rem; font-weight: 600; color: var(--leise); text-transform: uppercase; letter-spacing: .3px; padding-top: .1rem; }
.tt-dl dd { margin: 0; font-size: .92rem; white-space: pre-line; min-width: 0; }
@media (max-width: 640px) { .tt-dl div { flex-direction: column; gap: .1rem; } .tt-dl dt { width: auto; } }
.tt-karte mark, .tt-tabelle mark { background: #fff1a8; color: inherit; border-radius: 3px; padding: 0 1px; }
.tt-karte .leiste button span { white-space: normal; text-align: center; }

.tt-marke { display: inline-block; font-size: .72rem; font-weight: 600; border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
.tt-m-blau { background: #e8f1ff; color: #0a5bd3; }
.tt-m-gruen { background: var(--gut-grund); color: var(--gut-text); }
.tt-m-gelb { background: var(--warn-grund); color: var(--warn-text); }
.tt-m-grau { background: var(--grund); color: var(--leise); }
/* Angaben aus den Newslettern (30.11.2026): DGUV V3 / Teilsperre als Marken mit Rand, Quelle, Warn-Leiste */
.tt-nl-marken { display: flex; flex-wrap: wrap; gap: 6px; padding: .6rem 1.1rem 0; }
.tt-nl-marken span { font-size: .78rem; font-weight: 600; border-radius: 99px; padding: 2px 10px; background: var(--flaeche); border: 1px solid; }
.tt-nl-rot { color: var(--schlecht-text); border-color: #e5484d; }
.tt-nl-gruen { color: var(--gut-text); border-color: var(--gut); }
.tt-beleg { margin: 0; padding: 0 1.1rem .7rem; font-size: .8rem; }
.tt-warnleiste { display: flex; align-items: center; justify-content: space-between; gap: .8rem; width: 100%; margin: .2rem 0 .2rem; padding: .75rem 1rem;
  border-radius: 14px; border: 1px solid #f3b9bb; background: var(--rot-grund); color: var(--schlecht-text); font-size: .95rem; font-weight: 600; text-align: left; }
.tt-warnleiste small { font-weight: 400; white-space: nowrap; }
/* Bereich „Newsletter": Zeilen zum Aufklappen (Arbeitsanweisungen, Elektro-Regeln), Warnungen als Karten */
.tt-nl-zeile { align-items: flex-start; text-align: left; }
.tt-nl-zeile > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tt-nl-zeile b { font-weight: 500; }
.tt-nl-zeile small { font-size: .78rem; }
.tt-nl-offen { padding: .6rem .6rem .2rem; background: var(--grund); border-bottom: .5px solid var(--rand); }
.tt-nl-offen .tt-karte { margin-bottom: .5rem; }
.tt-nl-admin { display: flex; gap: .5rem; justify-content: flex-end; margin: -.2rem 0 .8rem; }
.tt-art { display: inline-flex; align-items: center; gap: 5px; background: var(--tt-bg); color: var(--tt-fg); border-radius: 99px; padding: 2px 9px;
  font-size: .78rem; font-weight: 500; white-space: nowrap; }
.tt-prio { display: inline-block; min-width: 26px; text-align: center; border-radius: 6px; padding: 1px 6px; font-size: .75rem; font-weight: 700; }
.tt-prio-A { background: #ff3b30; color: #fff; }
.tt-prio-Bp { background: #ff9500; color: #fff; }
.tt-prio-B { background: #ffd60a; color: #4a3b00; }
.tt-prio-C { background: #d1d1d6; color: var(--text); }

.tt-mehr { text-align: center; margin: .5rem 0 1rem; }
.tt-neu-box { margin-top: 1rem; padding: 1.1rem 1rem; text-align: center; border: 1.5px dashed var(--rand2, #d1d1d6); border-radius: 16px; }
.tt-neu-box p { margin: 0 0 .7rem; }

/* Katalog */
.tt-zahlen { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.tt-zahl-kachel { text-align: left; color: var(--text); padding: .7rem .9rem; border-radius: 14px; display: flex; flex-direction: column; gap: 2px; font-weight: 400; }
.tt-zahl-kachel b { font-size: 1.45rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.tt-zahl-kachel span { font-size: .78rem; color: var(--leise); }
.tt-zahl-kachel.an { border-color: var(--akzent); box-shadow: 0 0 0 2px #cfe0ff; }
.tt-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1rem; }
.tt-filter input[type="search"] { flex: 1 1 14rem; min-width: 0; background: var(--flaeche); border: 1px solid var(--kachelrand); }
.tt-filter select, .tt-form select { font: inherit; font-size: 16px; color: var(--text); background: var(--flaeche); border: 1px solid var(--kachelrand);
  border-radius: 12px; padding: .5rem .6rem; max-width: 15rem; }
.tt-filter select.an { border-color: var(--akzent); color: var(--akzent); }
@media (max-width: 640px) {
  .tt-zahlen { grid-template-columns: repeat(3, 1fr); gap: .45rem; }
  .tt-zahl-kachel { padding: .55rem .6rem; }
  .tt-zahl-kachel b { font-size: 1.2rem; }
  .tt-zahl-kachel span { font-size: .72rem; }
  .tt-filter select { flex: 1 1 40%; max-width: 100%; min-width: 0; width: 0; }
}
.tt-haken { display: inline-flex; align-items: center; gap: .35rem; font-weight: 400; margin: 0; font-size: .9rem; }
.tt-haken input { width: auto; margin: 0; }
.tt-filter .haupt[hidden], .tt-filter .link[hidden] { display: none; }
.tt-tabelle { padding: 0; overflow: hidden; }
.tt-reihe { display: flex; gap: .8rem; padding: .75rem 1rem; border-bottom: .5px solid var(--rand); align-items: flex-start; }
.tt-reihe:last-child { border-bottom: 0; }
.tt-r-nr { width: 2.2rem; flex: none; font-size: .82rem; font-variant-numeric: tabular-nums; padding-top: .1rem; }
.tt-r-haupt { flex: 1; min-width: 0; }
.tt-r-schlag { font-weight: 600; color: var(--akzent); font-size: .92rem; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.tt-r-bild { font-size: .92rem; margin-top: .15rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.tt-r-zusatz { font-size: .8rem; margin-top: .15rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.tt-r-marken { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .4rem; font-size: .82rem; }
.tt-r-kat { font-size: .78rem; margin-top: .3rem; }
.tt-r-knoepfe { flex: none; display: flex; flex-direction: column; gap: .35rem; }
@media (max-width: 640px) {
  .tt-reihe { flex-wrap: wrap; }
  .tt-r-knoepfe { flex-direction: row; width: 100%; padding-left: 3rem; }
}
.tt-leer { text-align: center; padding: 2rem 0; }
.tt-daten { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1.5rem; padding-top: 1rem; border-top: .5px solid var(--rand); }
.tt-daten[hidden] { display: none; }

/* Eingang */
.tt-leer-box { text-align: center; padding: 2.5rem 1rem; }
.tt-leer-box p { max-width: 26rem; margin: .4rem auto 0; }
.tt-vorschlag { margin-bottom: 1rem; padding: .8rem; border-radius: 18px; background: #eef4ff; border: 1px solid #cfe0ff; }
.tt-v-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .88rem; margin: 0 .2rem .6rem; }
.tt-kommentar { background: var(--flaeche); border-radius: 12px; padding: .5rem .8rem; margin: 0 0 .6rem; white-space: pre-line; }
.tt-diff { padding: 0; overflow: hidden; margin-bottom: .6rem; }
.tt-diff-kopf { font-size: .8rem; padding: .5rem 1rem; border-bottom: .5px solid var(--rand); }
.tt-diff-bild { margin: 0; padding: .55rem 1rem; font-weight: 500; border-bottom: .5px solid var(--rand); }
.tt-diff-zeile { padding: .55rem 1rem; border-bottom: .5px solid var(--rand); }
.tt-diff-zeile:last-child { border-bottom: 0; }
.tt-alt { color: var(--leise); text-decoration: line-through; white-space: pre-line; }
.tt-neu { font-weight: 500; white-space: pre-line; }
.tt-warn { background: var(--warn-grund); color: var(--warn-text); border-radius: 12px; padding: .5rem .8rem; font-size: .9rem; }
.tt-v-knoepfe { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; margin-top: .4rem; }
.tt-v-knoepfe button:not(.haupt) { background: var(--flaeche); }
.tt-vorschlag .tt-karte { margin-bottom: .4rem; }

/* Formular-Fenster: unten feste Leiste — Hauptknopf links, grauer Kreis mit rotem Kreuz rechts (Muster der App, 15.11.2026) */
dialog.dialog.breit.tt-dialog { width: min(640px, calc(100vw - 1.5rem)); }
dialog.tt-dialog h2 { margin: 0 0 .5rem; font-size: 1.1rem; }
.tt-form label { margin: .7rem 0 .25rem; font-size: .9rem; }
.tt-form label input, .tt-form label textarea, .tt-form label select { display: block; width: 100%; margin-top: .3rem; font-weight: 400; box-sizing: border-box; }
.tt-form label select { max-width: none; background: var(--grund); border: 0; }
.tt-form textarea { font-family: inherit; font-size: 16px; }
.tt-hilfe { font-size: .78rem; margin: .2rem .1rem 0; }
.tt-drei, .tt-zwei { display: grid; gap: 0 .7rem; }
.tt-drei { grid-template-columns: repeat(3, 1fr); }
.tt-zwei { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) { .tt-drei, .tt-zwei { grid-template-columns: 1fr; } }
.tt-info { background: #e8f1ff; color: #0a5bd3; border-radius: 12px; padding: .55rem .8rem; font-size: .88rem; }
.tt-meldekarte { border: 1px solid var(--rand); border-radius: 12px; padding: .6rem .8rem; white-space: pre-line; }
.tt-meldekarte b { color: var(--akzent); }
.tt-ki-form { margin: .4rem 0 .6rem; }
.tt-frei { display: flex; gap: .5rem; align-items: flex-start; margin-top: .55rem; }
.tt-frei textarea { flex: 1; background: var(--flaeche); }
.tt-ki-tun { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .5rem; }
.tt-ki-tun small { flex: 1 1 14rem; }
.tt-ki-notiz { margin: .5rem .1rem 0; font-size: .88rem; white-space: pre-line; }
.tt-vorher { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; background: var(--flaeche); border-radius: 12px; padding: .5rem .7rem; margin-top: .5rem; font-size: .88rem; }
.tt-vorher[hidden], .tt-ki-notiz[hidden] { display: none; }
.tt-verlauf { margin-top: 1rem; background: var(--grund); border-radius: 12px; padding: .5rem .8rem; font-size: .88rem; }
.tt-verlauf summary { cursor: pointer; font-weight: 600; }
.tt-verlauf ol { padding-left: 1.1rem; }
.tt-fuss { display: flex; align-items: center; gap: .7rem; margin: .8rem -1.35rem -1.25rem; padding: .7rem 1rem calc(.8rem + env(safe-area-inset-bottom));
  border-top: .5px solid var(--rand); background: var(--flaeche); }
.tt-speichern { flex: 1; padding: .85rem 1rem; font-size: 17px; }
.tt-zu { flex: none; width: 52px; height: 52px; padding: 0; border-radius: 50%; background: var(--rand); color: #e5484d; display: flex; align-items: center; justify-content: center; }
.tt-zu svg { width: 24px; height: 24px; }
@media (max-width: 640px) {
  dialog.dialog.breit.tt-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0;
    padding: calc(1rem + env(safe-area-inset-top)) .9rem 1rem; box-sizing: border-box; }
  .tt-fuss { margin: .8rem -.9rem -1rem; }
}

/* kurze Rückmeldung unten, über der Pille */
.tt-meldung { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(110px + env(safe-area-inset-bottom)); z-index: 60;
  background: #1c1c1e; color: #fff; border-radius: 99px; padding: .55rem 1.1rem; font-size: .9rem; font-weight: 500; max-width: calc(100vw - 2rem);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.tt-meldung.schlecht { background: var(--schlecht-text); }
.tt-meldung[hidden] { display: none; }
