/* Müller Power – redesign (white, black, grey, green). Geist, soft radii,
 * white cards on an off-white page, black primary buttons, Holz-Müller green
 * as the accent for links, active states and progress. Every colour is a
 * token on :root; dark mode only redefines the tokens. No build step. */
@font-face {
  font-family: "Geist";
  src: url("/static/vendor/fonts/geist-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/static/vendor/fonts/geist-italic-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/static/vendor/fonts/geist-mono-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------- Tokens */
:root {
  /* surfaces */
  --bg: #fafaf8;            /* page */
  --surface: #ffffff;       /* cards, sidebar, header */
  --surface-sunken: #f3f3f1; /* board columns, segmented controls */
  --surface-subtle: #fafaf8; /* table heads, inputs, quiet blocks */
  --hover: #f4f4f2;
  --row-hover: #fcfcfb;
  /* text */
  --ink: #111111;
  --ink-2: #3a3a38;         /* body copy in secondary places */
  --ink-3: #5e5e5a;         /* labels */
  --muted: #6b6b67;         /* meta text */
  --faint: #8a8a86;         /* icons, placeholders */
  /* lines */
  --line: #ecece8;          /* card borders */
  --line-input: #e4e4e1;    /* buttons, inputs */
  --line-soft: #f0f0ee;     /* row separators */
  --line-strong: #cfcfcb;   /* hover borders */
  --line-dashed: #d6d6d2;
  /* accent: Holz-Müller green */
  --accent: #007a00;
  --accent-hover: #006400;
  --accent-deep: #1f4d14;   /* text on --accent-soft */
  --accent-soft: #eef4ea;
  --accent-light: #c4e3c4;
  --accent-ink: #ffffff;    /* text on --accent */
  --link-hover: #1f4d14;
  /* primary buttons: black */
  --primary: #111111;
  --primary-hover: #2a2a28;
  --primary-ink: #ffffff;
  /* status */
  --ok: #1f4d14;
  --ok-soft: #eef4ea;
  --warn: #8a5a12;
  --warn-dot: #b7791f;
  --warn-soft: #fbf3e4;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --tag-bg: #f2f2f0;
  --tag-ink: #4a4a47;
  --avatar-bg: #ededea;
  --add-bg: #e6f2e3;
  --add-ink: #1f4d14;
  --del-bg: #fdecea;
  --del-ink: #7a1f18;
  --overlay: rgba(250, 250, 248, 0.72);
  --backdrop: rgba(17, 17, 17, 0.35);
  /* shape */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-menu: 0 8px 24px rgba(17, 17, 17, 0.1), 0 1px 3px rgba(17, 17, 17, 0.06);
  --focus: 0 0 0 3px rgba(0, 122, 0, 0.18);
  --sidebar-w: 248px;
  --header-h: 64px;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --logo-plate: transparent;
  /* old token names still used in a few inline styles */
  --card: var(--surface);
  --card-muted: var(--surface-sunken);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e0d;
    --surface: #171716;
    --surface-sunken: #1e1e1c;
    --surface-subtle: #1b1b19;
    --hover: #232321;
    --row-hover: #1c1c1a;
    --ink: #ededea;
    --ink-2: #cfcfca;
    --ink-3: #b0b0aa;
    --muted: #9a9a94;
    --faint: #7c7c76;
    --line: #2a2a27;
    --line-input: #34342f;
    --line-soft: #232321;
    --line-strong: #4a4a45;
    --line-dashed: #3e3e39;
    --accent: #4cb84c;
    --accent-hover: #63c763;
    --accent-deep: #a6dca6;
    --accent-soft: #1a2918;
    --accent-light: #2f5a2c;
    --accent-ink: #0b0f0a;
    --link-hover: #7fd07f;
    --primary: #ededea;
    --primary-hover: #ffffff;
    --primary-ink: #111111;
    --ok: #a6dca6;
    --ok-soft: #1a2918;
    --warn: #e3ae63;
    --warn-dot: #d39a45;
    --warn-soft: #33281a;
    --danger: #f2877b;
    --danger-soft: #3a1f1c;
    --tag-bg: #262624;
    --tag-ink: #cfcfca;
    --avatar-bg: #2c2c29;
    --add-bg: #1d3420;
    --add-ink: #b8e6c0;
    --del-bg: #45231e;
    --del-ink: #f2b8ad;
    --overlay: rgba(14, 14, 13, 0.72);
    --backdrop: rgba(0, 0, 0, 0.55);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-menu: 0 8px 24px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
    --focus: 0 0 0 3px rgba(76, 184, 76, 0.28);
    --logo-plate: #ffffff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e0d;
  --surface: #171716;
  --surface-sunken: #1e1e1c;
  --surface-subtle: #1b1b19;
  --hover: #232321;
  --row-hover: #1c1c1a;
  --ink: #ededea;
  --ink-2: #cfcfca;
  --ink-3: #b0b0aa;
  --muted: #9a9a94;
  --faint: #7c7c76;
  --line: #2a2a27;
  --line-input: #34342f;
  --line-soft: #232321;
  --line-strong: #4a4a45;
  --line-dashed: #3e3e39;
  --accent: #4cb84c;
  --accent-hover: #63c763;
  --accent-deep: #a6dca6;
  --accent-soft: #1a2918;
  --accent-light: #2f5a2c;
  --accent-ink: #0b0f0a;
  --link-hover: #7fd07f;
  --primary: #ededea;
  --primary-hover: #ffffff;
  --primary-ink: #111111;
  --ok: #a6dca6;
  --ok-soft: #1a2918;
  --warn: #e3ae63;
  --warn-dot: #d39a45;
  --warn-soft: #33281a;
  --danger: #f2877b;
  --danger-soft: #3a1f1c;
  --tag-bg: #262624;
  --tag-ink: #cfcfca;
  --avatar-bg: #2c2c29;
  --add-bg: #1d3420;
  --add-ink: #b8e6c0;
  --del-bg: #45231e;
  --del-ink: #f2b8ad;
  --overlay: rgba(14, 14, 13, 0.72);
  --backdrop: rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-menu: 0 8px 24px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
  --focus: 0 0 0 3px rgba(76, 184, 76, 0.28);
  --logo-plate: #ffffff;
  color-scheme: dark;
}

/* ------------------------------------------------------------------ Base */
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01" 0;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--link-hover); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.6em; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: 34px; line-height: 1.15; letter-spacing: -0.025em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }
code, pre, kbd { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--tag-bg); padding: 0.1em 0.35em; border-radius: 5px; }
pre { background: var(--surface-subtle); border: 1px solid var(--line); padding: 0.75rem 1rem; border-radius: var(--radius); overflow-x: auto; }
pre code { background: none; padding: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Icons and avatars */
.i { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.av, .avatar {
  width: 24px; height: 24px; border-radius: 50%; background: var(--avatar-bg); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; flex-shrink: 0; letter-spacing: 0.01em;
}
.avatar { width: 30px; height: 30px; font-size: 11px; }
.av.dark, .avatar.dark { background: var(--primary); color: var(--primary-ink); }
.avatar.lg, .av.lg { width: 48px; height: 48px; font-size: 15px; }
.avatar.xl { width: 64px; height: 64px; font-size: 20px; }
.avatar.sm, .av.sm { width: 28px; height: 28px; font-size: 11px; }

/* ---------------------------------------------------------------- Layout */
.app { display: flex; min-height: 100vh; }
/* Keep the sidebar's white column (and its border) running down long pages. */
@media (min-width: 861px) {
  .app { background: linear-gradient(to right, var(--surface) calc(var(--sidebar-w) - 1px), var(--line) calc(var(--sidebar-w) - 1px), var(--line) var(--sidebar-w), transparent var(--sidebar-w)); }
}
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 24px; padding: 20px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px; color: var(--ink); }
.brand:hover { color: var(--ink); }
/* The PNG (300x105) has ~100px of empty space right of the mark: crop it. */
.brand-logo { display: block; height: 40px; width: auto; aspect-ratio: 200 / 105; object-fit: cover; object-position: left center; background: var(--logo-plate); border-radius: 4px; }
.brand-sep { width: 1px; height: 30px; background: var(--line-input); flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-weight: 700; font-size: 14px; letter-spacing: -0.01em; }
.brand-text small { font-size: 12px; color: var(--muted); }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group.bottom { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.nav-section { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 0 10px 6px; }
.sidebar .nav {
  display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: 14px; font-weight: 500; line-height: 1.25;
}
.sidebar .nav:hover { background: var(--hover); color: var(--ink); }
.sidebar .nav.active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.sidebar .nav .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); font-family: var(--mono); }
.nav .sq { width: 8px; height: 8px; border-radius: 2px; background: var(--line-strong); margin: 0 5px; flex-shrink: 0; }
.nav.active .sq { background: var(--accent); }
.sidebar-backdrop { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h); display: flex; align-items: center; gap: 12px; padding: 0 32px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar-spacer { flex: 1; }
.online { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 6px; border-radius: var(--radius); cursor: default; }
.online-avatars { display: inline-flex; }
.online-avatars .av { width: 28px; height: 28px; font-size: 10px; border: 2px solid var(--surface); margin-left: -8px; position: relative; }
.online-avatars .av:first-child { margin-left: 0; }
.online-avatars .av::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.online-avatars .av.more::after { display: none; }
.online-avatars .av.more { background: var(--surface-sunken); color: var(--ink-3); }
.online-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.search {
  flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px;
  border: 1px solid var(--line-input); border-radius: var(--radius); background: var(--surface-subtle); color: var(--muted);
}
.search:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.search input[type="search"] { border: 0; background: transparent; outline: none; box-shadow: none; flex: 1; min-width: 0; padding: 0; height: auto; font-size: 14px; color: var(--ink); }
.search input[type="search"]:focus { box-shadow: none; }
.kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-input); border-radius: var(--radius-xs); padding: 2px 6px; color: var(--muted); background: var(--surface); line-height: 1.3; }
.icon-btn {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; position: relative;
  border: 0; background: transparent; border-radius: var(--radius); color: var(--ink-2); cursor: pointer; padding: 0; flex-shrink: 0;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.outlined { border: 1px solid var(--line-input); background: var(--surface); }
.menu-btn { display: none; }
.theme-btn .theme-sun { display: none; }
:root[data-theme="dark"] .theme-btn .theme-sun { display: block; }
:root[data-theme="dark"] .theme-btn .theme-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .theme-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .theme-moon { display: none; }
}
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.profile-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 4px; border-radius: var(--radius); font-size: 14px; font-weight: 500; color: var(--ink); }
.profile-btn:hover { background: var(--hover); }
.user-menu .menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-menu); padding: 6px; z-index: 40;
}
.user-menu .menu > a, .user-menu .menu > form > button, .user-menu .menu > form > .linklike {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--ink); font-size: 14px; font-weight: 500;
}
.user-menu .menu > a:hover, .user-menu .menu > form > button:hover { background: var(--hover); color: var(--ink); }
.user-menu .menu .i { color: var(--muted); }
.menu-head { padding: 8px 10px 10px; font-size: 13px; border-bottom: 1px solid var(--line); margin-bottom: 6px; line-height: 1.4; }
.menu-head small { display: block; }
.menu-name { display: block; font-weight: 600; color: var(--ink); }

.content { flex: 1; width: 100%; max-width: 1240px; padding: 40px 40px 64px; min-width: 0; }
.content.wide { max-width: none; }
.content.narrow { max-width: 1000px; }
.content.reading { max-width: 920px; }
.content-public { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.content-public > * { width: 100%; max-width: 420px; }

/* ------------------------------------------------------------ Components */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 24px; min-width: 0; }
.card + .card { margin-top: 20px; }
.card > h2:first-child, .card > h3:first-child, .card-head h2 { margin-top: 0; }
.card h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 14px; }
.card h3 { font-size: 14px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .empty { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head a { font-size: 13px; font-weight: 500; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.stack > .card + .card { margin-top: 0; }
.grid { display: grid; gap: 20px; }
/* Grid items default to min-width: auto, so a long <select> option would widen the whole column. */
.grid > * { min-width: 0; }
.grid > .card + .card { margin-top: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.grid-main-side { grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.grid-main-aside { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.grid-doc { grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; align-items: start; }
.sticky-side { position: sticky; top: calc(var(--header-h) + 24px); }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; }
.page-head > div:first-child { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.page-head h1 { margin: 0; overflow-wrap: anywhere; }
.page-head .eyebrow, .eyebrow { font-size: 13px; color: var(--muted); font-weight: 500; }
.page-head .sub { color: var(--ink-3); margin: 0; font-size: 13px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions > form { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--radius);
  border: 1px solid var(--line-input); background: var(--surface); color: var(--ink); cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap; line-height: 1; text-decoration: none;
}
.btn:hover { background: var(--hover); color: var(--ink); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--primary-ink); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-icon { width: 40px; padding: 0; }
.btn-sm.btn-icon { width: 34px; }
.btn-block { width: 100%; }
.btn[disabled], .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn .i { width: 16px; height: 16px; }
.linklike { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.linklike:hover { color: var(--link-hover); text-decoration: underline; }
.linklike.quiet { color: var(--muted); font-size: 12px; }
.linklike.quiet:hover { color: var(--danger); }

input, select, textarea, button { font: inherit; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="date"], input[type="url"], input[type="number"], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-input); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 14px;
}
select { padding-right: 32px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a86' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
select[multiple] { height: auto; background-image: none; padding: 6px; }
textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.5; border-radius: var(--radius); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }
input[type="file"] { font-size: 13px; color: var(--ink-3); }
input[type="file"]::file-selector-button { font: inherit; font-size: 13px; font-weight: 500; height: 32px; padding: 0 12px; margin-right: 10px; border: 1px solid var(--line-input); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); cursor: pointer; }
input[type="file"]::file-selector-button:hover { background: var(--hover); }
textarea.editor { min-height: 60vh; font-family: var(--mono); font-size: 13px; tab-size: 2; }
label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 6px; color: var(--ink-3); }
.field { margin-bottom: 16px; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row > .field { flex: 1 1 160px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; }
.inline-form label { margin: 0; }
.help { font-size: 12px; color: var(--muted); margin: 6px 0 0; line-height: 1.5; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); margin: 0; cursor: pointer; }
.check input { margin: 0; width: 18px; height: 18px; }

.flash, .alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 12px; margin-bottom: 20px; font-size: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.flash { background: var(--accent-soft); border-color: transparent; color: var(--accent-deep); font-weight: 500; }
.flash-warn, .alert-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.flash-error, .alert-error { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.alert { display: block; }
.alert.ok { background: var(--accent-soft); color: var(--accent-deep); border-color: transparent; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--radius-xs);
  background: var(--tag-bg); color: var(--tag-ink); font-size: 12px; font-weight: 500; white-space: nowrap; vertical-align: middle; line-height: 1;
}
a.tag:hover { color: var(--ink); background: var(--hover); }
.tag.accent, .tag.ok { background: var(--accent-soft); color: var(--accent-deep); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.danger { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.tag.neutral { background: var(--tag-bg); color: var(--muted); }
.tag.solid { background: var(--primary); color: var(--primary-ink); }
.tag .i { width: 13px; height: 13px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-input); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
}
.chip.has-av { padding-left: 4px; }
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.chip.active .av { background: rgba(255, 255, 255, 0.18); color: inherit; }
.chip.sm { height: 30px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; padding: 3px; border-radius: var(--radius); background: var(--surface-sunken); gap: 2px; }
.seg a, .seg button, .seg label {
  height: 34px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-sm); background: transparent;
  font-size: 13px; font-weight: 500; color: var(--ink-3); cursor: pointer; margin: 0; white-space: nowrap;
}
.seg a:hover, .seg button:hover, .seg label:hover { color: var(--ink); }
.seg .active, .seg input:checked + label { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg.full { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.seg.full label { height: 32px; padding: 0 6px; }

/* Long task titles in the options must not widen the page. */
.dep-add { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.dep-add select { flex: 1 1 0; width: 100%; min-width: 0; }
#abhaengigkeiten .list li { flex-wrap: nowrap; }
#abhaengigkeiten .list .grow { min-width: 0; overflow-wrap: anywhere; }
.dep-badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 20px; overflow-x: auto; }
.tabs a { padding: 10px 12px; font-size: 14px; font-weight: 500; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-color: var(--ink); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-top: 1px solid var(--line-soft); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 160px; }
.list .meta, .meta { font-size: 12px; color: var(--muted); }
.list .grow > a { color: var(--ink); font-weight: 500; }
.list .grow > a:hover { color: var(--accent); }

/* Row list (Start, Meine Aufgaben, Suche): checkbox | title + meta | date */
.rows { display: flex; flex-direction: column; }
.row-item { display: flex; align-items: center; gap: 14px; padding: 12px 8px; border-radius: var(--radius); color: var(--ink); min-width: 0; }
.row-item:hover { background: var(--row-hover); color: var(--ink); }
.rows.lined .row-item { border-radius: 0; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; color: var(--ink); }
.row-main:hover { color: var(--ink); }
.row-title { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.rows.lined .row-title { font-size: 15px; }
.row-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.row-end { font-size: 13px; color: var(--ink-3); white-space: nowrap; flex-shrink: 0; }
.row-end.today { color: var(--ink); font-weight: 600; }
.row-end.overdue { color: var(--danger); font-weight: 600; }
.row-item .i { color: var(--faint); }
.row-item .chk .i { color: inherit; }
.row-item.done .row-title { text-decoration: line-through; color: var(--muted); }
.group-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 10px; font-size: 13px; font-weight: 600; }
.group-head + .row-item, .group-head + form + .row-item { border-top: 0; }
.group-head .n { font-family: var(--mono); font-weight: 500; color: var(--muted); font-size: 12px; }
.group-head.overdue { color: var(--danger); }
.group-head:not(:first-child) { border-top: 1px solid var(--line); }
.chk {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface);
  flex-shrink: 0; cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: transparent;
}
.chk .i { width: 12px; height: 12px; stroke-width: 2.4; }
.chk:hover { border-color: var(--accent); color: var(--accent); }
.chk.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
form.chk-form { display: contents; }

table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table th { font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--surface-subtle); border-bottom-color: var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; overflow-x: auto; background: var(--surface); }
.card .table-wrap { border-radius: var(--radius); }
.card > .table-wrap:first-child { margin-top: 0; }
.empty { color: var(--muted); padding: 4px 0; margin: 0; font-size: 13px; }
.empty-box { border: 1.5px dashed var(--line-dashed); border-radius: 12px; padding: 24px 14px; text-align: center; font-size: 13px; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.kpis.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
a.kpi:hover { border-color: var(--line-strong); color: var(--ink); }
.kpi .label { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.kpi .num { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .num.danger { color: var(--danger); }
.progress { height: 4px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
details.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 10px; background: var(--surface); }
details.box > summary { cursor: pointer; font-weight: 500; font-size: 14px; list-style: none; display: flex; align-items: center; gap: 8px; }
details.box > summary::-webkit-details-marker { display: none; }
details.box > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint); transform: rotate(-45deg); transition: transform 0.15s; margin-right: 2px; }
details.box[open] > summary::before { transform: rotate(45deg); }
details.box[open] > summary { margin-bottom: 12px; }
.due { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.assignee { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.due.overdue { color: var(--danger); font-weight: 600; }
.due.soon { color: var(--warn); font-weight: 600; }
.doc-status-archived { opacity: 0.65; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: var(--ink); }
.dot.ring { background: transparent; border: 1.5px solid var(--faint); }
.dot.green { background: var(--accent); }
.dot.amber { background: var(--warn-dot); }
.count-inline { font-size: 12px; font-weight: 500; color: var(--muted); font-family: var(--mono); }

/* --------------------------------------------------------- Markdown prose */
.prose { max-width: 76ch; font-size: 15px; line-height: 1.65; color: var(--ink-2); overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--ink); }
.prose h1 { font-size: 26px; margin: 0 0 12px; }
.prose h2 { font-size: 20px; letter-spacing: -0.01em; margin: 32px 0 10px; }
.prose h3 { font-size: 16px; margin: 24px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 13px; line-height: 1.45; display: block; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.prose th, .prose td { border-bottom: 1px solid var(--line-soft); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-subtle); font-size: 12px; font-weight: 600; color: var(--ink-3); border-bottom-color: var(--line); }
.prose tr:last-child td { border-bottom: 0; }
.prose blockquote { border-left: 2px solid var(--accent); margin: 16px 0; padding: 2px 16px; color: var(--ink-3); }
.prose a { color: var(--accent); }
.prose a.wikilink { background: var(--accent-soft); color: var(--accent-deep); padding: 0 0.3em; border-radius: 4px; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 14px; }
.prose li + li { margin-top: 0.25em; }
.prose hr { margin: 24px 0; }
.prose img { border-radius: var(--radius); }
.prose.sm { font-size: 14px; line-height: 1.6; }
.prose.sm > :last-child { margin-bottom: 0; }
article.card.prose, .reader { padding: 40px 48px; max-width: none; }
.reader-wrap { max-width: 760px; }

/* ----------------------------------------------------------------- Editor */
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.preview { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; background: var(--surface); min-height: 60vh; overflow: auto; }
.editor-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 12px; font-weight: 500; color: var(--ink-3); }

/* Markdown toolbar: sits on top of its textarea as one bordered box */
.md-toolbar { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 4px; border: 1px solid var(--line-input); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; background: var(--surface); }
.md-toolbar + textarea, .md-toolbar + .mention-wrap textarea { border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.md-btn { min-width: 30px; height: 30px; padding: 0 8px; border: 0; border-radius: var(--radius-xs); background: none; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.md-btn:hover, .md-btn:focus-visible { background: var(--surface-sunken); color: var(--ink); }
.md-bold { font-weight: 800; }
.md-italic { font-style: italic; }
.md-h2, .md-h3 { font-size: 12px; }
.md-sep { width: 1px; height: 18px; background: var(--line-input); margin: 0 4px; }

/* ------------------------------------------------------------------- Diff */
.diff { font-family: var(--mono); font-size: 12px; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: auto; background: var(--surface); }
.diff .line { display: flex; white-space: pre-wrap; word-break: break-word; }
.diff .line span.no { flex: none; width: 3rem; text-align: right; padding-right: 0.5rem; color: var(--muted); user-select: none; }
.diff .line span.txt { flex: 1; padding: 1px 10px; }
.diff .add { background: var(--add-bg); color: var(--add-ink); }
.diff .del { background: var(--del-bg); color: var(--del-ink); }
.diff .hunk { background: var(--surface-sunken); color: var(--muted); }
.diff-stats .add { color: var(--accent); font-weight: 600; }
.diff-stats .del { color: var(--danger); font-weight: 600; }

/* ------------------------------------------------------------------ Board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 8px; align-items: start; scroll-snap-type: x proximity; }
.column { background: var(--surface-sunken); border-radius: var(--radius-lg); padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; scroll-snap-align: start; max-height: calc(100vh - 220px); }
.column.is-done { opacity: 0.92; }
.column-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 6px; }
.column-head h2 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0; }
.column.is-done .column-head h2 { color: var(--ink-3); }
.column-head .i { width: 14px; height: 14px; color: var(--accent); }
.column-head .count { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.task-list { display: flex; flex-direction: column; gap: 8px; min-height: 48px; overflow-y: auto; flex: 1; padding: 1px; border-radius: 12px; }
.task-list:empty { border: 1.5px dashed var(--line-dashed); }
.task-list:empty::before { content: "Karte hierher ziehen"; display: block; padding: 14px; text-align: center; font-size: 13px; color: var(--muted); }
.task-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; cursor: grab; }
.task-card:hover { border-color: var(--line-strong); }
.task-card:active { cursor: grabbing; }
.task-card.dragging { opacity: 0.6; }
.task-card .card-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.task-card .title { display: block; color: var(--ink); font-weight: 500; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.task-card .title:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.task-card .foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-card .foot:not(:has(*)) { display: none; }
.task-card .comments { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.task-card .comments .i { width: 14px; height: 14px; }
.task-card.done .title { text-decoration: line-through; color: var(--muted); }
.prio-pill { font-size: 11px; font-weight: 600; color: var(--danger); background: var(--danger-soft); border-radius: var(--radius-xs); padding: 3px 7px; white-space: nowrap; line-height: 1.2; }
.task-card.prio-low { opacity: 0.85; }
.sortable-ghost { opacity: 0.4; background: var(--accent-soft); border-color: var(--accent-light); }
.add-task details > summary, .add-task > summary {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px; border-radius: var(--radius-sm); list-style: none;
  font-size: 13px; font-weight: 500; color: var(--ink-3); cursor: pointer;
}
.add-task summary::-webkit-details-marker { display: none; }
.add-task summary:hover { background: var(--hover); color: var(--ink); }
.column .add-task summary:hover { background: var(--line); }
.add-task .i { width: 16px; height: 16px; }
.add-task form { display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 2px; }
.add-task .row { display: flex; gap: 8px; flex-wrap: wrap; }
.add-task .row > * { flex: 1 1 120px; width: auto; }
.add-task .row > .btn { flex: 0 0 auto; }

/* Board filters + sort */
.board-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 12px; }
.sort-switch { display: inline-flex; align-items: center; gap: 10px; }
.sort-switch .seg a { height: 30px; padding: 0 12px; font-size: 12px; }

/* Task list view */
.task-sections { display: flex; flex-direction: column; gap: 12px; }
.task-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.task-section > summary { display: flex; align-items: center; gap: 10px; padding: 14px 20px; cursor: pointer; list-style: none; }
.task-section > summary::-webkit-details-marker { display: none; }
.task-section > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint); transform: rotate(-45deg); transition: transform 0.15s; }
.task-section[open] > summary::after { transform: rotate(45deg); }
.task-section[open] > summary { border-bottom: 1px solid var(--line); }
.task-section-name { font-size: 14px; font-weight: 600; }
.task-section .count { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.task-section .empty { padding: 14px 20px; }
.task-rows { list-style: none; margin: 0; padding: 0; }
.task-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.task-row:first-child { border-top: 0; }
.task-row:hover { background: var(--row-hover); }
.task-row .title { flex: 1 1 280px; color: var(--ink); font-weight: 500; font-size: 15px; }
.task-row .title:hover { color: var(--accent); }
.task-row.done .title { text-decoration: line-through; color: var(--muted); }
.task-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.task-row { scroll-margin-top: calc(var(--header-h) + 16px); }
.task-row:target { background: var(--accent-soft); }
.task-row-column { order: 3; margin-left: auto; }
.task-row-column select { width: auto; min-width: 130px; height: 34px; font-size: 13px; }
.task-section > .add-task { margin: 0; padding: 8px 12px; border-top: 1px solid var(--line-soft); }
.task-section > .add-task form { padding: 6px 8px 8px; }
.task-section > .add-task .row input[type="text"] { flex: 2 1 240px; }

/* ------------------------------------------------- Presence (Anwesenheit) */
.month-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.month-nav strong { min-width: 140px; text-align: center; font-size: 15px; font-weight: 600; }
.presence-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.cal-head, .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: 12px 14px; font-size: 12px; font-weight: 600; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 110px; padding: 10px 12px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 6px; scroll-margin-top: 80px; }
.cal-week:last-child .cal-day { border-bottom: 0; }
.cal-week .cal-day:last-child { border-right: 0; }
.cal-day:hover { background: var(--row-hover); }
.cal-day.weekend { background: var(--surface-subtle); }
.cal-day.other-month .cal-date { color: var(--faint); }
.cal-day.other-month .cal-people { opacity: 0.6; }
.cal-day:target { background: var(--accent-soft); }
.cal-date { font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }
.cal-num { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; margin: -4px 0 -4px -6px; border-radius: 999px; }
.cal-day.today .cal-num { background: var(--primary); color: var(--primary-ink); font-weight: 600; }
.cal-wd { display: none; }
.cal-today { font-size: 11px; font-weight: 600; color: var(--muted); }
.cal-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cal-people li { display: flex; justify-content: space-between; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; line-height: 1.3; min-height: 24px; padding: 3px 4px 3px 8px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-deep); }
.cal-people li.me { background: var(--accent); color: var(--accent-ink); }
.cal-people li.me .cal-note, .cal-people li.me .cal-remove { color: inherit; opacity: 0.8; }
.cal-people li.absent { background: var(--tag-bg); color: var(--ink-3); }
.cal-people li.absent.me { background: var(--surface-sunken); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.cal-note { color: var(--ink-3); font-weight: 400; }
.away-line { display: block; font-size: 12px; color: var(--muted); }
.cal-remove { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 4px; line-height: 1; font-size: 15px; border-radius: 999px; }
.cal-remove:hover { color: var(--danger); }
.cal-people li.me .cal-remove:hover { color: inherit; opacity: 1; }
.cal-add { margin-top: auto; }
.cal-add button { border: 1px dashed var(--line-dashed); background: none; color: var(--ink-3); font: inherit; font-size: 12px; font-weight: 500; height: 24px; padding: 0 8px; cursor: pointer; width: 100%; border-radius: 999px; opacity: 0; transition: opacity 0.1s; }
.cal-add button:hover { border-color: var(--accent); color: var(--accent); }
.cal-day:hover .cal-add button, .cal-add button:focus-visible { opacity: 1; }
@media (hover: none) { .cal-add button { opacity: 1; } }
.weekday-pick { border: 0; padding: 0; margin: 0 0 16px; }
.weekday-pick legend { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-bottom: 6px; padding: 0; }
.weekday-pick label { display: inline-flex; align-items: center; gap: 4px; margin: 0 8px 4px 0; font-size: 13px; color: var(--ink); }
.weekday-pick input { width: auto; }
.presence-when { flex: 0 0 4.5rem; font-size: 14px; color: var(--ink-3); }
@media (max-width: 1100px) {
  .presence-layout { grid-template-columns: 1fr; }
}
/* Phones: the month becomes a list of days; neighbouring months' days are hidden. */
@media (max-width: 700px) {
  .cal-head { display: none; }
  .cal-week { display: block; }
  .cal-day { min-height: 0; border-right: 0; flex-direction: row; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--line-soft) !important; }
  .cal-day.other-month { display: none; }
  .cal-date { flex: 0 0 5rem; }
  .cal-num { margin: 0; }
  .cal-wd { display: inline; color: var(--muted); font-size: 12px; }
  .cal-people { flex: 1 1 0; flex-direction: row; flex-wrap: wrap; }
  .cal-add { margin-top: 0; }
  .cal-add button { width: auto; }
}

/* --------------------------------------------------------------- Timeline */
.timeline { overflow-x: auto; padding: 0; }
.tl-grid { min-width: 860px; position: relative; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.tl-labels { border-right: 1px solid var(--line-soft); }
.tl-labels .tl-label-head, .tl-months { height: 44px; border-bottom: 1px solid var(--line); }
.tl-labels .tl-label-head { padding: 12px 20px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.tl-label { height: 52px; padding: 0 20px; display: flex; flex-direction: column; justify-content: center; gap: 2px; border-top: 1px solid var(--line-soft); min-width: 0; }
.tl-label:first-of-type { border-top: 0; }
.tl-label a { font-size: 14px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-label a:hover { color: var(--accent); }
.tl-label span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tl-months { display: flex; }
.tl-months > div { font-size: 12px; font-weight: 500; color: var(--ink-3); padding: 12px 0 12px 8px; border-left: 1px solid var(--line-soft); white-space: nowrap; overflow: hidden; }
.tl-months > div:first-child { border-left: 0; }
.tl-rows { position: relative; }
.tl-row { position: relative; height: 52px; border-top: 1px solid var(--line-soft); }
.tl-row:first-child { border-top: 0; }
.tl-bar { position: absolute; top: 12px; height: 28px; border-radius: 7px; min-width: 10px; }
.tl-bar:hover { color: #fff; filter: brightness(1.08); }
.tl-bar.erledigt { opacity: 0.5; }
.tl-today { position: absolute; top: 0; bottom: 0; margin-left: -1px; width: 2px; background: var(--ink); z-index: 2; }
.tl-today::after { content: "Heute"; position: absolute; bottom: 8px; left: 6px; font-size: 11px; font-weight: 600; background: var(--ink); color: var(--bg); border-radius: 5px; padding: 2px 6px; white-space: nowrap; }
.tl-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); }
.tl-legend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.ms-list .ms-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

/* ------------------------------------------------------------------ Team */
.profile-card { display: flex; flex-direction: column; gap: 16px; color: var(--ink); padding: 24px; }
a.profile-card:hover { border-color: var(--line-strong); color: var(--ink); }
.profile-card .head { display: flex; gap: 14px; align-items: center; }
.profile-card .head h3 { margin: 0; font-size: 16px; }
.profile-card .headline { color: var(--ink-3); font-size: 13px; line-height: 1.4; }
.profile-card .excerpt { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.profile-card .foot { display: flex; gap: 12px; align-items: center; margin-top: auto; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line-soft); padding-top: 14px; }
.profile-card .foot b { font-weight: 600; color: var(--ink); }
.profile-card .foot .end { margin-left: auto; }
.profile-head, .page-head > div.profile-head { display: flex; flex-direction: row; gap: 16px; align-items: center; }
.profile-head h1 { margin: 0; }

/* ------------------------------------------------------------------- Feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.feed-item:first-child { border-top: 0; }
.feed-item .grow { flex: 1; min-width: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.feed-item .grow > strong { font-weight: 600; color: var(--ink); }
.feed-item .grow > a { font-weight: 500; }
.feed-item .meta { margin-top: 2px; }
.feed-item .new-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 9px; flex-shrink: 0; }
.feed-item.important .grow > strong::after { content: ""; }
.feed-quote { margin-top: 6px; padding: 8px 12px; background: var(--surface-subtle); border-radius: var(--radius-sm); font-size: 13px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.card.flush .feed-item { padding: 14px 20px; }
.feed.compact .feed-item { padding: 10px 0; gap: 0; }
.feed.compact .feed-item .av, .feed.compact .feed-item .new-dot { display: none; }
.feed.compact .feed-item .grow { font-size: 13px; }
.feed.compact .feed-quote { display: none; }
.news-card { border-color: var(--accent-light); }
.news-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.news-head h2 { margin: 0; }
.filters { display: flex; gap: 10px 16px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.filters label { margin: 0; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); font-weight: 400; }
.filters select { width: auto; height: 38px; }
.filters .check { color: var(--ink); font-size: 14px; }
.day-head { padding: 16px 20px 8px; font-size: 13px; font-weight: 600; margin: 0; }
.day-head:not(:first-child) { border-top: 1px solid var(--line); }
.day-head .muted { font-weight: 400; }

/* -------------------------------------------------------------------- AI */
.ai-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
.tool-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); }
.tool-card:hover { border-color: var(--line-strong); color: var(--ink); }
.tool-card.active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.tool-card b { font-size: 14px; font-weight: 600; }
.tool-card span { font-size: 13px; color: var(--ink-3); line-height: 1.45; }
.doc-picker { max-height: 280px; overflow: auto; border: 1px solid var(--line-input); border-radius: var(--radius); padding: 8px 12px; background: var(--surface); }
.doc-picker label { display: flex; gap: 8px; align-items: center; font-weight: 400; color: var(--ink); margin: 2px 0; font-size: 14px; padding: 3px 0; }
.doc-picker input { width: auto; margin: 0; }
.doc-picker .space-name { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 10px 0 2px; }
.doc-picker .space-name:first-child { margin-top: 2px; }
.ai-result { margin-top: 24px; }
.token-badge { font-size: 12px; color: var(--muted); font-weight: 400; }
.usage-line { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------ Chat */
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: start; }
.chat-list { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - 120px); overflow-y: auto; padding: 18px 16px; }
.chat-list-head { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 8px; padding: 0 4px; }
.chat-list .list li { flex-direction: column; align-items: stretch; gap: 2px; padding: 8px 4px; }
.chat-list a { color: var(--ink); font-size: 14px; font-weight: 500; }
.chat-list a:hover { color: var(--accent); }
.chat-list a.active { color: var(--accent-deep); font-weight: 600; }
.chat-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.chat-thread { display: flex; flex-direction: column; gap: 16px; }
.msg { max-width: 80ch; }
.msg-user { align-self: flex-end; max-width: min(72ch, 85%); background: var(--primary); color: var(--primary-ink); padding: 12px 16px; border-radius: 16px 16px 4px 16px; white-space: pre-wrap; font-size: 15px; }
.msg-ai { background: var(--surface); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 18px 22px; }
.msg-ai .prose { font-size: 15px; }
.msg-ai .prose > :last-child { margin-bottom: 0; }
.msg-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.msg-meta { display: flex; gap: 16px; align-items: center; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 12px; }
.composer { background: var(--surface); border: 1px solid var(--line-input); border-radius: 16px; padding: 6px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04); }
.composer:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.composer textarea { border: 0; box-shadow: none; outline: none; background: transparent; padding: 16px 18px 8px; font-size: 16px; min-height: 96px; }
.composer textarea:focus { box-shadow: none; }
.composer-foot { display: flex; align-items: center; gap: 12px; padding: 6px 8px 6px 18px; }
.composer-foot .help { margin: 0; flex: 1; }
.suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.suggestions form { display: contents; }
.sug { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font: inherit; font-size: 14px; line-height: 1.45; color: var(--ink); text-align: left; cursor: pointer; width: 100%; }
.sug:hover { border-color: var(--line-strong); }
.sug:disabled { opacity: 0.5; cursor: not-allowed; }
.sug .i { color: var(--accent); margin-top: 1px; }
.section-label { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-label a { font-weight: 500; }
@media (max-width: 960px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-list { position: static; max-height: 260px; }
}

/* --------------------------------------------------- Notifications (bell) */
.bell-count { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center; font-variant-numeric: tabular-nums; border: 2px solid var(--surface); box-sizing: content-box; }
.notif-menu .menu.notif-list { width: min(380px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; }
.notif-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.notif-head .linklike { width: auto; padding: 0; font-size: 13px; }
.notif { display: flex !important; flex-direction: column; gap: 2px; padding: 10px 10px 10px 22px !important; color: var(--ink); font-size: 13px; line-height: 1.4; border-radius: var(--radius-sm); position: relative; }
.notif:hover { background: var(--hover); color: var(--ink); }
.notif.unread::before { content: ""; position: absolute; left: 9px; top: 16px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.notif-time { font-size: 12px; color: var(--muted); }
.notif-all { justify-content: center; font-size: 13px; color: var(--accent) !important; border-top: 1px solid var(--line); border-radius: 0 0 6px 6px !important; margin-top: 6px; }
.notif-page { list-style: none; margin: 0; padding: 6px; }
.notif-page li + li { border-top: 1px solid var(--line-soft); }

/* --------------------------------------------------- Task detail sections */
.sec { display: flex; flex-direction: column; gap: 14px; }
.sec > h2, .sec-head h2 { margin: 0; font-size: 15px; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sec .help { margin: 0; }
.details-panel { display: flex; flex-direction: column; gap: 18px; }
.details-panel .field { margin: 0; }
.details-panel label { margin-bottom: 6px; }
.details-panel select, .details-panel input { height: 38px; }
.side-meta { font-size: 12px; color: var(--muted); line-height: 1.6; padding: 0 4px; margin-top: 16px; }
.save-state { font-size: 12px; color: var(--muted); margin: 0; }
.save-state.dirty { color: var(--warn); }
.desc-box { background: var(--surface-subtle); border-radius: var(--radius); padding: 16px 18px; }
.link-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.link-line a { font-weight: 500; }
.link-line .i { width: 16px; height: 16px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.two-col > * { min-width: 0; }
.two-col > .card + .card { margin-top: 0; }
.file-drop { border: 1.5px dashed var(--line-dashed); border-radius: 12px; padding: 20px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.file-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.file-drop .i { width: 22px; height: 22px; color: var(--muted); }
.file-drop strong { font-size: 14px; font-weight: 500; }
.file-drop small { font-size: 12px; }
.file-drop input[type="file"] { max-width: 100%; }
.doc-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
.doc-link:hover { border-color: var(--line-strong); color: var(--ink); }
.doc-link .i { color: var(--muted); }
.doc-link .grow { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.doc-link .grow b { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.doc-link .grow small { font-size: 12px; }
.doc-link-wrap { display: flex; align-items: center; gap: 8px; }
.doc-link-wrap .doc-link { flex: 1; min-width: 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.kv:first-of-type { border-top: 0; }
.kv > span:first-child { color: var(--ink-3); flex-shrink: 0; }
.kv > span:last-child { text-align: right; min-width: 0; overflow-wrap: anywhere; }

/* Aufgaben vorschlagen */
.suggestion { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; }
.suggestion-pick { margin-top: 10px; }
.suggestion-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.suggestion-title { font-weight: 600; }
.suggestion textarea { min-height: 56px; font-size: 13px; }
.suggestion-body .field-row > * { flex: 1 1 150px; width: auto; }
.suggestion:has(.suggestion-pick input:not(:checked)) .suggestion-body { opacity: 0.45; }
.suggestion-foot { position: sticky; bottom: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; box-shadow: var(--shadow-menu); }

/* Team-Chat */
.tc { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.tc-list { display: flex; flex-direction: column; gap: 4px; padding: 20px 20px 12px; height: calc(100vh - 330px); min-height: 320px; overflow-y: auto; }
.tc-day { display: flex; align-items: center; gap: 12px; margin: 14px 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tc-day::before, .tc-day::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.tc-msg { display: flex; gap: 10px; align-items: flex-end; max-width: 78%; }
.tc-msg.first { margin-top: 8px; }
.tc-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.tc-msg .av, .tc-av-space { width: 28px; height: 28px; flex-shrink: 0; }
.tc-bubble { background: var(--surface-sunken); border-radius: 14px 14px 14px 4px; padding: 8px 12px 6px; min-width: 0; }
.tc-msg.mine .tc-bubble { background: var(--primary); color: var(--primary-ink); border-radius: 14px 14px 4px 14px; }
.tc-msg.mine .prose, .tc-msg.mine .prose a { color: var(--primary-ink); }
.tc-msg.mine .mention { background: rgba(255, 255, 255, 0.18); color: inherit; }
.tc-name { font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.tc-bubble .prose { font-size: 14px; line-height: 1.5; }
.tc-bubble .prose > :last-child { margin-bottom: 0; }
.tc-meta { display: flex; justify-content: flex-end; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); margin-top: 2px; }
.tc-msg.mine .tc-meta, .tc-msg.mine .tc-meta .linklike { color: var(--primary-ink); opacity: 0.7; }
.tc-meta .linklike { font-size: 11px; opacity: 0; }
.tc-msg:hover .tc-meta .linklike, .tc-meta .linklike:focus-visible { opacity: 1; }
.tc-meta [data-reply]:hover { color: var(--accent); text-decoration: underline; }
.tc-msg.mine .tc-meta [data-reply]:hover { color: var(--primary-ink); }
@media (hover: none) { .tc-meta .linklike { opacity: 0.7; } }
.tc-highlight .tc-bubble { animation: tc-flash 2s ease-out; }
@keyframes tc-flash { 0%, 40% { box-shadow: 0 0 0 2px var(--accent); } 100% { box-shadow: 0 0 0 2px transparent; } }
.tc-quote { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px; padding: 4px 8px; border-left: 2px solid var(--accent); border-radius: 4px; background: rgba(127, 127, 127, 0.1); font-size: 12px; color: inherit; max-width: 100%; }
.tc-quote:hover { color: inherit; background: rgba(127, 127, 127, 0.18); }
.tc-quote b { font-weight: 600; }
.tc-quote span { opacity: 0.8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-msg.mine .tc-quote { border-left-color: var(--primary-ink); }
.tc-replybar { flex-basis: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-left: 2px solid var(--accent); border-radius: 6px; background: var(--surface-sunken); font-size: 13px; color: var(--ink-2); }
.tc-replybar-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tc-empty { margin: auto; text-align: center; }
.tc-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface); }
.tc-form .mention-wrap, .tc-form > textarea { flex: 1; min-width: 0; }
.tc-form textarea { min-height: 40px; max-height: 200px; height: 40px; padding: 9px 12px; resize: vertical; }
.nav-unread { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 7px; font-weight: 600; line-height: 18px; }
@media (max-width: 860px) {
  .tc-list { height: calc(100vh - 280px); padding: 12px; }
  .tc-msg { max-width: 92%; }
}

/* Toast (new chat message on other pages) */
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 2px; max-width: min(360px, calc(100vw - 40px)); padding: 12px 16px; border-radius: 12px; background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-menu); font-size: 13px; transition: opacity 0.4s, transform 0.4s; }
.toast:hover { color: var(--primary-ink); }
.toast strong { font-size: 14px; }
.toast span { opacity: 0.8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast.gone { opacity: 0; transform: translateY(8px); }

/* Hängt fest */
.stuck-card { border-color: var(--warn-soft); }
.stuck-card h2 .i { color: var(--warn-dot); }
.stuck-reason { color: var(--warn); }
.stuck-line { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; font-weight: 500; color: var(--warn); }
.stuck-line .i { width: 14px; height: 14px; margin-top: 1px; color: var(--warn-dot); }
.task-card .stuck-line { order: 0; }
.task-row .stuck-line.task-status { color: var(--warn); }
.task-row .stuck-line.task-status .i { color: var(--warn-dot); }
.stuck-alert { display: flex; gap: 10px; align-items: flex-start; }

/* Status updates on tasks */
.status-current { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; }
.status-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.status-current .status-text { font-size: 15px; font-weight: 500; color: var(--ink); }
.status-current .meta { margin-top: 6px; }
form.inline { display: inline; }
.status-history summary { cursor: pointer; font-size: 13px; color: var(--accent); }
.status-history .list { margin-top: 6px; }
.status-form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.status-form textarea { min-height: 72px; background: var(--surface-subtle); }
.task-status { flex-basis: 100%; order: 4; display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--ink-2); overflow: hidden; }
.task-status > span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.task-status .i { width: 14px; height: 14px; color: var(--accent); margin-top: 2px; }
.task-card .task-status { order: 0; font-size: 12px; color: var(--ink-3); }
.notif-detail { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Checklist inside a task */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; }
.checklist li form:first-child { flex: 1; min-width: 0; }
.checklist label { display: flex; align-items: flex-start; gap: 12px; margin: 0; font-size: 14px; font-weight: 400; line-height: 1.5; color: var(--ink); cursor: pointer; }
.checklist input[type="checkbox"] { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.checklist li.done .ck-text { text-decoration: line-through; color: var(--muted); }
.checklist .meta { font-size: 12px; margin-top: 3px; }
.checklist li .cal-remove { opacity: 0; margin-top: 1px; }
.checklist li:hover .cal-remove, .checklist li .cal-remove:focus-visible { opacity: 1; }
@media (hover: none) { .checklist li .cal-remove { opacity: 1; } }
.checklist-add { display: flex; gap: 8px; align-items: flex-start; }
.checklist-add textarea { min-height: 40px; height: 40px; padding: 9px 12px; flex: 1; border-style: dashed; border-color: var(--line-dashed); resize: vertical; }
.checklist-add textarea:focus { border-style: solid; height: 72px; }

/* Files on a task */
.file-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.file-gallery figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface-subtle); }
.file-gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.file-gallery figcaption { display: flex; justify-content: space-between; align-items: center; gap: 4px; padding: 4px 4px 4px 8px; font-size: 12px; }
.file-gallery figcaption span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-upload { display: flex; flex-direction: column; gap: 10px; align-items: center; }

/* Notes attached to a task */
.task-note { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-subtle); padding: 12px 14px; }
.task-note-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.task-note-head strong { font-size: 14px; }
.task-note-head .actions { gap: 12px; font-size: 13px; }
.task-note .prose { font-size: 14px; }
.task-note .prose > :last-child { margin-bottom: 0; }
.task-note .meta { margin-top: 6px; }
.attach-forms details.box { margin: 0; }
.attach-forms { display: flex; flex-direction: column; gap: 8px; }

/* Comments and @mentions */
.comment { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line-soft); scroll-margin-top: 80px; }
.comment:first-child { border-top: 0; padding-top: 0; }
.comment .grow { flex: 1; min-width: 0; }
.comment .meta { margin-bottom: 4px; }
.comment .meta strong { color: var(--ink); font-weight: 600; font-size: 13px; }
.comment:target { background: var(--accent-soft); border-radius: var(--radius); padding-left: 10px; padding-right: 10px; }
.comment-form { display: flex; gap: 12px; align-items: flex-start; }
.comment-form > .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.comment-form .form-foot { display: flex; justify-content: flex-end; }
.mention { color: var(--accent-deep); font-weight: 600; background: var(--accent-soft); padding: 0 0.25em; border-radius: 4px; }
.mention-wrap { position: relative; }
.mention-suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; list-style: none; margin: 4px 0 0; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-menu); max-width: 360px; }
.mention-suggest li { display: flex; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: var(--radius-xs); cursor: pointer; font-size: 14px; }
.mention-suggest li span { color: var(--muted); font-size: 12px; }
.mention-suggest li.active, .mention-suggest li:hover { background: var(--hover); }

.autosave-status { font-size: 12px; color: var(--muted); flex: 1 1 260px; }
.draft-notice { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

.news-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: auto; background: var(--danger); flex-shrink: 0; }
.news-dot[hidden] { display: none; }
.changelog h2 { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-top: 28px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.changelog h2:first-child { margin-top: 0; }
.changelog li + li { margin-top: 0.45em; }

/* Busy overlay (AI calls) */
.busy { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--overlay); backdrop-filter: blur(3px); }
.busy-card { display: flex; align-items: center; gap: 16px; min-width: 300px; max-width: calc(100vw - 32px); padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-menu); }
.busy-card strong { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.busy-card small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.spinner { flex: none; width: 26px; height: 26px; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* Login */
.login-card { padding: 32px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-card h1 { font-size: 24px; margin-bottom: 6px; }
.login-card .btn-primary { width: 100%; height: 44px; margin-top: 4px; }

/* ------------------------------------------------------------- Responsive */
@media (max-width: 1100px) {
  .grid-main-side, .grid-main-aside, .grid-doc { grid-template-columns: minmax(0, 1fr); }
  .sticky-side { position: static; }
  .ai-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .editor-grid, .grid-2, .grid-3, .two-col { grid-template-columns: 1fr; }
  .content { padding: 28px 24px 48px; }
  .topbar { padding: 0 24px; }
}
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .hide-sm { display: none !important; }
  .topbar { padding: 0 12px; gap: 6px; }
  .search { height: 38px; }
  .content { padding: 20px 16px 48px; }
  h1 { font-size: 28px; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform 0.2s; box-shadow: none; }
  body.sidebar-open .sidebar { transform: none; box-shadow: var(--shadow-menu); }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: var(--backdrop); z-index: 45; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .kpis.kpis-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis.kpis-4 > .kpi:last-child { grid-column: 1 / -1; }
  .kpi { padding: 14px; }
  .kpi .num { font-size: 26px; }
  .board { grid-auto-columns: 82vw; }
  .column { max-height: none; }
  .page-head { align-items: flex-start; }
  .suggestions, .ai-tools { grid-template-columns: 1fr; }
  article.card.prose, .reader { padding: 24px 20px; }
  .tl-grid { grid-template-columns: 180px minmax(0, 1fr); }
  .rows.lined .row-item { padding: 12px 16px; }
}
@media (max-width: 520px) {
  .kpi { padding: 12px; gap: 4px; }
  .kpi .label { font-size: 12px; line-height: 1.3; }
  .kpi .num { font-size: 22px; }
  .profile-btn .user-name { display: none; }
}

/* ------------------------------------------------------ Print: documents */
@media print {
  .topbar, .sidebar, .sidebar-backdrop, .tabs, .actions, .flash, .no-print, .editor-toolbar { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  .card, article.card.prose { border: 0; box-shadow: none; padding: 0; }
  body { background: #fff; color: #000; }
  .prose { max-width: none; font-size: 11pt; color: #000; }
  .prose a { color: #000; text-decoration: underline; }
  .prose table { display: table; }
}

/* Document rows (Bereich, Suche) */
.doc-row { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; border-top: 1px solid var(--line-soft); color: var(--ink); }
.doc-row:first-child { border-top: 0; }
.doc-row:hover { background: var(--row-hover); color: var(--ink); }
.doc-row > .i { color: var(--faint); margin-top: 2px; }
.doc-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.doc-row .doc-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.doc-row .doc-title b { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.doc-row .doc-excerpt { font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.doc-row > .meta { text-align: right; }
.archive-restore { display: flex; gap: 8px; align-items: center; margin: 0; flex-wrap: wrap; justify-content: flex-end; }
.archive-restore select { width: auto; height: 34px; font-size: 13px; }
@media (max-width: 700px) { .doc-row:has(.archive-restore) { flex-wrap: wrap; } .archive-restore { width: 100%; } }
