/* Exchange - eigenes Stylesheet. Keine Fremdbibliothek, keine externen Anfragen.
   Aufbau: Schriften, Farbwerte (hell, dunkel), Grundgeruest, Navigation,
   Bausteine, Seiten, Tablet und Handy. Redesign 2026-10-23 (Inter, Indigo). */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/inter-latin-400.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/inter-latin-500.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/inter-latin-600.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/inter-latin-700.woff2) format("woff2"); }
@font-face {
    font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap;
    src: url(fonts/jetbrains-mono-latin.woff2) format("woff2");
}

/* ---------- Farbwerte ---------- */

:root {
    color-scheme: light;
    --bg: #F3F4F8;
    --surface: #FFFFFF;
    --surface-2: #F8F9FB;
    --surface-3: #F1F3F7;
    --line: #E4E7EE;
    --line-2: #EEF0F4;
    --line-dash: #C7CBD6;
    --ink: #0F172A;
    --ink-2: #475467;
    --ink-3: #5E6A7D;
    --accent: #4F46E5;
    --accent-hover: #4338CA;
    --accent-soft: #EEF2FF;
    --accent-ink: #3730A3;
    --focus: #4F46E5;
    --link: #4338CA;
    --btn: #4F46E5;
    --btn-ink: #FFFFFF;
    --btn-hover: #4338CA;
    --chip-on: #0F172A;
    --chip-on-ink: #FFFFFF;
    --ghost-hover: #F1F3F7;
    --hover-line: #C7CBD6;
    --danger: #B91C1C;
    --warn: #C2410C;
    --ok-bg: #ECFDF3;
    --ok-ink: #15803D;
    --err-bg: #FEF2F2;
    --err-ink: #B91C1C;
    --bulk-bg: #0F172A;
    --overlay: rgba(15, 23, 42, .45);

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-md: 0 4px 12px rgba(16, 24, 40, .08);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);

    --kind-idea-bg: #FFFBEB;     --kind-idea-ink: #B45309;     --kind-idea: #F59E0B;
    --kind-change-bg: #F5F3FF;   --kind-change-ink: #6D28D9;   --kind-change: #8B5CF6;
    --kind-bug-bg: #FEF2F2;      --kind-bug-ink: #B91C1C;      --kind-bug: #EF4444;
    --kind-task-bg: #EFF6FF;     --kind-task-ink: #1D4ED8;     --kind-task: #3B82F6;
    --kind-question-bg: #F0FDFA; --kind-question-ink: #0F766E; --kind-question: #14B8A6;

    --st-inbox: #94A3B8;       --st-inbox-bg: #F1F5F9;       --st-inbox-ink: #475569;
    --st-accepted: #2563EB;    --st-accepted-bg: #EFF6FF;    --st-accepted-ink: #1D4ED8;
    --st-in_progress: #4F46E5; --st-in_progress-bg: #EEF2FF; --st-in_progress-ink: #4338CA;
    --st-review: #9333EA;      --st-review-bg: #FAF5FF;      --st-review-ink: #7E22CE;
    --st-done: #16A34A;        --st-done-bg: #F0FDF4;        --st-done-ink: #15803D;
    --st-rejected: #A3ADBD;    --st-rejected-bg: #F1F5F9;    --st-rejected-ink: #5E6A7D;

    --prio-critical-bg: #FEF2F2;
    --prio-critical: #B91C1C;
    --prio-high: #C2410C;

    --av-1: #4F46E5; --av-2: #0D9488; --av-3: #D97706; --av-4: #DB2777; --av-5: #2563EB; --av-6: #7C3AED;

    --show-moon: inline-flex;
    --show-sun: none;

    --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475467' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --chev-on: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

    --radius: 12px;
    --radius-sm: 10px;
    --radius-lg: 14px;
    --sidebar-w: 256px;
    --rail-w: 72px;
    --topbar-h: 64px;
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

/* Dunkel: folgt dem Geraet, ausser das Konto hat "hell" gewaehlt; oder fest
   "dunkel". Beide Bloecke tragen dieselben Werte. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #0B0F1A; --surface: #121828; --surface-2: #0F1626; --surface-3: #1A2235;
        --line: #232C3D; --line-2: #1B2333; --line-dash: #3A465A;
        --ink: #F1F5F9; --ink-2: #CBD5E1; --ink-3: #94A3B8;
        --accent: #6366F1; --accent-hover: #4F46E5; --accent-soft: #1E1B4B; --accent-ink: #C7D2FE;
        --focus: #818CF8; --link: #A5B4FC;
        --btn: #6366F1; --btn-ink: #FFFFFF; --btn-hover: #4F46E5;
        --chip-on: #F1F5F9; --chip-on-ink: #0B0F1A;
        --ghost-hover: #1A2235; --hover-line: #3A465A;
        --danger: #F87171; --warn: #FB923C;
        --ok-bg: #052E16; --ok-ink: #86EFAC; --err-bg: #3F1D1D; --err-ink: #FCA5A5;
        --bulk-bg: #1E293B; --overlay: rgba(0, 0, 0, .55);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow-md: 0 6px 16px rgba(0, 0, 0, .35); --shadow-lg: 0 16px 40px rgba(0, 0, 0, .5);
        --kind-idea-bg: #3B2A0A; --kind-idea-ink: #FCD34D;
        --kind-change-bg: #2E1065; --kind-change-ink: #C4B5FD;
        --kind-bug-bg: #3F1D1D; --kind-bug-ink: #FCA5A5;
        --kind-task-bg: #172554; --kind-task-ink: #93C5FD;
        --kind-question-bg: #042F2E; --kind-question-ink: #5EEAD4;
        --st-inbox: #64748B; --st-inbox-bg: #1E293B; --st-inbox-ink: #CBD5E1;
        --st-accepted: #3B82F6; --st-accepted-bg: #172554; --st-accepted-ink: #93C5FD;
        --st-in_progress: #818CF8; --st-in_progress-bg: #1E1B4B; --st-in_progress-ink: #C7D2FE;
        --st-review: #A855F7; --st-review-bg: #3B0764; --st-review-ink: #D8B4FE;
        --st-done: #22C55E; --st-done-bg: #052E16; --st-done-ink: #86EFAC;
        --st-rejected: #475569; --st-rejected-bg: #1E293B; --st-rejected-ink: #94A3B8;
        --prio-critical-bg: #3F1D1D; --prio-critical: #FCA5A5; --prio-high: #FB923C;
        --av-1: #6366F1; --av-2: #14B8A6; --av-3: #D97706; --av-4: #DB2777; --av-5: #3B82F6; --av-6: #8B5CF6;
        --show-moon: none; --show-sun: inline-flex;
        --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23CBD5E1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
        --chev-on: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B0F1A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0B0F1A; --surface: #121828; --surface-2: #0F1626; --surface-3: #1A2235;
    --line: #232C3D; --line-2: #1B2333; --line-dash: #3A465A;
    --ink: #F1F5F9; --ink-2: #CBD5E1; --ink-3: #94A3B8;
    --accent: #6366F1; --accent-hover: #4F46E5; --accent-soft: #1E1B4B; --accent-ink: #C7D2FE;
    --focus: #818CF8; --link: #A5B4FC;
    --btn: #6366F1; --btn-ink: #FFFFFF; --btn-hover: #4F46E5;
    --chip-on: #F1F5F9; --chip-on-ink: #0B0F1A;
    --ghost-hover: #1A2235; --hover-line: #3A465A;
    --danger: #F87171; --warn: #FB923C;
    --ok-bg: #052E16; --ok-ink: #86EFAC; --err-bg: #3F1D1D; --err-ink: #FCA5A5;
    --bulk-bg: #1E293B; --overlay: rgba(0, 0, 0, .55);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow-md: 0 6px 16px rgba(0, 0, 0, .35); --shadow-lg: 0 16px 40px rgba(0, 0, 0, .5);
    --kind-idea-bg: #3B2A0A; --kind-idea-ink: #FCD34D;
    --kind-change-bg: #2E1065; --kind-change-ink: #C4B5FD;
    --kind-bug-bg: #3F1D1D; --kind-bug-ink: #FCA5A5;
    --kind-task-bg: #172554; --kind-task-ink: #93C5FD;
    --kind-question-bg: #042F2E; --kind-question-ink: #5EEAD4;
    --st-inbox: #64748B; --st-inbox-bg: #1E293B; --st-inbox-ink: #CBD5E1;
    --st-accepted: #3B82F6; --st-accepted-bg: #172554; --st-accepted-ink: #93C5FD;
    --st-in_progress: #818CF8; --st-in_progress-bg: #1E1B4B; --st-in_progress-ink: #C7D2FE;
    --st-review: #A855F7; --st-review-bg: #3B0764; --st-review-ink: #D8B4FE;
    --st-done: #22C55E; --st-done-bg: #052E16; --st-done-ink: #86EFAC;
    --st-rejected: #475569; --st-rejected-bg: #1E293B; --st-rejected-ink: #94A3B8;
    --prio-critical-bg: #3F1D1D; --prio-critical: #FCA5A5; --prio-high: #FB923C;
    --av-1: #6366F1; --av-2: #14B8A6; --av-3: #D97706; --av-4: #DB2777; --av-5: #3B82F6; --av-6: #8B5CF6;
    --show-moon: none; --show-sun: inline-flex;
    --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23CBD5E1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --chev-on: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B0F1A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* ---------- Grundgeruest ---------- */

* { box-sizing: border-box; scrollbar-width: thin; }
[hidden] { display: none !important; }
/* Schmale, zum Thema passende Scrollleisten statt der grauen Standardbalken. */
html { height: 100%; -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-dash) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-dash); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
body {
    margin: 0; min-height: 100%; background: var(--bg); color: var(--ink);
    font-family: var(--sans); font-size: 14px; line-height: 1.5;
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.015em; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; letter-spacing: 0; }
p { margin: 0 0 10px; }
small { font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--line-2); margin: 10px 0; }
code, kbd, pre { font-family: var(--mono); }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.spacer { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex: none; vertical-align: -2px; }
.inline-form { display: inline; margin: 0; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 28px 32px 56px; }
.wrap-fluid { max-width: none; padding-top: 22px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }

.kbd {
    font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--ink-3);
    border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; background: var(--surface); line-height: 1.3;
}

/* ---------- Rahmen: Seitenleiste, Kopfzeile ---------- */

.app { display: flex; min-height: 100vh; }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; min-width: 0; }

.sidebar {
    flex: 0 0 var(--sidebar-w); width: var(--sidebar-w); position: sticky; top: 0; height: 100vh; z-index: 25;
    background: var(--surface); border-right: 1px solid var(--line);
    display: flex; flex-direction: column; gap: 4px; padding: 14px 12px 12px;
}
.sidebar > :not(.side-scopes) { flex-shrink: 0; }
.side-top { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 16px; font-weight: 700; letter-spacing: -0.01em; min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-mark {
    width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: #FFFFFF;
    display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.side-close {
    display: none; margin-left: auto; width: 36px; height: 36px; border: 0; border-radius: 10px;
    background: none; color: var(--ink-2); align-items: center; justify-content: center;
}
.side-close:hover { background: var(--ghost-hover); }

.project-switch {
    position: relative; display: flex; align-items: center; height: 42px; margin: 0 0 10px;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
}
.project-switch select {
    appearance: none; -webkit-appearance: none; width: 100%; height: 100%; border: 0; background: transparent;
    padding: 0 32px 0 44px; font-weight: 600; color: var(--ink); cursor: pointer; border-radius: inherit;
}
.project-switch select:focus { outline: none; }
.project-switch:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.project-switch.is-static { padding: 0 10px 0 44px; font-weight: 600; }
.project-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-mark {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 7px;
    background: var(--ink); color: var(--surface); font-size: 10px; font-weight: 700; letter-spacing: .02em;
    display: inline-flex; align-items: center; justify-content: center; pointer-events: none;
}
.project-chev { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); display: flex; pointer-events: none; }

.sidenav { display: flex; flex-direction: column; gap: 2px; }
.sidenav a {
    position: relative; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: var(--radius-sm);
    color: var(--ink-2); font-weight: 500; white-space: nowrap;
}
.sidenav a:hover { background: var(--ghost-hover); color: var(--ink); }
.sidenav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav-badge {
    margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
    background: var(--accent); color: #FFFFFF; font-size: 11px; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center;
}

/* Scope-Liste: Scrollleiste unsichtbar, bis die Maus darueber ist; unten
   blendet die Liste weich aus, damit man sieht, dass es weitergeht. */
.side-scopes {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 14px -6px 4px; padding: 0 6px 28px;
    scrollbar-width: thin; scrollbar-color: transparent transparent; overscroll-behavior: contain;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent);
}
.side-scopes:hover, .side-scopes:focus-within { scrollbar-color: var(--line-dash) transparent; }
.side-scopes::-webkit-scrollbar { width: 6px; }
.side-scopes::-webkit-scrollbar-thumb { background: transparent; border-radius: 999px; }
.side-scopes:hover::-webkit-scrollbar-thumb { background: var(--line-dash); }
.side-scopes .sidebar-head { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.side-scopes { border-top: 1px solid var(--line-2); padding-top: 12px; }
/* Gruppenueberschrift wie in der RealesOS-Navigation; ein Klick klappt die Gruppe ein. */
.side-section {
    display: flex; align-items: center; gap: 6px; width: 100%; margin: 14px 0 2px; padding: 4px 10px; border: 0; border-radius: 6px;
    background: none; color: var(--ink-3); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; text-align: left;
}
.side-section:hover { color: var(--ink); }
.side-section-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-section .ic { opacity: 0; transition: transform .12s, opacity .12s; }
.side-section:hover .ic, .side-section:focus-visible .ic, .side-section[aria-expanded="false"] .ic { opacity: 1; }
.side-section[aria-expanded="false"] .ic { transform: rotate(-90deg); }
.side-manage { margin-top: 12px; color: var(--ink-3); }
.sidebar-head {
    display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 6px;
    font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
}
.tree-manage { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 7px; color: var(--ink-3); }
.tree-manage:hover { background: var(--ghost-hover); color: var(--ink); }
.tree { list-style: none; margin: 0; padding: 0; }
/* Unter-Scopes ruecken ein; der Pfeil zum Auf- und Zuklappen sitzt rechts in
   der Zeile, damit links nichts frei bleibt und die Icons buendig stehen. */
.tree-row { position: relative; display: flex; align-items: center; padding-left: calc(var(--depth, 0) * 16px); }
.tree-toggle {
    position: absolute; right: 2px; top: 50%; transform: translateY(-50%); z-index: 1;
    width: 24px; height: 24px; border: 0; background: none; color: var(--ink-3); border-radius: 6px;
    display: flex; align-items: center; justify-content: center; padding: 0;
}
.tree-row:has(.tree-toggle) .tree-item { padding-right: 30px; }
.tree-toggle:hover { background: var(--ghost-hover); color: var(--ink); }
.tree-toggle .ic { transition: transform .12s; }
.tree-toggle[aria-expanded="false"] .ic { transform: rotate(-90deg); }
.tree-spacer { display: none; }
.tree-item {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px;
    border-radius: 8px; color: var(--ink-2); font-size: 13px; font-weight: 500;
}
.tree-item:hover { background: var(--ghost-hover); color: var(--ink); }
.tree-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.tree-item.active .tree-count { color: var(--accent-ink); }
.tree-ic { width: 18px; height: 18px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); }
.tree-item:hover .tree-ic { color: var(--ink-2); }
.tree-item.active .tree-ic { color: var(--accent); }
.tree-dot { width: 5px; height: 5px; border-radius: 999px; background: var(--line-dash); }
.tree-all { margin: 0 0 2px; }
.tree-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-count { font-size: 11.5px; color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.tree-node[hidden] { display: none; }

.dropdown { position: relative; margin: 0; }
.dropdown summary { list-style: none; cursor: pointer; }
.dropdown summary::-webkit-details-marker { display: none; }
.side-user { margin-top: auto; }
.side-user .user {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.side-user .user:hover { background: var(--ghost-hover); }
.user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-text strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-text small { font-size: 12px; color: var(--ink-3); }
.user-chev { margin-left: auto; color: var(--ink-3); display: flex; }
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; z-index: 60;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px;
    display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.side-user .dropdown-menu { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; width: 100%; }
.dropdown-head { display: flex; flex-direction: column; padding: 8px 10px 10px; line-height: 1.3; }
.dropdown-head strong { font-size: 14px; }
.dropdown-menu a, .dropdown-menu button {
    display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px;
    color: var(--ink); font-size: 14px; background: none; border: 0; width: 100%; text-align: left;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--ghost-hover); color: var(--ink); }
.dropdown-menu hr { margin: 6px 0; }
.dropdown-menu form { margin: 0; }

.topbar {
    position: sticky; top: 0; z-index: 20; height: var(--topbar-h); flex: none;
    display: flex; align-items: center; gap: 8px; padding: 0 28px 0 16px;
    background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar .brand-mobile, .topbar .page-name, .topbar .search-toggle, .topbar .scopes-toggle { display: none; }
.page-name { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.search { position: relative; flex: 1 1 320px; max-width: 520px; margin: 0 0 0 4px; }
.search input[type="search"] {
    width: 100%; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface-2); padding: 0 40px 0 38px; font-size: 14px;
}
.search input[type="search"]:focus { background: var(--surface); }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); display: flex; pointer-events: none; }
.search .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search input::-webkit-search-cancel-button { display: none; }
.theme-ic-dark { display: var(--show-moon); }
.theme-ic-light { display: var(--show-sun); }
.bell { position: relative; }
.bell-dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.new-btn { margin-left: 6px; }

.tabbar, .fab { display: none; }

/* Eingeklappt: nur Symbole. Breit auf Wunsch, mittelbreit immer (dort legt
   der Knopf die volle Leiste als Ebene darueber). Zwei gleiche Bloecke. */
@media (min-width: 1101px) {
    body.sidebar-closed .sidebar { flex-basis: var(--rail-w); width: var(--rail-w); padding-left: 12px; padding-right: 12px; align-items: center; }
    body.sidebar-closed .sidebar .side-label, body.sidebar-closed .side-scopes, body.sidebar-closed .project-chev,
    body.sidebar-closed .project-switch select, body.sidebar-closed .side-close { display: none; }
    body.sidebar-closed .side-top { padding: 4px 0 12px; }
    body.sidebar-closed .project-switch { width: 44px; padding: 0; }
    body.sidebar-closed .project-mark { left: 50%; transform: translate(-50%, -50%); }
    body.sidebar-closed .sidenav a { width: 44px; padding: 0; justify-content: center; }
    body.sidebar-closed .sidenav .nav-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; font-size: 10px; padding: 0 4px; }
    body.sidebar-closed .side-user .user { padding: 6px; border-color: transparent; }
    body.sidebar-closed .side-user .dropdown-menu { width: 230px; }
}
@media (min-width: 721px) and (max-width: 1100px) {
    body:not(.sidebar-mobile-open) .sidebar { flex-basis: var(--rail-w); width: var(--rail-w); padding-left: 12px; padding-right: 12px; align-items: center; }
    body:not(.sidebar-mobile-open) .sidebar .side-label, body:not(.sidebar-mobile-open) .side-scopes, body:not(.sidebar-mobile-open) .project-chev,
    body:not(.sidebar-mobile-open) .project-switch select, body:not(.sidebar-mobile-open) .side-close { display: none; }
    body:not(.sidebar-mobile-open) .side-top { padding: 4px 0 12px; }
    body:not(.sidebar-mobile-open) .project-switch { width: 44px; padding: 0; }
    body:not(.sidebar-mobile-open) .project-mark { left: 50%; transform: translate(-50%, -50%); }
    body:not(.sidebar-mobile-open) .sidenav a { width: 44px; padding: 0; justify-content: center; }
    body:not(.sidebar-mobile-open) .sidenav .nav-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; font-size: 10px; padding: 0 4px; }
    body:not(.sidebar-mobile-open) .side-user .user { padding: 6px; border-color: transparent; }
    body:not(.sidebar-mobile-open) .side-user .dropdown-menu { width: 230px; }
}
/* Als Ebene ueber der Seite (Tablet und Handy). */
@media (max-width: 1100px) {
    body.sidebar-mobile-open .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; height: auto; width: min(86vw, 300px); z-index: 70;
        box-shadow: 0 0 0 100vw var(--overlay); border-right: 0;
    }
    body.sidebar-mobile-open .side-close { display: inline-flex; }
    body.sidebar-mobile-open .app::before { content: ""; flex: 0 0 var(--rail-w); }
}

/* ---------- Buttons, Chips ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
    font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; text-decoration: none; box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--ghost-hover); color: var(--ink); }
.btn-primary { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); font-weight: 600; }
.btn-primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); color: var(--btn-ink); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); box-shadow: none; }
.btn-ghost:hover { color: var(--ink); }
.btn-danger { color: var(--danger); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn-lg { height: 44px; padding: 0 18px; border-radius: var(--radius); }
.btn-icon { width: 38px; padding: 0; }
.btn[disabled] { opacity: .5; cursor: default; }
.linklike { background: none; border: 0; padding: 0; margin: 0; width: auto; color: var(--link); font-size: inherit; cursor: pointer; }
.linklike:hover { text-decoration: underline; }
.linklike-danger { color: var(--danger); }

.chip, .chip-select {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink);
    font-size: 13px; font-weight: 500; white-space: nowrap; text-decoration: none; box-shadow: var(--shadow-sm);
}
a.chip:hover, .chip-select:hover { border-color: var(--hover-line); color: var(--ink); }
.chip-on, a.chip-on:hover { background: var(--chip-on); border-color: var(--chip-on); color: var(--chip-on-ink); }
.chip-static { cursor: default; }
.chip-select {
    appearance: none; -webkit-appearance: none; cursor: pointer; width: auto; max-width: 260px;
    padding-right: 30px; background-image: var(--chev); background-repeat: no-repeat;
    background-position: right 10px center; background-size: 14px; field-sizing: content;
}
.chip-select.chip-on { background-image: var(--chev-on); }
.chip-select option { color: var(--ink); background: var(--surface); font-weight: 400; }

/* ---------- Kennzeichen: Typ, Status, Prioritaet, Avatar ---------- */

.kind {
    display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; line-height: 16px;
    padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.kind-idea { background: var(--kind-idea-bg); color: var(--kind-idea-ink); }
.kind-change { background: var(--kind-change-bg); color: var(--kind-change-ink); }
.kind-bug { background: var(--kind-bug-bg); color: var(--kind-bug-ink); }
.kind-task { background: var(--kind-task-bg); color: var(--kind-task-ink); }
.kind-question { background: var(--kind-question-bg); color: var(--kind-question-ink); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; flex: none; }
.dot-idea { background: var(--kind-idea); }
.dot-change { background: var(--kind-change); }
.dot-bug { background: var(--kind-bug); }
.dot-task { background: var(--kind-task); }
.dot-question { background: var(--kind-question); }

.st { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.st .dot { width: 8px; height: 8px; }
.st-inbox .dot { background: var(--st-inbox); }
.st-accepted .dot { background: var(--st-accepted); }
.st-in_progress .dot { background: var(--st-in_progress); }
.st-review .dot { background: var(--st-review); }
.st-done .dot { background: var(--st-done); }
.st-rejected .dot { background: var(--st-rejected); }
.st-label { font-size: 11.5px; font-weight: 600; line-height: 16px; padding: 2px 9px 2px 7px; border-radius: 999px; gap: 5px; }
.st-label .dot { width: 6px; height: 6px; }
.st-label.st-inbox { background: var(--st-inbox-bg); color: var(--st-inbox-ink); }
.st-label.st-accepted { background: var(--st-accepted-bg); color: var(--st-accepted-ink); }
.st-label.st-in_progress { background: var(--st-in_progress-bg); color: var(--st-in_progress-ink); }
.st-label.st-review { background: var(--st-review-bg); color: var(--st-review-ink); }
.st-label.st-done { background: var(--st-done-bg); color: var(--st-done-ink); }
.st-label.st-rejected { background: var(--st-rejected-bg); color: var(--st-rejected-ink); }

.prio { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.prio-critical {
    font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; line-height: 16px;
    background: var(--prio-critical-bg); color: var(--prio-critical);
}
.prio-high { color: var(--prio-high); }
.prio-low { color: var(--ink-3); font-weight: 500; }
.prio-normal { color: var(--ink-2); font-weight: 500; }

.avatar {
    display: inline-flex; align-items: center; justify-content: center; flex: none; color: #FFFFFF;
    width: 22px; height: 22px; border-radius: 999px; font-size: 9.5px; font-weight: 700; letter-spacing: 0;
}
.avatar-md { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 34px; height: 34px; font-size: 12px; }
.av-1 { background: var(--av-1); } .av-2 { background: var(--av-2); } .av-3 { background: var(--av-3); }
.av-4 { background: var(--av-4); } .av-5 { background: var(--av-5); } .av-6 { background: var(--av-6); }
.who { display: inline-flex; align-items: center; gap: 8px; }

.ref { font-family: var(--mono); font-size: 11.5px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.meta-ic { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.due { color: var(--ink-2); font-weight: 500; }
.overdue { color: var(--danger); font-weight: 600; }
.resolved {
    font-family: var(--mono); font-size: 11px; font-weight: 500; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    background: var(--st-done-bg); color: var(--st-done-ink); padding: 1px 7px; border-radius: 999px;
}

/* ---------- Meldungen, Leerzustand ---------- */

.flash {
    display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 500; margin-bottom: 16px;
}
.flash-success { background: var(--ok-bg); color: var(--ok-ink); }
.flash-error { background: var(--err-bg); color: var(--err-ink); }
.empty {
    border: 1px dashed var(--line-dash); border-radius: var(--radius-lg); padding: 40px 20px; background: var(--surface-2);
    display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.empty strong { font-size: 15px; font-weight: 600; }

/* ---------- Seitenkopf und Filterleiste ---------- */

.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 0 18px; margin: 0; }
.filters-title { font-size: 22px; margin-right: 10px; }
.filters .summary { margin-left: auto; font-size: 13px; color: var(--ink-3); }
.filters .reset { font-size: 13px; font-weight: 500; color: var(--ink-2); padding: 0 4px; }
.filters .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

/* ---------- Board ---------- */

/* Spalten teilen sich die Breite; nur unterhalb von ~210 px je Spalte scrollt
   das Board waagerecht. Erledigt und Verworfen lassen sich zu einem schmalen
   Streifen einklappen (Zustand im Browser, Verworfen anfangs zu). */
.board-scroll { overflow-x: auto; padding-bottom: 16px; }
.board { display: flex; gap: 14px; align-items: flex-start; }
.column { flex: 1 1 0; min-width: 184px; }
.column-head { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 4px 0 6px; margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: 0; }
.column-head .count {
    font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: var(--surface-3); border: 1px solid var(--line);
    border-radius: 999px; padding: 0 7px; line-height: 18px; font-variant-numeric: tabular-nums;
}
.column-head .col-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; }
.column-note { font-size: 11px; font-weight: 400; color: var(--ink-3); margin-right: 2px; white-space: nowrap; }
.column-body { display: flex; flex-direction: column; gap: 10px; min-height: 96px; border-radius: var(--radius); }
.column-body:not(:has(.card)) { border: 1px dashed var(--line-dash); }
.col-toggle .ic { transition: transform .12s; }
.column.collapsed { flex: 0 0 46px; min-width: 46px; }
.column.collapsed .column-head {
    flex-direction: column; height: auto; padding: 10px 0; gap: 10px; margin: 0 0 8px;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-3);
}
.column.collapsed .column-head .col-actions { margin: 0; order: -1; }
.column.collapsed .col-toggle .ic { transform: rotate(180deg); }
.column.collapsed .column-label { writing-mode: vertical-rl; transform: rotate(180deg); }
.column.collapsed .column-note, .column.collapsed .col-archive, .column.collapsed .col-info { display: none; }
.col-info { cursor: help; }
.column.collapsed .column-body { min-height: 50vh; border: 1px dashed var(--line); }
.column.collapsed .card, .column.collapsed .dropnote { display: none; }
.board-tabs { display: none; }

/* Karte: die ganze Flaeche ist ein Link (::after ueber dem Inhalt), das
   Menue liegt darueber und bleibt klickbar. */
.card {
    position: relative; display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 12px 12px 10px; color: var(--ink); cursor: grab; box-shadow: var(--shadow-sm);
    transition: border-color .12s, box-shadow .12s;
}
.card:hover { border-color: var(--hover-line); box-shadow: var(--shadow-md); }
.card:active { cursor: grabbing; }
.card-link { color: inherit; text-decoration: none; }
.card-link:hover { color: inherit; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-link:focus-visible { outline: none; }
.card:has(.card-link:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.card-top { display: flex; align-items: center; gap: 6px; min-height: 22px; }
.card-top .prio { margin-left: auto; }
.card-top .prio + .card-menu { margin-left: 0; }
.card-title { font-size: 14px; font-weight: 500; line-height: 1.4; }
.unread-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--accent); flex: none; }
.blocked { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--danger); white-space: nowrap; }

/* Das Panel richtet sich an der Karte aus (nicht am Knopf), damit es nie aus
   dem waagerechten Scrollbereich des Boards ragt und abgeschnitten wird. */
.card-menu { margin-left: auto; }
.card-menu > summary {
    position: relative; z-index: 2;
    list-style: none; width: 26px; height: 24px; border-radius: 7px; color: var(--ink-3); cursor: pointer;
    display: flex; align-items: center; justify-content: center; opacity: 0;
}
.card-menu > summary::-webkit-details-marker { display: none; }
.card:hover .card-menu > summary, .card-menu[open] > summary, .card-menu > summary:focus-visible { opacity: 1; }
.card-menu > summary:hover { background: var(--ghost-hover); color: var(--ink); }
.card-menu-panel {
    position: absolute; left: 6px; right: 6px; top: 38px; z-index: 30; cursor: default;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px;
    display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-lg);
}
.card-menu-panel .menu-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); padding: 6px 8px 2px; }
.card-menu-panel .menu-row { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 4px 4px; }
.menu-btn {
    display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 8px; border: 0; border-radius: 8px;
    background: none; color: var(--ink); font-size: 13px; text-align: left;
}
.menu-btn:hover { background: var(--ghost-hover); }
.menu-btn[aria-current="true"] { font-weight: 600; }
.menu-btn[aria-current="true"]::after { content: "✓"; margin-left: auto; color: var(--accent); }
.menu-chip {
    height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
    font-size: 12px; font-weight: 500; color: var(--ink);
}
.menu-chip:hover { border-color: var(--hover-line); }
.menu-chip[aria-current="true"] { background: var(--chip-on); border-color: var(--chip-on); color: var(--chip-on-ink); }
.card-menu.menu-up .card-menu-panel { top: auto; bottom: calc(100% - 34px); }
@media (hover: none) { .card-menu > summary { opacity: 1; } }
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); min-width: 0; }
.card-meta .scope { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta .right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.column-closed .card { opacity: .82; box-shadow: none; }
.column-closed .card:hover { opacity: 1; }
.column-rejected .card { border-style: dashed; }
.column-rejected .card-title { text-decoration: line-through; text-decoration-color: var(--ink-3); }
.sortable-ghost { opacity: .35; }
.sortable-chosen { box-shadow: var(--shadow-lg); }
.card.saving { opacity: .6; }
.dropnote {
    margin-top: 10px; border: 1px dashed var(--line-dash); border-radius: var(--radius); padding: 14px 12px;
    font-size: 12px; color: var(--ink-3); text-align: center; line-height: 1.4;
}
.board-hint { font-size: 13px; color: var(--ink-3); margin: 4px 0 0; }

/* ---------- Flaechen, Tabellen ---------- */

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.section { padding: 18px 22px 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { display: flex; align-items: center; gap: 8px; }
.count {
    font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: var(--surface-3);
    border-radius: 999px; padding: 0 7px; line-height: 18px; font-variant-numeric: tabular-nums;
}
.section-head h2 .count, h2 .count { margin-left: 2px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table-items { min-width: 1000px; }
.table th {
    text-align: left; padding: 12px 12px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: var(--ink-3); border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2);
}
.table th a { color: inherit; }
.table th.sorted { color: var(--ink); }
.table th .ic { vertical-align: -1px; margin-left: 2px; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 18px; }
.table th:last-child, .table td:last-child { padding-right: 18px; }
.table thead tr:first-child th:first-child { border-top-left-radius: var(--radius-lg); }
.table thead tr:first-child th:last-child { border-top-right-radius: var(--radius-lg); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table td a.title { color: var(--ink); font-weight: 500; }
.table td a.title:hover { color: var(--accent-hover); }
.table td a.title-unread { font-weight: 650; }
.cell-title .unread-dot { display: inline-block; vertical-align: 1px; margin-right: 6px; }
.cell-title .blocked { margin-left: 6px; vertical-align: 1px; }
.table .counts { font-size: 12px; color: var(--ink-3); margin-left: 6px; white-space: nowrap; }
.table .ref a { color: inherit; }
.table td.muted-cell { color: var(--ink-3); }
tr.inactive td { color: var(--ink-3); }
.list-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 14px 4px 0; font-size: 13px; color: var(--ink-3); }

/* ---------- Formulare ---------- */

.field { display: flex; flex-direction: column; gap: 6px; margin: 0; min-width: 0; }
.field > .lbl { font-size: 13px; font-weight: 600; }
.field > .lbl .opt { font-weight: 400; color: var(--ink-3); }
.hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"],
input[type="search"], select, textarea {
    width: 100%; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface); padding: 0 12px; font-size: 14px; color: var(--ink);
}
select { font-weight: 500; }
textarea { height: auto; padding: 10px 12px; line-height: 1.55; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-soft); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
input[disabled] { color: var(--ink-3); background: var(--surface-2); }
.input-lg { height: 46px; font-size: 17px; font-weight: 600; padding: 0 14px; border-radius: var(--radius); }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.row4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions .hint { margin-left: auto; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.checks { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.form-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.form-title h1 { font-size: 22px; }
.form-title .muted { font-size: 13px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-names { font-size: 12.5px; color: var(--ink-2); }

.kind-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.kind-pick label { position: relative; cursor: pointer; }
.kind-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.kind-pick .pick {
    display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
    border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-sm);
}
.kind-pick label:hover .pick { border-color: var(--hover-line); }
.kind-pick input:checked + .pick { border: 2px solid currentColor; padding: 0 13px; font-weight: 600; }
.kind-pick input:checked + .pick-idea { background: var(--kind-idea-bg); color: var(--kind-idea-ink); }
.kind-pick input:checked + .pick-change { background: var(--kind-change-bg); color: var(--kind-change-ink); }
.kind-pick input:checked + .pick-bug { background: var(--kind-bug-bg); color: var(--kind-bug-ink); }
.kind-pick input:checked + .pick-task { background: var(--kind-task-bg); color: var(--kind-task-ink); }
.kind-pick input:checked + .pick-question { background: var(--kind-question-bg); color: var(--kind-question-ink); }
.kind-pick input:focus-visible + .pick { outline: 2px solid var(--focus); outline-offset: 2px; }

.dropzone {
    position: relative; display: flex; align-items: center; gap: 12px; border: 1px dashed var(--line-dash);
    border-radius: var(--radius); padding: 14px 16px; color: var(--ink-2); cursor: pointer; margin: 0; background: var(--surface-2);
}
.dropzone input[type="file"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dropzone.dragover, .dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-ic {
    width: 38px; height: 38px; border-radius: var(--radius-sm); background: var(--surface);
    display: flex; align-items: center; justify-content: center; flex: none; border: 1px solid var(--line);
}
.dropzone .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dropzone strong { font-size: 14px; font-weight: 500; color: var(--ink); }

/* ---------- Editor, Markdown ---------- */

.editor { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.editor:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-soft); }
.editor-tabs {
    display: flex; align-items: center; gap: 2px; padding: 6px 8px; background: var(--surface-2);
    border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
}
.editor > :last-child { border-radius: 0 0 var(--radius) var(--radius); }
.editor-label { font-size: 13px; font-weight: 600; margin-right: 8px; }
.editor-tabs .tab {
    height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent;
    font-size: 13px; font-weight: 500; color: var(--ink-2); width: auto; margin: 0;
}
.editor-tabs .tab.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.editor-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.editor textarea { display: block; border: 0; border-radius: 0; padding: 12px 14px; font-size: 14.5px; min-height: 110px; background: var(--surface); box-shadow: none; }
.editor textarea:focus { outline: none; box-shadow: none; }
.editor textarea.dragover { outline: 2px dashed var(--focus); outline-offset: -4px; }
.editor-preview { padding: 12px 14px; min-height: 110px; }
.editor-foot { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.editor-foot .spacer { flex: 1; }

.markdown { font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.markdown > :first-child { margin-top: 0; }
.markdown > :last-child { margin-bottom: 0; }
.markdown p { margin: 0 0 10px; }
.markdown ul, .markdown ol { margin: 0 0 10px; padding-left: 22px; }
.markdown li { margin: 3px 0; }
.markdown h1, .markdown h2, .markdown h3 { margin: 16px 0 6px; letter-spacing: -0.01em; }
.markdown h1 { font-size: 18px; } .markdown h2 { font-size: 16px; } .markdown h3 { font-size: 15px; }
.markdown strong { font-weight: 600; }
.markdown code { font-size: 12.5px; background: var(--surface-3); border-radius: 5px; padding: 1px 5px; }
.markdown pre { margin: 0 0 10px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow-x: auto; font-size: 12.5px; line-height: 1.5; }
.markdown pre code { background: none; border: 0; padding: 0; }
.markdown img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); display: block; margin: 6px 0; }
.markdown blockquote { margin: 0 0 10px; padding: 2px 12px; border-left: 3px solid var(--line-dash); color: var(--ink-2); }
.markdown table { border-collapse: collapse; margin: 0 0 10px; font-size: 13.5px; }
.markdown th, .markdown td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; }
.markdown hr { margin: 14px 0; }

/* ---------- Eintrag ---------- */

.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); margin: 0 0 16px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }
.item-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.item-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.item-title .ref { font-size: 15px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.item-title h1 { min-width: 0; overflow-wrap: anywhere; font-size: 26px; line-height: 1.25; }
.item-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-badges .by { font-size: 13px; color: var(--ink-3); margin-left: 4px; }
.item-badges .tools { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.item-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.item-main, .item-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.gallery figure { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); display: block; background: var(--surface-2); }
.gallery figcaption { display: flex; align-items: center; gap: 6px; font-size: 12.5px; min-width: 0; }
.gallery .name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.file-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; }
.file-list li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; min-width: 0; padding: 8px 0; border-top: 1px solid var(--line-2); }
.file-list li:first-child { border-top: 0; }
.file-list li > a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--ink); }
.file-list small { white-space: nowrap; }
.att-actions { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; flex: none; }
.att-actions a, .att-actions button {
    display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px;
    color: var(--ink-3); background: none; border: 0; padding: 0; cursor: pointer;
}
.att-actions a:hover, .att-actions button:hover { background: var(--ghost-hover); color: var(--ink); }
.upload-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }

.comments { display: flex; flex-direction: column; }
.comment { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line-2); margin: 0; }
.comment-body { min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.comment-head strong { font-size: 13.5px; font-weight: 600; }
.comment-head small { font-size: 12px; color: var(--ink-3); }
.comment .markdown { font-size: 14px; }
.comment-tools { margin-top: 6px; font-size: 13px; }
.comment-tools summary { cursor: pointer; color: var(--ink-3); font-size: 12.5px; list-style: none; }
.comment-tools summary::-webkit-details-marker { display: none; }
.comment-tools summary:hover { color: var(--ink); }
.comment-tools form { margin: 8px 0 0; }
.comment-tools .actions { margin-top: 8px; }
.composer { margin-top: 10px; }

.meta-form { display: flex; flex-direction: column; gap: 0; margin: 0; }
.meta-form label {
    display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 8px;
    font-size: 13px; color: var(--ink-3); font-weight: 500; padding: 7px 0; border-top: 1px solid var(--line-2);
}
.meta-form label:first-of-type { border-top: 0; padding-top: 0; }
.meta-form select, .meta-form input { height: 34px; font-weight: 500; color: var(--ink); border-color: transparent; background-color: var(--surface-2); }
.meta-form select:hover, .meta-form input:hover { border-color: var(--line); }
.meta-form select:focus, .meta-form input:focus { border-color: var(--focus); background-color: var(--surface); }
.meta-form input.mono { font-size: 13px; font-weight: 400; }
.meta-form .actions { margin-top: 12px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; padding-bottom: 14px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.timeline li:last-child { padding-bottom: 4px; }
.timeline .rail { display: flex; flex-direction: column; align-items: center; }
.timeline .rail .dot { margin-top: 5px; background: var(--line-dash); }
.timeline li:first-child .rail .dot { background: var(--accent); }
.timeline .rail .line { flex: 1; width: 1px; background: var(--line); margin-top: 4px; }
.timeline li:last-child .rail .line { display: none; }
.timeline time { display: block; font-size: 12px; color: var(--ink-3); }
.timeline strong { font-weight: 600; color: var(--ink); }
.danger-zone { padding: 0 4px; }
.danger-zone summary { font-size: 12.5px; color: var(--ink-3); cursor: pointer; list-style: none; }
.danger-zone summary::-webkit-details-marker { display: none; }
.danger-zone summary:hover { color: var(--danger); }
.danger-zone form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }

/* ---------- Neuer Eintrag ---------- */

.new-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; max-width: 1180px; margin: 0 auto; }
.new-form { padding: 26px 28px 24px; display: flex; flex-direction: column; gap: 18px; margin: 0; }
.tips { display: flex; flex-direction: column; gap: 14px; }
.tips .panel { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.tips dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 10px; font-size: 13px; line-height: 1.4; }
.tips dt { display: flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.tips dd { margin: 0; color: var(--ink-2); }
.tips ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }

/* ---------- Anmeldung, Fehler, Verwaltung ---------- */

.narrow { max-width: 440px; margin: 9vh auto 0; }
.auth { padding: 32px 32px 28px; display: flex; flex-direction: column; gap: 16px; border-radius: 18px; box-shadow: var(--shadow-md); }
.auth-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.auth-head h1 { font-size: 22px; }
.auth form { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.auth .btn { height: 44px; }
.admin-form { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; margin: 0; }
.panel-head { padding: 18px 22px 0; }
.project-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 14px; align-items: end; padding: 16px 22px; margin: 0; }
.project-row .meta { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.narrow-cell { width: 110px; }
.narrow-cell input, .table td input { height: 34px; }

/* Anmeldeseite: links die Marke auf dunklem Grund, rechts das Formular. */
.no-chrome .content-bare > .wrap:has(.login) { max-width: none; padding: 0; }
.login { display: flex; flex-wrap: wrap; min-height: 100vh; }
.login-aside {
    flex: 1 1 460px; min-width: 0; background: #0F172A; color: #F1F5F9; padding: 56px 64px;
    display: flex; flex-direction: column; gap: 40px;
}
.login-aside .brand { color: #FFFFFF; font-size: 18px; }
.login-aside .brand-mark { background: #6366F1; }
.login-pitch { max-width: 460px; }
.login-pitch h2 { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 14px; }
.login-pitch p { color: #94A3B8; font-size: 15px; margin: 0; }
.login-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; max-width: 460px; }
.login-points li { display: flex; gap: 12px; align-items: flex-start; color: #CBD5E1; }
.login-points .ic-box {
    width: 36px; height: 36px; border-radius: 10px; flex: none; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); color: #A5B4FC;
}
.login-points strong { display: block; color: #FFFFFF; font-weight: 600; }
.login-foot { margin-top: auto; color: #64748B; font-size: 12px; }
.login-main { flex: 1 1 460px; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 56px 24px; }
.login-main .auth { width: 100%; max-width: 420px; }

/* ---------- Dokumente ---------- */

.scope-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.scope-pill {
    display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
    background: var(--surface-3); color: var(--ink-2); white-space: nowrap; line-height: 16px;
}
a.scope-pill:hover { background: var(--accent-soft); color: var(--accent-ink); }
.scope-checks { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; padding: 4px 0; }
.scope-checks .check { padding-left: calc(var(--depth, 0) * 18px); height: 28px; }
.scope-checks-box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; background: var(--surface); }
.doc-current { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.doc-icon {
    width: 56px; height: 56px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-ink);
    display: flex; align-items: center; justify-content: center;
}
.doc-current .name { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.doc-current .meta { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.doc-current .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.version-badge { font-family: var(--mono); font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap; }
.version-badge-old { background: var(--surface-3); color: var(--ink-2); }
.table-versions td { vertical-align: middle; }
.version-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.doc-title-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.doc-title-cell .sub { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.view-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; box-shadow: var(--shadow-sm); background: var(--surface); }
.view-switch a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 32px; color: var(--ink-2); }
.view-switch a:hover { background: var(--ghost-hover); color: var(--ink); }
.view-switch a[aria-current="true"] { background: var(--chip-on); color: var(--chip-on-ink); }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.doc-card {
    position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 176px; padding: 18px 18px 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
    transition: border-color .12s, box-shadow .12s;
}
.doc-card:hover { border-color: var(--hover-line); box-shadow: var(--shadow-md); }
.doc-card-top { display: flex; align-items: center; gap: 10px; }
.doc-card-ic { width: 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--accent-soft); color: var(--accent-ink); }
.doc-card-top .version-badge { margin-left: auto; }
.doc-card-title { font-size: 15px; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; color: var(--ink); overflow-wrap: anywhere; }
.doc-card-title::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.doc-card-title:hover { color: var(--ink); }
.doc-card-file { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-card .scope-pills { position: relative; z-index: 1; }
.doc-card-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--ink-3); }
.doc-card-foot .push { margin-left: auto; }

.facts { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; font-size: 13px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; color: var(--ink); }

.flash-archive { background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.tag-archive { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--ink-3); margin-left: 6px; vertical-align: 1px; }
.scope-cell { display: flex; align-items: center; gap: 8px; padding-left: calc(var(--depth, 0) * 22px); }
.scope-branch { width: 10px; height: 10px; border-left: 1px solid var(--line-dash); border-bottom: 1px solid var(--line-dash); border-radius: 0 0 0 4px; margin: -8px 0 0 -4px; flex: none; }
.table-scopes td { vertical-align: middle; }
.table-scopes select { max-width: 260px; height: 34px; }
.table-scopes th, .table-scopes td { padding-left: 8px; padding-right: 8px; }
.table-scopes .scope-cell input { width: 180px; flex: none; }
.table-scopes select { width: 180px; max-width: none; }
.table-scopes .icon-select { width: 150px; }
.table-scopes .section-input { width: 140px; height: 34px; }
.table-scopes .narrow-cell { width: 84px; }
.table-scopes .narrow-cell input { width: 68px; }
.scope-ic { width: 20px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); }

.col-action {
    width: 26px; height: 26px; border: 0; background: none; color: var(--ink-3); border-radius: 7px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.col-action:hover { background: var(--ghost-hover); color: var(--ink); }
.column-head .inline-form { display: inline-flex; }

/* ---------- Fuer mich, Verknuepfungen, Liste ---------- */

.quick-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.quick-actions button.btn:first-of-type { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); font-weight: 600; }
.quick-actions button.btn:first-of-type:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.tag-new {
    font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 7px; border-radius: 6px;
    background: var(--accent-soft); color: var(--accent-ink);
}
.comment-new {
    border-left: 3px solid var(--accent); background: var(--accent-soft);
    margin: 0 -22px; padding: 14px 22px 14px 19px;
}
.comment-new + .comment { border-top-color: transparent; }

/* Checklisten, Verweise, Erwaehnungen im Markdown */
.markdown li.task { list-style: none; margin-left: -22px; display: flex; align-items: baseline; gap: 10px; }
.markdown li.task > p { margin: 0; }
.markdown li.task-done { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-dash); }
.task-box { width: 17px; height: 17px; margin: 0; flex: none; accent-color: var(--accent); position: relative; top: 3px; }
[data-tasks-url] .task-box:not([disabled]) { cursor: pointer; }
.task-box.saving { opacity: .5; }
.ref-link {
    font-family: var(--mono); font-size: .86em; font-weight: 500; padding: 1px 6px; border-radius: 6px;
    background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap;
}
.ref-link:hover { color: var(--accent-ink); box-shadow: 0 0 0 1px var(--accent); }
.ref-closed { text-decoration: line-through; text-decoration-color: var(--ink-3); background: var(--surface-3); color: var(--ink-2); }
a.ref-closed:hover { text-decoration: line-through; }
.mention { font-weight: 500; color: var(--accent-ink); background: var(--accent-soft); border-radius: 5px; padding: 0 4px; }

/* Verknuepfungen am Eintrag */
.link-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; }
.link-list li { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13.5px; padding: 9px 0; border-top: 1px solid var(--line-2); }
.link-list li:first-child { border-top: 0; padding-top: 2px; }
.link-kind { flex: none; width: 150px; font-size: 12.5px; color: var(--ink-3); }
.link-blocks .ic, .link-kind.link-blocks { color: var(--danger); font-weight: 600; }
.link-target { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 500; }
.link-target .ref { margin-right: 6px; }
.link-list .st { margin-left: auto; flex: none; }
.link-remove { margin-left: 4px; }
.link-list li:not(:has(.st)) .link-remove { margin-left: auto; }
.link-list-compact li { font-size: 13.5px; }
.link-forms { display: flex; flex-wrap: wrap; gap: 10px 18px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.link-form { display: flex; align-items: center; gap: 8px; margin: 0; flex-wrap: wrap; }
.link-form select, .link-form input { height: 32px; font-size: 13px; width: auto; }
.link-form input { width: 100px; }
.link-form select { max-width: 220px; }

/* Startseite "Fuer mich" */
.me-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 20px; flex-wrap: wrap; }
.me-head h1 { font-size: 26px; margin-bottom: 4px; }
.me-head p { margin: 0; font-size: 14px; }
.me-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.me-tile {
    display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; color: var(--ink);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
a.me-tile:hover { border-color: var(--hover-line); box-shadow: var(--shadow-md); color: var(--ink); }
.me-tile .big { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.me-tile .lbl { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.me-tile.is-alert .big { color: var(--danger); }
.me-tile.is-ok .big { color: var(--st-done-ink); }
.me-layout { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
.me-lists { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.me-notes h2 .ic { vertical-align: -2px; }
.me-list { list-style: none; margin: 0 -22px; padding: 0; }
.me-row {
    display: grid; grid-template-columns: 8px auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
    padding: 10px 22px; border-top: 1px solid var(--line-2);
}
.me-row:hover { background: var(--surface-2); }
.me-row .dot-spacer { width: 8px; }
.me-title { color: var(--ink); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-title:hover { color: var(--accent-hover); }
.me-title.title-unread { font-weight: 650; }
.me-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.note-list { list-style: none; margin: 0 -22px; padding: 0; display: flex; flex-direction: column; }
.note-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 22px; border-top: 1px solid var(--line-2); }
.note-list li:hover { background: var(--surface-2); }
.note-list .avatar { width: 28px; height: 28px; font-size: 11px; }
.note-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.4; }
.note-body:hover { color: var(--ink); }
.note-body strong { color: var(--ink); font-weight: 600; }
.note-title { color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-list time { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.note-unread .note-body { color: var(--ink); }
.note-unread .note-body > span:first-child::before {
    content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 999px; background: var(--accent); margin-right: 7px; vertical-align: 1px;
}

/* Mehrfachauswahl in der Liste: schwebt unten, sobald etwas gewaehlt ist. */
.row-check { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); cursor: pointer; vertical-align: -3px; }
.table .cell-check { width: 34px; padding-right: 0; }
.bulk-bar {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40; width: max-content; max-width: calc(100vw - 32px);
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; padding: 10px 12px 10px 16px;
    background: var(--bulk-bg); color: #FFFFFF; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.bulk-bar.is-hidden { display: none; }
.bulk-count { font-size: 13px; font-weight: 600; padding: 0 6px 0 0; }
.bulk-bar .chip-select, .bulk-bar .btn {
    height: 34px; background-color: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .16); color: #FFFFFF; box-shadow: none;
}
.bulk-bar .chip-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.bulk-bar .chip-select option { color: #0F172A; background: #FFFFFF; }
.bulk-bar .chip-select:hover, .bulk-bar .btn:hover { background-color: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .28); color: #FFFFFF; }
.bulk-bar .btn[type="submit"]:not([name]) { background: var(--accent); border-color: var(--accent); }
.bulk-bar .btn[type="submit"]:not([name]):hover { background: var(--accent-hover); }
tr.is-selected td { background: var(--accent-soft) !important; }

/* Import */
.table-import td { vertical-align: top; }
.table-import select { height: 32px; font-size: 13px; min-width: 120px; }
.table-import small.muted { display: block; margin-top: 2px; font-size: 11.5px; }
.table-import .import-title { font-weight: 600; display: block; }
.table-import .sub { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; max-width: 420px; }

/* @-Vorschlaege im Editor */
.mention-pop {
    position: absolute; left: 12px; z-index: 40; min-width: 200px; max-width: 280px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px;
    display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.mention-pop button {
    display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border: 0; border-radius: 7px;
    background: none; color: var(--ink); font-size: 13px; text-align: left;
}
.mention-pop button[aria-selected="true"], .mention-pop button:hover { background: var(--ghost-hover); }

/* ---------- Tablet ---------- */

@media (max-width: 1200px) {
    .me-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
    .item-layout { grid-template-columns: minmax(0, 1fr); }
    .new-layout { grid-template-columns: minmax(0, 1fr); }
    .row3, .row4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .me-layout { grid-template-columns: minmax(0, 1fr); }
    .wrap { padding: 24px 24px 48px; }
}

/* ---------- Handy ---------- */

@media (max-width: 720px) {
    :root { --topbar-h: 56px; }
    body { font-size: 14.5px; }
    .sidebar { display: none; }
    body.sidebar-mobile-open .sidebar { display: flex; }
    body.sidebar-mobile-open .app::before { content: none; }

    /* Kopfzeile: Marke, Seitenname, Suche und Scopes. Navigation unten. */
    .topbar { padding: 0 12px; gap: 4px; padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
    .topbar .side-toggle-form, .topbar .theme-form, .topbar .bell, .topbar .new-btn, .search .kbd { display: none; }
    .topbar .brand-mobile { display: flex; margin-right: 6px; }
    .brand-mobile .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
    .topbar .page-name { display: block; flex: 1; }
    .topbar .spacer { display: none; }
    .topbar .search-toggle, .topbar .scopes-toggle { display: inline-flex; }
    .search {
        display: none; position: absolute; left: 0; right: 0; top: 100%; max-width: none; margin: 0;
        padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line);
    }
    body.search-open .search, .search.has-value { display: block; }
    .search .ico { left: 24px; }

    .tabbar {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
        height: calc(64px + env(safe-area-inset-bottom)); padding: 6px 4px env(safe-area-inset-bottom);
        background: var(--surface); border-top: 1px solid var(--line);
    }
    .tabbar a {
        position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        font-size: 11px; font-weight: 600; color: var(--ink-3);
    }
    .tabbar a[aria-current="page"] { color: var(--accent); }
    .tab-badge {
        position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
        background: var(--accent); color: #FFFFFF; font-size: 10px; font-weight: 700;
        display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--surface);
    }
    .fab {
        display: inline-flex; position: fixed; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 44;
        width: 56px; height: 56px; border-radius: 18px; align-items: center; justify-content: center;
        background: var(--accent); color: #FFFFFF; box-shadow: 0 10px 24px rgba(79, 70, 229, .4);
    }
    .fab:hover { color: #FFFFFF; background: var(--accent-hover); }
    .content { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

    .wrap { padding: 14px 14px 32px; }
    .wrap-fluid { padding-top: 8px; }
    h1 { font-size: 21px; }
    .filters-title { display: none; }

    /* Board: eine Spalte je Bildschirmbreite, Leiste zum Springen. Einklappen
       gibt es hier nicht, alle Spalten sind erreichbar. */
    .board-tabs {
        display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -14px 12px; padding: 6px 14px;
        position: sticky; top: var(--topbar-h); z-index: 5; background: var(--bg);
    }
    .board-tabs::-webkit-scrollbar { display: none; }
    .board-tab {
        flex: none; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px;
        border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2);
        font-size: 13px; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow-sm);
    }
    .board-tab .count { font-size: 12px; color: var(--ink-3); font-weight: 500; background: none; padding: 0; }
    .column:not(.column-closed) .column-head { display: none; }
    .board-tab[aria-current="true"] { background: var(--chip-on); border-color: var(--chip-on); color: var(--chip-on-ink); }
    .board-tab[aria-current="true"] .count { color: inherit; opacity: .75; }
    .board-scroll { margin: 0 -14px; padding: 0 14px 16px; scroll-snap-type: x mandatory; scroll-padding: 14px; }
    .board { gap: 12px; }
    .column, .column.collapsed { flex: 0 0 calc(100vw - 44px); min-width: 0; scroll-snap-align: start; }
    .column.collapsed .column-head { flex-direction: row; height: 34px; padding: 0 4px 0 6px; border: 0; background: none; }
    .column.collapsed .column-head .col-actions { margin-left: auto; order: 0; }
    .column.collapsed .column-label { writing-mode: horizontal-tb; transform: none; }
    .column.collapsed .column-note, .column.collapsed .col-archive { display: inline-flex; }
    .column.collapsed .column-body { min-height: 96px; }
    .column.collapsed .card { display: flex; }
    .column.collapsed .dropnote { display: block; }
    .col-toggle { display: none; }
    .board-hint { display: none; }
    .card-title { font-size: 14.5px; }

    /* Liste: jede Zeile als Karte, gleiche Tabelle. */
    .table-items, .table-items tbody { display: block; min-width: 0; }
    .table-items thead { display: none; }
    .table-items tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
    .table-items tbody tr:last-child { border-bottom: 0; }
    .table-items td { display: block; padding: 0 !important; border: 0; }
    .table-items tbody tr:hover td { background: none; }
    .table-items .cell-title { flex: 1 1 100%; order: -1; }
    .table-items .cell-title .title { font-size: 15px; }
    .table-items .cell-scope { font-size: 12.5px; color: var(--ink-3); }
    .table-items .cell-prio:empty, .table-items .cell-check, .table-items .cell-prio:has(.prio-normal) { display: none; }
    .table-items .cell-who .who { font-size: 13px; }
    .table-items .cell-who .muted { display: none; }
    .table-items .cell-when { margin-left: auto; font-size: 12px; }
    .table-wrap { overflow-x: visible; }
    .table-wrap:has(.table-items) { overflow: hidden; }
    .bulk-bar { display: none !important; }

    .me-tiles { gap: 10px; margin-bottom: 16px; }
    .me-tile { padding: 12px 14px; }
    .me-tile .big { font-size: 22px; }
    .me-tile .lbl { font-size: 12px; }
    .me-head { margin-bottom: 14px; }
    .me-head h1 { font-size: 22px; }
    .me-head-actions { display: none; }
    .me-row { grid-template-columns: 8px auto minmax(0, 1fr); padding: 10px 16px; }
    .me-meta { grid-column: 2 / -1; flex-wrap: wrap; }
    .me-list, .note-list { margin: 0 -16px; }
    .note-list li { padding: 12px 16px; }
    .link-list li { flex-wrap: wrap; gap: 4px 10px; }
    .link-kind { width: 100%; }

    .row2, .row3, .row4 { grid-template-columns: minmax(0, 1fr); }
    .project-row { grid-template-columns: minmax(0, 1fr); }
    .item-title h1 { font-size: 21px; }
    .section { padding: 16px; }
    .comment-new { margin: 0 -16px; padding: 14px 16px 14px 13px; }
    .new-form { padding: 18px 16px; }
    .meta-form label { grid-template-columns: 88px minmax(0, 1fr); }
    .item-badges .tools { margin-left: 0; width: 100%; }
    .filters {
        flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 2px 14px 12px;
    }
    .filters::-webkit-scrollbar { display: none; }
    .filters > * { flex: none; }
    .filters .summary { margin-left: 4px; }
    .list-foot span:last-child { display: none; }
    .doc-current { grid-template-columns: 44px minmax(0, 1fr); }
    .doc-current .btns { grid-column: 1 / -1; }
    .version-form { grid-template-columns: minmax(0, 1fr); }
    .doc-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .doc-card { min-height: 0; }

    .login-aside { padding: 32px 24px; gap: 24px; flex-basis: 100%; }
    .login-pitch h2 { font-size: 26px; }
    .login-points, .login-foot { display: none; }
    .login-main { padding: 28px 16px 40px; align-items: flex-start; }
    .auth { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
