/* Farben: hell/dunkel über :root.dark (folgt dem System, umschaltbar) */
:root {
  --bg: #f4f5f7; --bg2: #eceef2; --fg: #1d2330; --card: #fff; --card2: #f7f8fa; --line: #e3e6ec; --input: #cdd2dc;
  --muted: #667085; --soft: #e8ebf1; --hover: #f1f4f9; --staff: #eef4ff;
  --accent: #2f6fed; --accent-bg: #e3ecfd; --ok: #1f8a4c; --ok-bg: #e1f5e6; --warn: #b26a00; --warn-bg: #fff1d6;
  --bad: #c43c3c; --bad-bg: #fbe3e3; --off: #98a2b3;
  --shadow: 0 1px 3px #0000000f, 0 8px 24px #0000000a;
  color-scheme: light;
}
:root.dark {
  --bg: #12151c; --bg2: #0d1016; --fg: #e4e8f1; --card: #1b1f29; --card2: #222733; --line: #2c3240; --input: #3a4052;
  --muted: #9aa3b5; --soft: #2a303d; --hover: #242a36; --staff: #1c2942;
  --accent: #5b8ef5; --accent-bg: #1f2e4d; --ok: #5fcf8e; --ok-bg: #173323; --warn: #f0b04a; --warn-bg: #3a2c12;
  --bad: #f07a7a; --bad-bg: #3d1b1b; --off: #6b7385;
  --shadow: 0 1px 3px #0000004d, 0 8px 24px #00000040;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--fg); -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; }
.hidden, [hidden] { display: none !important; }
.muted, .meta { color: var(--muted); font-size: 13px; }

/* ---------- Grundbausteine ---------- */
.card, .box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 4px; }
input, select, textarea, .field {
  width: 100%; padding: 10px 12px; border: 1px solid var(--input); border-radius: 8px;
  font: inherit; font-size: 16px; background: var(--card); color: var(--fg);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
textarea { min-height: 110px; resize: vertical; }
button, .b {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--card2); color: var(--fg); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 14px; font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
button:hover, .b:hover { background: var(--hover); }
button.primary, .b.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--bad); }
button.icon { padding: 8px 11px; }
button.small { padding: 5px 10px; font-size: 13px; }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 160px; }
.row > .shrink { flex: 0 0 auto; }
.msg { padding: 10px 12px; border-radius: 8px; margin-top: 12px; }
.ok { background: var(--ok-bg); color: var(--ok); } .bad { background: var(--bad-bg); color: var(--bad); }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px; background: var(--soft); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.acc { background: var(--accent-bg); color: var(--accent); } .chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.off { color: var(--off); }
.s-offen { background: var(--accent-bg); color: var(--accent); }
.s-in-Bearbeitung { background: var(--warn-bg); color: var(--warn); }
.s-wartend { background: #efe3ff; color: #7a3fd1; } :root.dark .s-wartend { background: #2e2145; color: #c3a2f5; }
.s-geschlossen { color: var(--off); }
.p-dringend { background: var(--bad-bg); color: var(--bad); } .p-hoch { background: var(--warn-bg); color: var(--warn); }
.u-wartend { background: var(--warn-bg); color: var(--warn); } .u-freigegeben { background: var(--ok-bg); color: var(--ok); }
.u-gesperrt { background: var(--bad-bg); color: var(--bad); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: 7px 13px; background: var(--card2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: #fff; }

.progress { display: inline-block; width: 80px; height: 7px; background: var(--soft); border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.progress > i { display: block; height: 100%; background: var(--ok); }

#toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100;
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; }

/* ---------- App-Hülle: Seitenleiste (PC) / Navigation unten (Handy) ---------- */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 10px; gap: 4px; }
.brand { font-weight: 800; font-size: 18px; padding: 4px 10px 14px; display: flex; align-items: center; gap: 8px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav button { justify-content: flex-start; border: 0; background: none; padding: 10px 12px; font-size: 15px; width: 100%; }
.side nav button.on { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.side .grow { flex: 1; }
.badge { min-width: 18px; height: 18px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-style: normal;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; margin-left: auto; }
main.content { padding: 24px; max-width: 1200px; width: 100%; min-width: 0; }
.top { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.top h1 { margin: 0; font-size: 24px; margin-right: auto; }
.bottom-nav { display: none; }

@media (max-width: 800px) {
  .app { display: block; }
  .side { display: none; }
  main.content { padding: calc(14px + env(safe-area-inset-top)) 14px calc(90px + env(safe-area-inset-bottom)); }
  .top h1 { font-size: 21px; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--card);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav button { flex: 1; flex-direction: column; gap: 1px; border: 0; background: none; font-size: 11px; padding: 4px 0; color: var(--muted); position: relative; }
  .bottom-nav button span { font-size: 20px; line-height: 1.2; }
  .bottom-nav button.on { color: var(--accent); }
  .bottom-nav .badge { position: absolute; top: 0; left: 55%; }
  .bottom-nav button.plus span { background: var(--accent); color: #fff; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; margin-top: -14px; box-shadow: var(--shadow); }
  .card, .box { padding: 14px; border-radius: 10px; }
  .cal-title { flex-basis: 100%; }
}

/* ---------- Listen ---------- */
.plist { display: grid; gap: 10px; }
.pcard { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 16px; cursor: pointer; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); color: inherit; font: inherit; width: 100%; }
.pcard:hover { border-color: var(--accent); background: var(--card); }
.pcard b { font-size: 16px; }
.pcard > div { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.pcard .sub { color: var(--muted); font-size: 13px; }
.pcard .right { grid-row: span 2; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; justify-content: center; }
.pcard.closed { opacity: .6; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input { flex: 1 1 200px; width: auto; } .filters select { width: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table td, .table th { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

/* Übersicht */
.ov { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .ov { grid-template-columns: minmax(0, 1fr); } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 24px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 0 0 8px; }

/* Personen (Nutzerverwaltung) */
.person { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.person .who { flex: 1; min-width: 0; }
.person .who small { color: var(--muted); }
.person .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.person.inactive { opacity: .55; }
@media (max-width: 600px) { .person { flex-wrap: wrap; } .person .acts { width: 100%; justify-content: flex-start; padding-left: 52px; } }

/* ---------- Sheets (Detail, Formulare) ---------- */
dialog.sheet { margin: 0 0 0 auto; width: min(760px, 100%); max-width: none; height: 100%; max-height: none; padding: 0;
  background: var(--bg); color: var(--fg); border: 0; border-left: 1px solid var(--line); box-shadow: var(--shadow); }
dialog.sheet.narrow { width: min(480px, 100%); }
dialog.sheet[open] { animation: sheet-in .22s ease-out; }
@keyframes sheet-in { from { transform: translateX(40px); opacity: 0; } }
dialog::backdrop { background: rgba(0, 0, 0, .5); }
.sheet-wrap { display: flex; flex-direction: column; height: 100%; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; border-bottom: 1px solid var(--line); background: var(--card); }
.sheet-head h2 { font-size: 19px; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.sheet-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); display: flex; gap: 10px; align-items: center; }
.sheet-foot .grow { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 0; overflow-x: auto; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 8px 12px; color: var(--muted); }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.inline-title { font-size: 20px; font-weight: 700; border: 1px solid transparent; padding: 6px 8px; margin: -6px -8px; background: transparent; }
.inline-title:hover { border-color: var(--line); }

/* Aufgaben */
.tasks { list-style: none; padding: 0; margin: 0; }
.tasks li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tasks li:last-child { border-bottom: 0; }
.tasks li .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tasks li.done .t { text-decoration: line-through; color: var(--muted); }
.tasks .due { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tasks .due.late { color: var(--bad); font-weight: 600; }
.tasks .x { padding: 2px 8px; border: 0; background: none; color: var(--muted); }
.tasks .x:hover { color: var(--bad); }
.task-add { display: flex; gap: 8px; margin-top: 10px; }
.task-add input[type=text] { flex: 1; }
.task-add input[type=date] { width: 150px; flex: 0 0 auto; }

/* Nachrichten */
.comment { border-left: 3px solid var(--input); padding: 8px 12px; margin: 10px 0; border-radius: 0 8px 8px 0; background: var(--card); }
.comment.staff { border-color: var(--accent); background: var(--staff); }
.comment .md > :first-child { margin-top: 0; } .comment .md > :last-child { margin-bottom: 0; }

/* ---------- Markdown (gerendert) ---------- */
.md { overflow-wrap: anywhere; }
.md h1, .md h2, .md h3 { margin: 1em 0 .4em; } .md h2 { font-size: 1.3em; } .md h3 { font-size: 1.1em; }
.md p { margin: .5em 0; }
.md ul, .md ol { padding-left: 1.4em; margin: .5em 0; }
.md li:has(> input[type=checkbox]) { list-style: none; margin-left: -1.3em; }
.md li > input[type=checkbox] { width: 15px; height: 15px; vertical-align: -2px; margin-right: 6px; }
.md blockquote { margin: .6em 0; padding: 2px 12px; border-left: 3px solid var(--input); color: var(--muted); }
.md code { background: var(--soft); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.md pre { background: var(--bg2); padding: 12px; border-radius: 8px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; margin: .6em 0; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; }
.md th { background: var(--card2); }
.md img { max-width: 100%; border-radius: 8px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1em 0; }
.md .callout { border-left: 4px solid var(--accent); background: var(--accent-bg); padding: 8px 12px; border-radius: 0 8px 8px 0; margin: .6em 0; }
.md .callout > :first-child { margin-top: 0; } .md .callout > :last-child { margin-bottom: 0; }
.diagram { margin: .6em 0; text-align: center; overflow-x: auto; } .diagram svg { max-width: 100%; height: auto; }
.diagram-error { color: var(--bad); font-size: 13px; text-align: left; }

/* ---------- Markdown-Editor (aus hub) ---------- */
.md-editor { position: relative; border: 1px solid var(--input); border-radius: 10px; background: var(--card); }
.md-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.md-bar { display: flex; gap: 2px; align-items: center; padding: 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap; position: sticky; top: 0; background: var(--card); z-index: 2; border-radius: 10px 10px 0 0; }
.md-tool { border: 0; background: none; padding: 5px 9px; font-size: 14px; min-width: 32px; }
.md-tool:hover { background: var(--hover); }
.md-grow { flex: 1; }
.md-views button { padding: 4px 10px; font-size: 12px; }
.md-views { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.md-views button { border: 0; border-radius: 0; background: var(--card2); }
.md-views button.on { background: var(--accent); color: #fff; }
.md-live { padding: 10px 14px; min-height: 140px; }
.md-editor[data-mode=live] .md-source { display: none; }
.md-editor[data-mode=source] .md-live { display: none; }
.md-source { border: 0; border-radius: 0 0 10px 10px; min-height: 220px; font: 14px/1.6 ui-monospace, "JetBrains Mono", monospace; box-shadow: none !important; }
.live-block { border-radius: 6px; padding: 1px 6px; margin: 0 -6px; outline: none; }
.live-block > :first-child { margin-top: 0; } .live-block > :last-child { margin-bottom: 0; }
.live-block + .live-block, .live-block + .live-input, .live-input + .live-block { margin-top: 10px; }
.live-text:focus { background: var(--hover); }
.live-block:not(.live-text) { cursor: text; } .live-block:not(.live-text):hover { background: var(--hover); }
.live-input { width: 100%; font: 14px/1.6 ui-monospace, "JetBrains Mono", monospace; min-height: 0; resize: none; background: var(--bg2); }
.live-add { color: var(--muted); font-size: 13px; padding: 8px 0 2px; cursor: text; }
.md-popup { position: absolute; z-index: 30; width: 250px; max-height: 300px; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; }
.md-popup button { display: flex; justify-content: space-between; width: 100%; border: 0; background: none; padding: 7px 10px; }
.md-popup button small { color: var(--muted); }
.md-popup button.on { background: var(--accent-bg); }

/* ---------- Kalender (aus Fresh Fade) ---------- */
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.cal-title { font-size: 20px; font-weight: 700; margin-right: auto; }
.ev { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--accent); background: var(--accent-bg); color: var(--fg);
  padding: 3px 6px; border-radius: 4px; font-size: 12px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.ev.done { border-left-color: var(--ok); background: var(--ok-bg); text-decoration: line-through; opacity: .75; }
.ev.late { border-left-color: var(--bad); background: var(--bad-bg); }
.ev.proj { border-left-color: var(--warn); background: var(--warn-bg); font-weight: 600; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.week > div { background: var(--card); min-height: 300px; padding: 6px; }
.week .wh { min-height: 0; text-align: center; cursor: pointer; font-weight: 600; padding: 8px 4px; }
.week .wh small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.week .wh.today { color: var(--accent); }
.week .wc.today { background: var(--hover); }
.wlist-day { margin-bottom: 10px; }
.wlist-head { display: flex; justify-content: space-between; padding: 9px 12px; background: var(--card2); border-radius: 10px; cursor: pointer; font-weight: 700; }
.wlist-head.today { color: var(--accent); }
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.month .mh { background: var(--card2); padding: 8px; text-align: center; color: var(--muted); font-size: 12px; }
.month .md-cell { background: var(--card); min-height: 104px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; font-size: 12px; min-width: 0; }
.month .md-cell:hover { background: var(--hover); }
.month .md-cell.other { opacity: .4; }
.month .md-cell b { font-size: 14px; }
.month .md-cell.today b { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; }
.month .more { color: var(--muted); font-size: 11px; }
@media (max-width: 800px) {
  .month .md-cell { min-height: 58px; padding: 4px; }
  .month .md-cell .ev { display: none; }
  .month .md-cell .dots { display: flex; gap: 2px; flex-wrap: wrap; }
}
.month .dots { display: none; }
.month .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.month .dots i.done { background: var(--ok); } .month .dots i.late { background: var(--bad); } .month .dots i.proj { background: var(--warn); }
.agenda-day { margin-top: 12px; font-weight: 700; font-size: 13px; }
.agenda-day.today { color: var(--accent); }
.agenda-item { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.agenda-item:hover { background: var(--hover); }
.agenda-item.done { text-decoration: line-through; color: var(--off); }
.agenda-item .late { color: var(--bad); }
.mini-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.mini { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; font-size: 13px; }
.mini .wd { color: var(--muted); font-size: 11px; }
.mini button { aspect-ratio: 1; padding: 0; border: 1px solid transparent; background: none; border-radius: 7px; position: relative; }
.mini button.other { visibility: hidden; }
.mini button.has { background: var(--accent-bg); color: var(--accent); font-weight: 700; }
.mini button.late { background: var(--bad-bg); color: var(--bad); }
.mini button.today { border-color: var(--accent); }

/* ---------- Login / Gast ---------- */
.auth { max-width: 440px; margin: 8vh auto; padding: 0 16px; }
.auth h1 { text-align: center; }

/* ---------- Projekte: Liste + Vorschau (wie Notion) ---------- */
main.content:has(> [data-panel="projects"]:not([hidden])) { max-width: none; }
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.pane { display: none; }
@media (min-width: 1100px) {
  main.content:has(> [data-panel="projects"]:not([hidden])) { padding: 0; }
  .split { grid-template-columns: clamp(300px, 28vw, 420px) minmax(0, 1fr); min-height: 100vh; }
  .split-list { padding: 20px 14px 20px 20px; border-right: 1px solid var(--line); height: 100vh; overflow-y: auto; position: sticky; top: 0; }
  .pane { display: block; position: sticky; top: 0; height: 100vh; overflow: hidden; background: var(--bg); }
  .pane-empty { display: flex; height: 100%; align-items: center; justify-content: center; }
  .pane:has(.dp:not(:empty)) .pane-empty { display: none; }
}
.dp:empty { display: none; }
.prows { display: flex; flex-direction: column; gap: 2px; }
.prow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; text-align: left; white-space: normal;
  padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; background: none; width: 100%; }
.prow:hover { background: var(--hover); }
.prow.on { background: var(--accent-bg); border-color: var(--accent); }
.prow.closed { opacity: .55; }
.prow-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow-sub { grid-column: 1 / -1; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .chip { font-size: 11px; padding: 1px 7px; }

/* Detail-Panel */
.dp { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.dp-head { display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; border-bottom: 1px solid var(--line); background: var(--card); }
.dp-head .inline-title { flex: 1; min-width: 0; margin: 0; font-size: 18px; padding: 6px 8px; }
.dp-scroll { flex: 1; overflow-y: auto; padding: 14px 18px 30px; display: flex; flex-direction: column; gap: 14px; }
.dp-foot { padding: 6px 18px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); min-height: 30px; font-size: 12px; }
.dp-summary { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: flex-start; white-space: normal; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; width: 100%; }
.dp-summary .dp-more { margin-left: auto; color: var(--accent); font-size: 13px; font-weight: 600; }
.dp-info { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px 14px; margin-top: -8px; }
.dp-sec { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.dp-sec.int { border-style: dashed; }
.dp-sec-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.dp-sec-head h3 { margin: 0; font-size: 15px; }
.dp-sec-head .seg { margin-left: auto; }
.seg.small button { padding: 4px 10px; font-size: 12px; }
.quick { display: flex; gap: 6px; align-items: center; }
.quick #quick-title { flex: 1; min-width: 0; }
.quick #quick-due { width: 140px; flex: 0 0 auto; }
.quick .lock { flex: 0 0 auto; }
.quick .lock.on { background: var(--warn-bg); border-color: var(--warn); }
.tasks .lockbtn { font-size: 13px; opacity: .6; } .tasks .lockbtn:hover { opacity: 1; }
.tasks li.done-head { border-bottom: 0; padding-top: 10px; }
.tasks li.done-head button { padding: 2px 0; font-size: 13px; }
#reply { margin-top: 10px; min-height: 80px; }
#d-detail-host, #detail-host { height: 100%; }
@media (max-width: 1099px) {
  .quick #quick-due { width: 44px; padding: 10px 6px; }
  .dp-scroll { padding: 12px 12px 30px; }
}
.ev.start { border-left-color: var(--ok); background: var(--ok-bg); font-weight: 600; }
