@font-face { font-family: "Outfit"; font-weight: 500; font-display: swap; src: url("/static/fonts/outfit-500.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 600; font-display: swap; src: url("/static/fonts/outfit-600.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 700; font-display: swap; src: url("/static/fonts/outfit-700.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url("/static/fonts/sourcesans-400.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-style: italic; font-display: swap; src: url("/static/fonts/sourcesans-400i.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url("/static/fonts/sourcesans-600.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-display: swap; src: url("/static/fonts/sourcesans-700.woff2") format("woff2"); }

:root {
  --pine: #1F4D2B; --garden: #2F6B3A; --leaf: #4E8B3A; --bud: #8CC56E; --sage: #E3EEDD; --sage-2: #F1F7EC;
  --ground: #F3F7F0; --line: #D5E3CE; --line-2: #EBF2E7; --field: #B9CDB1; --ink: #1B2A1F; --muted: #4A5D4E;
  --deep: #2B4A31; --link: #245C31; --bloom: #F4D35E; --danger: #A3341F; --warn: #8A4B0F;
  --radius: 10px; --head: "Outfit", system-ui, sans-serif; --body: "Source Sans 3", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 16px/1.5 var(--body); }
a { color: var(--link); } a:hover { color: #163D20; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: 32px; } h2 { font-size: 22px; } h3 { font-size: 18px; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { min-height: 44px; border: 1.5px solid var(--field); border-radius: var(--radius); padding: 8px 12px; background: #fff; width: 100%; }
textarea { min-height: 88px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--bud); outline-offset: 2px; }
label { font-weight: 600; font-size: 15px; }
code { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: 14px; } .strong { font-weight: 600; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.hint { font-size: 14px; color: var(--deep); background: #F6FAF3; border-radius: var(--radius); padding: 12px 14px; margin: 8px 0 0; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

/* Layout */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 248px; max-width: 100%; background: var(--pine); padding: 22px 16px; display: flex; flex-direction: column; gap: 24px; }
.main { flex: 999 1 560px; min-width: 0; padding: 28px 40px 60px; }
@media (min-width: 900px) { .side { max-width: 272px; min-height: 100vh; position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; } }
@media (max-width: 640px) { .main { padding: 20px 16px 48px; } h1 { font-size: 26px; } }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 0 6px; }
.brand-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--sage-2); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.brand-mark.lg { width: 64px; height: 64px; border-radius: 16px; }
.brand-name { display: block; font: 700 18px/1.2 var(--head); color: #fff; } .brand-name.lg { font-size: 26px; }
.brand-sub { display: block; font-size: 13px; color: #C9DFBF; } .brand-sub.lg { font-size: 15px; }
.nav-panel { display: flex; flex-direction: column; gap: 24px; flex: 1; }
.menu-toggle { display: none; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--radius); color: var(--sage); text-decoration: none; }
.nav a:hover { background: #28603A; color: #fff; }
.nav a.active { background: var(--garden); color: #fff; font-weight: 700; }
.nav-label { margin: 14px 14px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #A9C99B; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--garden); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--bud); color: var(--pine); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.me-name { flex: 1; color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; line-height: 1.2; }
.me-name span { display: block; color: #C9DFBF; font-size: 13px; font-weight: 400; }
.me .icon-btn { color: #C9DFBF; background: transparent; }
.me .icon-btn:hover { background: #28603A; }

/* Auth */
.auth-shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.auth-shell > .flash { flex-basis: 100%; margin: 0; border-radius: 0; }
.auth-aside { flex: 1 1 420px; background: var(--pine); color: #F1F7EC; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.brand-row { display: flex; align-items: center; gap: 16px; }
.auth-claim h1 { font-size: 38px; color: #F1F7EC; max-width: 460px; }
.auth-claim p { font-size: 18px; color: #D6E8CD; max-width: 440px; margin: 0; }
.auth-note { font-size: 14px; color: #C9DFBF; margin: 0; }
.auth-main { flex: 999 1 420px; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border-radius: 16px; padding: 36px; box-shadow: 0 1px 2px rgba(31,77,43,.08), 0 12px 32px rgba(31,77,43,.10); }
.auth-card h2 { font-size: 28px; margin-bottom: 4px; }
.auth-card form { margin: 20px 0 12px; }
.otp { font: 600 28px var(--head); letter-spacing: .35em; text-align: center; }
.qr-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.qr { border: 1.5px solid var(--field); border-radius: var(--radius); padding: 6px; background: #fff; }
.secret { font-size: 15px; color: var(--ink); word-break: break-all; }
.codes { list-style: none; padding: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; background: #F6FAF3; border: 1px dashed #8DB37E; border-radius: var(--radius); }
.codes code { font-size: 18px; }

/* Bausteine */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--radius); border: 1.5px solid var(--field); background: #fff; color: var(--pine); font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--sage-2); color: var(--pine); }
.btn-primary { background: var(--garden); border-color: var(--garden); color: #fff; }
.btn-primary:hover { background: var(--pine); color: #fff; }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; min-height: 50px; font-size: 17px; }
.btn.danger, .icon-btn.danger { color: var(--danger); border-color: #E5C1B9; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: var(--radius); background: var(--sage-2); color: var(--pine); cursor: pointer; font-weight: 700; }
.icon-btn.sm { width: 34px; height: 34px; font-size: 15px; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; margin-bottom: 20px; }
.card.narrow { max-width: 640px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.page-head h1 { margin: 4px 0 0; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 28px 0 12px; }
.section-head h2 { margin: 0; font-size: 24px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { margin: 0; }
.alert { background: var(--sage-2); border: 1px solid #C5DABB; border-radius: var(--radius); padding: 12px 16px; margin: 0 0 16px; }
.alert-error { background: #FBEDEA; border-color: #E5C1B9; color: #7A2414; }
.flash { border-radius: 12px; padding: 14px 18px; margin: 0 0 20px; font-weight: 600; }
.flash-ok { background: var(--pine); color: #fff; }
.flash-warn { background: #FFF4DA; color: #5C3A06; border: 1px solid #EBCB80; }
.flash-error { background: #FBEDEA; color: #7A2414; }
.badge { display: inline-flex; align-items: center; min-height: 26px; padding: 0 11px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.badge-draft { border: 1.5px dashed var(--leaf); color: var(--link); background: #fff; }
.badge-final { background: var(--pine); color: #fff; }
.badge-open { border: 1.5px solid var(--leaf); color: var(--link); background: #fff; }
.nr { font: 600 15px var(--head); color: var(--pine); white-space: nowrap; }
.nr.big { font-size: 18px; }
.nr-badge { font: 700 15px var(--head); background: var(--sage); color: var(--pine); padding: 4px 10px; border-radius: 8px; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.label-sm { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 8px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 12px; }
.dl dt { color: var(--muted); font-weight: 600; font-size: 14px; } .dl dd { margin: 0; font-weight: 600; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 160px; min-height: 40px; }
.inline-form label { font-size: 14px; color: var(--muted); }
.row-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.row-form input, .row-form select { width: auto; flex: 1 1 140px; min-height: 40px; }
.row-form .num { flex: 0 0 80px; }
.row-form.grow { flex: 1; }
.form-actions { flex-basis: 100%; display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.check-tile { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius); background: #F6FAF3; font-weight: 400; cursor: pointer; margin-bottom: 6px; }
.check-tile input, .check-row input { width: 20px; height: 20px; min-height: 0; accent-color: var(--garden); flex: none; margin-top: 2px; }
.check-tile span { display: flex; flex-direction: column; }
.check-row { display: flex; gap: 10px; align-items: center; font-weight: 400; }
.carry-group { font: 600 15px var(--head); color: var(--pine); margin: 12px 0 6px; }
fieldset { border: 0; padding: 0; margin: 0; }

/* Übersicht */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.stat-accent { background: var(--sage); border-color: #C5DABB; }
.stat-label { font-size: 14px; color: var(--muted); }
.stat-value { font: 600 32px var(--head); color: var(--pine); margin-top: 4px; }
.stat-value.sm { font-size: 22px; }
.stat-sub { font-size: 14px; margin-top: 2px; }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.col-main { flex: 3 1 560px; min-width: 0; }
.col-side { flex: 1 1 280px; min-width: 0; }
.col-half { flex: 1 1 420px; min-width: 0; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr.inactive td { opacity: .6; }
.strong-link { font-weight: 600; text-decoration: none; color: var(--ink); }
.strong-link:hover { text-decoration: underline; }
.task-tile { display: flex; gap: 12px; padding: 12px; border-radius: var(--radius); background: #F6FAF3; text-decoration: none; color: var(--ink); margin-bottom: 8px; }
.task-tile > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.task-tile:hover { background: var(--sage); color: var(--ink); }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--garden); margin-top: 6px; flex: none; }
.ok-text { color: var(--link); font-weight: 700; } .warn-text { color: var(--warn); font-weight: 700; }
.list-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.list-nav a { min-height: 44px; display: flex; align-items: center; padding: 0 12px; border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.list-nav a.active { background: var(--sage); color: var(--pine); font-weight: 700; }
.tpl-row { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.tpl-row form { margin: 0; }
.switch { width: 52px; height: 30px; border-radius: 999px; border: 0; padding: 3px; background: #C8D3C3; display: flex; justify-content: flex-start; cursor: pointer; }
.switch.on { background: var(--garden); justify-content: flex-end; }
.switch span { width: 24px; height: 24px; border-radius: 50%; background: #fff; }
.menu { padding: 10px 0; }

/* ProseMirror-Grundstile (statt injizierter Styles, CSP) */
.ProseMirror { position: relative; word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces; font-variant-ligatures: none; }
.ProseMirror [contenteditable="false"] { white-space: normal; }
.ProseMirror pre { white-space: pre-wrap; }
.ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; }
.ProseMirror-gapcursor:after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid black; }
.ProseMirror-focused .ProseMirror-gapcursor { display: block; }
.ProseMirror .selectedCell { background: #E3EEDD; }
.ProseMirror-hideselection *::selection { background: transparent; }
img.ProseMirror-separator { display: inline !important; border: none !important; margin: 0 !important; }

/* Editor */
.edit-point { margin-top: 8px; }
.edit-point > summary { list-style: none; }
.edit-point > summary::-webkit-details-marker { display: none; }
.edit-point[open] > summary { margin-bottom: 8px; background: var(--sage); }
.point-view { margin: 2px 0 4px; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.meta-grid .span-2 { grid-column: 1 / -1; }
.dl-cols { grid-template-columns: max-content 1fr; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip-form { margin: 0; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; font-size: 14px; cursor: pointer; border: 1.5px solid #8DB37E; background: var(--sage); color: var(--pine); font-weight: 600; list-style: none; }
.chip-excused { background: #fff; color: var(--muted); border-style: dashed; border-color: #9AB38F; font-weight: 400; }
.chip-absent { background: #fff; color: var(--muted); border-color: #D2D9CF; font-weight: 400; text-decoration: line-through; }
.chip-add { background: #fff; border-style: dashed; color: var(--link); }
.inline-details { display: inline-block; position: relative; }
.inline-details > summary { list-style: none; }
.inline-details > summary::-webkit-details-marker { display: none; }
.inline-details[open] > form, .inline-details[open] > .stack { margin-top: 8px; }
.main-top { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 14px; overflow: hidden; overflow: clip; }
.main-top > summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; min-height: 60px; cursor: pointer; list-style: none; color: var(--pine); }
.main-top > summary::-webkit-details-marker { display: none; }
.main-top[open] > summary { background: var(--sage); }
.chev { transition: transform .15s; flex: none; }
.main-top[open] .chev { transform: rotate(90deg); }
.main-title { font: 600 20px var(--head); }
.main-info { margin-left: auto; font-size: 14px; color: var(--deep); }
.main-body { padding: 4px 24px 20px; }
.sub-top { padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.sub-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sub-head h3 { margin: 0; font-size: 19px; font-family: var(--body); font-weight: 700; }
.tools { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.tools form { margin: 0; }
.empty { margin: 8px 0 0 4px; }
.points { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.point { border: 1.5px solid var(--line); border-left-width: 4px; border-left-color: var(--leaf); border-radius: var(--radius); padding: 12px 14px; background: #fff; }
.point.is-done { border-left-color: var(--pine); background: #FAFCF9; }
.point-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.point-head form { margin: 0; }
.point-title { font-size: 16px; }
.status-btn { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer; background: #fff; color: var(--link); border: 1.5px solid var(--leaf); }
.status-btn.on { background: var(--pine); color: #fff; border-color: var(--pine); }
.origin { font-size: 12px; font-weight: 700; color: var(--link); background: var(--sage-2); border: 1px solid #C5DABB; padding: 3px 8px; border-radius: 6px; }
.point-form { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.point-form.dirty [data-save]::after { content: " •"; }
.title-input { min-height: 40px; font-weight: 600; }
.rich-fallback { font-family: ui-monospace, monospace; font-size: 13px; min-height: 120px; }
.rich { border-radius: var(--radius); }
.rich.busy { opacity: .6; pointer-events: none; }
.toolbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 4; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px; background: var(--sage-2); border: 1.5px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
.toolbar select { width: auto; min-height: 36px; padding: 0 8px; font-size: 14px; border-radius: 8px; border-width: 1px; }
.tb-btn { min-width: 36px; height: 36px; border: 0; border-radius: 8px; background: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; color: var(--pine); }
.tb-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tb-btn.active { background: var(--pine); color: #fff; }
.tb-btn.tb-primary { background: var(--garden); color: #fff; font-weight: 700; font-size: 14px; }
.tb-sep { width: 1px; height: 24px; background: #C5DABB; margin: 0 4px; }
.tb-ok { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--link); padding: 0 6px; }
.rich-area .content { min-height: 90px; border: 1.5px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); padding: 12px 16px; background: #fff; outline: none; }
.rich-area .content:focus { border-color: var(--bud); }
.img-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); padding: 6px 0; }
.mini { min-height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--field); background: #fff; font-size: 13px; cursor: pointer; color: var(--pine); }
.mini.active { background: var(--pine); color: #fff; border-color: var(--pine); }
.mini:disabled { opacity: .4; cursor: default; }
.content { font-size: 15px; line-height: 1.55; color: #24372A; overflow-wrap: anywhere; }
.content > :first-child { margin-top: 0; } .content > :last-child { margin-bottom: 0; }
.content p { margin: 0 0 8px; }
.content h3 { font: 700 17px var(--body); margin: 10px 0 6px; } .content h4 { font: 700 15px var(--body); margin: 8px 0 4px; }
.content ul, .content ol { padding-left: 22px; margin: 4px 0 8px; }
.content blockquote { margin: 6px 0; padding: 6px 12px; border-left: 3px solid var(--bud); background: #F6FAF3; }
.content table { border-collapse: collapse; margin: 6px 0; }
.content th, .content td { border: 1px solid var(--field); padding: 6px 12px; min-width: 60px; vertical-align: top; }
.content th { background: var(--sage-2); text-align: left; }
.content th p, .content td p { margin: 0; }
.content img { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 6px 0; }
.content img[data-width="25"] { width: 25%; } .content img[data-width="50"] { width: 50%; }
.content img.ProseMirror-selectednode { outline: 3px solid var(--bud); }
.content hr { border: 0; border-top: 1px solid var(--line); }
.tasks { margin-top: 10px; }
.task { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; padding: 8px 10px; border-radius: var(--radius); background: #F6FAF3; margin-bottom: 6px; }
.task form { margin: 0; }
.task-check { width: 26px; height: 26px; border-radius: 6px; border: 2px solid var(--garden); background: #fff; color: #fff; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.task-check.on { background: var(--garden); }
.task-text { flex: 1 1 260px; font-weight: 600; font-size: 15px; }
.task.is-done .task-text { text-decoration: line-through; color: var(--muted); }
.task-meta { font-size: 14px; color: var(--deep); }
.task-edit { flex-basis: 100%; }
.task-edit[open] { display: block; }
.task-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.task-form input { flex: 1 1 180px; width: auto; min-height: 40px; }
details.add > summary { cursor: pointer; color: var(--link); font-weight: 700; font-size: 14px; min-height: 36px; display: inline-flex; align-items: center; list-style: none; }
details.add > summary::-webkit-details-marker { display: none; }
details.add-point, details.add-sub { margin-top: 10px; }
details.add-sub > summary { width: 100%; justify-content: center; min-height: 44px; border: 1.5px dashed #8DB37E; border-radius: var(--radius); margin-top: 14px; }
details.add[open] > summary { margin-bottom: 8px; }
.hint-box { background: var(--sage-2); border: 1px solid #C5DABB; border-radius: 14px; padding: 18px 22px; font-size: 14px; margin-top: 20px; }
.hint-box h2 { font-size: 17px; margin: 0 0 8px; } .hint-box p { margin: 0; }
.danger-zone { margin-top: 28px; font-size: 14px; }
.danger-zone > summary { cursor: pointer; color: var(--danger); font-weight: 700; }
.danger-zone form { margin-top: 10px; }

/* Umbenennen eines Unter-TOPs: Formular als Aufklapp-Feld unter der Überschrift statt mitten in der Werkzeugleiste */
.sub-head { position: relative; }
.tools .inline-details { position: static; }
.tools .inline-details[open] > form { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5; margin: 0; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(31,77,43,.14); }

/* Ungespeicherte Änderungen: Speichern-Leiste bleibt am unteren Rand sichtbar */
.point-form.dirty > .right { position: sticky; bottom: 0; z-index: 3; padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(rgba(255,255,255,0), #fff 35%); }
.point-form.dirty > .right::before { content: "Ungespeicherte Änderungen"; font-size: 13px; color: var(--warn); font-weight: 700; margin-right: 12px; }

/* Aufgaben auf der Übersicht: direkt abhaken */
.task-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.task-row form { margin: 0; padding-top: 10px; }
.task-row .dot { margin-top: 18px; }
.task-row .task-tile { flex: 1; margin-bottom: 0; }

/* Touch-Geräte (iPad, Tablets, Smartphones): Tippflächen mind. 44 × 44 px */
button, summary, .btn, .chip, .nav a, .list-nav a, .task-tile, .check-tile, label { touch-action: manipulation; -webkit-tap-highlight-color: rgba(78, 139, 58, .18); }
.task-check, .switch { position: relative; }
.task-check::after, .switch::after { content: ""; position: absolute; inset: -9px; }
@media (pointer: coarse) {
  .btn-sm, .inline-form input, .inline-form select, .row-form input, .row-form select, .task-form input, .title-input { min-height: 44px; }
  .icon-btn.sm { width: 44px; height: 44px; }
  .chip { min-height: 44px; }
  .status-btn { min-height: 44px; padding: 0 16px; }
  .task-check { width: 32px; height: 32px; }
  .task-check::after { inset: -6px; }
  .tb-btn { min-width: 44px; height: 44px; }
  .toolbar select { min-height: 44px; font-size: 16px; }
  .mini { min-height: 44px; padding: 0 14px; font-size: 15px; }
  details.add > summary { min-height: 44px; }
  .check-tile { padding: 12px 14px; }
  .check-tile input, .check-row input { width: 24px; height: 24px; }
  .check-row { min-height: 44px; }
  .tools { gap: 6px; }
  .rich-area .content { min-height: 140px; }
  .btn { min-width: 44px; }
  .me-name { min-height: 44px; display: flex; flex-direction: column; justify-content: center; }
  .table td > a, .stat-sub a, .back-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
  .danger-zone > summary { padding: 12px 0; }
}
/* Hover-Effekte nur bei echter Maus – verhindert „klebende“ Hover-Farben nach dem Antippen */
@media (hover: none) {
  .btn:hover { background: #fff; }
  .btn-primary:hover { background: var(--garden); }
  .nav a:not(.active):hover { background: transparent; color: var(--sage); }
  .me .icon-btn:hover { background: transparent; }
  .task-tile:hover { background: #F6FAF3; }
}
/* Tablet hochkant (z. B. iPad 768–899 px): Navigation kompakt als Leiste oben */
@media (max-width: 899px) {
  .side { flex-basis: 100%; padding: 14px 16px; gap: 14px; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .nav-label { flex-basis: 100%; margin: 6px 4px 0; }
  .me { margin-top: 0; }
}
@media (min-width: 900px) { .side { height: 100dvh; min-height: 100dvh; } }

/* ---------- Smartphones (iPhone / Android) ---------- */
@media (max-width: 640px) {
  /* Kopfzeile mit Menü statt großer Navigationsfläche */
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px)) 10px calc(12px + env(safe-area-inset-left, 0px)); }
  .brand { padding: 0; gap: 10px; min-height: 44px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 10px; }
  .brand-mark svg { width: 30px; height: 30px; }
  .brand-name { font-size: 17px; } .brand-sub { font-size: 12px; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1.5px solid #4E7A55; border-radius: var(--radius); background: transparent; color: #fff; font-weight: 700; cursor: pointer; }
  .side.nav-open .menu-toggle { background: var(--garden); border-color: var(--garden); }
  .nav-panel { display: none; flex-basis: 100%; gap: 12px; }
  .side.nav-open .nav-panel { display: flex; }
  .nav { flex-direction: column; gap: 2px; }
  .nav-label { margin: 8px 14px 2px; }

  /* Anmeldung: nur Logo-Kopf, Formular sofort sichtbar */
  .auth-shell { align-content: flex-start; }
  .auth-aside { flex-basis: 100%; padding: calc(16px + env(safe-area-inset-top, 0px)) 20px 16px; gap: 0; }
  .auth-aside .auth-claim, .auth-aside .auth-note { display: none; }
  .brand-mark.lg { width: 48px; height: 48px; border-radius: 12px; }
  .brand-mark.lg svg { width: 38px; height: 38px; }
  .brand-name.lg { font-size: 21px; } .brand-sub.lg { font-size: 13px; }
  .auth-main { padding: 20px 12px calc(32px + env(safe-area-inset-bottom, 0px)); align-items: flex-start; }
  .auth-card { padding: 24px 18px; border-radius: 14px; }
  .auth-card h2 { font-size: 24px; }

  /* Mehr Platz für Inhalte */
  .main { padding: 16px calc(12px + env(safe-area-inset-right, 0px)) calc(40px + env(safe-area-inset-bottom, 0px)) calc(12px + env(safe-area-inset-left, 0px)); }
  h1 { font-size: 24px; } h2 { font-size: 20px; }
  .card { padding: 16px 14px; border-radius: 12px; margin-bottom: 14px; }
  .page-head { margin-bottom: 14px; gap: 12px; }
  .page-head > .actions, .section-head > .actions { width: 100%; }
  .page-head > .actions > *, .section-head > .actions > * { flex: 1 1 auto; }
  .page-head > .actions .btn, .section-head > .actions .btn { width: 100%; }
  .page-head > .btn { width: 100%; }
  .section-head { margin: 22px 0 10px; }
  .section-head h2 { font-size: 21px; }
  .main-top > summary { padding: 12px 14px; gap: 8px; }
  .main-title { font-size: 18px; }
  .main-info { margin-left: 0; flex-basis: 100%; font-size: 13px; }
  .main-body { padding: 2px 12px 14px; }
  .sub-head h3 { font-size: 17px; }
  .point { padding: 10px 10px 10px 12px; }
  .point-head .tools { margin-left: auto; }
  .content ul, .content ol { padding-left: 20px; }
  .hint-box { padding: 14px 16px; }

  /* Übersicht: Aufgaben zuerst, kompakte Kennzahlen */
  .cols { gap: 14px; }
  .col-side.my-tasks { order: -1; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
  .stat { padding: 12px 14px; border-radius: 12px; }
  .stat:first-child { grid-column: 1 / -1; }
  .stat-value { font-size: 26px; } .stat-value.sm { font-size: 19px; }
  .card-head .inline-form { display: grid; grid-template-columns: auto minmax(0, 1fr); width: 100%; gap: 8px 10px; }
  .card-head .inline-form select { width: 100%; }

  /* Tabellen werden zu Karten */
  .table-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; background: #fff; }
  .table-cards td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; }
  .table-cards td[data-label]::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
  .table-cards td.card-title, .table-cards td.card-full, .table-cards td:has(form.row-form, details, code) { display: block; }
  .table-cards td:has(form.row-form, details, code)[data-label]::before { display: block; margin-bottom: 4px; }
  .table-cards td.card-title { font-size: 16px; padding-top: 6px; }
  .table-cards td.card-action a { width: 100%; border: 1.5px solid var(--field); border-radius: var(--radius); font-weight: 700; text-decoration: none; }
  .table-cards code { word-break: break-all; }
  .row-form input, .row-form select { flex: 1 1 100%; }
  .row-form .num { flex: 1 1 100%; }

  /* Editor: Werkzeugleiste einzeilig zum Wischen, bleibt beim Schreiben oben */
  .toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar > * { flex: none; }
  .tb-ok { display: none; }
  .point-form.dirty > .right::before { display: block; margin: 0 0 6px; text-align: left; }
  .point-form.dirty [data-save] { width: 100%; min-height: 48px; font-size: 16px; }
  .task-text { flex-basis: 100%; }
}

@media print {
  .side, .actions, .tools, .toolbar, details.add, .hint-box, .danger-zone { display: none !important; }
  .main { padding: 0; } .card, .main-top { border: 0; }
}
