/* Portal Genossenschaft Hoch-Etzel – Designsystem
 * Werte aus der Webseite / CMS V1.33 übernommen (Waldgrün, Creme, Sand, Erde).
 * Keine externen Abhängigkeiten. Schriften selbst ausgeliefert (OFL).
 */
@font-face { font-family: "Inter"; src: url("../fonts/inter-var.woff") format("woff"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("../fonts/playfair-var.woff") format("woff"); font-weight: 400 900; font-display: swap; }

:root {
  --forest: #245b3a;
  --forest-dark: #183d28;
  --forest-deep: #173d29;
  --forest-light: #4f7a5c;
  --meadow: #8aa66a;
  --cream: #faf7ef;
  --cream-2: #f7f3e8;
  --card: #fffdf8;
  --sand: #eadfca;
  --sand-2: #d8cbb5;
  --earth: #8c5930;
  --sunset: #c7743a;
  --danger: #a33b32;
  --danger-bg: #fbecea;
  --warn: #8a5a00;
  --warn-bg: #fdf3dc;
  --ok-bg: #eef6eb;
  --info-bg: #eaf2f5;
  --text: #183d28;
  --text-2: #4d5a4f;
  --muted: #6d705f;
  --ring: 0 0 0 3px rgba(36, 91, 58, .35);
  --radius: 10px;
  --radius-lg: 18px;
  --shadow: 0 10px 30px rgba(24, 68, 43, .08);
  --shadow-sm: 0 2px 8px rgba(24, 68, 43, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sidebar: 264px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--cream-2); font-feature-settings: "tnum" 0; }
img, svg { vertical-align: middle; }
a { color: var(--forest); text-underline-offset: 2px; }
a:hover { color: var(--forest-dark); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; color: var(--forest-dark); }
h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
h2 { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1em; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--forest); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
.icon { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 1.6em; height: 1.6em; }

/* ---------- Grundlayout Verwaltung ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--forest-deep); color: #fff; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 6px 10px 18px; }
.brand-mark { display: inline-flex; width: 36px; height: 36px; border-radius: 12px; background: rgba(255,255,255,.14); align-items: center; justify-content: center; }
.brand-text { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; line-height: 1.1; }
.brand-text small { display: block; font-family: var(--font); font-size: .72rem; font-weight: 500; opacity: .75; letter-spacing: .04em; text-transform: uppercase; }
.nav-section { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; opacity: .55; padding: 14px 12px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.82); text-decoration: none; padding: 9px 12px; border-radius: 10px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.active { background: rgba(255,255,255,.14); color: #fff; }
.nav a .count { margin-left: auto; background: var(--sunset); color: #fff; border-radius: 99px; font-size: .72rem; padding: 1px 8px; font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 12px; font-size: .75rem; opacity: .6; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(250,247,239,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--sand); position: sticky; top: 0; z-index: 20; }
.topbar .search-trigger { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--sand-2); border-radius: 12px; padding: 8px 12px; color: var(--muted); cursor: pointer; font: inherit; text-align: left; }
.topbar .search-trigger kbd { margin-left: auto; }
.topbar .spacer { flex: 1; }
.menu-toggle { display: none; background: none; border: 0; padding: 6px; color: var(--forest-dark); cursor: pointer; }
.user-chip { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); padding: 4px 8px; border-radius: 10px; }
.user-chip:hover { background: var(--sand); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--forest); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .85rem; }
.bell { position: relative; color: var(--forest-dark); padding: 6px; border-radius: 10px; display: inline-flex; }
.bell:hover { background: var(--sand); }
.bell .dot { position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; background: var(--sunset); border-radius: 50%; border: 2px solid var(--cream); }
.content { padding: 24px 28px 48px; max-width: 1320px; width: 100%; }
kbd { font-family: var(--font); font-size: .72rem; border: 1px solid var(--sand-2); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--cream); color: var(--muted); }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin-bottom: 20px; }
.page-head .titles { flex: 1; min-width: 240px; }
.page-head h1 { margin: 0; }
.page-head .lead { color: var(--text-2); margin: 4px 0 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumbs { font-size: .82rem; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--forest); text-decoration: underline; }

/* ---------- Karten, Raster ---------- */
.card { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; border: 1px solid rgba(234,223,202,.7); }
.card > h2:first-child, .card > h3:first-child, .card-head { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 18px 22px 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }

.kpi { background: var(--card); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); border: 1px solid rgba(234,223,202,.8); text-decoration: none; color: inherit; display: block; }
a.kpi:hover { border-color: var(--forest-light); }
.kpi .label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.kpi .value { font-size: 1.7rem; font-weight: 650; color: var(--forest-dark); font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 4px; }
.kpi .hint { font-size: .8rem; color: var(--text-2); margin-top: 2px; }

.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list li + li { border-top: 1px solid var(--sand); }
.todo-list a { display: flex; gap: 12px; align-items: center; padding: 12px 4px; text-decoration: none; color: var(--text); }
.todo-list a:hover { background: var(--cream); }
.todo-list .what { flex: 1; min-width: 0; }
.todo-list .what strong { display: block; font-weight: 600; }
.todo-list .what span { color: var(--muted); font-size: .85rem; }
.todo-icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--ok-bg); color: var(--forest); flex: none; }
.todo-icon.warn { background: var(--warn-bg); color: var(--warn); }
.todo-icon.danger { background: var(--danger-bg); color: var(--danger); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: var(--radius); border: 1px solid transparent; background: var(--forest); color: #fff; font: inherit; font-weight: 600; font-size: .92rem; text-decoration: none; cursor: pointer; line-height: 1.2; min-height: 40px; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--forest-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--forest-dark); border-color: var(--sand-2); }
.btn-secondary:hover { background: var(--cream); color: var(--forest-dark); border-color: var(--forest-light); }
.btn-earth { background: var(--earth); }
.btn-earth:hover { background: #6f4524; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #82291f; }
.btn-ghost { background: transparent; color: var(--forest); border-color: transparent; }
.btn-ghost:hover { background: var(--sand); color: var(--forest-dark); }
.btn-sm { padding: 5px 10px; min-height: 32px; font-size: .84rem; }
.btn-lg { padding: 13px 22px; font-size: 1.02rem; min-height: 50px; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.inline { display: inline; }

/* ---------- Formulare ---------- */
.form { display: grid; gap: 16px; }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.field { display: grid; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: .9rem; }
.field .help { font-size: .82rem; color: var(--muted); }
.field .error { font-size: .84rem; color: var(--danger); font-weight: 500; }
.req::after { content: " *"; color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=tel], input[type=search], input[type=url], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--sand-2); border-radius: var(--radius); background: #fff; color: var(--text); font: inherit; font-size: .95rem; min-height: 42px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--forest); box-shadow: var(--ring); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--forest); flex: none; }
.radio-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.radio-card { border: 1px solid var(--sand-2); border-radius: var(--radius-lg); padding: 14px 16px; background: #fff; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; }
.radio-card:has(input:checked) { border-color: var(--forest); box-shadow: var(--ring); background: var(--ok-bg); }
.radio-card input { accent-color: var(--forest); width: 18px; height: 18px; margin-top: 3px; }
.radio-card strong { display: block; }
.radio-card span { font-size: .85rem; color: var(--text-2); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 650; margin-bottom: 8px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding-top: 6px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .field { min-width: 160px; }
.filters .grow { flex: 1; min-width: 220px; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--sand); background: var(--cream); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--sand); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fffaf0; }
.table a.rowlink { font-weight: 600; text-decoration: none; }
.table a.rowlink:hover { text-decoration: underline; }
.card.flush .table th:first-child, .card.flush .table td:first-child { padding-left: 22px; }
.dl { display: grid; grid-template-columns: minmax(130px, 34%) 1fr; gap: 8px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: .88rem; }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* ---------- Badges, Hinweise ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; font-size: .76rem; font-weight: 600; background: var(--sand); color: var(--forest-dark); white-space: nowrap; }
.badge-green { background: var(--ok-bg); color: var(--forest); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-blue { background: var(--info-bg); color: #2f5d6e; }
.badge-grey { background: #eee9de; color: var(--muted); }
.badge-earth { background: #f3e6d9; color: var(--earth); }
.alert { padding: 13px 16px; border-radius: var(--radius); margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid transparent; }
.alert .icon { margin-top: 2px; }
.alert-ok { background: var(--ok-bg); border-color: #cfe3c8; }
.alert-warn { background: var(--warn-bg); border-color: #f0dcae; }
.alert-danger { background: var(--danger-bg); border-color: #efc9c4; }
.alert-info { background: var(--info-bg); border-color: #cfe0e7; }
.alert p:last-child { margin-bottom: 0; }
.ai-draft { border-left: 3px solid var(--sunset); }
.empty { text-align: center; padding: 36px 20px; color: var(--text-2); }
.empty .icon { width: 40px; height: 40px; color: var(--meadow); margin-bottom: 8px; }
.empty h3 { margin-bottom: 4px; }

/* ---------- Schritte (Assistent) ---------- */
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 22px; counter-reset: s; flex-wrap: wrap; }
.steps li { flex: 1; min-width: 120px; padding: 10px 12px 10px 42px; border-radius: 12px; background: #fff; border: 1px solid var(--sand); position: relative; font-size: .86rem; font-weight: 600; color: var(--muted); counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; background: var(--sand); color: var(--forest-dark); display: flex; align-items: center; justify-content: center; font-size: .78rem; }
.steps li.done { color: var(--forest); }
.steps li.done::before { content: "✓"; background: var(--forest); color: #fff; }
.steps li.current { border-color: var(--forest); color: var(--forest-dark); box-shadow: var(--ring); }
.steps li.current::before { background: var(--forest); color: #fff; }

/* ---------- Zusammenfassung vor Versand/Freigabe ---------- */
.summary-box { background: var(--cream); border: 1px dashed var(--sand-2); border-radius: var(--radius-lg); padding: 16px 18px; }
.summary-box h3 { margin-bottom: 8px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--sand); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--text-2); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--forest-dark); border-color: var(--forest); }
.tabs a:hover { color: var(--forest); }

/* ---------- Dialog / Befehlspalette ---------- */
dialog { border: 0; border-radius: var(--radius-lg); box-shadow: 0 30px 80px rgba(0,0,0,.25); padding: 0; max-width: min(640px, calc(100vw - 24px)); width: 100%; color: var(--text); }
dialog::backdrop { background: rgba(23, 61, 41, .35); backdrop-filter: blur(2px); }
.dialog-body { padding: 22px; }
.dialog-foot { padding: 14px 22px; background: var(--cream); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.palette input { border: 0; border-bottom: 1px solid var(--sand); border-radius: 0; font-size: 1.05rem; padding: 16px 20px; min-height: 56px; }
.palette input:focus { box-shadow: none; }
.palette-results { max-height: 60vh; overflow-y: auto; list-style: none; margin: 0; padding: 6px; }
.palette-results a { display: flex; gap: 12px; padding: 10px 14px; border-radius: 10px; text-decoration: none; color: var(--text); align-items: center; }
.palette-results a:hover, .palette-results a.sel { background: var(--ok-bg); }
.palette-results small { color: var(--muted); margin-left: auto; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.pagination a, .pagination span { padding: 6px 12px; border-radius: 8px; text-decoration: none; border: 1px solid var(--sand); background: #fff; font-size: .88rem; }
.pagination .current { background: var(--forest); color: #fff; border-color: var(--forest); }
.pagination .disabled { color: var(--muted); opacity: .6; }

/* ---------- Mitgliederportal ---------- */
.portal-body { background: var(--cream); font-size: 17px; }
.portal-header { background: var(--forest-deep); color: #fff; }
.portal-header .inner { max-width: 960px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 16px; }
.portal-header .brand { padding: 0; }
.portal-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.portal-nav a { color: rgba(255,255,255,.88); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 500; font-size: .95rem; }
.portal-nav a:hover, .portal-nav a.active { background: rgba(255,255,255,.14); color: #fff; }
.portal-hero { background: linear-gradient(180deg, var(--forest-deep), var(--forest)); color: #fff; padding: 26px 20px 60px; }
.portal-hero .inner { max-width: 960px; margin: 0 auto; }
.portal-hero h1 { color: #fff; }
.portal-hero p { color: rgba(255,255,255,.85); margin: 0; }
.portal-main { max-width: 960px; margin: -36px auto 0; padding: 0 20px 60px; }
.portal-main.plain { margin-top: 28px; }
.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 20px; }
.tile { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 6px; border: 1px solid rgba(234,223,202,.8); }
.tile:hover { border-color: var(--forest-light); }
.tile .icon { width: 28px; height: 28px; color: var(--forest); }
.tile strong { font-size: 1.05rem; }
.tile span { color: var(--text-2); font-size: .92rem; }
.portal-body .btn { min-height: 46px; font-size: 1rem; }
.portal-footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px 20px 40px; }
.portal-footer a { color: var(--muted); }

/* ---------- Gast / Anmeldung ---------- */
.guest { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 500px at 20% -10%, #2f6b47 0%, transparent 60%), linear-gradient(160deg, var(--forest-deep), #24533a 60%, #3c6a49); }
.guest-card { width: 100%; max-width: 440px; background: var(--card); border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.25); padding: 30px; }
.guest-card.wide { max-width: 760px; }
.guest-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; color: var(--forest-dark); }
.guest-brand .brand-mark { background: var(--forest); color: #fff; }
.guest-brand .brand-text small { color: var(--muted); }
.guest-foot { color: rgba(255,255,255,.7); font-size: .82rem; margin-top: 16px; text-align: center; }
.guest-foot a { color: rgba(255,255,255,.85); }
.code-input { font-size: 1.6rem !important; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- Hilfe ---------- */
.help-body h2 { margin-top: 1.4em; }
.help-body img, .help-body svg.flow { max-width: 100%; }
.flow { width: 100%; height: auto; }
.flow .box { fill: #fff; stroke: var(--forest); stroke-width: 1.5; }
.flow .box.alt { fill: var(--ok-bg); }
.flow .box.warn { fill: var(--warn-bg); stroke: var(--earth); }
.flow text { font-family: var(--font); font-size: 13px; fill: var(--forest-dark); }
.flow .arrow { stroke: var(--forest-light); stroke-width: 1.6; fill: none; marker-end: url(#arr); }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }

/* ---------- Druck ---------- */
@media print {
  .sidebar, .topbar, .page-head .actions, .no-print { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  body { background: #fff; }
}

/* ---------- Responsiv ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 10px 14px; }
  .topbar .search-trigger kbd { display: none; }
  .content { padding: 18px 14px 40px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .user-chip .name { display: none; }
}
@media (max-width: 640px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .card { padding: 16px; border-radius: 14px; }
  /* Tabellen als Karten */
  table.responsive thead { display: none; }
  table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { display: block; width: 100%; }
  table.responsive tr { border-bottom: 1px solid var(--sand); padding: 10px 0; }
  table.responsive td { border: 0; padding: 3px 16px; }
  table.responsive td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 8px; }
  .portal-header .inner { flex-wrap: wrap; }
  .portal-nav { margin-left: 0; width: 100%; }
  .steps li { min-width: 0; padding-left: 38px; font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Editor, Dropzone, Check-in */
.editor { min-height: 420px; border: 1px solid var(--sand-2); border-radius: var(--radius); padding: 16px 18px; background: #fff; line-height: 1.6; }
.editor:focus { outline: none; border-color: var(--forest); box-shadow: var(--ring); }
.editor h2, .editor h3 { font-family: var(--font); }
.editor-toolbar { gap: 4px; }
.dropzone { border: 2px dashed var(--sand-2); border-radius: var(--radius-lg); padding: 22px; text-align: center; background: var(--cream); cursor: pointer; display: block; }
.dropzone.drag { border-color: var(--forest); background: var(--ok-bg); }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
#checkin-list li.checked strong { color: var(--forest); }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.folder-tree { list-style: none; margin: 0; padding: 0; }
.folder-tree ul { list-style: none; margin: 0; padding-left: 16px; }
.folder-tree a { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: .92rem; }
.folder-tree a:hover { background: var(--cream); }
.folder-tree a.active { background: var(--ok-bg); color: var(--forest-dark); font-weight: 600; }
.preview-frame { width: 100%; height: 75vh; border: 1px solid var(--sand); border-radius: var(--radius); background: #fff; }
.thumb { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--sand); }
.matrix .yes { color: var(--forest); font-weight: 700; }
.matrix .no { color: var(--sand-2); }

/* Feinschliff */
.topbar .search-trigger span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (min-width: 901px) { .shell { background: linear-gradient(to right, var(--forest-deep) var(--sidebar), transparent var(--sidebar)); } }
@media (max-width: 640px) {
  table.responsive td[data-label] { display: grid; grid-template-columns: 96px 1fr; gap: 10px; text-align: left; padding: 2px 16px; }
  table.responsive td[data-label]::before { display: block; padding-top: 2px; }
  table.responsive td[data-label]:empty { display: none; }
  table.responsive tr { padding: 12px 0; }
  .filters .field { min-width: 0; flex: 1 1 45%; }
  .page-head .actions .btn { flex: 1 1 auto; }
  .portal-hero { padding-bottom: 50px; }
}
