/* Ulmer R&D – Styles (Basis aus design/prototyp.html) */
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/vendor/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/vendor/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Tokens ---------- */
:root {
  --bg: #FAF8F5; --surface: #FFFFFF; --surface-2: #F4F1EC; --line: #ECE6DE; --line-strong: #DDD5CA;
  --text: #1F2620; --text-2: #5E665F; --text-3: #8C928B;
  --accent: #2D3A2E; --accent-fg: #FFFFFF; --accent-soft: #E7ECE5; --accent-text: #2D3A2E;
  --sand: #D4B896; --sand-soft: #F5EDE2; --sand-text: #8A6A42;
  --ok: #3F7A4F; --ok-soft: #E3EFE5;
  --warn: #A86F1C; --warn-soft: #FAEEDA;
  --bad: #B4473C; --bad-soft: #F8E3E0;
  --shadow: 0 1px 2px rgba(31,38,32,.05), 0 1px 1px rgba(31,38,32,.03);
  --shadow-lg: 0 12px 40px rgba(31,38,32,.14), 0 2px 6px rgba(31,38,32,.06);
  --r: 12px; --r-sm: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141815; --surface: #1C211D; --surface-2: #232924; --line: #2A312B; --line-strong: #364037;
    --text: #E8EBE6; --text-2: #A7AFA6; --text-3: #737C72;
    --accent: #9DB8A0; --accent-fg: #141815; --accent-soft: #263128; --accent-text: #B5CDB7;
    --sand: #D4B896; --sand-soft: #2E2920; --sand-text: #D9C09E;
    --ok: #7FB98C; --ok-soft: #1F2E22; --warn: #E0A955; --warn-soft: #33291A; --bad: #E4877C; --bad-soft: #3A2220;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 16px 48px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141815; --surface: #1C211D; --surface-2: #232924; --line: #2A312B; --line-strong: #364037;
  --text: #E8EBE6; --text-2: #A7AFA6; --text-3: #737C72;
  --accent: #9DB8A0; --accent-fg: #141815; --accent-soft: #263128; --accent-text: #B5CDB7;
  --sand: #D4B896; --sand-soft: #2E2920; --sand-text: #D9C09E;
  --ok: #7FB98C; --ok-soft: #1F2E22; --warn: #E0A955; --warn-soft: #33291A; --bad: #E4877C; --bad-soft: #3A2220;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 16px 48px rgba(0,0,0,.5);
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 Inter, -apple-system, "Segoe UI", system-ui, sans-serif;
  font-feature-settings: "cv11", "ss01", "tnum"; -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { flex: none; }
.ico { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 14px; height: 14px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.hidden { display: none !important; }
.m-only { display: none !important; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 1440px; margin: 0 auto; height: 60px; padding: 0 24px; display: flex; align-items: center; gap: 16px; }
.brand { white-space: nowrap; display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.search-btn {
  flex: 1; max-width: 420px; margin-left: 24px; height: 38px; padding: 0 12px;
  display: flex; align-items: center; gap: 10px; color: var(--text-3);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; text-align: left;
}
.search-btn:hover { border-color: var(--line-strong); }
.search-btn span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kbd { font-size: 11px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--text-3); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sand); color: #3B2E1E; display: grid; place-items: center; font-size: 12px; font-weight: 600; margin-left: 6px; }

/* ---------- Layout ---------- */
.page { max-width: 1440px; margin: 0 auto; padding: 28px 24px 120px; }
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.hello h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 4px; font-weight: 600; }
.hello p { margin: 0; color: var(--text-2); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.chip.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.chip.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.chip.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }

.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 10px; gap: 2px; }
.seg button { height: 32px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }

/* ---------- Boards ---------- */
.board { margin-bottom: 32px; }
.board-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.board-head h2 { font-size: 15px; font-weight: 600; margin: 0; letter-spacing: -.005em; }
.count { font-size: 12px; color: var(--text-3); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; font-weight: 500; }
.board-head .spacer { flex: 1; }
.link-btn { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 6px; }
.link-btn:hover { background: var(--surface-2); color: var(--text); }
.cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(232px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.col { background: var(--surface-2); border-radius: var(--r); padding: 10px; min-height: 140px; scroll-snap-align: start; transition: background .15s; }
.col.drop { background: var(--accent-soft); outline: 2px dashed color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: -2px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.col-head .bullet { width: 8px; height: 8px; border-radius: 3px; }
.col-head .n { color: var(--text-3); font-weight: 500; }
.col-list { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s;
  display: grid; grid-template-columns: 1fr 44px; gap: 4px 10px;
}
.card:hover { border-color: var(--line-strong); box-shadow: 0 4px 14px rgba(31,38,32,.07); }
.card.dragging { opacity: .45; transform: rotate(1deg); }
.card-title { font-weight: 600; font-size: 14px; line-height: 1.35; letter-spacing: -.005em; display: flex; gap: 6px; align-items: flex-start; }
.prio { width: 6px; height: 6px; border-radius: 50%; background: var(--bad); margin-top: 7px; flex: none; }
.card-cust { font-size: 13px; color: var(--text-2); grid-column: 1; }
.card-thumb { grid-column: 2; grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: 8px; }
.card-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--text-2); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.sand { background: var(--sand-soft); color: var(--sand-text); }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.group-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 14px 0 4px; display: flex; align-items: center; gap: 6px; }
.group-label:first-of-type { margin-top: 2px; }
.group-label.bad { color: var(--bad); }

.todo { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; }
.todo + .todo { border-top: 1px solid var(--line); }
.check { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-strong); flex: none; display: grid; place-items: center; margin-top: 1px; transition: all .15s; }
.check:hover { border-color: var(--accent); }
.check svg { opacity: 0; width: 12px; height: 12px; stroke: var(--accent-fg); stroke-width: 3; fill: none; }
.todo.done .check { background: var(--accent); border-color: var(--accent); }
.todo.done .check svg { opacity: 1; }
.todo.done .todo-t { text-decoration: line-through; color: var(--text-3); }
.todo-body { flex: 1; min-width: 0; }
.todo-t { font-size: 14px; line-height: 1.4; }
.todo-sub { font-size: 12px; color: var(--text-3); display: flex; gap: 6px; flex-wrap: wrap; }
.todo-sub .proj { color: var(--text-2); }
.todo-sub .bad { color: var(--bad); font-weight: 500; }
.todo-sub .warn { color: var(--warn); font-weight: 500; }

.appt { display: flex; gap: 12px; padding: 8px 0; align-items: center; }
.appt + .appt { border-top: 1px solid var(--line); }
.cal { width: 42px; flex: none; text-align: center; border-radius: 8px; background: var(--surface-2); padding: 4px 0; }
.cal b { display: block; font-size: 16px; line-height: 1.1; }
.cal small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 600; }
.cal.today { background: var(--accent); color: var(--accent-fg); }
.cal.today small { color: inherit; opacity: .8; }
.appt-t { font-size: 14px; font-weight: 500; }
.appt-s { font-size: 12px; color: var(--text-3); }

.recent { display: flex; align-items: center; gap: 10px; padding: 7px 0; cursor: pointer; }
.recent + .recent { border-top: 1px solid var(--line); }
.recent .thumb { width: 30px; height: 30px; border-radius: 7px; }
.recent-t { font-size: 14px; font-weight: 500; }
.recent-s { font-size: 12px; color: var(--text-3); }

/* ---------- Project page ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 14px; padding: 6px 8px 6px 4px; border-radius: 8px; margin: -6px 0 12px -4px; }
.back:hover { background: var(--surface-2); color: var(--text); }
.p-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 20px; }
.p-cover { width: 72px; height: 72px; border-radius: 14px; flex: none; }
.p-title { flex: 1; min-width: 0; }
.p-title h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 6px; font-weight: 600; }
.p-title .sub { color: var(--text-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.props { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 24px; }
.prop { background: var(--surface); padding: 10px 14px; }
.prop label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 2px; }
.prop select, .prop input { border: 0; background: none; padding: 0; width: 100%; font-weight: 500; font-size: 14px; outline: none; appearance: none; -webkit-appearance: none; cursor: pointer; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 14px; }
.status-pill .bullet { width: 8px; height: 8px; border-radius: 3px; }

.tabs { display: none; }
.p-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.p-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.quick-add { display: flex; align-items: center; gap: 8px; border: 1px dashed var(--line-strong); border-radius: 10px; padding: 0 10px; height: 40px; margin-top: 8px; }
.quick-add:focus-within { border-style: solid; border-color: var(--accent); }
.quick-add input { flex: 1; border: 0; background: none; outline: none; height: 100%; }
.quick-add input[type=date] { flex: none; width: auto; font-size: 13px; color: var(--text-2); }

.editor-bar { display: flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: var(--surface-2); width: max-content; max-width: 100%; overflow-x: auto; }
.editor-bar button { height: 30px; min-width: 32px; padding: 0 8px; border-radius: 7px; color: var(--text-2); font-size: 13px; font-weight: 600; display: grid; place-items: center; }
.editor-bar button:hover { background: var(--surface); color: var(--text); }
.editor-bar .sep { width: 1px; background: var(--line-strong); margin: 6px 4px; }
.editor { min-height: 180px; outline: none; font-size: 15px; line-height: 1.65; }
.editor h3 { font-size: 16px; margin: 14px 0 4px; }
.editor p { margin: 0 0 8px; }
.editor ul { margin: 0 0 8px; padding-left: 22px; }
.editor ul.checklist { list-style: none; padding-left: 0; }
.editor ul.checklist li { display: flex; gap: 8px; align-items: flex-start; }
.editor ul.checklist li::before { content: ""; width: 15px; height: 15px; margin-top: 5px; border: 1.5px solid var(--line-strong); border-radius: 4px; flex: none; }
.editor ul.checklist li.x::before { background: var(--accent); border-color: var(--accent); }
.editor ul.checklist li.x { color: var(--text-3); text-decoration: line-through; }
.saved { font-size: 12px; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.gallery .ph { aspect-ratio: 1; border-radius: 10px; cursor: zoom-in; position: relative; overflow: hidden; }
.gallery .ph span { position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 600; color: #fff; background: rgba(0,0,0,.35); padding: 1px 6px; border-radius: 5px; backdrop-filter: blur(4px); }
.add-tile { aspect-ratio: 1; border-radius: 10px; border: 1.5px dashed var(--line-strong); display: grid; place-items: center; color: var(--text-3); text-align: center; font-size: 12px; gap: 2px; align-content: center; }
.add-tile:hover { border-color: var(--accent); color: var(--accent-text); }

.file { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.file + .file { border-top: 1px solid var(--line); }
.file-ico { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; font-size: 10px; font-weight: 700; letter-spacing: .03em; background: var(--surface-2); color: var(--text-2); }
.file-ico.pdf { background: var(--bad-soft); color: var(--bad); }
.file-ico.dxf { background: var(--accent-soft); color: var(--accent-text); }
.file-ico.sin { background: var(--sand-soft); color: var(--sand-text); }
.file-t { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-s { font-size: 12px; color: var(--text-3); }
.file .icon-btn { margin-left: auto; width: 32px; height: 32px; }

.tl { position: relative; padding-left: 26px; }
.tl::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 2px; }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item::before { content: ""; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.tl-item.sample::before { background: var(--sand); border-color: var(--sand); width: 14px; height: 14px; left: -24px; top: 4px; }
.tl-item.event::before { width: 8px; height: 8px; left: -21px; top: 7px; background: var(--line-strong); border: 0; }
.tl-date { font-size: 12px; color: var(--text-3); }
.tl-t { font-size: 14px; font-weight: 500; }
.tl-item.event .tl-t { font-weight: 400; color: var(--text-2); }
.tl-b { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.sample-card { display: flex; gap: 12px; margin-top: 8px; padding: 10px; background: var(--sand-soft); border-radius: 10px; }
.sample-card .ph { width: 64px; height: 64px; border-radius: 8px; flex: none; cursor: zoom-in; }
.badge-sample { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; color: var(--sand-text); background: var(--sand-soft); padding: 1px 7px; border-radius: 5px; margin-left: 6px; vertical-align: 1px; }
.tl-add { display: flex; gap: 8px; margin-bottom: 18px; }
.tl-add input { flex: 1; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--surface); outline: none; }
.tl-add input:focus { border-color: var(--accent); }
.btn { height: 40px; padding: 0 14px; border-radius: 10px; font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { border: 1px solid var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--line-strong); }
.toggle-sample { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.toggle-sample input { accent-color: var(--sand-text); }

/* ---------- Knit placeholders (statt echter Fotos) ---------- */
.ph1 { background: repeating-linear-gradient(60deg, #2D3A2E 0 6px, #3D4E3E 6px 12px), #2D3A2E; background-blend-mode: normal; }
.ph2 { background: radial-gradient(circle at 30% 30%, #E9DCC7 0 2px, transparent 3px) 0 0/8px 8px, linear-gradient(135deg, #D4B896, #B99A74); }
.ph3 { background: repeating-linear-gradient(90deg, #5F6F81 0 3px, #4E5C6B 3px 6px), #4E5C6B; }
.ph4 { background: repeating-linear-gradient(45deg, #CFC6BA 0 4px, #BDB2A4 4px 8px), repeating-linear-gradient(-45deg, transparent 0 4px, rgba(255,255,255,.2) 4px 8px); }
.ph5 { background: radial-gradient(circle, #8C3A2E 0 2px, transparent 2.5px) 0 0/6px 6px, #A9584A; }
.ph6 { background: repeating-linear-gradient(0deg, #1F2620 0 2px, #333D34 2px 4px), linear-gradient(#1F2620, #333D34); }
.ph7 { background: linear-gradient(160deg, #EDE7DE 0%, #D8CEC0 100%); }
.ph8 { background: repeating-radial-gradient(circle at 50% 50%, #7A8C6E 0 3px, #6B7C60 3px 6px); }

/* ---------- FAB, sheets, overlays ---------- */
.fab {
  position: fixed; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 30;
  width: 56px; height: 56px; border-radius: 18px; background: var(--accent); color: var(--accent-fg);
  display: grid; place-items: center; box-shadow: var(--shadow-lg); transition: transform .15s;
}
.fab:hover { transform: translateY(-2px); }
.fab .ico { width: 24px; height: 24px; stroke-width: 2.2; }
.scrim { position: fixed; inset: 0; background: rgba(15,20,16,.36); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 50; left: 50%; bottom: 24px; width: min(480px, calc(100% - 32px));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: all .22s cubic-bezier(.2,.8,.2,1);
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 18px;
}
.sheet.on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.sheet h3 { margin: 0 0 14px; font-size: 16px; font-weight: 600; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick-grid button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 6px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13px; font-weight: 500; }
.quick-grid button:hover, .quick-grid button.on { background: var(--accent-soft); color: var(--accent-text); }
.quick-grid .ico { width: 22px; height: 22px; }
.quick-form { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea { height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--surface); outline: none; }
.field textarea { height: 84px; padding: 10px 12px; resize: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.search {
  position: fixed; z-index: 50; left: 50%; top: 12vh; width: min(620px, calc(100% - 32px));
  transform: translate(-50%, -8px); opacity: 0; pointer-events: none; transition: all .18s;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.search.on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.search-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.search-in input { flex: 1; height: 56px; border: 0; outline: none; background: none; font-size: 16px; }
.search-res { max-height: 52vh; overflow-y: auto; padding: 8px; }
.sr-group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 10px 10px 4px; }
.sr { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.sr:hover { background: var(--surface-2); }
.sr .ico { color: var(--text-3); }
.sr small { color: var(--text-3); margin-left: auto; font-size: 12px; white-space: nowrap; }
.sr mark { background: var(--sand-soft); color: inherit; border-radius: 3px; padding: 0 1px; }

.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(10,12,10,.92); display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
.lightbox.on { opacity: 1; pointer-events: auto; }
.lightbox .big { width: min(86vw, 86vh); aspect-ratio: 1; border-radius: 14px; }
.lightbox .cap { color: #E8EBE6; text-align: center; margin-top: 14px; font-size: 14px; }
.lightbox .close { position: absolute; top: 16px; right: 16px; color: #fff; }
.lightbox .close:hover { background: rgba(255,255,255,.1); }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 10px); z-index: 70; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; opacity: 0; transition: all .2s; pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Hauptnavigation */
.mainnav { display: flex; gap: 2px; margin-left: 20px; }
.mainnav a, .mainnav button { height: 34px; padding: 0 12px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.mainnav a:hover { background: var(--surface-2); color: var(--text); }
.mainnav a.on { background: var(--accent-soft); color: var(--accent-text); }

/* Panel-Umschalter Notizen / Kalkulation */
.panel-seg { display: inline-flex; padding: 2px; background: var(--surface-2); border-radius: 9px; gap: 2px; }
.panel-seg button { height: 28px; padding: 0 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.panel-seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Kalkulation */
.kalk-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; font-size: 13px; color: var(--text-2); }
.kalk-group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 16px 0 6px; }
.kalk-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 64px 86px; gap: 8px; align-items: center; padding: 5px 0; font-size: 14px; }
.kalk-row + .kalk-row { border-top: 1px solid var(--line); }
.kalk-row input { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; background: var(--surface-2); text-align: right; outline: none; font-variant-numeric: tabular-nums; }
.kalk-row input:focus { border-color: var(--accent); background: var(--surface); }
.kalk-row .unit { color: var(--text-3); font-size: 12px; }
.kalk-row .val { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.kalk-sum { margin-top: 14px; border-radius: 12px; background: var(--surface-2); padding: 12px 14px; }
.kalk-sum .line { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 0; color: var(--text-2); font-variant-numeric: tabular-nums; }
.kalk-sum .total { color: var(--text); font-weight: 700; font-size: 17px; border-top: 1px solid var(--line-strong); margin-top: 6px; padding-top: 8px; }
.staffel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.staffel div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.staffel small { display: block; font-size: 12px; color: var(--text-3); }
.staffel b { font-size: 16px; font-variant-numeric: tabular-nums; }

/* Kalender */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.cal-head h1 { font-size: 24px; margin: 0; letter-spacing: -.02em; font-weight: 600; min-width: 190px; }
.cal-head .spacer { flex: 1; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.month { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.month-wd { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.month-wd div { padding: 8px 10px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.day { min-height: 112px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.day:nth-child(7n) { border-right: 0; }
.day:hover { background: var(--surface-2); }
.day.out { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.day.out .dn { color: var(--text-3); }
.day.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.day.we .dn { color: var(--text-3); }
.dn { font-size: 13px; font-weight: 600; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.day.today .dn { background: var(--accent); color: var(--accent-fg); }
.ev { font-size: 12px; line-height: 1.3; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.ev.appt { background: var(--sand-soft); color: var(--sand-text); }
.ev.todo { color: var(--text-2); padding-left: 4px; }
.ev.todo::before { content: "○ "; color: var(--text-3); }
.ev.todo.bad { color: var(--bad); }
.ev.dl { background: var(--bad-soft); color: var(--bad); }
.ev.more { color: var(--text-3); font-weight: 500; }
.dots { display: none; gap: 3px; justify-content: center; }
.dots i { width: 5px; height: 5px; border-radius: 50%; }
.agenda-day { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 8px; }
.agenda-item { display: flex; gap: 10px; padding: 8px 0; align-items: flex-start; cursor: pointer; }
.agenda-item + .agenda-item { border-top: 1px solid var(--line); }
.agenda-item .bar { width: 3px; align-self: stretch; border-radius: 2px; flex: none; }
.agenda-item .t { font-size: 14px; font-weight: 500; }
.agenda-item .s { font-size: 12px; color: var(--text-3); }

.proto-note { max-width: 1440px; margin: 0 auto; padding: 8px 24px 0; font-size: 12px; color: var(--text-3); }

/* ---------- Mobile ---------- */
@media (max-width: 1100px) {
  .home-grid { grid-template-columns: minmax(0,1fr); }
  .aside { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .aside .panel:first-child { grid-row: span 2; }
}
@media (max-width: 760px) {
  .topbar-in { padding: 0 16px; height: 56px; gap: 8px; }
  .search-btn { margin-left: 0; max-width: none; height: 36px; }
  .search-btn .kbd, .search-btn span { display: none; }
  .search-btn { flex: none; width: 38px; padding: 0; justify-content: center; border: 0; background: none; color: var(--text-2); }
  .brand-name { font-size: 15px; }
  .page { padding: 18px 16px 120px; }
  .hello h1 { font-size: 22px; }
  .hello .seg { width: 100%; }
  .hello .seg button { flex: 1; }
  .home-grid { display: flex; flex-direction: column; gap: 20px; }
  .aside { display: flex; order: -1; }
  .aside .panel:not(:first-child) { display: none; }
  .aside.all .panel { display: block; }
  .aside:not(.all) .tgroup.later { display: none; }
  .m-only { display: inline-flex !important; }
  .hide-m { display: none; }
  .topbar-right { gap: 2px; }
  .home-main { width: 100%; }
  .cols { grid-auto-columns: 82%; margin: 0 -16px; padding: 0 16px 6px; scroll-padding: 0 16px; }
  .fab { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
  .sheet { bottom: 0; width: 100%; border-radius: 20px 20px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); border-bottom: 0; }
  .search { top: 0; width: 100%; border-radius: 0 0 16px 16px; }
  .p-head { gap: 14px; }
  .p-cover { width: 56px; height: 56px; border-radius: 12px; }
  .p-title h1 { font-size: 21px; }
  .props { grid-template-columns: 1fr 1fr; }
  .tabs { display: flex; gap: 4px; position: sticky; top: 56px; z-index: 10; background: var(--bg); margin: 0 -16px 16px; padding: 8px 16px; overflow-x: auto; border-bottom: 1px solid var(--line); }
  .tabs button { height: 34px; padding: 0 12px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
  .tabs button.on { background: var(--accent-soft); color: var(--accent-text); }
  .p-grid { display: block; }
  .p-col { display: contents; }
  .p-grid [data-tab] { display: none; margin-bottom: 16px; }
  .p-grid[data-active="aufgaben"] [data-tab="aufgaben"],
  .p-grid[data-active="notizen"] [data-tab="notizen"],
  .p-grid[data-active="medien"] [data-tab="medien"],
  .p-grid[data-active="verlauf"] [data-tab="verlauf"],
  .p-grid[data-active="kalk"] [data-tab="kalk"] { display: block; }
  .panel-seg { display: none; }
  .brand-name { display: none; }
  .mainnav { margin-left: 4px; }
  .mainnav a, .mainnav button { padding: 0 10px; }
  .cal-layout { grid-template-columns: minmax(0,1fr); }
  .day { min-height: 54px; padding: 4px 2px; align-items: center; }
  .day .ev { display: none; }
  .dots { display: flex; }
  .month-wd div { padding: 8px 0; text-align: center; }
  .kalk-row { grid-template-columns: minmax(0, 1fr) 84px 76px; }
  .kalk-row .unit { display: none; }
  .staffel b { font-size: 14px; }
  .quick-grid .ico { width: 24px; height: 24px; }
  .toast { bottom: 90px; }
  .proto-note { padding: 8px 16px 0; }
}

/* ================= App-Ergänzungen ================= */
[hidden] { display: none !important; }
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--text-3); }

/* Login */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); }
.auth-card .brand { margin-bottom: 22px; }
.auth-card h1 { font-size: 21px; margin: 0 0 6px; letter-spacing: -.015em; font-weight: 600; }
.auth-card p { margin: 0 0 18px; color: var(--text-2); font-size: 14px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-card .btn { justify-content: center; height: 44px; }
.code-input { text-align: center; font-size: 22px !important; letter-spacing: .3em; font-variant-numeric: tabular-nums; height: 52px !important; }
.qr { background: #fff; border-radius: 12px; padding: 12px; width: 196px; margin: 0 auto 12px; }
.qr svg { display: block; width: 100%; height: auto; }
.secret { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; text-align: center; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 8px; word-break: break-all; margin-bottom: 14px; user-select: all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 15px; background: var(--surface-2); border-radius: 10px; padding: 12px; margin-bottom: 14px; text-align: center; user-select: all; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; margin: 0; }
.hint { font-size: 12px; color: var(--text-3); }
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--accent); }

/* Formulare allgemein */
.field select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.btn-danger { color: var(--bad); border: 1px solid var(--line); background: var(--surface); }
.btn-danger:hover { border-color: var(--bad); }
.btn:disabled { opacity: .55; cursor: default; }
.seg-type { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg-type button { height: 44px; border-radius: 10px; border: 1px solid var(--line); font-weight: 500; }
.seg-type button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.prio-high { color: var(--bad); }

/* Board-Ergänzungen */
.col-list { min-height: 56px; }
.col-empty { font-size: 12px; color: var(--text-3); text-align: center; padding: 14px 0; border: 1px dashed var(--line-strong); border-radius: 10px; }
.sortable-ghost { opacity: .35; }
.sortable-chosen .card, .card.sortable-chosen { box-shadow: var(--shadow-lg); }
.sortable-drag { transform: rotate(1.5deg); }
.card-thumb.initials { display: grid; place-items: center; font-weight: 600; font-size: 13px; color: var(--text-2); background: var(--surface-2); }
.empty { text-align: center; padding: 28px 16px; color: var(--text-2); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.soon { font-size: 13px; color: var(--text-3); margin: 0; }

/* Projektseite */
.p-title h1[contenteditable] { outline: none; border-radius: 6px; padding: 0 4px; margin-left: -4px; }
.p-title h1[contenteditable]:focus { background: var(--surface-2); }
.p-actions { display: flex; gap: 8px; margin-left: auto; }
.prop input[type=date] { color: var(--text); }
.placeholder-panel { border-style: dashed; background: transparent; }

/* Einstellungen */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 84px; }
.settings-nav a { text-align: left; height: 38px; padding: 0 12px; border-radius: 9px; font-weight: 500; color: var(--text-2); }
.settings-nav a:hover { background: var(--surface-2); color: var(--text); }
.settings-nav a.on { background: var(--accent-soft); color: var(--accent-text); }
.settings h2 { font-size: 18px; margin: 0 0 4px; letter-spacing: -.01em; font-weight: 600; }
.settings .lead { margin: 0 0 18px; color: var(--text-2); font-size: 14px; }
.settings .panel + .panel { margin-top: 16px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t { font-weight: 500; font-size: 14px; }
.list-row .s { font-size: 12px; color: var(--text-3); }
.list-row input[type=text] { height: 36px; border: 1px solid transparent; border-radius: 8px; padding: 0 8px; background: none; width: 100%; outline: none; font-weight: 500; margin-left: -8px; }
.list-row input[type=text]:hover { border-color: var(--line); }
.list-row input[type=text]:focus { border-color: var(--accent); background: var(--surface); }
.list-row input[type=color] { width: 28px; height: 28px; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 6px; }
.handle { cursor: grab; color: var(--text-3); padding: 4px; touch-action: none; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.chk input { accent-color: var(--accent); }
.audit { width: 100%; border-collapse: collapse; font-size: 13px; }
.audit td { padding: 7px 8px 7px 0; border-top: 1px solid var(--line); vertical-align: top; }
.audit td:first-child { color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.audit .warnrow td:nth-child(2) { color: var(--bad); font-weight: 500; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }

@media (max-width: 760px) {
  .settings { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
  .settings-nav a { white-space: nowrap; }
  .form-grid { grid-template-columns: 1fr; }
  .p-actions { margin-left: 0; }
  .p-head { flex-wrap: wrap; }
}

a { color: inherit; text-decoration: none; }
.settings-nav a { display: flex; align-items: center; }
.mainnav a { display: inline-flex; align-items: center; }
.list-row a.t:hover { text-decoration: underline; }
.recent .grow { min-width: 0; }
.p-cover.initials { font-size: 20px; }
@media (max-width: 760px) {
  .home-grid { align-items: stretch; }
}
@media (max-width: 760px) {
  .board-head h2 { white-space: nowrap; }
}
