/* 8gent Passwörter: zinc + EIN Akzent Rostorange #b45309, eckige Hauptknöpfe, Rot nur fürs Löschen. */
:root {
  --grund: #fafafa; --flaeche: #ffffff; --flaeche2: #f4f4f5; --linie: #e4e4e7; --text: #18181b; --leise: #71717a;
  --akzent: #b45309; --akzent-hell: #d97706; --akzent-grund: rgba(180, 83, 9, .1); --gefahr: #dc2626;
  --schatten: 0 10px 40px rgba(0,0,0,.08);
  --rund: 14px;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --grund: #09090b; --flaeche: #111113; --flaeche2: #18181b; --linie: #27272a; --text: #f4f4f5; --leise: #a1a1aa;
    --akzent-grund: rgba(217, 119, 6, .14); --schatten: 0 10px 40px rgba(0,0,0,.5); }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--grund); color: var(--text); -webkit-font-smoothing: antialiased; }
body { font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 24px; margin: 14px 0 6px; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0; }
h3 { font-size: 14px; margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .06em; color: var(--leise); }
p { margin: 8px 0; }
.leise { color: var(--leise); }
.klein { font-size: 12.5px; color: var(--leise); display: flex; gap: 6px; align-items: flex-start; }
.mono, code { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* Marke mit Pixel-8 */
.marke { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.marke b { font-weight: 700; }
.pixel8 { width: 26px; height: 26px; border-radius: 7px; background: #09090b url("/icon.svg") center/cover; flex: none; }

/* Karten-Seiten (Anmelden, Einrichten, Entsperren) */
.zentriert { min-height: 100%; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) 16px 24px; }
.karte { width: 100%; max-width: 420px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 22px; padding: 28px; box-shadow: var(--schatten); display: flex; flex-direction: column; gap: 10px; }
.karte .knopf.haupt { width: 100%; justify-content: center; margin-top: 6px; }
.schlosskreis { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 14px auto 0; background: var(--akzent-grund); color: var(--akzent); }
.karte h1 { text-align: center; }
.karte > .leise { text-align: center; }
.punkte { margin: 4px 0 6px; padding-left: 18px; color: var(--leise); font-size: 14px; }

.feld { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--leise); }
.feld > span { font-weight: 600; }
.feld small { font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--linie); background: var(--flaeche2); color: var(--text); font-size: 16px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--akzent); box-shadow: 0 0 0 3px var(--akzent-grund); }
input.code { text-align: center; letter-spacing: .4em; font-size: 22px; font-family: ui-monospace, Menlo, monospace; }
textarea.notizfeld { min-height: 110px; resize: vertical; }
.fehlerzeile { color: var(--gefahr); font-size: 13.5px; min-height: 0; margin: 0; }
.fehlerzeile:empty { display: none; }
.hinweis { background: var(--akzent-grund); color: var(--text); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }

/* Checkboxen: ungewählt nur Rand (8gent-Regel) */
input.haken { appearance: none; width: 18px; height: 18px; border: 2px solid var(--leise); border-radius: 5px; background: transparent; flex: none; display: grid; place-items: center; cursor: pointer; margin: 0; }
input.haken:checked { background: var(--akzent); border-color: var(--akzent); }
input.haken:checked::after { content: "✓"; color: #fff; font-size: 12px; line-height: 1; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); cursor: pointer; }

/* Knöpfe */
.knopf { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 0; border: 1px solid transparent; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; background: none; }
.knopf:disabled { opacity: .5; cursor: progress; }
.knopf.haupt { background: var(--akzent); color: #fff; }
.knopf.haupt:hover { background: var(--akzent-hell); }
.knopf.zweit { border-color: var(--linie); background: var(--flaeche); }
.knopf.zweit:hover { background: var(--flaeche2); }
.knopf.gefahr { color: var(--gefahr); border-color: var(--linie); }
.knopf.leise { color: var(--leise); padding: 0 10px; border-radius: 10px; }
.knopf.leise:hover { background: var(--flaeche2); color: var(--text); }
.link { background: none; border: 0; color: var(--leise); font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; }
.zeile { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.zwischen { justify-content: space-between; }

/* Notfall-Kit */
.kit { border: 1px dashed var(--akzent); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; background: var(--akzent-grund); }
.kit-kopf { display: flex; justify-content: space-between; align-items: center; }
.kit-wert { font-size: 15.5px; word-break: break-all; letter-spacing: .03em; user-select: all; }
.kit small { color: var(--leise); font-size: 12px; }
.staerke { height: 5px; border-radius: 3px; background: var(--flaeche2); overflow: hidden; }
.staerke i { display: block; height: 100%; background: var(--gefahr); transition: width .2s; }
.staerke[data-stufe="2"] i { background: var(--akzent-hell); }
.staerke[data-stufe="3"] i { background: #16a34a; }

/* Haupt-Rahmen: Seite | Mitte | Detail */
.rahmen { display: grid; grid-template-columns: 250px minmax(300px, 420px) 1fr; height: 100dvh; }
.seite { border-right: 1px solid var(--linie); padding: max(18px, env(safe-area-inset-top)) 12px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; background: var(--flaeche); }
.seite .marke { padding: 2px 8px 16px; }
.seite-titel { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--leise); padding: 14px 10px 6px; }
.seite-fuss { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--linie); display: flex; flex-direction: column; gap: 2px; }
.nav { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left; font-size: 14px; color: var(--text); }
.nav span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav em { font-style: normal; font-size: 12px; color: var(--leise); }
.nav em.punkt { background: var(--akzent); color: #fff; border-radius: 99px; padding: 1px 7px; }
.nav:hover { background: var(--flaeche2); }
.nav.aktiv { background: var(--akzent-grund); color: var(--akzent); font-weight: 600; }
.nav.leise { color: var(--leise); }
.mitte { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--linie); height: 100dvh; }
.kopf { display: flex; gap: 8px; padding: max(14px, env(safe-area-inset-top)) 14px 12px; border-bottom: 1px solid var(--linie); align-items: center; }
.suche { flex: 1; position: relative; display: flex; align-items: center; }
.suche svg { position: absolute; left: 12px; color: var(--leise); }
.suche input { padding-left: 36px; min-height: 40px; }
.liste { overflow-y: auto; flex: 1; padding: 6px; }
.zeile-eintrag { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 0; border-radius: 12px; background: none; cursor: pointer; text-align: left; }
.zeile-eintrag:hover { background: var(--flaeche2); }
.zeile-eintrag.aktiv { background: var(--akzent-grund); }
.zeile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.zeile-text b, .zeile-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeile-text small { color: var(--leise); font-size: 12.5px; }
.kachel { width: 38px; height: 38px; border-radius: 10px; background: var(--flaeche2); border: 1px solid var(--linie); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; color: var(--akzent); }
.kachel.gross { width: 52px; height: 52px; font-size: 17px; border-radius: 14px; }
.fav { color: var(--akzent); }
.tresor-etikett { font-size: 11px; color: var(--leise); border: 1px solid var(--linie); padding: 2px 7px; border-radius: 99px; white-space: nowrap; }
.banner { margin: 10px 12px 0; padding: 10px 12px; border-radius: 12px; background: var(--akzent-grund); font-size: 13.5px; display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.banner.warnung { border: 1px solid var(--gefahr); background: transparent; }

.detail { overflow-y: auto; height: 100dvh; background: var(--grund); }
.detail-kopf { display: flex; align-items: center; gap: 8px; padding: max(14px, env(safe-area-inset-top)) 14px 12px; border-bottom: 1px solid var(--linie); position: sticky; top: 0; background: var(--grund); z-index: 1; }
.detail-koerper { padding: 18px 22px 40px; max-width: 640px; display: flex; flex-direction: column; gap: 12px; }
.detail-titel { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.detail-titel h3 { text-transform: none; letter-spacing: 0; color: var(--text); font-size: 20px; margin: 0; }
.detail-titel small { color: var(--leise); }
.wertzeile { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.wertzeile > small { color: var(--leise); font-size: 12px; font-weight: 600; }
.wertzeile-inhalt { display: flex; align-items: center; gap: 4px; }
.wert { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; word-break: break-all; font-size: 15.5px; }
a.wert { color: var(--akzent); text-decoration: none; }
.wert.totp { font-family: ui-monospace, Menlo, monospace; font-size: 22px; letter-spacing: .08em; color: var(--akzent); }
.rest { font-size: 12px; color: var(--leise); min-width: 28px; }
.notiz { white-space: pre-wrap; margin: 0; }
.mit-knopf { display: flex; gap: 8px; }
.generator { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; font-size: 13px; color: var(--leise); }
.generator input[type=range] { accent-color: var(--akzent); }
.leer { display: grid; place-items: center; gap: 8px; color: var(--leise); text-align: center; padding: 60px 20px; }
.fpr-box { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; padding: 12px 14px; }
.fpr-box small { color: var(--leise); font-size: 12px; font-weight: 600; }
.fpr { display: block; font-size: 15px; line-height: 1.7; word-spacing: .3em; letter-spacing: .03em; margin-top: 4px; }
.kontakte { display: flex; flex-direction: column; gap: 10px; }
.kontakt { border: 1px solid var(--linie); border-radius: 14px; padding: 12px 14px; background: var(--flaeche); display: flex; flex-direction: column; gap: 8px; }
.kontakt.ok { border-color: rgba(22,163,74,.4); }
.kontakt-kopf, .mitglied { display: flex; gap: 12px; align-items: center; }
.kontakt-kopf small, .mitglied small { display: block; color: var(--leise); font-size: 12.5px; }
.mitglied { padding: 8px 0; border-bottom: 1px solid var(--linie); }
.mitglied > div { flex: 1; }

/* Meldung */
.meldung { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: #18181b; color: #fff; padding: 10px 16px; border-radius: 99px; font-size: 14px; box-shadow: var(--schatten); z-index: 50; transition: opacity .3s; }
.meldung.fehler { background: var(--gefahr); }
.meldung.weg { opacity: 0; }
.nur-mobil { display: none; }

/* Handy: eine Spalte, Detail schiebt sich drüber */
@media (max-width: 860px) {
  .rahmen { grid-template-columns: 1fr; }
  .seite { display: none; }
  .mitte { border-right: 0; }
  .detail { position: fixed; inset: 0; transform: translateX(100%); transition: transform .25s ease; z-index: 10; }
  .rahmen.rechts-offen .detail { transform: none; }
  .nur-mobil { display: inline-flex; }
  .kopf .knopf.zweit { display: none; }
}
.chips { display: none; gap: 6px; padding: 10px 12px 2px; overflow-x: auto; scrollbar-width: none; }
.chip { border: 1px solid var(--linie); background: var(--flaeche); border-radius: 99px; padding: 7px 13px; font-size: 13.5px; white-space: nowrap; cursor: pointer; }
.chip.aktiv { background: var(--akzent); border-color: var(--akzent); color: #fff; font-weight: 600; }
@media (max-width: 860px) { .chips { display: flex; } }

/* Drucken: nur das Notfall-Kit */
@media print {
  body { background: #fff; color: #000; }
  .knopf, .check, .link { display: none !important; }
  .karte { box-shadow: none; border: 0; }
  .kit { border-color: #000; background: none; }
}
