/* =====================================================================
   Design „Klar“ (30.10.2026)
   Wird nach allen anderen Stilen geladen. Enthält den Rahmen
   (Seitenleiste, Werkzeugleiste, Tableiste), die Bausteine im Stil
   von Apple und die Anpassungen für Handy, Tablet und Schreibtisch.
   Farben und Schrift stehen in common.css.
   ===================================================================== */

:root {
  --kl-sidebar: 248px;
  --kl-toolbar: 56px;
  --kl-tabbar: 64px;
  --kl-safe-b: env(safe-area-inset-bottom, 0px);
  --kl-ease: cubic-bezier(.2, .9, .25, 1);
}

/* ---------- Zähler für den Chat in Seitenleiste und Tableiste ---------- */
.kl-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--fill-2); color: var(--text); font-size: 11px; font-weight: 650; line-height: 18px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.kl-badge[hidden] { display: none; }
.kl-badge.is-mention { background: var(--alarm); color: #fff; }
.kl-nav-item, .kl-tab { position: relative; }
.kl-tab .kl-badge { position: absolute; top: 2px; left: calc(50% + 4px); margin: 0; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; background: var(--accent); color: #fff; }
.kl-tab .kl-badge.is-mention { background: var(--alarm); }
@media (max-width: 1180px) and (min-width: 821px) {
  .kl-nav-item .kl-badge { position: absolute; top: 1px; right: 4px; margin: 0; min-width: 15px; height: 15px; line-height: 15px; font-size: 10px; padding: 0 3px; background: var(--accent); color: #fff; }
}
html.kl-side-collapsed .kl-nav-item .kl-badge { position: absolute; top: 1px; right: 4px; margin: 0; min-width: 15px; height: 15px; line-height: 15px; font-size: 10px; padding: 0 3px; background: var(--accent); color: #fff; }

/* ---------- Grundlagen ---------- */
h1, h2, h3 { letter-spacing: -0.015em; }
a { color: var(--accent); text-decoration: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 1px; border-radius: 8px; }
.mono { letter-spacing: 0; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
img { max-width: 100%; }

/* ---------- Knöpfe: Rückmeldung schon beim Drücken ---------- */
.btn {
  min-height: 32px; padding: 6px 14px; gap: 6px;
  border: 0; border-radius: 8px;
  background: var(--fill); color: var(--text);
  font-weight: 500; font-size: 14px; line-height: 1.2;
  box-shadow: none; text-decoration: none;
  transition: transform .1s ease-out, background-color .15s ease, color .15s ease, opacity .15s ease;
}
.btn:hover { transform: none; border-color: transparent; color: var(--text); }
@media (hover: hover) { .btn:hover { background: var(--fill-2); } }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-primary, .btn-primary:hover { background: var(--accent); color: #fff; filter: none; box-shadow: none; }
@media (hover: hover) { .btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); color: #fff; } }
.btn-danger { background: transparent; color: var(--alarm); border: 0; }
@media (hover: hover) { .btn-danger:hover { background: color-mix(in srgb, var(--alarm) 12%, transparent); color: var(--alarm); border-color: transparent; } }
.btn-icon { width: 32px; min-height: 32px; padding: 0; background: transparent; color: var(--text-soft); }
@media (hover: hover) { .btn-icon:hover { background: var(--fill); color: var(--accent); } }
.btn-icon.btn-danger { color: var(--alarm); }
.link-btn { color: var(--accent); }
kbd { font-family: var(--font-sans); font-size: 11px; padding: 1px 5px; border-radius: 4px; background: var(--panel); color: var(--text-soft); box-shadow: 0 0 0 .5px var(--border-strong); border: 0; }

/* ---------- Felder ---------- */
.field { margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-soft); margin: 0 0 6px 2px; }
.field input, .field textarea, .field select, .search-field input,
.jira-filters select, .jira-filters input, .jira-inline-select, .jira-filterbar select, .dx-search input, .jira-inline-form input {
  border: 0; border-radius: 10px; background: var(--fill); color: var(--text);
  box-shadow: none; min-height: 38px; font-size: 15px;
  transition: box-shadow .15s ease, background-color .15s ease;
}
.field input:focus, .field textarea:focus, .field select:focus, .search-field input:focus,
.jira-filters select:focus, .jira-filters input:focus, .jira-inline-select:focus, .jira-filterbar select:focus, .dx-search input:focus, .jira-inline-form input:focus {
  outline: none; border-color: transparent; background: var(--panel);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent);
}
.field input::placeholder, .field textarea::placeholder, .search-field input::placeholder { color: var(--text-soft); opacity: .8; }
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--accent); }
.search-field::before { display: none; }
.error-msg { border-left: 0; padding-left: 2px; color: var(--alarm); font-size: 13px; margin-top: 10px; }
.error-msg:empty { display: none; }

/* =====================================================================
   Rahmen
   ===================================================================== */
.kl-sidebar, .kl-tabbar { display: none; }

body.kl-shell #app { padding-left: var(--kl-sidebar); min-height: 100vh; min-height: 100dvh; }

body.kl-shell .kl-sidebar {
  display: flex; flex-direction: column;
  position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: var(--kl-sidebar);
  padding: 14px 10px 12px;
  background: var(--material-heavy);
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  border-right: .5px solid var(--border);
}
.kl-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: var(--text); font-weight: 650; font-size: 16px; letter-spacing: -.01em; }
.kl-app-icon, .kl-login-icon { display: grid; place-items: center; background: linear-gradient(160deg, #7371F2, #4B49C8); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28); }
.kl-app-icon { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.kl-nav { display: grid; gap: 2px; }
.kl-sidebar .kl-nav { overflow-y: auto; min-height: 0; }
.kl-nav-group { display: grid; gap: 2px; margin-top: 14px; }
.kl-nav-heading { padding: 0 10px 4px; color: var(--text-soft); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.kl-nav-item {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px;
  border-radius: 8px; color: var(--text); font-size: 14px; font-weight: 500;
  transition: background-color .12s ease, transform .1s ease-out;
}
.kl-nav-item svg { color: var(--accent); flex: none; }
@media (hover: hover) { .kl-nav-item:hover { background: var(--fill); } }
.kl-nav-item:active { transform: scale(.98); }
.kl-nav-item.is-current { background: var(--accent); color: #fff; }
.kl-nav-item.is-current svg { color: #fff; }
.kl-me { margin-top: auto; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; text-align: left; font: inherit; transition: background-color .12s ease; }
@media (hover: hover) { .kl-me:hover { background: var(--fill); } }
.kl-me[aria-expanded="true"] { background: var(--fill-2); }
.kl-avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600; background: linear-gradient(180deg, #7371F2, #4B49C8); }
.kl-me-text { display: grid; min-width: 0; line-height: 1.25; }
.kl-me-text strong { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kl-me-text small { font-size: 12px; color: var(--text-soft); }

/* Werkzeugleiste: Glas, Inhalt läuft darunter durch */
body.kl-shell .app-header, body.kl-shell.page-wide .app-header {
  position: sticky; top: 0; z-index: 30;
  width: auto; max-width: none; margin: 0; min-height: var(--kl-toolbar);
  padding: 8px 20px 8px 28px; gap: 12px;
  display: flex; align-items: center; justify-content: space-between;
  border: 0; border-radius: 0; box-shadow: none;
  background: var(--material);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
}
body.kl-shell .app-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: .5px; background: var(--border); opacity: 0; transition: opacity .2s ease; }
body.kl-scrolled .app-header::after { opacity: 1; }
body.kl-shell .brand-group { gap: 8px; min-width: 0; }
body.kl-shell .brand-group .security-mark { display: none; }
.kl-toolbar-title, body.kl-shell .brand-group .brandmark { font-size: 17px; font-weight: 650; letter-spacing: -.012em; white-space: nowrap; margin: 0; }
body.kl-shell .header-controls { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; margin-left: auto; }
body.kl-shell .app-nav { display: none; }
.search-trigger { width: 220px; justify-content: flex-start; color: var(--text-soft); gap: 8px; }
.search-trigger span { flex: 1; text-align: left; }
.search-trigger svg { flex: none; }
body.kl-shell .search-field { width: 240px; }
body.kl-shell .search-field input { min-height: 32px; padding: 6px 12px; font-size: 14px; }

/* Inhaltsbereiche aller Seiten */
body.kl-shell .app-shell, body.kl-shell.page-wide .app-shell,
body.kl-shell .admin-shell, body.kl-shell.page-wide .admin-shell,
body.kl-shell .st-page, body.kl-shell .if-page, body.kl-shell .jira-page, body.kl-shell .documentation-page.dx-page {
  width: auto; max-width: 1480px; margin: 0; padding: 12px 28px 48px;
}

/* Tableiste (Handy) */
.kl-tab { display: grid; justify-items: center; gap: 2px; flex: 1; min-width: 0; padding: 6px 2px 2px; border: 0; background: transparent; color: var(--text-soft); font: 500 10.5px/1.1 var(--font-sans); cursor: pointer; transition: transform .1s ease-out; }
.kl-tab svg { width: 24px; height: 24px; }
.kl-tab:active { transform: scale(.92); }
.kl-tab.is-current { color: var(--accent); }

/* =====================================================================
   Blätter (Dialoge), Menüs, Suche, Mitteilungen
   ===================================================================== */
.modal-overlay { background: rgba(0, 0, 0, .28); padding: 24px; z-index: 100; -webkit-backdrop-filter: none; backdrop-filter: none; }
[data-theme="dark"] .modal-overlay { background: rgba(0, 0, 0, .55); }
.modal-overlay:not([hidden]) { animation: kl-fade .25s ease both; }
.modal {
  background: var(--bg); border: 0; border-radius: 16px; padding: 22px 22px 20px;
  box-shadow: var(--shadow); max-height: min(88vh, 88dvh);
  overscroll-behavior: contain;
}
.modal-overlay:not([hidden]) .modal { animation: kl-sheet-in .38s var(--kl-ease) both; }
.modal h2 { font-size: 19px; font-weight: 650; letter-spacing: -.012em; margin-bottom: 16px; }
.modal .field input, .modal .field textarea, .modal .field select { background: var(--panel); }
.modal .field input:focus, .modal .field textarea:focus, .modal .field select:focus { background: var(--panel); }
.modal-actions { gap: 8px; margin-top: 18px; }
.modal-note { color: var(--text-soft); font-size: 13px; }
@keyframes kl-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes kl-sheet-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes kl-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes kl-pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

/* Menüs wachsen aus ihrem Auslöser */
.context-menu {
  border: 0; border-radius: 12px; padding: 5px; min-width: 230px;
  background: var(--material);
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  box-shadow: var(--shadow-tight);
}
.context-menu:not([hidden]) { animation: kl-pop .22s var(--kl-ease) both; }
.context-menu-item { border-radius: 7px; padding: 7px 10px; gap: 10px; min-height: 34px; }
.context-menu-item:hover, .context-menu-item:focus-visible { background: var(--accent); color: #fff; outline: none; }
.context-menu-item:hover .context-menu-desc, .context-menu-item:focus-visible .context-menu-desc,
.context-menu-item:hover .context-menu-icon, .context-menu-item:focus-visible .context-menu-icon { color: rgba(255, 255, 255, .85); }
.context-menu-icon { color: var(--accent); }
.context-menu-label { font-weight: 500; font-size: 14px; }
.context-menu-desc { font-size: 12px; color: var(--text-soft); }
.context-menu-item-danger { color: var(--alarm); }
.context-menu-item-danger .context-menu-icon { color: var(--alarm); }
.context-menu-item-danger:hover, .context-menu-item-danger:focus-visible { background: var(--alarm); color: #fff; }
.settings-menu-sep { height: .5px; background: var(--border); margin: 4px 8px; }

/* Suche (Strg K): erscheint als Material */
.search-overlay { background: rgba(0, 0, 0, .22); align-items: flex-start; padding-top: 12vh; }
.search-dialog {
  border: 0; border-radius: 16px; overflow: hidden;
  background: var(--material);
  -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
  box-shadow: var(--shadow);
}
.search-overlay:not([hidden]) .search-dialog { animation: kl-palette .32s var(--kl-ease) both; }
@keyframes kl-palette { from { opacity: 0; transform: scale(.95); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.search-input-row { border-bottom: .5px solid var(--border); min-height: 56px; }
.search-input-row input { font-size: 18px; background: transparent; border: 0; box-shadow: none; }
.search-input-row input:focus { box-shadow: none; outline: none; }
.search-hit { border-radius: 9px; }
.search-hit.is-active, .search-hit:hover { background: var(--accent); color: #fff; }
.search-hit.is-active small, .search-hit:hover small, .search-hit.is-active em, .search-hit:hover em { color: rgba(255, 255, 255, .8); }
.search-hit mark { background: color-mix(in srgb, #FFCC00 45%, transparent); color: inherit; border-radius: 3px; }
.search-foot { border-top: .5px solid var(--border); }

/* Mitteilungen */
.toast-region { bottom: calc(24px + var(--kl-safe-b)); }
.toast {
  background: var(--material); color: var(--text); border: 0;
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  box-shadow: var(--shadow-tight); padding: 10px 18px; font-size: 14px; font-weight: 500;
  animation: kl-toast .38s var(--kl-ease) both;
}
.toast.is-error { color: var(--alarm); }
@keyframes kl-toast { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }

/* =====================================================================
   Anmeldung
   ===================================================================== */
.login-shell { min-height: 100vh; min-height: 100dvh; padding: 40px 20px calc(40px + var(--kl-safe-b)); }
.login-card { width: min(400px, 100%); display: block; background: transparent; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
.login-visual { display: none; }
.login-form-panel { padding: 0; text-align: center; }
.kl-login-icon { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 18px; box-shadow: 0 12px 28px -12px rgba(75, 73, 200, .75), inset 0 1px 0 rgba(255, 255, 255, .3); }
.login-form-panel .brandmark { font-size: 28px; font-weight: 700; letter-spacing: -.018em; margin-bottom: 4px; }
.login-form-panel .lede { color: var(--text-soft); margin-bottom: 24px; }
/* Tresor gesperrt */
#btnLockVault { display: inline-flex; align-items: center; gap: 6px; flex: none; }
@media (max-width: 820px) {
  body.kl-shell #btnLockVault { order: -3; width: 40px; padding: 0; justify-content: center; }
  #btnLockVault span { display: none; }
}
.kl-lock { display: grid; place-items: center; min-height: calc(100dvh - 160px); padding: 24px 20px; }
.kl-lock-card { width: min(380px, 100%); text-align: center; }
.kl-lock-card h2 { font-size: 24px; font-weight: 700; letter-spacing: -.015em; margin: 0 0 6px; }
.kl-lock-card > p { margin: 0 0 22px; line-height: 1.45; }
.kl-unlock { text-align: left; display: grid; gap: 10px; }
.kl-unlock .field { margin: 0; }
.kl-unlock .error-msg:empty { display: none; }
/* Benutzername und Passwort als gruppierte Liste */
#loginForm { text-align: left; }
#loginForm .field { margin: 0; background: var(--panel); display: flex; align-items: center; gap: 10px; padding: 0 16px; min-height: 50px; position: relative; }
#loginForm .field:first-child { border-radius: 12px 12px 0 0; }
#loginForm .field:nth-child(2) { border-radius: 0 0 12px 12px; }
#loginForm .field + .field::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--border); }
#loginForm .field label { width: 120px; flex: none; margin: 0; font-size: 15px; color: var(--text); }
#loginForm .field input { background: transparent; padding: 0; min-height: 48px; border-radius: 0; }
#loginForm .field input:focus { box-shadow: none; }
#loginForm .field:focus-within { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
#loginForm .btn-primary { margin-top: 16px; }
.login-form-panel .btn-block { min-height: 46px; border-radius: 12px; font-size: 16px; font-weight: 600; }
#btnPasskeyLogin { background: var(--accent-soft); color: var(--accent); }
.login-divider { margin: 18px 0; font-size: 13px; }
.login-divider::before, .login-divider::after { background: var(--border); height: .5px; }
.login-extension-link { margin-top: 18px; }
.login-extension-link .link-btn { color: var(--accent); font-size: 14px; }

/* =====================================================================
   Tresor
   ===================================================================== */
body.kl-shell .vault-layout { grid-template-columns: 230px minmax(0, 1fr); gap: 24px; }
.folder-sidebar { background: transparent; border: 0; box-shadow: none; padding: 4px 0; position: sticky; top: calc(var(--kl-toolbar) + 12px); max-height: calc(100dvh - var(--kl-toolbar) - 24px); overflow: auto; }
.folder-sidebar-head { padding: 0 6px 6px; }
.folder-sidebar-title { font-size: 13px; font-weight: 600; color: var(--text-soft); text-transform: none; letter-spacing: 0; }
.folder-row { border-radius: 8px; border: 0; min-height: 32px; font-size: 14px; }
.folder-row::before { display: none; }
@media (hover: hover) { .folder-row:hover { background: var(--fill); } }
.folder-row.is-active { background: var(--fill-2); color: var(--text); font-weight: 600; }
.folder-row-count { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.folder-row.is-drop-target { background: var(--accent-soft); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.folder-row-wrap.is-nested::before, .folder-row-wrap.is-nested::after { opacity: .5; }

.vault-main { background: transparent; border: 0; box-shadow: none; padding: 0; }
.vault-main-head { padding: 0 2px 12px; border: 0; }
.vault-main-title { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.vault-mode { background: var(--fill); border: 0; border-radius: 9px; padding: 2px; gap: 0; }
.vault-mode-btn { border: 0; border-radius: 7px; min-height: 28px; padding: 4px 14px; font-size: 13px; font-weight: 500; background: transparent; color: var(--text); transition: background-color .2s var(--kl-ease), box-shadow .2s ease; }
.vault-mode-btn.is-active, .vault-mode-btn[data-vault-mode="private"].is-active { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .04); }
[data-theme="dark"] .vault-mode-btn.is-active { background: #636366; }
.vault-mode-note { background: color-mix(in srgb, var(--private) 12%, transparent); color: var(--text); border: 0; border-radius: 10px; }

/* Einträge als gruppierte Liste */
.entry-list { background: var(--panel); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-card); border: 0; gap: 0; }
.entry-row { border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 12px 16px; position: relative; margin: 0; transition: background-color .12s ease; }
.entry-row + .entry-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--border); }
@media (hover: hover) { .entry-row:hover { background: color-mix(in srgb, var(--fill) 55%, transparent); transform: none; } }
.entry-name { font-weight: 600; font-size: 15px; }
.entry-url { color: var(--accent); font-size: 13px; }
.entry-secondary { color: var(--text-soft); font-size: 13.5px; gap: 6px 16px; }
.entry-totp-code { color: var(--accent); font-weight: 600; letter-spacing: .06em; }
.entry-actions .btn-icon { width: 34px; min-height: 34px; }
.empty-state { background: var(--panel); border: 0; border-radius: 12px; }

/* Generator im Formular */
.generator-trigger { border-radius: 8px; }
.generator-panel { background: var(--panel); border: 0; border-radius: 12px; box-shadow: var(--shadow-card); }
.gen-chip { border: 0; background: var(--fill); border-radius: 8px; }
.gen-chip:has(input:checked) { background: var(--accent-soft); color: var(--accent); }
.generator-preview-value input#genPreview { font-family: var(--font-mono); font-size: 16px; }

/* Verwaltung */
.admin-table-wrap { background: var(--panel); border: 0; border-radius: 12px; box-shadow: var(--shadow-card); }
.admin-table th { font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--text-soft); font-weight: 600; background: transparent; }
.admin-table th, .admin-table td { border-bottom: .5px solid var(--border); }
.role-pill { border: 0; background: var(--fill); color: var(--text-soft); border-radius: 10px; }

/* =====================================================================
   Übersicht
   ===================================================================== */
.st-hero { background: transparent; border: 0; padding: 14px 2px 22px; margin-bottom: 4px; align-items: flex-end; }
.st-hero h2 { font-size: 34px; font-weight: 700; letter-spacing: -.022em; line-height: 1.12; margin: 2px 0 4px; }
.st-eyebrow { text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 500; color: var(--text-soft); }
.st-grid { gap: 20px; }
.st-col { gap: 20px; }
.st-card { border: 0; border-radius: 12px; background: var(--panel); box-shadow: var(--shadow-card); padding: 16px 18px; }
.st-card h3 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.st-link, .st-more { font-weight: 500; font-size: 14px; }
.st-sprint-name { font-size: 22px; font-weight: 700; }
.st-progress { height: 8px; background: var(--fill); }
.st-progress span { background: var(--ok); }
.st-cat, .st-status { font-weight: 600; font-size: 12px; border-radius: 10px; }
.st-cat.c-done, .st-status.c-done { background: color-mix(in srgb, var(--ok) 16%, transparent); color: color-mix(in srgb, var(--ok) 70%, var(--text)); }
.st-row { border-radius: 8px; }
@media (hover: hover) { .st-row:hover { background: var(--fill); } }
.st-due.is-soon { color: var(--warn); }
.st-due.is-late { color: var(--alarm); }
.st-stack .c-done { background: var(--ok); }
.st-stack .c-indeterminate { background: var(--accent); }

/* =====================================================================
   Doku
   ===================================================================== */
body.kl-shell .documentation-page.dx-page { max-width: none; padding-bottom: 20px; }
body.kl-shell .dx-layout { height: calc(100vh - var(--kl-toolbar) - 32px); height: calc(100dvh - var(--kl-toolbar) - 32px); gap: 16px; grid-template-columns: 260px minmax(0, 1fr) 300px; }
.dx-panel { border: 0; border-radius: 12px; background: var(--panel); box-shadow: var(--shadow-card); }
.dx-panel-head { border-bottom: .5px solid var(--border); min-height: 52px; }
.dx-panel-head strong { font-size: 15px; font-weight: 650; }
.dx-panel-head-sub { border-top: .5px solid var(--border); }
.dx-row { border: 0; border-radius: 8px; font-size: 14px; min-height: 32px; }
@media (hover: hover) { .dx-row:hover { background: var(--fill); } }
.dx-row.is-selected { background: var(--accent); color: #fff; }
.dx-row.is-selected .dx-count, .dx-row.is-selected .dx-icon, .dx-row.is-selected .dx-twisty { color: rgba(255, 255, 255, .85); }
.dx-row.is-drop, .dx-file.is-drop { background: var(--accent-soft); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.dx-hint { font-size: 12px; color: var(--text-soft); border-top: .5px solid var(--border); }
.dx-file { border: 0; border-radius: 9px; }
@media (hover: hover) { .dx-file:hover { background: var(--fill); } }
.dx-file.is-selected { background: var(--accent); color: #fff; }
.dx-file.is-selected small, .dx-file.is-selected .dx-file-main small { color: rgba(255, 255, 255, .82); }
.dx-file.is-selected strong { color: #fff; }
.dx-title-input { font-size: 26px; font-weight: 700; letter-spacing: -.018em; border-radius: 8px; }
.dx-save-status { color: var(--text-soft); font-size: 13px; }
.dx-save-status.is-error { color: var(--alarm); }
.docs-rich-toolbar {
  border: 0; border-radius: 10px; background: var(--fill); padding: 4px; gap: 2px;
}
.docs-rich-toolbar button, .docs-rich-toolbar select { border: 0; border-radius: 7px; background: transparent; min-height: 30px; color: var(--text); transition: background-color .12s ease, transform .1s ease-out; }
@media (hover: hover) { .docs-rich-toolbar button:hover { background: var(--panel); } }
.docs-rich-toolbar button:active { transform: scale(.92); }
.docs-rich-editor { border: 0; background: transparent; font-size: 16px; line-height: 1.6; padding: 4px 2px; }
.docs-rich-editor:focus { box-shadow: none; outline: none; }
.docs-rich-editor h1, .docs-rich-editor h2, .docs-rich-editor h3 { font-family: var(--font-display); letter-spacing: -.012em; }
.docs-rich-editor table { border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 .5px var(--border); border: 0; }
.docs-rich-editor th { background: var(--fill); color: var(--text-soft); font-size: 13px; }
.docs-rich-editor th, .docs-rich-editor td { border-color: var(--border); }
.docs-rich-editor pre { background: var(--fill); border: 0; border-radius: 10px; }
.docs-rich-editor code { background: var(--fill); border-radius: 5px; }
.docs-rich-editor blockquote { border-left-color: var(--accent); }
.jira-ref { font-family: var(--font-sans); border: 0; background: var(--accent-soft); border-radius: 6px; }
.dx-attach { border: 0; background: var(--fill); border-radius: 9px; }
.dx-panel-files.is-drop { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.dx-history-item { border-radius: 9px; border: 0; }
.dx-history-item.is-selected { background: var(--accent); color: #fff; }
.dx-history-item.is-selected small { color: rgba(255, 255, 255, .8); }
.dx-picker-item { border-radius: 9px; }

/* =====================================================================
   Sprints
   ===================================================================== */
.jira-head { background: transparent; border: 0; box-shadow: none; padding: 14px 2px 18px; }
.jira-head h2 { font-size: 34px; font-weight: 700; letter-spacing: -.022em; line-height: 1.12; }
.jira-head p { color: var(--text-soft); }
.documentation-eyebrow { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; color: var(--text-soft); }
.jira-progress-bar { background: var(--fill); height: 8px; }
.jira-progress-bar span { background: var(--ok); }
.jira-sync-status { color: var(--text-soft); font-size: 13px; }
/* Ansichten als Segmentsteuerung */
.jira-tabs { background: var(--fill); border: 0; border-radius: 9px; padding: 2px; gap: 0; }
.jira-tab { border: 0; border-radius: 7px; min-height: 28px; padding: 4px 14px; font-size: 13px; font-weight: 500; background: transparent; color: var(--text); transition: background-color .2s var(--kl-ease), box-shadow .2s ease, transform .1s ease-out; }
.jira-tab:active { transform: scale(.96); }
.jira-tab.is-active { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .04); }
[data-theme="dark"] .jira-tab.is-active { background: #636366; }
.jira-filterbar { background: transparent; border: 0; padding: 0; gap: 8px; }
.jira-filterbar-label { text-transform: none; letter-spacing: 0; color: var(--text-soft); font-weight: 500; }
.jira-filterbar select { border-radius: 16px; min-height: 32px; padding: 0 28px 0 12px; font-size: 13px; background-color: var(--panel); box-shadow: var(--shadow-card); }
.jira-notice { border: 0; border-radius: 12px; background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--text); }
.jira-notice.is-error { background: color-mix(in srgb, var(--alarm) 12%, transparent); }
/* Board */
.jira-board { gap: 16px; }
.jira-col { background: var(--fill); border: 0; border-radius: 14px; transition: background-color .15s ease, box-shadow .15s ease; }
.jira-col.is-over { background: var(--accent-soft); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.jira-col-head { font-size: 14px; font-weight: 650; border: 0; text-transform: none; letter-spacing: 0; }
.jira-col-head span { color: var(--text-soft); background: transparent; font-weight: 500; }
.jira-card { border: 0; border-radius: 11px; background: var(--panel); box-shadow: var(--shadow-card); transition: box-shadow .2s ease, transform .2s var(--kl-ease); }
@media (hover: hover) { .jira-card:hover { transform: translateY(-1px); box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .2), 0 0 0 .5px rgba(0, 0, 0, .05); border-color: transparent; } }
.jira-card.is-dragging { opacity: .55; transform: scale(.98); }
.jira-card-title { font-weight: 500; }
.jira-key { font-family: var(--font-sans); color: var(--text-soft); font-weight: 500; }
.jira-pts { background: var(--fill); color: var(--text-soft); border: 0; border-radius: 10px; }
.jira-status { border: 0; border-radius: 10px; font-weight: 600; }
.jira-status.c-done { background: color-mix(in srgb, var(--ok) 16%, transparent); color: color-mix(in srgb, var(--ok) 70%, var(--text)); }
.jira-status.c-indeterminate { background: var(--accent-soft); color: var(--accent); }
.jira-type.t-story { background: var(--ok); }
.jira-type.t-bug { background: var(--alarm); }
/* Backlog als gruppierte Liste */
.jira-sprint { border: 0; border-radius: 12px; background: var(--panel); box-shadow: var(--shadow-card); }
.jira-sprint-head { border-bottom: .5px solid var(--border); }
.jira-state { border: 0; border-radius: 10px; font-weight: 600; }
.jira-state.s-active { background: color-mix(in srgb, var(--ok) 16%, transparent); color: color-mix(in srgb, var(--ok) 70%, var(--text)); }
.jira-row { border: 0; border-radius: 0; }
.jira-row + .jira-row { box-shadow: 0 -.5px 0 var(--border); }
@media (hover: hover) { .jira-row:hover { background: color-mix(in srgb, var(--fill) 55%, transparent); } }
.jira-comment { border: 0; background: var(--fill); border-radius: 14px; border-top-left-radius: 4px; }
.jira-side { background: var(--panel); border: 0; border-radius: 12px; padding: 14px; align-self: start; min-width: 0; }
/* Die Knöpfe stehen in der Spalte, nicht als Leiste am unteren Rand des Fensters */
.jira-side .modal-actions { position: static; margin: 4px 0 0; padding: 0; background: none; }
.jira-side .modal-actions .btn { flex: 1; }
.jira-side .jira-inline-form { min-width: 0; }
.jira-side .jira-inline-form input { flex: 1; width: auto; min-width: 0; }
.jira-subtask { border-radius: 8px; border: 0; }

/* =====================================================================
   Tablet: Seitenleiste schmal, nur Symbole
   ===================================================================== */
@media (max-width: 1180px) and (min-width: 821px) {
  :root { --kl-sidebar: 72px; }
  .kl-brand span:last-child, .kl-nav-item span, .kl-me-text { display: none; }
  .kl-nav-heading { font-size: 0; padding: 0; margin: 0 14px 6px; border-top: .5px solid var(--border); }
  .kl-brand { justify-content: center; padding: 4px 0 16px; }
  .kl-nav-item { justify-content: center; padding: 0; height: 44px; }
  .kl-nav-item svg { width: 22px; height: 22px; }
  .kl-me { justify-content: center; padding: 8px 0; }
  .search-trigger { width: auto; }
  .search-trigger span, .search-trigger kbd { display: none; }
  body.kl-shell .search-field { width: 200px; }
  body.kl-shell .dx-layout { grid-template-columns: 220px minmax(0, 1fr) 250px; }
}

/* =====================================================================
   Handy: Tableiste unten, Blätter von unten, große Tippflächen
   ===================================================================== */
@media (max-width: 820px) {
  :root { --kl-toolbar: 52px; }
  body.kl-shell #app { padding-left: 0; padding-bottom: calc(var(--kl-tabbar) + var(--kl-safe-b) + 16px); }
  body.kl-shell .kl-sidebar { display: none; }
  body.kl-shell .kl-tabbar {
    display: flex; position: fixed; z-index: 45; left: 0; right: 0; bottom: 0;
    padding: 2px 4px var(--kl-safe-b);
    min-height: calc(var(--kl-tabbar) - 8px);
    background: var(--material-heavy);
    -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
    border-top: .5px solid var(--border);
  }
  body.kl-shell .app-header, body.kl-shell.page-wide .app-header { padding: 6px 12px; padding-top: max(6px, env(safe-area-inset-top)); gap: 8px; flex-wrap: nowrap; }
  body.kl-shell .header-controls { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 2px; }
  body.kl-shell .header-controls::-webkit-scrollbar { display: none; }
  .search-trigger { width: 38px; padding: 0; justify-content: center; flex: none; }
  .search-trigger span, .search-trigger kbd { display: none; }
  body.kl-shell .search-field { width: 150px; flex: none; }
  .jira-sync-status { display: none; }
  body.kl-shell .app-shell, body.kl-shell.page-wide .app-shell, body.kl-shell .admin-shell, body.kl-shell.page-wide .admin-shell,
  body.kl-shell .st-page, body.kl-shell .if-page, body.kl-shell .jira-page, body.kl-shell .documentation-page.dx-page { padding: 8px 14px 24px; }

  /* Tippflächen nach Apple mindestens 44 px, Eingaben 16 px gegen das Zoomen in iOS */
  .btn { min-height: 40px; }
  .btn-icon { width: 40px; min-height: 40px; }
  .field input, .field textarea, .field select, .search-field input, .jira-filters select, .jira-filters input, .jira-inline-select, .jira-filterbar select, .dx-search input, .jira-inline-form input, .search-input-row input, #loginForm .field input { font-size: 16px; }
  .context-menu-item { min-height: 44px; }
  .folder-row, .dx-row { min-height: 40px; }

  /* Dialoge als Blatt von unten */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal, .modal.modal-wide, .modal.dx-modal, .modal.dx-modal.is-wide, .modal.jira-modal, .modal.jira-modal.is-wide {
    width: 100%; max-width: none; max-height: 92vh; max-height: 92dvh;
    border-radius: 16px 16px 0 0; padding: 10px 18px calc(20px + var(--kl-safe-b));
  }
  .modal::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 0 auto 12px; }
  .modal-overlay:not([hidden]) .modal { animation: kl-sheet-up .4s var(--kl-ease) both; }
  .modal-actions { position: sticky; bottom: calc(-20px - var(--kl-safe-b)); background: var(--bg); padding: 12px 0 calc(8px + var(--kl-safe-b)); margin-bottom: calc(-20px - var(--kl-safe-b)); flex-wrap: wrap; }
  .modal-actions .btn { flex: 1; }
  .search-overlay { padding: 8px 8px 0; padding-top: max(8px, env(safe-area-inset-top)); }
  .search-dialog { max-height: 80dvh; }
  .toast-region { bottom: calc(var(--kl-tabbar) + var(--kl-safe-b) + 12px); }

  /* Übersicht */
  .st-hero { padding: 6px 2px 16px; }
  .st-hero h2 { font-size: 28px; }
  .st-actions { width: 100%; }
  .st-actions .btn { flex: 1; }

  /* Tresor */
  body.kl-shell .vault-layout { grid-template-columns: minmax(0, 1fr); }
  .vault-main-title { font-size: 26px; }
  .entry-row { padding: 12px 14px; }
  .entry-actions { opacity: 1; flex-wrap: wrap; }

  /* Doku: Ordner und Dateien oben kompakt, Text darunter */
  body.kl-shell .dx-layout { height: auto; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .dx-panel-tree, .dx-panel-files { max-height: 300px; }
  .dx-panel-editor { min-height: 70vh; }
  .dx-panel-editor.docs-page-editor { padding: 14px; }
  .dx-title-input { font-size: 22px; }
  .docs-rich-toolbar { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .dx-head-actions { flex-wrap: wrap; }

  /* Sprints: Spalten zum Wischen */
  .jira-head h2 { font-size: 28px; }
  .jira-head-actions { width: 100%; }
  .jira-head-actions .btn { flex: 1; }
  .jira-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .jira-tabs { overflow-x: auto; scrollbar-width: none; }
  .jira-tab { white-space: nowrap; flex: 1; }
  .jira-filterbar { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; padding-bottom: 4px; }
  .jira-filterbar select { flex: none; }
  .jira-board { display: grid; grid-auto-flow: column; grid-auto-columns: 86%; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -14px; padding: 0 14px 8px; scroll-padding: 0 14px; }
  .jira-col { scroll-snap-align: start; }
}

/* Sehr kleine Handys */
@media (max-width: 380px) {
  .kl-tab { font-size: 9.5px; }
  .kl-tab svg { width: 22px; height: 22px; }
  .st-hero h2, .jira-head h2 { font-size: 25px; }
}

/* Querformat am Handy: weniger Höhe für die Leisten */
@media (max-width: 920px) and (max-height: 500px) and (orientation: landscape) {
  :root { --kl-tabbar: 52px; }
  .kl-tab span { display: none; }
}

/* =====================================================================
   Rücksicht auf Einstellungen des Geräts
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  .modal-overlay:not([hidden]) .modal, .context-menu:not([hidden]), .search-overlay:not([hidden]) .search-dialog, .toast { animation: kl-fade .2s ease both !important; }
  .btn:active, .kl-nav-item:active, .kl-tab:active, .jira-tab:active { transform: none; }
  .jira-card, .jira-card:hover { transform: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .kl-sidebar, .app-header, .kl-tabbar, .context-menu, .search-dialog, .toast { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: var(--panel) !important; }
}
@media (prefers-contrast: more) {
  :root { --border: rgba(0, 0, 0, .45); --text-soft: #3A3A3C; }
  [data-theme="dark"] { --border: rgba(255, 255, 255, .5); --text-soft: #C7C7CC; }
  .st-card, .dx-panel, .entry-list, .jira-card, .jira-sprint, .modal, .context-menu { box-shadow: 0 0 0 1px var(--border); }
}
@media print {
  .kl-sidebar, .kl-tabbar, .app-header { display: none !important; }
  body.kl-shell #app { padding: 0 !important; }
}

/* ---------- Nachbesserungen nach dem ersten Test ---------- */
body.kl-shell .search-field input { width: 100%; max-width: none; padding-left: 12px; }
.vault-main-head { background: none; border: 0; box-shadow: none; padding: 0 2px 12px; margin: 0; }
.vault-main-head::before, .vault-main-head::after { display: none; }
.entry-username { background: none; border: 0; padding: 0; color: var(--text); font-family: var(--font-sans); }
.entry-secondary .mono { font-family: var(--font-mono); }
/* Auf Touchgeräten gibt es kein Überfahren, die Aktionen sind immer sichtbar */
@media (hover: none) { .entry-actions { opacity: 1; pointer-events: auto; } }

/* Bezeichnungen in normaler Schreibweise statt Großbuchstaben */
.search-group, .jira-col-head, .jira-state, .jira-side label, .jira-section-title, .jira-filterbar-label {
  text-transform: none; letter-spacing: 0;
}
.search-group { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.jira-side label, .jira-section-title { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.jira-state { font-size: 12px; }

/* Knopftexte bleiben einzeilig */
.btn, .jira-tab, .vault-mode-btn { white-space: nowrap; }

/* Werkzeugleiste: immer eine Zeile, Steuerelemente rechts daneben und bei Bedarf waagrecht wischbar */
body.kl-shell .app-header, body.kl-shell.page-wide .app-header { flex-direction: row; align-items: center; flex-wrap: nowrap; text-align: left; }
body.kl-shell .brand-group { min-width: 0; flex: none; }
body.kl-shell .header-controls { width: auto; flex: 1 1 auto; justify-content: flex-end; flex-wrap: nowrap; }
body.kl-shell .header-controls > * { flex: none; }
@media (max-width: 820px) {
  body.kl-shell .header-controls { justify-content: flex-start; min-width: 0; }
  body.kl-shell .header-controls > .search-trigger { order: -1; }
  .kl-toolbar-title, body.kl-shell .brand-group .brandmark { font-size: 17px; }
  body.kl-shell .header-controls .btn { min-height: 36px; padding: 6px 12px; }
  body.kl-shell .header-controls .search-trigger { width: 36px; padding: 0; }
}
@media (max-width: 820px) {
  body.kl-shell .header-controls > #btnNew { order: -2; }
  .dx-panel-editor:has(> .docs-empty) { min-height: 180px; }
}

/* Verwaltung: Kopf ohne Kasten, wie ein großer Titel */
.admin-head { background: transparent; border: 0; box-shadow: none; padding: 14px 2px 18px; }
.admin-head-title h2 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.admin-head-title p { color: var(--text-soft); }
/* Ordner Schublade auf dem Handy als Material */
.folder-drawer-panel { background: var(--bg); box-shadow: var(--shadow); }
.dx-jira-pop { border: 0; border-radius: 12px; background: var(--material); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); }
@media (max-width: 820px) {
  .admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* =====================================================================
   Einstellungen (eigene Seite wie im Entwurf)
   ===================================================================== */
.kl-me.is-current { background: var(--fill-2); }
.kl-settings { max-width: 720px; padding: 12px 28px 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.kl-large-title { font-size: 34px; font-weight: 700; letter-spacing: -.022em; line-height: 1.12; margin: 6px 2px -6px; }
.kl-group { background: var(--panel); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-card); }
.kl-group-title { display: flex; align-items: baseline; gap: 8px; font-size: 15px; font-weight: 600; margin: 0 0 8px 4px; }
.kl-title-link { margin-left: auto; font-weight: 500; font-size: 14px; }
.kl-group-foot { font-size: 13px; color: var(--text-soft); margin: 8px 16px 0; line-height: 1.45; }
.kl-soft { color: var(--text-soft); }
.kl-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 9px 16px; position: relative; border: 0; background: transparent; color: var(--text); text-align: left; font: inherit; font-size: 15px; }
.kl-row + .kl-row::before, #passkeyRows + .kl-row::before, #aiRows + .kl-row::before, .kl-row + #passkeyRows > .kl-row:first-child::before,
#passkeyRows > .kl-row + .kl-row::before, #aiRows > .kl-row + .kl-row::before, #teamRows > .kl-row + .kl-row::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--border);
}
button.kl-row, a.kl-row { cursor: pointer; transition: background-color .12s ease; }
button.kl-row:active, a.kl-row:active { background: var(--fill); }
@media (hover: hover) { button.kl-row:hover, a.kl-row:hover { background: color-mix(in srgb, var(--fill) 55%, transparent); } }
.kl-row-main { flex: 1; min-width: 0; }
.kl-row-main small { display: block; font-size: 13px; color: var(--text-soft); margin-top: 1px; overflow-wrap: anywhere; }
.kl-row-action { color: var(--accent); }
.kl-row-action svg { flex: none; }
.kl-row-danger { justify-content: center; color: var(--alarm); font-weight: 500; }
.kl-row-wrap { flex-wrap: wrap; }
.kl-chev { color: var(--text-soft); opacity: .6; flex: none; }
.kl-tile { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.kl-profile { display: flex; align-items: center; gap: 16px; padding: 16px; }
.kl-avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.kl-profile-name { font-size: 21px; font-weight: 700; letter-spacing: -.012em; }
.kl-row .btn-danger { min-height: 30px; padding: 4px 10px; font-size: 14px; }
.kl-switch { position: relative; flex: none; width: 51px; height: 31px; margin-left: auto; border: 0; border-radius: 999px; background: var(--fill); cursor: pointer; transition: background-color .18s ease; }
.kl-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .22); transition: transform .18s ease; }
.kl-switch[aria-checked="true"] { background: #34C759; }
.kl-switch[aria-checked="true"]::after { transform: translateX(20px); }
@media (prefers-reduced-motion: reduce) { .kl-switch, .kl-switch::after { transition: none; } }
.kl-seg { display: inline-flex; padding: 2px; background: var(--fill); border-radius: 9px; margin-left: auto; }
.kl-seg button { border: 0; background: transparent; padding: 5px 14px; border-radius: 7px; font: 500 13px/1.2 var(--font-sans); color: var(--text); cursor: pointer; transition: background-color .2s var(--kl-ease), box-shadow .2s ease, transform .1s ease-out; }
.kl-seg button:active { transform: scale(.96); }
.kl-seg button[aria-checked="true"] { background: var(--panel); box-shadow: 0 1px 3px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .04); }
[data-theme="dark"] .kl-seg button[aria-checked="true"] { background: #636366; }
@media (max-width: 820px) {
  .kl-settings { padding: 8px 14px 24px; gap: 24px; }
  .kl-large-title { font-size: 30px; }
  .kl-row { min-height: 50px; }
  .kl-seg button { padding: 7px 12px; }
}

/* =====================================================================
   Doku: Mischung aus bisheriger Seite und Entwurf
   Ordnerbaum links (wie bisher), Dokumentliste wie Notizen in der Mitte,
   rechts der Text mit Formatleiste oben und großem Titel (wie im Entwurf)
   ===================================================================== */
body.kl-shell .dx-layout { grid-template-columns: 240px 300px minmax(0, 1fr); }
.dx-panel-editor.docs-page-editor { padding: 0; overflow: auto; display: block; }
/* Dateien (Office, PDF, Bilder): Die Ansicht füllt die Spalte, sonst bleibt der Rahmen bei 150 px stehen */
.dx-panel-editor.docs-page-editor:has(> .dx-viewer) { display: flex; flex-direction: column; overflow: hidden; }
.dx-panel-editor.docs-page-editor > .dx-viewer { min-height: 320px; }
.dx-panel-editor .docs-empty { min-height: 100%; display: grid; place-content: center; text-align: center; padding: 40px 20px; }
.dx-editor-bar {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  margin: 0; padding: 8px 14px; border-radius: 0;
  background: var(--material);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border-bottom: .5px solid var(--border);
}
.dx-editor-bar button, .dx-editor-bar select { min-width: 32px; min-height: 32px; display: inline-grid; place-items: center; padding: 0 8px; }
.dx-editor-bar select { padding: 0 6px; font-size: 14px; }
.dx-bar-sep { width: .5px; height: 20px; background: var(--border-strong); margin: 0 6px; }
.dx-editor-bar .dx-save-status { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; white-space: nowrap; }
.dx-save-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.dx-save-status.is-saving::before { background: var(--warn); }
.dx-save-status.is-error::before { background: var(--alarm); }
.dx-history-btn { border: 0; border-radius: 7px; background: transparent; color: var(--text); cursor: pointer; }
@media (hover: hover) { .dx-history-btn:hover { background: var(--fill); } }
.dx-doc-page { max-width: 820px; margin: 0 auto; padding: 18px 36px 40px; }
.dx-doc-page .dx-editor-crumbs { margin-bottom: 4px; }
.dx-doc-page .dx-title-input { width: 100%; font-size: 32px; font-weight: 700; letter-spacing: -.022em; border: 0; background: transparent; padding: 2px 0; color: var(--text); }
.dx-doc-page .dx-title-input:focus { outline: none; box-shadow: none; }
.dx-doc-page .dx-editor-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 18px; font-size: 13px; color: var(--text-soft); }
.dx-meta-who { margin-right: auto; }
.dx-doc-page .dx-editor-meta label { font-size: 13px; color: var(--text-soft); }
.dx-doc-page .dx-editor-meta select { border: 0; background: var(--fill); border-radius: 7px; min-height: 28px; font-size: 13px; padding: 2px 8px; color: var(--text); }
.dx-doc-page .docs-rich-editor { min-height: 50vh; }
.dx-doc-page .docs-editor-actions { margin-top: 28px; padding-top: 14px; border-top: .5px solid var(--border); display: flex; justify-content: flex-end; }
/* Dateiansicht (PDF, Word …) im rechten Bereich */
.dx-panel-editor > .dx-editor-crumbs, .dx-panel-editor > .dx-file-head, .dx-panel-editor > .dx-editor-meta, .dx-panel-editor > .dx-viewer { margin-left: 22px; margin-right: 22px; }
.dx-panel-editor > .dx-editor-crumbs { margin-top: 16px; }
.dx-panel-editor > .dx-viewer { margin-bottom: 18px; }

/* Dokumentliste wie Notizen */
.dx-files { padding: 4px 8px 8px; }
.dx-note { display: block; padding: 10px 12px; border-radius: 9px; position: relative; }
.dx-note + .dx-note::before { content: ""; position: absolute; top: 0; left: 12px; right: 12px; height: .5px; background: var(--border); }
.dx-note.is-selected::before, .dx-note.is-selected + .dx-note::before { display: none; }
.dx-note .dx-file-main { display: block; min-width: 0; }
.dx-note strong { display: block; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-note small { display: block; font-size: 13px; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.dx-note small time { color: var(--text); margin-right: 8px; font-variant-numeric: tabular-nums; }
.dx-note.is-selected small, .dx-note.is-selected small time { color: rgba(255, 255, 255, .85); }

@media (max-width: 1180px) and (min-width: 821px) {
  body.kl-shell .dx-layout { grid-template-columns: 210px 250px minmax(0, 1fr); }
  .dx-doc-page { padding: 14px 22px 32px; }
}
@media (max-width: 820px) {
  body.kl-shell .dx-layout { grid-template-columns: minmax(0, 1fr); }
  .dx-panel-tree { max-height: 240px; }
  .dx-panel-files { max-height: 340px; }
  .dx-panel-editor.docs-page-editor { padding: 0; min-height: 70vh; overflow: visible; }
  .dx-panel-editor.docs-page-editor:has(> .dx-viewer) { overflow: visible; }
  .dx-panel-editor.docs-page-editor > .dx-viewer { min-height: 70vh; }
  .dx-editor-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; top: var(--kl-toolbar); border-radius: 12px 12px 0 0; }
  .dx-editor-bar::-webkit-scrollbar { display: none; }
  .dx-editor-bar button, .dx-editor-bar select { min-width: 40px; min-height: 40px; flex: none; }
  .dx-doc-page { padding: 12px 16px 24px; }
  .dx-doc-page .dx-title-input { font-size: 26px; }
}
.dx-editor-bar select { width: auto; max-width: 150px; flex: none; }
.dx-doc-page .dx-editor-meta select { width: auto; max-width: 260px; }
.dx-doc-page .docs-rich-editor { padding: 0; }
.dx-doc-page .dx-editor-crumbs { padding: 0; }
/* Status und Verlauf in der Metazeile, damit die Formatleiste einzeilig bleibt */
.dx-editor-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.dx-editor-bar::-webkit-scrollbar { display: none; }
.dx-editor-bar button { min-width: 30px; padding: 0 6px; flex: none; }
.dx-editor-bar select { max-width: 120px; }
.dx-doc-page .dx-editor-meta { row-gap: 6px; }
.dx-doc-page .dx-save-status { margin-left: 0; display: inline-flex; align-items: center; gap: 6px; }
.dx-doc-page .dx-history-btn { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 0 8px; font: inherit; color: var(--accent); }
.dx-meta-folder { display: inline-flex; align-items: center; gap: 6px; }
.kl-row-wrap .kl-row-main { flex: 1 0 auto; }
/* Handy: Dokumentliste in voller Länge (kein Scrollen im Kasten), leerer Editor ausgeblendet */
@media (max-width: 820px) {
  .dx-panel-files { max-height: none; }
  .dx-panel-files .dx-files { overflow: visible; }
  .dx-panel-editor.docs-page-editor:has(> .docs-empty) { display: none; }
  .dx-panel-editor.docs-page-editor { scroll-margin-top: calc(var(--kl-toolbar) + 8px); }
}

/* =====================================================================
   Einklappen für mehr Platz (Laptop): Seitenleiste auf Symbole,
   Ordnerspalte der Doku auf einen schmalen Streifen
   ===================================================================== */
.kl-side-toggle, .dx-tree-toggle {
  display: none; flex: none; width: 32px; height: 32px; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-soft); cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
}
@media (hover: hover) { .kl-side-toggle:hover, .dx-tree-toggle:hover { background: var(--fill); color: var(--text); } }
.kl-side-toggle:active, .dx-tree-toggle:active { transform: scale(.94); }
.kl-side-toggle[aria-pressed="true"] { color: var(--accent); }

@media (min-width: 1181px) {
  body.kl-shell .kl-side-toggle { display: inline-grid; margin-left: -6px; }
  body.kl-shell .kl-sidebar { transition: width .22s var(--kl-ease); }
  body.kl-shell #app { transition: padding-left .22s var(--kl-ease); }
  html.kl-side-collapsed { --kl-sidebar: 72px; }
  html.kl-side-collapsed .kl-brand span:last-child, html.kl-side-collapsed .kl-nav-item span, html.kl-side-collapsed .kl-me-text { display: none; }
  html.kl-side-collapsed .kl-nav-heading { font-size: 0; padding: 0; margin: 0 14px 6px; border-top: .5px solid var(--border); }
  html.kl-side-collapsed .kl-brand { justify-content: center; padding: 4px 0 16px; }
  html.kl-side-collapsed .kl-nav-item { justify-content: center; padding: 0; height: 44px; }
  html.kl-side-collapsed .kl-nav-item svg { width: 22px; height: 22px; }
  html.kl-side-collapsed .kl-me { justify-content: center; padding: 8px 0; }
}

@media (min-width: 821px) {
  .dx-tree-toggle { display: inline-grid; margin-left: -6px; }
  .dx-panel-tree .dx-panel-head strong { margin-right: auto; }
  body.kl-shell .dx-layout { transition: grid-template-columns .22s var(--kl-ease); }
  body.kl-shell .dx-layout.is-tree-collapsed { grid-template-columns: 52px 300px minmax(0, 1fr); }
  .dx-layout.is-tree-collapsed .dx-panel-tree { overflow: hidden; }
  .dx-layout.is-tree-collapsed .dx-panel-tree .dx-panel-head { justify-content: center; padding: 0; border-bottom: 0; }
  .dx-layout.is-tree-collapsed .dx-tree-toggle { margin: 0; color: var(--accent); }
  .dx-layout.is-tree-collapsed .dx-panel-tree .dx-panel-head strong,
  .dx-layout.is-tree-collapsed #btnDxNewFolder,
  .dx-layout.is-tree-collapsed .dx-tree,
  .dx-layout.is-tree-collapsed .dx-hint { display: none; }
}
@media (max-width: 1180px) and (min-width: 821px) {
  body.kl-shell .dx-layout.is-tree-collapsed { grid-template-columns: 52px 250px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  body.kl-shell .kl-sidebar, body.kl-shell #app, body.kl-shell .dx-layout { transition: none; }
}

/* Der Zähler bleibt sichtbar, auch wenn die Beschriftung ausgeblendet ist */
.kl-nav-item span.kl-badge:not([hidden]), .kl-tab span.kl-badge:not([hidden]) { display: block !important; }

/* Liste aller Bereiche unter „Mehr“, nur am Handy (dort fehlen sie in der Tableiste) */
.kl-only-phone { display: none; }
.kl-tile-nav { background: var(--accent); color: #fff; }
.kl-tile-nav svg { width: 16px; height: 16px; }
@media (max-width: 820px) { .kl-only-phone { display: block; } }
