/* VetrexTask – stylesheet. Plain, dense, tool-like. No webfonts, no frameworks.
   One calm panel language for app, admin and support panel: dark navy surfaces, flat areas with a 1 px border (--border),
   hierarchy through type size, weight and spacing. One accent colour (brand violet: primary buttons, links, active states).
   Status = small dot + text (green/yellow/red), no pills, no shadows, no gradients (except the logo), radius 6 px. Dark is the default theme. */

:root {
  --accent: #5b27d9;
  --accent-fill: #5b27d9; /* background behind white text (counts, avatars, primary buttons on the public pages) */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f1f4;
  --field: #ffffff;
  --hover: #eef0f3;
  --border: #e1e3e8;
  --border-strong: #cbced6;
  --text: #1b1d24;
  --text-2: #4f5361;
  --text-3: #60647a; /* meta text: ≥ 4.5:1 on every surface (WCAG 1.4.3) */
  --control: #80869a; /* border of fields and other controls: ≥ 3:1 on the surface (WCAG 1.4.11) */
  --star: #a87c00;
  --ink: #1b1d24;
  --ink-text: #ffffff;
  --success: #2b742e;
  --warning: #a15c07;
  --danger: #c92a2a;
  --r: 6px;
  --r-sm: 6px;
  --sidebar: 248px;
  --font: system-ui, "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --accent: #9a7bf7;
  --accent-fill: #6d4ae6;
  --bg: #17181f;
  --surface: #1e1f28;
  --surface-2: #252631;
  --field: #16171d;
  --hover: #262834;
  --border: #2d2f3c;
  --border-strong: #3b3e4e;
  --text: #e7e8ee;
  --text-2: #a8abbb;
  --text-3: #9598ab;
  --control: #6f748c;
  --star: #d9a400;
  --ink: #e7e8ee;
  --ink-text: #17181f;
  --success: #4fb056;
  --warning: #e0a53c;
  --danger: #ee6a62;
  color-scheme: dark;
}

/* Accent colours. --accent: lines, focus, text on the page; --accent-fill: behind white text (AA in both themes). */
:root[data-accent="orange"] { --accent: #c2410c; --accent-fill: #c2410c; }
:root[data-accent="blue"] { --accent: #1c6fd1; --accent-fill: #1c6fd1; }
:root[data-accent="violet"] { --accent: #5b27d9; --accent-fill: #5b27d9; }
:root[data-accent="green"] { --accent: #2f7d32; --accent-fill: #2f7d32; }
:root[data-accent="red"] { --accent: #c92a2a; --accent-fill: #c92a2a; }
:root[data-accent="cyan"] { --accent: #0b7285; --accent-fill: #0b7285; }
:root[data-theme="dark"][data-accent="orange"] { --accent: #f2711c; }
:root[data-theme="dark"][data-accent="blue"] { --accent: #4c94e8; }
:root[data-theme="dark"][data-accent="violet"] { --accent: #9a7bf7; --accent-fill: #6d4ae6; }
:root[data-theme="dark"][data-accent="green"] { --accent: #51a356; }
:root[data-theme="dark"][data-accent="red"] { --accent: #ee6a62; }
:root[data-theme="dark"][data-accent="cyan"] { --accent: #22a3b8; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; }
h1 { font-size: 18px; letter-spacing: -.01em; }
h2 { font-size: 15px; }
h3 { font-size: 13.5px; }
p { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 13px; height: 13px; }
.icon.lg { width: 20px; height: 20px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ------------------------------------------------------------------ layout
   App and panels share one frame: dark sidebar (.panel-side, see "shell" below), top bar (.panel-top),
   banner slot (.shell-banners) and content. App: ≥ 1024 px full sidebar, 641–1023 px icon rail,
   ≤ 640 px bottom tab bar + "Mehr" sheet. */

.wordmark { display: flex; align-items: center; gap: 8px; padding: 2px 8px 16px; font-weight: 700; font-size: 15px; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
.wordmark::before { content: ""; width: 24px; height: 24px; flex: none; background: url(img/logo.png?v=2) center / contain no-repeat; }
.app { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 18px 28px 96px; max-width: 2200px; width: 100%; }
.content:focus { outline: none; }
/* Page head (pageHead() in dom.js): title + subtitle left, breadcrumb and actions top right */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 18px; }
.page-head .sub { color: var(--text-3); margin-top: 3px; font-size: 13px; font-weight: 400; max-width: 72ch; }
.page-head-text { min-width: 0; }
.page-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; min-width: 0; }
.page-head-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.crumbs ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; gap: 4px 8px; font-size: 12.5px; color: var(--text-3); justify-content: flex-end; }
.crumbs li + li::before { content: "›"; margin-right: 8px; }
.crumbs a { color: var(--text-3); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumbs [aria-current] { color: var(--text-2); }
@media (max-width: 640px) { .page-head-side { width: 100%; align-items: flex-start; } .page-head-actions { justify-content: flex-start; } .page-head .crumbs { display: none; } }

/* Top bar of the app: title left, search and "+ Neu" right */
.top-logo, .topbar .top-search-btn, .tabbar { display: none; }
.top-search { width: 300px; }
.top-search .input { padding-right: 56px; }
.top-search .kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); pointer-events: none; background: var(--surface); }
.top-search:focus-within .kbd { display: none; }

/* Footer of the app sidebar: account button, legal links */
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--p-line); }
.side-foot .panel-user { margin-top: 0; }
.app .app-side .legal-links { justify-content: flex-start; gap: 2px 9px; padding: 10px 8px 0; font-size: 11px; }
.app .app-side .legal-links a { color: var(--p-dim); }
.app .app-side .legal-links a:hover { color: #fff; }

/* Tablet: the sidebar shrinks to an icon rail (labels stay for screen readers, title = tooltip) */
@media (max-width: 1023px) and (min-width: 641px) {
  .app .app-side { width: 64px; padding: 14px 8px; }
  .app .app-side .panel-brand { justify-content: center; padding: 2px 0 16px; }
  .app .app-side .panel-brand-text, .app .app-side .panel-group-label, .app .app-side .legal-links,
  .app .app-side .panel-link > .icon.sm, .app .app-side .panel-user-text, .app .app-side .panel-user > .icon { display: none; }
  .app .app-side .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .app .app-side .panel-nav { gap: 10px; }
  .app .app-side .panel-group + .panel-group { border-top: 1px solid var(--p-line); padding-top: 10px; }
  .app .app-side .panel-link { justify-content: center; padding: 10px 0; }
  .app .app-side .panel-link .icon { width: 18px; height: 18px; }
  .app .app-side .panel-link.active::before { left: -8px; }
  .app .app-side .panel-link .count { position: absolute; top: 3px; right: 5px; padding: 0 3px; font-size: 10.5px; line-height: 16px; background: var(--p-bg); border-radius: 3px; color: #fff; }
  .app .app-side .panel-user { justify-content: center; padding: 6px 0; background: none; }
  .content { padding: 20px 22px 96px; }
  .app .panel-top { padding: 0 22px; }
  .top-search { width: 240px; }
}

/* Phone: tab bar at the bottom, compact top bar */
@media (max-width: 640px) {
  .app .app-side { display: none; }
  .app .panel-top { height: auto; min-height: 52px; gap: 4px; padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); }
  .top-logo { display: block; flex: none; margin-right: 6px; }
  .top-title { font-size: 16px; }
  .top-search { display: none; }
  .topbar .top-search-btn.icon-only { display: inline-flex; width: 44px; height: 44px; color: var(--text); }
  .topbar .top-new { width: 40px; height: 40px; padding: 0; margin-left: 2px; }
  .top-new .new-label { display: none; }
  .content { padding: 16px 14px calc(92px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 14px; gap: 10px; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--border);
    padding: 4px max(4px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
  }
  .tabbar a, .tabbar button {
    flex: 1; min-width: 0; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 2px 0;
    font-size: 11px; font-weight: 500; color: var(--text-2); text-decoration: none; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .tab-icon { position: relative; display: grid; place-items: center; width: 56px; height: 30px; }
  .tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar .active { color: var(--accent); font-weight: 600; }
  .tabbar .active .tab-icon { color: var(--accent); }
  .tab-icon .count { position: absolute; top: -2px; left: 32px; padding: 0 3px; font-size: 10.5px; line-height: 16px; background: var(--surface); border-radius: 3px; }
  .tabbar :focus-visible { outline-offset: -2px; }
}

/* ------------------------------------------------------------------ controls */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--hover); border-color: var(--border-strong); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }
.btn.primary:hover { background: var(--accent-fill); filter: brightness(1.12); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.ghost.danger, .btn.ghost.danger:hover { color: var(--danger); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12.5px; }
.btn.icon-only { width: 32px; padding: 0; }
.btn.sm.icon-only { width: 26px; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.link-btn { border: 0; background: none; padding: 0; color: var(--text-2); cursor: pointer; font-size: 12.5px; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }
.link-btn:hover { color: var(--text); }

.input, select.input, textarea.input {
  width: 100%; height: 32px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--control);
  background: var(--field); color: var(--text);
}
textarea.input { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--accent); }
.input:focus-visible { outline-offset: 0; }
.input::placeholder { color: var(--text-3); }
input[type="range"].input { border: 0; box-shadow: none; padding: 0; accent-color: var(--accent); }
.search-box { position: relative; }
.search-box .icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search-box .input { padding-left: 30px; }
.kbd { font-family: var(--mono); font-size: 10.5px; padding: 0 5px; border: 1px solid var(--border); border-radius: 3px; color: var(--text-3); }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.checkbox-line { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-line input { width: 15px; height: 15px; accent-color: var(--accent); }

.segmented { display: inline-flex; align-self: flex-start; width: fit-content; border: 1px solid var(--control); border-radius: var(--r-sm); overflow: hidden; }
.segmented button { border: 0; border-right: 1px solid var(--control); background: var(--field); padding: 5px 12px; cursor: pointer; color: var(--text-2); font-size: 13px; }
.segmented button:last-child { border-right: 0; }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface-2); color: var(--accent); font-weight: 600; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .search-box { width: 240px; }
.toolbar select.input { width: auto; min-width: 140px; }
.btn.filter-toggle { display: none; }
.filter-toggle .count[hidden] { display: none; }
@media (max-width: 640px) {
  .toolbar .search-box { width: 100%; }
  .toolbar.filters .search-box { width: auto; flex: 1 1 0; }
  .toolbar .btn.filter-toggle { display: inline-flex; height: 40px; }
  .toolbar.filters:not(.open) > select { display: none; }
  .toolbar select.input { flex: 1 1 calc(50% - 4px); width: calc(50% - 4px); min-width: 0; }
  .segmented button { padding: 6px 10px; }
}

/* ------------------------------------------------------------------ panels & lists */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.card-pad { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; min-height: 40px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { font-size: 13px; color: var(--text); font-weight: 600; }
.card-head a, .card-head .small { font-size: 12px; color: var(--text-3); }
.card-body { padding: 4px 14px 8px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); align-items: start; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
@media (max-width: 640px) { .grid.two, .grid.three { grid-template-columns: minmax(0, 1fr); } }

/* Key figures: flat rows (label left, figure right) in one bordered area, no tiles */
.kpis { display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 16px; overflow: hidden; }
.kpi { flex: 1 1 230px; display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; min-height: 40px; padding: 10px 14px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); margin: 0 -1px -1px 0; text-decoration: none; color: inherit; }
a.kpi:hover { background: var(--hover); }
.kpi-label { order: 1; flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--text-2); }
.kpi-hint { order: 3; flex: 1 1 100%; font-size: 12px; color: var(--text-3); margin-top: -2px; }
.kpi-value { order: 2; font-size: 14px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; }
.kpi-value.alert { color: var(--danger); }

.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 10px; padding: 7px 2px; min-height: 40px; border-bottom: 1px solid var(--border); min-width: 0; }
.row:last-child { border-bottom: 0; }
.row.clickable { cursor: pointer; margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.row.clickable:hover { background: var(--hover); }
a.row { color: inherit; text-decoration: none; }
.row-side { width: 130px; flex: none; text-align: right; }
.row-side.narrow { width: 110px; }
.phone-only { display: none !important; }
.row-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.row-meta { display: flex; gap: 2px 12px; flex-wrap: wrap; color: var(--text-2); font-size: 12px; margin-top: 1px; align-items: center; }
.row-meta span { display: inline-flex; align-items: center; gap: 4px; }
.row-time { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.group-title { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 16px 0 4px; display: flex; gap: 6px; align-items: baseline; }
.group-title .n { font-family: var(--mono); font-weight: 400; }
.group-title.danger { color: var(--danger); }
/* project/order colours stay in editors, calendar and detail pages; list rows carry a quiet neutral rule (one accent colour only) */
.colorbar { width: 2px; align-self: stretch; border-radius: 1px; flex: none; min-height: 18px; background: var(--border-strong) !important; }

/* Project table */
.ptable { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.prow {
  display: grid; grid-template-columns: 3px minmax(0, 2.4fr) minmax(0, 1fr) 150px 90px 70px; gap: 14px; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; color: inherit; text-decoration: none;
}
.prow:last-child { border-bottom: 0; }
.prow:hover { background: var(--hover); }
.prow.head { cursor: default; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border-radius: var(--r) var(--r) 0 0; padding-top: 8px; padding-bottom: 8px; }
.prow.head:hover { background: var(--surface-2); }
.prow .name { font-weight: 500; }
.prow .sub { font-size: 12px; color: var(--text-2); }
.prow .num { font-family: var(--mono); font-size: 12px; color: var(--text-2); text-align: right; }
.progress-cell { display: flex; align-items: center; gap: 8px; }
.progress-cell .mono { width: 34px; text-align: right; color: var(--text-2); }
@media (max-width: 760px) {
  .prow { grid-template-columns: 3px minmax(0, 1fr) 96px; }
  .prow > :nth-child(3), .prow > :nth-child(5), .prow > :nth-child(6) { display: none; }
  .prow.head { display: none; }
}

/* Status = small dot + text (statusDot() in dom.js), meta = plain grey text (metaText()). No pills, no tinted boxes. */
.status, .badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; line-height: 1.4; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }
.status[data-tone="ok"]::before { background: var(--success); }
.status[data-tone="warn"]::before { background: var(--warning); }
.status[data-tone="bad"]::before { background: var(--danger); }
.status[data-tone="bad"] { color: var(--danger); }
.meta { font-size: 12.5px; color: var(--text-3); }
.count-n { font-family: var(--mono); font-weight: 400; color: var(--text-3); }
h1 .count-n { margin-left: 8px; font-size: 13px; }
.prio-high { color: var(--warning); font-weight: 600; font-size: 12px; }
.prio-critical { color: var(--danger); font-weight: 700; font-size: 12px; }
.chip-list { display: flex; gap: 4px 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); background: none; border: 0; padding: 0; text-decoration: none; }
a.chip:hover { color: var(--text); text-decoration: underline; }
button.chip { cursor: pointer; border: 1px solid var(--control); border-radius: var(--r-sm); padding: 2px 8px; background: var(--field); }
button.chip:hover { border-color: var(--border-strong); color: var(--text); }
button.chip.active { border-color: var(--accent); color: var(--accent); }

.progress { height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; flex: 1; }
.progress > div { height: 100%; background: var(--accent); }

.checkbox {
  width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--control); background: var(--field); flex: none;
  display: grid; place-items: center; cursor: pointer; padding: 0; color: #fff;
}
.checkbox:hover { border-color: var(--text-2); }
.checkbox.done { background: var(--accent-fill); border-color: var(--accent-fill); }
.checkbox .icon { width: 11px; height: 11px; stroke-width: 3; }
.task-title.done { text-decoration: line-through; color: var(--text-3); }
.overdue { color: var(--danger) !important; }
.due-today { color: var(--warning) !important; }

.empty { padding: 18px 0; color: var(--text-2); }
.empty strong { color: var(--text); font-weight: 600; display: block; margin-bottom: 2px; }
.empty .btn, .empty .link-btn { margin-top: 10px; }

.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 0; cursor: pointer; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: 13.5px; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-head { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.detail-meta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--text-2); margin-top: 6px; }
.back { font-size: 12.5px; color: var(--text-3); display: inline-block; margin-bottom: 10px; text-decoration: none; }
.back:hover { color: var(--text); }
.mark { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; flex: none; border: 1px solid var(--border); background: var(--surface); }  /* legacy: no longer used by the views */

/* ------------------------------------------------------------------ dialogs, menus, toasts */

.backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(18, 18, 17, .45); display: flex; align-items: flex-start; justify-content: center; padding: 7vh 14px 14px; overflow-y: auto; }
.modal { width: 100%; max-width: 620px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); display: flex; flex-direction: column; }
.modal.wide { max-width: 780px; }
.modal.narrow { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; border-radius: 0 0 var(--r) var(--r); }
.modal-foot .left { margin-right: auto; }

.menu { position: fixed; z-index: 120; min-width: 190px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 4px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 6px 8px; border: 0; background: none; border-radius: 3px; cursor: pointer; text-align: left; font-size: 13.5px; }
.menu button .icon { color: var(--text-3); }
.menu button:hover { background: var(--hover); }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

.toast-live { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 6px; align-items: center; }
@media (max-width: 640px) { .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); } }
.toast { padding: 8px 14px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); font-size: 13px; max-width: min(460px, calc(100vw - 28px)); }
.toast.error { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ------------------------------------------------------------------ auth & install */

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 14px; }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.auth-card .wordmark { padding: 0 0 6px; font-size: 17px; }
.auth-card .wordmark::before { width: 26px; height: 26px; }
.auth-card h2 { font-size: 18px; }
.auth-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.auth-foot { font-size: 13px; color: var(--text-2); }

/* Login, registration, password reset (auth.js): split layout. Left the form column (logo, DE | EN, light/dark,
   form, legal links), right a picture inset by 12 px – the home page banner under a flat black overlay (--ov from
   the admin's setting), without one a dark surface with the brand mark reaching out of the lower right corner.
   Below 900 px only the form. No gradients; the only motion is a 200 ms fade of the form. */
.auth { display: grid; grid-template-columns: minmax(440px, 5fr) minmax(0, 7fr); min-height: 100vh; min-height: 100dvh; background: var(--surface); }
.auth-side { display: flex; flex-direction: column; min-width: 0; padding: 0 clamp(24px, 4vw, 56px); }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 0 12px; }
.auth-brand { padding: 0; font-size: 16px; }
.auth-brand::before { width: 28px; height: 28px; }
.auth-brand:hover { color: var(--text); }
.auth-switches { display: flex; align-items: center; gap: 6px; }
.auth-lang { display: inline-flex; border: 1px solid var(--control); border-radius: var(--r-sm); overflow: hidden; font-size: 12px; font-weight: 600; }
.auth-lang a { padding: 4px 8px; color: var(--text-2); text-decoration: none; line-height: 1.35; }
.auth-lang a[href]:hover { color: var(--text); background: var(--hover); }
.auth-lang a[aria-current] { color: var(--text); background: var(--surface-2); }
.auth-theme .icon:last-child, [data-theme="dark"] .auth-theme .icon:first-child { display: none; }
[data-theme="dark"] .auth-theme .icon:last-child { display: inline-block; }
.auth-body { flex: 1; display: flex; align-items: center; padding: 32px 0; }
.auth .auth-panel { width: 100%; max-width: 380px; margin: 0 auto; background: none; border: 0; border-radius: 0; padding: 0; gap: 0; animation: auth-in .2s ease-out both; }
@keyframes auth-in { from { opacity: 0; } }
.auth-mark { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--r); color: var(--text-2); margin-bottom: 18px; background: var(--surface-2); }
.auth-mark .icon { width: 20px; height: 20px; }
.auth-title { font-size: 24px; line-height: 1.2; letter-spacing: -.015em; font-weight: 650; }
.auth-sub { margin-top: 8px; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.auth-status:not(:empty) { margin-top: 20px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.auth .field { gap: 6px; }
.auth .field > label, .auth .field-head label { font-size: 13px; font-weight: 600; color: var(--text); }
.auth .input { height: 38px; padding: 0 11px; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field-head a { font-size: 12.5px; color: var(--text-2); }
.field-head a:hover { color: var(--text); }
.field-error { font-size: 12.5px; color: var(--danger); display: flex; gap: 5px; align-items: flex-start; }
.auth .input[aria-invalid="true"] { border-color: var(--danger); }
.auth .input[aria-invalid="true"]:focus { box-shadow: 0 0 0 1px var(--danger); }
.pw-input { position: relative; }
.auth .pw-input .input { padding-right: 42px; }
.pw-toggle { position: absolute; top: 3px; right: 3px; bottom: 3px; width: 34px; display: grid; place-items: center; border: 0; border-radius: 3px; background: none; color: var(--text-3); cursor: pointer; }
.pw-toggle:hover { color: var(--text); background: var(--hover); }
.pw-toggle[aria-pressed="true"] { color: var(--text); }
.caps-note { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--warning); }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.pw-meter span { height: 3px; border-radius: 1px; background: var(--border); }
.pw-meter[data-level="1"] span.on { background: var(--warning); }
.pw-meter[data-level="2"] span.on, .pw-meter[data-level="3"] span.on, .pw-meter[data-level="4"] span.on { background: var(--success); }
.auth-terms { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.auth-submit { width: 100%; height: 40px; font-size: 14px; margin-top: 4px; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  border: 2px solid var(--ink-text); border-right-color: transparent; animation: auth-spin .7s linear infinite; }
.btn:not(.primary).busy::after { border-color: var(--text); border-right-color: transparent; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
.btn.primary.busy:disabled { opacity: 1; }
.auth-actions { margin-top: 24px; }
.auth-actions .btn { height: 38px; padding: 0 16px; }
.auth .auth-foot { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13.5px; }
.auth-legal { padding: 16px 0 22px; }
.auth-legal .legal-links { justify-content: flex-start; }

/* the picture */
.auth-visual { position: sticky; top: 0; height: 100vh; height: 100dvh; padding: 12px 12px 12px 0; display: flex; color: #fff; }
.auth-visual::before { content: ""; position: absolute; inset: 12px 12px 12px 0; border-radius: 8px; background: #0a0a11; z-index: -1; }
[data-theme="dark"] .auth-visual::before { box-shadow: inset 0 0 0 1px var(--border); }
.auth-visual { isolation: isolate; }
.auth-visual-media { position: absolute; inset: 12px 12px 12px 0; border-radius: 8px; overflow: hidden; z-index: -1; }
.auth-visual-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-visual-media::after { content: ""; position: absolute; inset: 0; background: rgb(0 0 0 / var(--ov, .5)); }
[data-theme="dark"] .auth-visual-media img { filter: brightness(.86); }
.auth-visual-text { padding: clamp(32px, 4vw, 56px); max-width: 680px; }
.auth-visual.has-image { align-items: flex-end; }
.auth-visual.has-image .auth-visual-text { text-shadow: 0 1px 2px rgb(0 0 0 / .35); }
.auth-claim { font-size: clamp(24px, 2.3vw, 32px); line-height: 1.2; letter-spacing: -.02em; font-weight: 650; color: #fff; }
.auth-facts { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 15px; color: rgb(255 255 255 / .8); }
.auth-facts li { display: flex; align-items: center; gap: 10px; }
.auth-facts .icon { width: 16px; height: 16px; color: #fff; stroke-width: 2; }
/* without a picture: text at the top, the brand mark (logo) below, cut off by the right and bottom edge */
.auth-visual.has-shot { flex-direction: column; }
.auth-visual.has-shot .auth-visual-text { padding-bottom: 0; }
.auth-shot { position: relative; flex: 1; min-height: 0; margin: 24px 0 0; overflow: hidden; border-radius: 0 0 8px 0; display: flex; align-items: flex-end; justify-content: flex-end; }
.auth-shot img { width: min(560px, 92%); height: auto; display: block; margin: 0 -6% -10% 0; }
@media (prefers-reduced-motion: reduce) { .auth .auth-panel, .btn.busy::after { animation: none; } }
@media (max-width: 899px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-visual { display: none; }
  .auth-side { padding: 0 16px; }
  .auth-top { padding: calc(14px + env(safe-area-inset-top)) 0 8px; }
  .auth-body { align-items: flex-start; padding: 28px 0 32px; }
}
@media (max-width: 640px) {
  .auth .input { height: 42px; font-size: 16px; } /* 16 px: iOS does not zoom into the field */
  .auth-title { font-size: 22px; }
  .auth-submit, .auth-actions .btn { height: 44px; }
  .auth-actions .btn { flex: 1; }
  .pw-toggle { width: 38px; }
  .auth-legal .legal-links { gap: 6px 14px; }
}
.notice { padding: 9px 12px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; }
.notice.warn { border-color: color-mix(in srgb, var(--warning) 40%, var(--border)); }
.notice.error { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); color: var(--danger); background: color-mix(in srgb, var(--danger) 6%, var(--surface)); }
.notice.ok { border-color: color-mix(in srgb, var(--success) 40%, var(--border)); }
.install-card { max-width: 560px; }
.install-form { display: flex; flex-direction: column; gap: 12px; }
.install-form h3 { margin-top: 8px; }
.install-submit { width: 100%; }
.check-ok { color: var(--success); }
.check-bad { color: var(--danger); }

/* ------------------------------------------------------------------ calendar */

.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-head h2 { min-width: 150px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal-dow { padding: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal-day { min-height: 96px; padding: 4px 5px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; cursor: pointer; min-width: 0; background: var(--surface); }
.cal-day:hover { background: var(--hover); }
.cal-day.other { background: var(--bg); }
.cal-day.other .num { color: var(--text-3); }
.cal-day .num { font-size: 12px; font-family: var(--mono); color: var(--text-2); }
.cal-day.today .num { color: var(--accent); font-weight: 700; }
.cal-day.selected { box-shadow: inset 0 0 0 1.5px var(--text); }
.cal-item { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 4px; align-items: center; }
.cal-item::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: var(--c, var(--accent)); flex: none; }
.cal-more { font-size: 11px; color: var(--text-3); }
.cal-dot { display: none; width: 5px; height: 5px; border-radius: 1px; background: var(--accent); }
@media (max-width: 900px) { .cal-layout { grid-template-columns: 1fr !important; } }
@media (max-width: 700px) { .cal-day { min-height: 54px; } .cal-item, .cal-more { display: none; } .cal-dot { display: block; } }

/* ------------------------------------------------------------------ charts */

.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 8px; }
.bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bar { width: 100%; max-width: 36px; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 1px; }
.bars .bar-label { font-size: 10.5px; color: var(--text-3); white-space: nowrap; font-family: var(--mono); max-width: 100%; overflow: hidden; text-overflow: clip; }
@media (max-width: 640px) { .bars { gap: 4px; } .bars .bar-label { font-size: 9px; letter-spacing: -.02em; } }
.bars .bar-value { font-size: 11px; color: var(--text-2); font-family: var(--mono); }
.hbar { display: grid; grid-template-columns: 120px 1fr 36px; gap: 10px; align-items: center; padding: 4px 0; font-size: 13px; }
.hbar .track { height: 6px; background: var(--surface-2); border-radius: 1px; overflow: hidden; }
.hbar .fill { height: 100%; }
.hbar strong { font-family: var(--mono); font-weight: 400; font-size: 12px; color: var(--text-2); text-align: right; }

/* ------------------------------------------------------------------ misc */

.color-swatches { display: flex; gap: 5px; flex-wrap: wrap; }
.swatch { width: 22px; height: 22px; border-radius: 3px; border: 0; cursor: pointer; padding: 0; outline-offset: 2px; }
.swatch.active { outline: 2px solid var(--text); }
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, 32px); gap: 4px; }
.icon-picker button { width: 32px; height: 32px; border-radius: var(--r-sm); border: 1px solid var(--control); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--text-2); }
.icon-picker button.active { border-color: var(--text); color: var(--text); background: var(--surface-2); }
.subtask-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.subtask-row .input { height: 28px; }
.quick-add { display: flex; gap: 6px; margin-bottom: 10px; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th { text-align: left; font-size: 12px; color: var(--text-2); font-weight: 600; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
table.table th:first-child { border-radius: var(--r) 0 0 0; }
table.table th:last-child { border-radius: 0 var(--r) 0 0; }
table.table td { padding: 8px 12px; min-height: 40px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.table tr:last-child td { border-bottom: 0; }
.loading { display: grid; place-items: center; min-height: 60vh; color: var(--text-3); font-size: 13px; }
.settings-section { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.settings-section:last-child { border-bottom: 0; }
.settings-section .title { font-weight: 600; }
.settings-section .desc { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
@media (max-width: 760px) { .settings-section { grid-template-columns: 1fr; gap: 10px; } }
.catalog { border: 1px solid var(--border); border-radius: var(--r); padding: 10px 14px; background: var(--surface); }
.catalog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
html:not(.theme-ready) * { transition: none !important; }

/* Settings page: sections are separated by rules inside one card */
.card-pad.settings { padding-top: 0; padding-bottom: 0; }
.mark.sm { width: 26px; height: 26px; }
.note-row { align-items: flex-start; }
.note-body { font-size: 12.5px; color: var(--text-2); white-space: pre-wrap; max-height: 3.2em; overflow: hidden; margin-top: 2px; }

/* Shared projects */
.member-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.member-add .input { flex: 1 1 260px; max-width: 420px; }
.row-meta .assignee { color: var(--text); }

/* Images: thumbnails, previews, project image, large view */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.thumb { position: relative; }
.thumb-btn, .file-thumb { display: block; padding: 0; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); cursor: zoom-in; overflow: hidden; }
.thumb-btn img { display: block; width: 96px; height: 72px; object-fit: cover; }
.file-thumb { flex: none; }
.file-thumb img { display: block; width: 48px; height: 36px; object-fit: cover; }
.thumb-remove { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: var(--r-sm); background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; }
.project-cover { display: block; width: 100%; padding: 0; margin: -16px 0 14px; border: 0; background: none; cursor: zoom-in; }
.project-cover img { display: block; width: calc(100% + 32px); margin: 0 -16px; max-height: 220px; object-fit: cover; border-radius: var(--r) var(--r) 0 0; }
.modal.lightbox { max-width: 1100px; }
.modal.lightbox .modal-body { display: grid; place-items: center; background: var(--surface-2); }
.lightbox-img { display: block; max-width: 100%; max-height: 72vh; object-fit: contain; }
.modal.lightbox .modal-foot { align-items: center; }
.modal.lightbox .modal-foot .small { max-width: 50%; }
/* Selects inside list rows (e.g. member roles) keep their natural width */
.row > select.input { width: auto; flex: 0 0 auto; max-width: 240px; }
.member-add select.input { flex: 0 1 auto; width: auto; min-width: 180px; }

/* ------------------------------------------------------------------ legal links, reviews (app) */
.auth-wrap { grid-template-rows: 1fr auto; }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; justify-content: center; }
.legal-links a { color: var(--text-3); text-decoration: none; }
.legal-links a:hover { color: var(--text); text-decoration: underline; }
.stars { color: var(--star); letter-spacing: 1px; white-space: nowrap; }
.stars-off { color: var(--control); }
.star-row { display: flex; gap: 2px; }
.star-btn { border: 0; background: none; font-size: 28px; line-height: 1; padding: 2px; cursor: pointer; color: var(--control); }
.star-btn.on { color: var(--star); }
.star-btn:focus-visible { outline: 2px solid var(--accent); border-radius: var(--r-sm); }
textarea.mono-area { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }
code { font-family: var(--mono); font-size: .92em; background: var(--surface-2); padding: 0 3px; border-radius: 3px; }

/* ------------------------------------------------------------------ support conversations */
.thread { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.msg { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); padding: 12px 14px; max-width: 760px; }
.msg.staff { border-left: 3px solid var(--accent); }
.msg.customer { margin-left: 0; }
.msg-head { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.msg-head strong { color: var(--text-2); font-weight: 600; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; font-size: 14px; }
.unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: middle; }
.ticket-side { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.ticket-main, .ticket-aside { min-width: 0; }
.ticket-aside { display: flex; flex-direction: column; gap: 12px; }
.case-thread { margin-top: 0; }
.case-label { margin-top: 14px; }
.case-controls > .case-control:first-child .case-label, .case-info > .case-label:first-child { margin-top: 0; }
.case-controls .case-control + .case-control { margin-top: 0; }
.case-take { margin-top: 8px; }
.case-note { margin-top: 4px; }
.case-mail, .case-customer, .case-other { overflow-wrap: anywhere; }
.reply-form { display: flex; flex-direction: column; gap: 10px; }
.reply-form select.reply-next { width: auto; }
/* ≤ 900 px: status and assignment above the conversation (side by side), the customer box below it */
@media (max-width: 900px) {
  .ticket-side { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  .ticket-aside { display: contents; }
  .case-controls { order: -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; align-items: end; padding: 12px 14px; }
  .case-controls .case-label { margin-top: 0; }
  .case-controls .case-take { grid-column: 1 / -1; justify-self: start; margin-top: 4px; }
  .case-info { order: 1; }
}

/* ------------------------------------------------------------------ shell: dark sidebar of the app and of the panels (admin.php, support.php) */
.panel-app { display: flex; min-height: 100vh; }
.panel-side {
  --p-bg: #16171d; --p-text: #d6d8e2; --p-dim: #9a9db0; --p-hover: rgba(255, 255, 255, .06); --p-line: rgba(255, 255, 255, .08);
  width: var(--sidebar); flex: none; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background: var(--p-bg); color: var(--p-text); padding: 16px 12px; border-right: 1px solid var(--p-line); z-index: 30;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent;
}
.panel-side :focus-visible { outline-color: #fff; }
.panel-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; color: #fff; text-decoration: none; }
.panel-brand img { flex: none; }
.panel-brand-text { min-width: 0; }
.panel-brand-name { display: block; font-weight: 700; font-size: 15px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-brand-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--p-dim); font-weight: 600; }
.panel-nav { display: flex; flex-direction: column; gap: 14px; }
.panel-group { display: flex; flex-direction: column; gap: 2px; }
.panel-group-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--p-dim); padding: 0 10px 4px; font-weight: 600; }
.panel-link { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); color: var(--p-text); text-decoration: none; font-size: 13.5px; }
.panel-link .nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-link .icon { color: var(--p-dim); flex: none; }
.panel-link:hover { background: var(--p-hover); color: #fff; }
.panel-link.active { background: rgba(255, 255, 255, .08); color: #fff; font-weight: 600; }
.panel-link.active::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 2px; background: var(--accent); }
.panel-link.active .icon { color: #fff; }
.panel-link .count { color: var(--p-text); font-weight: 500; }
.panel-links { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--p-line); display: flex; flex-direction: column; gap: 2px; }
.panel-user { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 10px; padding: 8px; border: 0; border-radius: var(--r); background: var(--p-hover); color: #fff; text-align: left; cursor: pointer; font: inherit; font-size: 13px; min-width: 0; }
.panel-user:hover { background: rgba(255, 255, 255, .1); }
.panel-user .icon { color: var(--p-dim); flex: none; }
.panel-user-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.panel-user-name, .panel-user-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-user-name { font-weight: 600; }
.panel-user-mail { font-size: 12px; color: var(--p-dim); }
.panel-avatar { width: 28px; height: 28px; border-radius: var(--r-sm); flex: none; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600; }
.panel-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.panel-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--border); }
.panel-title { font-weight: 600; font-size: 14px; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-content { max-width: 2200px; width: 100%; }
.panel-top-logo { display: none; }
/* the page head carries the title on desktop; the top bar keeps it on phones only */
@media (min-width: 641px) { .panel-top .panel-title, .topbar .top-title { display: none; } }

/* Panels, tablet (641–900 px): the sidebar shrinks to an icon rail like the app (labels stay for screen readers,
   title = tooltip). Phones (≤ 640 px): no sidebar – tab bar at the bottom (entries with a tab label) + "Mehr" sheet. */
@media (max-width: 900px) and (min-width: 641px) {
  .panel-app .panel-side { width: 64px; padding: 14px 8px; }
  .panel-app .panel-side .panel-brand { justify-content: center; padding: 2px 0 16px; }
  .panel-app .panel-side .panel-brand-text, .panel-app .panel-side .panel-group-label,
  .panel-app .panel-side .panel-link > .icon.sm, .panel-app .panel-side .panel-user-text, .panel-app .panel-side .panel-user > .icon { display: none; }
  .panel-app .panel-side .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .panel-app .panel-side .panel-nav { gap: 10px; }
  .panel-app .panel-side .panel-group + .panel-group { border-top: 1px solid var(--p-line); padding-top: 10px; }
  .panel-app .panel-side .panel-link { justify-content: center; min-height: 40px; padding: 10px 0; }
  .panel-app .panel-side .panel-link .icon { width: 18px; height: 18px; }
  .panel-app .panel-side .panel-link.active::before { left: -8px; }
  .panel-app .panel-side .panel-link .count { position: absolute; top: 3px; right: 5px; padding: 0 3px; font-size: 10.5px; line-height: 16px; background: var(--p-bg); border-radius: 3px; color: #fff; }
  .panel-app .panel-side .panel-user { justify-content: center; padding: 6px 0; background: none; }
  .panel-app .panel-top { padding: 0 22px; }
  .panel-app .content { padding: 20px 22px 96px; }
}
@media (max-width: 640px) {
  .panel-app .panel-side { display: none; }
  .panel-app .panel-top { height: auto; min-height: 52px; gap: 6px; padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); }
  .panel-top-logo { display: block; flex: none; margin-right: 4px; }
  .panel-app .panel-title { font-size: 16px; }
  .panel-tabbar .tab-label { font-size: 10.5px; }
  .panel-app .panel-sound, .panel-app .panel-top-app { display: none; }
  .panel-app .content { padding: 16px max(14px, env(safe-area-inset-right)) calc(92px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
}

/* Banner slot between top bar and content (e.g. remote assistance); hidden while empty */
.shell-banners { display: flex; flex-direction: column; }
.shell-banners[hidden] { display: none; }
.shell-banner { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; padding: 8px 28px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 13px; }
.shell-banner.warn { border-left: 2px solid var(--warning); }
.shell-banner.danger { border-left: 2px solid var(--danger); }
.shell-banner-text { flex: 1 1 260px; min-width: 0; }
@media (max-width: 640px) { .shell-banner { padding: 8px 14px; } }

/* shared by app and public pages */
.btn.lg { height: 42px; padding: 0 18px; font-size: 15px; gap: 8px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.field.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.input[aria-invalid="true"] { border-color: var(--danger); }

/* ------------------------------------------------------------------ cookie dialog (public pages and app) */
/* Centered dialog on a dimmed backdrop (phones: bottom sheet); after a choice only the round button bottom left remains.
   The button stays clear of the back-to-top button (bottom right), the phone tab bar and the sidebar of the app. */
.cookie-backdrop { position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(18, 18, 17, .5); animation: cookie-fade .18s ease; }
.cookie-dialog { width: min(520px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r); animation: cookie-rise .2s ease; }
.cookie-dialog:focus { outline: none; }
.cookie-view { display: flex; flex-direction: column; min-height: 0; }
.cookie-body { padding: 24px 24px 8px; overflow-y: auto; min-height: 0; }
.cookie-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--text); margin-bottom: 12px; }
.cookie-icon .icon { width: 22px; height: 22px; }
.cookie-title { margin: 0 0 8px; font-size: 18px; line-height: 1.3; font-weight: 600; letter-spacing: 0; }
.cookie-title:focus { outline: none; }
.cookie-text { margin: 0 0 16px; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.cookie-text a { color: var(--accent); }
.cookie-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 24px 24px; }
.cookie-actions.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cookie-dialog .cookie-actions .btn { width: 100%; justify-content: center; height: 40px; white-space: normal; text-align: center; line-height: 1.2; }
.cookie-cat { padding: 12px 0; border-top: 1px solid var(--border); }
.cookie-cat-head { display: flex; align-items: center; gap: 10px; }
.cookie-cat-title { font-weight: 600; font-size: 14px; }
.cookie-cat-note { font-size: 12px; color: var(--text-3); }
.cookie-cat-head .cookie-switch { margin-left: auto; }
.cookie-cat-text { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.cookie-switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 38px; height: 22px; margin: 0; border-radius: 11px; border: 1px solid var(--border-strong); background: var(--surface-2); }
.cookie-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-3); }
.cookie-switch:checked { background: var(--ink); border-color: var(--ink); }
.cookie-switch:checked::after { left: 18px; background: var(--ink-text); }
.cookie-switch:disabled { opacity: .6; }
.cookie-entries { margin-top: 8px; font-size: 13px; }
.cookie-entries summary { cursor: pointer; color: var(--accent); }
.cookie-entries ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.cookie-entries li { border: 1px solid var(--border); border-radius: var(--r); padding: 8px 10px; background: var(--bg); }
.cookie-entries li p { margin: 2px 0 0; line-height: 1.45; color: var(--text-2); overflow-wrap: anywhere; }
.cookie-entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.cookie-entry-head code { font-family: var(--mono); font-size: 12.5px; color: var(--text); overflow-wrap: anywhere; }
.cookie-entry-kind { font-size: 12px; color: var(--text-3); }
.cookie-entries li .cookie-entry-meta { font-size: 12px; color: var(--text-3); }
html.cookie-lock { overflow: hidden; }
.cookie-settings { position: fixed; z-index: 40; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); width: 44px; height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); cursor: pointer; }
.cookie-settings[hidden] { display: none; }
.cookie-settings .icon { width: 20px; height: 20px; }
.cookie-settings:hover { background: var(--hover); }
body:has(.app-side) .cookie-settings { left: calc(var(--sidebar) + 16px); }
@keyframes cookie-fade { from { opacity: 0; } }
@keyframes cookie-rise { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 900px) and (min-width: 641px) { body:has(.app-side) .cookie-settings { left: 80px; } }
@media (max-width: 640px) {
  .cookie-backdrop { align-items: flex-end; padding: 0; }
  .cookie-dialog { width: 100%; max-height: 92vh; max-height: 92dvh; border-width: 1px 0 0; border-radius: var(--r) var(--r) 0 0; animation-name: cookie-sheet; }
  .cookie-body { padding: 20px 16px 4px; }
  .cookie-actions, .cookie-actions.two { grid-template-columns: minmax(0, 1fr); padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
  .cookie-dialog .cookie-actions .btn { height: 44px; }
  body:has(.tabbar) .cookie-settings { bottom: calc(76px + env(safe-area-inset-bottom)); }
  body:has(.app-side) .cookie-settings { left: 16px; }
}
@keyframes cookie-sheet { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cookie-backdrop, .cookie-dialog { animation: none; } }
.panel-sound.off { color: var(--text-3); }
@media (max-width: 640px) { .panel-sound-label { display: none; } }

/* ------------------------------------------------------------------ task board (Kanban) */
.view-toggle button { display: inline-flex; align-items: center; gap: 5px; }
.quick-add .view-toggle { flex: none; margin-left: auto; }
.quick-add > .muted { align-self: center; }
.quick-add:has(.view-toggle) { flex-wrap: wrap; }
.quick-add:has(.view-toggle) > .input { flex: 1 1 220px; width: auto; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.kcol { display: flex; flex-direction: column; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); }
.kcol.drop-target { border-color: var(--accent); }
.kcol-head { display: flex; align-items: center; gap: 7px; padding: 7px 8px 7px 12px; min-height: 40px; }
.kcol-head h2, .kcol-head h3 { font-size: 13px; color: var(--text); }
.kcol-head .n { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.kcol-fold { margin: -2px 0 -2px -6px; }
.kcol.folded .kcol-head { padding-bottom: 7px; }
.done-group .fold-btn { margin-bottom: 4px; }
.kcol-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--text-3); }
.kcol-dot[data-tone="ok"] { background: var(--success); }
.kcol-dot[data-tone="warn"] { background: var(--warning); }
.kcol-dot[data-tone="bad"] { background: var(--danger); }
.kcol-body { display: flex; flex-direction: column; gap: 6px; padding: 0 8px 8px; min-height: 72px; }
.kcol-empty, .kcol-more { padding: 14px 4px; text-align: center; font-size: 12px; color: var(--text-3); }
.kcol-empty { border: 1px dashed var(--border-strong); border-radius: var(--r-sm); }
.kcol.drop-target .kcol-empty { display: none; }
.kcard { display: flex; gap: 9px; padding: 8px 6px 8px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; min-width: 0; }
.kcard[draggable="true"] { cursor: grab; }
@media (hover: hover) { .kcard:hover { border-color: var(--border-strong); } }
.kcard.dragging { opacity: .4; }
.kcard.done .kcard-title { color: var(--text-3); }
.kcard-main { flex: 1; min-width: 0; }
.kcard-title { font-weight: 500; overflow-wrap: anywhere; }
.kcard-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 12px; color: var(--text-2); }
.kcard-meta > span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.kcard-where { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block !important; }
.kcard-side { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; }
.kcard-menu { margin-top: -3px; }
.avatar { width: 22px; height: 22px; border-radius: 4px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-2); font-size: 10px; font-weight: 700; }
.board-drop { height: 3px; margin: -1px 2px; border-radius: 2px; background: var(--accent); flex: none; }
@media (max-width: 640px) {
  .board { grid-auto-columns: min(280px, calc(100vw - 56px)); margin: 0 -14px; padding: 0 14px 8px; scroll-snap-type: x mandatory; scroll-padding: 0 14px; overscroll-behavior-x: contain; }
  .kcol { scroll-snap-align: start; }
  .kcard { padding: 10px 6px 10px 10px; }
}

/* ------------------------------------------------------------------ files & links: drop zone */
/* Board canvas: fixed reading width, independent lists, touch scrolling and equivalent card menus. */
.board { grid-auto-columns: 286px; gap: 14px; padding: 16px; margin-top: 12px; max-width: 100%; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); overscroll-behavior-x: contain; scrollbar-gutter: stable; }
.kcol { --list-accent: #6f7e91; background: color-mix(in srgb, var(--list-accent) 12%, var(--surface)); border-color: color-mix(in srgb, var(--list-accent) 28%, var(--border)); border-top: 3px solid var(--list-accent); border-radius: 10px; max-height: min(76dvh, 880px); }
.kcol[data-color="blue"] { --list-accent: #4f86d9; }
.kcol[data-color="purple"] { --list-accent: #9a76d2; }
.kcol[data-color="green"] { --list-accent: #398867; }
.kcol[data-color="amber"] { --list-accent: #b18522; }
.kcol[data-color="red"] { --list-accent: #cb6262; }
.kcol[data-color="cyan"] { --list-accent: #3e91a2; }
.kcol-head { min-height: 50px; padding: 8px 10px; flex: none; }
.kcol-head h2 { line-height: 1.45; overflow-wrap: anywhere; margin: 0; }
.kcol-head .n { color: var(--text-2); }
.kcol-dot { display: none; }
.kcol-body { overflow-y: auto; overscroll-behavior-y: contain; gap: 9px; padding: 0 9px 9px; min-height: 40px; }
.kcard { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 30px; gap: 0 4px; padding: 12px 9px 12px 12px; border-radius: 8px; box-shadow: 0 1px 2px #0000000c; flex: none; }
.kcard > .colorbar { display: none; }
.kcard-cover { grid-column: 1 / -1; display: block; width: calc(100% + 21px); max-width: none; height: 148px; margin: -12px -9px 12px -12px; border-radius: 7px 7px 0 0; object-fit: cover; }
.kcard-title { line-height: 1.5; font-size: 14px; }
.kcard-tags { margin-bottom: 7px; display: flex; flex-wrap: wrap; gap: 4px; }
.kcard-meta { margin-top: 9px; font-size: 11px; }
.kcol-add, .board-add-list { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--text-2); text-align: left; padding: 12px; min-height: 44px; cursor: pointer; font: inherit; font-size: 13px; border-radius: 8px; flex: none; }
.kcol-add:hover { background: var(--hover); color: var(--text); }
.board-add-list { background: var(--surface); border: 1px dashed var(--border-strong); color: var(--text); }
.sheet-legal { padding: 12px 16px; border-block: 1px solid var(--border); }
@media (max-width: 640px) {
  .board { grid-auto-columns: min(286px, calc(100vw - 60px)); margin: 12px 0 0; padding: 12px; scroll-padding: 12px; scroll-snap-type: x proximity; }
  .kcol { max-height: 70dvh; }
  .kcard-menu, .kcol-head .icon-only { min-width: 40px; min-height: 40px; }
  .kcard { grid-template-columns: minmax(0,1fr) 40px; }
  .quick-add > .btn, .view-toggle button { min-height: 44px; }
  .app .page-head, .app .page-actions { flex-wrap: wrap; }
  .app .page-head > *, .app .content, .app .main { min-width: 0; }
  .app input.input, .app select.input, .app textarea.input { font-size: 16px; }
  .menu { max-width: calc(100vw - 16px); max-height: calc(100dvh - 32px); overflow-y: auto; }
  .menu > button { min-height: 44px; white-space: normal; text-align: left; }
}

.files-panel { border-radius: var(--r); }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; min-height: 104px; padding: 16px;
  border: 1.5px dashed var(--border-strong); border-radius: var(--r); background: var(--surface); color: var(--text-2); cursor: pointer; text-align: center;
}
.dropzone .icon { color: var(--text-3); margin-bottom: 2px; }
.files-panel.dragover .dropzone { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.files-panel.dragover .dropzone .icon { color: var(--accent); }
@media (hover: hover) { .dropzone:hover:not(:disabled) { border-color: var(--accent); color: var(--text); } }
.dropzone:disabled { cursor: progress; opacity: 1; }
.dropzone-text { font-weight: 600; color: var(--text); }
.dropzone-hint { font-size: 12px; color: var(--text-3); }
.dropzone-busy:empty { display: none; }
.dropzone-busy { display: flex; flex-direction: column; gap: 6px; width: min(260px, 100%); margin-top: 6px; font-size: 12.5px; }
.dropzone.busy .dropzone-text, .dropzone.busy .dropzone-hint { display: none; }
.files-actions { margin: 8px 0 12px; }
.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; }

/* ------------------------------------------------------------------ "Mehr" sheet (phone navigation) */
.sheet-backdrop { align-items: flex-end; padding: 0; overflow: hidden; }
.modal.sheet { max-width: 560px; max-height: calc(100dvh - 32px); border-bottom: 0; border-radius: var(--r) var(--r) 0 0; }
.modal.sheet .modal-head { padding: 8px 8px 8px 16px; }
.modal.sheet .modal-head .btn { width: 40px; height: 40px; }
.modal.sheet .modal-body { overflow-y: auto; overscroll-behavior: contain; gap: 16px; padding: 14px 14px calc(18px + env(safe-area-inset-bottom)); background: var(--bg); }
.sheet-user { display: flex; align-items: center; gap: 12px; padding: 0 2px; min-width: 0; }
.sheet-user .panel-avatar { width: 36px; height: 36px; }
.sheet-user-name { font-weight: 600; }
.sheet-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); font-weight: 600; padding: 0 2px 6px; }
.sheet-list { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.sheet-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 12px 0 14px; border: 0; border-bottom: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none; font-size: 15px; text-align: left; cursor: pointer;
}
.sheet-item:last-child { border-bottom: 0; }
.sheet-item .icon { color: var(--text-3); }
.sheet-item > .icon:first-child { width: 18px; height: 18px; color: var(--text-2); }
.sheet-item:hover { background: var(--hover); }
.sheet-item.active { font-weight: 600; }
.sheet-item.active > .icon:first-child { color: var(--accent); }
.sheet-item.danger, .sheet-item.danger > .icon:first-child { color: var(--danger); }
.sheet-item:focus-visible { outline-offset: -2px; }

/* ------------------------------------------------------------------ overview (dashboard) */
.dash-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-steps { margin-bottom: 16px; }
.card-n { margin-left: 7px; font-family: var(--mono); font-weight: 400; letter-spacing: 0; color: var(--text-3); }
.card-more { display: block; padding: 9px 0 4px; font-size: 12.5px; color: var(--text-2); }
.dash-quick { position: relative; margin: 10px 0 6px; }
.dash-quick .icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.dash-quick .input { padding-left: 31px; background: var(--surface-2); border-color: var(--border); }
.dash-quick .input:focus { background: var(--surface); border-color: var(--accent); }
.dash-progress { width: 150px; flex: none; }
.dash-card .empty { padding: 16px 0 12px; }
.activity-text { overflow-wrap: anywhere; }
.step-mark { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; flex: none; color: #fff; }
.step-mark.done { background: var(--success); border-color: var(--success); }
.step-mark .icon { stroke-width: 3; width: 11px; height: 11px; }
/* Mini board: stacked bar + one flat row per column (status dot, label, figure) */
.stackbar { display: flex; gap: 2px; height: 6px; margin: 12px 0 8px; }
.stackbar span { min-width: 4px; border-radius: 2px; background: var(--border-strong); }
.stackbar span[data-tone="ok"] { background: var(--success); }
.stackbar span[data-tone="warn"] { background: var(--warning); }
.stackbar span[data-tone="bad"] { background: var(--danger); }
.board-stats { display: flex; flex-direction: column; margin: 0 -14px -8px; border-top: 1px solid var(--border); }
.board-stat { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 38px; padding: 0 14px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; min-width: 0; }
.board-stat:last-child { border-bottom: 0; }
.board-stat:hover { background: var(--hover); }
.board-stat-n { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.board-stat-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-card[data-card="board"] { overflow: hidden; }

@media (max-width: 900px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-col { display: contents; }
  .dash-card[data-card="today"] { order: 1; }
  .dash-card[data-card="deadlines"] { order: 2; }
  .dash-card[data-card="board"] { order: 3; }
  .dash-card[data-card="projects"] { order: 4; }
  .dash-card[data-card="orders"] { order: 5; }
  .dash-card[data-card="activity"] { order: 6; }
}

/* ------------------------------------------------------------------ phones: bigger tap targets, compact rows */
@media (max-width: 640px) {
  .dash-actions { display: none; }
  .row { min-height: 48px; }
  .row.clickable { padding-top: 9px; padding-bottom: 9px; }
  .checkbox { position: relative; width: 20px; height: 20px; }
  .checkbox::after { content: ""; position: absolute; inset: -12px; }
  .checkbox .icon { width: 13px; height: 13px; }
  .row-side { width: auto; max-width: 42%; }
  .row-side .badge { white-space: normal; text-align: left; }
  .row-price { display: none; }
  .phone-only { display: inline-flex !important; }
  .dash-progress { width: 84px; }
  .dash-quick .input { height: 40px; font-size: 16px; }
  .toolbar .segmented { max-width: 100%; overflow-x: auto; }
  .input, select.input { height: 40px; font-size: 16px; } /* 16 px: iOS does not zoom into the field */
  textarea.input { font-size: 16px; }
  .btn { height: 36px; }
  .btn.sm { height: 30px; }
  .btn.icon-only { width: 36px; }
  .btn.sm.icon-only { width: 30px; }
  .tabs { gap: 16px; margin-left: -14px; margin-right: -14px; padding: 0 14px; scrollbar-width: none; }
  .tabs button { padding: 11px 0; }
  .menu button { min-height: 42px; font-size: 15px; }
  /* Detail pages: icon and actions in one line, the title below in full width */
  .detail-head { gap: 12px; }
  .detail-head > .grow { order: 3; flex-basis: 100%; }
  .detail-head > .btn-row { margin-left: auto; }
  .detail-meta { gap: 4px 14px; }
  .project-cover img { max-height: 170px; }
  .card-pad { padding: 14px; }
  .project-cover { margin-top: -14px; }
  .project-cover img { width: calc(100% + 28px); margin: 0 -14px; }
  .kv { grid-template-columns: 96px minmax(0, 1fr); }
  .swatch { width: 32px; height: 32px; }
  .color-swatches { gap: 8px; }
}
@media (pointer: coarse) {
  .checkbox { position: relative; }
  .checkbox::after { content: ""; position: absolute; inset: -12px; }
}

/* ---------------------------------------------------------------- partner program (app/partner.php, partner.js) */
/* "Partner" next to names: gold dot + text, readable on light, dark and the dark sidebar. */
:root { --partner: #8a5a00; }
:root[data-theme="dark"] { --partner: #e3b341; }
.partner-badge { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; vertical-align: 1px; color: var(--partner); font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; }
.partner-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--partner); flex: none; }
.partner-badge .icon { width: 10px; height: 10px; }
.settings-section .desc .partner-badge { margin: 6px 0 0; }
.panel-side .partner-badge { --partner: #e3b341; margin-left: 0; font-size: 11px; }
.panel-user-name { display: flex; align-items: center; gap: 6px; }
.panel-user-name > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Partner page in the app */
.partner-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.partner-logo-edit { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.partner-logo-box { width: 72px; height: 72px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: var(--r);
  background: #fff; overflow: hidden; flex: none; color: #6e6e6e; font-size: 26px; font-weight: 650; }
.partner-logo-box img { max-width: 64px; max-height: 64px; object-fit: contain; display: block; }
.partner-preview { border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; background: var(--bg); display: flex; flex-direction: column; gap: 6px; }
.partner-preview .partner-logo-box { width: auto; min-width: 56px; max-width: 168px; height: 56px; padding: 5px; margin-bottom: 4px; border-color: var(--border); border-radius: var(--r-sm); }
.partner-preview .partner-logo-box img { max-width: 156px; max-height: 44px; }
.partner-preview-name { font-weight: 650; font-size: 15px; overflow-wrap: anywhere; }
.partner-preview-text { color: var(--text-2); white-space: pre-line; overflow-wrap: anywhere; }
.partner-preview-link { color: var(--accent); font-size: 12.5px; overflow-wrap: anywhere; }
.partner-perks { margin: 0; padding: 0; list-style: none; }
.partner-perks li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.partner-perks li:first-child { border-top: 0; padding-top: 0; }
.partner-perks .icon { color: var(--partner); margin-top: 2px; flex: none; }
.char-count { font-size: 12px; color: var(--text-3); text-align: right; }
.char-count.over { color: var(--danger); }
/* Admin-Panel → Partner */
.partner-admin-card { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.partner-admin-card + .partner-admin-card { border-top: 1px solid var(--border); }
.partner-live { margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: var(--r-sm); }
.beta-table td:last-child { width: 220px; }
/* Support panel: open partner cases first, with a thin gold line on the left */
.table tr.partner-row > td:first-child { box-shadow: inset 3px 0 0 var(--partner); }
@media (max-width: 900px) {
  .partner-grid { grid-template-columns: minmax(0, 1fr); }
  .partner-admin-card { grid-template-columns: 56px minmax(0, 1fr); }
  .partner-admin-card > .btn-row { grid-column: 1 / -1; }
  .partner-admin-card .partner-logo-box { width: 56px; height: 56px; }
  .partner-admin-card .partner-logo-box img { max-width: 48px; max-height: 48px; }
  .beta-table td:last-child { width: auto; }
}

/* ------------------------------------------------------------------ admin and support panel: lists, tables, dialogs */
.card-gap { margin-bottom: 16px; }
.notice-gap { margin-bottom: 14px; }
.card-head-aside { margin-left: auto; }
.list-pad { padding: 0 16px; }
.row.row-top { align-items: flex-start; }
.update-thumb { width: 72px; height: 48px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); flex: none; }
.row-meta .badge { white-space: normal; }
.users-search { width: 260px; max-width: 100%; }
.users-search-box { margin-left: auto; min-width: 0; }
.users-none { padding: 12px 0; }
.users-kpis { margin-bottom: 14px; }
.users-online-filter { margin-right: 14px; font-size: 13px; white-space: nowrap; }
.card-head.users-head { flex-wrap: wrap; gap: 8px; }
.users-search-box { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 0; }
.mail-rejected { margin-top: 2px; }
.email-error { color: var(--danger); min-height: 1.2em; margin-top: 8px; }
.email-history { margin-top: 10px; overflow-wrap: anywhere; }
.user-name { font-weight: 600; }
.user-mail, .ticket-mail { overflow-wrap: break-word; }
.user-actions .icon { color: var(--text-3); }
.data-table td.dt-actions .btn-row { justify-content: flex-end; }
@media (min-width: 1101px) { .data-table td.dt-actions .btn-row { flex-wrap: nowrap; } }
/* columns that only fit on wide screens (header and cells carry .dt-wide); on phones they are card lines again */
@media (min-width: 641px) and (max-width: 1100px) { .data-table .dt-wide { display: none; } }
.data-table tr.clickable-row { cursor: pointer; }
.data-table tr.clickable-row:hover td { background: var(--hover); }
.ticket-subject { font-weight: 600; }
.ticket-subject.unread { font-weight: 700; }
.ticket-link { color: inherit; text-decoration: none; }
.ticket-link:hover { text-decoration: underline; }
.legal-pages { flex-wrap: wrap; margin-bottom: 12px; }
.legal-page-select { display: none; }
.partner-admin-card, .partner-live { overflow-wrap: anywhere; }

@media (max-width: 640px) {
  /* Tables become cards: the primary column as title, the others "label  value", actions as a row of buttons */
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: auto; }
  .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .data-table tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .data-table tr:last-child { border-bottom: 0; }
  table.data-table td, table.data-table tr:last-child td { border: 0; padding: 0; white-space: normal; }
  table.data-table td[data-label] { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 10px; padding: 2px 0; font-size: 13px; overflow-wrap: anywhere; }
  .data-table td[data-label]::before { content: attr(data-label); color: var(--text-3); font-size: 12px; font-family: var(--font); line-height: 1.6; }
  .data-table td[data-label]:has(> .dt-value:empty) { display: none; }
  table.data-table td.dt-primary { margin-bottom: 6px; font-size: 14px; overflow-wrap: anywhere; }
  table.data-table td.dt-actions { margin-top: 10px; }
  .data-table td.dt-actions .btn-row { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
  .data-table td.dt-actions .btn { flex: 1 1 auto; }
  .data-table td.dt-actions .btn.user-actions { flex: 0 0 auto; min-width: 132px; }
  .data-table tr.clickable-row:hover td { background: none; }
  .data-table tr.clickable-row:hover { background: var(--hover); }
  .table tr.partner-row > td:first-child { box-shadow: none; }
  .data-table tr.partner-row { box-shadow: inset 3px 0 0 var(--partner); }
  .card-body > .table-wrap:has(> .data-table) { margin: 0 -14px; }
  .card > .table-wrap { overflow-x: visible; }

  .card-head { flex-wrap: wrap; }
  .users-search-box { flex: 1 1 100%; margin-left: 0; }
  .users-search { width: 100%; }

  /* Rows with text and buttons: the buttons get a full-width line of their own */
  .panel-body .row:has(> .grow ~ .btn-row), .panel-body .row:has(> .grow ~ .btn) { flex-wrap: wrap; }
  .panel-body .row > .grow ~ .btn-row { flex: 1 1 100%; gap: 8px; }
  .panel-body .row > .grow ~ .btn-row > .btn { flex: 1 1 auto; }
  .list-pad { padding: 0 14px; }
  .update-thumb { width: 56px; height: 40px; }
  .partner-admin-card > .btn-row .btn { flex: 1 1 auto; }

  /* Legal texts: a select instead of five buttons, the editor not taller than the screen */
  .legal-pages { display: none; }
  .legal-page-select { display: block; margin-bottom: 12px; }
  textarea.legal-text { height: 55vh; min-height: 240px; }

  /* Panels: touch targets of at least 40 px, dialogs as bottom sheets */
  .panel-body .btn, .panel-body .btn.sm { height: 40px; }
  .panel-body .btn.sm { padding: 0 12px; font-size: 13.5px; }
  .panel-body .btn.icon-only, .panel-body .btn.sm.icon-only { width: 40px; }
  .panel-body .link-btn { min-height: 40px; display: inline-flex; align-items: center; font-size: 14px; }
  .panel-body .backdrop { align-items: flex-end; padding: 0; overflow: hidden; }
  .panel-body .modal { max-width: none; max-height: calc(100dvh - 24px); border-bottom: 0; border-radius: var(--r) var(--r) 0 0; }
  .panel-body .modal-body { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
  .panel-body .modal:not(:has(.modal-foot)) .modal-body, .panel-body .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .panel-body .modal-foot { border-radius: 0; }
  .panel-body .modal-foot .btn { flex: 1 1 auto; }
  .panel-body .modal-head .btn.icon-only { width: 40px; height: 40px; }
  .panel-body .modal.sheet .modal-body { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }

  .reply-actions .btn { flex: 1 1 auto; }
  .reply-form select.reply-next { flex: 1 1 100%; width: 100%; }
}

/* Admin → Einstellungen → Wartungsmodus: preview of the picture of the maintenance page */
.maintenance-preview { display: block; max-width: 280px; width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--border); }
.maintenance-image-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ------------------------------------------------------------------ accessibility (WCAG 2.2 AA, see Documentation/ACCESSIBILITY.md)
   Skip link, targets of at least 24 px (44 px on touch screens), reduced motion, high-contrast mode. The focus ring itself is
   the global :focus-visible rule at the top (2 px, --accent, ≥ 3:1 in light and dark). */
.skip-link { position: fixed; left: 12px; top: 8px; z-index: 1000; padding: 10px 16px; border-radius: var(--r); background: var(--surface); color: var(--text); border: 2px solid var(--accent);
  font-weight: 600; font-size: 14px; text-decoration: none; transform: translateY(-200%); }
.skip-link:focus, .skip-link:focus-visible { transform: none; outline: 2px solid var(--text); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
.legal-links a { display: inline-block; padding: 4px 2px; min-height: 24px; }
.crumbs a, .back, .field-head a, .link-btn { display: inline-block; min-height: 24px; line-height: 24px; padding: 0; }
.link-btn { padding: 0 2px; }
.row-title[role="button"] { cursor: pointer; }
.row.clickable:focus-within .row-title[role="button"]:focus-visible { outline-offset: 2px; }
@media (pointer: coarse) {
  .btn, .input, select.input { min-height: 44px; }
  .btn.icon-only { min-width: 44px; }
  .btn.sm { min-height: 36px; }
  .menu button { min-height: 44px; }
  .segmented button { min-height: 44px; }
  .tabs button { min-height: 44px; }
  .checkbox { width: 24px; height: 24px; }
  .pw-toggle { min-width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  :focus-visible { outline: 2px solid Highlight; }
  .status::before, .kcol-dot { forced-color-adjust: none; }
  .btn.primary, .skip-link { border: 2px solid ButtonText; }
}
@media print {
  .skip-link, .cookie-settings, .toasts, .tabbar, .site-top { display: none !important; }
}
.is-req::after { content: " *" / ""; color: var(--text-2); font-weight: 400; } /* asterisk for the eyes; the empty alternative keeps it out of the name */
.error-summary strong { display: block; margin-bottom: 4px; }
.error-summary ul { margin: 0; padding-left: 18px; }
.error-summary a { color: inherit; text-decoration-color: currentColor; }
.error-summary li { padding: 2px 0; }
.error-summary a { display: inline-block; min-height: 24px; line-height: 24px; }
.tag-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* Notification settings (notify-ui.js) */
.notify-settings { display: grid; gap: 14px; max-width: 640px; }
.notify-group, .notify-areas { display: grid; gap: 10px; }
.notify-areas { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin: 0; min-width: 0; }
.notify-areas legend { padding: 0 6px; font-weight: 600; font-size: 13px; }
.notify-settings .checkbox-line input { width: 18px; height: 18px; flex: none; }
.notify-help, .notify-status { margin: 0; }
.notify-status:empty { display: none; }
.storage-notice { position: fixed; z-index: 45; inset: auto 24px 24px auto; width: min(460px, calc(100vw - 48px)); padding: 20px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 8px 36px #0003; }
.storage-notice strong { font-size: 15px; }
.storage-notice p { font-size: 14px; line-height: 1.6; margin: 8px 0 16px; color: var(--text-2); }
.storage-notice .btn-row { justify-content: flex-end; }
.cookie-storage-list { list-style: none; padding: 0; }
.cookie-storage-list li { padding-block: 16px; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.cookie-storage-list p { margin-block: 6px; }
@media (max-width: 640px) { .storage-notice { inset: auto 12px calc(82px + env(safe-area-inset-bottom)) 12px; width: auto; padding: 16px; }.storage-notice .btn { min-height: 44px; } }

body:has(.backdrop) .storage-notice { display: none; }

/* Consistent authentication and timeout dialog. */
.auth { grid-template-columns: minmax(360px,1fr) minmax(0,1fr); background: var(--bg); }
.auth-side { padding-inline: clamp(24px,5vw,80px); }
.auth-body { flex: 1; padding-block: 40px; }
.auth .auth-panel { border: 0; border-radius: 0; background: transparent; padding: 0; box-shadow: none; width: 100%; max-width: 440px; }
.auth-title { font-size: 38px; line-height: 1.12; letter-spacing: -.04em; font-weight: 600; }
.auth-sub { font-size: 15px; line-height: 1.7; }
.auth-form { gap: 18px; }
.auth .input { height: 48px; font-size: 16px; border-radius: 6px; }
.auth-submit { min-height: 48px; border-radius: 6px; font-size: 16px; }
.auth .pw-toggle { min-width: 42px; min-height: 42px; top: 3px; }
.auth-visual { padding: 0; margin: 24px 24px 24px 0; height: calc(100dvh - 48px); border-radius: 12px; overflow: hidden; background: #171a20; }
.auth-visual::before, .auth-visual-media { inset: 0; border-radius: 12px; }
.auth-visual-text { padding: 40px; }
.auth-claim { font-size: clamp(28px,3vw,42px); font-weight: 550; letter-spacing: -.035em; }
.auth .legal-links a { min-height: 32px; display: inline-flex; align-items: center; }
.auth-status:empty { display: none; }
.kcol.folded > .kcol-add { display: none; }
.modal.idle-warning { max-width: 460px; border-radius: 16px; }
.idle-warning .modal-body { padding: 24px; }
.idle-symbol { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--surface-2); color: var(--accent); margin-bottom: 20px; }
.idle-symbol .icon { width: 24px; height: 24px; }
.idle-time { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; padding: 18px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.idle-countdown { font-size: 32px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.idle-warning .modal-foot { padding: 0 24px 24px; border: 0; }
.idle-warning .modal-foot .btn { min-height: 44px; }
@media(max-width:899px) { .auth { grid-template-columns: minmax(0,1fr); }.auth-visual { display:none; }.auth-side { padding-inline:20px; max-width:520px; width:100%; margin-inline:auto; }.auth-body { padding-block:32px; }.auth-title { font-size:34px; }.auth-legal { padding-bottom:calc(24px + env(safe-area-inset-bottom)); } }
@media(max-width:400px) { .idle-warning .modal-foot { flex-direction:column-reverse; }.idle-warning .modal-foot .btn { width:100%; }.auth-top { gap:8px; }.auth-brand { font-size:15px; } }
.auth-visual-media::after { background: rgb(8 10 15 / max(.72,var(--ov,.5))); }

