/* ===== Farben & Grundwerte ===== */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --border: #dde3ea;
  --text: #16212d;
  --muted: #5d6b7a;
  --primary: #0f3d5e;
  --primary-hover: #0b2f49;
  --primary-soft: #e3edf5;
  --accent: #2bb3a3;
  --accent-soft: #dff5f2;
  --danger: #c0392b;
  --danger-soft: #fbe9e7;
  --warn-soft: #fff6e0;
  --warn-text: #7a5600;
  --recording: #e5484d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 33, 45, .06), 0 4px 16px rgba(16, 33, 45, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e141b;
    --surface: #161f29;
    --surface-2: #1d2833;
    --border: #2a3846;
    --text: #e6edf3;
    --muted: #93a1b0;
    --primary: #5aa9e6;
    --primary-hover: #7bbcef;
    --primary-soft: #1a2f42;
    --accent: #3cc7b6;
    --accent-soft: #15332f;
    --danger: #f2766b;
    --danger-soft: #3a1c1a;
    --warn-soft: #33290f;
    --warn-text: #f0cf7a;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 650; }
.muted { color: var(--muted); }
.icon { width: 20px; height: 20px; flex-shrink: 0; }

/* ===== Layout ===== */
.layout { min-height: 100vh; }
.main {
  max-width: 860px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
}
.sidebar { display: none; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .7rem; color: var(--muted); padding: 4px 10px; border-radius: 10px; min-width: 64px;
}
.tabbar a.active { color: var(--primary); font-weight: 600; }
.tabbar .icon { width: 24px; height: 24px; }

/* Platz für das "Powered by Netlify"-Schild (64 px hoch, unten rechts) auf dem Handy */
@media (max-width: 899px) {
  .has-badge .tabbar { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .has-badge .main { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
  .has-badge .fab { bottom: calc(148px + env(safe-area-inset-bottom)); }
  .has-badge .toast { bottom: calc(164px + env(safe-area-inset-bottom)); }
}

@media (min-width: 900px) {
  .layout { display: grid; grid-template-columns: 248px 1fr; }
  .tabbar, .fab { display: none !important; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100vh;
    background: var(--surface); border-right: 1px solid var(--border); padding: 20px 14px;
  }
  .sidebar a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500;
  }
  .sidebar a:hover { background: var(--surface-2); color: var(--text); }
  .sidebar a.active { background: var(--primary-soft); color: var(--primary); }
  .sidebar .version { margin-top: auto; font-size: .75rem; color: var(--muted); padding: 0 12px; }
  .main { padding: 32px 32px 48px; width: 100%; }
  .hide-desktop { display: none !important; }
}
@media (max-width: 899px) { .hide-mobile { display: none !important; } }

.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; font-weight: 700; }
.brand img { width: 34px; height: 34px; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: .75rem; }

/* ===== Bausteine ===== */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head p { margin: 2px 0 0; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .9rem; margin-bottom: 10px; }

.banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--warn-soft); color: var(--warn-text);
  border-radius: 12px; padding: 10px 14px; font-size: .85rem; margin-bottom: 18px;
}
/* Speicherbelegung */
.usage { display: flex; flex-direction: column; gap: 14px; }
.usage-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .9rem; margin-bottom: 6px; }
.usage-head span { color: var(--muted); font-variant-numeric: tabular-nums; }
.usage-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.usage-bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.usage-bar.warn span { background: #e0a100; }
.usage-bar.full span { background: var(--danger); }

/* Erinnerung an die Datensicherung */
.banner-backup { align-items: center; flex-wrap: wrap; background: var(--primary-soft); color: var(--text); }
.banner-backup > .icon { color: var(--primary); }
.banner-backup > span:first-of-type { flex: 1; min-width: 200px; }
.banner-actions { display: flex; align-items: center; gap: 4px; }
.btn-sm-text { min-height: 36px; padding: 6px 12px; font-size: .85rem; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}
.card + .card { margin-top: 14px; }
.card h2 { margin-bottom: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: .95rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 12px; padding: 10px 16px; min-height: 44px; cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* Formulare */
label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 600px) { .field-row { grid-template-columns: 1fr 1fr; } }
input, select, textarea {
  width: 100%; font: inherit; font-size: 16px; /* 16px verhindert Zoom auf dem iPhone */
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px;
}
textarea { min-height: 180px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }

/* Aufnahme */
.recorder { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 18px; }
.mic-btn {
  width: 84px; height: 84px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--primary); color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(15, 61, 94, .3);
}
.mic-btn .icon { width: 34px; height: 34px; }
.mic-btn.recording { background: var(--recording); animation: pulse 1.4s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .5); }
  70% { box-shadow: 0 0 0 18px rgba(229, 72, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); }
}
.interim { min-height: 1.5em; font-style: italic; color: var(--muted); text-align: center; font-size: .9rem; }

/* Notizen-Übersicht */
.toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; }
.chip {
  font: inherit; font-size: .85rem; font-weight: 600; white-space: nowrap; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 6px 14px;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.note-list { display: flex; flex-direction: column; gap: 10px; }
.note-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 14px 12px;
}
.note-card:hover { border-color: var(--primary); }
.note-link { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.note-summary {
  flex: 1; min-width: 0; margin: 0; color: var(--text); font-size: 1rem; font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.note-date { flex-shrink: 0; font-size: .78rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 599px) {
  .note-link { flex-direction: column; gap: 2px; }
}

/* Pläne: Übersicht */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.plan-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.plan-card:hover { border-color: var(--primary); }
.plan-open {
  display: flex; flex-direction: column; gap: 4px; padding: 0 0 10px; text-align: left; cursor: pointer;
  font: inherit; color: var(--text); background: none; border: none;
}
.plan-thumb-box {
  display: grid; place-items: center; aspect-ratio: 4 / 3; max-width: 100%; background: #ffffff;
  border-bottom: 1px solid var(--border); color: var(--muted); overflow: hidden;
}
.plan-thumb-box img { width: 100%; height: 100%; object-fit: contain; }
.plan-thumb-box .icon { width: 40px; height: 40px; }
.plan-name { font-weight: 650; padding: 6px 14px 0; overflow-wrap: anywhere; }
.plan-open .muted { padding: 0 14px; }
.plan-actions { display: flex; gap: 6px; padding: 0 10px 10px; justify-content: flex-end; }

/* Stelle im Plan (in der Notiz) */
.plan-pick { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.plan-thumb {
  position: relative; width: 180px; max-width: 100%; padding: 0; cursor: zoom-in;
  background: #ffffff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.plan-thumb img { display: block; width: 100%; }
.plan-thumb-pin {
  position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: var(--recording); border: 2px solid #ffffff; box-shadow: 0 0 0 4px rgba(229, 72, 77, .35);
}
.plan-pick-info { flex: 1; min-width: 180px; overflow-wrap: anywhere; }

/* Planansicht (Vollbild) */
.plan-viewer {
  position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column;
  background: #0b0f14; color: #e6edf3;
  padding: calc(8px + env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}
.pv-top, .pv-bottom { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pv-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.05rem; }
.pv-pages { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.pv-pages[hidden] { display: none; }
.pv-btn {
  min-width: 40px; min-height: 40px; padding: 6px 10px; cursor: pointer;
  font: inherit; font-size: 1.1rem; font-weight: 600; color: #e6edf3;
  background: #1d2833; border: 1px solid #2a3846; border-radius: 10px;
}
.pv-btn:hover { border-color: #5aa9e6; }
.pv-btn:disabled { opacity: .45; cursor: not-allowed; }
.pv-btn[hidden] { display: none; }
.pv-text, .pv-fit { font-size: .9rem; }
.pv-primary { background: #5aa9e6; border-color: #5aa9e6; color: #0b0f14; }
.pv-stage {
  flex: 1; min-height: 0; position: relative; overflow: hidden; margin: 8px 0;
  border-radius: 8px; background: #1a222b; touch-action: none; cursor: grab;
}
.pv-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #ffffff; }
.pv-inner img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-select: none; pointer-events: none; }
.pv-markers { position: absolute; inset: 0; }
.pv-marker { position: absolute; width: 0; height: 0; transform: scale(var(--inv, 1)); transform-origin: 0 0; cursor: pointer; }
/* Stecknadel: Spitze genau auf der markierten Stelle */
.pv-pin {
  position: absolute; left: -14px; top: -34px; width: 28px; height: 28px;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: #e5484d; border: 3px solid #ffffff; box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}
.pv-marker.done .pv-pin { background: #7d8a97; }
.pv-marker.picked .pv-pin { background: #0a84ff; }
.pv-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 16px; text-align: center; color: #93a1b0; pointer-events: none; }
.pv-loading[hidden] { display: none; }
.pv-hint { flex: 1; min-width: 200px; font-size: .82rem; color: #93a1b0; }
.pv-zoom, .pv-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Fortschrittsanzeige */
.modal.busy { display: flex; align-items: center; gap: 14px; max-width: 340px; }
.modal.busy p { margin: 0; }
.spinner {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--primary); animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* Anmeldung */
.auth-page {
  min-height: 100vh; display: grid; place-items: center;
  padding: calc(24px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 28px 24px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 18px; }
.auth-brand img { width: 36px; height: 36px; }
.auth-card h1 { font-size: 1.35rem; margin-bottom: 16px; }
.auth-notice { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin: 0 0 16px; }
.auth-error { color: var(--danger); background: var(--danger-soft); border-radius: 10px; padding: 8px 12px; font-size: .9rem; margin: 0 0 12px; }
.auth-error[hidden] { display: none; }
.auth-links { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 14px; }
.link { background: none; border: none; padding: 6px; font: inherit; font-size: .9rem; color: var(--primary); cursor: pointer; }
.link:hover { text-decoration: underline; }
.auth-privacy { display: flex; gap: 8px; align-items: flex-start; margin: 18px 0 0; }
.auth-privacy .icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.loading { min-height: 60vh; display: grid; place-items: center; color: var(--muted); padding: 16px; text-align: center; }
.head-actions { display: flex; gap: 8px; align-items: center; }

/* Fotos */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 10px; }
.photo-grid[hidden] { display: none; }
.photo { position: relative; aspect-ratio: 1; max-width: 100%; }
.photo-view {
  width: 100%; height: 100%; padding: 0; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; cursor: zoom-in; background: var(--surface-2);
}
.photo-view img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-del {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  border: none; border-radius: 50%; background: rgba(10, 18, 26, .7); color: #fff;
}
.photo-del .icon { width: 16px; height: 16px; }
.photo-edit {
  position: absolute; bottom: 4px; right: 4px; width: 30px; height: 30px; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  border: none; border-radius: 50%; background: var(--primary); color: #fff;
}
.photo-edit .icon { width: 15px; height: 15px; }
.photo-viewer-actions { display: flex; gap: 10px; }
.photo-viewer-actions .btn:not(.btn-primary) { background: var(--surface); }
.photo-add { cursor: pointer; }
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn[hidden] { display: none; }
.photo-viewer-actions { flex-wrap: wrap; justify-content: center; }
.photo-add:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.photo-viewer {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  cursor: zoom-out; background: rgba(5, 10, 15, .9);
}
.photo-viewer img { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 8px; object-fit: contain; }
.photo-close { background: var(--surface); }
.note-photos { display: inline-flex; align-items: center; gap: 3px; margin-right: 8px; }
.note-photos .icon { width: 13px; height: 13px; }

/* Projektwechsler links oben (auf dem Handy ganz oben) */
.proj-switch { position: relative; margin-bottom: 14px; }
.proj-switch-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
}
.proj-switch-btn:hover, .proj-switch-btn[aria-expanded="true"] { border-color: var(--primary); }
.proj-switch-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.proj-switch-btn > .icon:first-child { color: var(--primary); }
.proj-switch-btn > .icon:last-child { color: var(--muted); width: 18px; height: 18px; }
.proj-switch-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.proj-switch-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-switch-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.proj-menu {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 45; min-width: 100%; width: max-content; max-width: min(340px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 33, 45, .2); padding: 6px;
}
.proj-menu[hidden] { display: none; }
.proj-menu-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px 4px; }
.proj-item, .proj-manage {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; text-align: left; cursor: pointer;
  font: inherit; font-size: .95rem; color: var(--text); background: none; border: none; border-radius: 8px; padding: 8px 10px;
}
.proj-item:hover, .proj-manage:hover { background: var(--surface-2); }
.proj-item .dd-box { border-radius: 50%; }
.proj-item.current { font-weight: 600; }
.proj-item.current .dd-box { background: var(--primary); border-color: var(--primary); color: #fff; }
.proj-manage { color: var(--primary); font-weight: 600; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; margin-top: 4px; }
.proj-manage + .proj-manage { border-top: none; margin-top: 0; }

/* Fenster "Projekte verwalten" */
.modal-wide { max-width: 640px; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.modal-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.modal-head h2 .icon { color: var(--primary); }

/* Foto-Editor (Vollbild) */
.editor {
  position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column;
  background: #0b0f14; color: #e6edf3;
  padding: calc(10px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.editor-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.editor-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.editor-tools button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 12px; cursor: pointer;
  font: inherit; font-size: .9rem; font-weight: 600; color: #e6edf3;
  background: #1d2833; border: 1px solid #2a3846; border-radius: 10px;
}
.editor-tools button.active { background: #5aa9e6; border-color: #5aa9e6; color: #0b0f14; }
.editor-colors { display: flex; gap: 8px; }
.editor-colors button {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 2px solid rgba(255, 255, 255, .35);
}
.editor-colors button.active { outline: 3px solid #5aa9e6; outline-offset: 2px; }
.editor-stage { flex: 1; min-height: 0; position: relative; margin: 10px 0; }
.editor-stage canvas {
  position: absolute; inset: 0; margin: auto; /* mittig, so groß wie möglich, Seitenverhältnis bleibt */
  max-width: 100%; max-height: 100%; touch-action: none; cursor: crosshair;
  border-radius: 6px; box-shadow: 0 6px 30px rgba(0, 0, 0, .5);
}
.editor-textbar { display: flex; gap: 8px; margin-bottom: 8px; }
.editor-textbar[hidden] { display: none; }
.editor-textbar input { flex: 1; min-width: 0; background: #161f29; color: #e6edf3; border-color: #2a3846; }
.editor-textbar .btn { min-width: 44px; padding: 8px 10px; }
.editor-textbar .btn:not(.btn-primary) { background: #1d2833; border-color: #2a3846; color: #e6edf3; }
.editor-textbar .btn-primary { background: #5aa9e6; border-color: #5aa9e6; color: #0b0f14; }
.editor-hint { margin: 0 0 8px; text-align: center; font-size: .85rem; color: #93a1b0; }
.editor-bottom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.editor-bottom .btn:not(.btn-primary) { background: #1d2833; border-color: #2a3846; color: #e6edf3; }
.editor-bottom .btn-primary { background: #5aa9e6; border-color: #5aa9e6; color: #0b0f14; }
.editor-bottom [hidden] { display: none; }
.editor-spacer { flex: 1; }
@media (max-width: 480px) {
  .editor-tools button span { display: none; } /* auf dem Handy nur Symbole */
  .editor-tools button { padding: 8px 11px; }
}
.mobile-top .proj-switch-btn { background: var(--surface); }

/* Projekte-Seite */
.project-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 14px; }
.project-row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 12px; padding: 6px 8px 6px 6px;
}
.project-row.current { border-color: var(--primary); background: var(--primary-soft); }
.project-open {
  display: flex; align-items: center; gap: 12px; min-width: 0; padding: 8px; text-align: left;
  font: inherit; color: var(--text); background: none; border: none; border-radius: 8px; cursor: pointer;
}
.project-open:hover { background: var(--surface-2); }
.project-open > .icon { color: var(--primary); }
.project-row-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.project-edit { border: 1px solid var(--primary); border-radius: 12px; padding: 14px; }
.check-label { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; cursor: pointer; }
.check-label input { width: 18px; height: 18px; accent-color: var(--primary); }

/* Notiz-Detail: Übersicht */
.facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px;
}
@media (max-width: 599px) { .facts { grid-template-columns: 1fr; } }
.facts > div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.facts dt { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.note-source { display: inline-flex; color: var(--muted); }
.note-source .icon { width: 14px; height: 14px; }

/* Abhak-Kästchen */
.check {
  flex-shrink: 0; width: 26px; height: 26px; margin-top: 2px; padding: 0; cursor: pointer;
  display: grid; place-items: center;
  border: 2px solid var(--muted); border-radius: 7px; background: var(--surface); color: transparent;
  transition: background .15s, border-color .15s;
}
.check .icon { width: 17px; height: 17px; stroke-width: 3; }
.check:hover { border-color: var(--accent); }
.check:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.note-card.done .check { background: var(--accent); border-color: var(--accent); color: #fff; }
.note-card.done .note-summary { text-decoration: line-through; color: var(--muted); }
.note-card.done .note-project { color: var(--muted); }
/* größere Tippfläche fürs Handy */
@media (max-width: 899px) { .check { width: 30px; height: 30px; } }
.note-card.leaving { opacity: 0; transform: translateX(24px); transition: opacity .3s, transform .3s; }

/* Liste: Abschnitte und Suche */
.list-heading {
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin: 10px 2px 0;
}
.list-heading:first-child { margin-top: 0; }
.search-info { margin: -6px 2px 12px; }
.chips.searching .chip { opacity: .45; }

/* Rückfrage-Fenster */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 16px;
  background: rgba(10, 18, 26, .55);
  animation: fade-in .15s ease-out;
}
.modal {
  width: 100%; max-width: 420px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 16px; padding: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
}
.modal h2 { font-size: 1.15rem; margin-bottom: 10px; }
.modal-text {
  margin: 0 0 6px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); font-weight: 500;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
@media (max-width: 480px) { .modal-actions .btn { flex: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .note-card.leaving { animation: none; transition: none; }
}
.note-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.note-project { font-weight: 650; color: var(--text); font-size: .95rem; }
.note-loc {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--primary-soft); color: var(--primary); font-weight: 600;
  border-radius: 999px; padding: 1px 9px 1px 6px;
}
.note-loc .icon { width: 13px; height: 13px; }
.note-text {
  margin: 0; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 650; border-radius: 999px; padding: 2px 9px;
  background: var(--surface-2); color: var(--muted);
}
.badge .icon { width: 13px; height: 13px; }
.badge-new { background: var(--accent-soft); color: var(--accent); }
.badge-planned { background: var(--surface-2); color: var(--muted); }
.badge-active { background: var(--accent-soft); color: var(--accent); }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .icon { width: 44px; height: 44px; margin-bottom: 8px; opacity: .6; }

/* Knopf "Neue Notiz" unten rechts (nur Handy) */
.fab {
  position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 21;
  height: 56px; padding: 0 22px 0 18px; border-radius: 28px;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 1rem;
  box-shadow: 0 6px 20px rgba(15, 61, 94, .35);
}
.fab .icon { width: 24px; height: 24px; stroke-width: 2.5; }

/* KI-Werkzeuge & Assistenten */

.assistant-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .assistant-grid { grid-template-columns: 1fr 1fr; } }
.assistant-grid .card { margin: 0; }
.assistant-grid .card p { margin: 6px 0 10px; color: var(--muted); font-size: .9rem; }

.list-plain { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: .9rem; }
.list-plain li + li { margin-top: 4px; }
.small { font-size: .82rem; }
.small a { color: var(--primary); text-decoration: underline; }

/* Firmenerkennung */
.detected {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
  background: var(--accent-soft); color: var(--text);
  border-radius: 10px; padding: 8px 12px; font-size: .88rem;
}
.detected .icon { color: var(--accent); width: 18px; height: 18px; }
.detected[hidden] { display: none; }

/* Aufklapplisten in der Notiz */
.field-grid { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 600px) { .field-grid { grid-template-columns: 1fr 1fr; } }
.dd { position: relative; }
.dd-toggle {
  width: 100%; min-height: 46px; display: flex; align-items: center; gap: 8px;
  font: inherit; font-size: 16px; text-align: left; cursor: pointer;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px 10px 13px;
}
.dd-toggle:hover { border-color: var(--primary); }
.dd-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: -1px; }
.dd-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd.empty .dd-value { color: var(--muted); }
.dd-toggle .icon { color: var(--muted); transition: transform .15s; }
.dd.open .dd-toggle { border-color: var(--primary); }
.dd.open .dd-toggle .icon { transform: rotate(180deg); }
.dd.needs-choice .dd-toggle { border: 1.5px dashed var(--accent); }

.dd-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 33, 45, .18); padding: 6px;
  display: flex; flex-direction: column; gap: 4px;
}
.dd-panel[hidden] { display: none; }
.dd-search { margin: 2px 0 4px; padding: 9px 11px; }
.dd-options { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; }
.dd-option, .dd-add {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px;
  font: inherit; font-size: .95rem; text-align: left; cursor: pointer;
  background: none; border: none; border-radius: 8px; padding: 8px 10px; color: var(--text);
}
.dd-option[hidden], .dd-add[hidden] { display: none; }
.dd-option:hover, .dd-add:hover { background: var(--surface-2); }
.dd-box {
  width: 18px; height: 18px; flex-shrink: 0; display: grid; place-items: center;
  border: 2px solid var(--border); border-radius: 5px; color: transparent;
}
.dd-box .icon { width: 13px; height: 13px; stroke-width: 3; }
.dd[data-multiple="false"] .dd-box { border-radius: 50%; }
.dd-option[aria-selected="true"] { font-weight: 600; }
.dd-option[aria-selected="true"] .dd-box { background: var(--primary); border-color: var(--primary); color: #fff; }
.dd-option.suggested { background: var(--accent-soft); }
.dd-option.suggested::after { content: "Vorschlag"; margin-left: auto; font-size: .72rem; font-weight: 600; color: var(--accent); }
.dd-none { color: var(--muted); }
.dd-add { color: var(--primary); font-weight: 600; }
.dd-done { margin-top: 2px; min-height: 40px; }

/* Gewerke-Auswahl (Mehrfachauswahl) */
.label-hint { font-weight: 400; }
.trade-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.trade-picker .chip { min-height: 38px; }
.trade-picker .chip.suggested:not(.active) { border: 1.5px dashed var(--accent); color: var(--accent); }

/* Firmenverzeichnis */
.company-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.company-row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 10px 10px 14px;
}
.company-row.editing { border-color: var(--primary); background: var(--primary-soft); }
.company-name { min-width: 0; overflow-wrap: anywhere; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.badges-lg { gap: 8px; margin-bottom: 14px; }
.badges-lg .badge { font-size: .82rem; padding: 4px 12px; }
.badge-custom { background: var(--primary-soft); color: var(--primary); padding-right: 4px !important; }
.badge-custom button {
  display: inline-grid; place-items: center; border: none; background: none; color: inherit;
  cursor: pointer; padding: 2px; margin-left: 2px; border-radius: 50%;
}
.badge-custom button:hover { background: var(--surface); }
.btn-icon { padding: 0; width: 44px; }
.company-form { border-top: 1px solid var(--border); padding-top: 16px; }

/* Einstellungen: aufklappbare Bereiche */
details.section { padding: 0; }
.section-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px;
  cursor: pointer; list-style: none; border-radius: var(--radius);
}
.section-head::-webkit-details-marker { display: none; }
.section-head:hover { background: var(--surface-2); }
.section-head:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.section-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.section-title h2 { margin: 0; }
.section-head > .icon { color: var(--muted); transition: transform .15s; }
details.section[open] > .section-head > .icon { transform: rotate(180deg); }
details.section[open] > .section-head { border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.section-body { padding: 16px 18px 18px; }
.sub-section > summary { list-style: none; margin-top: 4px; }
.sub-section > summary::-webkit-details-marker { display: none; }
.sub-section[open] > summary { margin-bottom: 14px; }

/* Lern-Fenster */
.learn-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; max-height: 50vh; overflow-y: auto; }
.learn-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px;
}
.learn-row label { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text); font-size: .95rem; cursor: pointer; }
.learn-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.learn-row select { width: auto; padding: 6px 10px; font-size: .9rem; }

/* Gewerke & Fachbegriffe */
.trade-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.trade-item { border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; }
.trade-item[open] { padding-bottom: 14px; }
.trade-item summary {
  display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; list-style: none;
}
.trade-item summary::-webkit-details-marker { display: none; }
.trade-item summary::after { content: "›"; margin-left: auto; color: var(--muted); font-size: 1.3rem; transition: transform .15s; }
.trade-item[open] summary::after { transform: rotate(90deg); }
.trade-item-name { font-weight: 600; }
.trade-item textarea { min-height: 100px; }
.btn-sm { min-height: 34px; width: 34px; }
.form-title { font-size: 1rem; margin-bottom: 12px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; min-width: 0; }

/* Hinweis-Meldung */
.toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); z-index: 50;
  transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: #16212d; color: #fff; padding: 10px 18px; border-radius: 12px; font-size: .9rem;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 900px) { .toast { bottom: 32px; } }


/* ===== Aufgaben, Wiedervorlagen, Kategorien ===== */
:root { --warn: #b26a00; --info-soft: #e7f0fb; --info-text: #1d4f86; }
@media (prefers-color-scheme: dark) { :root { --warn: #f0b04a; --info-soft: #1a2c40; --info-text: #9cc8f0; } }

/* kleine Hinweise an Einträgen */
.note-badges { display: flex; flex-wrap: wrap; gap: 6px; }
@media (min-width: 600px) { .note-badges { flex-shrink: 0; } }
.pill {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font-size: .74rem; font-weight: 600; border-radius: 999px; padding: 2px 9px;
  background: var(--surface-2); color: var(--muted);
}
.pill .icon { width: 13px; height: 13px; }
.pill-in_bearbeitung { background: var(--info-soft); color: var(--info-text); }
.pill-zur_kontrolle { background: var(--warn-soft); color: var(--warn-text); }
.pill-followup { background: var(--primary-soft); color: var(--primary); }
.pill-overdue { background: var(--danger-soft); color: var(--danger); }

/* Kennzahlen auf der Notizen-Seite */
.overview { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 12px; padding-bottom: 2px; }
.overview-item {
  display: flex; align-items: baseline; gap: 6px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px;
  font-size: .85rem; color: var(--muted);
}
.overview-item strong { font-size: 1.05rem; color: var(--text); }
.overview-item.warn { border-color: var(--danger); }
.overview-item.warn strong { color: var(--danger); }
.search-answer { color: var(--text); font-weight: 600; background: var(--primary-soft); border-radius: 10px; padding: 8px 12px; }

/* Kacheln auf der Aufgaben-Seite */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 600px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile {
  font: inherit; text-align: left; cursor: pointer; min-height: 68px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; color: var(--muted);
}
.tile strong { font-size: 1.5rem; line-height: 1.1; color: var(--text); }
.tile span { font-size: .85rem; font-weight: 600; }
.tile.zero strong { color: var(--muted); }
.tile.warn { border-color: var(--danger); }
.tile.warn strong { color: var(--danger); }
.tiles + .chips { margin-bottom: 12px; }
.chip .icon { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; }

.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 14px; margin-bottom: 12px; }
.filters summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.filter-grid { display: grid; grid-template-columns: 1fr; gap: 10px 14px; padding: 4px 0 12px; }
@media (min-width: 600px) { .filter-grid { grid-template-columns: 1fr 1fr; } }
.filter-grid label { margin: 0; }
.filter-grid select { margin-top: 4px; }

.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px;
}
.task-row.overdue { border-left: 4px solid var(--danger); }
.task-row.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-link { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.task-title { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.task-link .icon { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.prio { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 6px; border-radius: 50%; background: var(--danger); color: #fff; font-size: .75rem; font-weight: 800; }
.status-select {
  width: auto; flex-shrink: 0; max-width: 46%; font-size: .85rem; font-weight: 600;
  padding: 8px 10px; border-radius: 999px; min-height: 40px;
}
.st-neu { background: var(--surface-2); }
.st-in_bearbeitung { background: var(--info-soft); color: var(--info-text); }
.st-zur_kontrolle { background: var(--warn-soft); color: var(--warn-text); }
.st-erledigt { background: var(--accent-soft); color: var(--accent); }
.btn-compact { min-height: 40px; padding: 6px 12px; font-size: .85rem; }
.report-row { color: var(--text); }

/* Bereich "Vorgang" in der Notiz */
.task-card .task-top { display: grid; gap: 12px; align-items: end; margin-bottom: 14px; }
@media (min-width: 600px) { .task-card .task-top { grid-template-columns: 1fr auto; } }
.switch { display: flex; align-items: center; gap: 10px; margin: 0; font-size: .95rem; font-weight: 600; color: var(--text); cursor: pointer; min-height: 44px; }
.switch input { width: 22px; height: 22px; margin: 0; accent-color: var(--primary); }
.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 14px; }
@media (min-width: 600px) { .seg { grid-template-columns: repeat(4, 1fr); } }
.seg button {
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; min-height: 46px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--muted);
}
.seg button[aria-checked="true"] { color: #fff; border-color: transparent; }
.seg .seg-neu[aria-checked="true"] { background: var(--primary); }
.seg .seg-in_bearbeitung[aria-checked="true"] { background: var(--info-text); }
.seg .seg-zur_kontrolle[aria-checked="true"] { background: var(--warn); }
.seg .seg-erledigt[aria-checked="true"] { background: var(--accent); }
.followup { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.followup-state { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; }
.followup-state.due { color: var(--danger); font-weight: 600; }
.followup .btn-row { margin-top: 4px; }
.history { margin-top: 12px; font-size: .9rem; }
.history summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.history ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
.source-text { white-space: pre-wrap; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin: 8px 0 0; }

/* Vorschau erkannter Vorgänge */
.review { max-width: 720px; }
@media (max-width: 599px) {
  .modal-backdrop.review-backdrop { padding: 0; align-items: stretch; }
  .review { max-height: 100vh; height: 100%; border-radius: 0; padding: calc(16px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom)); }
}
.review-note { display: flex; gap: 6px; align-items: center; background: var(--surface-2); border-radius: 10px; padding: 6px 10px; margin: 0 0 10px; }
.review-note .icon { width: 15px; height: 15px; }
.review-list { display: flex; flex-direction: column; gap: 12px; }
.review-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; background: var(--surface); }
.review-card textarea { min-height: 64px; margin: 8px 0; }
.review-card > input { margin-bottom: 8px; }
.review-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-head select { width: auto; flex: 1; min-width: 160px; padding: 8px 10px; }
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin: 6px 0; }
.review-grid label { margin: 0; font-size: .8rem; }
.review-grid input, .review-grid select { margin-top: 3px; padding: 9px 10px; }
.review-warn {
  display: flex; align-items: flex-start; gap: 6px; margin: 6px 0 0; font-size: .85rem;
  background: var(--warn-soft); color: var(--warn-text); border-radius: 10px; padding: 6px 10px;
}
.review-warn .icon { width: 16px; height: 16px; margin-top: 2px; }
.review-warn .link { padding: 0 4px; font-size: .85rem; font-weight: 700; }
.review-dupe { margin-top: 8px; background: var(--danger-soft); border-radius: 10px; padding: 8px 10px; font-size: .9rem; }
.review-dupe > strong { display: flex; align-items: center; gap: 6px; color: var(--danger); }
.review-dupe .icon { width: 16px; height: 16px; }
.dupe-row { margin: 4px 0; }
.dupe-row a { color: var(--primary); text-decoration: underline; font-weight: 600; }
.review-dupe label { margin: 8px 0 0; }
.review-actions { position: sticky; bottom: -22px; background: var(--surface); padding: 12px 0 4px; margin-top: 12px; flex-wrap: wrap; }

/* Bautagesbericht */
.report-edit textarea { min-height: 70px; }
.report-doc h1 { font-size: 1.35rem; }
.report-doc h2 { font-size: 1rem; margin: 18px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.report-doc ul, .report-doc ol { margin: 0; padding-left: 20px; }
.report-doc li { margin: 3px 0; }
.report-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.report-meta { border-collapse: collapse; width: 100%; }
.report-meta th { text-align: left; width: 110px; color: var(--muted); font-weight: 600; padding: 3px 8px 3px 0; vertical-align: top; }
.report-meta td { padding: 3px 0; }
.na { color: var(--muted); font-style: italic; }
.report-foot { margin-top: 20px; font-size: .8rem; color: var(--muted); }
.report-photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.report-photo-grid figure { margin: 0; break-inside: avoid; }
.report-photo-grid img { width: 100%; height: auto; border-radius: 4px; }
.report-photo-grid figcaption { font-size: .7rem; color: var(--muted); }
#print-root { display: none; }

@media print {
  @page { size: A4; margin: 16mm 14mm; }
  body { background: #fff; color: #000; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; font-size: 10.5pt; }
  #print-root .report-doc h2 { border-color: #999; break-after: avoid; }
  #print-root .badge { border: 1px solid #999; background: none; color: #000; }
  #print-root .na, #print-root .report-meta th, #print-root .report-foot, #print-root .muted { color: #555; }
}
@media (max-width: 599px) {
  .task-row.has-status { flex-wrap: wrap; }
  .task-row.has-status .task-link { flex-basis: 100%; order: -1; }
  .task-row.has-status .status-select { max-width: none; }
}
