/* RE Organizer – Optik im Stil von REBot / einfachriggo.com.
   Alle Farben sind Variablen und lassen sich im Tool unter Einstellungen → Farben ändern. */
:root {
  --bg: #121315; --surface: #1b1d20; --surface2: #222428; --fg: #eceef1; --muted: #8d939c; --line: #2c2f34;
  --accent: #1a8cff; --pink: #ff2b8a; --ok: #3fd07f; --warn: #ffb547; --late: #ff5a5a;
  --accent-soft: color-mix(in srgb, var(--accent) 18%, var(--surface));
  --pink-soft: color-mix(in srgb, var(--pink) 16%, var(--surface));
  --ok-soft: color-mix(in srgb, var(--ok) 15%, var(--surface));
  --warn-soft: color-mix(in srgb, var(--warn) 15%, var(--surface));
  --late-soft: color-mix(in srgb, var(--late) 16%, var(--surface));
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); margin: 0; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; text-wrap: balance; }
h1 { font-size: 2.3rem; line-height: 1; }
h2 { font-size: 1.2rem; line-height: 1.15; }
h3 { font-size: 1rem; }
a { color: var(--accent); }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.ic { flex: none; vertical-align: -3px; }
.boot { min-height: 100vh; display: grid; place-items: center; font-family: var(--display); font-size: 2.4rem; font-weight: 700; text-transform: uppercase; }
.boot span, .brand span { color: var(--pink); }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px 24px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.55rem; text-transform: uppercase; padding: 0 10px 14px; letter-spacing: .02em; text-decoration: none; color: var(--fg); display: block; }
.side a.nav { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 4px; color: var(--fg); text-decoration: none; font-weight: 500; font-size: .9rem; border-left: 3px solid transparent; }
.side a.nav:hover { background: var(--surface2); }
.side a.nav.active { background: linear-gradient(90deg, var(--accent-soft), var(--pink-soft)); border-left-color: var(--accent); font-weight: 600; }
.side a.nav .dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.side a.nav .badge { margin-left: auto; background: var(--pink); color: #fff; font-size: .7rem; font-weight: 700; border-radius: 9px; padding: 0 6px; line-height: 1.5; }
.side .grp { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 16px 10px 4px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.side .grp a { color: var(--muted); text-decoration: none; font-size: 1rem; line-height: 1; }
.side .grp a:hover { color: var(--fg); }
.side .spacer { flex: 1; min-height: 12px; }
.side .me { display: flex; align-items: center; gap: 8px; padding: 8px 10px; color: var(--muted); font-size: .82rem; }
.topbar { display: none; }
main { padding: 26px max(20px, env(safe-area-inset-right)) 60px max(20px, env(safe-area-inset-left)); min-width: 0; }
.wrap { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.wrap.full { max-width: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.sub { color: var(--muted); margin: 6px 0 0; }
.crumb { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.crumb a { text-decoration: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cols-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
.nowrapc { white-space: nowrap; }
.right { text-align: right; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; position: relative; }
.panel::before { content: ""; position: absolute; left: -1px; top: -1px; width: 44px; height: 2px; background: var(--accent); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel h2 { padding-left: 10px; border-left: 3px solid var(--accent); }
.count { font-family: var(--body); font-size: .78rem; color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; }
a.panel { text-decoration: none; color: inherit; }
a.panel:hover { border-color: var(--accent); }
.empty { color: var(--muted); font-size: .88rem; padding: 6px 0; }
.error-box { border-color: var(--late); }
.loading { color: var(--muted); padding: 30px 0; display: flex; gap: 10px; align-items: center; }
.loading span { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--pink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.handoff { position: relative; background: var(--surface); border: 1px solid var(--line); padding: 12px 16px; border-radius: 3px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.handoff::before { content: ""; position: absolute; left: 0; right: 30%; top: -1px; height: 2px; background: linear-gradient(90deg, var(--accent), var(--pink)); }
.handoff b.tag { color: var(--pink); text-transform: uppercase; font-family: var(--display); font-size: 1.05rem; letter-spacing: .02em; margin-right: 6px; }

/* ---------- Knöpfe ---------- */
.btn { display: inline-flex; align-items: center; font-weight: 600; font-size: .82rem; border: 1px solid var(--line); background: var(--surface2); color: var(--fg); padding: 6px 13px; cursor: pointer; transform: skewX(-8deg); text-decoration: none; border-radius: 1px; white-space: nowrap; }
.btn > span { transform: skewX(8deg); display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:disabled:hover { background: var(--surface2); border-color: var(--line); color: var(--fg); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 80%, #fff); }
.btn-pink { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn-pink:hover { background: color-mix(in srgb, var(--pink) 80%, #fff); border-color: var(--pink); }
.btn-danger:hover { background: var(--late); border-color: var(--late); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: 3px 9px; font-size: .76rem; }
.iconbtn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 3px; display: inline-flex; }
.iconbtn:hover { color: var(--fg); background: var(--surface2); }

/* ---------- Pills ---------- */
.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 2px; white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 1.5; }
.p-n { background: var(--surface2); color: var(--muted); }
.p-late { background: var(--late-soft); color: var(--late); }
.p-soon { background: var(--warn-soft); color: var(--warn); }
.p-ok { background: var(--ok-soft); color: var(--ok); }
.p-acc { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 70%, #fff); }
.p-pink { background: var(--pink-soft); color: var(--pink); }
.upill { background: color-mix(in srgb, var(--uc) 18%, var(--surface)); color: color-mix(in srgb, var(--uc) 80%, #fff); }

/* ---------- Listen ---------- */
.item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item .t { flex: 1; min-width: 0; }
.item b { font-weight: 600; }
.meta { font-size: .8rem; color: var(--muted); }
.clickable { cursor: pointer; }
.clickable:hover b, .clickable:hover .name { color: color-mix(in srgb, var(--accent) 70%, #fff); }
.ev { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.ev:first-child { border-top: 0; }
.ev:hover b { color: var(--accent); }
.date { width: 56px; text-align: center; background: var(--surface2); border-bottom: 2px solid var(--pink); padding: 4px 0; font-variant-numeric: tabular-nums; }
.date b { display: block; font-family: var(--display); font-size: 1.6rem; line-height: 1; }
.date small { font-size: .66rem; text-transform: uppercase; color: var(--muted); letter-spacing: .08em; display: block; }
.tags { font-size: .76rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.tags span { background: var(--surface2); border: 1px solid var(--line); padding: 0 7px; border-radius: 2px; }
.bar { height: 5px; background: var(--surface2); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--pink)); transition: width .3s; }

/* ---------- Abläufe ---------- */
.flow { display: flex; flex-direction: column; }
.step { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; }
.step > input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--pink); cursor: pointer; margin: 2px 0 0; }
.step .name { cursor: pointer; font-weight: 500; }
.step.done .name { text-decoration: line-through; color: var(--muted); }
.step .att { font-size: .77rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.step .rt { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.step.next { background: linear-gradient(90deg, var(--pink-soft), transparent 70%); margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.wf-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wf-head h3 { font-size: 1.1rem; }
.addline { display: flex; gap: 6px; margin-top: 6px; }
.addline input { flex: 1; }

/* ---------- Formulare ---------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; padding: 4px 0; }
.form.one { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.lbl { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.hint { color: var(--muted); font-size: .77rem; }
.inp { background: var(--bg); border: 1px solid var(--line); border-radius: 2px; padding: 7px 9px; width: 100%; min-width: 0; }
.inp:focus { border-color: var(--accent); outline: none; }
textarea.inp { resize: vertical; line-height: 1.45; }
select.inp { padding-right: 4px; }
input[type=color].inp { padding: 2px; height: 34px; width: 56px; }
.inp-sm { padding: 3px 6px; font-size: .84rem; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { accent-color: var(--pink); width: 16px; height: 16px; }
.searchbox { position: relative; }
.searchbox .ic { position: absolute; left: 9px; top: 9px; color: var(--muted); }
.searchbox input { padding-left: 30px; }

/* ---------- Tabellen ---------- */
.tbl { overflow: auto; max-width: 100%; }
.tbl.tall { max-height: 70vh; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: .69rem; letter-spacing: .08em; background: var(--surface); position: sticky; top: 0; z-index: 1; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--fg); }
tr.removed td { opacity: .45; }
tr.hl td { background: var(--pink-soft); }
td.cell { cursor: text; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
td.cell:hover { background: var(--surface2); }
td.cell input { width: 100%; min-width: 120px; }
td.wrapc { white-space: normal; min-width: 200px; }

/* Tabellen-Editor */
.sheet { overflow: auto; max-height: 72vh; border: 1px solid var(--line); background: var(--bg); }
.sheet table { width: auto; font-size: .85rem; }
.sheet th, .sheet td { border: 1px solid var(--line); padding: 0; }
.sheet th { text-align: center; padding: 3px 6px; min-width: 40px; }
.sheet td input { background: transparent; border: 0; padding: 5px 7px; width: 100%; min-width: 120px; color: var(--fg); }
.sheet td input:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--surface); }
.sheet tr:first-child td input { font-weight: 600; }
.sheet td.rowh { color: var(--muted); text-align: center; padding: 0 6px; background: var(--surface); position: sticky; left: 0; font-size: .75rem; }
.tabs { display: flex; gap: 2px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; box-shadow: inset 0 -1px 0 var(--line); }
.tabs a, .tabs button { padding: 8px 14px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .85rem; border: 0; background: none; cursor: pointer; border-bottom: 2px solid transparent; display: inline-flex; white-space: nowrap; flex: none; gap: 6px; align-items: center; }
.tabs a:hover, .tabs button:hover { color: var(--fg); }
.tabs .on { color: var(--fg); border-bottom-color: var(--pink); }

/* ---------- Kalender ---------- */
.cal-wrap { overflow-x: auto; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); min-width: 770px; }
.cal > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 104px; padding: 5px; font-size: .75rem; display: flex; flex-direction: column; gap: 3px; background: var(--surface); min-width: 0; }
.cal .hd { min-height: 0; font-weight: 600; color: var(--muted); background: var(--bg); text-align: center; text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; }
.cal .d { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.cal .other { background: var(--bg); }
.cal .other .d { opacity: .5; }
.cal .today { box-shadow: inset 0 2px 0 var(--pink); }
.cal .today .d { color: var(--pink); }
.cal.week > div { min-height: 340px; }
.chip { border-radius: 2px; padding: 1px 5px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; text-decoration: none; display: block; color: var(--fg); }
.chip.ev-race { background: var(--cc, var(--accent)); color: #fff; font-weight: 600; }
.chip.ev-task { background: color-mix(in srgb, var(--cc) 20%, var(--surface)); color: color-mix(in srgb, var(--cc) 75%, #fff); }
.chip.ev-task.done { text-decoration: line-through; opacity: .6; }
.chip.ev-ext { background: var(--surface2); color: var(--muted); border: 1px dashed var(--line); }
.cal.week .chip { white-space: normal; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .78rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.agenda .day { padding: 10px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 120px 1fr; gap: 12px; }
.agenda .day:first-child { border-top: 0; }
.agenda .day > b { font-family: var(--display); text-transform: uppercase; font-size: 1.05rem; }
.agenda .entries { display: flex; flex-direction: column; gap: 4px; }
.agenda .chip { white-space: normal; padding: 3px 8px; }

/* ---------- Dialoge ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 12px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border: 1px solid var(--line); width: 100%; max-width: 560px; padding: 18px; display: flex; flex-direction: column; gap: 14px; position: relative; border-radius: 3px; }
.modal::before { content: ""; position: absolute; left: 0; right: 40%; top: -1px; height: 2px; background: linear-gradient(90deg, var(--accent), var(--pink)); }
.modal.wide { max-width: 920px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal-head .x { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; }
.modal-head .x:hover { color: var(--fg); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.modal-text { color: var(--fg); white-space: pre-wrap; }

/* ---------- Hinweise ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--surface2); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 2px; box-shadow: 0 6px 24px rgba(0, 0, 0, .4); }
.toast.ok { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--late); }
.notice { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); padding: 10px 14px; border-radius: 2px; font-size: .88rem; }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.notice.pink { background: var(--pink-soft); border-color: color-mix(in srgb, var(--pink) 40%, var(--line)); }

/* ---------- Aufgaben-Details ---------- */
.checklist { display: flex; flex-direction: column; gap: 4px; }
.checklist .ci { display: flex; gap: 8px; align-items: center; }
.checklist .ci input[type=checkbox] { accent-color: var(--pink); width: 16px; height: 16px; }
.checklist .ci.done span { text-decoration: line-through; color: var(--muted); }
.comment { border-top: 1px solid var(--line); padding: 8px 0; }
.comment .who { font-size: .78rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.comment p { white-space: pre-wrap; margin-top: 2px; }
.snippet-box { background: var(--bg); border: 1px solid var(--line); padding: 10px; white-space: pre-wrap; font-size: .88rem; border-radius: 2px; }

/* ---------- Text-Editor ---------- */
.editor-bar { display: flex; flex-wrap: wrap; gap: 2px; border: 1px solid var(--line); border-bottom: 0; background: var(--surface2); padding: 4px; position: sticky; top: 0; z-index: 2; }
.editor-bar button { background: none; border: 0; padding: 5px 8px; border-radius: 2px; cursor: pointer; color: var(--fg); font-weight: 600; font-size: .82rem; min-width: 30px; }
.editor-bar button:hover { background: var(--accent); color: #fff; }
.editor-bar .sepv { width: 1px; background: var(--line); margin: 2px 4px; }
.editor { min-height: 420px; border: 1px solid var(--line); background: var(--bg); padding: 18px 22px; line-height: 1.6; }
.editor:focus { outline: none; border-color: var(--accent); }
.doc-body h1 { font-size: 2rem; margin: .6em 0 .3em; }
.doc-body h2 { font-size: 1.45rem; margin: .8em 0 .3em; }
.doc-body h3 { font-size: 1.15rem; margin: .8em 0 .3em; }
.doc-body p { margin: .4em 0; }
.doc-body ul, .doc-body ol { margin: .4em 0; padding-left: 1.4em; }
.doc-body img { max-width: 100%; height: auto; }
.doc-body table { width: auto; min-width: 50%; margin: .6em 0; }
.doc-body td, .doc-body th { border: 1px solid var(--line); white-space: normal; padding: 5px 8px; min-width: 60px; position: static; }
.doc-body blockquote { border-left: 3px solid var(--pink); margin: .5em 0; padding-left: 12px; color: var(--muted); }

/* ---------- Briefing ---------- */
.brief-page { background: #fff; color: #16181b; padding: 40px 46px; max-width: 794px; margin: 0 auto; box-shadow: 0 6px 30px rgba(0, 0, 0, .4); font-family: var(--body); }
.brief-page h1, .brief-page h2, .brief-page h3 { color: #16181b; }
.brief-page h1 { font-size: 2.6rem; border-bottom: 4px solid; border-image: linear-gradient(90deg, var(--accent), var(--pink)) 1; padding-bottom: 6px; }
.brief-page h2 { color: var(--pink); font-size: 1.5rem; margin-top: 6px; }
.brief-page h3 { font-size: 1.15rem; margin-top: 18px; border-left: 4px solid var(--accent); padding-left: 8px; }
.brief-page p { margin: 6px 0; }
.brief-page img { max-width: 100%; height: auto; display: block; margin: 10px 0; }
.brief-page table { color: #16181b; }
.brief-page td, .brief-page th { border: 1px solid #d0d3d8; color: #16181b; background: #fff; position: static; white-space: normal; }
.brief-tbl td { padding: 3px 4px; }
.brief-tbl .inp { min-width: 110px; }
.notice code, .hint code { background: var(--surface); border: 1px solid var(--line); padding: 0 4px; border-radius: 2px; font-size: .85em; }
.imgs { display: flex; gap: 8px; flex-wrap: wrap; }
.imgs .thumb { position: relative; }
.imgs img { height: 90px; border: 1px solid var(--line); display: block; }
.imgs .thumb button { position: absolute; top: 2px; right: 2px; }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at top left, var(--accent-soft), transparent 50%), radial-gradient(ellipse at bottom right, var(--pink-soft), transparent 50%), var(--bg); }
.auth .panel { width: 100%; max-width: 400px; padding: 26px; gap: 16px; }
.auth h1 span { color: var(--pink); }

/* ---------- Farb-Einstellungen ---------- */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.swatch { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); padding: 6px 10px; }

/* ---------- Handy ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .6); padding-top: max(18px, env(safe-area-inset-top)); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 39; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); padding: max(8px, env(safe-area-inset-top)) 12px 8px; }
  .topbar .brand { padding: 0; font-size: 1.3rem; }
  main { padding-top: 18px; padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
  h1 { font-size: 1.9rem; }
  .agenda .day { grid-template-columns: 1fr; gap: 4px; }
  .brief-page { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Drucken (Briefing als PDF) ---------- */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .no-print, .side, .topbar, .toasts, .modal-bg { display: none !important; }
  .app { display: block; }
  main { padding: 0; }
  .brief-page { box-shadow: none; padding: 0; max-width: none; }
  .print-only-root .wrap > *:not(.print-area) { display: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.row > select.inp { width: auto; max-width: 100%; }
.sepv { width: 1px; align-self: stretch; background: var(--line); margin: 2px 4px; display: inline-block; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸ "; color: var(--muted); }
details[open] > summary::before { content: "▾ "; }
/* Aufgabe ansehen (ohne Bearbeiten) */
.task-title { font-family: var(--display); font-size: 1.5rem; font-weight: 700; text-transform: uppercase; margin: 2px 0 0; }
.task-facts { display: flex; gap: 28px; flex-wrap: wrap; }
.task-facts > div { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.task-desc { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); padding: 10px; border-radius: 2px; }
label.ci { cursor: pointer; }

/* =====================================================================
   Ruhiger Neuaufbau (Nov 2026): weniger Rahmen, Großbuchstaben und Linien.
   Steht absichtlich am Ende und überschreibt die alten Regeln oben.
   ===================================================================== */
h1, h2, h3 { text-transform: none; letter-spacing: 0; }
h1 { font-size: 2.1rem; line-height: 1.05; }
h2 { font-family: var(--body); font-size: 1rem; font-weight: 600; }
.crumb { text-transform: none; letter-spacing: 0; font-size: .82rem; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--fg); }
.lbl { text-transform: none; letter-spacing: 0; font-size: .82rem; font-weight: 500; }
th { text-transform: none; letter-spacing: 0; font-size: .78rem; font-weight: 500; }
.wrap { gap: 22px; }
.wrap.narrow, .wrap:not(.full) { max-width: 920px; }
.page-head { align-items: flex-start; }

/* Leiste */
.side { background: var(--bg); padding-top: 22px; }
.side a.nav { color: var(--muted); border-left: 0; border-radius: 6px; padding: 8px 10px; }
.side a.nav:hover { color: var(--fg); background: var(--surface); }
.side a.nav.active { background: var(--surface2); color: var(--fg); font-weight: 500; }
.side a.nav .dot { border-radius: 50%; }
.side .grp { text-transform: none; letter-spacing: 0; font-size: .78rem; font-weight: 500; padding-top: 20px; }
.side a.nav-add { font-size: .84rem; }

/* Flächen ohne Rahmen und Farbstreifen */
.panel { border: 0; border-radius: 10px; }
.panel::before, .modal::before, .handoff::before { display: none; }
.panel h2 { padding-left: 0; border-left: 0; }
a.panel:hover { border-color: transparent; background: var(--surface2); }
.modal { border: 0; border-radius: 12px; }
.handoff { border: 0; border-radius: 10px; background: var(--pink-soft); }
.notice { border: 0; border-radius: 8px; }
.toast { border: 0; border-left: 3px solid var(--accent); border-radius: 8px; }

/* Knöpfe gerade und ruhig */
.btn { transform: none; border: 0; border-radius: 6px; font-weight: 500; font-size: .86rem; padding: 7px 14px; background: var(--surface2); }
.btn > span { transform: none; }
.btn:hover { background: color-mix(in srgb, var(--surface2) 70%, #fff 8%); color: var(--fg); }
.btn-primary, .btn-primary:hover { color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); }
.btn-sm { padding: 4px 10px; font-size: .8rem; }
.btn-danger:hover { color: #fff; }
.iconbtn { border-radius: 6px; padding: 6px; text-decoration: none; }
.pill { border-radius: 999px; }
.inp { border-radius: 6px; }
.tabs .on { border-bottom-color: var(--pink); }
.tabs a, .tabs button { font-weight: 500; font-size: .9rem; padding: 8px 12px; }
.tabs .cnt { background: var(--pink); color: #fff; border-radius: 9px; font-size: .7rem; padding: 0 6px; margin-left: 4px; }
.seg { display: inline-flex; background: var(--surface); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { background: none; border: 0; color: var(--muted); padding: 4px 12px; border-radius: 6px; cursor: pointer; font: inherit; font-size: .85rem; }
.seg button.on { background: var(--surface2); color: var(--fg); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: .84rem; }
.add-chip { background: none; border: 1px dashed color-mix(in srgb, var(--muted) 50%, transparent); color: var(--muted); border-radius: 6px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: .86rem; }
.add-chip:hover { color: var(--fg); border-color: var(--muted); }
.link-chip { display: inline-flex; gap: 6px; align-items: center; background: var(--surface); border-radius: 6px; padding: 5px 10px; color: var(--fg); text-decoration: none; font-size: .85rem; }
.link-chip:hover { background: var(--surface2); }
.sec-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }

/* Menü hinter „…“ */
.menu-wrap { position: relative; display: inline-flex; }
.menu { position: absolute; right: 0; top: calc(100% + 4px); background: var(--surface2); border-radius: 10px; padding: 6px; min-width: 210px; z-index: 60; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); display: flex; flex-direction: column; }
.menu.up { top: auto; bottom: calc(100% + 6px); }
.menu button, .menu a { text-align: left; padding: 8px 10px; border-radius: 6px; background: none; border: 0; color: var(--fg); font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap; }
.menu button:hover, .menu a:hover { background: color-mix(in srgb, var(--surface2) 60%, #fff 10%); }
.menu .danger { color: var(--late); }

/* Schritte: eine ruhige Zeile */
.slist { display: flex; flex-direction: column; }
.srow { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 4px; }
.srow:last-child { border-bottom: 0; }
.srow:hover { background: var(--surface); }
.srow .t { flex: 1; min-width: 0; }
.srow .name { font-weight: 500; }
.srow .ctx { font-size: .8rem; color: var(--muted); }
.srow.done .name { color: var(--muted); text-decoration: line-through; }
.tick { width: 20px; height: 20px; border-radius: 50%; border: 1.6px solid color-mix(in srgb, var(--muted) 70%, transparent); background: none; flex: none; cursor: pointer; display: grid; place-items: center; padding: 0; }
.tick:hover { border-color: var(--pink); }
.srow.done .tick { background: var(--pink); border-color: var(--pink); }
.srow.done .tick::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.due { font-size: .82rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.due.soon { color: var(--warn); }
.due.late { color: var(--late); }
.av { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .66rem; font-weight: 700; flex: none; background: color-mix(in srgb, var(--uc) 35%, var(--surface)); color: #fff; }
.wf { display: flex; flex-direction: column; gap: 2px; }
.wf-head { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.wf + .wf { margin-top: 6px; }
.addline { display: flex; gap: 6px; margin-top: 6px; }

/* Events */
.ev { border-top: 0; border-bottom: 1px solid var(--line); padding: 10px 6px; border-radius: 4px; grid-template-columns: auto 1fr auto auto; }
.ev:hover { background: var(--surface); }
.ev:hover b { color: inherit; }
.ev b { font-weight: 500; }
.date { background: none; border: 0; width: 46px; padding: 0; }
.date small { text-transform: none; letter-spacing: 0; font-size: .74rem; }
.bar { height: 4px; border-radius: 2px; }
.bar i { background: var(--ok); }
.mini-bar { width: 90px; }
.next-ev { display: flex; align-items: center; gap: 16px; background: var(--surface); border-radius: 12px; padding: 16px 18px; color: inherit; text-decoration: none; }
.next-ev:hover { background: var(--surface2); }
.next-ev b { font-weight: 600; font-size: 1.05rem; }
.next-ev .date b { font-size: 2rem; font-weight: 700; }

/* Seitenfenster für einen Schritt */
.drawer-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: var(--surface); overflow-y: auto; padding: max(18px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 22px 22px; display: flex; flex-direction: column; gap: 16px; box-shadow: -12px 0 40px rgba(0, 0, 0, .45); }
.drawer-top { display: flex; align-items: center; gap: 4px; }
.drawer-title { font-size: 1.7rem; }
.drawer-text { white-space: pre-wrap; }
.facts { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.facts span { display: inline-flex; gap: 6px; align-items: center; }
.copybox { background: var(--bg); border-radius: 8px; padding: 12px; display: flex; gap: 10px; align-items: flex-start; white-space: pre-wrap; }
.sub-items { display: flex; flex-direction: column; gap: 6px; }
.sub-items .ci { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.sub-items .ci input { accent-color: var(--pink); width: 17px; height: 17px; }
.sub-items .ci.done span { color: var(--muted); text-decoration: line-through; }
.attach { display: flex; flex-wrap: wrap; gap: 8px; }
.attach a { display: inline-flex; gap: 6px; align-items: center; background: var(--bg); border-radius: 6px; padding: 5px 10px; text-decoration: none; color: var(--fg); font-size: .85rem; }
.comments { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.comment { border-top: 0; padding: 0; }

/* Briefing */
.auto-box { background: var(--surface); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.auto-vals { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .9rem; }
.auto-vals b { font-weight: 500; }
.img-slot { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.img-slot .thumb { position: relative; }
.img-slot img { height: 90px; border-radius: 6px; display: block; }
.img-slot .thumb button { position: absolute; top: 3px; right: 3px; background: var(--surface); }
.action-bar { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); padding: 12px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; z-index: 5; }

/* Einstellungen: eigener Bereich mit Unternavigation */
.hub { display: grid; grid-template-columns: 230px 1fr; gap: 32px; max-width: 1180px; margin: 0 auto; }
.hub-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 20px; align-self: start; }
.hub-nav h1 { font-size: 1.7rem; margin-bottom: 8px; }
.hub-nav a { color: var(--muted); text-decoration: none; padding: 7px 10px; border-radius: 6px; }
.hub-nav a:hover { color: var(--fg); background: var(--surface); }
.hub-nav a.on { color: var(--fg); background: var(--surface2); }
.hub-grp { font-size: .78rem; color: var(--muted); padding: 14px 10px 4px; }
.hub-logout { margin-top: 18px; background: none; border: 0; color: var(--muted); display: inline-flex; gap: 8px; align-items: center; padding: 7px 10px; cursor: pointer; font: inherit; text-align: left; }
.hub-logout:hover { color: var(--fg); }
.hub-body { min-width: 0; }
.hub-body .wrap { max-width: none; }

@media (max-width: 900px) {
  .hub { grid-template-columns: 1fr; gap: 16px; }
  .hub-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .hub-nav h1 { width: 100%; }
  .hub-grp { display: none; }
  .hub-nav a { background: var(--surface); }
  .hub-logout { margin-top: 0; }
  .mini-bar { display: none; }
  .srow .ctx { white-space: normal; }
}
.btn.btn-primary { background: var(--accent); color: #fff; }
.btn.btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); }
.btn.btn-pink { background: var(--pink); color: #fff; }
.btn.btn-ghost { background: transparent; }
