/* Allmighty · SPD-Fraktion im Stadtbezirksrat 322 – Oberfläche im Stil von
   iOS (gruppierte Listen, große Titel, Tab-Leiste, Sheets) in SPD-Rot. */

:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --card: #ffffff;
  --card-raised: #ffffff;
  --label: #111113;
  --secondary: #636366;
  --tertiary: #8e8e93;
  --separator: #3c3c4329;
  --fill: #7878801f;
  --fill-strong: #78788033;
  --tint: #e3000f;
  --tint-pressed: #b8000c;
  --tint-soft: #e3000f1a;
  --on-tint: #ffffff;
  --red: #c4000d;
  --red-soft: #e3000f1a;
  --spd: #e3000f;
  --header: #e3000f;
  --orange: #9a5b00;
  --orange-soft: #ff9f0a2e;
  --blue: #0058c7;
  --blue-soft: #007aff24;
  --green: #1b7a36;
  --green-soft: #34c75930;
  --gray-soft: #8e8e9329;
  --highlight: #ffe58a;
  --bar: #f9f9fbd9;
  --shadow: 0 1px 2px #0000000a, 0 8px 24px #0000000f;
  --radius: 14px;
  --radius-small: 10px;
  --tabbar-height: 56px;
  --navbar-height: 52px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* Dunkel: automatisch nach Gerät, solange nicht „Hell“ gewählt ist … */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --card: #1c1c1e;
    --card-raised: #2c2c2e;
    --label: #f5f5f7;
    --secondary: #aeaeb2;
    --tertiary: #8e8e93;
    --separator: #54545899;
    --fill: #7878803d;
    --fill-strong: #7878805c;
    --tint: #ff5c66;
    --tint-pressed: #ff7a82;
    --tint-soft: #ff5c6629;
    --on-tint: #2b0003;
    --red: #ff6961;
    --red-soft: #ff453a33;
    --orange: #ffb340;
    --orange-soft: #ff9f0a33;
    --blue: #6cb0ff;
    --blue-soft: #0a84ff38;
    --green: #5ad67d;
    --green-soft: #30d15833;
    --gray-soft: #8e8e933d;
    --highlight: #7a6400;
    --bar: #1c1c1ed9;
    --shadow: 0 1px 2px #00000066, 0 8px 24px #00000080;
    --header: #b8000c;
  }
}
/* … oder fest gewählt (data-theme setzt das Skript im Seitenkopf). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --card: #1c1c1e;
  --card-raised: #2c2c2e;
  --label: #f5f5f7;
  --secondary: #aeaeb2;
  --tertiary: #8e8e93;
  --separator: #54545899;
  --fill: #7878803d;
  --fill-strong: #7878805c;
  --tint: #ff5c66;
  --tint-pressed: #ff7a82;
  --tint-soft: #ff5c6629;
  --on-tint: #2b0003;
  --red: #ff6961;
  --red-soft: #ff453a33;
  --orange: #ffb340;
  --orange-soft: #ff9f0a33;
  --blue: #6cb0ff;
  --blue-soft: #0a84ff38;
  --green: #5ad67d;
  --green-soft: #30d15833;
  --gray-soft: #8e8e933d;
  --highlight: #7a6400;
  --bar: #1c1c1ed9;
  --shadow: 0 1px 2px #00000066, 0 8px 24px #00000080;
  --header: #b8000c;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--label);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.has-tabbar { padding-bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom)); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--tint); }
h1, h2, h3, p { margin: 0; }
code { padding: .05em .3em; border-radius: 5px; background: var(--fill); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
mark { padding: 0 .1em; border-radius: 3px; color: inherit; background: var(--highlight); }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); outline-offset: 2px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Navigationsleiste ---- */
.navbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: calc(var(--navbar-height) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left));
  border-bottom: .5px solid var(--separator);
  background: var(--bar);
  box-shadow: inset 0 3px 0 var(--spd);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.brand { display: inline-flex; align-items: center; gap: .6rem; min-width: 0; color: var(--label); font-size: 1.02rem; font-weight: 650; letter-spacing: -.01em; text-decoration: none; }
.brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { display: grid; flex: 0 0 auto; width: 32px; height: 32px; place-items: center; border-radius: 4px; color: #fff; background: var(--spd); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: .78rem; font-weight: 800; letter-spacing: -.02em; }
.navbar-tools { display: flex; align-items: center; gap: .35rem; }
.icon-button { position: relative; display: grid; width: 40px; height: 40px; place-items: center; padding: 0; border: 0; border-radius: 50%; color: var(--tint); background: transparent; }
.icon-button:hover, .icon-button[aria-expanded="true"] { background: var(--fill); }
.icon-button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bell-wrapper { position: relative; }
.bell-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; color: #fff; background: #ff3b30; font-size: .66rem; font-weight: 700; line-height: 18px; text-align: center; }
.avatar { display: grid; flex: 0 0 auto; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #9aa0a8, #6b7078); font-size: .76rem; font-weight: 700; text-decoration: none; }
button.avatar { padding: 0; border: 0; }
.account-wrapper { position: relative; display: flex; }
.account-menu { position: absolute; z-index: 40; top: calc(100% + 8px); right: 0; width: min(240px, calc(100vw - 1.5rem)); overflow: hidden; border: .5px solid var(--separator); border-radius: var(--radius); background: var(--card-raised); box-shadow: var(--shadow); }
.account-menu-head { display: grid; gap: .1rem; padding: .8rem 1rem; border-bottom: .5px solid var(--separator); font-size: .95rem; overflow-wrap: anywhere; }
.account-menu-head small { color: var(--secondary); font-size: .8rem; }
.account-menu-item { display: block; width: 100%; min-height: 46px; padding: .7rem 1rem; border: 0; color: var(--label); background: none; font-size: 1rem; text-align: left; text-decoration: none; }
.account-menu-item + .account-menu-item { border-top: .5px solid var(--separator); }
.account-menu-item:hover { background: var(--fill); }
.account-menu-item.destructive { color: var(--red); }
.avatar.is-admin { background: var(--spd); }
.avatar-large { width: 60px; height: 60px; font-size: 1.3rem; }

.notification-panel { position: absolute; z-index: 40; top: calc(100% + 8px); right: -44px; width: min(370px, calc(100vw - 1.5rem)); max-height: min(70vh, 500px); overflow: auto; border-radius: var(--radius); background: var(--card-raised); box-shadow: var(--shadow); border: .5px solid var(--separator); }
.notification-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .8rem 1rem; border-bottom: .5px solid var(--separator); background: var(--card-raised); font-size: .95rem; }
.notification-list { margin: 0; padding: 0; list-style: none; }
.notification-item { display: grid; gap: .2rem; padding: .75rem 1rem .75rem 1.6rem; border-bottom: .5px solid var(--separator); color: var(--label); font-size: .9rem; text-decoration: none; position: relative; }
.notification-item:hover { background: var(--fill); }
.notification-item.unread::before { content: ""; position: absolute; top: 1.15rem; left: .65rem; width: 9px; height: 9px; border-radius: 50%; background: var(--tint); }
.notification-item.unread .notification-message { font-weight: 600; }
.notification-item small { color: var(--secondary); font-size: .78rem; }
.notification-empty { padding: 1.2rem 1rem; color: var(--secondary); font-size: .9rem; }

/* ---- Tab-Leiste ---- */
.tabbar {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: space-around;
  min-height: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
  padding: 0 max(.25rem, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(.25rem, env(safe-area-inset-left));
  border-top: .5px solid var(--separator);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.tab { position: relative; display: flex; flex: 1 1 0; flex-direction: column; align-items: center; justify-content: center; gap: 2px; max-width: 140px; min-height: var(--tabbar-height); color: var(--tertiary); font-size: .66rem; font-weight: 550; text-decoration: none; }
.tab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--tint); }
.tab-badge { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; color: #fff; background: #ff3b30; font-size: .62rem; font-weight: 700; line-height: 17px; text-align: center; }

/* ---- Seite ---- */
.page { width: min(100%, 760px); margin: 0 auto; padding: .5rem max(1rem, env(safe-area-inset-right)) 2.5rem max(1rem, env(safe-area-inset-left)); }
.page.wide { width: min(100%, 1180px); }
.page.extra-wide { width: min(100%, 1560px); }
.large-title { margin: .6rem 0 .2rem; font-size: clamp(1.9rem, 6vw, 2.15rem); font-weight: 750; line-height: 1.12; letter-spacing: -.022em; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem; }
.title-row .large-title { min-width: 0; }
.eyebrow { margin-top: .9rem; color: var(--secondary); font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.lead { max-width: 620px; margin-top: .4rem; color: var(--secondary); font-size: .98rem; line-height: 1.45; }
.section-header { margin: 1.5rem 1rem .4rem; color: var(--secondary); font-size: .8rem; font-weight: 500; letter-spacing: .02em; text-transform: uppercase; }
.section-header.with-action { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-right: .3rem; }
.section-footer { margin: .45rem 1rem 0; color: var(--secondary); font-size: .8rem; line-height: 1.4; }

.card { margin-top: 1rem; padding: 1rem; border-radius: var(--radius); background: var(--card); }
.card > h2, .card > h3, .card-title { font-size: 1.12rem; font-weight: 650; letter-spacing: -.01em; }
.card > h2 + p, .card > h3 + p { margin-top: .25rem; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.stack { display: grid; gap: .9rem; }
.divider { height: .5px; margin: 1rem -1rem; background: var(--separator); }

/* ---- Schaltflächen ---- */
.primary-button, .secondary-button, .danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 44px;
  padding: .55rem 1.05rem;
  border: 0;
  border-radius: 12px;
  font-size: .98rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform .12s ease, opacity .12s ease, background-color .12s ease;
}
.primary-button { color: #fff; background: var(--spd); }
.primary-button:hover { background: #b8000c; }
.secondary-button { color: var(--label); background: var(--fill); }
.secondary-button:hover { background: var(--fill-strong); }
.danger-button { color: var(--red); background: transparent; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--red) 45%, transparent); }
.primary-button:active, .secondary-button:active, .danger-button:active { transform: scale(.97); opacity: .8; }
.primary-button:disabled, .secondary-button:disabled, .danger-button:disabled { color: var(--tertiary); background: var(--fill); cursor: not-allowed; transform: none; }
.primary-button svg, .secondary-button svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.block { width: 100%; }
.large { min-height: 50px; border-radius: 14px; font-size: 1.05rem; }
.small { min-height: 34px; padding: .3rem .75rem; border-radius: 999px; font-size: .85rem; }
.link-button { padding: 0; border: 0; color: var(--tint); background: none; font-size: .9rem; font-weight: 500; }
.link-button.danger { color: var(--red); }
.round-button { display: grid; flex: 0 0 auto; width: 36px; height: 36px; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #fff; background: var(--spd); }
.round-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.back-button { display: inline-flex; align-items: center; gap: .1rem; margin: .4rem 0 0 -.4rem; padding: .3rem .4rem; border: 0; color: var(--tint); background: none; font-size: 1.02rem; }
.back-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Formulare ---- */
label { display: block; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.field { min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > label, .field-label { display: block; margin: 0 0 .35rem .15rem; color: var(--secondary); font-size: .84rem; font-weight: 500; }
.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .field textarea, .field select, .input {
  width: 100%;
  min-height: 46px;
  padding: .65rem .8rem;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  color: var(--label);
  background: var(--fill);
  font-size: 1rem;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
}
.field select { padding-right: 2.2rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 9 5-5 5 5M7 15l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; background-size: 16px; }
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .input:focus { border-color: var(--tint); outline: none; background: var(--card); box-shadow: 0 0 0 3px var(--tint-soft); }
.field input:disabled:not([type="checkbox"]):not([type="radio"]), .field textarea:disabled, .field select:disabled { color: var(--secondary); opacity: 1; -webkit-text-fill-color: var(--secondary); }
::placeholder { color: var(--tertiary); opacity: 1; }
.field-hint { display: block; margin-top: .4rem; color: var(--secondary); font-size: .82rem; line-height: 1.4; }
.plain-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.inline-row { display: flex; gap: .5rem; }
.inline-row > :first-child { flex: 1; min-width: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem !important; }

.status { min-height: 1.3em; margin-top: .6rem; color: var(--secondary); font-size: .86rem; line-height: 1.4; }
.status:empty { min-height: 0; margin-top: 0; }
.status[data-state="error"] { color: var(--red); }
.status[data-state="success"] { color: var(--green); }
.status[data-state="action"] { color: var(--orange); font-weight: 600; }

/* Segmentierte Auswahl */
.segmented { display: flex; padding: 2px; border-radius: 9px; background: var(--fill); }
.segmented label { position: relative; flex: 1 1 0; margin: 0; }
.segmented input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: .38rem .6rem; border-radius: 7px; color: var(--label); font-size: .86rem; font-weight: 500; text-align: center; white-space: nowrap; transition: background-color .15s ease; }
.segmented input:checked + span { background: var(--card-raised); box-shadow: 0 1px 3px #0000001f, 0 0 0 .5px #0000000a; font-weight: 600; }
.segmented input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); }
.segmented input:disabled { cursor: default; }
.segmented input:disabled:not(:checked) + span { color: var(--tertiary); }

/* Schalter */
.switch { position: relative; display: inline-block; flex: 0 0 auto; width: 51px; height: 31px; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--fill-strong); transition: background-color .2s ease; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px #00000033; transition: transform .2s ease; }
.switch input:checked + span { background: #34c759; }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:disabled + span { opacity: .5; }
.switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); outline-offset: 2px; }

/* ---- Gruppierte Listen ---- */
.list { margin: 0; padding: 0; overflow: hidden; border-radius: var(--radius); background: var(--card); list-style: none; }
.list > li, .list > .row { position: relative; }
.list > li + li::before, .list > .row + .row::before { content: ""; position: absolute; top: 0; right: 0; left: 1rem; height: .5px; background: var(--separator); }
.row { display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 48px; padding: .7rem 1rem; border: 0; color: var(--label); background: transparent; font-size: 1rem; text-align: left; text-decoration: none; }
button.row:hover, a.row:hover { background: var(--fill); }
button.row:active, a.row:active { background: var(--fill-strong); }
.row[aria-current="true"] { background: var(--tint-soft); }
.row-main { display: grid; flex: 1 1 auto; gap: .15rem; min-width: 0; }
.row-title { overflow: hidden; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.row-title.wrap { white-space: normal; overflow-wrap: anywhere; }
.row-sub { overflow: hidden; color: var(--secondary); font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.row-sub.wrap { white-space: normal; overflow-wrap: anywhere; }
.row-value { flex: 0 0 auto; color: var(--secondary); font-size: .95rem; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .15rem; }
.chevron { flex: 0 0 auto; width: 9px; height: 15px; fill: none; stroke: var(--tertiary); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.row.needs-action .row-title::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: .45rem; border-radius: 50%; background: #ff9f0a; vertical-align: .05em; }
.row-icon { display: grid; flex: 0 0 auto; width: 32px; height: 32px; place-items: center; border-radius: 8px; color: #fff; background: var(--tint); font-size: .72rem; font-weight: 700; }
.row-icon.blue { background: #0a84ff; }
.row-icon.orange { background: #ff9f0a; }
.row-icon.gray { background: #8e8e93; }
.row-icon.green { background: #1b8a3a; }
#home-filter span { padding: .38rem .15rem; font-size: .8rem; }
.row-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Übersicht ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .7rem; margin-top: 1.1rem; }
.tile { display: grid; gap: .1rem; padding: .85rem 1rem; border-radius: var(--radius); color: var(--label); background: var(--card); text-decoration: none; }
.tile:hover { background: var(--card-raised); box-shadow: var(--shadow); }
.tile strong { font-size: 1.9rem; font-weight: 750; line-height: 1.1; letter-spacing: -.02em; }
.tile span { color: var(--secondary); font-size: .86rem; }
.tile.is-highlight strong { color: var(--tint); }
.activity .row { align-items: flex-start; }
.activity .row-icon { margin-top: .15rem; }
.activity .chevron { align-self: center; }
.activity .row.is-new { background: var(--tint-soft); }
.activity a.row.is-new:hover { background: color-mix(in srgb, var(--tint) 16%, transparent); }
.section-header.with-action h2 { margin: 0; font: inherit; letter-spacing: inherit; }
.section-header.with-action .link-button { font-size: .8rem; letter-spacing: 0; text-transform: none; }
.activity li.has-read-button { display: flex; align-items: stretch; background: var(--tint-soft); }
.activity li.has-read-button .row { flex: 1 1 auto; min-width: 0; background: none; }
.activity li.has-row-action { display: flex; align-items: stretch; }
.activity li.has-row-action .row { flex: 1 1 auto; min-width: 0; }
.row-delete { flex: 0 0 auto; display: grid; place-items: center; width: 40px; padding: 0; border: 0; color: var(--tertiary); background: none; }
.row-delete:hover { color: var(--red); background: var(--red-soft); }
.row-delete svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.download-link { display: inline-grid; flex: 0 0 auto; width: 36px; height: 36px; place-items: center; border-radius: 50%; color: var(--secondary); background: var(--fill); text-decoration: none; vertical-align: middle; }
.download-link:hover { color: var(--label); background: var(--fill-strong); }
.download-link:active { transform: scale(.94); }
.download-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.list li.has-row-action { display: flex; align-items: stretch; }
.list li.has-row-action > .row { flex: 1 1 auto; min-width: 0; }
.list li.has-row-action > .download-link { align-self: center; margin-right: .6rem; }
.list.plain li.has-row-action > .download-link { margin-right: 0; }
a + .download-link { margin-left: .7rem; }
.reader-page-tools { align-items: center; }
.reader-page-tools .download-link { width: 30px; height: 30px; margin-left: 0; }
.reader-page-tools .download-link svg { width: 16px; height: 16px; }
.note-text a { overflow-wrap: anywhere; }
.read-button { flex: 0 0 auto; display: grid; place-items: center; width: 48px; padding: 0; border: 0; border-left: .5px solid var(--separator); color: var(--tint); background: none; }
.read-button:hover { background: color-mix(in srgb, var(--tint) 16%, transparent); }
.read-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.new-dot { flex: 0 0 auto; align-self: center; width: 10px; height: 10px; border-radius: 50%; background: var(--tint); }

.badge { display: inline-flex; align-items: center; padding: .14rem .5rem; border-radius: 999px; color: var(--secondary); background: var(--gray-soft); font-size: .72rem; font-weight: 600; white-space: nowrap; }
.badge-prompt_ready, .badge-generating, .badge-in_review, .badge-anfrage, .badge-blue { color: var(--blue); background: var(--blue-soft); }
.badge-review, .badge-new, .badge-pending, .badge-orange { color: var(--orange); background: var(--orange-soft); }
.badge-completed, .badge-scheduled, .badge-converted, .badge-done, .badge-antrag, .badge-green { color: var(--green); background: var(--green-soft); }
.badge-admin { color: #fff; background: var(--spd); }
.badge-red { color: var(--red); background: var(--red-soft); }

.empty { padding: 1.6rem 1rem; border-radius: var(--radius); color: var(--secondary); background: var(--card); font-size: .95rem; line-height: 1.45; text-align: center; }
.empty.error { color: var(--red); }
.empty strong { display: block; margin-bottom: .25rem; color: var(--label); font-size: 1.05rem; }

.banner { margin-top: .9rem; padding: .8rem .95rem; border-radius: var(--radius-small); color: var(--label); background: var(--fill); font-size: .92rem; line-height: 1.45; }
.banner[data-state="action"] { background: var(--orange-soft); }
.banner[data-state="waiting"] { background: var(--blue-soft); }
.banner[data-state="success"] { background: var(--green-soft); }
.banner[data-state="error"] { color: var(--red); background: var(--red-soft); }

.steps { display: flex; gap: 4px; margin: .9rem 0 0; padding: 0; list-style: none; }
.steps li { flex: 1 1 0; min-width: 0; padding-top: .45rem; border-top: 4px solid var(--fill-strong); border-radius: 2px; color: var(--tertiary); font-size: .7rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps li[data-state="done"] { border-color: color-mix(in srgb, var(--tint) 45%, transparent); color: var(--secondary); }
.steps li[data-state="active"] { border-color: var(--tint); color: var(--tint); }

/* ---- Master/Detail ---- */
.split { display: block; }
body.detail-open .split-master { display: none; }
body:not(.detail-open) .split-detail { display: none; }
.detail-placeholder { display: none; }

/* Verlauf neben dem Vorgang, sobald der Bildschirm breit genug ist. */
@media (min-width: 1280px) {
  .detail-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); gap: 1.5rem; align-items: start; }
  .detail-aside { position: sticky; top: calc(var(--navbar-height) + .5rem); max-height: calc(100dvh - var(--navbar-height) - 1.5rem); overflow: auto; scrollbar-width: thin; }
}

/* ---- Bilder ---- */
.proposal-images-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem; margin-top: .75rem; }
.proposal-images-list:empty { display: none; }
.proposal-image { min-width: 0; margin: 0; }
.proposal-image img { display: block; width: 100%; aspect-ratio: 1; border-radius: var(--radius-small); object-fit: cover; background: var(--fill); }
.proposal-image figcaption { margin-top: .3rem; overflow: hidden; color: var(--secondary); font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.proposal-image-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .3rem; font-size: .8rem; }
.proposal-image-actions a { font-weight: 500; text-decoration: none; }
.proposal-image-actions .danger-button { min-height: 0; padding: 0; background: none; font-size: .8rem; font-weight: 500; }
.file-picker { display: flex; align-items: center; gap: .75rem; min-height: 64px; margin: 0; padding: .8rem 1rem; border: 1.5px dashed var(--fill-strong); border-radius: var(--radius-small); color: var(--label); background: var(--fill); cursor: pointer; }
.file-picker svg { color: var(--tint); }
.file-picker:focus-within { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); outline-offset: 2px; }
.file-picker svg { width: 26px; height: 26px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.file-picker span { font-weight: 600; }
.file-picker small { margin-left: auto; color: var(--secondary); font-size: .78rem; text-align: right; }
.file-picker.is-disabled { opacity: .5; pointer-events: none; }
.file-picker input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.selected-files { margin: .6rem 0 0; padding-left: 1.2rem; color: var(--secondary); font-size: .86rem; overflow-wrap: anywhere; }

/* ---- Sitzungsvorbereitung ---- */
.avatar-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; color: #fff; background: #ff9f0a; font-size: .66rem; font-weight: 700; line-height: 18px; text-align: center; pointer-events: none; }
.agenda .agenda-row { align-items: flex-start; gap: .6rem; min-height: 0; padding-top: .55rem; padding-bottom: .55rem; }
.agenda-section { padding: .9rem 1rem .3rem; color: var(--secondary); font-size: .76rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.top-number { flex: 0 0 auto; min-width: 2.4rem; padding-top: .08rem; color: var(--secondary); font-size: .82rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.agenda-title { display: -webkit-box; overflow: hidden; font-size: .93rem; font-weight: 550; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.agenda-origin, .note-count { color: var(--secondary); font-size: .76rem; }
.note-count::before { content: "· "; }
.badge-mitteilung, .badge-sonstiges { color: var(--secondary); background: var(--gray-soft); }
.badge-vorlage, .badge-wahl { color: var(--orange); background: var(--orange-soft); }
.badge-origin { color: var(--label); background: var(--fill-strong); }
.notes-chip { display: inline-flex; align-items: center; gap: .28rem; padding: .08rem .45rem; border-radius: 999px; color: var(--secondary); background: var(--gray-soft); font-size: .72rem; font-weight: 600; white-space: nowrap; }
.notes-chip svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.notes-chip strong { font-weight: 700; }
.notes-chip.has-mine { color: var(--tint); background: var(--tint-soft); }
.notes-chip .notes-other { color: var(--secondary); font-weight: 600; }
.notes-chip .notes-mine { font-weight: 700; }
.tally { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.tally-chip { display: inline-flex; align-items: center; padding: .1rem .45rem; border-radius: 999px; font-size: .72rem; font-weight: 650; white-space: nowrap; }
.vote-zustimmen { color: var(--green); background: var(--green-soft); }
.vote-enthalten { color: var(--secondary); background: var(--gray-soft); }
.vote-ablehnen { color: var(--red); background: var(--red-soft); }
.vote-aendern { color: var(--orange); background: var(--orange-soft); }
.my-vote { padding: .1rem .45rem; border-radius: 999px; font-size: .72rem; font-weight: 650; white-space: nowrap; }
.my-vote.is-missing { color: var(--secondary); background: none; box-shadow: inset 0 0 0 1px var(--fill-strong); font-weight: 500; }
.top-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .4rem; }
.top-nav .back-button { margin-top: 0; }
.step-bar { position: sticky; z-index: 5; bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom) + .5rem); display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: 1rem; padding: .4rem; border: .5px solid var(--separator); border-radius: 999px; background: var(--bar); box-shadow: var(--shadow); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.step-bar button { flex: 0 0 auto; min-width: 6.2rem; }
.step-position { min-width: 0; overflow: hidden; color: var(--secondary); font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.context-heading { margin: .9rem 0 0; color: var(--secondary); font-size: .8rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.context-text { margin-top: .25rem; font-size: .93rem; line-height: 1.45; }
.vote-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin-top: .7rem; }
.vote-buttons button { min-height: 44px; padding: .4rem .3rem; border: 0; border-radius: var(--radius-small); color: var(--label); background: var(--fill); font-size: .9rem; font-weight: 600; }
.vote-buttons button:hover { background: var(--fill-strong); }
.vote-buttons button.is-active[data-vote="zustimmen"] { color: #fff; background: #1b8a3a; }
.vote-buttons button.is-active[data-vote="enthalten"] { color: #fff; background: #6c6c70; }
.vote-buttons button.is-active[data-vote="ablehnen"] { color: #fff; background: var(--spd); }
.vote-buttons button.is-active[data-vote="aendern"] { color: #fff; background: #b96a00; }
.list.plain { margin-top: .7rem; border-radius: 0; background: none; }
.vote-entry { padding: .55rem 0; }
.list.plain > li + li::before { left: 0; }
.vote-entry-head, .note-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .2rem .6rem; font-size: .88rem; }
.note-head span { color: var(--secondary); font-size: .76rem; }
.note-list { margin: .8rem 0 0; padding: 0; list-style: none; }
.note { padding: .6rem 0; border-top: .5px solid var(--separator); }
.note-text { margin-top: .2rem; font-size: .93rem; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
.note-actions { display: flex; gap: .9rem; margin-top: .3rem; }
.note-actions .link-button { font-size: .8rem; }
@media (max-width: 560px) { .vote-buttons { grid-template-columns: repeat(2, 1fr); } }
/* Am Handy fest über der Tab-Leiste, damit die Knöpfe bei jedem Punkt an derselben Stelle sitzen. */
@media (max-width: 899px) {
  .step-bar { position: fixed; right: max(1rem, env(safe-area-inset-right)); left: max(1rem, env(safe-area-inset-left)); margin: 0; }
  body[data-tab="meeting"].detail-open .split-detail { padding-bottom: 3.6rem; }
}
/* Am Desktop füllt die Detailspalte mindestens den Bildschirm, damit die Leiste auch bei kurzen Punkten unten sitzt. */
@media (min-width: 900px) {
  .top-nav { display: none; }
  body[data-tab="meeting"] .page { padding-bottom: .75rem; }
  body[data-tab="meeting"].detail-open .split-detail { display: flex; flex-direction: column; min-height: calc(100dvh - var(--navbar-height) - 1.25rem); }
  .step-bar { bottom: .75rem; width: min(100%, 30rem); margin: auto auto 0; }
  #top-detail { margin-bottom: 1rem; }
}
@media (min-width: 1280px) { body[data-tab="meeting"] .detail-columns { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); } }

/* ---- Karte ---- */
.map { height: 260px; margin-top: .6rem; overflow: hidden; border-radius: var(--radius-small); background: var(--fill); isolation: isolate; }
.map.is-editable { cursor: crosshair; }
.map.leaflet-container { font: inherit; font-size: .75rem; }
.map-pin { background: none; border: 0; }
.map-pin span { position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border: 3px solid #fff; border-radius: 50% 50% 50% 0; background: var(--spd); box-shadow: 0 2px 6px #00000066; transform: rotate(-45deg); }
.map-pin span::after { content: ""; position: absolute; top: 6px; left: 6px; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
/* Lage nur aus der Adresse geschätzt: grauer statt roter Pin. */
.map.is-approximate .map-pin span { background: #6c6c70; }
.map-caption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem .8rem; margin-top: .4rem; color: var(--secondary); font-size: .82rem; }

/* ---- Verlauf / Journal ---- */
.timeline { margin: 0; padding: .2rem 0 0; list-style: none; }
.timeline li { position: relative; padding: 0 0 1rem 1.6rem; }
.timeline li::before { content: ""; position: absolute; top: .38rem; left: .2rem; width: 10px; height: 10px; border: 2px solid var(--tint); border-radius: 50%; background: var(--card); }
.timeline li::after { content: ""; position: absolute; top: 1.1rem; bottom: -.2rem; left: calc(.2rem + 4px); width: 2px; border-radius: 1px; background: var(--fill-strong); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline li.system::before { border-color: var(--tertiary); }
.timeline-summary { font-size: .93rem; overflow-wrap: anywhere; }
.timeline-meta { margin-top: .1rem; color: var(--secondary); font-size: .8rem; }
.timeline-meta a { text-decoration: none; }
.timeline-empty { color: var(--secondary); font-size: .9rem; }

/* ---- Sheets und Dialoge ---- */
dialog { color: var(--label); }
dialog::backdrop { background: #00000066; }
.sheet { width: min(100%, 560px); max-width: 100%; max-height: min(92dvh, 900px); margin: auto auto 0; padding: 0; overflow: auto; border: 0; border-radius: 18px 18px 0 0; background: var(--bg); box-shadow: var(--shadow); overscroll-behavior: contain; }
.sheet[open] { animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-up { from { transform: translateY(40%); opacity: .4; } }
.sheet-head { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .9rem 1rem .7rem; background: var(--bg); }
.sheet-head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 5px; border-radius: 3px; background: var(--fill-strong); transform: translateX(-50%); }
.sheet-head h2 { font-size: 1.05rem; font-weight: 650; }
.sheet-body { padding: 0 1rem calc(1.4rem + env(safe-area-inset-bottom)); }
.sheet-body .card:first-child, .sheet-body .list:first-child { margin-top: .2rem; }
.alert { width: min(calc(100% - 3rem), 300px); padding: 0; border: 0; border-radius: 14px; background: var(--card-raised); box-shadow: var(--shadow); text-align: center; }
.alert[open] { animation: alert-in .18s ease-out; }
@keyframes alert-in { from { transform: scale(1.08); opacity: 0; } }
.alert-body { padding: 1.2rem 1rem 1rem; font-size: .95rem; line-height: 1.4; }
.alert-actions { display: flex; border-top: .5px solid var(--separator); }
.alert-actions button { flex: 1 1 0; min-height: 46px; padding: .5rem; border: 0; color: var(--tint); background: none; font-size: 1.02rem; }
.alert-actions button + button { border-left: .5px solid var(--separator); font-weight: 650; }
.alert-actions button.destructive { color: var(--red); }
.alert-actions button:active { background: var(--fill); }
@media (prefers-reduced-motion: reduce) { .sheet[open], .alert[open] { animation: none; } }

.toast-host { position: fixed; z-index: 60; top: calc(env(safe-area-inset-top) + .6rem); right: 0; left: 0; display: grid; justify-items: center; gap: .4rem; pointer-events: none; }
.toast { max-width: min(calc(100% - 2rem), 460px); padding: .65rem 1rem; border-radius: 999px; color: var(--label); background: var(--card-raised); box-shadow: var(--shadow); border: .5px solid var(--separator); font-size: .9rem; font-weight: 500; animation: toast-in .25s ease-out; }
.toast[data-state="error"] { color: var(--red); }
.toast[data-state="success"]::before { content: "✓  "; color: var(--green); font-weight: 700; }
@keyframes toast-in { from { transform: translateY(-120%); opacity: 0; } }

/* ---- Zugangshinweis ---- */
.gate { display: grid; justify-items: center; gap: .8rem; max-width: 440px; margin: 12vh auto 0; padding: 2rem 1.25rem; border-radius: 22px; background: var(--card); text-align: center; }
.gate-icon { display: grid; width: 68px; height: 68px; place-items: center; border-radius: 18px; color: #fff; background: linear-gradient(145deg, #ffb340, #ff8a00); }
.gate-icon svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gate h1 { font-size: 1.45rem; letter-spacing: -.015em; }
.gate p { color: var(--secondary); font-size: .96rem; line-height: 1.45; }
.gate .actions { justify-content: center; }

/* ---- Anmeldung ---- */
.auth-page { display: grid; align-content: start; justify-items: center; min-height: 100dvh; padding: max(6vh, 1.5rem) 1rem 2rem; }
.auth-box { width: min(100%, 400px); }
.auth-logo { display: grid; width: 76px; height: 76px; margin: 0 auto 1rem; place-items: center; border-radius: 8px; color: #fff; background: var(--spd); box-shadow: 0 10px 24px #e3000f40; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; }
.auth-box h1 { font-size: 1.75rem; font-weight: 750; letter-spacing: -.02em; text-align: center; }
.auth-box .lead { margin: .35rem auto 1.4rem; text-align: center; }
.brand small { color: var(--secondary); font-size: .72rem; font-weight: 500; letter-spacing: 0; }
.brand-text { display: grid; min-width: 0; line-height: 1.15; }
.auth-footer { margin-top: 1.4rem; color: var(--secondary); font-size: .88rem; text-align: center; }

/* ---- Recherche ---- */
.searchbar { position: relative; margin-top: .8rem; }
.searchbar svg { position: absolute; top: 50%; left: .7rem; width: 18px; height: 18px; fill: none; stroke: var(--tertiary); stroke-width: 2.2; stroke-linecap: round; transform: translateY(-50%); pointer-events: none; }
.searchbar input { width: 100%; min-height: 42px; padding: .5rem .9rem .5rem 2.3rem; border: 0; border-radius: 11px; background: var(--fill); font-size: 1.02rem; -webkit-appearance: none; appearance: none; }
.searchbar input:focus { outline: none; box-shadow: 0 0 0 3px var(--tint-soft); }
.folds { overflow: hidden; border-radius: var(--radius); background: var(--card); }
.fold { margin: 0; padding: 0; border: 0; }
.fold + .fold { border-top: .5px solid var(--separator); }
.fold summary { display: flex; align-items: center; gap: .6rem; width: auto; min-height: 46px; margin: 0; padding: .6rem 1rem; color: var(--label); font-size: .95rem; cursor: pointer; list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: ""; flex: 0 0 auto; width: 8px; height: 8px; margin-right: .2rem; border-right: 2px solid var(--tertiary); border-bottom: 2px solid var(--tertiary); transform: rotate(-45deg); transition: transform .15s ease; }
.fold[open] summary::after { transform: rotate(45deg); }
.fold summary small { margin-left: auto; color: var(--secondary); font-size: .82rem; }
.fold summary:hover { background: var(--fill); }
.fold-body { padding: .2rem 1rem 1rem; }
.list.compact { margin-top: 0; }
.list.compact .row { min-height: 0; padding: .45rem 0; gap: .6rem; }
.list.compact .row-icon { width: 30px; height: 30px; border-radius: 7px; font-size: .58rem; }
.list.compact .row-title { font-size: .9rem; font-weight: 550; }
.list.compact .row-sub { font-size: .76rem; }
.sync-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .8rem; margin-top: .7rem; padding-top: .6rem; border-top: .5px solid var(--separator); }
.sync-row .field-hint { flex: 1 1 16rem; margin: 0; }
.sync-row .link-button { font-size: .86rem; }
.sync-row .status { flex: 1 1 100%; min-height: 0; margin-top: 0; }
.filters { margin-top: .7rem; }
.filters summary { width: fit-content; color: var(--tint); font-size: .92rem; cursor: pointer; }
.date-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; padding-top: .7rem; }
.results-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 1.5rem 1rem .4rem; }
.results-heading h2 { color: var(--secondary); font-size: .8rem; font-weight: 500; letter-spacing: .02em; text-transform: uppercase; }
.results-count { color: var(--secondary); font-size: .8rem; }
.results-list { display: grid; gap: .7rem; }
.result-card { padding: 1rem; border-radius: var(--radius); background: var(--card); }
.result-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin-bottom: .5rem; color: var(--secondary); font-size: .82rem; }
.result-date { color: var(--label); font-weight: 650; }
.result-source { overflow-wrap: anywhere; }
.pdf-download { font-weight: 500; text-decoration: none; }
.result-snippet { font-size: .95rem; line-height: 1.5; overflow-wrap: anywhere; }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin-top: .7rem; }
.result-actions a { text-decoration: none; }
.source-page h3 a { text-decoration: none; }
/* ---- Leseansicht (dokument.html) ---- */
.reader-back { margin-top: .4rem; text-decoration: none; }
@media (min-width: 900px) { a.reader-back { display: inline-flex; } }
.reader { margin-top: .8rem; }
.reader-searchbar { margin: 0; }
.reader-pages { display: grid; gap: .8rem; margin-top: .6rem; }
.reader-page { scroll-margin-top: 4rem; }
.reader-page.is-current { box-shadow: 0 0 0 2px var(--tint), var(--shadow); }
.reader-page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; padding-bottom: .5rem; border-bottom: .5px solid var(--separator); }
.reader-page-head h2 { color: var(--secondary); font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.reader-page-tools { display: flex; gap: .9rem; margin-left: auto; font-size: .86rem; }
.reader-page-tools a { text-decoration: none; }
.reader-page-tools .link-button { font-size: .86rem; }
.reader-text { margin-top: .6rem; font-size: 1rem; line-height: 1.55; overflow-wrap: anywhere; }
.reader-text p { margin-top: .6rem; white-space: pre-line; }
.reader-text h3 { margin-top: 1rem; color: var(--tint); font-size: .8rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.reader-text > :first-child { margin-top: 0; }
.reader-notes:not(:empty) { margin-top: .9rem; padding: .1rem .8rem .7rem; border-radius: var(--radius-small); background: var(--fill); }
.reader-notes .note:first-child { border-top: 0; }
.reader-notes .note-list { margin-top: 0; }
.reader-compose { padding-top: .7rem; }
.note-quote { margin: .3rem 0 0; padding-left: .6rem; border-left: 3px solid var(--tint); color: var(--secondary); font-size: .86rem; font-style: italic; line-height: 1.4; }
.reader-aside { display: grid; gap: .8rem; margin-top: .8rem; }
.reader-aside .card { margin: 0; }
.reader-jump { margin-top: .4rem; max-height: 40vh; overflow: auto; scrollbar-width: thin; }
.reader-jump-row { display: grid; gap: .1rem; padding: .5rem 0; color: var(--label); font-size: .88rem; text-decoration: none; }
.reader-jump-row span { display: -webkit-box; overflow: hidden; color: var(--secondary); font-size: .8rem; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
@media (max-width: 899px) { body[data-page="reader"] .page { padding-bottom: 6.5rem; } }
@media (min-width: 1000px) {
  .reader { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 330px); gap: 1.5rem; align-items: start; }
  .reader-main { display: flex; flex-direction: column; min-height: calc(100dvh - var(--navbar-height) - 9rem); }
  .reader-aside { position: sticky; top: calc(var(--navbar-height) + .75rem); max-height: calc(100dvh - var(--navbar-height) - 1.5rem); margin-top: 0; overflow: auto; scrollbar-width: thin; }
  .reader-jump { max-height: 32vh; }
}
.result-pages { margin-top: .7rem; padding-top: .6rem; border-top: .5px solid var(--separator); }
.result-pages summary { width: fit-content; color: var(--tint); font-size: .9rem; cursor: pointer; }
.source-page { margin-top: .7rem; padding: .8rem; border-radius: var(--radius-small); background: var(--fill); }
.source-page h3 { margin-bottom: .3rem; color: var(--secondary); font-size: .78rem; font-weight: 600; }
.source-page p { font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.more-pages { margin-top: .6rem; color: var(--secondary); font-size: .82rem; }

/* ---- Werkstatt ---- */
.readonly-text { margin-top: .6rem; padding: .9rem; border-radius: var(--radius-small); background: var(--fill); font-size: .93rem; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.agent-head { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: .8rem; }
.agent-mark { display: grid; flex: 0 0 auto; width: 40px; height: 40px; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(145deg, #5e5ce6, #0a84ff); font-weight: 800; }
.agent-running { display: flex; align-items: center; gap: .6rem; margin: .2rem 0 .8rem; color: var(--blue); font-size: .95rem; font-weight: 550; }
.spinner { width: 20px; height: 20px; border: 3px solid var(--blue-soft); border-top-color: var(--blue); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.agent-error { margin: .2rem 0 .8rem; padding: .65rem .8rem; border-radius: var(--radius-small); color: var(--red); background: var(--red-soft); font-size: .88rem; }
details.disclosure { margin-top: 1rem; padding-top: .8rem; border-top: .5px solid var(--separator); }
details.disclosure summary { color: var(--tint); font-size: .92rem; cursor: pointer; }
details.disclosure > * + * { margin-top: .6rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: .9rem 0 0; font-size: .93rem; }
.kv dt { color: var(--secondary); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv a { text-decoration: none; }
.pre-text { margin-top: .5rem; font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.share-box { display: grid; gap: .5rem; }
.share-box code { overflow-wrap: anywhere; }
.chip-row { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ---- Aueklick (öffentliches Ideenformular) ---- */
.idea-form { display: grid; gap: 1.4rem; }
.idea-step { min-width: 0; margin: 0; }
.idea-step legend, .idea-step > label:not(.file-picker):not(.consent), .idea-label-row label { margin-bottom: .5rem; padding: 0; color: var(--label); font-size: 1rem; font-weight: 650; }
.idea-label-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .5rem; }
.idea-label-row label { margin-bottom: 0; }
.required-mark, .optional-mark { margin-left: .3rem; color: var(--secondary); font-size: .76rem; font-weight: 400; }
.idea-form textarea, .idea-input { width: 100%; min-height: 50px; padding: .75rem .85rem; border: 1px solid transparent; border-radius: var(--radius-small); color: var(--label); background: var(--fill); font-size: 1.02rem; line-height: 1.45; -webkit-appearance: none; appearance: none; }
.idea-form textarea { resize: vertical; }
.idea-form textarea:focus, .idea-input:focus { border-color: var(--tint); outline: none; background: var(--card); box-shadow: 0 0 0 3px var(--tint-soft); }
.dictate-button { display: grid; flex: 0 0 auto; width: 48px; height: 48px; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #fff; background: var(--spd); box-shadow: 0 3px 10px #e3000f4d; }
.dictate-button:hover { background: #b8000c; }
.dictate-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.dictate-button.is-listening { color: #fff; background: #ff3b30; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px #ff3b3033; } }
@media (prefers-reduced-motion: reduce) { .dictate-button.is-listening { animation: none; } }
.dictate-status { margin-top: .5rem; padding: .6rem .8rem; border-radius: var(--radius-small); color: var(--green); background: var(--green-soft); font-size: .86rem; }
.dictate-status[data-state="error"] { color: var(--red); background: var(--red-soft); }
.idea-inline-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.location-result { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .75rem; margin-top: .6rem; padding: .65rem .8rem; border-radius: var(--radius-small); color: var(--green); background: var(--green-soft); font-size: .88rem; }
.choice-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice { position: relative; margin: 0; font-size: .95rem; font-weight: 500; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: inline-flex; min-height: 42px; align-items: center; padding: .45rem .95rem; border-radius: 999px; background: var(--fill); cursor: pointer; }
.choice input:checked + span { color: #fff; background: var(--spd); }
.choice input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); outline-offset: 2px; }
.consent { display: flex; align-items: flex-start; gap: .7rem; margin: 0; font-size: .92rem; line-height: 1.45; }
.consent input { flex: 0 0 auto; width: 22px; height: 22px; margin: .1rem 0 0; accent-color: var(--tint); }
.privacy-details { margin-top: .75rem; color: var(--secondary); font-size: .86rem; line-height: 1.5; }
.privacy-details summary { color: var(--tint); cursor: pointer; }
.privacy-details p { margin-top: .55rem; }
.idea-success:focus { outline: none; }
.hero-share { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .9rem; padding-top: .8rem; border-top: .5px solid var(--separator); }
.hero-share-label { color: var(--tint); font-size: .84rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.share-row { display: flex; gap: .5rem; }
.share-button { display: grid; width: 42px; height: 42px; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #fff; background: var(--spd); }
.share-button:hover { background: #b8000c; }
.share-button:active { transform: scale(.94); }
.share-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.hero .status:empty { display: none; }

/* ---- Anklänge an spd-braunschweig.de: roter Kopf mit weißer Schrift, rote
   fette Titel, Abschnittstitel mit rotem Balken, runde Knöpfe in Versalien,
   weiße Karte auf roter Schwungfläche. Die iOS-Struktur (Karten, Listen,
   Tab-Leiste) bleibt unverändert. ---- */
.navbar { border-bottom: 0; background: var(--header); box-shadow: 0 1px 6px #00000026; -webkit-backdrop-filter: none; backdrop-filter: none; }
.navbar .brand, .navbar .icon-button, .navbar .link-button { color: #fff; }
.navbar .brand small { color: #ffffffd9; }
.navbar .brand-mark, .navbar .avatar { color: #c4000d; background: #fff; }
.navbar .icon-button:hover, .navbar .icon-button[aria-expanded="true"] { background: #ffffff2e; }
.navbar .bell-badge { color: #c4000d; background: #fff; }
.navbar :focus-visible, .tabbar :focus-visible { outline-color: #fff; }
.large-title:not([style]), .auth-box h1 { color: var(--tint); font-weight: 750; }
.card > h3, .card-head > h3 { color: var(--tint); font-weight: 750; }
.section-header { margin-left: .15rem; padding-left: .6rem; border-left: 3px solid var(--spd); color: var(--label); font-size: .84rem; font-weight: 750; letter-spacing: .04em; }
.primary-button, .secondary-button, .danger-button { border-radius: 999px; }
.primary-button { font-size: .84rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.hero { position: relative; margin: 1.9rem 0 2.1rem; padding: 1.15rem 1.2rem 1.3rem; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.page:has(> .hero) { isolation: isolate; overflow-x: clip; }
.hero::before { content: ""; position: absolute; z-index: -1; inset: -1.15rem -1.6rem; border-radius: 46% 54% 38% 62% / 30% 34% 66% 70%; background: var(--spd); transform: rotate(-2.5deg); }
.hero .eyebrow { margin-top: 0; }
.wordmark { display: flex; align-items: center; gap: 0; margin: .25rem 0 0; color: var(--label); font-size: clamp(2.7rem, 13vw, 3.8rem); font-weight: 850; line-height: 1; letter-spacing: -.045em; }
.wordmark span { color: var(--tint); }
.wordmark svg { width: .62em; height: .62em; margin-left: .14em; fill: none; stroke: var(--tint); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.hero-question { margin-top: .55rem; font-size: 1.15rem; font-weight: 700; line-height: 1.25; }
.hero .lead { color: var(--label); }
.public-page .footer { display: grid; justify-items: center; gap: .5rem; width: 100%; margin-top: 2rem; padding: 1.1rem 1.25rem calc(1.1rem + env(safe-area-inset-bottom)); color: #fff; background: var(--header); text-align: center; }
.public-page .footer .link-button { color: #fff; font-size: .8rem; text-decoration: underline; }
.account-menu-version { padding: .55rem 1rem .65rem; border-top: .5px solid var(--separator); color: var(--tertiary); font-size: .74rem; font-variant-numeric: tabular-nums; }
.footer-links { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem 1.1rem; }
.public-page .footer a { color: #fff; font-size: .8rem; }
.auth-theme a { color: var(--secondary); font-size: .84rem; }
.legal { display: grid; gap: 1rem; }
.legal .status:empty, .legal .status[hidden] { display: none; }
.legal-section { scroll-margin-top: calc(var(--navbar-height) + 1rem); }
.legal-section .large-title { margin-top: 0; font-size: 1.6rem; }
.legal-heading { margin-top: 1.1rem; color: var(--tint); font-size: .84rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.legal-text { margin-top: .35rem; font-size: .95rem; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-line; }
.legal-missing { color: var(--secondary); font-style: italic; }
.theme-switch { padding: .7rem 1rem; border-top: .5px solid var(--separator); }
.theme-switch-label { display: block; margin-bottom: .4rem; color: var(--secondary); font-size: .8rem; }
.theme-switch .segmented span { padding: .38rem .3rem; font-size: .8rem; }
.theme-switch + .account-menu-item { border-top: .5px solid var(--separator); }
.auth-theme { margin-top: .9rem; text-align: center; }
.auth-theme .link-button { color: var(--secondary); font-size: .84rem; }
@media (min-width: 900px) {
  .tabbar .tab { color: #ffffffe6; }
  .tabbar .tab:hover { background: #ffffff2e; }
  .tabbar .tab[aria-current="page"] { color: #c4000d; background: #fff; }
}

.footer { width: min(100%, 760px); margin: 0 auto; padding: 0 1.9rem 1.5rem; color: var(--tertiary); font-size: .78rem; line-height: 1.4; }
.page.wide + .footer { width: min(100%, 1180px); }

/* ---- Breite Bildschirme: Tab-Leiste oben, geteilte Ansicht ---- */
@media (min-width: 900px) {
  body.has-tabbar { padding-bottom: 0; }
  .tabbar { top: 0; right: auto; bottom: auto; left: 50%; z-index: 31; gap: .25rem; min-height: var(--navbar-height); padding: 0; border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; transform: translateX(-50%); }
  .tab { flex: 0 0 auto; flex-direction: row; gap: .4rem; max-width: none; min-height: 36px; margin: auto 0; padding: 0 .7rem; border-radius: 999px; font-size: .9rem; }
  .tab svg { width: 20px; height: 20px; }
  .tab:hover { background: var(--fill); }
  .tab[aria-current="page"] { background: var(--tint-soft); }
  .tab-badge { position: static; }
  .notification-panel { right: 0; }
  .split { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
  body.detail-open .split-master, body:not(.detail-open) .split-detail { display: block; }
  .split-master { position: sticky; top: calc(var(--navbar-height) + .5rem); max-height: calc(100dvh - var(--navbar-height) - 1rem); overflow: auto; padding-bottom: 1rem; scrollbar-width: thin; }
  body:not(.detail-open) .split-detail > :not(.detail-placeholder) { display: none; }
  body:not(.detail-open) .detail-placeholder { display: grid; min-height: 50vh; place-items: center; color: var(--tertiary); font-size: 1.05rem; }
  .back-button { display: none; }
  .sheet { margin: auto; border-radius: 18px; }
  .sheet-head::before { display: none; }
}

@media (max-width: 560px) {
  .fields { grid-template-columns: 1fr; }
  .field { grid-column: 1 / -1; }
  .date-fields { grid-template-columns: 1fr; }
  .actions > .primary-button, .actions > .secondary-button, .actions > .danger-button { flex: 1 1 100%; }
  .file-picker { flex-wrap: wrap; }
  .file-picker small { width: 100%; margin: -.4rem 0 0 2.4rem; text-align: left; }
  .idea-inline-actions > button { width: 100%; }
  .choice-row { display: grid; }
  .choice span { width: 100%; }
  .kv { grid-template-columns: 1fr; gap: .05rem; }
  .kv dd { margin-bottom: .5rem; }
}

/* Zwischenbreiten: Platz für die mittige Tab-Leiste lassen. */
@media (min-width: 900px) and (max-width: 1250px) { .brand small { display: none; } }
@media (max-width: 380px) { .brand small { display: none; } }
@media (min-width: 1280px) { .detail-columns:has(> .detail-aside[hidden]) { grid-template-columns: minmax(0, 1fr); } }

/* ---- Einstellungen ---- */
.settings-tabs { margin-top: .8rem; overflow-x: auto; scrollbar-width: none; }
.settings-tabs span { padding: .38rem .45rem; font-size: .82rem; }
.settings-panel { margin-top: .6rem; }
.settings-panel > .lead { margin-top: .9rem; }
.inline-check { display: inline-flex; align-items: center; gap: .4rem; margin-top: .35rem; color: var(--secondary); font-size: .84rem; font-weight: 500; }
.inline-check input { width: 18px; height: 18px; accent-color: var(--tint); }

/* Lange Texte eingeklappt (Sachverhalt, Stellungnahmen) */
.collapsible.is-collapsed { position: relative; max-height: 13.5em; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 65%, transparent); mask-image: linear-gradient(to bottom, #000 65%, transparent); }
.collapse-toggle { display: inline-flex; align-items: center; min-height: 44px; margin-top: .1rem; font-weight: 600; }

/* Mit einem TOP verknüpfte Dokumente (Stellungnahmen) */
.file-button { position: relative; overflow: hidden; cursor: pointer; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-button:focus-within { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); outline-offset: 2px; }
.linked-list { margin: .6rem 0 0; padding: 0; list-style: none; }
.linked-list:empty { display: none; }
.linked-doc { padding: .7rem 0; border-top: .5px solid var(--separator); }
.linked-doc:first-child { border-top: 0; padding-top: .2rem; }
.linked-doc-head { display: flex; align-items: flex-start; gap: .6rem; }
.linked-doc-head .row-main { flex: 1 1 auto; min-width: 0; }
.linked-doc-title { font-weight: 600; overflow-wrap: anywhere; }
.linked-doc-meta { color: var(--secondary); font-size: .8rem; }
.linked-doc .pre-text { margin-top: .5rem; font-size: .93rem; }
.linked-doc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin-top: .4rem; }
.linked-doc-actions .link-button, .linked-doc-actions a { font-size: .85rem; }
.file-button.is-busy { opacity: .55; pointer-events: none; }

/* Ladeanzeige: Balken unter der Kopfleiste, Hinweis bei langer Dauer */
.activity-bar { position: fixed; z-index: 60; top: env(safe-area-inset-top); left: 0; right: 0; height: 3px; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .2s ease; }
.activity-bar.is-active { opacity: 1; }
.activity-bar::before { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; border-radius: 3px; background: #fff; box-shadow: 0 0 6px #0006; animation: activity-slide 1.1s ease-in-out infinite; }
@keyframes activity-slide { to { left: 100%; } }
.slow-notice { position: fixed; z-index: 61; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 132px); width: max-content; max-width: min(92vw, 520px); padding: .55rem .9rem; border-radius: 12px; color: #fff; background: #333c; box-shadow: var(--shadow); font-size: .85rem; transform: translateX(-50%); backdrop-filter: blur(10px); }
.loading-line { display: flex; align-items: center; gap: .55rem; color: var(--secondary); font-size: .9rem; }
.spinner { flex: 0 0 auto; width: 16px; height: 16px; border: 2px solid color-mix(in srgb, var(--secondary) 35%, transparent); border-top-color: var(--tint); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-line .retry-button { font-size: inherit; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .activity-bar::before, .spinner { animation-duration: 3s; } }
.sync-state { display: block; margin-top: .25rem; color: var(--red); font-size: .8rem; }
.sync-state .retry-button { font-size: .8rem; }
.offline-notice { position: fixed; z-index: 62; left: 50%; top: calc(env(safe-area-inset-top) + 60px); width: max-content; max-width: min(92vw, 520px); padding: .55rem .9rem; border-radius: 12px; color: #fff; background: #b00020; box-shadow: var(--shadow); font-size: .85rem; font-weight: 600; transform: translateX(-50%); }
.detail-sync { margin: .3rem 0 .4rem; padding: .5rem .7rem; border-radius: 10px; background: color-mix(in srgb, var(--red) 12%, transparent); }
.detail-sync .sync-state { margin: 0; }
/* Popover-Grundstil des Browsers (inset: 0, margin: auto, Rahmen) neutralisieren. */
.slow-notice[popover], .offline-notice[popover] { right: auto; margin: 0; border: 0; overflow: visible; }
.slow-notice[popover] { top: auto; }
.offline-notice[popover] { bottom: auto; }

/* Statistik: Kennzahl-Kacheln und Säulen je Tag */
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-top: 1rem; }
@media (min-width: 760px) { .stat-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat-tile { padding: .9rem 1rem; border-radius: var(--radius); background: var(--card); }
.stat-label { margin: 0; color: var(--secondary); font-size: .82rem; font-weight: 600; }
.stat-value { margin: .3rem 0 0; color: var(--label); font-size: 2rem; font-weight: 650; line-height: 1.1; }
.stat-unit { margin: 0; color: var(--secondary); font-size: .8rem; }
.stat-sub { margin: .5rem 0 0; padding-top: .45rem; border-top: .5px solid var(--separator); color: var(--label); font-size: .85rem; }
.chart-card { position: relative; }
.chart-title { margin: 0 0 .8rem; font-size: 1rem; }
.chart-tooltip { position: absolute; z-index: 5; display: flex; flex-direction: column; gap: .1rem; padding: .45rem .65rem; border-radius: 10px; color: var(--label); background: var(--card-raised); box-shadow: var(--shadow); font-size: .8rem; pointer-events: none; white-space: nowrap; }
.chart-tooltip[hidden] { display: none; }
.chart-table { margin-top: .9rem; font-size: .85rem; }
.chart-table summary { color: var(--tint); cursor: pointer; font-weight: 600; }
.chart-table table { width: 100%; margin-top: .5rem; border-collapse: collapse; }
.chart-table th, .chart-table td { padding: .3rem .2rem; border-bottom: .5px solid var(--separator); text-align: left; }
.chart-table .num, .chart-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }

/* Statistik „Fraktionen“: gestapelte Balken je Fraktion (Anträge, Anfragen) */
:root { --kind-antrag: #2a78d6; --kind-anfrage: #eb6834; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --kind-antrag: #3987e5; --kind-anfrage: #d95926; } }
:root[data-theme="dark"] { --kind-antrag: #3987e5; --kind-anfrage: #d95926; }
.stats-panel { margin-top: .8rem; }
.faction-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-top: .8rem; }
.faction-controls .segmented { flex: 1 1 100%; }
.faction-period { flex: 1 1 18rem; margin: 0; }
.faction-headline { margin: 1rem 0 0; font-size: 1.05rem; }
.chart-legend { display: flex; gap: 1rem; margin: -.3rem 0 .8rem; color: var(--secondary); font-size: .8rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.kind-antrag { background: var(--kind-antrag); }
.kind-anfrage { background: var(--kind-anfrage); }
.faction-chart { display: grid; gap: .55rem; }
.faction-row { display: grid; grid-template-columns: minmax(5.5rem, 9rem) 1fr; align-items: center; gap: .6rem; padding: .15rem .25rem; border-radius: 8px; outline: none; }
.faction-row:hover, .faction-row:focus-visible { background: color-mix(in srgb, var(--secondary) 10%, transparent); }
.faction-row:focus-visible { box-shadow: 0 0 0 2px var(--tint); }
.faction-name { overflow: hidden; color: var(--label); font-size: .88rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.faction-track { display: flex; align-items: center; gap: 2px; min-width: 0; height: 20px; }
.faction-segment { flex: 0 0 auto; height: 100%; min-width: 3px; }
.faction-segment.is-end { border-radius: 0 4px 4px 0; }
.faction-total { margin-left: .4rem; color: var(--label); font-size: .82rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.faction-items { margin-top: 1rem; }
.faction-items summary { color: var(--tint); cursor: pointer; font-weight: 600; }
.faction-item-list { margin: .6rem 0 0; padding: 0; list-style: none; }
.faction-item { display: grid; gap: .1rem; padding: .55rem 0; border-top: .5px solid var(--separator); }
.faction-item-meta { display: flex; align-items: center; gap: .4rem; color: var(--secondary); font-size: .78rem; }
.kind-dot { display: inline-block; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; }
.faction-item-title { color: var(--label); font-size: .92rem; }
a.faction-item-title { color: var(--tint); }
.faction-item-ref { color: var(--secondary); font-size: .75rem; }

/* Statistik Aueklick: Verlauf als Liniendiagramm (eine Reihe, Blau aus der geprüften Palette) */
.resolution-tabs { margin: 0 0 .5rem; }
.resolution-tabs span { padding-left: .2rem; padding-right: .2rem; font-size: .8rem; }
.chart-caption { margin: 0 0 .4rem; color: var(--secondary); font-size: .8rem; }
.line-chart { position: relative; min-height: 200px; }
.line-svg { display: block; overflow: visible; touch-action: pan-y; outline: none; }
.line-svg:focus-visible { box-shadow: 0 0 0 2px var(--tint); border-radius: 6px; }
.line-svg .grid { stroke: var(--separator); stroke-width: 1; }
.line-svg .baseline { stroke: color-mix(in srgb, var(--secondary) 45%, transparent); stroke-width: 1; }
.line-svg .axis-label { fill: var(--secondary); font-size: 11px; font-variant-numeric: tabular-nums; }
.line-svg .area { fill: var(--kind-antrag); opacity: .1; }
.line-svg .line { fill: none; stroke: var(--kind-antrag); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line-svg .marker { fill: var(--kind-antrag); stroke: var(--card); stroke-width: 2; }
.line-svg .crosshair { stroke: var(--secondary); stroke-width: 1; }
.line-svg .focus-dot { fill: var(--kind-antrag); stroke: var(--card); stroke-width: 2; }
.tooltip-row { display: inline-flex; align-items: center; gap: .35rem; }
.line-key { display: inline-block; width: 12px; height: 2px; border-radius: 1px; background: var(--kind-antrag); }

/* Sechs Reiter: auf mittelbreiten Bildschirmen enger, damit sie nicht an Logo und Profil stoßen. */
@media (min-width: 900px) and (max-width: 1099px) {
  .tabbar { gap: .1rem; }
  .tab { gap: .3rem; padding: 0 .5rem; font-size: .86rem; }
}

/* Aueklick: Häufige Fragen */
.faq { margin-top: 1.5rem; }
.faq-item { margin-top: .5rem; padding: .8rem 1rem; border-radius: var(--radius); background: var(--card); }
.faq-item summary { color: var(--label); cursor: pointer; font-weight: 650; }
.faq-item p { margin: .5rem 0 0; color: var(--secondary); line-height: 1.5; }
.stat-rejected { margin: .25rem 0 0; color: var(--secondary); font-size: .78rem; }

/* Testversion: Banner über der Kopfleiste, Kopfleiste orange statt rot */
.env-banner { flex: 0 0 auto; margin: 0 .5rem 0 .6rem; padding: .22rem .55rem; border-radius: 6px; color: #1d1d1f; background: repeating-linear-gradient(135deg, #ffcc00 0 8px, #ffd633 8px 16px); font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; cursor: help; }
.env-short { display: none; }
/* Mittelbreite Desktops: neben sechs Reitern ist nur Platz für „Test“. */
@media (min-width: 900px) and (max-width: 1279px) { .env-long { display: none; } .env-short { display: inline; } }
@media (max-width: 419px) { .env-long { display: none; } .env-short { display: inline; } }
.navbar > .env-banner { margin-left: auto; }
/* Ohne Kopfleiste (Sonderfall): als Streifen ganz oben. */
body > .env-banner { display: block; margin: 0; border-radius: 0; text-align: center; }
.is-test-env .navbar { background: #b45309; }

/* Schwebender Knopf „Neue Idee“ (alle App-Seiten) */
.fab-idea { position: fixed; z-index: 25; right: max(1rem, env(safe-area-inset-right)); bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom) + 1rem); display: inline-flex; align-items: center; justify-content: center; gap: .45rem; width: 56px; height: 56px; border-radius: 999px; color: #fff; background: var(--tint); box-shadow: 0 6px 18px #0000003d; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.fab-idea:hover { transform: translateY(-2px); box-shadow: 0 10px 24px #00000047; }
.fab-idea:focus-visible { outline: 3px solid color-mix(in srgb, var(--tint) 45%, #fff); outline-offset: 3px; }
.fab-idea svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.fab-label { display: none; font-size: .92rem; font-weight: 700; }
/* Handy, Sitzung mit geöffnetem Punkt: Weiter-Leiste schmaler, der Ideen-Knopf
   sitzt rechts daneben auf gleicher Höhe (statt darüber zu schweben). */
@media (max-width: 899px) {
  body.detail-open .step-bar { min-height: 56px; margin-right: calc(56px + .6rem); }
  body.detail-open .step-bar button { min-width: 5rem; }
  body.detail-open:has(.step-bar) .fab-idea { bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom) + .5rem); }
}
@media (min-width: 900px) {
  .fab-idea { bottom: 1.5rem; width: auto; padding: 0 1.15rem 0 .95rem; }
  .fab-label { display: inline; }
}
@media print { .fab-idea { display: none; } }
body:has(.fab-idea) .page { padding-bottom: 6rem; }

/* Ideen: Suche und Archiv */
.idea-search { margin: .6rem 0 .2rem; }
.archive-group { margin-top: 1.4rem; }
.archive-group > summary { cursor: pointer; list-style: revert; }
.row.is-archived .row-title { color: var(--secondary); }
.badge-archived { color: var(--secondary); background: var(--gray-soft); }
.archive-banner { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; margin-top: .6rem; }
.archive-banner .pre-text { margin-top: .3rem; font-size: .92rem; }

/* Benachrichtigungen: Schalter E-Mail/Push je Art und Push je Gerät */
.notify-toggles { display: flex; flex: 0 0 auto; gap: .6rem; }
.notify-toggle { display: grid; justify-items: center; gap: .2rem; }
.notify-toggle small { color: var(--secondary); font-size: .72rem; font-weight: 600; letter-spacing: .02em; }
.push-device { margin-bottom: .9rem; }
.push-device-actions { display: flex; flex: 0 0 auto; align-items: center; gap: .9rem; }

/* Rückfrage mit Erklärung (z. B. „Allmighty schreibt den Text“) */
.alert.alert-rich { width: min(calc(100% - 2rem), 420px); text-align: left; }
.alert-rich .alert-body { padding: 1.2rem 1.2rem 1rem; }
.alert-rich .explain { display: grid; gap: .55rem; }
.alert-rich .alert-body strong { font-size: 1.05rem; }
.alert-rich .alert-body p, .alert-rich .alert-body ol { margin: 0; }
.alert-rich .alert-body ol { display: grid; gap: .35rem; padding-left: 1.2rem; }
.alert-rich .explain-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: #fff; background: var(--tint); font-weight: 750; font-size: 1.2rem; }
/* Schreibweg in der Werkstatt */
.mode-hint { margin-top: .35rem; }

/* Ideen: Zuständigkeiten (Leiste unter dem Titel, Auswahlblatt) */
.assignee-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .7rem 0 .9rem; padding: .55rem .6rem .55rem .7rem; border-radius: var(--radius); background: var(--card); box-shadow: 0 1px 2px #0000000f; }
.assignee-stack { display: flex; flex: 1 1 14rem; align-items: center; gap: .7rem; min-width: 0; padding: .15rem; border: 0; border-radius: 10px; color: inherit; background: none; text-align: left; cursor: pointer; }
.assignee-stack:hover { background: var(--fill); }
.assignee-avatars { display: flex; flex: 0 0 auto; }
.assignee-avatars .assignee-avatar + .assignee-avatar { margin-left: -9px; }
.assignee-avatar { display: grid; flex: 0 0 34px; place-items: center; box-sizing: border-box; width: 34px; min-width: 34px; height: 34px; padding: 0; line-height: 1; border: 2px solid var(--card); border-radius: 50%; color: var(--tint); background: color-mix(in srgb, var(--tint) 14%, var(--card)); font-size: .78rem; font-weight: 700; }
.assignee-avatar.is-me { color: #fff; background: var(--tint); }
.assignee-avatar.more { color: var(--secondary); background: var(--fill-strong); }
.assignee-avatar.empty { border: 2px dashed var(--fill-strong); color: var(--secondary); background: none; font-size: 1.1rem; font-weight: 500; }
.assignee-summary { display: grid; min-width: 0; line-height: 1.25; }
.assignee-summary small { color: var(--secondary); font-size: .72rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.assignee-summary strong { overflow: hidden; font-size: .95rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.assign-me { display: inline-flex; flex: 0 0 auto; align-items: center; gap: .4rem; min-height: 40px; padding: 0 1rem 0 .8rem; border: 0; border-radius: 999px; color: #fff; background: var(--tint); font-size: .92rem; font-weight: 650; cursor: pointer; }
.assign-me svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.assign-me[hidden] { display: none; }
.assignee-avatars .assignee-avatar.empty { margin-left: 4px; }
.assignee-stack:hover .assignee-avatar.empty, .assignee-stack:focus-visible .assignee-avatar.empty { border-color: var(--tint); color: var(--tint); }
.assignee-chevron { flex: 0 0 auto; width: 18px; height: 18px; margin-left: auto; fill: none; stroke: var(--tertiary, var(--secondary)); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.assign-more { display: inline-flex; flex: 0 0 auto; align-items: center; gap: .4rem; min-height: 40px; padding: 0 1rem 0 .8rem; border: 0; border-radius: 999px; color: var(--tint); background: color-mix(in srgb, var(--tint) 12%, transparent); font-size: .92rem; font-weight: 650; cursor: pointer; }
.assign-more svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.assign-more[hidden] { display: none; }
.member-picker { margin: 0; }
.member-row { cursor: pointer; }
.member-row .assignee-avatar { border-color: transparent; }
.member-check { display: grid; flex: 0 0 auto; place-items: center; width: 26px; height: 26px; border: 2px solid var(--fill-strong); border-radius: 50%; }
.member-row.is-selected .member-check { border-color: var(--tint); background: var(--tint); }
.member-row.is-selected .member-check::after { content: ""; width: 6px; height: 11px; margin-top: -3px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.badge-assignee { color: var(--secondary); background: var(--fill); }
.badge-assignee.is-me { color: var(--tint); background: color-mix(in srgb, var(--tint) 14%, transparent); }

/* ---------- Sitzungsplanung (Werkstatt) */
.planner-options { display: grid; gap: .6rem; }
.planner-options.disabled .plan-option { cursor: default; opacity: .65; }
.plan-meetings { display: grid; gap: .6rem; }
.plan-alternatives { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; }
.plan-option { position: relative; display: flex; align-items: center; gap: .75rem; padding: .7rem 2.3rem .7rem .7rem; border: 1.5px solid var(--separator); border-radius: var(--radius-small); background: var(--card); cursor: pointer; transition: border-color .15s, background-color .15s; }
.plan-option:hover { border-color: var(--fill-strong); }
.plan-option:has(input:focus-visible) { outline: 2px solid var(--tint); outline-offset: 2px; }
.plan-option.selected { border-color: var(--tint); background: var(--tint-soft); }
.plan-simple { padding-block: .55rem; }
.plan-body { display: grid; gap: .1rem; min-width: 0; }
.plan-body strong { font-size: .95rem; font-weight: 600; color: var(--label); }
.plan-name { color: var(--secondary); font-size: .84rem; line-height: 1.3; overflow-wrap: anywhere; }
.plan-meta { margin-top: .2rem; justify-self: start; padding: .1rem .45rem; border-radius: 999px; background: var(--fill); color: var(--secondary); font-size: .76rem; font-weight: 500; }
.plan-meta.soon { background: var(--orange-soft); color: var(--orange); }
.plan-meta.warn { background: var(--red-soft); color: var(--red); }
.plan-meta.done { background: var(--green-soft); color: var(--green); }
.plan-leaf { flex: none; display: grid; grid-template-rows: auto 1fr; width: 3.1rem; overflow: hidden; border-radius: 9px; background: var(--card-raised); box-shadow: inset 0 0 0 1px var(--separator); text-align: center; }
.plan-leaf-month { padding: .12rem 0; background: var(--tint); color: var(--on-tint); font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.plan-leaf-day { padding: .18rem 0 .25rem; color: var(--label); font-size: 1.35rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.plan-icon { flex: none; display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--fill); color: var(--secondary); }
.plan-icon svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.plan-later.selected .plan-icon { background: var(--blue-soft); color: var(--blue); }
.plan-check { position: absolute; top: 50%; right: .75rem; width: 1.15rem; height: 1.15rem; margin-top: -.575rem; border: 1.5px solid var(--fill-strong); border-radius: 50%; }
.plan-option.selected .plan-check { border-color: var(--tint); background: var(--tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 75% no-repeat; }

/* ---------- Werkstatt: Prozessschritte bleiben beim Scrollen sichtbar */
#editor-steps { position: sticky; z-index: 6; top: calc(var(--navbar-height) + env(safe-area-inset-top)); margin-inline: -.5rem; padding: .35rem .5rem .55rem; background: var(--bg); transition: box-shadow .2s; }
#editor-steps.stuck { box-shadow: 0 6px 10px -8px #00000040; }
@media (min-width: 1280px) {
  #proposal-editor .detail-aside { top: calc(var(--navbar-height) + 3.4rem); max-height: calc(100dvh - var(--navbar-height) - 4.4rem); }
}

/* ---------- Einheitliche Detailseiten: Verknüpfungen, Weitere Aktionen */
.linked-list { margin-top: .5rem; }
.linked-list:empty { display: none; }
.linked-list .row { padding-inline: 0; }
.linked-empty { margin-top: .6rem; }
.picker-group { margin: 1.1rem .2rem .4rem; color: var(--secondary); font-size: .78rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
#link-results .member-row .row-meta .row-sub { margin-left: .15rem; }

/* Kopfaktionen (Archivieren, Löschen) oben rechts auf Detailseiten */
.detail-topbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 36px; }
.detail-topbar .eyebrow { flex: 1 1 auto; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-actions { display: flex; flex: none; gap: .4rem; }
.head-action { display: inline-flex; align-items: center; gap: .4rem; min-height: 36px; padding: 0 .9rem 0 .75rem; border: 0; border-radius: 999px; color: var(--label); background: var(--fill); font-size: .88rem; font-weight: 600; cursor: pointer; transition: background-color .15s, color .15s; }
.head-action:hover { background: var(--fill-strong); }
.head-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.head-action.danger { color: var(--red); background: var(--red-soft); }
.head-action.danger:hover { color: #fff; background: var(--red); }
.head-action[hidden] { display: none; }
.head-action:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
@media (max-width: 480px) {
  .head-action { justify-content: center; width: 38px; min-height: 38px; padding: 0; }
  .head-action span { display: none; }
}

.reload-button.spinning svg { animation: reload-spin .8s linear infinite; }
@keyframes reload-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .reload-button.spinning svg { animation: none; opacity: .5; } }

/* Anmeldung: Passwort vergessen / zurücksetzen */
.auth-link { margin: 0; text-align: center; }
.auth-form-title { margin: 0; font-size: 1.15rem; font-weight: 700; }

/* ---------- Ideen: Kachelansicht */
/* Suchfeld und Schalter in einer Höhe. */
.board-controls { --control-height: 40px; display: grid; gap: .6rem; margin-top: .9rem; }
.board-controls .board-search { margin-top: 0; }
.board-controls .board-search input { height: var(--control-height); min-height: var(--control-height); padding-block: 0; }
.board-controls .chip { min-height: var(--control-height); }
.title-row .head-actions { align-items: center; margin-bottom: .2rem; }
@media (min-width: 900px) {
  body[data-tab="ideas"] .split { display: block; }
  body[data-tab="ideas"].detail-open .split-master { display: none; }
  body[data-tab="ideas"]:not(.detail-open) .split-detail { display: none; }
  body[data-tab="ideas"] .split-master { position: static; max-height: none; overflow: visible; padding-bottom: 0; }
  body[data-tab="ideas"] .back-button { display: inline-flex; }
}
.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.chip-row:empty { display: none; }
.chip { display: inline-flex; flex: none; align-items: center; gap: .35rem; min-height: 34px; padding: 0 .85rem; border: 0; border-radius: 999px; color: var(--label); background: var(--fill); font-size: .86rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.chip small { color: var(--secondary); font-size: .76rem; font-variant-numeric: tabular-nums; }
.chip:hover { background: var(--fill-strong); }
.chip[aria-pressed="true"] { color: var(--on-tint); background: var(--tint); }
.chip[aria-pressed="true"] small { color: inherit; opacity: .85; }
.chip:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
.chip svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip-divider { width: 1px; height: 22px; margin: 0 .2rem; background: var(--separator); }
.chip-toggle { color: var(--label); background: transparent; box-shadow: inset 0 0 0 1.5px var(--fill-strong); }
.chip-toggle:hover { background: var(--fill); }
.chip-toggle[aria-pressed="true"] { color: var(--tint); background: var(--tint-soft); box-shadow: inset 0 0 0 1.5px var(--tint); }
.chip-toggle[aria-pressed="true"] small { color: inherit; }
.idea-board { margin-top: .4rem; }
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .9rem; margin-top: .6rem; }
.archive-group .idea-grid { margin-top: .2rem; }
.idea-card { position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: var(--radius); background: var(--card); box-shadow: 0 1px 2px #0000000f; transition: box-shadow .15s, transform .15s; }
.idea-card:has(.prio-menu) { z-index: 3; }
.idea-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.idea-card:has(.idea-card-title:focus-visible) { outline: 2px solid var(--tint); outline-offset: 2px; }
.idea-card.is-archived { opacity: .72; }
.idea-card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: var(--fill); }
.idea-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.idea-card-media.is-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; padding: .9rem 1rem; color: color-mix(in srgb, var(--tint) 55%, var(--tertiary)); background: color-mix(in srgb, var(--tint) 6%, var(--fill)); }
.idea-card-media.is-empty svg { flex: none; width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.idea-card-media.is-empty:has(.idea-card-quote) { align-items: flex-start; justify-content: flex-start; }
.idea-card-media.is-empty:has(.idea-card-quote) svg { width: 22px; height: 22px; }
.idea-card-quote { display: -webkit-box; margin: 0; overflow: hidden; color: var(--label); font-size: .9rem; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.idea-card-count { position: absolute; right: .45rem; bottom: .45rem; display: inline-flex; align-items: center; gap: .25rem; padding: .12rem .45rem; border-radius: 999px; color: #fff; background: #000000a6; font-size: .72rem; font-weight: 650; }
.idea-card-count svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.idea-card-body { display: flex; flex: 1 1 auto; flex-direction: column; gap: .3rem; padding: .7rem .8rem .75rem; }
.idea-card-meta { margin: 0; overflow: hidden; color: var(--secondary); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.idea-card-title { display: -webkit-box; overflow: hidden; color: var(--label); font-size: .98rem; font-weight: 650; line-height: 1.3; text-decoration: none; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.idea-card-title::after { content: ""; position: absolute; inset: 0; }
.idea-card-title:focus-visible { outline: none; }
.idea-card-text { display: -webkit-box; margin: 0; overflow: hidden; color: var(--secondary); font-size: .84rem; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.idea-card-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: .4rem; margin-top: auto; padding-top: .4rem; }
.idea-card-tags { display: flex; flex-wrap: wrap; gap: .3rem; min-width: 0; }
.idea-card-tags .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* Priorität: Balken (eigene Stufe), Punkte-Knopf auf der Kachel, Auswahl in der Idee */
.level-bars { width: 16px; height: 16px; flex: none; }
.level-bars rect { fill: currentColor; opacity: .28; }
.level-bars rect.on { opacity: 1; }
.prio-wrap { position: relative; z-index: 2; flex: none; }
.prio-pill { display: inline-flex; align-items: center; gap: .3rem; min-height: 32px; padding: 0 .65rem; border: 0; border-radius: 999px; color: var(--secondary); background: var(--fill); font-size: .85rem; font-weight: 650; cursor: pointer; transition: background-color .15s, color .15s; }
.prio-pill:hover { color: var(--tint); background: var(--tint-soft); }
.prio-pill.is-set { color: var(--tint); background: var(--tint-soft); box-shadow: inset 0 0 0 1.5px var(--tint); }
.prio-pill:disabled { opacity: .5; cursor: default; }
.prio-pill:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
.prio-points { font-variant-numeric: tabular-nums; }
.prio-menu { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 5; width: 150px; padding: .5rem; border-radius: 12px; background: var(--card-raised); box-shadow: var(--shadow), 0 0 0 .5px var(--separator); }
.prio-menu-title { margin: 0 .2rem .35rem; color: var(--secondary); font-size: .72rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.prio-menu-hint { margin: .35rem .2rem 0; color: var(--secondary); font-size: .72rem; }
.priority-buttons { display: inline-flex; gap: 2px; padding: 2px; border-radius: 10px; background: var(--fill); }
.priority-buttons.vertical { display: grid; width: 100%; gap: 2px; padding: 0; background: none; }
.priority-button { display: inline-flex; align-items: center; justify-content: flex-start; gap: .4rem; min-height: 36px; padding: 0 .8rem 0 .65rem; border: 0; border-radius: 8px; color: var(--label); background: transparent; font-size: .88rem; font-weight: 600; cursor: pointer; }
.priority-buttons.vertical .priority-button { width: 100%; background: var(--fill); }
.priority-button .level-bars { color: var(--tint); }
.priority-button:hover { background: var(--fill-strong); }
.priority-button[aria-pressed="true"] { color: var(--on-tint); background: var(--tint); }
.priority-button[aria-pressed="true"] .level-bars { color: currentColor; }
.priority-buttons.vertical .priority-button[aria-pressed="true"] { background: var(--tint); }
.priority-button:disabled { opacity: .5; cursor: default; }
.priority-button:focus-visible { outline: 2px solid var(--tint); outline-offset: 1px; }
/* Kachel ohne Foto, aber mit Ort: kleiner Kartenausschnitt */
.mini-map { position: absolute; inset: 0; overflow: hidden; background: #e8e4dc; }
.mini-map-tiles { position: absolute; top: 50%; left: 50%; }
.mini-map-tiles img { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; }
.mini-map-pin { position: absolute; top: 50%; left: 50%; width: 30px; height: 40px; margin: -38px 0 0 -15px; }
.mini-map-credit { position: absolute; right: 0; bottom: 0; padding: 0 .3rem; border-top-left-radius: 4px; color: #333; background: #ffffffcc; font-size: .58rem; }
.related-list { margin-top: .4rem; }
.related-list .row { gap: .55rem; }
.related-list .row-title { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.related-open { margin-top: .6rem; }
.picker-thumb { display: grid; flex: 0 0 44px; place-items: center; width: 44px; height: 44px; overflow: hidden; border-radius: 9px; color: var(--tertiary); background: var(--fill); }
.picker-thumb img { width: 100%; height: 100%; object-fit: cover; }
.picker-thumb svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 560px) {
  .idea-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .idea-card-body { padding: .55rem .6rem .6rem; }
  .idea-card-title { font-size: .9rem; -webkit-line-clamp: 3; }
  .idea-card-text { display: none; }
  .idea-card-media.is-empty { padding: .6rem .65rem; }
  .idea-card-quote { font-size: .78rem; -webkit-line-clamp: 4; }
  .idea-card-media.is-empty:has(.idea-card-quote) svg { display: none; }
  .idea-card-foot { flex-wrap: wrap; }
}

/* ---------- Idee: Leiste „Zuständig | Priorität“ unter dem Titel */
.idea-meta-bar { flex-wrap: nowrap; }
.meta-divider { flex: none; align-self: stretch; width: 1px; margin: .15rem .1rem; background: var(--separator); }
.priority-slot { flex: 0 1 17rem; min-width: 0; }
.prio-detail { width: 100%; z-index: 4; }
.priority-stack { display: flex; align-items: center; gap: .7rem; width: 100%; min-width: 0; padding: .15rem; border: 0; border-radius: 10px; color: inherit; background: none; text-align: left; cursor: pointer; }
.priority-stack:hover { background: var(--fill); }
.priority-stack:disabled { cursor: default; opacity: .6; }
.priority-stack:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
.priority-stack .chevron, .priority-stack > svg:last-child { flex: none; width: 18px; height: 18px; margin-left: auto; color: var(--tertiary); }
.priority-badge { display: grid; flex: 0 0 34px; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--tint); background: color-mix(in srgb, var(--tint) 14%, var(--card)); }
.priority-badge .level-bars { width: 18px; height: 18px; }
.priority-stack.is-set .priority-badge { color: #fff; background: var(--tint); }
.prio-detail .prio-menu { top: calc(100% + 6px); bottom: auto; width: min(240px, 80vw); }
.prio-menu-ratings { margin: 0 .2rem; padding: 0; color: var(--secondary); font-size: .8rem; line-height: 1.5; list-style: none; }
.prio-menu .prio-menu-title + .priority-buttons + .prio-menu-hint + .prio-menu-title,
.prio-menu .priority-buttons + .prio-menu-title { margin-top: .6rem; }
@media (max-width: 899px) {
  /* Handy: Zuständig und Priorität als zwei kompakte Hälften, Idee rückt nach oben. */
  body[data-tab="ideas"] #detail-meta { display: none; }
  .idea-meta-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: .35rem; margin: .55rem 0 .7rem; padding: .4rem; }
  .idea-meta-bar .assign-me, .idea-meta-bar .assign-more { display: none; }
  .idea-meta-bar .assignee-stack { gap: .5rem; }
  .idea-meta-bar .assignee-chevron, .idea-meta-bar .priority-stack > svg:last-child { display: none; }
  .idea-meta-bar .assignee-avatar { flex-basis: 30px; width: 30px; min-width: 30px; height: 30px; font-size: .7rem; }
  .idea-meta-bar .assignee-avatars .assignee-avatar:nth-child(n + 3) { display: none; }
  .idea-meta-bar .priority-badge { flex-basis: 30px; width: 30px; height: 30px; }
  .idea-meta-bar .priority-stack { gap: .5rem; }
  .idea-meta-bar .assignee-summary strong { font-size: .86rem; }
  .idea-meta-bar .assignee-summary small { font-size: .66rem; }
  .prio-detail .prio-menu { right: 0; }
}
