/* marinos welt – Design B „Feldnotizen“
   Schriften liegen lokal (keine Verbindung zu Google). Mobil zuerst, Stufen: 600 · 900 · 1280 · 1600 px. */

@font-face { font-family: "Fraunces"; src: url("fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("fonts/caveat.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --paper: #F6F1E7; --linen: #ECE4D4; --card: #FFFFFF; --line: #D9CBB0;
  --ink: #2A2925; --muted: #5E5A52;
  --green: #2F5D50; --green-hover: #24493F; --on-green: #FFFFFF; --green-soft: #DCE5DD;
  --ochre: #C7772A; --ochre-ink: #8A4E14; --sage: #A8B89E;
  --danger: #A3271B; --danger-soft: #F6DCD7; --ok: #2F5D50; --ok-soft: #DCE5DD;
  --shadow: 0 10px 30px rgba(42, 41, 37, .12);
  --radius: 16px; --radius-sm: 10px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hand: "Caveat", "Bradley Hand", cursive;
  --wrap: 1200px; --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1C1F1C; --linen: #252A26; --card: #2B312C; --line: #3C443D;
    --ink: #EDE7DA; --muted: #B9B2A3;
    --green: #8CC2AE; --green-hover: #A6D3C2; --on-green: #12201B; --green-soft: #2E3D36;
    --ochre: #E0A15E; --ochre-ink: #E8B57C; --sage: #5F7056;
    --danger: #F2A196; --danger-soft: #4A2A25; --ok: #8CC2AE; --ok-soft: #2E3D36;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1C1F1C; --linen: #252A26; --card: #2B312C; --line: #3C443D;
  --ink: #EDE7DA; --muted: #B9B2A3;
  --green: #8CC2AE; --green-hover: #A6D3C2; --on-green: #12201B; --green-soft: #2E3D36;
  --ochre: #E0A15E; --ochre-ink: #E8B57C; --sage: #5F7056;
  --danger: #F2A196; --danger-soft: #4A2A25; --ok: #8CC2AE; --ok-soft: #2E3D36;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
@media (min-width: 1600px) { :root { --wrap: 1360px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: clamp(16px, 0.95rem + 0.2vw, 18px); line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--green-hover); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--green); color: var(--on-green); padding: 10px 16px; border-radius: var(--radius-sm); }
.skip:focus { top: 8px; }
.hand { font-family: var(--hand); font-weight: 600; color: var(--ochre-ink); line-height: 1.2; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.ico { flex: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------------------------------------------------------------- Knöpfe und Formulare */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 2px solid var(--green); background: var(--green); color: var(--on-green);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--green-hover); border-color: var(--green-hover); color: var(--on-green); }
.btn-outline { background: transparent; color: var(--green); }
.btn-outline:hover { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.btn-quiet { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-quiet:hover { background: var(--linen); color: var(--ink); border-color: var(--line); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: .95em; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; padding: 0;
}
.icon-btn:hover { background: var(--linen); }
.icon-btn[disabled] { opacity: .35; cursor: default; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 500; font-size: .95em; }
.field small { color: var(--muted); }
.input, select.input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit;
}
.input:focus { border-color: var(--green); outline: 3px solid var(--green-soft); outline-offset: 0; }
.input-code { font-size: 1.6em; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
.form { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); align-items: end; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 24px; height: 24px; accent-color: var(--green); }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-weight: 500; }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-info { background: var(--linen); color: var(--ink); }
.toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40;
  max-width: min(92vw, 520px); padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--paper);
  box-shadow: var(--shadow); font-weight: 500;
}
@media (min-width: 900px) { .toast { bottom: 24px; } }
.toast-fehler { display: flex; align-items: flex-start; gap: 12px; background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); }
.toast-zu { flex: none; min-width: 32px; min-height: 32px; margin: -6px -10px -6px 0; border: 0; background: transparent; color: inherit; font-size: 22px; line-height: 1; cursor: pointer; border-radius: 8px; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .8em; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--linen); color: var(--ink); white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--danger-soft); color: var(--danger); }
.stamp { display: inline-block; font-size: .78em; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--green); border: 1.5px solid currentColor; border-radius: 4px; padding: 1px 8px; }

/* ---------------------------------------------------------------- Öffentlicher Teil */
.site-header { padding-block: clamp(16px, 3vw, 28px); }
.site-header .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: baseline; gap: 10px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: clamp(24px, 2.4vw, 30px); letter-spacing: -0.02em; }
.brand-note { font-family: var(--hand); font-weight: 600; font-size: clamp(19px, 1.8vw, 23px); color: var(--ochre-ink); }
.site-nav { display: flex; flex-wrap: wrap; gap: 0 22px; font-weight: 500; }
.site-nav a { color: var(--ink); text-decoration: none; padding: 10px 0; display: inline-block; }
.site-nav a[aria-current="page"], .site-nav a:hover { color: var(--green); text-decoration: underline; }

.hero { padding-block: clamp(24px, 5vw, 72px) clamp(48px, 7vw, 96px); }
.hero .wrap { display: flex; flex-wrap: wrap; gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero-text { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: clamp(16px, 2vw, 24px); }
.hero-text h1 { font-size: clamp(36px, 2rem + 3.2vw, 72px); line-height: 1.06; letter-spacing: -0.02em; }
.hero-text .lead { font-size: clamp(18px, 1rem + .4vw, 21px); color: var(--muted); max-width: 34em; }
.hero-text .hand { font-size: clamp(22px, 1.2rem + .6vw, 28px); color: var(--green); }
.hero-photo { flex: 1 1 340px; min-width: 0; display: flex; justify-content: center; }
.polaroid {
  position: relative; margin: 0; width: 100%; max-width: 460px; background: #FFFFFF; padding: 14px 14px 18px;
  box-shadow: var(--shadow); transform: rotate(2deg);
}
.polaroid::before {
  content: ""; position: absolute; top: -14px; left: 50%; width: 110px; height: 30px; margin-left: -55px;
  background: rgba(199, 119, 42, .35); transform: rotate(-3deg);
}
.polaroid-img { aspect-ratio: 4 / 5; background: var(--sage); display: flex; align-items: center; justify-content: center; color: #2A2925; }
.polaroid-img svg { width: 38%; height: auto; color: #2A2925; opacity: .55; }
.polaroid figcaption { font-family: var(--hand); font-weight: 600; font-size: 24px; color: #2A2925; text-align: center; padding-top: 10px; }

.section { padding-block: clamp(48px, 7vw, 88px); }
.section-alt { background: var(--linen); }
.section h2 { font-size: clamp(28px, 1.4rem + 1.4vw, 40px); }
.section-head { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; justify-content: space-between; margin-bottom: clamp(20px, 3vw, 32px); }
.cards { display: grid; gap: clamp(16px, 2.4vw, 28px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.card { background: var(--card); border-radius: var(--radius); padding: clamp(20px, 2.4vw, 28px); display: flex; flex-direction: column; gap: 12px; }
.section-alt .card { background: var(--paper); }
.card h3 { font-size: clamp(21px, 1.1rem + .5vw, 25px); }
.card .ico { color: var(--green); }

.prose { max-width: 720px; display: flex; flex-direction: column; gap: 16px; }
/* Lange Wörter und Adressen umbrechen statt die Seite zu verbreitern (auch im Privatbereich) */
main :is(p, li, h1, h2, h3, h4, blockquote, figcaption, dd, dt, label, .hand) { overflow-wrap: anywhere; }
main td, main th { overflow-wrap: break-word; }
.prose pre { overflow-x: auto; max-width: 100%; }
.prose table { display: block; overflow-x: auto; max-width: 100%; }
.prose h1 { font-size: clamp(32px, 1.6rem + 2vw, 48px); margin-bottom: 8px; }
.prose h2 { font-size: clamp(22px, 1.1rem + .8vw, 28px); margin-top: 16px; }
.prose ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose address { font-style: normal; }
.note-draft { border: 1.5px dashed var(--ochre); border-radius: var(--radius-sm); padding: 12px 16px; }

.site-footer { border-top: 1px solid var(--line); margin-top: auto; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 32px; justify-content: space-between; padding-block: 28px; color: var(--muted); font-size: .95em; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 24px; }
.site-footer a { color: var(--muted); display: inline-block; padding: 8px 0; }
.page-public { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- Privatbereich */
.app { min-height: 100vh; min-height: 100dvh; }
.sidebar { display: none; }
.mobile-top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px; background: var(--paper); border-bottom: 1px solid var(--line);
}
.mobile-top .brand-name { font-size: 22px; }
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  background: var(--linen); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 500; }
.tabbar a[aria-current="page"] { color: var(--green); font-weight: 700; }
.tabbar-more { position: relative; }
.tabbar-more summary { list-style: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer; }
.tabbar-more summary::-webkit-details-marker { display: none; }
.tabbar-more summary[aria-current="page"], .tabbar-more[open] summary { color: var(--green); font-weight: 700; }
.tabbar-menu { position: absolute; right: 4px; bottom: calc(100% + 10px); min-width: 210px; display: flex; flex-direction: column; gap: 2px; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.tabbar .tabbar-menu a { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: 10px; font-size: 16px; color: var(--ink); }
.tabbar .tabbar-menu a:hover { background: var(--linen); }
.tabbar .tabbar-menu a[aria-current="page"] { color: var(--green); }
.main { padding: clamp(20px, 3vw, 40px) var(--gutter) calc(100px + env(safe-area-inset-bottom)); max-width: 1440px; }
.page-head { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: clamp(20px, 3vw, 32px); }
.page-head h1 { font-size: clamp(30px, 1.5rem + 1.6vw, 44px); }
.page-head .date { color: var(--muted); font-size: .95em; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
  .mobile-top, .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
    background: var(--linen); padding: 28px 18px;
  }
  .sidebar .brand { flex-direction: column; gap: 0; align-items: flex-start; }
  .sidebar .brand-note { font-family: var(--sans); font-size: 13px; color: var(--muted); font-weight: 500; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; }
  .side-nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; font-weight: 500; }
  .side-nav a:hover { background: var(--paper); }
  .side-nav a[aria-current="page"] { background: var(--green); color: var(--on-green); }
  .sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; font-size: .9em; color: var(--muted); }
  .main { padding-bottom: 48px; }
}
@media (min-width: 1280px) { .app { grid-template-columns: 272px minmax(0, 1fr); } .main { padding-inline: 48px; } }

.tile-grid { display: grid; gap: clamp(14px, 2vw, 20px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.tile { background: var(--card); border-radius: 18px; padding: clamp(18px, 2vw, 24px); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tile-wide { grid-column: 1 / -1; }
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tile-head h2 { font-size: 22px; }
.tile-head .muted { font-size: .85em; }
.tile-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tile-list li { display: flex; align-items: center; gap: 10px; }
.tile-list .ok { color: var(--ok); }
.tile-list .open { color: var(--ochre-ink); }
.tile-soft { background: var(--paper); border-radius: 12px; padding: 12px 14px; }
.roadmap { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.roadmap div { background: var(--paper); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: break-word; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--ok); flex: none; }
.dot-warn { background: var(--danger); }
meter, progress { width: 100%; height: 10px; }
meter::-webkit-meter-bar { background: var(--linen); border: 0; border-radius: 999px; height: 10px; }
meter::-webkit-meter-optimum-value { background: var(--green); border-radius: 999px; }
meter::-moz-meter-bar { background: var(--green); border-radius: 999px; }

.panel { background: var(--card); border-radius: 18px; padding: clamp(18px, 2.4vw, 28px); display: flex; flex-direction: column; gap: 16px; }
.panels { display: grid; gap: clamp(14px, 2vw, 20px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; }
.panel h2 { font-size: 24px; }
.qr { background: #FFFFFF; border-radius: 12px; padding: 10px; width: fit-content; max-width: 100%; }
.qr svg { display: block; width: 220px; height: auto; max-width: 100%; }
.secret { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1.05em; letter-spacing: .05em; overflow-wrap: anywhere; background: var(--paper); padding: 8px 12px; border-radius: 8px; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0; }
.codes li { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1.1em; background: var(--paper); border-radius: 8px; padding: 10px; text-align: center; }

/* Tabellen: ab 900 px als Tabelle, darunter als Karten */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .85em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1.5px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
@media (max-width: 899px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { background: var(--card); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
  .table td { border: 0; padding: 4px 0; }
  .table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .85em; }
}
.table-wrap { overflow-x: auto; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* Dashboard anpassen */
.sortable { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sortable li { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 14px; padding: 8px 10px; border: 1.5px solid transparent; }
.sortable li.is-dragging { border-color: var(--green); box-shadow: var(--shadow); opacity: .92; }
.sortable .drag { cursor: grab; touch-action: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; border: 0; background: transparent; }
.sortable .drag:active { cursor: grabbing; }
.sortable .grow { flex: 1; min-width: 0; }
.sortable .moves { display: flex; gap: 6px; }

/* Anmeldung */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px var(--gutter); }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border-radius: 22px; padding: clamp(24px, 5vw, 40px); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 20px; }
.auth-card h1 { font-size: clamp(26px, 1.4rem + 1vw, 32px); }
.theme-switch { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.theme-switch button { min-height: 38px; padding: 0 12px; border-radius: 999px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: .9em; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.theme-switch button[aria-pressed="true"] { background: var(--green); color: var(--on-green); }

@media print {
  .sidebar, .tabbar, .mobile-top, .btn, .skip { display: none !important; }
  body { background: #FFFFFF; color: #000000; }
}

.app-main { min-width: 0; }
.mobile-top form { margin: 0; }
.sidebar-foot form { margin: 0; }
.sidebar-foot .theme-switch { width: fit-content; }

/* Feinschliff nach Bildschirmfotos */
.stamp { align-self: flex-start; width: fit-content; }
.cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.site-footer .wrap { align-items: center; }
@media (max-width: 599px) { .polaroid { max-width: 300px; } }
@media (min-width: 900px) {
  .app { background: linear-gradient(to right, var(--linen) 248px, transparent 248px); }
}
@media (min-width: 1280px) {
  .app { background: linear-gradient(to right, var(--linen) 272px, transparent 272px); }
}
@media (max-width: 899px) { .panel .table tr { background: var(--paper); } }

/* ================================================================ Phase 3: Website */
.narrow { max-width: 820px; }
.small { font-size: .875em; }
.page-h1 { font-size: clamp(32px, 1.6rem + 2vw, 48px); }
.hero-h { font-size: clamp(30px, 1.5rem + 2.4vw, 56px); line-height: 1.08; }
.block-pad { padding-block: 8px 32px; }
.abstand-klein { height: 16px; } .abstand-mittel { height: 48px; } .abstand-gross { height: 96px; }
.preview-bar { position: sticky; top: 0; z-index: 30; background: var(--ochre); color: #2A2925; padding: 10px var(--gutter); text-align: center; font-size: .95em; }
.polaroid-foto { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.meta { color: var(--muted); font-size: .9em; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.meta a.stamp { text-decoration: none; }
.lead { font-size: clamp(18px, 1rem + .4vw, 21px); color: var(--muted); }

/* Blog */
.post-grid { display: grid; gap: clamp(16px, 2.4vw, 28px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.post-card { background: var(--card); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.section-alt .post-card { background: var(--paper); }
.post-card-img { display: block; aspect-ratio: 3 / 2; background: var(--sage); }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.post-card-title { font-size: 22px; }
.post-card-title a { color: var(--ink); text-decoration: none; }
.post-card-title a:hover { color: var(--green); text-decoration: underline; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.chips a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; background: var(--linen); color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95em; }
.chips a:hover { background: var(--green-soft); }
.chips a[aria-current="page"] { background: var(--green); color: var(--on-green); }
.search { display: flex; gap: 8px; width: 100%; max-width: 420px; }
.search .input { min-height: 44px; }
.article { margin-inline: auto; }
.article h1 { font-size: clamp(32px, 1.5rem + 2.6vw, 56px); }
.richtext { display: flex; flex-direction: column; gap: 18px; font-size: 1.05em; }
.richtext h2 { font-size: clamp(24px, 1.2rem + .8vw, 30px); margin-top: 18px; }
.richtext h3 { font-size: 22px; margin-top: 8px; }
.richtext ul, .richtext ol { margin: 0; padding-left: 24px; display: flex; flex-direction: column; gap: 6px; }
.richtext blockquote { margin: 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--ochre); font-family: var(--serif); font-size: 1.2em; }
.richtext img { max-width: 100%; height: auto; }
.richtext table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.richtext th, .richtext td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; }
.richtext pre { overflow-x: auto; background: var(--linen); padding: 12px; border-radius: 8px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border-top: 1px solid var(--line); padding-top: 24px; margin-top: 16px; }
.post-nav a { display: flex; flex-direction: column; text-decoration: none; font-weight: 600; }
.post-nav .next { text-align: right; }

/* Bilder und Galerie */
.bild { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.bild img { width: 100%; height: auto; border-radius: 12px; display: block; }
.bild figcaption { color: var(--muted); font-size: .9em; }
.bild-cover { margin-block: 24px; }
.bild-cover img { max-height: 70vh; object-fit: cover; }
.galerie { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(46%, 220px), 1fr)); }
.galerie a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: var(--linen); }
.galerie img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.galerie a:hover img { transform: scale(1.03); }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(20, 22, 20, .94); display: flex; align-items: center; justify-content: center; padding: 56px 12px; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lightbox img { max-width: 100%; max-height: calc(100dvh - 140px); object-fit: contain; border-radius: 6px; }
.lightbox figcaption { color: #EDE7DA; text-align: center; }
.lightbox button { position: absolute; background: rgba(255, 255, 255, .12); color: #FFFFFF; border: 0; width: 52px; height: 52px; border-radius: 50%; font-size: 30px; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: rgba(255, 255, 255, .24); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
html.lb-open { overflow: hidden; }

.zahlen { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); margin: 0; }
.zahlen div { background: var(--card); border-radius: var(--radius); padding: 20px; }
.section-alt .zahlen div { background: var(--paper); }
.zahlen dt { font-family: var(--serif); font-weight: 700; font-size: clamp(32px, 1.6rem + 1.6vw, 48px); color: var(--green); line-height: 1.1; }
.zahlen dd { margin: 4px 0 0; color: var(--muted); }
.zitat { margin: 0; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.zitat blockquote { margin: 0; font-family: var(--serif); font-size: clamp(24px, 1.2rem + 1.4vw, 36px); line-height: 1.3; }
.zitat blockquote::before { content: "„"; color: var(--ochre); }
.zitat blockquote::after { content: "“"; color: var(--ochre); }
.zitat figcaption { font-family: var(--hand); font-size: 24px; color: var(--ochre-ink); }

/* ---------------------------------------------------------------- Redaktion */
.subnav { display: flex; flex-wrap: wrap; gap: 4px; margin: -8px 0 20px; padding-bottom: 4px; } /* umbrechen statt abschneiden */
.subnav a { white-space: nowrap; padding: 8px 14px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 500; }
.subnav a:hover { background: var(--linen); }
.subnav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.subnav a:last-child { margin-left: auto; }
@media (max-width: 599px) { .subnav a { padding: 8px 10px; } .subnav a:last-child { margin-left: 0; } }
.subnav a:last-child:not([aria-current]) { color: var(--green); }
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.is-trashed { opacity: .6; }
.editor { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .editor { grid-template-columns: minmax(0, 1fr) 320px; } .editor-side { position: sticky; top: 20px; } }
.editor-main, .editor-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.editor-side .panel h2 { font-size: 20px; }
.input-title { font-family: var(--serif); font-size: 1.5em; font-weight: 600; }
.input-body { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .95em; line-height: 1.6; min-height: 420px; resize: vertical; }
.toolbar { display: flex; flex-wrap: wrap; gap: 4px; }
.toolbar[hidden] { display: none; }
.toolbar button { min-height: 40px; min-width: 44px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; font-size: .9em; cursor: pointer; }
.toolbar button:hover { background: var(--linen); }
.hilfe summary, .panel-soft summary, .block-fields summary { cursor: pointer; font-weight: 500; min-height: 44px; display: flex; align-items: center; }
.hilfe p { color: var(--muted); font-size: .9em; }
.panel-soft { background: var(--card); border-radius: 18px; padding: 8px 18px 18px; }
.btn-col { display: flex; flex-direction: column; gap: 8px; }
.danger-zone { margin-top: 20px; }
.hint { color: var(--ochre-ink); font-size: .85em; }

.pick { border: 0; padding: 0; margin: 0; min-width: 0; }
.pick legend { font-weight: 500; margin-bottom: 8px; padding: 0; }
.pick-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); max-height: 340px; overflow-y: auto; padding: 2px; }
.pick-item { position: relative; display: block; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--linen); cursor: pointer; aspect-ratio: 4 / 3; padding: 0; }
.pick-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-item input { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; accent-color: var(--green); }
.pick-item:has(input:checked), .pick-item.is-picked { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.pick-id { position: absolute; right: 4px; bottom: 4px; background: rgba(42, 41, 37, .75); color: #FFFFFF; font-size: 11px; padding: 1px 6px; border-radius: 6px; }
.pick-none { display: flex; align-items: center; justify-content: center; font-size: .85em; color: var(--muted); }
.pick-none input { position: static; margin-right: 6px; }

.blocks { counter-reset: block; }
.block-edit { flex-direction: column; align-items: stretch !important; padding: 8px 12px 12px !important; }
.block-head { display: flex; align-items: center; gap: 8px; }
.block-fields .form { padding-top: 8px; }
.add-blocks { border: 0; }
.add-blocks legend { font-family: var(--serif); font-size: 22px; font-weight: 600; float: left; width: 100%; margin-bottom: 12px; }
.add-grid { clear: both; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.add-btn { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 12px; min-height: 56px; border-radius: 12px; border: 1.5px dashed var(--line); background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.add-btn:hover { border-color: var(--green); background: var(--green-soft); }
.add-btn span { display: flex; flex-direction: column; }
.add-btn small { color: var(--muted); }
.add-btn .ico { color: var(--green); margin-top: 2px; }

.dropzone { align-items: flex-start; border: 2px dashed var(--line); margin-bottom: 20px; }
.dropzone.is-over { border-color: var(--green); background: var(--green-soft); }
.dropzone .ico { color: var(--green); }
.media-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.media-card { background: var(--card); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.media-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; height: auto; }

/* ---------------------------------------------------------------- Journal (0.3.0) */
.j-routines { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); margin-bottom: 28px; }
@media (min-width: 760px) { .j-routines { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.j-routine .tile-head h2 { display: flex; align-items: center; gap: 10px; }
.tile-head h2 .ico { color: var(--ochre-ink); }
.j-focus { font-family: var(--serif); font-size: clamp(20px, 1rem + .8vw, 26px); line-height: 1.3; margin: 0; overflow-wrap: anywhere; }
.j-focus .hand { display: block; font-size: 22px; color: var(--ochre-ink); line-height: 1; margin-bottom: 4px; }
.j-prios { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.j-prios li { display: flex; gap: 10px; align-items: flex-start; overflow-wrap: anywhere; }
.j-prios li .ico { flex: none; margin-top: 3px; color: var(--muted); }
.j-prios li.is-done .ico { color: var(--green); }
.j-prios li.is-done span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--green); }
.j-answer { margin: 0; overflow-wrap: anywhere; }
.j-answer strong { display: block; font-size: .85em; color: var(--muted); font-weight: 600; }
.j-body { max-width: none; gap: 10px; }
.j-free .section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.j-free .section-head h2 { font-size: 26px; }
.j-free { display: flex; flex-direction: column; gap: 16px; }
.j-entry-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.j-entry-head h3 { font-size: 22px; overflow-wrap: anywhere; }
.j-photos { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); }
.j-photos figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.j-photos img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); display: block; }
.j-photos figcaption { font-size: .85em; color: var(--muted); }
.j-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.j-tags a { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--linen); color: var(--ink); text-decoration: none; font-size: .9em; }

.j-form legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.j-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.j-prio-fields { display: flex; flex-direction: column; gap: 8px; }
.j-prio-input { display: flex; align-items: center; gap: 10px; }
.j-num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-weight: 700; font-family: var(--serif); }
.j-checks { display: flex; flex-direction: column; gap: 4px; }
.j-check span { overflow-wrap: anywhere; }
.j-mood-scale { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.j-mood-scale label { position: relative; cursor: pointer; }
.j-mood-scale input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.j-mood-scale span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 6px 2px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--paper); text-align: center; }
.j-mood-scale strong { font-family: var(--serif); font-size: 22px; line-height: 1; }
.j-mood-scale small { font-size: 11px; color: var(--muted); line-height: 1.15; overflow-wrap: anywhere; }
.j-mood-scale input:checked + span { background: var(--green); border-color: var(--green); color: var(--on-green); }
.j-mood-scale input:checked + span small { color: var(--on-green); }
.j-mood-scale input:focus-visible + span { outline: 3px solid var(--ochre); outline-offset: 2px; }
.j-photo-edit { display: flex; flex-direction: column; gap: 12px; }
.j-photo-item { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 4px 10px; align-items: center; }
.j-photo-item img { grid-row: span 2; width: 88px; height: 66px; object-fit: cover; border-radius: var(--radius-sm); }
.j-photo-item .field { margin: 0; }
.j-photo-item .check { min-height: 32px; font-size: .9em; }

.j-search { margin-bottom: 8px; max-width: 560px; }
.j-day { margin-top: 24px; }
.j-day-h { font-size: 20px; margin-bottom: 8px; }
.j-day-h a { color: var(--ink); text-decoration: none; }
.j-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.j-list li { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: var(--radius-sm); padding-right: 8px; }
.j-list li form { margin: 0; flex: none; }
.j-list-link { flex: 1; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; color: var(--ink); text-decoration: none; }
.j-list-text { display: flex; flex-direction: column; min-width: 0; }
.j-list-text strong, .j-list-text .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.j-list-meta { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .9em; white-space: nowrap; }
@media (max-width: 480px) { .j-list-link { grid-template-columns: minmax(0, 1fr) auto; } .j-list-link .badge { display: none; } }

.j-cal { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.j-cal th { font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; }
.j-cal td { height: 64px; vertical-align: top; border-radius: var(--radius-sm); background: var(--paper); padding: 0; }
.j-cal td.is-other { background: transparent; color: var(--line); }
.j-cal td.has-entry { background: var(--green-soft); }
.j-cal td.is-today { box-shadow: inset 0 0 0 2px var(--ochre); }
.j-cal a, .j-cal td > .j-cal-day { display: flex; flex-direction: column; justify-content: space-between; height: 100%; padding: 6px 8px; color: var(--ink); text-decoration: none; }
.j-cal-day { font-weight: 600; font-size: 14px; }
.j-cal-dots { display: flex; gap: 3px; flex-wrap: wrap; }
.j-cal i, .j-cal-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.j-cal i.m, .j-cal-legend i.m { background: var(--ochre); }
.j-cal i.a, .j-cal-legend i.a { background: var(--green); }
.j-cal i.f, .j-cal-legend i.f { background: var(--ink); }
.j-cal-legend { display: flex; gap: 16px; flex-wrap: wrap; }
.j-cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 480px) { .j-cal { border-spacing: 2px; } .j-cal td { height: 48px; } .j-cal a, .j-cal td > .j-cal-day { padding: 4px; } }

.j-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.j-week span { display: grid; place-items: center; min-height: 34px; border-radius: 8px; background: var(--paper); font-size: 12px; color: var(--muted); font-weight: 600; }
.j-week span.has { background: var(--green); color: var(--on-green); }
.j-week span.today { box-shadow: inset 0 0 0 2px var(--ochre); }
.badge .ico { margin-right: 4px; vertical-align: -2px; }
.j-body blockquote { margin: 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--ochre); color: var(--muted); font-style: italic; }
.j-body p, .j-body ul, .j-body ol { margin: 0; }
.j-save-mobile { margin-top: 4px; }
@media (min-width: 1100px) { .j-save-mobile { display: none; } }

/* ---------------------------------------------------------------- Körper (0.4.0) */
.k-layout { display: grid; gap: clamp(14px, 2vw, 20px); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .k-layout { grid-template-columns: minmax(0, 1fr) 340px; } .k-recent { position: sticky; top: 20px; } }
.k-numbers { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.k-numbers .field { margin: 0; }
.k-unit-input { position: relative; display: block; }
.k-unit-input .input { padding-right: 48px; font-size: 20px; font-weight: 600; }
.k-unit-input > span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.k-scales { display: grid; gap: 16px 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .k-scales { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.k-scale legend small { font-weight: 400; }
.k-sub { font-size: 20px; margin-bottom: 4px; }
.k-custom { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 16px; }

.k-days { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.k-days a { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 44px; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; }
.k-days a:hover { background: var(--linen); }
.k-days li.is-current a { background: var(--green-soft); }
.k-day { font-weight: 600; font-size: .9em; }
.k-day-vals { display: flex; gap: 12px; font-size: .9em; white-space: nowrap; overflow: hidden; }
.k-dots { display: inline-flex; gap: 3px; }
.k-dots i { width: 10px; height: 10px; border-radius: 3px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.k-dots i.lvl-1 { background: var(--sage); opacity: .45; box-shadow: none; }
.k-dots i.lvl-2 { background: var(--sage); box-shadow: none; }
.k-dots i.lvl-3 { background: var(--green); opacity: .5; box-shadow: none; }
.k-dots i.lvl-4 { background: var(--green); opacity: .75; box-shadow: none; }
.k-dots i.lvl-5 { background: var(--green); box-shadow: none; }
.k-legend { margin: 0; }

.k-ranges { display: flex; gap: 4px; flex-wrap: wrap; }
.k-ranges a { padding: 8px 14px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 999px; border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 500; }
.k-ranges a[aria-current="page"] { background: var(--green); border-color: var(--green); color: var(--on-green); }
.k-charts { display: grid; gap: clamp(14px, 2vw, 20px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }
.k-chart-card { gap: 12px; }
.k-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.k-stats div { background: var(--paper); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.k-stats dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.k-stats dt small { font-weight: 400; display: block; }
.k-stats dd { margin: 0; font-family: var(--serif); font-size: clamp(18px, 1rem + .4vw, 22px); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: stretch; }
.k-chart-small { grid-template-columns: minmax(0, 1fr); }
.k-axis-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; padding: 2px 0; }
.k-axis-x { display: flex; justify-content: space-between; padding-left: 4px; margin-top: -6px; }
.k-svg { display: block; width: 100%; height: clamp(150px, 18vw, 200px); overflow: visible; }
.k-chart-small .k-svg { height: 64px; }
.k-svg path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.k-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.k-line { stroke: var(--sage); stroke-width: 1.5; }
.k-pts { stroke: var(--ochre); stroke-width: 7; }
.k-avg { stroke: var(--green); stroke-width: 3; }
.k-chart-small .k-pts { stroke-width: 4; }
.k-key { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.k-key-line, .k-key-avg { display: inline-block; width: 22px; height: 0; border-top: 3px solid var(--green); }
.k-key-line { border-top: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--ochre); }
.k-key-avg { margin-left: 10px; }
.k-tile-chart { display: flex; flex-direction: column; gap: 4px; }

.k-metric-form { display: flex; flex-direction: column; gap: 12px; }
.k-metric-form fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.k-metric-form legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
.k-metric-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.k-metric-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 8px; align-items: center; margin: 0; }
.k-metric-row .btn-row { grid-column: 1 / -1; }
.k-metric-row .field { margin: 0; }
li.k-metric-row { grid-template-columns: minmax(0, 1fr) auto; }
li.k-metric-row form { margin: 0; }

/* ---------------------------------------------------------------- Training (0.5.0) */
.t-week { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: clamp(16px, 2vw, 24px); }
.t-facts { grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); margin-bottom: clamp(16px, 2vw, 24px); }
@media (max-width: 480px) { .t-week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.t-layout { display: grid; gap: clamp(14px, 2vw, 20px); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .t-layout { grid-template-columns: minmax(0, 1fr) 360px; } }
.t-list-wrap, .t-side, .t-ex-groups { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.t-list-wrap .tile-head h2 { font-size: 24px; }
.t-kind { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); }
.t-kind-rad { background: var(--linen); color: var(--ochre-ink); }
.t-kind-sonstiges { background: var(--paper); color: var(--ink); }
.t-pages { justify-content: space-between; }
.t-prs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.t-prs a { display: flex; flex-direction: column; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); text-decoration: none; }
.t-prs a:hover { background: var(--linen); }
.t-prs span { color: var(--green); font-weight: 600; }
.t-side .panel h2 { font-size: 22px; display: flex; align-items: center; gap: 8px; }
.t-bars { display: flex; flex-direction: column; gap: 6px; }
.t-bars h3 { font-size: 17px; font-family: var(--sans); font-weight: 600; }
.t-bars-svg { display: block; width: 100%; height: 110px; }
.t-bar { fill: var(--sage); }
.t-bar.is-now { fill: var(--green); }
.t-bars + .t-bars { margin-top: 10px; }

.t-route-svg { display: block; width: 100%; height: auto; max-height: 70vh; }
.t-route-line { fill: none; stroke: var(--green); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.t-route-start { fill: var(--green); stroke: var(--card); stroke-width: 3; }
.t-route-end { fill: var(--ochre); stroke: var(--card); stroke-width: 3; }
.t-groups { display: grid; gap: clamp(14px, 2vw, 20px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); margin-bottom: 20px; }
.t-group h2 { font-size: 21px; }
.t-group h2 a { color: var(--ink); text-decoration: none; }
.t-sets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.t-sets li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.t-set-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); font-size: 13px; font-weight: 700; }
.t-note { white-space: pre-line; margin: 0; overflow-wrap: anywhere; }

.t-sets-form { border: 0; margin: 0; }
.t-rows { display: flex; flex-direction: column; gap: 8px; }
.t-row { display: grid; grid-template-columns: minmax(0, 1fr) 68px 84px; gap: 8px; align-items: center; }
.t-row label { margin: 0; min-width: 0; }
.t-row .input { padding-inline: 10px; }
.t-row select.input { padding-right: 4px; text-overflow: ellipsis; }
.t-row-head { font-size: 12px; font-weight: 600; color: var(--muted); }
.t-row input::placeholder { color: var(--muted); opacity: .6; }
@media (min-width: 700px) { .t-row { grid-template-columns: minmax(0, 1fr) 90px 110px; } }

.t-ex-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.t-ex-list a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; min-height: 44px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; }
.t-ex-list a:hover { background: var(--paper); }
.t-ex-best { font-weight: 600; color: var(--green); }
.t-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.t-hist li { display: flex; flex-direction: column; padding: 8px 10px; background: var(--paper); border-radius: var(--radius-sm); }
.t-hist .ico { color: var(--ochre); vertical-align: -2px; }
.t-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.t-week div, .t-facts div { background: var(--card); }
.j-form fieldset.t-sets-form { padding: clamp(18px, 2.4vw, 28px); }
.k-line-main { stroke: var(--green); stroke-width: 2.5; }
@media (max-width: 480px) { .t-list .j-list-link { grid-template-columns: 40px minmax(0, 1fr); } .t-list .j-list-meta { display: none; } }

/* ---------------------------------------------------------------- Tagesübersicht (0.6.0) */
.h-layout { display: grid; gap: clamp(14px, 2vw, 20px); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .h-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.h-col { display: flex; flex-direction: column; gap: clamp(14px, 2vw, 20px); min-width: 0; }
.h-col .panel { display: flex; flex-direction: column; gap: 12px; }
.h-sub { font-family: var(--sans); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 0; display: flex; align-items: center; gap: 6px; }
.h-source { font-size: 11px; color: var(--muted); margin: 0; }
.h-weather { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; min-width: 0; }
.h-weather > * { margin: 0; }
.h-now { display: flex; gap: 14px; align-items: center; }
.h-now p { margin: 0; }
.h-now-icon { color: var(--ochre-ink); flex: none; }
.h-temp { font-family: var(--serif); font-size: clamp(34px, 1.6rem + 1.5vw, 46px); font-weight: 600; line-height: 1; }
.h-hours { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: 100%; }
.h-hours li { background: var(--paper); border-radius: 10px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink); }
.h-hours li .ico { color: var(--muted); }
.h-hint { display: flex; align-items: center; gap: 6px; background: var(--green-soft); color: var(--green); padding: 6px 10px; border-radius: 8px; font-weight: 600; }
.h-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.h-events li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.h-events li:last-child { border-bottom: 0; }
.h-events li.is-past { opacity: .55; }
.h-time { font-size: 13px; font-weight: 600; color: var(--green); font-variant-numeric: tabular-nums; }
.h-title { min-width: 0; overflow-wrap: anywhere; }
.h-title small { display: block; }
.h-plan { display: flex; align-items: center; gap: 12px; margin: 0; }
.h-plan > span:nth-child(2) { flex: 1; min-width: 0; }
.h-plan small { display: block; }
.h-plan-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--paper); color: var(--ochre-ink); flex: none; }
.h-plan.is-done .h-plan-icon { background: var(--green); color: var(--on-green); }
.h-weekplan { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.h-weekplan li { background: var(--paper); border-radius: 8px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.h-weekplan li span { font-size: 12px; font-weight: 700; color: var(--muted); }
.h-weekplan li small { font-size: 10px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-weekplan li.today { box-shadow: inset 0 0 0 2px var(--ochre); }
.h-weekplan li.done { background: var(--green); }
.h-weekplan li.done span, .h-weekplan li.done small { color: var(--on-green); }
.h-habits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.h-habits form { margin: 0; }
.h-check { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 10px; border-radius: 10px; background: var(--paper); }
.h-check:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }
.h-box { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; background: var(--card); }
.h-check.is-done .h-box { background: var(--green); border-color: var(--green); color: var(--on-green); }
.h-check.is-done .h-name { color: var(--muted); }
.h-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.h-streak { display: inline-flex; align-items: center; gap: 2px; color: var(--ochre-ink); font-weight: 700; }
.h-dots { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.h-dots form { margin: 0; }
.h-dots button { all: unset; box-sizing: border-box; cursor: pointer; display: grid; place-items: center; width: 100%; min-height: 32px; border-radius: 8px; background: var(--paper); font-size: 12px; font-weight: 600; color: var(--muted); }
.h-dots button.has { background: var(--green); color: var(--on-green); }
.h-dots button.today { box-shadow: inset 0 0 0 2px var(--ochre); }
.h-dots button:focus-visible { outline: 3px solid var(--ochre); outline-offset: 1px; }
.h-tile { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .h-tile { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.h-tile-part { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.h-tile-part > p { margin: 0; }
.h-figures { grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); }
.h-figures dd a { color: inherit; text-decoration: none; }
.tile .h-figures div, .panel .h-figures div { background: var(--paper); }
.h-plan-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.h-plan-row { display: grid; grid-template-columns: 96px minmax(0, 150px) minmax(0, 1fr); gap: 8px; align-items: center; }
.h-plan-day { font-weight: 600; }
@media (max-width: 520px) { .h-plan-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .h-plan-day { grid-column: 1 / -1; } }
/* Trainingspläne (0.7.0) */
.p-week-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.p-week .h-plan-day { font-size: 14px; }
.p-row { display: grid; grid-template-columns: minmax(0, 1fr) 56px 76px 76px 52px 70px; gap: 8px; align-items: center; }
.p-row-rad { grid-template-columns: minmax(0, 140px) 64px 72px minmax(0, 1fr) 72px; }
.p-row label { margin: 0; min-width: 0; }
.p-row .input { padding-inline: 8px; }
.p-row-head { font-size: 12px; font-weight: 600; color: var(--muted); }
.p-row input::placeholder { color: var(--muted); opacity: .6; }
@media (max-width: 700px) {
  .p-row { grid-template-columns: repeat(5, minmax(0, 1fr)); padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .p-row .p-ex { grid-column: 1 / -1; }
  .p-row-head span:first-child { grid-column: 1 / -1; }
  .p-row-rad { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 2fr) minmax(0, 1.2fr); }
  .p-row-rad label:first-child, .p-row-rad.p-row-head span:first-child { grid-column: 1 / -1; }
}
.p-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.p-items > li { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.p-items > li:last-child { border-bottom: 0; padding-bottom: 0; }
.p-items p { margin: 4px 0 0; }
.p-item-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.p-target { font-variant-numeric: tabular-nums; font-weight: 600; }
.p-hint { display: flex; gap: 6px; align-items: center; color: var(--ok); font-size: 14px; font-weight: 600; }
.p-note { white-space: pre-line; margin-top: 12px; }
.h-details summary { cursor: pointer; font-weight: 600; margin: 8px 0; }
.h-rename { display: flex; gap: 8px; align-items: center; min-width: 0; }
.h-rename .input { min-width: 0; }
.h-habit-row { grid-template-columns: minmax(0, 1fr) auto; }
@media (max-width: 520px) { li.h-habit-row { grid-template-columns: minmax(0, 1fr); } }
.h-add { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.h-add .field { flex: 1; min-width: 200px; margin: 0; }

/* Schalter Hell/Dunkel auf der öffentlichen Seite: Mond im Hellen, Sonne im Dunkeln */
.site-header .wrap { flex-wrap: nowrap; }
.site-header .site-nav { flex: 1; min-width: 0; justify-content: flex-end; }
.theme-toggle { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; padding: 0; }
.theme-toggle:hover { border-color: var(--green); color: var(--green); }
.theme-toggle svg { display: block; }
.theme-toggle .tt-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .tt-sun { display: inline-flex; }
:root[data-theme="dark"] .theme-toggle .tt-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .tt-sun { display: inline-flex; }
  :root:not([data-theme="light"]) .theme-toggle .tt-moon { display: none; }
}
@media (max-width: 599px) {
  .site-header .wrap { flex-wrap: wrap; }
  .site-header .brand { flex: 1; }
  .site-header .theme-toggle { order: 2; }
  .site-header .site-nav { order: 3; flex-basis: 100%; justify-content: flex-start; }
}

/* Legende der Rollen auf /benutzer */
.role-legend { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.role-legend h3 { font-size: 19px; }
.role-legend dl { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.role-legend dt { font-weight: 600; }
.role-legend dd { margin: 2px 0 0; }
.role-legend ul { margin: 0; padding-left: 1.2em; }
.role-legend li { margin: 2px 0; }
