:root {
  --bg: #f4f6f8; --card: #fff; --text: #1b2733; --muted: #66727f; --line: #dde3e9;
  --navy: #16324f; --accent: #1f6fb2; --accent-text: #fff;
  --ok: #1e7a46; --warn: #a15c00; --bad: #b3261e;
  --n1: #fff6e0; --n2: #e8f4ec; --n3: #e7f0fb;
  --radius: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161c; --card: #1a2129; --text: #e6ebf0; --muted: #9aa6b2; --line: #2c3540;
    --navy: #0d1f31; --accent: #4c9be0; --accent-text: #0b1520;
    --ok: #5cc98a; --warn: #f0b04d; --bad: #f2867e;
    --n1: #2e2716; --n2: #1a2c22; --n3: #1a2533;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: .2rem 0 .8rem; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; }
h3 { font-size: .95rem; margin: 0 0 .3rem; }

.top {
  position: sticky; top: 0; z-index: 10; background: var(--navy); color: #fff;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .04em; flex: 1; }
.brand span { font-weight: 400; opacity: .75; letter-spacing: 0; }
.top nav { width: 100%; display: flex; gap: 2px; overflow-x: auto; }
.top nav a {
  color: #cfdbe7; text-decoration: none; padding: 10px 7px; font-size: .92rem; border-bottom: 3px solid transparent; white-space: nowrap;
}
.top nav a.active { color: #fff; border-bottom-color: #7fb8ea; }

.pill { font-size: .8rem; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.12); color: #fff; white-space: nowrap; }
.pill.ok { color: #fff; }
.pill.ok::before { content: "● "; color: #6fdc9a; }
.pill.warn { background: #f0b04d; color: #2b1d00; }
.pill.bad { background: #f2867e; color: #2b0805; }
.pill.busy::before { content: "↻ "; }
.pill.tap { cursor: pointer; }

/* Breite wächst mit dem Bildschirm (bis 1280 px), damit Zeilen auf großen Bildschirmen länger werden */
main { max-width: 1280px; margin: 0 auto; padding: 16px 16px calc(env(safe-area-inset-bottom) + 48px); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card h2 { margin-top: 0; }
.boat-card h1 { margin-bottom: .2rem; }
.warn-card { border-color: var(--warn); background: var(--n1); }
.warn-card h2 { color: var(--warn); }
.muted { color: var(--muted); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.error, .form-error { color: var(--bad); }
.form-error:empty { display: none; }
.nowrap { white-space: nowrap; }
.crumbs { color: var(--muted); font-size: .9rem; margin: 0 0 .2rem; }

.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.head h1 { margin-bottom: .6rem; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-decoration: none; color: var(--text); text-align: center; }
.stat strong { display: block; font-size: 1.6rem; }
.stat span { color: var(--muted); font-size: .9rem; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
button, .button {
  font: inherit; font-size: .95rem; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); cursor: pointer; text-decoration: none; display: inline-block; min-height: 40px;
}
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.danger { color: var(--bad); border-color: var(--bad); margin-left: auto; }
button.small, .button.small { padding: 6px 10px; min-height: 34px; font-size: .9rem; }
button:disabled { opacity: .5; }
.icon-btn { min-height: 36px; width: 40px; padding: 0; font-size: 1.2rem; color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list li + li { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-decoration: none; color: var(--text); }
.row .row { padding: 0; }
.grow { flex: 1; min-width: 0; }
.row .date { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 6.2em; }
.row .main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
/* Wichtige Angaben unter dem Titel nie abschneiden: lieber in die nächste Zeile umbrechen */
.row .main .muted { font-size: .88rem; white-space: normal; overflow-wrap: anywhere; }
.row .main strong { overflow-wrap: anywhere; }
/* Schmaler Bildschirm: Schilder (Priorität, Status) unter den Text, damit der Text die volle Breite hat */
@media (max-width: 600px) {
  .row { flex-wrap: wrap; }
  .row .main { flex: 1 1 0; }
  .row > .badges { flex-basis: 100%; justify-content: flex-start; padding-left: calc(2.4em + 12px); }
  /* Wartung: Zustand, Text und Schilder untereinander, links bündig */
  .plan-row { display: grid; grid-template-columns: 1fr; justify-items: start; gap: 4px; }
  .plan-row > .badges { padding-left: 0; }
}

.thumb { width: 48px; height: 48px; border-radius: 6px; overflow: hidden; flex: none; background: var(--bg); display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.icon { font-size: .7rem; font-weight: 700; color: var(--muted); border: 1px solid var(--line); }

.tree { list-style: none; padding-left: 0; margin: 0; }
.tree .tree { padding-left: 18px; border-left: 2px solid var(--line); margin: 2px 0 4px 6px; }
.tree li { padding: 5px 0; }
.tree > li > a { font-weight: 500; }
main > div > .tree { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px; }
.badge { display: inline-block; margin-left: 6px; font-size: .75rem; padding: 0 7px; border-radius: 99px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.multiline { white-space: pre-wrap; overflow-wrap: anywhere; }

.notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 8px 0; }
.note { border-radius: var(--radius); padding: 12px; }
.note.n1 { background: var(--n1); } .note.n2 { background: var(--n2); } .note.n3 { background: var(--n3); }
.note p { margin: 0; }

.form { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field .label { font-weight: 600; font-size: .92rem; }
.field .hint { color: var(--muted); font-size: .85rem; }
input, textarea, select {
  font: inherit; font-size: 16px; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); width: 100%;
}
textarea { resize: vertical; }
input[type=search] { margin-bottom: 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.filters > * { flex: 1 1 200px; width: auto; margin: 0; }
.preview img { max-width: 100%; max-height: 70vh; border-radius: var(--radius); display: block; margin: 8px 0; }
details summary { cursor: pointer; }

/* Status der Wartungspläne */
.state { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; flex: none; }
.st-ueberfaellig { background: #fde3e1; color: #9b1c14; }
.st-offen { background: #fdebd3; color: #8a4b00; }
.st-bald { background: #fff3c4; color: #6b5200; }
.st-ok { background: #dff3e6; color: #17603a; }
.st-erledigt, .st-inaktiv { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) {
  .st-ueberfaellig { background: #4a1612; color: #ffb4ab; }
  .st-offen { background: #46300f; color: #ffcf8f; }
  .st-bald { background: #423710; color: #f5dc7a; }
  .st-ok { background: #173a26; color: #8fe0ad; }
}
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 12px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
legend { font-weight: 600; font-size: .92rem; padding: 0 4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checks .check { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.checks input[type=checkbox] { width: 22px; height: 22px; flex: none; }
.hint, .small { color: var(--muted); font-size: .85rem; margin: 0; }
.form.inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); align-items: end; max-width: none; }

/* Aufgaben */
.ts-offen { background: var(--bg); color: var(--text); border: 1px solid var(--line); }
.ts-angefragt { background: #e7f0fb; color: #1d4f86; }
.ts-beauftragt { background: #ece6fb; color: #4b2f8f; }
.ts-in_arbeit { background: #fff3c4; color: #6b5200; }
.ts-erledigt { background: #dff3e6; color: #17603a; }
.ts-verworfen { background: var(--bg); color: var(--muted); text-decoration: line-through; }
@media (prefers-color-scheme: dark) {
  .ts-angefragt { background: #1a2b40; color: #9cc4f0; }
  .ts-beauftragt { background: #2a2140; color: #c3b0f2; }
  .ts-in_arbeit { background: #423710; color: #f5dc7a; }
  .ts-erledigt { background: #173a26; color: #8fe0ad; }
}
.prio { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-size: .78rem; font-weight: 700; flex: none; }
.prio-A { background: #b3261e; color: #fff; }
.prio-B { background: #f0b04d; color: #2b1d00; }
.prio-C { background: var(--line); color: var(--text); }
.row .num { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2.4em; }
/* Wartung: Nummer (M7) und Zustand nebeneinander, auch auf dem iPhone */
.plan-tag { display: inline-flex; align-items: center; gap: 8px; min-width: 10.5em; }
.badges { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.status-line { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.status-line select { width: auto; }
.status-line .label { font-weight: 600; }
.note-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; margin-bottom: 10px; }
.note-form .two { grid-column: 1 / -1; display: grid; grid-template-columns: 9em 1fr; gap: 8px; margin: 0; }
.note-form .date-input { max-width: none; width: 100%; }
@media (max-width: 600px) { .note-form { grid-template-columns: 1fr; } }

@media (max-width: 699px) {
  .top nav { display: grid; grid-template-columns: repeat(4, 1fr); overflow: visible; }
  .top nav a { text-align: center; padding: 8px 2px; font-size: .85rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 700px) {
  .top { padding-top: calc(env(safe-area-inset-top) + 10px); }
  .top nav { width: auto; order: 2; }
  .brand { flex: none; margin-right: 12px; }
  .top-right { order: 3; margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
}

/* Prüfliste (Import prüfen) */
.notice { border-color: var(--accent); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.section-head h2 { margin: 18px 0 8px; }
.review-row { align-items: flex-start; }
.review-row .main .muted { white-space: normal; }
.review-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
button.subtle { background: transparent; }
.questions { list-style: none; margin: 0; padding: 0; }
.question .q, .review-banner .q { font-weight: 600; margin: 0 0 6px; white-space: pre-line; }
.question textarea { width: 100%; margin-top: 6px; }
@media (max-width: 700px) { .review-row { flex-direction: column; } .review-actions { justify-content: flex-start; } }

/* Anmeldung und Nutzer */
.top-right { display: flex; align-items: center; gap: 10px; }
#user-link { color: #fff; opacity: .85; font-size: .85rem; text-decoration: none; }
#user-link:hover { opacity: 1; text-decoration: underline; }
body.logged-out .top nav, body.logged-out #sync-pill { display: none; }
.narrow { max-width: 460px; margin: 0 auto; }
.form .field input { width: 100%; }
.users { list-style: none; margin: 0; padding: 0; }
.user-card h3 { margin: 0; }
.user-card h4 { margin: 12px 0 4px; font-size: .95rem; }
.row-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 4px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Nur-Lesen-Zugang: Schaltflächen zum Ändern ausblenden (der Server lehnt Änderungen ohnehin ab) */
body.ro a[href$="/neu"], body.ro a[href*="/neu?"], body.ro a[href$="/bearbeiten"],
body.ro .review-actions, body.ro .question .actions, body.ro .review-banner .actions button,
body.ro form:not(.form) button, body.ro .row button { display: none !important; }
body.ro select[name=doc], body.ro .note-form { display: none !important; }
body.ro .status-line select { pointer-events: none; opacity: .75; }

/* Dokument in der App anzeigen (App auf dem Home-Bildschirm) */
.viewer { position: fixed; inset: 0; z-index: 50; background: #fff; display: flex; flex-direction: column; }
.viewer-bar {
  display: flex; align-items: center; gap: 10px; background: #16324f; color: #fff;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; font-weight: 600;
}
.viewer-bar .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-body { flex: 1; width: 100%; border: 0; overflow: auto; -webkit-overflow-scrolling: touch; padding-bottom: env(safe-area-inset-bottom); }
div.viewer-body { padding: 12px; }
.viewer-body img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.viewer-body.pdf { background: #525659; padding: 12px; }
.pdf-pages { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-content: flex-start; min-width: min-content; }
.pdf-wrap { flex: none; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.pdf-page { display: block; width: 100%; height: 100%; }
.viewer-body.pdf > p { color: #fff; }
.pdf-controls { display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: .85rem; white-space: nowrap; }
.pdf-zoom { min-width: 3.2em; text-align: center; }
.pdf-count { opacity: .8; margin-left: 4px; }
@media (max-width: 600px) { .pdf-count, .pdf-controls [title='Page width'] { display: none; } }

/* „hidden“ gilt immer, auch bei Knöpfen mit eigener Anzeige-Art */
[hidden] { display: none !important; }

/* Gesprächsliste */
.talk-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 12px; }
.chip { display: inline-block; padding: 4px 12px; border-radius: 99px; background: var(--n3); color: var(--text); text-decoration: none; font-size: .9rem; font-weight: 600; }
.talk-list { list-style: none; padding: 0; }
.talk-card h2 { font-size: 1.05rem; margin: 0; }
.talk-card .head { align-items: flex-start; gap: 10px; }
.talk-card textarea { width: 100%; margin-top: 8px; }
.talk-notes { list-style: none; padding: 8px 10px; margin: 8px 0; background: var(--bg); border-radius: 8px; font-size: .92rem; }
.talk-notes li { padding: 3px 0; }
.talk-notes .date { color: var(--muted); }
.date-input { max-width: 11em; }

/* Haken „approx.“ neben Preis- und Datumsfeldern */
.with-approx { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* Das Feld teilt sich die Breite mit dem Haken (sonst schiebt „width: 100%“ den Haken hinaus) */
.form .field .with-approx > input { flex: 1 1 auto; width: auto; min-width: 0; }
.form .field .with-approx > input.date-input { flex: 0 1 11em; }
.approx { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; color: var(--muted); white-space: nowrap; cursor: pointer; }
.form .field .approx input, .approx input { width: 20px; height: 20px; margin: 0; padding: 0; flex: none; }

/* Wartungsplan: wie wird er erledigt */
.how select { max-width: 100%; }
.how .how-info { margin: 10px 0 0; }
.state.how-self { background: var(--n2); color: var(--ok); }
.how-who { margin-left: 4px; white-space: nowrap; }
.on-talk-list { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 12px; border-radius: 99px; background: var(--n3); font-size: .9rem; }
.on-talk-list a { color: var(--text); font-weight: 600; text-decoration: none; }

/* Projektnummer im Formular: fest, nicht änderbar */
.fixed-number { display: inline-block; padding: 8px 0; font-weight: 700; font-size: 1.05rem; }

/* Auswahl der Personen für die Talk lists (Schilder mit ×, Auswahlliste, „New person …“) */
.people-field { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.person-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.person-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 12px; }
.chip-x { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 99px; cursor: pointer; font-size: 1.1rem; line-height: 1; color: var(--muted); }
.chip-x:hover, .chip-x:focus-visible { background: var(--n2); color: var(--text); }
.person-chooser { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; max-width: 100%; }
.form .field .person-chooser select, .person-select { width: auto; max-width: 100%; min-width: 14em; }
.person-new-box:not([hidden]) { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.form .field .person-new-box input, .person-new { width: 16em; max-width: 100%; }

/* Zurück-Knopf oben links (die App auf dem Home-Bildschirm hat keinen eigenen) */
.back-btn { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 99px; padding: 4px 12px; min-height: 30px; font-size: .9rem; cursor: pointer; }
.back-btn:hover { background: rgba(255,255,255,.24); }
@media (max-width: 600px) { .how-who { display: none; } }
/* Schmale Bildschirme: Feldpaare untereinander, damit Haken und Beschriftung Platz haben */
@media (max-width: 520px) { .form .two { grid-template-columns: 1fr; } }

/* Notizen bearbeiten */
.note-edit { padding: 2px 8px; min-height: 26px; font-size: .8rem; }
.talk-notes .note-edit { margin-left: 4px; }
.note-form.note-editing { margin: 6px 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.note-form.note-editing .actions { grid-column: 1 / -1; margin: 0; }
.note-form.note-editing textarea { grid-column: 1 / -1; }

/* Alles Anklickbare erkennbar machen: Titel in anklickbaren Zeilen und Kacheln unterstreichen
   (Knöpfe, Menü und runde Schilder sind schon als Knopf erkennbar und bleiben ohne Linie) */
a.row strong, a.row .main > :first-child, .stat span, .stat strong + * { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--accent); }
.on-talk-list a, #user-link { text-decoration: underline; text-underline-offset: 3px; }

/* Kaufliste */
.kauf-row { align-items: flex-start; }
.kauf-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.kauf-check input[type=checkbox] { width: 22px; height: 22px; margin: 2px 0 0; flex: none; }
.kauf-list li.bought strong { text-decoration-line: line-through; color: var(--muted); }
.bought-list { margin-top: 16px; }
.bought-list summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.break { overflow-wrap: anywhere; }

/* Unterprojekte in der Projektliste: eingerückt unter dem Hauptprojekt */
.list li.sub > .row { padding-left: 36px; background: color-mix(in srgb, var(--bg) 50%, transparent); }
.list li.sub > .row .num { font-size: .9rem; }

/* Haken „Seen“ mit Auge (alle Tasks) */
.seen { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; color: var(--muted); flex: none; }
/* Nur das Auge ist sichtbar und klickbar (offen = gesehen); das Kästchen bleibt unsichtbar für Tastatur/Vorlesen */
.seen { position: relative; padding: 2px; border-radius: 6px; }
.seen input[type=checkbox] { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.seen:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.seen .eye { width: 26px; height: 26px; }
.seen:hover { color: var(--text); }
.seen.on:hover { color: var(--text); }
.seen .eye { flex: none; }
.seen.on { color: var(--text); }
.seen span { font-size: .9rem; }
.seen-row { padding-left: 10px; gap: 10px; }
.seen-row > .row { padding: 0; }
.list li.sub > .seen-row { padding-left: 36px; }
@media (max-width: 600px) {
  .seen-row { flex-wrap: nowrap; align-items: flex-start; }
  .seen-row > .seen { padding-top: 2px; }
  .seen-row > .row { align-items: flex-start; gap: 8px; }
  .seen-row .num { min-width: 1.6em; }
  .seen-row > .row > .badges { padding-left: calc(1.6em + 8px); }
  /* Knopf (z. B. „Done …“) unter den Text, damit der Text die volle Breite hat */
  .seen-row:has(> .button) { flex-wrap: wrap; }
  .seen-row > .grow { flex: 1 1 calc(100% - 50px); }
  .seen-row > .button { margin-left: 40px; }
}

/* Textfelder „Next step“ und „Notes“ auf den Detailseiten */
.note-box { margin: 16px 0; }
.note-box .head { margin-bottom: 4px; }
.note-box h2 { margin: 0; font-size: 1.05rem; }
textarea.note-field { min-height: 3.2em; resize: vertical; overflow: hidden; background: var(--card); }
.note-links { margin-top: 4px; }

/* Erinnerung „Review on“ */
.review-box { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.review-box input[type=date] { width: auto; }
.review-box .label { font-weight: 600; }
.review-box button.small { min-height: 34px; padding: 4px 10px; }
/* Datum im App-Format anzeigen, Kalender des Geräts liegt unsichtbar darüber */
.date-pick { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); cursor: pointer; }
.date-pick .date-shown { white-space: nowrap; }
.date-pick input.date-overlay { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.done-notice p { margin: 0 0 4px; }

/* Suche */
.search-link { color: #fff; display: inline-flex; align-items: center; padding: 4px; border-radius: 6px; }
.search-link:hover { background: rgba(255,255,255,.12); }
.search-form { display: flex; gap: 8px; margin-bottom: 6px; }
.search-form .search-input { flex: 1; min-width: 0; font-size: 16px; }
.search-results .main .muted em { font-style: normal; font-weight: 600; }
mark { background: #ffe58a; color: inherit; border-radius: 2px; padding: 0 1px; }
@media (prefers-color-scheme: dark) { mark { background: #8a6d00; } }
.search-scope { display: flex; gap: 8px; margin: 4px 0 6px; }
.search-scope .chip.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.search-results a.page-hit { text-decoration: none; color: var(--muted); }
.search-results a.page-hit:hover em { text-decoration: underline; }

/* Word/Excel im Betrachter: gelesener Text */
.viewer-body.text-view { padding: 16px; overflow: auto; background: var(--card); color: var(--text); }
.viewer-body.text-view .text-page { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 50em; margin: 0 auto 24px; line-height: 1.5; }
.viewer-body.text-view .hint { max-width: 50em; margin: 0 auto 12px; }
.doc-open { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 600px) { .fwd-text { display: none; } }
/* Ohne App-Namen in der Kopfzeile (spart Platz): Anmeldung/Abgleich rechts außen */
.top-right { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.autosave-info { align-self: center; }
