/* Onyx – Aussehen. Fast schwarz wie der Stein, Jadegrün als einzige Akzentfarbe. */
:root {
  --grund: #0E0F11;
  --flaeche: #17191C;
  --flaeche2: #1E2226;
  --kachel: #23272C;
  --linie: #22252A;
  --rand: #2E3238;
  --text: #ECEDEE;
  --text2: #C9CDD2;
  --leise: #8A9099;
  --jade: #7FD1B9;
  --jade-hell: #A6E3D1;
  --warn: #F0B86E;
  --rot: #F08C7E;
  --schrift: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  --r: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--grund); color: var(--text); font-family: var(--schrift); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--jade); }
a:hover { color: var(--jade-hell); }
:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
[hidden] { display: none !important; }
.nur-leser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Bausteine ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.mitte { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.schirm { max-width: 460px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; gap: 18px;
  padding: calc(env(safe-area-inset-top) + 48px) 22px calc(env(safe-area-inset-bottom) + 28px); }
.schirm.oben { padding-top: calc(env(safe-area-inset-top) + 28px); }
.wachsen { flex-grow: 1; }
.zentriert { text-align: center; }
.abstand-oben { margin-top: 14px; }
.formular { display: flex; flex-direction: column; gap: 14px; }
.leise { color: var(--leise); }
.klein { font-size: 13px; }
.mono { font-family: var(--mono); }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 650; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }
.text { color: var(--text2); line-height: 1.55; }
.text b { color: var(--text); }
ol.schritte, ul.punkte { margin: 0; padding-left: 22px; color: var(--text2); display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }

.logo { display: flex; align-items: center; gap: 12px; }
.logo svg { flex-shrink: 0; }
.logo span { font-weight: 750; letter-spacing: .18em; font-size: 22px; }
.logo.gross { flex-direction: column; gap: 18px; }
.logo.gross span { font-size: 38px; letter-spacing: .24em; padding-left: .24em; }

.knopf { min-height: 52px; padding: 0 22px; border: 0; border-radius: 16px; background: var(--jade); color: var(--grund); font-weight: 650; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; text-decoration: none; }
.knopf:hover { background: var(--jade-hell); color: var(--grund); }
.knopf:disabled { opacity: .55; cursor: progress; }
.knopf.voll { width: 100%; }
.knopf.zweit { background: var(--flaeche); color: var(--text); border: 1px solid var(--rand); font-weight: 500; }
.knopf.zweit:hover { background: var(--flaeche2); color: var(--text); }
.knopf.rot { background: transparent; color: var(--rot); border: 1px solid #4A2F2C; font-weight: 500; }
.knopf.klein { min-height: 40px; padding: 0 14px; border-radius: 10px; font-size: 14px; }
.linkknopf { background: none; border: 0; color: var(--jade); padding: 10px 4px; min-height: 44px; cursor: pointer; font-size: 15px; text-align: left; }
.linkknopf.leise { color: var(--leise); }
.ikon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; border: 1px solid var(--linie); background: var(--flaeche); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.ikon.blank { border: 0; background: transparent; color: var(--jade); }
.ikon.blank.grau { color: var(--text2); }
.ikon:hover { background: var(--flaeche2); }
.ikon svg, .knopf svg { pointer-events: none; }

.feld { display: flex; flex-direction: column; gap: 8px; }
.feld > span { font-size: 13px; color: var(--leise); }
.eingabe { width: 100%; min-height: 52px; border-radius: var(--r); border: 1px solid var(--rand); background: var(--flaeche); color: var(--text); padding: 0 16px; font-size: 16px; }
.eingabe.mono { font-family: var(--mono); letter-spacing: .04em; }
.eingabe.code { font-family: var(--mono); font-size: 20px; letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.eingabe::placeholder { color: #6E747C; }
.zeile-ein { display: flex; gap: 10px; }
.zeile-ein .eingabe { flex-grow: 1; min-width: 0; }
.zeile-ein .ikon { width: 52px; height: 52px; border-radius: var(--r); border-color: var(--rand); }
.meldung { min-height: 1.4em; font-size: 14px; color: var(--rot); }
.meldung.gut { color: var(--jade); }
.haken { display: flex; gap: 12px; align-items: flex-start; color: var(--text2); font-size: 15px; line-height: 1.45; cursor: pointer; }
.haken input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; accent-color: var(--jade); }

.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 18px; }
.karte.innen { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.karte.jade { border-color: var(--jade); }
.karte.warn { border-color: #5A4526; }
.hinweis { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--flaeche); border: 1px solid var(--linie); color: var(--text2); font-size: 14px; line-height: 1.5; }
.hinweis svg { flex-shrink: 0; color: var(--jade); margin-top: 1px; }
.hinweis.warn svg { color: var(--warn); }
.reiter { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: var(--flaeche); border: 1px solid var(--linie); }
.reiter button { flex: 1; min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--text2); cursor: pointer; font-size: 14px; }
.reiter button.an { background: var(--kachel); color: var(--text); font-weight: 600; }
.zurueck { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-left: -6px; background: none; border: 0; color: var(--jade); cursor: pointer; font-size: 16px; padding: 0 6px 0 0; }

/* ---------- Würfel-Wörter ---------- */
.woerter { display: flex; flex-direction: column; gap: 8px; }
.wort { display: flex; align-items: baseline; gap: 14px; padding: 12px 16px; border-radius: 12px; background: var(--flaeche); border: 1px solid var(--linie); }
.wort i { font-style: normal; font-family: var(--mono); color: var(--leise); font-size: 13px; width: 1.2em; }
.wort b { font-family: var(--mono); font-size: 22px; font-weight: 500; letter-spacing: .03em; }
.codeanzeige { font-family: var(--mono); font-size: 24px; letter-spacing: .1em; text-align: center; padding: 18px 12px; border-radius: 16px; background: var(--flaeche); border: 1px solid var(--jade); word-break: break-word; }

/* ---------- Tresor ---------- */
.tresor { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.kopf { display: flex; align-items: center; gap: 12px; padding: calc(env(safe-area-inset-top) + 16px) 20px 12px; }
.kopf .logo { flex-grow: 1; }
.kopf .gross-nur { display: none; }
.suchfeld { position: relative; }
.suchfeld svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--leise); pointer-events: none; }
.suchfeld .eingabe { padding-left: 46px; }
.suchfeld kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); padding: 2px 7px; border: 1px solid var(--rand); border-radius: 6px; font-family: var(--mono); font-size: 12px; color: var(--leise); display: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--rand); background: transparent; color: var(--text2); cursor: pointer; font-size: 14px; }
.chip.an { background: var(--text); color: var(--grund); border-color: var(--text); font-weight: 600; }
.koerper { flex-grow: 1; display: flex; flex-direction: column; }
.seite-liste > * { flex-shrink: 0; } /* nichts zusammendrücken, lieber scrollen */
.seite-liste { display: flex; flex-direction: column; gap: 14px; padding: 4px 20px calc(env(safe-area-inset-bottom) + 100px); }
.seite-eintrag { display: none; }
.zeigt-eintrag .seite-liste { display: none; }
.zeigt-eintrag .seite-eintrag { display: flex; }
.liste { display: flex; flex-direction: column; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 18px; overflow: hidden; }
.liste .leer { padding: 22px 18px; color: var(--leise); text-align: center; }
.zeile { display: flex; align-items: center; gap: 14px; padding: 10px 8px 10px 14px; border-bottom: 1px solid var(--linie); }
.zeile:last-child { border-bottom: 0; }
.zeile.an { background: var(--flaeche2); }
.zeile-auf { flex-grow: 1; min-width: 0; display: flex; align-items: center; gap: 14px; background: none; border: 0; padding: 2px 0; text-align: left; cursor: pointer; color: inherit; }
.kachel { width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px; background: var(--kachel); color: var(--text2); display: flex; align-items: center; justify-content: center; font-weight: 650; font-size: 17px; }
.kachel.gross { width: 60px; height: 60px; border-radius: 16px; font-size: 26px; }
.zeile-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.zeile-text b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zeile-text span { font-size: 13px; color: var(--leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marke { font-size: 11px; padding: 1px 7px; border-radius: 8px; margin-left: 6px; vertical-align: 1px; font-weight: 600; }
.marke.schwach { background: #3A2A1A; color: var(--warn); }
.zeile-titel { display: flex; align-items: center; min-width: 0; }
.zeile-titel .marke { flex-shrink: 0; font-style: normal; }
.wahl-leiste { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: 14px; background: var(--flaeche2); border: 1px solid var(--rand); font-size: 14px; color: var(--text2); }
.wahl-leiste b { color: var(--text); }
.wahl-leiste > span { white-space: nowrap; min-width: 0; }
.wahl-leiste .knopf.klein { padding: 0 11px; }
.wahl-leiste .knopf[disabled] { opacity: .4; cursor: default; }
.wahlkreis { border-radius: 50%; background: transparent; border: 2px solid var(--rand); width: 30px; height: 30px; margin: 5px; }
.zeile.gewaehlt { background: var(--flaeche2); }
.zeile.gewaehlt .wahlkreis { background: var(--jade); border-color: var(--jade); color: var(--grund); }
.mehr-laden { padding: 12px; text-align: center; }

.unten { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 14px 20px calc(env(safe-area-inset-bottom) + 18px);
  background: var(--grund); border-top: 1px solid #1C1F23; }
.unten .leise { flex-grow: 1; font-size: 12px; line-height: 1.5; }

.seite-eintrag { flex-direction: column; gap: 20px; padding: 6px 20px calc(env(safe-area-inset-bottom) + 32px); }
.eintrag-kopf { display: flex; align-items: center; gap: 16px; }
.eintrag-kopf h2 { font-size: 24px; word-break: break-word; }
.felder { display: flex; flex-direction: column; }
.fz { display: flex; align-items: center; gap: 4px; padding: 14px 8px 14px 16px; border-bottom: 1px solid var(--linie); }
.fz:last-child { border-bottom: 0; }
.fz-inhalt { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fz-inhalt > span:first-child { font-size: 12px; color: var(--leise); }
.fz-wert { word-break: break-all; }
.fz-wert.mono { font-family: var(--mono); font-size: 17px; letter-spacing: .04em; }
.notiz { white-space: pre-wrap; word-break: break-word; color: var(--text2); }
.balken { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.balken > div { display: flex; gap: 3px; }
.balken i { width: 22px; height: 4px; border-radius: 2px; background: var(--rand); }
.balken.s1 i:nth-child(-n+1) { background: var(--warn); }
.balken.s2 i:nth-child(-n+2) { background: #C7C98A; }
.balken.s3 i:nth-child(-n+3) { background: var(--jade); }
.balken.s4 i { background: var(--jade); }
.balken span { font-size: 12px; color: var(--leise); }
.verlauf { display: flex; flex-direction: column; }
.platzhalter { flex-grow: 1; display: flex; align-items: center; justify-content: center; color: var(--leise); padding: 40px; text-align: center; }

/* ---------- Blatt (Einlesen, Einstellungen) ---------- */
.blatt-grund { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 20; }
.blatt { position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; max-height: 92vh; max-height: 92dvh; overflow-y: auto; background: var(--grund); border-top: 1px solid var(--rand);
  border-radius: 22px 22px 0 0; padding: 18px 20px calc(env(safe-area-inset-bottom) + 28px); display: flex; flex-direction: column; gap: 16px; }
.blatt-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.zahlen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.zahl { padding: 14px; border-radius: 14px; background: var(--flaeche); border: 1px solid var(--linie); }
.zahl b { display: block; font-size: 26px; font-weight: 650; }
.zahl span { font-size: 13px; color: var(--leise); }
.namen { color: var(--text2); font-size: 14px; line-height: 1.6; }
.geraet { display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 16px; border-bottom: 1px solid var(--linie); }
.geraet:last-child { border-bottom: 0; }
.geraet div { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.geraet span { font-size: 13px; color: var(--leise); }
.abschnitt { display: flex; flex-direction: column; gap: 10px; }
.abschnitt h3 { color: var(--leise); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }

.toast { position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 96px); width: min(420px, calc(100% - 40px));
  min-height: 52px; border-radius: 14px; background: var(--text); color: var(--grund); display: flex; align-items: center; gap: 12px; padding: 12px 16px; font-size: 14px; font-weight: 500; box-shadow: 0 8px 30px rgba(0,0,0,.4); }

.toast span { flex-grow: 1; }
.toast .linkknopf { color: var(--grund); font-weight: 700; text-decoration: underline; padding: 6px 2px; min-height: 36px; flex-shrink: 0; }

/* ---------- Eintrag anlegen und bearbeiten ---------- */
.eintrag-aktionen { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 20px; }
.wuerfel-optionen { display: flex; flex-direction: column; gap: 12px; }
.regler { display: flex; align-items: center; gap: 14px; color: var(--text2); font-size: 15px; }
.regler input { flex-grow: 1; accent-color: var(--jade); height: 28px; }
.regler b { font-family: var(--mono); color: var(--text); min-width: 2ch; text-align: right; }
.optionen { display: flex; gap: 24px; flex-wrap: wrap; }
.optionen .haken { align-items: center; }
.notizfeld { min-height: 88px; padding: 14px 16px; resize: vertical; line-height: 1.45; font-family: inherit; }
.linkknopf.links { align-self: flex-start; }
.unten .knopf { flex: 1 1 0; }

.druck { display: none; }

/* ---------- Breiter Bildschirm (PC) ---------- */
@media (min-width: 1000px) {
  .schirm { padding-top: 12vh; }
  .kopf { padding: 16px 28px; border-bottom: 1px solid #1C1F23; gap: 16px; }
  .kopf .logo { flex-grow: 0; width: 200px; }
  .kopf .gross-nur { display: flex; }
  .kopf .suchfeld-oben { flex: 1 1 320px; max-width: 640px; }
  .kopf .wachsen { flex-grow: 1; }
  .suchfeld kbd { display: inline-block; }
  .koerper { flex-direction: row; }
  .seite-liste { display: flex !important; width: 400px; flex-shrink: 0; border-right: 1px solid #1C1F23; padding: 20px 16px 40px; max-height: calc(100vh - 77px); overflow-y: auto; }
  .seite-liste .suchfeld-unten { display: none; }
  .chips { margin: 0; padding: 0; flex-wrap: wrap; }
  .seite-eintrag { display: flex !important; flex-grow: 1; padding: 32px 40px; max-width: 820px; }
  .unten { display: none; }
  .blatt { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 40px)); border-radius: 22px; border: 1px solid var(--rand); max-height: 86vh; }
  .toast { bottom: 32px; }
}
@media (max-width: 999px) { .nur-pc { display: none !important; } }
@media (min-width: 1000px) { .nur-handy { display: none !important; } }

/* ---------- Notfallblatt drucken ---------- */
@media print {
  @page { margin: 18mm; }
  html, body { background: #fff !important; color: #000 !important; }
  body > *:not(.druck) { display: none !important; }
  .druck { display: block !important; font-family: Georgia, "Times New Roman", serif; font-size: 12pt; line-height: 1.5; color: #000; }
  .druck h1 { font-size: 22pt; margin: 0 0 4pt; }
  .druck h2 { font-size: 13pt; margin: 18pt 0 6pt; }
  .druck .gross { font-family: "Courier New", monospace; font-size: 18pt; letter-spacing: .06em; border: 1.5pt solid #000; padding: 10pt 12pt; margin: 6pt 0; }
  .druck .linie { border-bottom: 1pt solid #000; height: 26pt; margin: 4pt 0; }
  .druck .klein { font-size: 10pt; color: #333; }
  .druck ol { margin: 4pt 0; padding-left: 18pt; }
}

/* Logo als Aktualisieren-Knopf */
.logoknopf { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.logoknopf:active svg { transform: rotate(-30deg); transition: transform .15s; }
/* Eintragsarten */
.marke.art { background: #1D2A27; color: var(--jade); font-weight: 500; }
.chips.arten { margin: 0 0 6px; padding: 0; flex-wrap: wrap; overflow: visible; }
.chip.klein { min-height: 30px; padding: 0 12px; font-size: 13px; }
.chips.arten { gap: 6px; }
.chips.arten .chip { padding: 0 11px; font-size: 13.5px; }
.anbieter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -6px; }
/* Liste besser lesbar: Name hell und kräftig, zweite Zeile ruhiger, aber klar lesbar */
.zeile-text b { color: var(--text); font-weight: 600; font-size: 16px; }
.zeile-text > span:last-child { color: #A9AFB7; font-size: 14px; }
/* Bereiche: Passwörter | Bank & PINs */
.bereiche { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--flaeche); border: 1px solid var(--linie); }
.bereich { flex: 1 1 0; min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--text2); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.bereich span { font-size: 12px; color: var(--leise); }
.bereich.an { background: var(--flaeche2); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--rand); }
.bereich.an span { color: var(--jade); }
/* Auswahl-Leiste bleibt beim Scrollen oben stehen (der Kasten #wahl klebt, nicht nur die Leiste darin) */
#wahl { position: sticky; top: 0; z-index: 5; }
#wahl:not(:empty) { margin: -8px 0; padding: 8px 0; background: var(--grund); }
@media (min-width: 1000px) { #wahl { top: -20px; } } /* PC: Liste hat 20px Innenabstand oben, sonst schaut eine Zeile darüber durch */
/* Gruppen in „Gleiches Passwort“ und „Doppelte Einträge“ */
.gruppe-kopf { padding: 12px 14px 8px; font-size: 13px; font-weight: 600; color: var(--jade); background: var(--grund); border-bottom: 1px solid var(--linie); }
.liste > .gruppe-kopf:not(:first-child) { border-top: 1px solid var(--linie); margin-top: 10px; }
