/* =====================================================================
   Craft Journal – Stylesheet
   Klar, ruhig, linienbasiert. Mobile zuerst.
   ===================================================================== */

@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-stretch: 75% 100%; font-display: swap;
  src: url(/fonts/sans/instrument-sans-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/sans/instrument-sans-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/mono/jetbrains-mono-latin-wght-normal.woff2) format('woff2'); }

/* ---------------------------------------------------------- Tokens */
:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #efeee9;
  --surface-3: #e6e4dd;
  --line: #e0ded6;
  --line-strong: #c9c6bb;
  --text: #1c1b18;
  --text-2: #45433d;
  --muted: #76736a;
  --accent: #3f6b5c;
  --on-accent: #ffffff;
  --accent-ui: var(--accent);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --danger: #b91c1c;
  --ok: #15803d;
  --shadow: 0 1px 2px rgb(20 18 12 / .05), 0 8px 24px -12px rgb(20 18 12 / .18);
  --shadow-lg: 0 24px 64px -24px rgb(20 18 12 / .35), 0 2px 6px rgb(20 18 12 / .06);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --gap: 14px;
  --gap-y: 30px;
  --pad: 16px;
  --topbar-h: 60px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t: .18s;
  --cols-m: 2;
  --cols-d: 4;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211; --surface: #1a1a18; --surface-2: #222220; --surface-3: #2b2b28; --line: #2c2b28; --line-strong: #3c3b37;
    --text: #ecebe6; --text-2: #c9c7c0; --muted: #96938a;
    --accent-ui: color-mix(in oklab, var(--accent) 65%, white);
    --accent-soft: color-mix(in srgb, var(--accent-ui) 16%, transparent);
    --danger: #f87171; --ok: #4ade80;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -12px rgb(0 0 0 / .6);
    --shadow-lg: 0 24px 64px -20px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121211; --surface: #1a1a18; --surface-2: #222220; --surface-3: #2b2b28; --line: #2c2b28; --line-strong: #3c3b37;
  --text: #ecebe6; --text-2: #c9c7c0; --muted: #96938a;
  --accent-ui: color-mix(in oklab, var(--accent) 65%, white);
  --accent-soft: color-mix(in srgb, var(--accent-ui) 16%, transparent);
  --danger: #f87171; --ok: #4ade80;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -12px rgb(0 0 0 / .6);
  --shadow-lg: 0 24px 64px -20px rgb(0 0 0 / .7);
  color-scheme: dark;
}
:root[data-density="compact"] { --gap: 8px; --gap-y: 18px; --r: 9px; }
:root[data-density="compact"] .card-meta { padding-top: 18px; }
:root[data-density="compact"] .card-title { font-size: 13px; }
:root[data-density="compact"] .card-date { font-size: 10.5px; }
:root[data-density="compact"] .section-head { padding-bottom: 10px; font-size: 13px; }
:root[data-density="compact"] .grid { row-gap: calc(var(--gap) + 8px); }
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; animation-duration: .01ms !important; } }

/* ---------------------------------------------------------- Basis */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font); font-feature-settings: 'ss01', 'cv11'; letter-spacing: -.003em;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
body { overflow-x: clip; }
body.no-scroll { overflow: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.018em; line-height: 1.2; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent-ui); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }
.mono { font-family: var(--mono); font-size: .9em; letter-spacing: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
[hidden] { display: none !important; }

.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; overflow: visible; }
img.ic.up { object-fit: contain; }
.ic.txt { display: inline-grid; place-items: center; font-weight: 700; font-size: 10px; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }

.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .2; transform: scale(.7); } }

/* ---------------------------------------------------------- Knöpfe */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-weight: 500; font-size: 15px; cursor: pointer;
  text-decoration: none; white-space: nowrap; user-select: none; transition: background var(--t), border-color var(--t), transform var(--t), opacity var(--t);
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: color-mix(in oklab, var(--accent) 88%, black); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 9px; }
.btn.sm .ic { width: 18px; height: 18px; }
.btn.block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; padding: 0; line-height: 0;
  border: 0; background: transparent; color: var(--text-2); cursor: pointer; text-decoration: none; flex: none;
  transition: background var(--t), color var(--t);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: .3; pointer-events: none; }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.xs { width: 30px; height: 30px; }
.icon-btn.xs .ic { width: 17px; height: 17px; }
.icon-btn.on { color: var(--accent-ui); }
.icon-btn.danger-hover:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.icon-btn.subtle { color: var(--muted); }
.icon-btn.on-dark { color: #fff; }
.icon-btn.on-dark:hover { background: rgb(255 255 255 / .12); }

.link-btn { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 4px 0; color: var(--accent-ui); font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: none; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn .ic { width: 16px; height: 16px; }

/* ---------------------------------------------------------- Formulare */
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 14px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; }
.row-gap { display: flex; gap: 8px; align-items: center; }
.two-col { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }

.field { display: grid; gap: 7px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field-hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

.input {
  width: 100%; min-height: 46px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px; /* 16px verhindert iOS-Zoom */
  transition: border-color var(--t), box-shadow var(--t); appearance: none; -webkit-appearance: none;
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.input:hover { border-color: color-mix(in srgb, var(--text) 30%, var(--line-strong)); }
.input:focus { outline: none; border-color: var(--accent-ui); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.sm { min-height: 40px; padding: 0 11px; font-size: 16px; border-radius: 9px; }
textarea.input { padding: 11px 13px; line-height: 1.5; resize: vertical; min-height: 92px; }
textarea.input.sm { min-height: 40px; padding: 8px 11px; }
select.input { padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2376736a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
input[type="date"].input, input[type="datetime-local"].input { font-family: var(--mono); font-size: 15px; min-width: 0; }
input[type="date"]::-webkit-calendar-picker-indicator, input[type="datetime-local"]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
:root[data-theme="dark"] input::-webkit-calendar-picker-indicator { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) input::-webkit-calendar-picker-indicator { filter: invert(1); } }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 48px; }
.input-addon { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; background: none; border: 0; color: var(--muted); cursor: pointer; border-radius: 8px; }
.input-addon:hover { color: var(--text); }

/* Segmentschalter */
.segmented { display: flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background var(--t), color var(--t), box-shadow var(--t);
}
.segmented button:hover { color: var(--text); }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 0 0 1px var(--line); }
.segmented .ic { width: 17px; height: 17px; }
.segmented.sm button { min-height: 34px; padding: 0 10px; font-size: 13.5px; }

/* Schalter */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-size: 14px; }
.switch { position: relative; display: inline-flex; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch-ui { width: 46px; height: 28px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-strong); position: relative; transition: background var(--t), border-color var(--t); }
.switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform var(--t) var(--ease); }
.switch input:checked + .switch-ui { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent-ui); outline-offset: 2px; }

/* Farbauswahl */
.color-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  --c: #888; position: relative; width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: var(--c); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .12); transition: transform var(--t);
}
.swatch:hover { transform: scale(1.08); }
.swatch.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--c); }
.swatch.custom { display: grid; place-items: center; background: conic-gradient(from 90deg, #e11d48, #f59e0b, #84cc16, #06b6d4, #6366f1, #d946ef, #e11d48); color: #fff; overflow: hidden; }
.swatch.custom.on { background: var(--c); }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
.swatch.custom .ic { width: 16px; height: 16px; pointer-events: none; filter: drop-shadow(0 1px 1px rgb(0 0 0 / .4)); }

/* Chips */
.chip-row { display: flex; gap: 6px; }
.chip-row.wrap { flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); font-size: 13.5px; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: all var(--t);
}
.chip:hover { border-color: var(--text-2); color: var(--text); }
.chip.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent-ui) 55%, transparent); color: var(--text); }
.chip .ic { width: 16px; height: 16px; }
.chip.removable .ic { width: 14px; height: 14px; opacity: .6; }
.chip-count { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.color-dot { --c: #888; width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); flex: none; }

.pill { font-size: 12px; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }

/* ---------------------------------------------------------- Status-Badges */
.badge { --c: #666; --fg: #fff; display: inline-flex; align-items: center; justify-content: center; position: relative; flex: none; }
.badge.mini { zoom: .82; }

/* ---- Text-Schilder ---- */
.badge-text { display: inline-flex; }
.badge-shape {
  display: inline-flex; align-items: center; height: 24px; padding: 0 13px; background: var(--c); color: var(--fg);
  font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; line-height: 1; white-space: nowrap;
  clip-path: polygon(0 50%, 9px 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 9px 100%);
}
.shape-pill .badge-shape { clip-path: none; border-radius: 99px; padding: 0 12px; }
.shape-rounded .badge-shape { clip-path: none; border-radius: 7px; padding: 0 10px; }
.shape-rect .badge-shape { clip-path: none; border-radius: 1px; padding: 0 10px; }
.shape-arrow .badge-shape { clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); padding: 0 16px 0 10px; }
.shape-tag .badge-shape { clip-path: polygon(9px 0, 100% 0, 100% 100%, 9px 100%, 0 50%); padding: 0 10px 0 15px; }
.shape-chevron .badge-shape { clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%); padding: 0 15px 0 17px; }
.shape-slant .badge-shape { clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%); padding: 0 14px; }
.shape-banner .badge-shape { clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 50%, 100% 100%, 0 100%, 8px 50%); padding: 0 16px; }
.shape-ticket .badge-shape { clip-path: polygon(0 0, 100% 0, 100% 30%, calc(100% - 5px) 50%, 100% 70%, 100% 100%, 0 100%, 0 70%, 5px 50%, 0 30%); padding: 0 13px; }
.shape-underline .badge-shape { clip-path: none; background: var(--surface); color: var(--text); border-bottom: 3px solid var(--c); border-radius: 5px 5px 0 0; padding: 0 10px; }
.shape-outline .badge-shape { clip-path: none; background: var(--surface); color: color-mix(in oklab, var(--c) 82%, var(--text)); box-shadow: inset 0 0 0 1.5px var(--c); border-radius: 7px; padding: 0 10px; }

/* ---- Symbol-Plaketten ---- */
.badge-icon { width: 30px; height: 30px; color: var(--fg); }
.badge-ring, .badge-bg { position: absolute; }
.badge-ring { inset: 0; background: var(--bg); display: none; }
.badge-bg { inset: 3px; background: var(--c); }
.badge-sym { position: relative; display: grid; place-items: center; }
.badge-sym .ic { width: 15px; height: 15px; stroke-width: 2.1; }
.shape-diamond .badge-ring { inset: 1.5px; transform: rotate(45deg); border-radius: 6px; }
.shape-diamond .badge-bg { inset: 4.5px; transform: rotate(45deg); border-radius: 4px; }
.shape-circle .badge-ring, .shape-circle .badge-bg { border-radius: 50%; }
.shape-square .badge-ring { inset: 1.5px; border-radius: 5px; }
.shape-square .badge-bg { inset: 4px; border-radius: 3px; }
.shape-squircle .badge-ring { inset: 1px; border-radius: 11px; }
.shape-squircle .badge-bg { inset: 3.5px; border-radius: 9px; }
.shape-hexagon .badge-ring, .shape-hexagon .badge-bg { clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%); }
.shape-octagon .badge-ring, .shape-octagon .badge-bg { clip-path: polygon(29% 0, 71% 0, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0 71%, 0 29%); }
.shape-shield .badge-ring, .shape-shield .badge-bg { clip-path: polygon(50% 0, 97% 14%, 92% 60%, 50% 100%, 8% 60%, 3% 14%); }
.shape-shield .badge-sym { margin-top: -2px; }
.shape-seal .badge-ring, .shape-seal .badge-bg { clip-path: polygon(50.0% 0.0%, 59.6% 8.1%, 71.7% 5.0%, 76.8% 16.4%, 89.1% 18.8%, 88.7% 31.3%, 98.7% 38.9%, 93.0% 50.0%, 98.7% 61.1%, 88.7% 68.7%, 89.1% 81.2%, 76.8% 83.6%, 71.7% 95.0%, 59.6% 91.9%, 50.0% 100.0%, 40.4% 91.9%, 28.3% 95.0%, 23.2% 83.6%, 10.9% 81.2%, 11.3% 68.7%, 1.3% 61.1%, 7.0% 50.0%, 1.3% 38.9%, 11.3% 31.3%, 10.9% 18.8%, 23.2% 16.4%, 28.3% 5.0%, 40.4% 8.1%); }
.shape-seal .badge-ring { inset: -1px; }
.shape-burst .badge-ring, .shape-burst .badge-bg { clip-path: polygon(50.0% 0.0%, 63.0% 18.6%, 85.4% 14.6%, 81.4% 37.0%, 100.0% 50.0%, 81.4% 63.0%, 85.4% 85.4%, 63.0% 81.4%, 50.0% 100.0%, 37.0% 81.4%, 14.6% 85.4%, 18.6% 63.0%, 0.0% 50.0%, 18.6% 37.0%, 14.6% 14.6%, 37.0% 18.6%); }
.shape-burst .badge-ring { inset: -2px; }
.shape-burst .badge-bg { inset: 2px; }
.shape-burst .badge-sym .ic { width: 12px; height: 12px; }
.shape-drop .badge-ring, .shape-drop .badge-bg { border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.shape-drop .badge-ring { inset: 1px; }
.shape-drop .badge-bg { inset: 4px; }
.shape-leaf .badge-ring { inset: 1px; border-radius: 55% 0; }
.shape-leaf .badge-bg { inset: 3.5px; border-radius: 55% 0; }
.shape-ring .badge-ring, .shape-ring .badge-bg { border-radius: 50%; }
.shape-ring .badge-bg { background: var(--surface); box-shadow: inset 0 0 0 2.5px var(--c); }
.shape-ring { color: var(--c); }

/* Kategorie-Punkte */
.cat-dot {
  --c: #666; display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface); color: var(--c); border: 1.5px solid color-mix(in srgb, var(--c) 70%, var(--surface));
}
.cat-dot .ic { width: 16px; height: 16px; stroke-width: 1.8; }
.cat-dot img.ic { width: 18px; height: 18px; }
.cat-dot.xs { width: 22px; height: 22px; border-width: 1px; }
.cat-dot.xs .ic { width: 13px; height: 13px; }
.cat-dot.sm { width: 26px; height: 26px; }
.cat-dot.sm .ic { width: 14px; height: 14px; }
.cat-dot.md { width: 36px; height: 36px; }
.cat-dot.md .ic { width: 18px; height: 18px; }
.cat-dot.lg { width: 40px; height: 40px; }
.cat-dot.lg .ic { width: 20px; height: 20px; }
.cat-dot.more { font-family: var(--mono); font-size: 10.5px; color: var(--muted); border-color: var(--line-strong); }

/* ---------------------------------------------------------- Toasts */
#toasts { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: toast-in .22s var(--ease); transition: opacity .3s, transform .3s;
}
.toast.error { background: var(--danger); color: #fff; }
.toast .ic { width: 18px; height: 18px; }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@media (min-width: 760px) { #toasts { bottom: 24px; } }

/* ---------------------------------------------------------- Sheets */
.sheet { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgb(14 13 10 / 0); transition: background .2s; }
.sheet.open { background: rgb(14 13 10 / .42); }
.sheet.closing { background: rgb(14 13 10 / 0); }
.sheet-panel {
  width: 100%; max-height: calc(100dvh - 32px - var(--safe-t)); display: flex; flex-direction: column;
  background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(100%); transition: transform .26s var(--ease); padding-bottom: var(--safe-b);
}
.sheet.open .sheet-panel { transform: none; }
.sheet.closing .sheet-panel { transform: translateY(100%); transition-duration: .18s; }
.sheet-grab { height: 22px; flex: none; display: grid; place-items: center; cursor: grab; touch-action: none; }
.sheet-grab::before { content: ''; width: 38px; height: 4px; border-radius: 4px; background: var(--line-strong); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px 8px 20px; touch-action: none; }
.sheet-head h2 { font-size: 18px; }
.sheet-body { padding: 8px 20px 20px; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 16px; align-content: start; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); flex: none; }
.sheet-foot .btn { flex: 1; }
.sheet-foot .btn.ghost { flex: 0 0 auto; }
.dialog-text { font-size: 15px; color: var(--text-2); line-height: 1.55; }
.sheet-sub { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.sheet-sub .ic { width: 16px; height: 16px; }

@media (min-width: 760px) {
  .sheet { align-items: center; padding: 24px; }
  .sheet-panel { border-radius: 18px; max-height: min(86dvh, 860px); transform: translateY(14px) scale(.98); opacity: 0; transition: transform .22s var(--ease), opacity .18s; padding-bottom: 0; }
  .sheet.open .sheet-panel { transform: none; opacity: 1; }
  .sheet.closing .sheet-panel { transform: translateY(8px) scale(.98); opacity: 0; }
  .sheet-panel.size-sm { max-width: 440px; }
  .sheet-panel.size-md { max-width: 560px; }
  .sheet-panel.size-lg { max-width: 720px; }
  .sheet-grab { height: 12px; }
  .sheet-grab::before { display: none; }
  .sheet-foot .btn { flex: 0 0 auto; }
}

/* Popover (Desktop-Filter) */
.popover {
  position: absolute; z-index: 90; min-width: 260px; max-width: 380px; max-height: 70vh; overflow: auto; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  animation: pop-in .16s var(--ease);
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }

/* Häkchen-Listen */
.check-list { display: grid; gap: 2px; }
.check-row { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 4px 8px; margin: 0 -8px; border-radius: 10px; cursor: pointer; }
.check-row:hover { background: var(--surface-2); }
.check-row input { position: absolute; opacity: 0; pointer-events: none; }
.check-box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; color: transparent; transition: all var(--t); }
.check-box .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.check-row input:checked + .check-box { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.check-row input:focus-visible + .check-box { outline: 2px solid var(--accent-ui); outline-offset: 2px; }
.check-label { flex: 1; font-weight: 500; }
.check-count { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* Symbolauswahl */
.picker-content { display: grid; gap: 6px; }
.picker-group { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-top: 10px; }
.sym-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.sym-cell {
  --c: var(--text); aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--c); cursor: pointer; transition: all var(--t);
}
.sym-cell:hover { border-color: var(--text-2); background: var(--surface-2); }
.sym-cell.on { border-color: var(--accent-ui); box-shadow: 0 0 0 2px var(--accent-soft); }
.sym-cell .ic { width: 24px; height: 24px; }
.sym-cell img.ic { width: 28px; height: 28px; }
.sym-cell.add { border-style: dashed; color: var(--muted); }
.sym-grid.manage { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.sym-manage { position: relative; }
.sym-manage .icon-btn { position: absolute; top: -8px; right: -8px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }

.symbol-btn {
  --c: var(--text); width: 54px; height: 54px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; color: var(--c); cursor: pointer; transition: border-color var(--t);
}
.symbol-btn:hover { border-color: var(--text-2); }
.symbol-btn .ic { width: 26px; height: 26px; }
.symbol-btn.sm { width: 40px; height: 40px; border-radius: 10px; border-style: dashed; color: var(--muted); }
.symbol-btn.sm .ic { width: 20px; height: 20px; }

/* ---------------------------------------------------------- Anmeldung */
.auth { min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 20px; padding: 24px 16px calc(24px + var(--safe-b)); }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px 24px; box-shadow: var(--shadow); display: grid; gap: 22px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.auth-title { font-size: 26px; }
.auth-foot { font-size: 12.5px; color: var(--muted); text-align: center; }
.form-error { color: var(--danger); font-size: 14px; min-height: 0; }
.form-error:empty { display: none; }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.meter span { height: 4px; border-radius: 4px; background: var(--surface-3); transition: background var(--t); }
.meter[data-s="1"] span:nth-child(-n+1) { background: var(--danger); }
.meter[data-s="2"] span:nth-child(-n+2) { background: #d97706; }
.meter[data-s="3"] span:nth-child(-n+3) { background: #65a30d; }
.meter[data-s="4"] span { background: var(--ok); }

/* ---------------------------------------------------------- Marke / Kopf */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--text); color: var(--bg);
}
.brand-mark .ic { width: 20px; height: 20px; stroke-width: 1.7; }
.brand-mark img.ic { width: 24px; height: 24px; }
.brand-name { font-weight: 600; font-size: 17px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1px solid var(--line-strong); font-weight: 600; font-size: 14px; background: var(--surface); }
.avatar.lg { width: 52px; height: 52px; font-size: 20px; }
.user-chip { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; padding: 4px; border-radius: 99px; line-height: 1; }
.user-chip:hover { background: var(--surface-2); }
.user-name { display: none; font-weight: 500; font-size: 14px; padding-right: 8px; }

/* ---------------------------------------------------------- Übersicht */
.page { min-height: 100dvh; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 24px); }
.topbar { padding: calc(var(--safe-t) + 10px) var(--pad) 0; }
.topbar-row { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.topbar-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.topbar-search-slot { display: none; }
.new-btn, .desk-only { display: none !important; }
.search-row { padding: 10px 0 0; }

.search { position: relative; }
.search input {
  width: 100%; height: 48px; padding: 0 44px 0 44px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px; appearance: none; -webkit-appearance: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--accent-ui); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; pointer-events: none; }
.search-clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; border-radius: 10px; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; max-height: min(60vh, 460px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px;
}
.suggest-group + .suggest-group { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.suggest-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px 4px; }
.suggest-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 6px 10px; border: 0; border-radius: 9px; background: none; text-align: left; cursor: pointer; }
.suggest-item:hover, .suggest-item.active { background: var(--surface-2); }
.suggest-item > .ic { color: var(--muted); width: 18px; height: 18px; }
.suggest-label { flex: 1; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-sub { font-size: 12px; color: var(--muted); white-space: nowrap; }
.suggest-hint { font-size: 12px; color: var(--muted); padding: 8px 10px 4px; border-top: 1px solid var(--line); margin-top: 4px; }

.filter-bar { padding: 10px 0 2px; display: grid; gap: 8px; }
.chip-scroll { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 2px 0; }
.chip-scroll::-webkit-scrollbar { display: none; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px 0 11px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; flex: none;
  transition: all var(--t);
}
.fchip:hover, .fchip[aria-expanded="true"] { border-color: var(--line-strong); background: var(--surface); color: var(--text); }
.fchip .ic { width: 16px; height: 16px; }
.fchip .chev { width: 14px; height: 14px; opacity: .55; }
@media (max-width: 759px) { .fchip { min-height: 34px; font-size: 13.5px; padding: 0 10px; } .fchip .chev { display: none; } }
.fchip.on { border-color: color-mix(in srgb, var(--accent-ui) 50%, transparent); background: var(--accent-soft); color: var(--text); }
.fchip-n { font-family: var(--mono); font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; padding: 0 5px; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.no-search .search-row { display: none; }
.no-search .filter-bar { padding-top: 12px; }
.active-filters .chip { min-height: 30px; font-size: 13px; padding: 0 10px; }
.active-filters .link-btn { font-size: 13px; margin-left: 4px; }

.date-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filter-sheet { display: grid; gap: 26px; }
.attr-filter { display: grid; gap: 16px; }
.attr-filter-group { display: grid; gap: 8px; }
.attr-filter-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }

.overview-main { padding: 0 var(--pad); padding-right: calc(var(--pad) + 22px); }
.result-line { font-size: 12.5px; color: var(--muted); padding: 14px 0 0; font-family: var(--mono); letter-spacing: 0; }
.result-line:empty { display: none; }

.section { padding-top: 14px; }
.section + .section { padding-top: var(--gap-y); }
.section-head { display: flex; align-items: baseline; gap: 10px; padding-bottom: 14px; font-size: 14px; font-weight: 600; letter-spacing: -.005em; }
.section-head::after { content: ''; flex: 1; height: 1px; background: var(--line); align-self: center; }
.section-count { order: 3; font-family: var(--mono); font-size: 11.5px; color: var(--muted); font-weight: 400; }
.gallery[data-gran="year"] .section-title { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; }

.grid { display: grid; grid-template-columns: repeat(var(--cols-m), minmax(0, 1fr)); gap: calc(var(--gap) + 10px) var(--gap); }

/* Karte */
.card { display: block; text-decoration: none; min-width: 0; padding-top: 12px; -webkit-touch-callout: none; }
.card-frame { position: relative; }
.card-media {
  position: relative; aspect-ratio: 1; border-radius: var(--r); overflow: hidden; background: var(--surface-2);
  border: 1px solid var(--line); transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
:root[data-aspect="portrait"] .card-media { aspect-ratio: 4 / 5; }
:root[data-aspect="landscape"] .card-media { aspect-ratio: 4 / 3; }
.card-media img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.card-media img.loaded { opacity: 1; }
.card:hover .card-media { transform: translateY(-2px); box-shadow: var(--shadow); }
.card:active .card-media { transform: scale(.985); }
.card-placeholder { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--muted); font-size: 12px;
  background: repeating-linear-gradient(-45deg, transparent 0 9px, color-mix(in srgb, var(--line) 60%, transparent) 9px 10px); }
.card-placeholder .ic { width: 30px; height: 30px; stroke-width: 1.3; }
.card-count { position: absolute; right: 8px; top: 8px; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 8px; background: rgb(18 17 14 / .55); color: #fff; font-family: var(--mono); font-size: 11.5px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.card-count .ic { width: 13px; height: 13px; }
.card-badge { position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); z-index: 2; }
/* Text-Schild: gleicher 2,5-px-Rand in Hintergrundfarbe wie beim Symbol-Diamant */
.card-badge.badge-text { padding: 2.5px; background: var(--bg); clip-path: polygon(0 50%, 10.9px 0, calc(100% - 10.9px) 0, 100% 50%, calc(100% - 10.9px) 100%, 10.9px 100%); }
.card-badge.shape-pill { clip-path: none; border-radius: 99px; }
.card-badge.shape-rounded, .card-badge.shape-outline { clip-path: none; border-radius: 9.5px; }
.card-badge.shape-rect { clip-path: none; border-radius: 3px; }
.card-badge.shape-underline { clip-path: none; border-radius: 7px 7px 2px 2px; }
.card-badge.shape-arrow { clip-path: polygon(0 0, calc(100% - 10.9px) 0, 100% 50%, calc(100% - 10.9px) 100%, 0 100%); }
.card-badge.shape-tag { clip-path: polygon(10.9px 0, 100% 0, 100% 100%, 10.9px 100%, 0 50%); }
.card-badge.shape-chevron { clip-path: polygon(0 0, calc(100% - 10.9px) 0, 100% 50%, calc(100% - 10.9px) 100%, 0 100%, 10.9px 50%); }
.card-badge.shape-slant { clip-path: polygon(8.5px 0, 100% 0, calc(100% - 8.5px) 100%, 0 100%); }
.card-badge.shape-banner { clip-path: polygon(0 0, 100% 0, calc(100% - 8.5px) 50%, 100% 100%, 0 100%, 8.5px 50%); }
.card-badge.shape-ticket { clip-path: polygon(0 0, 100% 0, 100% 30%, calc(100% - 4px) 50%, 100% 70%, 100% 100%, 0 100%, 0 70%, 4px 50%, 0 30%); }
.card-badge .badge-ring { display: block; }
.card-cats { position: absolute; left: 8px; bottom: 0; transform: translateY(50%); display: flex; gap: 4px; z-index: 2; }
.card-cats .cat-dot { box-shadow: 0 0 0 2.5px var(--bg); }
.card-meta { display: grid; gap: 1px; padding: 22px 2px 0; min-width: 0; }
.card-cats:empty + .card-meta, .card-frame:not(:has(.card-cats)) + .card-meta { padding-top: 10px; }
.card-title { font-weight: 600; font-size: 14.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-date { font-family: var(--mono); font-size: 11.5px; color: var(--muted); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-cols1] .card-title { font-size: 16px; }

/* Leere Zustände */
.empty-state { max-width: 380px; margin: 9vh auto 0; text-align: center; display: grid; justify-items: center; gap: 12px; padding: 0 8px; }
.empty-state h2 { font-size: 20px; }
.empty-state p { line-height: 1.55; }
.empty-state .btn { margin-top: 8px; }
.empty-state.small { margin-top: 6vh; }
.empty-mark { width: 64px; height: 64px; border-radius: 18px; border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--text-2); margin-bottom: 4px; }
.empty-mark .ic { width: 30px; height: 30px; stroke-width: 1.3; }

/* ---------------------------------------------------------- Zeitleiste rechts */
.rail {
  position: fixed; right: 0; top: 120px; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); width: 30px; z-index: 30;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: ns-resize;
}
.rail:focus-visible { outline: none; }
.rail-inner { position: absolute; inset: 10px 0 10px 0; }
.rail-track { position: absolute; inset: 0; }
.rail-track::before { content: ''; position: absolute; right: 13px; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.rail-tick { position: absolute; right: 11px; width: 5px; height: 1px; background: var(--muted); transform: translateY(-.5px); opacity: .6; }
.rail-label {
  position: absolute; right: 24px; transform: translateY(-50%); font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  white-space: nowrap; padding: 1px 6px; border-radius: 6px; background: var(--bg); opacity: 0; transition: opacity .2s; pointer-events: none;
}
.rail-label.major { color: var(--text); font-weight: 600; }
.rail.active .rail-label, .rail.dragging .rail-label { opacity: 1; }
.rail-thumb { position: absolute; right: 7px; width: 13px; height: 22px; transform: translateY(-50%); border-radius: 7px; background: var(--text); box-shadow: 0 0 0 2px var(--bg); transition: transform .15s var(--ease); }
.rail.dragging .rail-thumb { transform: translateY(-50%) scale(1.15); }
.rail-bubble {
  position: absolute; right: 24px; top: 50%; transform: translateY(-50%); white-space: nowrap; padding: 7px 12px; border-radius: 10px;
  background: var(--text); color: var(--bg); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .15s;
}
.rail.dragging .rail-bubble { opacity: 1; }
.rail.dragging .rail-label, .rail.dragging .rail-tick { opacity: .25; }
.rail:hover .rail-label { opacity: 1; }

/* ---------------------------------------------------------- Untere Navigation */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 88%, transparent); border-top: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.nav-item { display: grid; justify-items: center; align-content: center; gap: 3px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.nav-item .nav-ic { display: grid; place-items: center; width: 44px; height: 30px; border-radius: 10px; transition: background var(--t); }
.nav-item .ic { width: 22px; height: 22px; }
.nav-label { font-size: 11px; font-weight: 500; }
.nav-item.on { color: var(--text); }
.nav-item.on .nav-ic { background: var(--surface-2); }
.nav-item.primary .nav-ic { background: var(--accent); color: var(--on-accent); width: 48px; height: 32px; border-radius: 11px; }
.nav-item.primary { color: var(--text); }

/* ---------------------------------------------------------- Projektseite */
.project-top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 4px;
  padding: calc(var(--safe-t) + 8px) 8px 8px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid transparent;
}
.title-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 6px 8px; border-radius: 10px; cursor: pointer; text-align: left; }
.title-btn:hover { background: var(--surface-2); }
.project-title { font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-edit { width: 16px; height: 16px; color: var(--muted); opacity: 0; transition: opacity var(--t); }
.title-btn:hover .title-edit { opacity: 1; }
@media (pointer: coarse) { .title-edit { opacity: .6; } }
.project-actions { display: flex; align-items: center; gap: 0; }
.save-state { font-size: 12px; color: var(--muted); opacity: 0; transition: opacity .25s; white-space: nowrap; margin-right: 4px; font-family: var(--mono); }
.save-state.show { opacity: 1; }
.save-state.err { color: var(--danger); }

.project-layout { padding: 0 var(--pad); }
.carousel-wrap { position: relative; margin-top: 20px; }
.range-pill {
  position: absolute; z-index: 3; left: 50%; top: 0; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-strong);
  font-family: var(--mono); font-size: 12.5px; white-space: nowrap; box-shadow: 0 0 0 4px var(--bg); letter-spacing: 0;
}
.range-pill .ic { width: 15px; height: 15px; color: var(--muted); }
.range-dur { color: var(--muted); padding-left: 8px; border-left: 1px solid var(--line); }
.carousel {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
  margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad); scroll-padding: 0 var(--pad);
}
.carousel::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 88%; margin: 0; scroll-snap-align: center; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); aspect-ratio: 4 / 5; cursor: zoom-in; }
.slide:only-child { flex-basis: 100%; }
.slide-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide-img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.slide-time { position: absolute; left: 10px; bottom: 10px; padding: 4px 9px; border-radius: 8px; background: rgb(18 17 14 / .55); color: #fff; font-family: var(--mono); font-size: 11.5px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.slide-cover { position: absolute; right: 10px; bottom: 10px; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgb(18 17 14 / .55); color: #fbbf24; }
.slide-cover .ic { width: 15px; height: 15px; }
.car-nav { display: none !important; }
.carousel-empty {
  width: 100%; aspect-ratio: 4 / 3; border-radius: var(--r-lg); border: 1.5px dashed var(--line-strong); background: var(--surface);
  display: grid; place-items: center; align-content: center; gap: 8px; padding: 24px; cursor: pointer; color: var(--text-2); text-align: center;
}
.carousel-empty .ic { width: 34px; height: 34px; stroke-width: 1.3; color: var(--muted); }
.carousel-empty:hover { border-color: var(--accent-ui); }
.carousel-foot { display: flex; justify-content: center; padding: 12px 0 4px; min-height: 30px; }
.dots { display: flex; gap: 7px; align-items: center; }
.dot { width: 7px; height: 7px; border-radius: 50%; border: 1.3px solid var(--text-2); transition: background var(--t), transform var(--t); }
.dot.on { background: var(--text); border-color: var(--text); transform: scale(1.1); }
.slide-counter { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.media-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0 0; }
.time-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 10px; margin-left: -10px; border-radius: 9px; border: 0; background: none; cursor: pointer; font-family: var(--mono); font-size: 13px; color: var(--text-2); letter-spacing: 0; }
.time-btn:hover { background: var(--surface-2); }
.time-btn .ic { width: 16px; height: 16px; color: var(--muted); }
.toolbar-actions { display: flex; align-items: center; gap: 2px; }
.toolbar-actions .btn { margin-left: 6px; }

.project-history { display: none; }
.history-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.history-head h2 { font-size: 15px; }
.history-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 0; }
.hist-gap { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--muted); padding: 2px 0 2px 33px; position: relative; }
.hist-gap::before { content: ''; position: absolute; left: 24px; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.hist-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px; border: 1px solid transparent; border-radius: 12px; background: none; cursor: pointer; text-align: left; }
.hist-item:hover { background: var(--surface-2); }
.hist-item.on { border-color: var(--line-strong); background: var(--surface); }
.hist-item img { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex: none; }
.hist-text { display: grid; }
.hist-date { font-family: var(--mono); font-size: 12.5px; }
.hist-time { font-family: var(--mono); font-size: 11px; color: var(--muted); }

.project-details { padding: 8px var(--pad) 0; display: grid; gap: 4px; }
.detail-block { padding: 20px 0; border-top: 1px solid var(--line); }
.detail-block:first-child { border-top: 0; }
.block-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 14px; }
.block-title .ic { width: 16px; height: 16px; }
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.block-head .block-title { margin: 0; }

.status-row { display: flex; flex-wrap: wrap; gap: 8px; }
.status-pick {
  --c: #666; --fg: #fff; display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); font-weight: 500; font-size: 14px; cursor: pointer; transition: all var(--t);
}
.status-pick .ic { width: 16px; height: 16px; color: var(--c); }
.status-pick:hover { border-color: var(--c); }
.status-pick.on { background: var(--c); border-color: var(--c); color: var(--fg); }
.status-pick.on .ic { color: var(--fg); }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.stats-row div { padding: 12px 12px; border-left: 1px solid var(--line); min-width: 0; }
.stats-row div:first-child { border-left: 0; }
.stats-row dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stats-row dd { margin: 3px 0 0; font-family: var(--mono); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .stats-row { grid-template-columns: 1fr 1fr; } .stats-row div:nth-child(3) { border-left: 0; } .stats-row div:nth-child(n+3) { border-top: 1px solid var(--line); } }

.cat-blocks { display: grid; gap: 22px; }
.cat-head { display: flex; align-items: center; gap: 12px; }
.cat-head h3 { flex: 1; font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.attr-tree { list-style: none; margin: 0 0 0 19px; padding: 6px 0 0; position: relative; }
.attr-tree::before { content: ''; position: absolute; left: 0; top: -4px; bottom: 22px; width: 1.5px; background: color-mix(in srgb, var(--c) 55%, var(--line-strong)); border-radius: 2px; }
.attr-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 5px 0 5px 22px; min-height: 52px; }
.attr-row::before { content: ''; position: absolute; left: 0; top: 50%; width: 14px; height: 1.5px; background: color-mix(in srgb, var(--c) 55%, var(--line-strong)); }
.attr-row:last-child::after { content: ''; position: absolute; left: -2px; top: calc(50% + 1px); bottom: 0; width: 6px; background: var(--bg); }
.attr-name { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attr-ic { width: 16px; height: 16px; color: var(--c); }
.attr-fill { flex: 1; min-width: 12px; height: 1px; border-top: 1.5px dotted var(--line-strong); align-self: center; }
.attr-control { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.attr-control .input.sm { width: 150px; }
.attr-control.with-unit { position: relative; }
.attr-control.with-unit .input { width: 120px; text-align: right; padding-right: 40px; font-family: var(--mono); font-size: 15px; }
.attr-control .unit { position: absolute; right: 11px; color: var(--muted); font-size: 13px; pointer-events: none; font-family: var(--mono); }
.attr-control.text { flex: 1 1 130px; max-width: 240px; }
.attr-control.text .input.sm { width: 100%; }
.attr-control.wide { flex: 1 1 100%; }
.attr-control.wide .input { width: 100%; }
.attr-row:has(.attr-control.wide) { flex-wrap: wrap; }
.attr-row:has(.attr-control.wide) .attr-fill { display: none; }
.attr-control.color .input { width: 112px; }
.color-swatch { --c: transparent; position: relative; width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--c); cursor: pointer; flex: none; overflow: hidden; }
.color-swatch.empty { background: repeating-linear-gradient(-45deg, var(--surface) 0 5px, var(--surface-2) 5px 10px); }
.color-swatch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.attr-empty { padding: 8px 0 0 52px; }
.attr-empty a { color: var(--accent-ui); }
.cat-empty { width: 100%; display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: var(--r); border: 1.5px dashed var(--line-strong); background: none; color: var(--muted); text-align: left; cursor: pointer; font-size: 14px; }
.cat-empty:hover { border-color: var(--accent-ui); color: var(--text-2); }
.notes { min-height: 110px; }

@media (max-width: 420px) {
  .attr-control .input.sm { width: 128px; }
  .attr-control.with-unit .input { width: 104px; }
  .attr-control.color .input { width: 96px; }
}

/* Bildauswahl */
.photo-picker { display: grid; gap: 14px; border-radius: var(--r); transition: background var(--t); }
.photo-picker.dragover { background: var(--accent-soft); outline: 2px dashed var(--accent-ui); outline-offset: 6px; }
.pick-buttons { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.drop {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; padding: 0 18px; border-radius: var(--r);
  border: 1.5px dashed var(--line-strong); background: var(--surface); color: var(--text-2); font-weight: 500; cursor: pointer; transition: border-color var(--t), background var(--t);
}
.drop:hover { border-color: var(--accent-ui); background: var(--accent-soft); }
.drop .ic { width: 22px; height: 22px; }
.photo-picker.compact .drop { min-height: 52px; }
@media (pointer: fine) { .drop.cam { display: none; } .pick-buttons { grid-template-columns: 1fr; } }
.pick-list { display: grid; gap: 8px; }
.pick-list:empty { display: none; }
.pick-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.pick-item.error { border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.pick-thumb { position: relative; width: 56px; height: 56px; border-radius: 9px; background-size: cover; background-position: center; flex: none; overflow: hidden; background-color: var(--surface-2); }
.pick-progress { --p: 0; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgb(0 0 0 / .25); }
.pick-progress::after { content: ''; position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p)); background: var(--accent); transition: transform .2s; }
.pick-done { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / .45); color: #fff; }
.pick-info { display: grid; gap: 4px; min-width: 0; flex: 1; }
.pick-name { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-sub { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.pick-err { font-size: 12px; color: var(--danger); }
.pick-info .input.sm { min-height: 36px; font-size: 14px; }
.past-box { display: grid; gap: 12px; }
.past-box:empty { display: none; }
.status-row, .chip-row { min-width: 0; }

/* Vollbild */
.viewer { position: fixed; inset: 0; z-index: 150; background: #0b0b0a; display: flex; flex-direction: column; opacity: 0; transition: opacity .18s; }
.viewer.open { opacity: 1; }
.viewer.closing { opacity: 0; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(var(--safe-t) + 8px) 8px 8px 16px; color: #e9e8e3; }
.viewer-info { font-family: var(--mono); font-size: 12.5px; }
.viewer-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.viewer-track::-webkit-scrollbar { display: none; }
.viewer-slide { flex: 0 0 100%; scroll-snap-align: center; display: grid; place-items: center; padding: 0 0 calc(var(--safe-b) + 16px); overflow: auto; }
.viewer-slide img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); display: none !important; background: rgb(255 255 255 / .08) !important; }
.viewer-nav.prev { left: 16px; } .viewer-nav.next { right: 16px; }

/* ---------------------------------------------------------- Einstellungen */
.settings-top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 6px; padding: calc(var(--safe-t) + 8px) 8px 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.settings-top h1 { font-size: 19px; }
.settings-index { padding: 8px var(--pad) 0; display: grid; gap: 18px; }
.profile-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.settings-nav { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.settings-link { display: flex; align-items: center; gap: 14px; padding: 12px 14px; text-decoration: none; border-top: 1px solid var(--line); transition: background var(--t); }
.settings-link:first-child { border-top: 0; }
.settings-link:hover { background: var(--surface-2); }
.settings-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--text-2); flex: none; }
.settings-ic .ic { width: 19px; height: 19px; }
.settings-link-text { display: grid; flex: 1; min-width: 0; }
.settings-link-text > span:first-child { font-weight: 500; }
.settings-link-hint { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-link .chev { width: 18px; height: 18px; color: var(--muted); }
.logout { color: var(--danger); }
.settings-content { padding: 4px var(--pad) 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; align-content: start; min-width: 0; }
.settings-content > * { min-width: 0; }
.settings-h { font-size: 24px; margin: 4px 0 8px; }
.set-intro { font-size: 14px; color: var(--muted); line-height: 1.55; margin: 6px 0 4px; }
.set-group { margin-top: 18px; }
.set-group-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 4px 8px; }
.set-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.set-card.flat { border-radius: var(--r); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-top: 1px solid var(--line); min-height: 60px; }
.set-row:first-child { border-top: 0; }
.set-row.stack { flex-direction: column; align-items: stretch; gap: 12px; }
.set-text { min-width: 0; }
.set-label { font-weight: 500; }
.set-hint { font-size: 13px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.set-control { display: flex; justify-content: flex-end; min-width: 0; }
.set-row:not(.stack) .set-control:has(> .segmented) { flex: none; }
.set-row:not(.stack) .set-text { flex: 1; }
.set-row.stack .set-control { justify-content: flex-start; }
.set-row.stack .set-control > .segmented { width: 100%; }
.set-pad { padding: 16px; }
.set-empty { padding: 28px 16px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); margin: 16px 0; }
.settings-content > div > .btn.block, .settings-content > div > a.btn.block { margin-top: 14px; }
.inline-form { display: flex; gap: 8px; width: 100%; }
.inline-form .input { flex: 1; }
.session-list { display: grid; gap: 4px; }
.session { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.session .ic { color: var(--muted); }
.session-text { display: grid; flex: 1; min-width: 0; }
.range-wrap { display: flex; align-items: center; gap: 12px; }
.range { width: 160px; accent-color: var(--accent); }
.range-val { font-family: var(--mono); font-size: 13px; min-width: 40px; text-align: right; }

.preview { display: grid; }
.preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); max-width: 460px; transition: gap .2s; }
.preview .card { pointer-events: none; }
.preview-fill { position: absolute; inset: 0; }
.preview-fill.a { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 35%, var(--surface-2)), var(--surface-2) 70%); }
.preview-fill.b { background: linear-gradient(200deg, var(--surface-3), color-mix(in srgb, var(--accent) 18%, var(--surface-2))); }

.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 6px; border-top: 1px solid var(--line); min-height: 64px; }
.list-row:first-child { border-top: 0; }
.list-lead { width: 64px; display: grid; place-items: center; flex: none; }
.list-text { display: grid; flex: 1; min-width: 0; text-decoration: none; }
.list-text > span:first-child { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.move-btns { display: grid; gap: 0; flex: none; }
.move-btns .icon-btn { width: 28px; height: 22px; border-radius: 6px; }
.move-btns .icon-btn .ic { width: 15px; height: 15px; }

.badge-preview { display: grid; place-items: center; padding: 8px 0; }
.badge-stage { position: relative; width: 150px; padding-top: 14px; }
.badge-stage-card { aspect-ratio: 4 / 3; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }

.cat-ident { display: flex; align-items: flex-end; gap: 14px; }
.back-link { margin-bottom: 4px; }
.attr-editor { display: grid; gap: 10px; }
.attr-card { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 6px 10px 6px; background: var(--bg); }
.attr-card-main { display: flex; align-items: flex-start; gap: 8px; }
.attr-card-main > .move-btns { padding-top: 0; }
.attr-fields { flex: 1; display: grid; gap: 8px; min-width: 0; }
.attr-line { display: flex; gap: 8px; flex-wrap: wrap; }
.attr-line > .input:first-child { flex: 1 1 160px; }
.attr-line > select.input { flex: 0 1 150px; }
.attr-line > .input { flex: 1 1 140px; }
.opt-editor { display: grid; gap: 8px; width: 100%; }
.warn-text { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: #b45309; }
.warn-text .ic { width: 15px; height: 15px; }
.attr-add { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 6px; }
.attr-add .chip { border-style: dashed; }
.sticky-actions {
  position: sticky; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin-top: 18px; padding: 12px 0; background: linear-gradient(to top, var(--bg) 70%, transparent);
}

/* =====================================================================
   Breite Bildschirme
   ===================================================================== */
@media (min-width: 560px) {
  :root { --pad: 24px; }
  .grid { grid-template-columns: repeat(max(var(--cols-m), 3), minmax(0, 1fr)); }
  .slide { flex-basis: 70%; }
}

@media (min-width: 760px) {
  :root { --nav-h: 0px; }
  .bottomnav { display: none; }
  .page { padding-bottom: 48px; }
  .topbar { position: sticky; top: 0; z-index: 35; padding: 0 var(--pad); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
  .topbar-row { min-height: 64px; gap: 20px; }
  .topbar-search-slot { display: block; flex: 1; max-width: 560px; margin: 0 auto; }
  .topbar-search-slot .search input { height: 42px; border-radius: 12px; background: var(--surface); }
  .topbar-actions { margin-left: 0; gap: 4px; }
  .search-row { display: none; }
  .new-btn, .desk-only { display: inline-flex !important; }
  .new-btn { min-height: 40px; margin-right: 6px; }
  .user-name { display: inline; }
  .filter-bar { padding: 0 0 12px; }
  .chip-scroll { margin: 0; padding: 0; overflow: visible; flex-wrap: wrap; justify-content: center; }
  .no-search .topbar-search-slot { max-width: none; }
  .no-search .topbar-search-slot .filter-bar { padding: 10px 0; }
  .overview-main { padding-right: calc(var(--pad) + 76px); max-width: 1680px; }
  .grid { grid-template-columns: repeat(var(--cols-d), minmax(0, 1fr)); }
  .rail { width: 84px; right: 4px; }
  .rail-track::before { right: 16px; }
  .rail-tick { right: 14px; }
  .rail-thumb { right: 10px; }
  .rail-label { opacity: 1; right: 28px; }
  .rail-bubble { right: 30px; }
  .section-head { font-size: 15px; }
}

@media (min-width: 900px) {
  .settings-top { padding: 14px var(--pad); border-bottom: 1px solid var(--line); }
  .settings-layout { display: grid; grid-template-columns: 300px minmax(0, 720px); gap: 40px; padding: 28px var(--pad) 0; max-width: 1140px; margin: 0 auto; align-items: start; }
  .settings-nav { position: sticky; top: 90px; border: 0; background: transparent; gap: 2px; }
  .settings-link { border: 0; border-radius: 12px; padding: 9px 10px; }
  .settings-link.on { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
  .settings-link .chev { display: none; }
  .settings-content { padding: 0; }
  .sticky-actions { bottom: 0; }
  .set-row.stack { flex-direction: row; align-items: center; }
  .set-row.stack .set-control { justify-content: flex-end; }
  .set-row.stack .set-control > .segmented { width: auto; }
  .set-row.stack .set-text { flex: 1; }
  .set-row.stack .input { max-width: 320px; }
  .set-row.stack:has(.color-picker) { flex-direction: column; align-items: stretch; }
  .set-row.stack:has(.color-picker) .set-control { justify-content: flex-start; }
}

@media (min-width: 960px) {
  .project-top { padding: 12px 20px; border-bottom: 1px solid var(--line); }
  .project-title { font-size: 22px; }
  .project-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; max-width: 1280px; margin: 0 auto; padding: 16px 32px 0; }
  .project-details { max-width: 1280px; margin: 0 auto; padding: 16px 32px 0; grid-template-columns: minmax(0, 1fr) 300px; column-gap: 32px; }
  .project-details > .detail-block { grid-column: 1; }
  .carousel { margin: 0; padding: 0; scroll-padding: 0; border-radius: var(--r-lg); }
  .slide { flex-basis: 100%; aspect-ratio: 4 / 3; border-radius: var(--r-lg); }
  .slide-img { object-fit: contain; }
  .slide-bg { filter: blur(28px) saturate(1.1); transform: scale(1.15); opacity: .55; }
  .car-nav { display: grid !important; position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; background: color-mix(in srgb, var(--surface) 85%, transparent) !important; box-shadow: 0 0 0 1px var(--line); backdrop-filter: blur(8px); }
  .car-nav.prev { left: 14px; } .car-nav.next { right: 14px; }
  .project-history { display: block; position: sticky; top: 92px; align-self: start; margin-top: 20px; max-height: calc(100vh - 120px); overflow-y: auto; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
  .project-history:empty { display: none; }
  .viewer-nav { display: grid !important; }
}

@media (min-width: 1400px) {
  .overview-main { margin: 0 auto; }
}

/* Feine Zeiger: Hover-Akzente */
@media (hover: none) {
  .card:hover .card-media { transform: none; box-shadow: none; }
}

.app-version { text-align: center; font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin: -6px 0 8px; }

/* =====================================================================
   Hintergrund-Linien
   ===================================================================== */
.bg-lines { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
/* Sanfte Abblendung in den unteren Ecken: Projekte laufen beim Scrollen darunter aus, darauf entstehen die Motive */
.bg-vignette {
  --vr: min(20vw, 300px);
  position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--vr) * 1.1); z-index: 3; pointer-events: none;
  background:
    radial-gradient(circle at 0 100%, var(--bg) 0, color-mix(in srgb, var(--bg) 94%, transparent) calc(var(--vr) * .55), transparent var(--vr)),
    radial-gradient(circle at 100% 100%, var(--bg) 0, color-mix(in srgb, var(--bg) 94%, transparent) calc(var(--vr) * .55), transparent var(--vr));
}
@media (max-width: 759px) {
  .bg-vignette { --vr: min(48vw, 200px); bottom: calc(var(--nav-h) + var(--safe-b)); }
}
.overview-main { position: relative; z-index: 1; }
@media (max-width: 759px) { .overview .topbar { position: relative; z-index: 2; } }

/* =====================================================================
   Kopfzeile Desktop: Suche + Filter exakt mittig untereinander
   ===================================================================== */
@media (min-width: 760px) {
  .topbar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 20px; }
  .topbar-row > .brand { justify-self: start; }
  .topbar-row > .topbar-actions { justify-self: end; }
  /* Suche schmaler, sobald Logo, Name und Umschalter links sonst nicht mehr passen */
  .topbar-search-slot { width: clamp(240px, calc(100vw - 2 * var(--pad) - 2 * 480px), 560px); max-width: none; margin: 0; }
  .no-search .topbar-search-slot { width: auto; }
  .filter-bar { justify-items: center; }
}
@media (min-width: 760px) and (max-width: 1099px) {
  .new-btn span { display: none; }
  .new-btn { width: 40px; padding: 0; }
  .user-name { display: none; }
}

/* =====================================================================
   Fortschritt der Anleitung auf der Karte
   ===================================================================== */
.card-guide { display: flex; align-items: center; gap: 8px; padding: 6px 2px 0; }
.card-guide-bar { flex: 1; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.card-guide-bar span { display: block; height: 100%; background: var(--accent-ui); border-radius: 3px; }
.card-guide-n { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }

/* =====================================================================
   Anleitungen – Abschnitt im Projekt
   ===================================================================== */
.guide-list { display: grid; gap: 10px; }
.guide-card { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.guide-thumb { position: relative; width: 52px; height: 64px; flex: none; border-radius: 8px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.guide-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.guide-done { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 70%, transparent); color: var(--on-accent); }
.guide-info { flex: 1; min-width: 0; display: grid; gap: 4px; text-decoration: none; }
.guide-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guide-sub { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.guide-bar { display: block; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.guide-bar span { display: block; height: 100%; background: var(--accent-ui); border-radius: 4px; transition: width .3s var(--ease); }
.guide-pick-sel { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r); }
.guide-pick-sel span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.guide-progress { display: grid; gap: 8px; }
.guide-progress .bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.guide-progress .bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s; }
.guide-progress-text { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

.menu-list { display: grid; gap: 2px; }
.menu-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 10px; margin: 0 -10px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; text-decoration: none; font-weight: 500; }
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--danger); }

/* =====================================================================
   Anleitung – Seitenansicht
   ===================================================================== */
.guide-page { padding-bottom: calc(24px + var(--safe-b)); }
.guide-top { border-bottom: 0; }
.guide-head-text { flex: 1; min-width: 0; display: grid; padding: 0 6px; }
.guide-head-title { font-weight: 600; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.guide-head-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guide-count { font-family: var(--mono); font-size: 13px; color: var(--text-2); padding: 0 8px; }
.guide-bar.top { position: sticky; top: calc(var(--safe-t) + 58px); z-index: 29; height: 2px; border-radius: 0; margin: 0; }
.guide-layout { display: grid; gap: 18px; padding: 14px var(--pad) 0; }
.guide-stage { position: relative; min-width: 0; }
.guide-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; border-radius: var(--r); }
.guide-track::-webkit-scrollbar { display: none; }
.guide-slide { flex: 0 0 100%; scroll-snap-align: start; display: grid; place-items: start center; }
.guide-paper { width: 100%; background: #fff; border-radius: var(--r); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow); }
.guide-paper img { width: 100%; height: 100%; object-fit: contain; }
.guide-side { display: grid; gap: 14px; align-content: start; min-width: 0; }
.guide-panel { display: grid; gap: 14px; }

.done-toggle {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 16px; border-radius: var(--r);
  border: 1.5px dashed var(--line-strong); background: var(--surface); text-align: left; cursor: pointer; transition: all var(--t);
}
.done-toggle:hover { border-color: var(--accent-ui); }
.done-ic { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: transparent; flex: none; transition: all var(--t); }
.done-ic .ic { width: 18px; height: 18px; stroke-width: 2.2; }
.done-text { display: grid; flex: 1; }
.done-text b { font-weight: 600; }
.done-text span { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.done-undo { font-size: 13px; color: var(--muted); }
.done-toggle.on { border-style: solid; border-color: color-mix(in srgb, var(--accent-ui) 60%, transparent); background: var(--accent-soft); }
.done-toggle.on .done-ic { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.photo-link { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 12px; display: grid; gap: 10px; }
.photo-link-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.photo-link-head .ic { width: 16px; height: 16px; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-linked { display: flex; align-items: center; gap: 12px; }
.photo-linked img { width: 56px; height: 56px; border-radius: 9px; object-fit: cover; flex: none; }
.photo-linked-text { display: grid; flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; }

.side-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-top: 6px; }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.page-cell { position: relative; aspect-ratio: 3 / 4; padding: 0; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.page-cell img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: opacity var(--t); }
.page-cell.done img { opacity: .45; }
.page-cell.on { outline: 2px solid var(--accent-ui); outline-offset: 1px; }
.page-no { position: absolute; left: 4px; bottom: 4px; font-family: var(--mono); font-size: 10.5px; padding: 1px 5px; border-radius: 5px; background: rgb(18 17 14 / .6); color: #fff; }
.page-check { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent-ui); }
.page-check .ic { width: 26px; height: 26px; stroke-width: 2.4; }
.page-photo { position: absolute; right: 4px; top: 4px; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: var(--surface); color: var(--text-2); }
.page-photo .ic { width: 13px; height: 13px; }

.img-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.img-pick { padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); cursor: pointer; display: grid; }
.img-pick img { aspect-ratio: 1; width: 100%; object-fit: cover; }
.img-pick span { font-family: var(--mono); font-size: 11px; color: var(--muted); padding: 4px; }
.img-pick.on { outline: 2px solid var(--accent-ui); }

@media (min-width: 960px) {
  .guide-top { padding: 12px 20px; }
  .guide-bar.top { top: 66px; }
  .guide-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; max-width: 1280px; margin: 0 auto; padding: 20px 32px 0; }
  .guide-side { position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow-y: auto; padding-right: 4px; }
  .guide-stage .car-nav { display: grid !important; position: absolute; top: 40%; z-index: 3; background: color-mix(in srgb, var(--surface) 85%, transparent) !important; box-shadow: 0 0 0 1px var(--line); }
  .guide-stage .car-nav.prev { left: 12px; } .guide-stage .car-nav.next { right: 12px; }
}

/* =====================================================================
   Schematische Vorschau „Übersicht & Karten“
   ===================================================================== */
.lp { display: grid; place-items: center; }
.lp-frame { width: 100%; max-width: 260px; padding: 12px 10px 14px; border: 1.5px solid var(--line-strong); border-radius: 22px; background: var(--bg); display: grid; gap: 8px; align-content: start; }
.lp.desk .lp-frame { max-width: 560px; border-radius: 12px; padding: 10px 12px 14px; }
.lp-top { display: flex; align-items: center; gap: 8px; }
.lp-logo { width: 14px; height: 14px; border-radius: 4px; background: var(--text); flex: none; }
.lp-gap { flex: 1; }
.lp-avatar { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; }
.lp-search { flex: 1; height: 12px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface); }
.lp.desk .lp-search { flex: 0 1 46%; margin: 0 auto; }
.lp-search.full { display: block; height: 16px; }
.lp-chips { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.lp-chip { height: 9px; border-radius: 4px; border: 1px solid var(--line-strong); }
.lp-grid { display: grid; gap: 10px 6px; margin-top: 4px; }
.lp-card { display: grid; gap: 3px; min-width: 0; }
.lp-media { position: relative; border-radius: 4px; background: color-mix(in srgb, var(--c) 14%, var(--surface-2)); border: 1px solid var(--line); margin-top: 4px; }
.lp-badge { position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); background: var(--c); box-shadow: 0 0 0 1.5px var(--bg); }
.lp-badge.text { width: 14px; height: 5px; border-radius: 2px; }
.lp-badge.icon { width: 6px; height: 6px; transform: translate(-50%, -50%) rotate(45deg); border-radius: 1px; }
.lp-cats { position: absolute; left: 3px; bottom: 0; transform: translateY(50%); display: flex; gap: 2px; }
.lp-dot { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--c); background: var(--surface); box-shadow: 0 0 0 1px var(--bg); }
.lp-line { display: block; height: 3px; border-radius: 2px; }
.lp-line.title { background: var(--text-2); opacity: .55; margin-top: 3px; }
.lp-line.date { background: var(--muted); opacity: .35; height: 2px; }

/* Formauswahl im Status-Editor */
.shape-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.shape-opt { display: grid; justify-items: center; gap: 6px; padding: 14px 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); cursor: pointer; transition: border-color var(--t), background var(--t); min-width: 0; }
.shape-opt:hover { border-color: var(--line-strong); }
.shape-opt.on { border-color: var(--accent-ui); box-shadow: 0 0 0 2px var(--accent-soft); background: var(--surface); }
.shape-opt-stage { position: relative; height: 34px; width: 100%; display: grid; place-items: center; overflow: hidden; }
.shape-opt-stage .card-badge { position: relative; left: auto; top: auto; transform: none; }
.shape-opt-stage .badge-shape { font-size: 10px; height: 21px; }
.shape-opt-label { font-size: 12px; color: var(--muted); }
.shape-opt.on .shape-opt-label { color: var(--text); font-weight: 500; }
.device-note { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--text-2); margin: 6px 4px 0; }
.device-note .ic { width: 17px; height: 17px; color: var(--muted); }
.device-note > div { display: grid; gap: 1px; }
.device-sub { font-size: 12.5px; color: var(--muted); }
.device-note .ic { margin-top: 2px; }

/* Profilbild */
.avatar { overflow: hidden; }
.avatar.has-img { border-color: transparent; background: var(--surface-2); }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-control { display: flex; align-items: center; gap: 6px; }
.avatar-pick { position: relative; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
.avatar-pick .avatar.lg { width: 56px; height: 56px; }
.avatar-edit { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); box-shadow: 0 0 0 2px var(--surface); }
.avatar-edit .ic { width: 13px; height: 13px; }

/* Eigene Daten für Beginn/Ende */
.stat-edit { cursor: pointer; transition: background var(--t); }
.stat-edit:hover { background: var(--surface-2); }
.stat-edit dt { display: flex; align-items: center; gap: 4px; }
.stat-pen { width: 11px; height: 11px; opacity: .5; }
.stat-src { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats-row div:first-child { border-radius: var(--r) 0 0 var(--r); }
.date-src { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.date-src .ic { width: 17px; height: 17px; color: var(--muted); flex: none; }

/* Attribute ein-/ausblenden */
.attr-vis { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 11px; flex: none; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); font-size: 13px; cursor: pointer; }
.attr-vis .ic { width: 16px; height: 16px; }
.attr-row.is-hidden .attr-name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.attr-row.is-hidden .attr-vis { color: var(--muted); border-style: dashed; }
.attr-toggle-list .attr-row { min-height: 46px; }
.attr-hidden-note { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 0 41px; padding: 4px 8px; border: 0; background: none; color: var(--muted); font-size: 12.5px; cursor: pointer; border-radius: 8px; }
.attr-hidden-note:hover { background: var(--surface-2); color: var(--text-2); }
.attr-hidden-note .ic { width: 15px; height: 15px; }
.cat-block.editing .cat-head h3::after { content: 'Attribute auswählen'; display: block; font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-top: 2px; }

/* Projektansicht mittig */
@media (min-width: 960px) {
  .page.project { --pw: 1120px; }
  .project-top { padding-left: max(20px, calc((100% - var(--pw)) / 2)); padding-right: max(20px, calc((100% - var(--pw)) / 2)); }
  .project-layout { max-width: var(--pw); padding-left: 0; padding-right: 0; width: calc(100% - 64px); }
  .project-details { display: block; max-width: var(--pw); width: calc(100% - 64px); padding-left: 0; padding-right: 0; }
}


/* =====================================================================
   Langer Text (Attribut) – immer volle Breite, auch auf schmalen Handys
   ===================================================================== */
.attr-row:has(.attr-control.wide) { padding-top: 10px; padding-bottom: 10px; gap: 8px; }
.attr-row:has(.attr-control.wide) .attr-name { flex: 1 1 100%; white-space: normal; }
.attr-control.wide, .attr-control.wide .input, .attr-control.wide .input.sm { width: 100%; max-width: none; }
.attr-control.wide textarea.input.sm { min-height: 76px; padding: 10px 12px; line-height: 1.45; font-size: 16px; }
.attr-row:has(.attr-control.wide)::before { top: 26px; }

/* =====================================================================
   Navigation: 5 Tabs unten (Handy), Bereichs-Umschalter oben (groß)
   ===================================================================== */
.nav-label { font-size: 10.5px; white-space: nowrap; }
@media (max-width: 360px) { .nav-label { font-size: 9.5px; } .nav-item .nav-ic { width: 40px; } }
.desk-tabs { display: none; }
@media (min-width: 760px) {
  .topbar-left { display: flex; align-items: center; gap: 18px; min-width: 0; justify-self: start; }
  .desk-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
  .desk-tabs a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; text-decoration: none; font-size: 13.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
  .desk-tabs a .ic { width: 16px; height: 16px; }
  .desk-tabs a:hover { color: var(--text); }
  .desk-tabs a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 0 0 1px var(--line); }
}
@media (min-width: 760px) and (max-width: 1199px) {
  .desk-tabs a span { display: none; }
  .desk-tabs a { padding: 0 9px; }
}
@media (min-width: 760px) and (max-width: 1259px) { .topbar-left .brand-name { display: none; } }

/* =====================================================================
   Filterleiste unten (Handy)
   ===================================================================== */
.filter-dock {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 39;
  padding: 8px 12px; background: color-mix(in srgb, var(--surface) 92%, transparent); border-top: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.filter-dock .filter-bar { padding: 0; gap: 6px; }
.filter-dock .chip-scroll { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; }
.filter-dock .chip-scroll::-webkit-scrollbar { display: none; }
.filter-dock .active-filters { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
.filter-dock .active-filters::-webkit-scrollbar { display: none; }
.filters-bottom .page, .page.filters-bottom { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 84px); }
.filters-bottom .bg-vignette { bottom: calc(var(--nav-h) + var(--safe-b) + 52px); }
.filters-bottom .rail { bottom: calc(var(--nav-h) + var(--safe-b) + 64px); }
@media (min-width: 760px) { .filter-dock { display: none; } }

/* =====================================================================
   Anleitungskatalog
   ===================================================================== */
.catalog-top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px;
  padding: calc(var(--safe-t) + 10px) var(--pad) 10px; background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.catalog-top > .icon-btn { margin-left: -8px; }
.catalog-head { display: flex; align-items: center; gap: 18px; flex: 1; min-width: 0; }
.catalog-head h1 { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catalog-top .topbar-actions { margin-left: auto; }
.catalog-top .user-chip { padding: 2px; }
.catalog-bar { padding: 4px var(--pad) 0; }
.catalog-filters { display: grid; gap: 10px; justify-items: center; }
.catalog-search { width: 100%; max-width: 560px; }
.chip-row.center { justify-content: center; }
.field-hint.center { text-align: center; }
.catalog-main { padding: 0 var(--pad); position: relative; z-index: 1; }
.catalog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 14px; padding-top: 14px; }
@media (min-width: 560px) { .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }
@media (min-width: 760px) {
  .catalog-top { padding: 12px var(--pad); border-bottom: 1px solid var(--line); }
  .catalog-bar { padding-top: 16px; }
  .catalog-main { max-width: 1480px; margin: 0 auto; }
  .new-btn.desk-only, .catalog-top .new-btn { display: inline-flex !important; }
}
.catalog-top .new-btn { display: none; }
.catalog-grid > .empty-state { grid-column: 1 / -1; }

.guide-tile { position: relative; display: block; text-decoration: none; min-width: 0; }
.guide-tile-media {
  position: relative; aspect-ratio: 3 / 4; max-height: 340px; border-radius: var(--r); overflow: hidden; background: #fff;
  border: 1px solid var(--line); box-shadow: 0 1px 0 var(--line), 3px 3px 0 -1px var(--surface-2), 3px 3px 0 0 var(--line);
  transition: transform .25s var(--ease);
}
.guide-tile:hover .guide-tile-media { transform: translateY(-2px); }
.guide-tile-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity .3s; }
.guide-tile-media img.loaded { opacity: 1; }
.guide-tile-pages { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 7px; background: rgb(18 17 14 / .6); color: #fff; font-family: var(--mono); font-size: 11px; }
.guide-tile-pages .ic { width: 12px; height: 12px; }
.guide-tile-new { position: absolute; left: 8px; top: 8px; height: 20px; padding: 0 8px; border-radius: 6px; display: inline-flex; align-items: center; background: var(--accent); color: var(--on-accent); font-size: 10.5px; font-weight: 600; letter-spacing: .03em; }
.guide-tile-meta { display: grid; gap: 1px; padding: 22px 2px 0; }
.guide-tile:not(:has(.card-cats)) .guide-tile-meta { padding-top: 10px; }

/* Einzelne Anleitung */
.catalog-guide { padding: 6px var(--pad) 0; max-width: 1120px; margin: 0 auto; }
.cg-layout { display: grid; gap: 20px; }
.cg-cover { width: min(240px, 60%); justify-self: center; aspect-ratio: 3 / 4; border-radius: var(--r); overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--muted); }
.cg-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.cg-info { display: grid; gap: 16px; align-content: start; min-width: 0; }
.title-input { font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.cg-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); font-family: var(--mono); }
.cg-meta span { display: inline-flex; align-items: center; gap: 6px; }
.cg-meta .ic { width: 15px; height: 15px; }
.cg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cg-actions .btn.primary { flex: 1 1 auto; }
.cg-pages { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.use-list { display: grid; gap: 8px; }
.use-item { display: grid; grid-template-columns: minmax(0, 1fr) 80px auto auto; align-items: center; gap: 12px; padding: 12px 10px 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-decoration: none; }
.use-item:hover { border-color: var(--line-strong); }
.use-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.use-n { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.use-item .ic { width: 16px; height: 16px; color: var(--muted); }
@media (min-width: 760px) {
  .cg-layout { grid-template-columns: 260px minmax(0, 1fr); gap: 36px; padding-top: 18px; }
  .cg-cover { width: 100%; }
  .cg-actions .btn.primary { flex: 0 0 auto; }
}

/* Anleitung zuweisen */
.assign-list { display: grid; gap: 6px; }
.assign-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-align: left; cursor: pointer; }
.assign-item:hover { border-color: var(--accent-ui); }
.assign-thumb { width: 44px; height: 56px; border-radius: 6px; overflow: hidden; background: #fff; border: 1px solid var(--line); flex: none; display: grid; place-items: center; color: var(--muted); }
.assign-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.assign-text { display: grid; flex: 1; min-width: 0; }
.assign-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assign-sub { font-size: 12.5px; color: var(--muted); }
.assign-cats { display: flex; gap: 3px; }
.assign-empty { padding: 12px 4px; }

/* Projekt aus Anleitung starten */
.start-guide { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: var(--r); background: var(--surface-2); }
.start-guide img { width: 48px; height: 62px; object-fit: cover; object-position: top; border-radius: 6px; background: #fff; }
.start-guide > div { display: grid; }
.start-from-guide { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: var(--r); text-decoration: none; color: var(--text-2); }
.start-from-guide:hover { border-color: var(--accent-ui); }
.start-from-guide > span { display: grid; flex: 1; gap: 1px; }
.start-from-guide > span > span { font-size: 12.5px; color: var(--muted); }
.start-from-guide .ic { width: 20px; height: 20px; color: var(--muted); flex: none; }

/* Sicherung */
.backup-box { display: grid; gap: 14px; border-top: 1px solid var(--line); }
.backup-last { display: flex; gap: 12px; align-items: flex-start; }
.backup-last > div { display: grid; gap: 2px; min-width: 0; }
.backup-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ui); flex: none; }
.backup-ic .ic { width: 19px; height: 19px; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------------------------------------------------- Logo als Bild */
.set-sub > .set-row { border-top: 1px solid var(--line); }
.brand-mark.img { width: 40px; height: 40px; background: none; overflow: hidden; }
.brand-mark.img img.ic, .empty-mark.img img.ic, .logo-in.img img.ic { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-mark.shape-round, .empty-mark.shape-round, .logo-in.shape-round { border-radius: 50%; }
.brand-mark.shape-free, .empty-mark.shape-free, .logo-in.shape-free { border-radius: 0; overflow: visible; }
.brand-mark.shape-free img.ic, .empty-mark.shape-free img.ic, .logo-in.shape-free img.ic { object-fit: contain; }
.empty-mark.img { border: 0; overflow: hidden; width: 72px; height: 72px; }
.logo-btn { overflow: hidden; }
.logo-in { display: grid; place-items: center; width: 100%; height: 100%; }
.logo-in.img { width: 100%; height: 100%; overflow: hidden; border-radius: inherit; }
.logo-in.img.shape-round { width: 100%; border-radius: 50%; }
.logo-btn:has(.logo-in.img) { padding: 0; border: 0; background: none; }

/* Anleitungskatalog im Rahmen der Übersicht */
.guide-cat .card-media { background: #fff; }
.guide-cat .card-media img { object-position: top; }
.overview .popover .field-hint, .check-list + .field-hint, .check-list .field-hint { margin: 8px 0 0; }
