:root {
  --bg: #eceff3;
  --panel: #ffffff;
  --ink: #101b26;
  --muted: #566676;
  --line: #d3dae2;
  --accent: #2f3fd4;
  --accent-ink: #ffffff;
  --warn: #b25e00;
  --danger: #b3261e;
  --ok: #1d6b3a;
  --radius: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e151d;
    --panel: #16202b;
    --ink: #e8eef4;
    --muted: #93a3b3;
    --line: #26333f;
    --accent: #8e9bff;
    --accent-ink: #0e151d;
    --warn: #f0b04a;
    --danger: #ff8a80;
    --ok: #7ad99a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; font: 16px/1.5 var(--font); color: var(--ink); background: var(--bg); min-height: 100vh; }
.shell { max-width: 40rem; margin: 0 auto; padding: 1.25rem 1rem 4rem; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 1.5rem; letter-spacing: -0.01em; }
h2 { font-size: 1.125rem; }
p { margin: 0.5rem 0; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius);
  padding: 0.5rem 0.9rem; min-height: 2.5rem;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.danger { color: var(--danger); border-color: currentColor; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn[disabled] { opacity: 0.55; cursor: progress; }

.field { display: grid; gap: 0.25rem; margin: 0.9rem 0; }
.field > label, .field > .label { font-weight: 600; font-size: 0.9rem; }
.field .hint { font-size: 0.85rem; color: var(--muted); }
input[type=text], input[type=password], input[type=search], input[type=number], select, textarea {
  width: 100%; padding: 0.55rem 0.65rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); min-height: 2.5rem;
}
textarea { min-height: 6rem; resize: vertical; }
/* Platzhalter: der Browser-Standard (Grau #757575) ist auf dem dunklen Feld zu blass (3,6:1); --muted erreicht in hell und dunkel mindestens 4,5:1 */
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0.9rem 0; }
.check input { margin-top: 0.3rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 30rem) { .row2 { grid-template-columns: 1fr; } }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.actions .spacer { flex: 1; }

.notice { border-left: 3px solid var(--warn); padding: 0.5rem 0.75rem; background: var(--panel); margin: 1rem 0; border-radius: 0 var(--radius) var(--radius) 0; }
.notice.danger { border-color: var(--danger); }
.error { color: var(--danger); min-height: 1.5rem; margin: 0.5rem 0 0; }

/* Startseite */
.hero { padding: 2.5rem 0 1.25rem; }
.hero h1 { font-size: 2rem; }
.hero .kicker { margin: 0 0 0.25rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.hero p { max-width: 34rem; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.tab { border: 0; background: transparent; padding: 0.7rem 1rem; border-bottom: 3px solid transparent; margin-bottom: -1px; color: var(--muted); font-weight: 600; }
.tab[aria-selected=true] { color: var(--ink); border-color: var(--accent); }
.panel { background: var(--panel); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 0.5rem 1.25rem 1.25rem; }

/* Menü: eine Liste, zwei Leisten (Logik wie tierkompass.eu: oben sticky für PC/Notebook/Tablet, fest unten für das Handy).
   dhx.js füllt #nav-links (oben) und #nav-bottom (unten) mit denselben Punkten, das CSS zeigt je Bildschirmbreite eine davon. */
:root { --nav-h: 3.25rem; --bottom-h: 3.6rem; }
.topnav {
  position: sticky; top: 0; z-index: 40; background: var(--panel); border-bottom: 1px solid var(--line);
  --pad: max(0.75rem, calc((100% - 40rem) / 2 + 0.75rem));
  padding-inline: max(calc(var(--pad) - 0.5rem), env(safe-area-inset-left)) max(var(--pad), env(safe-area-inset-right));
  padding-top: env(safe-area-inset-top);
}
.topbar { display: flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; }
.topnav-links { display: flex; flex: 1 1 auto; flex-wrap: wrap; min-width: 0; }
.topnav-links::-webkit-scrollbar { display: none; }
.navlink {
  display: flex; align-items: center; justify-content: center; gap: 0.35rem; min-height: 2.75rem; padding: 0.5rem 0.8rem; white-space: nowrap;
  font: inherit; font-weight: 700; font-size: 0.95rem; letter-spacing: 0.04em; color: var(--muted); text-decoration: none;
  background: transparent; border: 0; border-bottom: 3px solid transparent; border-radius: 0; cursor: pointer;
}
.navlink:hover { color: var(--ink); }
.navlink[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.gearlink, .toollock, .toolsearch { padding-inline: 0.8rem; }   /* Zahnrad und Schloss: gleiche Symbolgröße (.ico) und gleiche Fläche wie die übrigen Menüpunkte, auf jedem Gerät */
.nav-tools .toollock, .nav-tools .toolsearch { border-bottom-color: transparent; }
.navlink { flex: 0 0 auto; min-width: 2.75rem; }
.bottomnav .navlink { flex: 1 1 0; min-width: 0; }
.ico { display: block; width: 1.45rem; height: 1.45rem; min-width: 1.45rem; min-height: 1.45rem; max-width: none; flex: none; overflow: visible; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico-grip { width: 1.2rem; height: 1.2rem; fill: currentColor; stroke: none; }
.ico-cross { fill: #d32f2f; stroke: #d32f2f; stroke-width: 1; stroke-linejoin: round; }
@media (prefers-color-scheme: dark) { .ico-cross { fill: #ef5350; stroke: #ef5350; } }
.navlink .ico { opacity: 0.8; }
.navlink:hover .ico, .navlink[aria-current="page"] .ico { opacity: 1; }
.navlink[aria-current="page"] .ico-bookmark, .navlink[aria-current="page"] .ico-key { stroke-width: 2.4; }
.navlink:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.brand {
  display: flex; align-items: center; flex: none; min-height: 2.75rem; padding: 0.5rem 0.55rem 0.5rem 0.25rem; margin: 0;
  font: inherit; font-weight: 800; font-size: 0.95rem; letter-spacing: 0.06em; color: var(--ink); white-space: nowrap;
  background: transparent; border: 0; border-radius: 0; cursor: pointer;
}
.brand::after { content: ""; width: 1px; height: 1.1rem; background: var(--line); margin-left: 0.55rem; }
.count, .chipcount {
  display: inline-block; min-width: 1.45em; padding: 0 0.4em; margin-left: 0.4em; border-radius: 999px; text-align: center;
  font-size: 0.75rem; font-weight: 700; line-height: 1.45; letter-spacing: 0; font-variant-numeric: tabular-nums;
  background: var(--bg); color: var(--muted); border: 1px solid var(--line);
}
.nav-tools { display: flex; flex: none; gap: 0.35rem; }
.nav-tools:empty { display: none; }
.nav-tools .btn { min-height: 2.25rem; padding: 0.25rem 0.7rem; }
.nav-sub { display: flex; gap: 0.4rem; min-width: 0; padding: 0.1rem 0.5rem 0.5rem; overflow-x: auto; scrollbar-width: none; }
.nav-sub[hidden] { display: none; }
/* Eine gemeinsame Zeitleiste für alle 2FA-Codes */
.nav-time { display: flex; align-items: center; gap: 0.6rem; padding: 0 0.5rem 0.45rem; }
.nav-time[hidden] { display: none; }
.timebar { flex: 1; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.timebar-fill { display: block; height: 100%; width: 100%; background: var(--accent); transition: width 0.26s linear; }
.nav-time[data-low="1"] .timebar-fill { background: var(--warn); }
.timebar-left { min-width: 2.4rem; text-align: right; font-size: 0.8rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.nav-time[data-low="1"] .timebar-left { color: var(--warn); font-weight: 700; }
.chip { flex: none; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 0.25rem 0.8rem; min-height: 2rem; font-size: 0.875rem; }
.chip:hover { border-color: var(--accent); }
.has-nav .sec { scroll-margin-top: 6.5rem; }

/* Untere Leiste: nur auf dem Handy und nur nach dem Entsperren (dhx.js setzt body.nav-bottom-on) */
.bottomnav { display: none; }
@media (min-width: 48rem) { .bottomnav, .bottomnav:not([hidden]) { display: none; } }   /* oben und unten schließen lückenlos aneinander an (kein Breitenbereich ohne Menü) */
@media (max-width: 47.999rem) {
  body.nav-bottom-on { padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); }
  /* Oben bleiben Marke und Sperren; die Menüpunkte wandern nach unten */
  body.nav-bottom-on .topnav-links { display: none; }
  body.nav-bottom-on .topbar { justify-content: space-between; }
  .bottomnav:not([hidden]) {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: var(--panel); border-top: 1px solid var(--line);
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-shadow: 0 -2px 10px rgba(8, 14, 22, 0.08);
  }
  .bottomnav .navlink {
    flex: 1 1 0; overflow: visible; min-width: 0; min-height: var(--bottom-h); padding: 0.4rem 0.2rem; font-size: 0.85rem;
    border-bottom: 0; border-top: 3px solid transparent;
  }
  .bottomnav .navlink[aria-current="page"] { border-top-color: var(--accent); }
  /* „Mehr“: Auswahl mit den Punkten, die unten nicht mehr nebeneinander passen; klappt über der Leiste auf */
  .bottomnav .nav-more-sheet {
    position: absolute; left: 0; right: 0; bottom: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
    background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(8, 14, 22, 0.12);
    padding: 0.35rem env(safe-area-inset-right) 0.35rem env(safe-area-inset-left); max-height: 60vh; overflow-y: auto;
  }
  .bottomnav .nav-more-sheet .navlink { flex-direction: column; gap: 0.15rem; min-height: 3.6rem; border-top-width: 0; border-left: 3px solid transparent; }
  .bottomnav .nav-more-sheet .navlink[aria-current="page"] { border-left-color: var(--accent); }
  .navlabel { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; }
  .toast { bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom) + 0.75rem); }
  .has-nav .sec { scroll-margin-top: 5.5rem; }
}
@media (max-width: 34rem) {
  .navlink, .gearlink, .toollock, .toolsearch { padding: 0.5rem 0.65rem; }
}
/* Gruppiertes Menü (ab 1.31, Einstellung „Menü-Darstellung“; nav-ui.js). Die klassische Leiste bleibt unverändert: alles hier greift nur mit body.nav-grouped. */
.navgroup .navtext { font-size: 0.9rem; letter-spacing: 0.01em; }
.navgroup { position: relative; }
.navgroup .ico-caret { width: 0.8rem; height: 0.8rem; min-width: 0.8rem; min-height: 0.8rem; opacity: 0.6; margin-left: -0.1rem; }
.navgroup[aria-expanded="true"] { color: var(--ink); }
.navgroup[aria-expanded="true"] .ico-caret { transform: rotate(180deg); }
body.nav-icons-only .navgroup { padding-inline: 0.8rem; }
.nav-menu {
  position: fixed; z-index: 60; min-width: 17rem; max-width: min(24rem, calc(100vw - 1rem)); max-height: calc(100vh - 6rem); max-height: calc(100dvh - 6rem); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(8, 14, 22, 0.18); padding: 0.3rem;
}
.nav-menu-title { display: none; margin: 0; padding: 0.4rem 0.7rem 0.2rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.navitem {
  display: flex; align-items: center; gap: 0.65rem; min-height: 2.75rem; padding: 0.45rem 0.7rem; border-radius: calc(var(--radius) - 2px);
  color: var(--ink); text-decoration: none; font-size: 0.95rem; border-left: 3px solid transparent;
}
.navitem:hover, .navitem:focus-visible { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.navitem:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.navitem[aria-current="page"] { border-left-color: var(--accent); font-weight: 700; }
.navitem .ico { opacity: 0.85; }
.navitem-name { flex: 1 1 auto; min-width: 0; }
.navitem-code { flex: none; color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; }
.navitem-ext { flex: none; color: var(--muted); font-size: 0.72rem; }
.navitem-badge { flex: none; min-width: 1.25rem; padding: 0 0.35rem; border-radius: 999px; background: var(--warn); color: var(--panel); font-size: 0.72rem; font-weight: 800; line-height: 1.25rem; text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 47.999rem) {
  /* Handy: das Untermenü klappt als Blatt über der unteren Leiste auf (wie „Mehr“ in der klassischen Leiste) */
  .nav-menu {
    left: 0 !important; right: 0; top: auto !important; bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); max-width: none; min-width: 0;
    border-radius: calc(var(--radius) + 6px) calc(var(--radius) + 6px) 0 0; border-width: 1px 0 0; box-shadow: 0 -6px 18px rgba(8, 14, 22, 0.16);
    max-height: 65vh; max-height: 65dvh; padding: 0.3rem env(safe-area-inset-right) 0.5rem env(safe-area-inset-left);
  }
  .nav-menu-title { display: block; }
  .navitem { min-height: 3.1rem; font-size: 1rem; }
  /* Untere Leiste: Symbol mit kurzer Beschriftung darunter (nur Darstellung „groups“) */
  body.nav-grouped:not(.nav-icons-only) .bottomnav .navgroup { flex-direction: column; gap: 0.1rem; padding-block: 0.3rem; }
  body.nav-grouped:not(.nav-icons-only) .bottomnav .navgroup .navtext { font-size: 0.68rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  body.nav-grouped .bottomnav .ico-caret { display: none; }
  .bottomnav .navgroup[aria-expanded="true"] { border-top-color: var(--accent); }
}
@media (min-width: 48rem) {
  .navgroup[aria-current="page"] { border-bottom-color: var(--accent); }
  /* Mit Beschriftung braucht die obere Leiste mehr Platz als die 40 rem der Inhaltsspalte, sonst bricht sie in zwei Zeilen um */
  body.nav-grouped:not(.nav-icons-only) .topnav { --pad: max(0.75rem, calc((100% - 56rem) / 2 + 0.75rem)); }
  body.nav-grouped:not(.nav-icons-only) .topnav-links .navgroup { padding-inline: 0.6rem; }
}
a.row-main { color: inherit; text-decoration: none; }
a.row-main:hover .issuer { text-decoration: underline; }

/* App-Ansicht */
.bar { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; padding: 0.5rem 0 1rem; }
.bar .grow { flex: 1 1 0; min-width: 0; }
.bar .who-am-i { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
.who-am-i { font-weight: 600; }
.badge { display: inline-block; font-size: 0.8rem; padding: 0.05rem 0.5rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); margin-left: 0.4rem; font-weight: 400; }

.list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.entry { border-bottom: 1px solid var(--line); position: relative; }
.entry:last-child { border-bottom: 0; }
.entry-line { display: flex; align-items: stretch; }
.row-main {
  flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border: 0; background: transparent; text-align: left; padding: 0.85rem 0.25rem 0.85rem 1rem; min-width: 0;
}
.row-main:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.who { display: grid; min-width: 0; }
.issuer { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct { color: var(--muted); font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code { font-size: 1.75rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.06em; white-space: nowrap; }
.entry-tools { display: flex; align-items: center; padding-right: 0.5rem; }
.rail { display: block; height: 3px; background: var(--line); }
.rail-bar { display: block; height: 100%; width: 100%; background: var(--accent); transition: width 0.26s linear; }
.rail[data-low="1"] .rail-bar { background: var(--warn); }
.entry[data-low="1"] .code { color: var(--warn); }
.empty { text-align: center; padding: 2.5rem 1rem; }
.empty p { max-width: 26rem; margin-inline: auto; }

/* 2FA: Folgecode und Kachelraster (Spalten 1–3) */
.codebox { display: grid; justify-items: end; line-height: 1.15; }
.next { font-size: 0.8rem; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; visibility: hidden; white-space: nowrap; }
.entry[data-soon="1"] .next { visibility: visible; }
.cols { display: inline-flex; align-items: center; gap: 0.15rem; }
.colbtn { min-height: 2rem; padding: 0.15rem 0.6rem; font-size: 0.875rem; }
.colbtn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.tiles { display: grid; gap: 0; }
.tiles.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles.cols-2, .tiles.cols-3 { background: transparent; border: 0; gap: 0.75rem; }
.tiles.cols-2 .entry, .tiles.cols-3 .entry { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tiles.cols-2 .row-main, .tiles.cols-3 .row-main { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
.tiles.cols-2 .codebox, .tiles.cols-3 .codebox { justify-items: start; }
.tiles.cols-3 .code { font-size: 1.4rem; }
.tiles.cols-2 .entry-line, .tiles.cols-3 .entry-line { flex-direction: column; }
.tiles.cols-2 .entry-tools, .tiles.cols-3 .entry-tools { padding: 0 0.5rem 0.4rem; }
@media (max-width: 30rem) { .tiles.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tiles.cols-3 .code { font-size: 1.75rem; } }

@media (max-width: 30rem) { .code { font-size: 1.5rem; } .tiles.cols-3 .code { font-size: 1.5rem; } }

/* Dialoge */
dialog.modal { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; background: var(--panel); color: var(--ink); width: min(32rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); overflow: auto; overscroll-behavior: contain; }
dialog.modal::backdrop { background: rgba(8, 14, 22, 0.55); }
dialog.modal h2 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
/* Feste Leiste oben im Fenster: Titel links, Symbole (Speichern, Bearbeiten, Löschen, Schließen) rechts; bleibt beim Scrollen stehen */
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.5rem 0.5rem 1.25rem; background: var(--panel); border-bottom: 1px solid var(--line); }
.modal-tools { display: flex; flex: 0 0 auto; gap: 0.15rem; }
.modal-tool { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; min-height: 2.75rem; padding: 0; border-radius: 50%; }
.modal-tool .ico { width: 1.35rem; height: 1.35rem; }
.modal-tool:hover, .modal-tool:focus-visible { background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: transparent; }
.modal-tool.tool-delete { color: var(--danger); }
.modal-tool.tool-save { color: var(--ok); }
.modal-body { padding: 0.75rem 1.25rem 1.25rem; }
/* Handy: Fenster fast bildschirmfüllend, größere Tippflächen, Eingaben mit 16 px (kein Zoomen beim Antippen in iOS) */
@media (max-width: 40rem) {
  dialog.modal { width: calc(100vw - 0.75rem); max-height: calc(100vh - 0.75rem); max-height: calc(100dvh - 0.75rem); }
  .modal-head { padding-left: 0.9rem; }
  .modal-body { padding: 0.6rem 0.9rem calc(1rem + env(safe-area-inset-bottom, 0px)); }
  dialog.modal h2 { font-size: 1.05rem; }
  dialog.modal input, dialog.modal select, dialog.modal textarea { font-size: 16px; }
  dialog.modal .actions .btn { flex: 1 1 auto; min-height: 2.75rem; }
}
.menu { display: grid; gap: 0.25rem; margin: 0.75rem 0; }
.menu .btn { text-align: left; }
video.scan { width: 100%; border-radius: var(--radius); background: #000; max-height: 60vh; }
pre.out { white-space: pre-wrap; word-break: break-all; font-size: 0.8rem; background: var(--bg); padding: 0.5rem; border-radius: var(--radius); }

/* Backup-Erinnerung: unter dem Menü, bis exportiert oder „Später“ gewählt wird */
.backup-banner { max-width: 40rem; margin: 0.5rem auto 0; padding: 0.5rem 0.75rem; border-left: 3px solid var(--warn); background: var(--panel); border-radius: 0 var(--radius) var(--radius) 0; }
.backup-banner p { margin: 0 0 0.4rem; }
.deadline-banner { border-left-color: var(--danger); }
.deadline-list { margin: 0 0 0.4rem; padding-left: 1.1rem; }
.deadline-list li { margin: 0.15rem 0; }
.linklike { font: inherit; font-weight: 700; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-align: left; }
.backup-banner .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0; }
@media (max-width: 42rem) { .backup-banner { margin-inline: 1rem; } }
.toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 0.5rem 0.9rem; border-radius: var(--radius); font-size: 0.9rem; z-index: 50; max-width: calc(100vw - 2rem); }

@media (prefers-reduced-motion: reduce) { .timebar-fill { transition: none; } }

/* A2K-Eintrag: Name links (Tipp = bearbeiten), große Zahl rechts (Tipp = kopieren). Kein Einstellungsrad, knappe Abstände. */
.entry-line.compact { align-items: center; }
.entry-line.compact > .row-main { flex: 1 1 5rem; min-width: 0; padding: 0.45rem 0.25rem 0.45rem 1rem; }
.entry-line.compact > .codebtn { margin-left: auto; align-self: stretch; border: 0; background: transparent; color: inherit; text-align: right; padding: 0.3rem 1rem 0.3rem 0.5rem; cursor: pointer; }
.entry-line.compact .code { font-size: 2.75rem; line-height: 1.1; letter-spacing: 0.04em; }
.entry-line.compact .chev { font-size: 1.1rem; }
@media (max-width: 30rem) { .entry-line.compact .code { font-size: 2.35rem; } }
/* Folgecode: nimmt keinen Platz ein, solange er nicht gebraucht wird (ab 10 s Restzeit erscheint er links neben der Zahl) */
.entry-line.compact .codebox { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; column-gap: 0.7rem; line-height: 1.1; }
.entry-line.compact .next { order: -1; display: none; visibility: visible; }
.entry[data-soon="1"] .entry-line.compact .next { display: inline; }
/* Kachelraster (2 oder 3 Spalten): Name oben, Zahl darunter */
.tiles.cols-2 .entry-line.compact, .tiles.cols-3 .entry-line.compact { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
.tiles.cols-2 .entry-line.compact > .row-main, .tiles.cols-3 .entry-line.compact > .row-main { flex: 0 0 auto; padding: 0.5rem 0.75rem 0.1rem 1rem; }
.tiles.cols-2 .entry-line.compact > .codebtn, .tiles.cols-3 .entry-line.compact > .codebtn { margin-left: 0; text-align: left; padding: 0 0.75rem 0.45rem 1rem; }
.tiles.cols-2 .entry-line.compact .code { font-size: 2.3rem; }
.tiles.cols-3 .entry-line.compact .code { font-size: 1.9rem; }
.tiles.cols-2 .entry-line.compact .codebox, .tiles.cols-3 .entry-line.compact .codebox { justify-content: flex-start; }
@media (max-width: 30rem) {
  .tiles.cols-2 .entry-line.compact .code, .tiles.cols-3 .entry-line.compact .code { font-size: 1.75rem; }
  /* schmale Anzeige: Folgecode unter der Zahl statt daneben, damit der Name nicht zusammengedrückt wird */
  .entry-line.compact .codebox { flex-direction: column; align-items: flex-end; }
  .entry-line.compact .next { order: 1; }
  .tiles.cols-2 .entry-line.compact .codebox, .tiles.cols-3 .entry-line.compact .codebox { align-items: flex-start; }
  .tiles.cols-2 .entry-line.compact .next, .tiles.cols-3 .entry-line.compact .next { order: -1; }
}
/* MAIL: eigenständiger Dienst im iframe unter dem Menü (dhx.js setzt body.ext-page, wenn er offen ist) */
body.ext-page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.ext-view { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.ext-view[hidden] { display: none; }
.ext-bar { padding: 0.3rem 0.75rem; font-size: 0.85rem; text-align: right; background: var(--bg); border-bottom: 1px solid var(--line); }
.ext-bar a { color: var(--muted); }
.ext-frame { flex: 1 1 auto; width: 100%; min-height: 70vh; border: 0; background: #fff; }

/* A2K-Kategorien: Filter-Chips, Umschalter Gruppiert/Liste, Gruppenüberschriften, Verwaltungsdialog */
.catbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.25rem 0 0.75rem; }
.catchips { display: flex; flex-wrap: wrap; gap: 0.4rem; flex: 1 1 12rem; min-width: 0; }
.catchip { display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 0.2rem 0.7rem; min-height: 2rem; font-size: 0.875rem; max-width: 100%; }
.catchip:hover { border-color: var(--accent); }
.catchip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); font-weight: 700; background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.catselectwrap { display: flex; align-items: center; gap: 0.5rem; flex: 1 1 14rem; min-width: 0; }
.catselectlabel { color: var(--muted); font-size: 0.875rem; white-space: nowrap; }
.catselect { flex: 1 1 auto; min-width: 0; max-width: 24rem; min-height: 2.25rem; font-size: 0.95rem; }
.catmanage { white-space: nowrap; margin-left: auto; }
.catsec + .catsec { margin-top: 1rem; }
.cat-head { display: flex; align-items: center; gap: 0.5rem; width: 100%; border: 0; background: transparent; padding: 0.35rem 0.1rem; margin-bottom: 0.25rem; text-align: left; font-weight: 700; font-size: 0.95rem; color: var(--ink); cursor: pointer; }
.cat-head:hover .cat-name { color: var(--accent); }
.cat-chev { width: 1rem; color: var(--muted); }
.cat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catlist { display: grid; gap: 0.4rem; margin: 0.5rem 0; }
.catrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto; gap: 0.4rem; align-items: center; }
.catrow input { min-width: 0; }
.catn { white-space: nowrap; }
.catadd { display: flex; gap: 0.5rem; margin: 0.75rem 0 0.25rem; }
.catadd input { flex: 1; min-width: 0; }
@media (max-width: 40rem) {
  /* schmal: Chips in einer waagerecht scrollbaren Zeile, darunter Umschalter und Verwaltung */
  .catchips { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 0.15rem; }
  .catchips::-webkit-scrollbar { display: none; }
  .catchip { flex: none; }
}
@media (max-width: 30rem) {
  .catrow { grid-template-columns: minmax(0, 1fr) auto auto auto; }
  .catrow input { grid-column: 1 / -1; }
}

/* Fristen: Plakette am Menüpunkt FRISTEN (Zahl der vorbeigegangenen und bald fälligen Fristen) */
.navlink[data-nav="fristen"], .navlink.morelink { position: relative; }
.duesbadge { position: absolute; top: 0.2rem; right: 0.1rem; min-width: 1.05rem; height: 1.05rem; padding: 0 0.25rem; border-radius: 999px; background: var(--warn); color: var(--panel); font-size: 0.68rem; font-weight: 800; line-height: 1.05rem; text-align: center; font-variant-numeric: tabular-nums; }

/* Speicherplatz-Anzeige (Einstellungen) */
.storage .label { display: block; font-size: 0.9rem; color: var(--muted); }
.storage-text { margin: 0.15rem 0 0.35rem; font-weight: 600; }
.storage-bar { width: 100%; height: 0.6rem; accent-color: var(--accent); }
.storage.warn .storage-bar { accent-color: var(--warn); }
.storage.full .storage-bar { accent-color: var(--danger); }
.storage.warn .storage-text { color: var(--warn); }
.storage.full .storage-text { color: var(--danger); }

/* Globale Suche (Dialog) */
.gs input[type=search] { width: 100%; }
.gs-list { max-height: 50vh; overflow: auto; margin-top: 0.5rem; }
.gs-head { margin: 0.75rem 0 0.25rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.gs-hit { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; width: 100%; padding: 0.5rem 0.4rem; border: 0; border-radius: 0.5rem; background: transparent; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.gs-hit:hover, .gs-hit:focus-visible { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.gs-title { font-weight: 600; overflow-wrap: anywhere; }
.gs-sub { overflow-wrap: anywhere; }

/* v30: Passwort-Check, Sicherung vor dem Ersetzen, Papierkorb */
.pwflag { display: inline-block; font-size: 0.8rem; padding: 0.05rem 0.5rem; border: 1px solid var(--warn); border-radius: 999px; color: var(--ink); margin-left: 0.5rem; }
.pwhint { margin: 0.35rem 0 0.9rem; padding-left: 0.6rem; border-left: 3px solid var(--line); color: var(--ink); }
.pwhint:empty { display: none; }
.pwhint[data-tone="warn"] { border-left-color: var(--warn); }
.pwhint[data-tone="ok"] { border-left-color: var(--ok); }
.pwcheck .pwlist { margin: 0.4rem 0; padding-left: 1.2rem; }
.pwdetail { margin: 0.25rem 0 0; color: var(--ink); }
.replace-sum { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 0.8rem; margin: 0.6rem 0; }
.replace-sum dt { color: var(--muted); }
.replace-sum dd { margin: 0; overflow-wrap: anywhere; }
.trash-row { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; align-items: center; justify-content: space-between; padding: 0.55rem 0; border-top: 1px solid var(--line); }
.trash-row:first-child { border-top: 0; }
.trash-info { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.trash-row .actions { margin: 0; }

/* v35: Passwort-Generator, Gesundheit, Import */
.pwbox { display: flex; gap: 0.5rem; align-items: center; margin: 0.8rem 0 0.3rem; flex-wrap: wrap; }
.pwpreview { flex: 1 1 14rem; display: block; padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 0.5rem; background: var(--panel, transparent); word-break: break-all; user-select: all; font-size: 1.05rem; }
.pwgenrow { margin: -0.4rem 0 0.4rem; }
.sec-head { flex-wrap: wrap; gap: 0.4rem; }
.healthscore { font-size: 1.1rem; margin: 0 0 0.3rem; }
.healthbar { height: 0.6rem; border-radius: 0.3rem; background: var(--line); overflow: hidden; margin-bottom: 0.8rem; }
.healthbar > span { display: block; height: 100%; background: var(--ok); }
.healthbar[data-tone="fair"] > span { background: var(--warn); }
.healthbar[data-tone="bad"] > span { background: var(--danger, #c0392b); }
.healthstats { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; list-style: none; padding: 0; margin: 0 0 0.8rem; }
.healthlist { max-height: 40vh; overflow: auto; }
.pwflag[data-level="fair"] { opacity: 0.8; }
.pwflag[data-level="leaked"] { background: var(--danger, #c0392b); border-color: var(--danger, #c0392b); color: #fff; }
.leakbox { margin: 0 0 0.8rem; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: 0.5rem; }
.leakbox .actions { margin: 0 0 0.4rem; }
.healthhints { margin: 0.8rem 0; }
.healthhints h3 { margin: 0 0 0.3rem; }
.healthhint { margin: 0.3rem 0; }
.healthhint summary { cursor: pointer; font-weight: 600; }
label.no2fa { display: flex; align-items: flex-start; gap: 0.4rem; margin: 0.3rem 0 0.8rem; font-size: 0.9rem; }

/* Letzte Abrufe (activity-ui.js) */
.activity { list-style: none; margin: 0.5rem 0; padding: 0; max-height: 50vh; overflow: auto; }
.activity li { padding: 0.4rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.activity li.warn { box-shadow: inset 3px 0 0 var(--danger, #c62828); padding-left: 0.6rem; }

/* Recovery-Key (recovery-ui.js) */
.recovery-key { font: 600 1.25rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.05em; padding: 0.6rem 0.8rem; border: 1px dashed var(--line); border-radius: 8px; overflow-wrap: anywhere; user-select: all; }
.recovery-print { display: none; }
@media print {
  body.printing-recovery > *:not(.recovery-print) { display: none !important; }
  body.printing-recovery .recovery-print { display: block; padding: 2rem; color: #000; background: #fff; }
  .recovery-print .recovery-key { font-size: 1.6rem; border: 2px solid #000; text-align: center; }
}

/* ---- LOGINS: Login mit 2FA-Code, Websites und Notizen (v37.1) ---- */
.row-main .who { flex: 1 1 auto; min-width: 0; }
.avatar { flex: none; width: 2.25rem; height: 2.25rem; border-radius: 0.6rem; display: grid; place-items: center; font-weight: 700; font-size: 1rem;
  background: hsl(var(--hue, 220) 55% 90%); color: hsl(var(--hue, 220) 55% 26%); }
@media (prefers-color-scheme: dark) { .avatar { background: hsl(var(--hue, 220) 35% 24%); color: hsl(var(--hue, 220) 70% 85%); } }
.entry-line.compact > .row-main { justify-content: flex-start; }
.entry.k-login .entry-line.compact .code { font-size: 1.6rem; }
.entry.k-login .entry-line.compact > .codebtn:not(.chevbtn) { padding-right: 0.25rem; }
.entry.k-login .entry-line.compact .codebox { align-items: center; }
.entry-line.compact > .chevbtn { margin-left: 0; padding-left: 0.25rem; }
.entry.k-login .entry-line.compact > .codebtn:not(.chevbtn) { margin-left: auto; }
.entry.k-login:not(:has(.codebtn:not(.chevbtn))) .chevbtn { margin-left: auto; }
.tiles.cols-2 .entry.k-login .entry-line.compact > .codebtn, .tiles.cols-3 .entry.k-login .entry-line.compact > .codebtn { text-align: left; }
.val.copyable { cursor: copy; border-radius: 0.3rem; padding: 0.1rem 0.25rem; margin: -0.1rem -0.25rem; }
.val.copyable:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.sitesset { border: 0; padding: 0; margin: 0 0 0.9rem; min-width: 0; }
.sitesset legend { padding: 0; font-weight: 600; margin-bottom: 0.3rem; }
.siterow { display: flex; gap: 0.4rem; margin-bottom: 0.4rem; }
.siterow input { flex: 1 1 auto; min-width: 0; }
.adv { margin: 0 0 0.9rem; }
.adv summary { cursor: pointer; color: var(--muted); font-size: 0.875rem; margin-bottom: 0.5rem; }

.readonly-banner { border-left-color: var(--danger, #b3261e); }
.mergerow { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.4rem 0; border-top: 1px solid var(--line, #d9dde4); }
.mergerow input { margin-top: 0.25rem; }

/* Favoriten (Stern) und Archiv in LOGINS (ab v1.09) */
.starbtn { flex: none; align-self: center; border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1.15rem; line-height: 1; padding: 0.4rem 0.5rem; min-width: 2.5rem; min-height: 2.5rem; opacity: 0.6; }
.starbtn.on { color: var(--accent, #2f3fd4); opacity: 1; }
.starbtn:hover, .starbtn:focus-visible { opacity: 1; }
.starbtn.restorebtn { font-size: 0.85rem; opacity: 1; text-decoration: underline; padding: 0.4rem 0.75rem; }
.favbar { margin: 0.5rem 0; }
.entry.archived { opacity: 0.8; }

/* ---- Symbole statt Text (ab 1.18) ---- */
:root { --add: #1b7f45; --add-ink: #ffffff; }
@media (prefers-color-scheme: dark) { :root { --add: #3ecf85; --add-ink: #06150d; } }
.btn.iconbtn { display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem; padding: 0.4rem; min-width: 2.5rem; min-height: 2.5rem; line-height: 1; flex: none; }
.btn.iconbtn .ico { width: 1.3rem; height: 1.3rem; min-width: 1.3rem; min-height: 1.3rem; }
.btn.iconbtn.ghost:hover, .btn.iconbtn.ghost:focus-visible { background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: transparent; }
.btn.iconbtn.ghost.danger { border-color: transparent; }
.btn.iconbtn[aria-pressed="true"] { color: var(--accent); }
.btn.iconbtn.starred .ico { fill: currentColor; }
/* Grünes Plus: Hinzufügen und Neu in allen Bereichen */
.btn.add { background: var(--add); border-color: var(--add); color: var(--add-ink); }
.btn.add:hover, .btn.add:focus-visible { background: var(--add); border-color: var(--add); filter: brightness(1.1); }
.btn.add .ico { width: 1.45rem; height: 1.45rem; stroke-width: 2.8; }
dialog.modal .actions .iconbtn { flex: 0 0 auto; min-width: 3rem; min-height: 2.75rem; }
.cols .ico { width: 1.1rem; height: 1.1rem; min-width: 1.1rem; min-height: 1.1rem; }

/* LOGINS: kompakte Zeile (Benutzer und Passwort nebeneinander, Antippen kopiert) und Symbolleiste */
.vbody .vquick { display: flex; flex-wrap: wrap; gap: 0.4rem 0.6rem; }
.vcell { flex: 1 1 14rem; min-width: 0; display: flex; align-items: center; gap: 0.15rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); padding: 0 0.2rem 0 0.6rem; }
.vcell-ico { flex: none; display: flex; color: var(--muted); }
.vcell-ico .ico { width: 1.1rem; height: 1.1rem; min-width: 1.1rem; min-height: 1.1rem; }
.vquick-val { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; text-align: left; padding: 0.55rem 0.35rem; border-radius: 0.3rem; cursor: copy; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vquick-val:hover, .vquick-val:focus-visible { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.vquick-val.multi { white-space: pre-wrap; overflow-wrap: anywhere; text-overflow: clip; }
.vcell .vtools { flex: none; align-items: center; }
.vtools .btn.iconbtn { padding: 0.25rem; min-width: 2.25rem; min-height: 2.25rem; }
.vtools .btn.iconbtn .ico { width: 1.2rem; height: 1.2rem; min-width: 1.2rem; min-height: 1.2rem; }
.vbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.1rem; margin-top: 0.15rem; }
.vdetails { display: grid; gap: 0.15rem; margin-top: 0.35rem; padding-top: 0.4rem; border-top: 1px solid var(--line); }
.favmark { display: inline-flex; vertical-align: middle; margin-left: 0.3rem; color: var(--accent); }
.favmark .ico { width: 0.9rem; height: 0.9rem; min-width: 0.9rem; min-height: 0.9rem; fill: currentColor; }
.chevbtn .ico { width: 1.2rem; height: 1.2rem; min-width: 1.2rem; min-height: 1.2rem; color: var(--muted); }
.cat-head.archhead { width: auto; gap: 0.45rem; align-items: center; }
.cat-head.archhead .ico { width: 1.3rem; height: 1.3rem; min-width: 1.3rem; min-height: 1.3rem; }
.favbar .btn .ico { width: 1.15rem; height: 1.15rem; min-width: 1.15rem; min-height: 1.15rem; }
.favbar .btn[aria-pressed="true"] .ico { fill: currentColor; }
.sec-head .btn.iconbtn { flex: none; }
[hidden].btn, .btn[hidden], .vcell[hidden] { display: none !important; }
.flagrow { display: flex; gap: 0.5rem; margin: 0.6rem 0; }
.flagtoggle { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; color: var(--muted); }
.flagtoggle:has(input:checked) { border-color: var(--accent); color: var(--accent); }
.flagtoggle:has(input:checked) .ico-star { fill: currentColor; }
.flagtoggle .ico { width: 1.3rem; height: 1.3rem; min-width: 1.3rem; min-height: 1.3rem; }
.rec-val .copyable { cursor: copy; border-radius: 0.3rem; padding: 0.1rem 0.25rem; margin: -0.1rem -0.25rem; }
.rec-val .copyable:hover, .rec-val .copyable:focus-visible { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.rec-view .vbar { margin: 0.6rem 0; }
.catmanage { margin-left: auto; }

/* Passkey-Verzeichnis (ab 1.36): Schlüssel-Symbol neben dem Login. Rot = Passkey wird angeboten, grün = Passkey vorhanden (Bedeutung steht zusätzlich im Tooltip und für Bildschirmleser). */
.pkmark { display: inline-flex; vertical-align: middle; margin-left: 0.35rem; }
.pkmark .ico { width: 0.95rem; height: 0.95rem; min-width: 0.95rem; min-height: 0.95rem; }
.pkmark.pk-offer { color: var(--danger); }
.pkmark.pk-have { color: var(--ok); }
.vrow .pkmark { margin-left: 0; margin-right: 0.15rem; }

/* Ab 1.41: Suchfeld mit großem runden X-Knopf (common.js searchBox); das eingebaute X des Browsers ist winzig */
.sb { position: relative; display: block; flex: 1 1 12rem; min-width: 0; }
.sb > input { width: 100%; padding-right: 3rem; }
.sb > .btn.sb-clear { position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%); width: 2rem; height: 2rem; min-width: 2rem; min-height: 2rem; padding: 0; border-radius: 50%; background: color-mix(in srgb, var(--muted) 20%, transparent); color: var(--ink); }
.sb > .btn.sb-clear:hover, .sb > .btn.sb-clear:focus-visible { background: color-mix(in srgb, var(--muted) 38%, transparent); }
.sb > .btn.sb-clear[hidden] { display: none; }
.sb > .btn.sb-clear .ico { width: 1.1rem; height: 1.1rem; min-width: 1.1rem; min-height: 1.1rem; stroke-width: 2.6; }
/* Suchfelder ohne eigenen Knopf (Chat, Erben): das eingebaute X wenigstens deutlich größer */
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; height: 1.5rem; width: 1.5rem; margin-left: 0.25rem; border-radius: 50%; cursor: pointer; background: color-mix(in srgb, #8a97a5 25%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23566676' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E") center / 65% no-repeat; }
.sb > input[type=search]::-webkit-search-cancel-button { display: none; }
@media (max-width: 40rem) { .sb > .btn.sb-clear { width: 2.25rem; height: 2.25rem; } }
