/* Selbst gehostete Schriften (SIL Open Font License 1.1, siehe OFL.txt) – keine Anfragen an Google. */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('/fonts/bricolage-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('/fonts/bricolage-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/geist-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/geist-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/geist-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/geist-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* =====================================================================
   URLS – Oberfläche (Entwurf C: Layout mit Index + Rangliste,
   Material mit kühlem Papier, weißen Karten und Kobalt-Akzent)
   ===================================================================== */
:root {
  color-scheme: light;
  --bg:     oklch(0.965 0.008 255);
  --card:   oklch(1 0 0);
  --sunk:   oklch(0.94 0.011 255);
  --line:   oklch(0.9 0.012 255);
  --fg:     oklch(0.23 0.025 262);
  --muted:  oklch(0.47 0.025 262);
  --faint:  oklch(0.52 0.02 262);   /* ≥ 4,6:1 auf --bg, --card und --sunk */
  --field-line: oklch(0.65 0.015 258); /* Rahmen von Eingabefeldern, ≥ 3:1 */
  --accent: oklch(0.5 0.2 264);
  --on-accent: oklch(0.99 0 0);
  --danger: oklch(0.53 0.2 25);
  --shadow: 0 1px 2px oklch(0.3 0.03 262 / 0.07), 0 6px 20px oklch(0.3 0.03 262 / 0.06);
  --lift:   0 12px 34px oklch(0.3 0.03 262 / 0.15);
  --backdrop: oklch(0.2 0.03 262 / 0.35);
  --tile-l: 0.93; --tile-c: 0.05; --ink-l: 0.36; --ink-c: 0.12; --chip-l: 0.62;

  --f-display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --f-body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: oklch(0.19 0.016 262); --card: oklch(0.235 0.018 262); --sunk: oklch(0.27 0.02 262);
    --line: oklch(0.31 0.02 262); --fg: oklch(0.95 0.008 262); --muted: oklch(0.76 0.02 262); --faint: oklch(0.66 0.02 262);
    --accent: oklch(0.74 0.14 262); --on-accent: oklch(0.18 0.03 262); --danger: oklch(0.72 0.16 25); --field-line: oklch(0.55 0.02 262);
    --shadow: 0 1px 2px oklch(0 0 0 / 0.3); --lift: 0 12px 34px oklch(0 0 0 / 0.5); --backdrop: oklch(0.1 0.02 262 / 0.6);
    --tile-l: 0.34; --tile-c: 0.06; --ink-l: 0.9; --ink-c: 0.08; --chip-l: 0.7;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: oklch(0.19 0.016 262); --card: oklch(0.235 0.018 262); --sunk: oklch(0.27 0.02 262);
  --line: oklch(0.31 0.02 262); --fg: oklch(0.95 0.008 262); --muted: oklch(0.76 0.02 262); --faint: oklch(0.66 0.02 262);
  --accent: oklch(0.74 0.14 262); --on-accent: oklch(0.18 0.03 262); --danger: oklch(0.72 0.16 25); --field-line: oklch(0.55 0.02 262);
  --shadow: 0 1px 2px oklch(0 0 0 / 0.3); --lift: 0 12px 34px oklch(0 0 0 / 0.5); --backdrop: oklch(0.1 0.02 262 / 0.6);
  --tile-l: 0.34; --tile-c: 0.06; --ink-l: 0.9; --ink-c: 0.08; --chip-l: 0.7;
}

*, *::before, *::after { box-sizing: border-box; }
html { padding-block: env(safe-area-inset-top, 0px) env(safe-area-inset-bottom, 0px); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--fg); font: 400 15px/1.45 var(--f-body); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.skip { position: absolute; left: 16px; top: -60px; z-index: 30; background: var(--accent); color: var(--on-accent); padding: 10px 14px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 12px); }

/* ---- Gerüst ---------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; max-width: 1160px; margin-inline: auto; padding-block: 28px 96px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.rail { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 28px); align-self: start; display: flex; flex-direction: column; gap: 22px; max-height: calc(100dvh - 56px); }
.brand { display: flex; align-items: center; justify-content: space-between; }
.wordmark { font: 800 26px/1 var(--f-display); letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.wordmark svg { color: var(--accent); }
.brand-actions { display: flex; gap: 8px; }
.icon-btn { inline-size: 40px; block-size: 40px; flex: none; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; padding: 0; }
.icon-btn:hover { border-color: var(--muted); }
#themeBtn .i-sun { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #themeBtn .i-sun { display: block; } :root:not([data-theme="light"]) #themeBtn .i-moon { display: none; } }
:root[data-theme="dark"] #themeBtn .i-sun { display: block; }
:root[data-theme="dark"] #themeBtn .i-moon { display: none; }

.nav-wrap, nav { min-height: 0; }
.index { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 2px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); max-height: 52dvh; overflow-y: auto; scrollbar-width: thin; }
.index a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; text-decoration: none; font-weight: 500; color: var(--muted); }
.index a > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.index a:hover { background: var(--sunk); color: var(--fg); }
.index a.is-active { background: var(--sunk); color: var(--fg); font-weight: 600; }
.chip { width: 10px; height: 10px; border-radius: 3px; flex: none; background: oklch(var(--chip-l) 0.16 var(--h, 264)); }
.chip.none { background: var(--line); }
.index .n { font: 500 12.5px/1 var(--f-mono); color: var(--faint); font-variant-numeric: tabular-nums; }
.btn-new { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 0; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 600; cursor: pointer; padding-inline: 16px; }
.btn-new:hover { filter: brightness(1.06); }
.btn-new.compact { width: 40px; min-height: 40px; padding: 0; }
.rail-foot { font-size: 13px; color: var(--faint); display: flex; flex-direction: column; gap: 8px; padding-inline: 4px; }
.foot-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.foot-actions form { display: contents; }
.link-btn { border: 0; background: none; padding: 2px 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 13px; }
.link-btn:hover { color: var(--fg); }
.keys { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.keys > span { white-space: nowrap; display: inline-flex; gap: 3px; align-items: center; }
kbd { font: 500 12px/1 var(--f-mono); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--line); border-bottom-width: 2px; color: var(--muted); background: var(--card); }

/* ---- Suche ----------------------------------------------------------- */
.search { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 12px); z-index: 5; display: flex; align-items: center; gap: 12px; height: 54px; padding-inline: 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent) 18%, transparent), var(--shadow); }
.search > svg { flex: none; color: var(--faint); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--fg); font: 500 17px/1 var(--f-body); }
.search input::placeholder { color: var(--faint); }
.search .hint { font-size: 13px; color: var(--faint); white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.search .data-mobile { display: none; }

/* ---- Kategorien und Zeilen ------------------------------------------ */
.main { min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.cats { display: flex; flex-direction: column; gap: 32px; }
.cat { scroll-margin-top: 96px; display: flex; flex-direction: column; gap: 10px; }
.cat-head { display: flex; align-items: center; gap: 10px; padding-inline: 6px; min-width: 0; }
.cat-head .chip { width: 12px; height: 12px; border-radius: 4px; }
.cat-head h2 { margin: 0; font: 700 24px/1.1 var(--f-display); letter-spacing: -0.015em; text-wrap: balance; min-width: 0; overflow-wrap: anywhere; }
.cat-head .meta { font: 500 13px/1 var(--f-mono); color: var(--faint); white-space: nowrap; }
.cat-head .spacer { flex: 1; }
.ghost { border: 0; background: none; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; padding: 8px; border-radius: 9px; }
.ghost:hover, .ghost:focus-visible { color: var(--fg); background: var(--card); }
.collapse svg { transition: rotate .2s; }
.cat[data-collapsed] .collapse svg { rotate: -90deg; }
.cat[data-collapsed] .rows { display: none; }

.rows { list-style: none; margin: 0; padding: 6px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); container-type: inline-size; min-height: 20px; }
.rows:empty::after { content: "Noch leer. Über das Menü der Kategorie einen Eintrag hinzufügen."; display: block; padding: 12px 10px; color: var(--faint); font-size: 14px; }
.row { position: relative; }
.row:not([hidden]) ~ .row:not([hidden])::before { content: ""; position: absolute; inset: 0 12px auto 92px; border-top: 1px solid var(--line); pointer-events: none; }
.divider + .row::before { display: none !important; }
.row:not([hidden]):has(.row-link:hover, :focus-visible)::before, .row:not([hidden]):has(.row-link:hover, :focus-visible) + .row::before { opacity: 0; }
.row-link { display: grid; grid-template-columns: 26px 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 52px; padding: 8px 92px 8px 8px; text-decoration: none; border-radius: 10px; }
.row-link:hover, .row-link:focus-visible { background: var(--sunk); }
.row-link:focus-visible { outline-offset: -2px; }
.rank { font: 500 13px/1 var(--f-mono); color: var(--faint); font-variant-numeric: tabular-nums; text-align: right; }
.mono-av { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font: 800 15px/1 var(--f-display); text-transform: uppercase; background: oklch(var(--tile-l) var(--tile-c) var(--h, 250)); color: oklch(var(--ink-l) var(--ink-c) var(--h, 250)); }
.txt { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.host { font: 400 12.5px/1.2 var(--f-mono); color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.open-ico { color: var(--accent); opacity: 0; transition: opacity .15s, translate .15s; }
.row-link:hover .open-ico, .row-link:focus-visible .open-ico { opacity: 1; translate: 2px -2px; }
.row-tools { position: absolute; right: 8px; top: 50%; translate: 0 -50%; display: flex; gap: 2px; }
.tool { inline-size: 36px; block-size: 36px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--faint); cursor: pointer; padding: 0; }
.tool:hover, .tool:focus-visible { background: var(--card); color: var(--fg); box-shadow: var(--shadow); }
.tool.grip { cursor: grab; touch-action: none; }
@container (max-width: 520px) {
  .txt { flex-direction: column; gap: 2px; }
  .row-link { grid-template-columns: 20px 34px minmax(0, 1fr); padding-right: 50px; }
  .open-ico { display: none; }
  .tool.grip { display: none; }
  .row::before { left: 86px !important; }
}

.divider { position: relative; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 92px 6px 10px; font: 700 12px/1 var(--f-body); letter-spacing: .08em; text-transform: uppercase; }
.divider .label { color: var(--accent); overflow-wrap: anywhere; }
.divider .rule { flex: 1; min-width: 24px; border-top: 1px dashed color-mix(in oklch, var(--accent) 55%, var(--line)); }
.divider .kind { color: var(--faint); letter-spacing: .04em; }
@container (max-width: 520px) { .divider { padding-right: 50px; } .divider .kind { display: none; } }
.row.below .row-link { min-height: 44px; padding-block: 5px; }
.row.below .mono-av { width: 26px; height: 26px; border-radius: 8px; font-size: 12px; margin-inline: 4px; }
.row.below .title { font-weight: 500; color: var(--muted); }
.row.below .row-link:hover .title { color: var(--fg); }

/* Ziehen zum Sortieren */
.is-dragging { opacity: .45; }
.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.rows.drop-into { outline: 2px dashed var(--accent); outline-offset: 2px; }
.is-picked { background: color-mix(in oklch, var(--accent) 12%, var(--card)); border-radius: 10px; }

mark { background: color-mix(in oklch, var(--accent) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty strong { color: var(--fg); }

/* ---- Menüs ----------------------------------------------------------- */
.menu { margin: 0; padding: 6px; min-width: 230px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--fg); box-shadow: var(--lift); position: fixed; inset: auto; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 9px; cursor: pointer; font-size: 14px; }
.menu button:hover, .menu button:focus-visible { background: var(--sunk); }
.menu button:disabled { opacity: .4; cursor: default; background: none; }
.menu .danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

/* ---- Dialoge --------------------------------------------------------- */
dialog { border: 1px solid var(--line); border-radius: 18px; padding: 0; width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); background: var(--card); color: var(--fg); box-shadow: var(--lift); opacity: 1; translate: 0 0; transition: opacity .2s, translate .2s, display .2s allow-discrete, overlay .2s allow-discrete; }
dialog.wide { width: min(620px, calc(100vw - 32px)); }
@starting-style { dialog[open] { opacity: 0; translate: 0 12px; } }
dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(4px); }
.dlg-head { padding: 20px 22px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dlg-head h2 { margin: 0; font: 700 24px/1.1 var(--f-display); letter-spacing: -0.015em; }
.dlg-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 16px; }
.dlg-body p { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .seg legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0; }
.field input, .field select { height: 44px; border-radius: 11px; border: 1px solid var(--field-line); background: var(--bg); color: var(--fg); padding-inline: 12px; font: 500 15px var(--f-body); min-width: 0; }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.err { font-size: 13px; color: var(--danger); }
.err:empty { display: none; }
.seg { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.seg-opts { display: inline-flex; flex-wrap: wrap; background: var(--sunk); border-radius: 11px; padding: 3px; gap: 3px; align-self: start; }
.seg-opts label { padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); position: relative; }
.seg-opts input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opts label:has(input:checked) { background: var(--card); color: var(--fg); box-shadow: var(--shadow); }
.seg-opts label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
form:has(input[name="kind"][value="divider"]:checked) .only-link,
form:has(input[name="kind"][value="category"]:checked) .only-link,
form:has(input[name="kind"][value="category"]:checked) .not-category { display: none; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.btn { min-height: 44px; padding-inline: 18px; border-radius: 11px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { background: var(--sunk); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { background: var(--danger); color: oklch(0.99 0 0); border-color: transparent; }
:root[data-theme="dark"] .btn.danger { color: oklch(0.18 0.03 262); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.danger { color: oklch(0.18 0.03 262); } }
.btn[aria-busy="true"] { opacity: .6; pointer-events: none; }

.data-sec { display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.data-sec:last-child { border-bottom: 0; padding-bottom: 0; }
.data-sec h3 { margin: 0; font: 700 17px/1.2 var(--f-display); }
.data-sec p { font-size: 14px; }
.row-btns, .import-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.file-pick { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding-inline: 14px; border: 1px dashed var(--field-line); border-radius: 11px; cursor: pointer; max-width: 100%; }
.file-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-pick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.backups { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; max-height: 260px; overflow-y: auto; }
.backups li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.backups li:first-child { border-top: 0; }
.backups .b-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.backups .b-name small { font: 400 12px/1.3 var(--f-mono); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backups .btn { min-height: 36px; padding-inline: 12px; font-size: 13px; }

/* ---- Meldungen ------------------------------------------------------- */
.toasts { position: fixed; z-index: 20; left: 50%; translate: -50% 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { pointer-events: auto; background: var(--fg); color: var(--bg); border-radius: 12px; padding: 10px 14px; font-weight: 500; font-size: 14px; display: flex; gap: 12px; align-items: center; box-shadow: var(--lift); }
.toast.error { background: var(--danger); color: oklch(0.99 0 0); }
.toast button { border: 0; background: none; color: inherit; text-decoration: underline; font-weight: 700; cursor: pointer; padding: 0; }

/* ---- Handy ----------------------------------------------------------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-block: 16px 120px; }
  .rail { position: static; gap: 14px; max-height: none; }
  .index { flex-direction: row; overflow-x: auto; gap: 6px; padding: 0 0 2px; background: none; box-shadow: none; scrollbar-width: none; max-height: none; }
  .index a { white-space: nowrap; background: var(--card); border: 1px solid var(--line); padding: 8px 12px; border-radius: 999px; }
  .index a > span:nth-child(2) { overflow: visible; }
  .index a.is-active { background: var(--fg); color: var(--bg); border-color: var(--fg); }
  .index a.is-active .n { color: inherit; }
  .rail-foot, .btn-new.wide { display: none; }
  .search { position: fixed; top: auto; z-index: 15; left: 0; right: 0; bottom: 0; height: auto; border-radius: 18px 18px 0 0; padding-block: 12px calc(12px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); border-width: 1px 0 0; box-shadow: var(--lift); }
  .search:focus-within { box-shadow: var(--lift); }
  .search input { height: 44px; }
  .search .hint { display: none; }
  .search .data-mobile { display: inline-grid; }
  .toasts { bottom: calc(env(safe-area-inset-bottom, 0px) + 92px); }
}
@media (min-width: 861px) { .btn-new.compact { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

/* ---- Anmeldung ------------------------------------------------------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding-block: 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.auth-card { width: min(400px, 100%); background: var(--card); border-radius: 20px; box-shadow: var(--lift); padding: 28px 26px; display: flex; flex-direction: column; gap: 20px; }
.auth-card .wordmark { font-size: 28px; }
.auth-card h1 { margin: 0; font: 700 22px/1.2 var(--f-display); color: var(--muted); }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.auth-card .btn.primary { width: 100%; }

/* Kategorie-Kopf auf schmalen Bildschirmen: Name einzeilig, nur die Zahl */
@media (max-width: 520px) {
  .cat-head h2 { font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
  .cat-head .meta-word { display: none; }
  .cat-head { gap: 8px; }
}
@media (max-width: 860px) { .index { position: relative; } }
.is-grabbing, .is-grabbing * { cursor: grabbing !important; user-select: none; }

/* Toast mit Rückgängig: bleibt stehen, solange Maus oder Fokus darauf liegen */
.toast kbd { background: transparent; color: inherit; border-color: currentColor; opacity: .75; }
.account { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.account form { display: contents; }
@media (hover: hover) { .divider .kind { opacity: 0; transition: opacity .15s; } .divider:hover .kind, .divider:focus-within .kind { opacity: 1; } }
