/* NVPD – NoctoraV Police Department
   Farbwelt nach dem Wappen: Schwarz, Weiß, Silber. Statusfarben nur für Bedeutung. */
:root {
  --bg: #07080a;
  --bg-2: #0c0e11;
  --surface: #111418;
  --surface-2: #171b20;
  --surface-3: #1e232a;
  --border: #252a32;
  --border-strong: #353c46;
  --text: #eceef1;
  --text-2: #b9bfc8;
  --muted: #8a919c;
  --silver: #d4d8de;
  --silver-dim: #9aa1ab;
  --accent: #f2f4f7;
  --accent-text: #0a0b0d;
  --ok: #3fb97a;   --ok-bg: rgba(63, 185, 122, .12);
  --warn: #e0a43a; --warn-bg: rgba(224, 164, 58, .12);
  --bad: #ef5b5b;  --bad-bg: rgba(239, 91, 91, .12);
  --info: #7aa7e6; --info-bg: rgba(122, 167, 230, .12);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -12px rgba(0, 0, 0, .6);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --sidebar: 264px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--silver); text-decoration: none; }
a:hover { color: #fff; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; color: #fff; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
pre { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; margin: .5rem 0 0; color: var(--text-2); }
hr { border: 0; border-top: 1px solid var(--border); }
::selection { background: rgba(255, 255, 255, .2); }
:focus-visible { outline: 2px solid var(--silver); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; color: #000; padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }

.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.pad { padding: 16px 20px; }
.grow { flex: 1; }
.dimmed { opacity: .6; }
.inline { display: inline; margin: 0; }

.row { display: flex; align-items: center; }
.row.gap, .gap { gap: 10px; }
.row.wrap, .wrap { flex-wrap: wrap; }
.row.between, .between { justify-content: space-between; }
.row.end, .end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 14px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--silver-dim); margin-bottom: .45rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: 600 .92rem/1.2 var(--font); cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .05s; white-space: nowrap; color: var(--text); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #fff, #d9dde3); color: var(--accent-text); border-color: #fff; }
.btn-primary:hover { background: #fff; color: #000; }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); color: #fff; border-color: #48505c; }
.btn-ok { background: var(--ok-bg); border-color: rgba(63, 185, 122, .4); color: #8de0b3; }
.btn-ok:hover { background: rgba(63, 185, 122, .2); color: #b7f0cf; }
.btn-warn { background: var(--warn-bg); border-color: rgba(224, 164, 58, .4); color: #f1c878; }
.btn-warn:hover { background: rgba(224, 164, 58, .2); color: #ffd995; }
.btn-danger { background: var(--bad-bg); border-color: rgba(239, 91, 91, .4); color: #ff9a9a; }
.btn-danger:hover { background: rgba(239, 91, 91, .2); color: #ffc0c0; }
.btn-sm { padding: 6px 11px; font-size: .84rem; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-3); color: #fff; }
.icon-btn.danger:hover { color: var(--bad); background: var(--bad-bg); }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font: inherit; display: inline-flex; gap: 4px; align-items: center; }
.link-btn.danger:hover { color: var(--bad); }
.link-btn .icon { width: 14px; height: 14px; }

/* ------------------------------------------------------------------ Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; line-height: 1.6; white-space: nowrap; border: 1px solid transparent; }
.badge .icon { width: 12px; height: 12px; }
.badge-ok { background: var(--ok-bg); color: #8de0b3; border-color: rgba(63, 185, 122, .3); }
.badge-warn { background: var(--warn-bg); color: #f1c878; border-color: rgba(224, 164, 58, .3); }
.badge-bad { background: var(--bad-bg); color: #ff9a9a; border-color: rgba(239, 91, 91, .3); }
.badge-info { background: var(--info-bg); color: #a9c8f2; border-color: rgba(122, 167, 230, .3); }
.badge-muted { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
.badge-group { background: transparent; border-color: var(--border-strong); color: var(--text-2); }
/* Fraktions-Abzeichen in Chats (NVPD blau, DOJ gold) */
.badge-nvpd { background: rgba(122, 167, 230, .15); color: #a9c8f2; border-color: rgba(122, 167, 230, .4); font-size: .68rem; padding: 1px 7px; }
.badge-doj { background: rgba(201, 162, 39, .15); color: #e6c866; border-color: rgba(201, 162, 39, .45); font-size: .68rem; padding: 1px 7px; }
/* Chat-Fraktions-Tabs (NVPD / DOJ) */
.chat-tabs { display: flex; gap: 6px; margin: 6px 0 4px; }
.chat-tab { flex: 1; text-align: center; padding: 7px 10px; border-radius: 9px; background: var(--surface-3); color: var(--text-2); font-weight: 700; font-size: .82rem; border: 1px solid var(--border); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.chat-tab.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.chat-tab .tab-count { background: rgba(0, 0, 0, .25); }
.badge-leitungsebene { border-color: rgba(255, 255, 255, .5); color: #fff; }
.badge-leitungsrat { border-color: rgba(212, 216, 222, .4); color: var(--silver); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: .74rem; font-weight: 700; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); }
.tag-lead { border-color: rgba(255, 255, 255, .45); color: #fff; }
.tag-ok { color: #8de0b3; border-color: rgba(63, 185, 122, .35); }
.tag-bad { color: #ff9a9a; border-color: rgba(239, 91, 91, .35); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.unit-short { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 2px 8px; border-radius: 5px;
  background: linear-gradient(180deg, #2a3038, #1c2027); border: 1px solid var(--border-strong); color: var(--silver); }
.req { color: var(--bad); }

/* ------------------------------------------------------------------ Cards */
.card { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin-bottom: 14px; }
.card-title .icon { color: var(--silver-dim); }
.table-card { padding: 0; overflow: hidden; }
.table-card > .card-head { padding: 16px 20px 0; }
.table-card .card-title.pad { margin: 0; }
a.card { display: block; color: inherit; transition: border-color .15s, transform .15s, background .15s; }
a.card:hover { border-color: var(--border-strong); transform: translateY(-2px); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-record { grid-template-columns: 320px minmax(0, 1fr); align-items: start; }
.span-2 { grid-column: span 2; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: start; }

.empty { text-align: center; padding: 28px 16px; color: var(--text-2); }
.empty p { margin: 0 0 4px; }

.notice { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 16px; display: flex; gap: 8px; align-items: flex-start; }
.notice-warn { border-color: rgba(224, 164, 58, .35); background: var(--warn-bg); color: #f1d39c; }

/* ------------------------------------------------------------------ Forms */
label { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; font-weight: 600; color: var(--text-2); }
input, select, textarea { font: 400 .95rem/1.4 var(--font); color: var(--text); background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 11px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--silver-dim); box-shadow: 0 0 0 3px rgba(212, 216, 222, .12); }
input:disabled { opacity: .6; }
textarea { resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa1ab' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: #e9ecf0; flex: none; margin: 0; padding: 0; }
.hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; color: var(--text); cursor: pointer; }
.check-inline { align-self: end; padding-bottom: 10px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 16px; }
.fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px 16px; margin: 0; }
.fieldset legend { padding: 0 6px; font-weight: 700; font-size: .85rem; color: var(--silver); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; }
.form-card { max-width: 920px; }
.confirm-check { padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px; margin-bottom: 16px; align-items: center; }
.filters select { width: auto; flex: 1 1 150px; }
.search { position: relative; flex: 2 1 240px; display: block; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 36px; }

/* ------------------------------------------------------------------ Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg-2); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr:hover td { background: rgba(255, 255, 255, .02); }
.table td a strong { color: #fff; }
.table .cat-row th { background: var(--surface-2); color: var(--silver); font-size: .75rem; }
.table input:not([type=checkbox]) { padding: 6px 9px; }

.matrix th.rank-col { writing-mode: vertical-rl; transform: rotate(180deg); text-transform: none; letter-spacing: 0; font-size: .8rem; padding: 12px 6px; height: 150px; text-align: left; vertical-align: bottom; color: var(--text-2); }
.matrix th.rank-leitungsebene { color: #fff; }
.matrix td { padding: 8px 6px; }
.matrix .sticky { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 260px; }
.matrix thead .sticky { background: var(--bg-2); vertical-align: bottom; }
.matrix .cat-row .sticky { background: var(--surface-2); }
.perm-name { font-weight: 500; text-transform: none !important; letter-spacing: 0 !important; color: var(--text) !important; font-size: .88rem !important; }
.perm-name small { display: block; font-weight: 400; font-size: .76rem; }

.audit-details summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.audit-details pre { max-width: 460px; }

.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 10px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: #fff; border-color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { padding: 6px 13px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-2); font-size: .85rem; font-weight: 600; }
.chip:hover { color: #fff; border-color: #4a525e; }
.chip.active { background: #fff; color: #000; border-color: #fff; }

/* ------------------------------------------------------------------ Flash / Dialog */
.flashes { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(440px, calc(100vw - 32px)); }
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 10px 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); transition: opacity .4s, transform .4s; }
.flash > span { flex: 1; padding-top: 1px; }
.flash .icon-btn { width: 26px; height: 26px; margin: -3px 0; }
.flash-success .icon:first-child { color: var(--ok); }
.flash-info .icon:first-child { color: var(--info); }
.flash-error { border-color: rgba(239, 91, 91, .5); }
.flash-error .icon:first-child { color: var(--bad); }
.flash.fade { opacity: 0; transform: translateY(8px); pointer-events: none; }

.dialog { border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); color: var(--text); padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.dialog::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(3px); }
.dialog-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-head h2 { margin: 0; font-size: 1.15rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

.banner { display: flex; gap: 10px; align-items: center; padding: 10px 24px; font-weight: 600; font-size: .9rem; }
.banner-warn { background: var(--warn-bg); color: #f1d39c; border-bottom: 1px solid rgba(224, 164, 58, .3); }

/* ------------------------------------------------------------------ Public site */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(7, 8, 10, .82); backdrop-filter: saturate(140%) blur(12px); border-bottom: 1px solid var(--border); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand img { }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.1rem; letter-spacing: .12em; }
.brand-text small { font-size: .68rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav > a:not(.btn) { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 600; font-size: .92rem; }
.site-nav > a:not(.btn):hover { color: #fff; background: var(--surface-2); }
.site-nav > a.active { color: #fff; }
.site-nav .btn { margin-left: 8px; }
.nav-toggle { display: none; }
.public-main { padding-top: 32px; padding-bottom: 64px; min-height: 60vh; }

.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border);
  background: radial-gradient(900px 500px at 75% 40%, rgba(255, 255, 255, .07), transparent 60%), radial-gradient(600px 400px at 10% 100%, rgba(122, 167, 230, .05), transparent 60%), var(--bg); }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(ellipse at 70% 50%, #000 20%, transparent 70%); }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: center; padding-top: 40px; padding-bottom: 48px; }
.hero h1 { font-size: clamp(2.2rem, 5.2vw, 4rem); font-weight: 900; letter-spacing: -.02em; text-transform: uppercase; line-height: 1.02;
  background: linear-gradient(180deg, #fff 30%, #9aa1ab); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: 1.15rem; color: var(--text-2); margin-bottom: 28px; font-style: italic; }
.hero-logo { justify-self: center; width: min(100%, 520px); filter: drop-shadow(0 0 60px rgba(255, 255, 255, .08)); }

.stats-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-top: -1px; transform: translateY(-50%); position: relative; z-index: 2; max-width: 900px; }
.stat { background: var(--surface); padding: 18px 20px; text-align: center; }
.stat strong { display: block; font-size: 1.8rem; font-weight: 900; color: #fff; }
.stat span { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

.section { margin-top: 48px; }
.section-head { margin-bottom: 18px; align-items: flex-end; }
.section-head h2 { font-size: 1.6rem; margin: 0; }
.prose p:last-child { margin-bottom: 0; }
.lead { font-size: 1.08rem; color: var(--text-2); }
.about .prose { max-width: 820px; }

.unit-card h3, .unit-card h2 { margin: 12px 0 6px; }
.unit-card p { margin: 0 0 8px; }
.unit-card-lg p { margin-bottom: 14px; }
.more { display: inline-flex; align-items: center; gap: 4px; color: var(--silver); font-weight: 600; font-size: .9rem; }
.more .icon { width: 16px; height: 16px; }

.press-card h3 { margin-bottom: 6px; }
.press-card p { margin-bottom: 10px; }

.change-list { list-style: none; margin: 0; padding: 0; }
.change-list li { display: grid; grid-template-columns: 140px 1fr auto; gap: 14px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--border); }
.change-list li:last-child { border-bottom: 0; }
.change-type { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--silver-dim); }
.split .change-list li { grid-template-columns: 1fr auto; }
.split .change-type { grid-column: 1 / -1; margin-bottom: -10px; }

.cta { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 32px; background: radial-gradient(600px 200px at 100% 0, rgba(255, 255, 255, .06), transparent), var(--surface); }
.cta h2 { font-size: 1.6rem; }
.cta p { margin: 0; max-width: 640px; }

.page-hero { margin-bottom: 28px; }
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 10px; }
.page-hero .unit-short { margin-bottom: 12px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .9rem; font-weight: 600; margin-bottom: 18px; }
.back-link:hover { color: #fff; }

.check-list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.check-list li { position: relative; padding-left: 24px; }
.check-list li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 10px; height: 6px; border-left: 2px solid var(--silver); border-bottom: 2px solid var(--silver); transform: rotate(-45deg); }
.person-card strong { display: block; font-size: 1.05rem; color: #fff; }

.article { max-width: 760px; }
.article h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.article .prose { font-size: 1.04rem; color: var(--text-2); }
.article-foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); }

.auth-card { max-width: 440px; margin: 24px auto; text-align: center; padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.auth-card .stack { text-align: left; }
.auth-logo { margin: -10px auto 0; }
.dev-login { text-align: left; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 10px 14px; }
.dev-login summary { cursor: pointer; color: var(--warn); font-weight: 600; font-size: .88rem; }
.dev-login form { margin-top: 12px; }

.error-page { text-align: center; padding: 60px 0; max-width: 520px; margin: 0 auto; }
.error-page .row { justify-content: center; }
.error-code { font-size: 5rem; font-weight: 900; line-height: 1; color: transparent; -webkit-text-stroke: 1px var(--border-strong); margin-bottom: 12px; }

.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 36px 0; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 18px 24px; align-items: center; }
.footer-brand { display: flex; gap: 14px; align-items: center; }
.footer-brand img { }
.footer-brand p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--muted); font-size: .9rem; }
.footer-links a:hover { color: #fff; }
.footer-note { grid-column: 1 / -1; margin: 0; }

/* ------------------------------------------------------------------ Portal */
.portal { display: block; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--bg-2); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 50; }
.sidebar-brand { padding: 18px 18px 14px; border-bottom: 1px solid var(--border); }
.side-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
.side-group { padding: 6px 0; }
.side-group + .side-group { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px; }
.side-label { font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 4px 10px 6px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 600; font-size: .92rem; }
.side-nav a:hover { background: var(--surface-2); color: #fff; }
.side-nav a.active { background: var(--surface-3); color: #fff; box-shadow: inset 2px 0 0 #fff; }
.side-nav a .icon { color: var(--silver-dim); }
.side-nav a.active .icon { color: #fff; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; border-top: 1px solid var(--border); }
.side-user-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.side-user-text strong { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-text small { color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); object-fit: cover; flex: none; }
.portal-main { margin-left: var(--sidebar); min-height: 100vh; }
.topbar { display: none; }
.portal-content { padding: 28px 32px 64px; max-width: 1320px; }
.scrim { display: none; }

.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-header h1 { margin: 0; }
.page-header .sub { margin: 6px 0 0; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.profile-card { display: flex; flex-direction: column; gap: 16px; }
.profile-top { display: flex; gap: 14px; align-items: center; }
.profile-name { font-size: 1.15rem; color: #fff; }
.sn-badge { font-family: var(--mono); font-weight: 800; font-size: .95rem; letter-spacing: .04em; padding: 10px 12px; border-radius: 10px; background: linear-gradient(180deg, #2b313a, #171b20); border: 1px solid var(--border-strong); color: #fff; white-space: nowrap; }
.sn-lg { font-size: 1.2rem; padding: 14px 16px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; margin: 0 0 14px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; }

.announcements { display: flex; flex-direction: column; gap: 8px; }
.announcement { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--bg); }
.announcement summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; list-style: none; }
.announcement summary::-webkit-details-marker { display: none; }
.announcement summary strong { flex: 1; min-width: 140px; }
.announcement .prose { margin-top: 10px; color: var(--text-2); font-size: .93rem; }

.unit-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.unit-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.unit-list li:last-child { border-bottom: 0; }
.unit-list a, .unit-list li > span:first-child { display: flex; gap: 10px; align-items: center; color: var(--text); font-weight: 600; }
.unit-add { margin-top: 12px; }
.unit-add select { flex: 1; }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.mini-stat { display: flex; flex-direction: column; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); }
.mini-stat strong { font-size: 1.6rem; font-weight: 900; color: #fff; }
.mini-stat span { color: var(--muted); font-size: .82rem; }
a.mini-stat:hover { border-color: var(--border-strong); }

.dist-card { margin-bottom: 16px; padding: 14px 20px; }
.dist-card summary { cursor: pointer; }
.dist { display: grid; gap: 6px; margin-top: 14px; }
.dist-row { display: grid; grid-template-columns: 170px 1fr 36px; gap: 12px; align-items: center; color: var(--text-2); font-size: .88rem; padding: 2px 0; }
.dist-row strong { text-align: right; color: #fff; }
.dist-bar { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.dist-bar span { display: block; height: 100%; background: linear-gradient(90deg, #8f97a3, #fff); border-radius: 99px; }

.record-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.record-id { flex: 1; min-width: 220px; }
.record-id h1 { margin: 0 0 8px; }
.record-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 22px 30px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--silver-dim); }
.tl-hire .tl-dot, .tl-rehire .tl-dot, .tl-promotion .tl-dot, .tl-unsuspension .tl-dot, .tl-praise .tl-dot { border-color: var(--ok); }
.tl-demotion .tl-dot, .tl-suspension .tl-dot { border-color: var(--warn); }
.tl-termination .tl-dot, .tl-discipline .tl-dot { border-color: var(--bad); }
.tl-unit_join .tl-dot, .tl-unit_leave .tl-dot, .tl-unit_transfer .tl-dot, .tl-unit_role .tl-dot { border-color: var(--info); }
.tl-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.tl-head time { margin-left: auto; }
.tl-title { display: block; color: #fff; }
.tl-details { color: var(--text-2); font-size: .92rem; margin-top: 4px; }
.tl-details p { margin-bottom: .5em; }
.tl-foot { display: flex; gap: 14px; margin-top: 4px; align-items: center; }

.add-member { padding: 16px 20px 20px; border-top: 1px solid var(--border); }
.add-member select { flex: 2 1 200px; width: auto; }
.add-member input { flex: 1 1 160px; width: auto; }
.add-member select[name=role] { flex: 0 1 150px; }
.small-head { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 16px 0 10px; }
.add-member .small-head { margin-top: 0; }

/* ------------------------------------------------------------------ Responsive */
@media (max-width: 1100px) {
  .grid-record { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .6); }
  .portal-main { margin-left: 0; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--bg-2); position: sticky; top: 0; z-index: 30; }
  .topbar .brand img { }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 45; }
  .portal-content { padding: 20px 16px 48px; }
  .grid-dash { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; padding-top: 24px; }
  .hero-inner .row { justify-content: center; }
  .hero-inner .eyebrow { justify-content: center; }
  .hero-logo { order: -1; width: min(70%, 340px); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .nav-toggle { display: inline-grid; }
  .site-nav { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 12px 16px 18px; background: var(--bg-2); border-bottom: 1px solid var(--border); }
  .site-nav.open { display: flex; }
  .site-nav .btn { margin: 8px 0 0; }
  .site-nav form .btn { width: 100%; }
  .container { padding: 0 16px; }
  .stats-strip { transform: none; margin-top: 20px; }
  .stat strong { font-size: 1.4rem; }
  .change-list li { grid-template-columns: 1fr auto; }
  .change-type { grid-column: 1 / -1; margin-bottom: -10px; }
  .cta { flex-direction: column; align-items: flex-start; padding: 22px; }
  .footer-inner { grid-template-columns: 1fr; }
  .dist-row { grid-template-columns: 110px 1fr 30px; }
  .kv dd { text-align: left; }
  .table th, .table td { padding: 10px 12px; }
  .page-header { align-items: flex-start; }
  .filters select { flex: 1 1 calc(50% - 10px); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Startseite: Units immer gleichmäßig in 3 Spalten */
.grid-units { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-units { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-units { grid-template-columns: 1fr; } }

.notice-link { color: inherit; }
.notice-link:hover { border-color: rgba(224, 164, 58, .6); color: #ffe2a8; }
.card-head-row { margin-bottom: 14px; }
.card-head-row .card-title { margin: 0; }

.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; flex: none; }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(63, 185, 122, .18); }
.dot-warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(224, 164, 58, .18); }
.dot-bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(239, 91, 91, .18); }
.record-id h1 .status-dot { width: 13px; height: 13px; vertical-align: 6px; margin-right: 12px; }

/* Unit hinzufügen in der Personalakte: untereinander, volle Breite */
.unit-add { flex-direction: column; align-items: stretch; }
.unit-add select, .unit-add .btn { width: 100%; }
/* kompakte Personalupdates im Dashboard */
.compact-changes .change-list li { grid-template-columns: 1fr auto; padding: 8px 0; }
.compact-changes .change-type { grid-column: 1 / -1; margin-bottom: -8px; }

/* ---- Eigene Auswahllisten ---- */
.dd { position: relative; min-width: 0; }
.filters .dd { flex: 1 1 150px; }
.add-member .dd { flex: 2 1 200px; }
.dd-native { position: absolute !important; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.dd-btn { width: 100%; text-align: left; font: 400 .95rem/1.4 var(--font); color: var(--text); background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 9px 30px 9px 11px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa1ab' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.dd-btn:focus-visible, .dd.open .dd-btn { outline: none; border-color: var(--silver-dim); box-shadow: 0 0 0 3px rgba(212, 216, 222, .12); }
.dd-btn.dd-placeholder { color: var(--muted); }
.dd.dd-invalid .dd-btn { border-color: var(--bad); }
.dd-list { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 80; max-height: 260px; overflow-y: auto;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: 0 16px 40px rgba(0, 0, 0, .55); padding: 4px; }
.dd.up .dd-list { top: auto; bottom: calc(100% + 4px); }
.dd.open .dd-list { display: block; }
.dd-item { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: .93rem; color: var(--text); }
.dd-item:hover { background: var(--surface-3); }
.dd-item.selected { background: rgba(255, 255, 255, .1); font-weight: 600; }
.dd-item.disabled { opacity: .45; cursor: default; }
.table-wrap:has(.dd.open) { overflow: visible; }
.dialog { overflow: visible; }
/* Lange Dialoge (z. B. „Neue Aufgabe“) scrollen innerhalb – auch am Handy; Auswahllisten schweben fest und werden nicht abgeschnitten */
.dialog[open] { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
@media (max-width: 600px) { .dialog { width: calc(100vw - 16px); margin: auto; } .dialog-body { padding: 16px; } .dialog-actions { position: sticky; bottom: -16px; background: var(--surface); padding: 12px 0 16px; margin-bottom: -16px; border-top: 1px solid var(--border); z-index: 2; } }

/* Glocke */
.bell { position: relative; }
.bell.active { background: var(--surface-3); color: #fff; }
.bell-count { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: .68rem; font-weight: 800; display: grid; place-items: center; line-height: 1; }
.sidebar-brand { gap: 8px; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { border-bottom: 1px solid var(--border); }
.notif-list li:last-child { border-bottom: 0; }
.notif-list a, .notif-list .notif { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; padding: 14px 20px; color: var(--text); align-items: baseline; }
.notif-list a:hover { background: rgba(255,255,255,.02); }
.notif-list .unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--info); align-self: center; }
.notif-list .read .unread-dot { background: transparent; }
.notif-list .read strong { font-weight: 500; color: var(--text-2); }
.notif-list p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }

/* ===================== Phase 2 ===================== */
.section-title { font-size: 1.05rem; margin: 26px 0 12px; color: var(--silver); }
.section-gap { margin-top: 16px; }
.section-tools { margin-bottom: 4px; }
.chip-sep { width: 1px; background: var(--border-strong); margin: 0 4px; }
.inline-label { flex-direction: row; align-items: center; gap: 8px; }
.inline-label .dd { min-width: 120px; }
.kv-left dd { text-align: left; }
.stats-row.compact .mini-stat { padding: 10px 12px; }
.stats-row.compact .mini-stat strong { font-size: 1.3rem; }

/* Stempeluhr */
.clock-state { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); margin-bottom: 14px; flex-wrap: wrap; }
.clock-state > div { flex: 1; min-width: 150px; }
.clock-led { width: 12px; height: 12px; border-radius: 50%; background: var(--surface-3); box-shadow: 0 0 0 4px rgba(255,255,255,.04); flex: none; }
.clock-state.on { border-color: rgba(63,185,122,.4); background: rgba(63,185,122,.06); }
.clock-state.on .clock-led { background: var(--ok); box-shadow: 0 0 0 4px rgba(63,185,122,.2); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(63,185,122,.08); } }
.clock-timer { font-family: var(--mono); font-size: 1.6rem; font-weight: 800; color: #fff; }
.time-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; margin: 2px 4px 2px 0; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--border); font-family: var(--mono); font-size: .82rem; }
.time-chip.running { border-color: rgba(63,185,122,.5); color: #8de0b3; }
.time-chip.auto { border-color: rgba(224,164,58,.5); color: #f1c878; }
.week-nav { justify-content: space-between; }
.week-bars { display: grid; gap: 7px; }
.week-bar-row { display: grid; grid-template-columns: 52px 1fr 54px; gap: 10px; align-items: center; }
.week-bar-row strong { text-align: right; }
.dist-bar span.low { background: linear-gradient(90deg, #8a4a4a, var(--bad)); }
.table tfoot th { background: var(--bg-2); color: var(--text); font-size: .85rem; text-transform: none; letter-spacing: 0; }
.rank-list { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rank-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.rank-list li:last-child { border-bottom: 0; }
ol.rank-list li::before { counter-increment: r; content: counter(r) "."; color: var(--muted); margin-right: 8px; }
ol.rank-list li > span { flex: 1; }

/* Kalender */
.grid-cal { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.cal-card { padding: 16px; }
.cal-head h2 { margin: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); margin-top: 10px; }
.cal-wd { padding: 6px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-2); }
.cal-day { min-height: 96px; padding: 4px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.other { background: rgba(0,0,0,.25); }
.cal-day.other .cal-num { color: var(--border-strong); }
.cal-day.today { background: rgba(255,255,255,.04); }
.cal-day.today .cal-num { background: #fff; color: #000; border-radius: 999px; padding: 0 7px; }
.cal-num { font-size: .8rem; font-weight: 700; color: var(--text-2); align-self: flex-start; }
.cal-ev { display: block; font-size: .74rem; padding: 2px 5px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; background: var(--surface-3); border-left: 3px solid var(--silver-dim); }
.cal-ev.ev-training, .badge.ev-training { border-color: var(--info); }
.cal-ev.ev-meeting, .badge.ev-meeting { border-color: var(--warn); }
.cal-ev.cancelled { text-decoration: line-through; opacity: .5; }
.badge.ev-training { background: var(--info-bg); color: #a9c8f2; }
.badge.ev-meeting { background: var(--warn-bg); color: #f1c878; }
.badge.ev-event { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li a { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.agenda li:last-child a { border-bottom: 0; }
.agenda time { font-family: var(--mono); font-size: .82rem; color: var(--silver); }
.people-pick summary { cursor: pointer; color: var(--text-2); margin: 10px 0; }

/* Bewerbungen */
.cta-inline { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.cta-inline h3 { margin: 0 0 4px; }
.cta-inline p { margin: 0; }
.app-card { display: flex; flex-direction: column; gap: 14px; }
.app-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; counter-reset: s; }
.app-steps li { position: relative; padding: 8px 8px 8px 30px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); font-size: .82rem; color: var(--muted); }
.app-steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: .66rem; font-weight: 800; background: var(--surface-3); color: var(--text-2); }
.app-steps li.done { color: #fff; border-color: rgba(63,185,122,.4); }
.app-steps li.done::before { background: var(--ok); color: #000; }
.app-steps li.done.bad { border-color: rgba(239,91,91,.4); }
.app-steps li.done.bad::before { background: var(--bad); }
.interviews { display: flex; flex-direction: column; gap: 8px; }
.interview { display: flex; gap: 10px; padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(224,164,58,.35); background: var(--warn-bg); }
.interview.done { border-color: rgba(63,185,122,.35); background: var(--ok-bg); }
.interview.cancelled { opacity: .55; border-color: var(--border); background: var(--bg); }
.interview p { margin: 4px 0 0; }
.answers dt { font-weight: 700; color: var(--silver); margin-top: 14px; font-size: .9rem; }
.answers dt:first-child { margin-top: 0; }
.answers dd { margin: 4px 0 0; color: var(--text-2); }
.notes { list-style: none; margin: 14px 0 0; padding: 0; }
.notes li { padding: 10px 0; border-top: 1px solid var(--border); }
.notes p { margin: 4px 0 0; color: var(--text-2); }
.stars { color: #f1c878; letter-spacing: 1px; }
.note-form textarea { min-height: 70px; }
.question-row { display: grid; grid-template-columns: 60px minmax(160px, 2fr) 150px minmax(140px, 1fr) auto auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.question-row.new { border-bottom: 0; padding-top: 16px; }
.question-row textarea { min-height: 40px; }
@media (max-width: 960px) {
  .grid-cal { grid-template-columns: 1fr; }
  .cal-day { min-height: 64px; }
  .cal-ev b { display: none; }
  .question-row { grid-template-columns: 1fr 1fr; }
  .app-steps { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Eigener Datums-/Zeit-Picker ---- */
.dtp { position: relative; display: flex; min-width: 0; }
.dtp-text { border-top-right-radius: 0; border-bottom-right-radius: 0; flex: 1; }
.dtp-btn { flex: none; width: 42px; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-2); color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.dtp-btn:hover, .dtp.open .dtp-btn { color: #fff; background: var(--surface-3); }
.dtp-pop { display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 90; width: 290px; padding: 12px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.dtp.up .dtp-pop { top: auto; bottom: calc(100% + 4px); }
.dtp.open .dtp-pop { display: block; }
.dtp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dtp-nav { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border-strong); background: transparent; color: var(--text); cursor: pointer; font-size: 1.1rem; }
.dtp-wd, .dtp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.dtp-wd span { font-size: .7rem; color: var(--muted); font-weight: 700; padding: 3px 0; }
.dtp-day { height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; font: 500 .88rem var(--font); }
.dtp-day:hover { background: var(--surface-3); }
.dtp-day.today { box-shadow: inset 0 0 0 1px var(--silver-dim); }
.dtp-day.sel { background: #fff; color: #000; font-weight: 800; }
.dtp-day:disabled { opacity: .3; cursor: default; }
.dtp-time { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--text-2); font-size: .88rem; }
.dtp-time span { flex: 1; }
.dtp-time input { width: 62px; text-align: center; padding: 6px; }
.dtp-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.dtp-clear { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: .85rem; }

.tab-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--bad); color: #fff; font-size: .72rem; font-weight: 800; }

/* ---- Chat ---- */
.chat { display: flex; flex-direction: column; gap: 10px; }
.chat-log { max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border); align-self: flex-start; }
.msg.mine { align-self: flex-end; background: rgba(122,167,230,.12); border-color: rgba(122,167,230,.3); }
.msg-meta { display: flex; gap: 10px; justify-content: space-between; font-size: .76rem; color: var(--muted); margin-bottom: 3px; }
.msg-meta strong { color: var(--text-2); }
.msg-body p { margin: 0; }
.msg-body p + p { margin-top: 6px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; min-height: 44px; }
.chat-empty { margin: 4px 0; }
.chat-details summary { cursor: pointer; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.chat-details[open] summary { margin-bottom: 10px; }

/* Beschriftung + Pflicht-Sternchen in einer Zeile, Eingabefeld darunter */
label:not(.check):not(.inline-label):not(.search) { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 4px; }
label:not(.check):not(.inline-label):not(.search) > :is(input, select, textarea, .dd, .dtp, .hint, datalist) { flex: 1 1 100%; }
.mine-tag { font-weight: 700; color: #a9c8f2; }

/* Footer immer unten (auch bei kurzen Seiten) */
body.public { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body.public > .public-main { flex: 1 0 auto; width: 100%; }
body.public > .site-footer { flex-shrink: 0; }

/* ===================== Phase 3 ===================== */
.made-with { grid-column: 1 / -1; margin: 6px 0 0; font-size: .8rem; color: var(--muted); text-align: center; }
.portal-main { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.portal-main > .portal-content { flex: 1 0 auto; width: 100%; }
.portal-main > .made-with { margin: 0; padding: 14px 16px 18px; font-size: .75rem; opacity: .7; }
.made-with .heart { color: var(--bad); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }
.bad-text { color: var(--bad); font-weight: 600; }
.small-prose { font-size: .9rem; color: var(--text-2); margin-top: 10px; }

/* Dokumente */
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--border); }
.doc-list li:first-child { border-top: 0; }
.doc-list li > a:first-child { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.doc-list li.voided strong { text-decoration: line-through; color: var(--muted); }
.doc-toolbar { margin-bottom: 16px; }
.paper { position: relative; max-width: 760px; margin: 0 auto; background: #f7f8fa; color: #16181d; border-radius: 6px; padding: 48px 56px; box-shadow: 0 20px 60px -20px rgba(0,0,0,.8); }
.paper h1 { color: #111; font-size: 1.6rem; margin-top: 28px; }
.paper .muted { color: #6b7280; }
.paper-head { display: flex; align-items: center; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid #c9ccd2; }
.paper-head > div { display: flex; flex-direction: column; }
.paper-head strong { color: #111; font-size: 1.1rem; }
.paper-head small { color: #6b7280; }
.paper-meta { margin-left: auto; text-align: right; }
.paper-body { margin-top: 18px; line-height: 1.7; }
.paper-body p { margin: 0 0 .9em; }
.paper-sign { display: flex; flex-direction: column; margin-top: 48px; padding-top: 10px; border-top: 1px solid #c9ccd2; width: 260px; }
.paper-sign strong { color: #111; }
.paper-sign small { color: #6b7280; }
.paper.voided::after { content: 'UNGÜLTIG'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 6rem; font-weight: 900; color: rgba(200,30,30,.18); transform: rotate(-25deg); pointer-events: none; }
.paper-void { margin-top: 18px; color: #b91c1c; font-weight: 700; }
@media (max-width: 640px) { .paper { padding: 28px 22px; } .paper-head img { width: 44px; } }
.ph-list { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: .85rem; color: var(--text-2); }
.ph-list code { color: #fff; }
.mono-area { font-family: var(--mono); font-size: .88rem; }

/* Ermittlungen */
.case-no { font-size: .95rem; min-width: 96px; }
.evidence-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.evidence { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); display: flex; flex-direction: column; }
.ev-thumb { display: grid; place-items: center; aspect-ratio: 16 / 10; background: var(--bg-2); overflow: hidden; color: var(--text-2); gap: 4px; }
.ev-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ev-thumb .icon { width: 30px; height: 30px; }
.ev-video, .ev-file { grid-template-rows: auto auto; align-content: center; font-size: .85rem; }
.ev-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.ev-body p { margin: 4px 0; color: var(--text-2); }
.ev-body .link-btn { align-self: flex-start; margin-top: 4px; }
.entity-list { list-style: none; margin: 0; padding: 0; }
.entity-list li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); }
.entity-list li:first-child { border-top: 0; }

/* Aufgaben */
.task-mini { list-style: none; margin: 0; padding: 0; }
.task-mini li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.task-mini li:first-child { border-top: 0; }
.task-mini li a { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.task-mini li.overdue small { color: var(--bad); }
.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--bad); }

/* Vorschläge */
.fb-list { display: grid; gap: 10px; }
.fb-item { display: flex; gap: 16px; align-items: center; padding: 14px 18px; }
.fb-vote { flex: 0 0 58px; display: flex; justify-content: center; }
.fb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.vote-btn { display: flex; flex-direction: column; align-items: center; gap: 0; width: 54px; padding: 6px 0; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2); cursor: pointer; font: inherit; }
.vote-btn:hover { border-color: var(--silver-dim); color: #fff; }
.vote-btn.voted { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.vote-btn.voted strong { color: var(--accent-text); }
.vote-btn strong { color: #fff; }

/* Leitungs-Dashboard */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); }
.kpi-warn strong { color: var(--warn); }
.kpi-bad strong { color: var(--bad); }
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.todo-list a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.todo-list a:hover { border-color: var(--border-strong); }
.todo-list a .icon:last-child { margin-left: auto; color: var(--muted); }
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .bar-ok { fill: var(--ok); }
.chart .bar-bad { fill: var(--bad); }
.chart .chart-axis { stroke: var(--border-strong); }
.chart .chart-label { fill: var(--muted); font-size: 11px; }
.chart .chart-val { fill: var(--text-2); font-size: 10px; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.lg-ok { background: var(--ok); } .lg-bad { background: var(--bad); }

/* Unit-Bereich */
.grid-unit-area { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .grid-unit-area { grid-template-columns: 1fr; } }
.chat-log-lg { max-height: 520px; min-height: 260px; }
.msg { position: relative; }
.msg-del { position: absolute; top: 4px; right: 6px; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-del { opacity: 1; }
.unit-area-card { display: flex; flex-direction: column; gap: 8px; }
.unit-area-card:hover { border-color: var(--border-strong); }
[hidden] { display: none !important; }
.unit-add .row > .dd, .unit-add .row > select { flex: 1; min-width: 0; }
.grid-dash.section > .card { align-self: start; }

/* Dashboard (kompakt) */
.dash-head { align-items: flex-end; }
.dash-id { margin-top: 10px; color: var(--text-2); font-size: .92rem; }
.sn-chip { padding: 3px 9px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--border-strong); color: #fff; font-weight: 700; font-size: .85rem; }
.dash-notices { margin-bottom: 16px; gap: 8px; }
.dash-notices .notice { margin: 0; }
.grid-dash3 { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.grid-dash3 > .span-2 { grid-column: span 2; }
.grid-dash3 > .span-2 > .card { height: 100%; }
@media (max-width: 1150px) { .grid-dash3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-dash3 > .span-2 { grid-column: 1 / -1; } }
@media (max-width: 720px) { .grid-dash3 { grid-template-columns: 1fr; } }
.compact-changes .change-list li { padding: 8px 0; }

/* Lizenzen */
.lic { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; background: rgba(241,200,120,.1); border: 1px solid rgba(241,200,120,.35); color: #f1c878; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.lic .icon { width: 12px; height: 12px; }
.lic-expired { background: var(--bad-bg); border-color: rgba(239,91,91,.4); color: var(--bad); text-decoration: line-through; }
.lic-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lic-x { background: none; border: 0; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-size: 1rem; line-height: 1; opacity: .7; }
.lic-x:hover { opacity: 1; color: var(--bad); }
.lic-list { list-style: none; margin: 0; padding: 0; }
.lic-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.lic-list li:first-child { border-top: 0; }
.lic-admin-row { display: grid; grid-template-columns: 60px minmax(160px, 1.4fr) 100px minmax(140px, 2fr) auto auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.lic-admin-row.new { grid-template-columns: minmax(160px, 1.4fr) 100px minmax(140px, 2fr) auto; border: 0; }
@media (max-width: 900px) { .lic-admin-row, .lic-admin-row.new { grid-template-columns: 1fr 1fr; } }
.field-label { font-weight: 600; font-size: .9rem; color: var(--text-2); margin-top: 6px; }
.narrow-form { max-width: 720px; }

/* Leitungs-Dashboard (kompakt) */
.kpi-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1150px) { .kpi-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .kpi-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ok-text { color: var(--ok); }
.grid-lead { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.grid-lead > .span-2 { grid-column: span 2; }
@media (max-width: 1150px) { .grid-lead { grid-template-columns: 1fr 1fr; } .grid-lead > .span-2 { grid-column: 1 / -1; } }
@media (max-width: 720px) { .grid-lead { grid-template-columns: 1fr; } }
.todo-list a .grow { flex: 1; }
.todo-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; vertical-align: middle; }
.todo-chips .unit-short { font-size: .65rem; }
.dot-muted { background: var(--muted); }
.count-list { list-style: none; margin: 0; padding: 0; }
.count-list a { display: flex; justify-content: space-between; padding: 9px 2px; border-top: 1px solid var(--border); color: var(--text-2); }
.count-list li:first-child a { border-top: 0; }
.count-list a:hover { color: #fff; }
.count-list strong { color: #fff; font-size: 1.05rem; }
.table-compact td, .table-compact th { padding-top: 8px; padding-bottom: 8px; }
.dist-group summary { list-style: none; cursor: pointer; }
.dist-group summary::-webkit-details-marker { display: none; }
.dist-sub { padding: 2px 0 8px 14px; border-left: 2px solid var(--border); margin-left: 4px; }
.dist-sub .dist-row { font-size: .82rem; }

/* Urkunde (Ansicht im Portal) */
.paper-body .hl { font-size: 1.15em; color: #111; }
.paper.cert { padding: 14px; background: #fcfaf6; border: 6px solid #12161f; }
.cert-frame { position: relative; border: 1.5px solid #b08c3d; outline: 1px solid #dcc285; outline-offset: -6px; padding: 44px 48px 30px; text-align: center; color: #16181d; overflow: hidden; }
.cert-frame::before { content: ''; position: absolute; inset: 0; background: url('/static/img/wappen.webp') center 55% / 62% no-repeat; opacity: .05; pointer-events: none; }
.cert-crest { width: 110px; height: auto; }
.cert-org { margin-top: 12px; color: #b08c3d; font: 700 .78rem/1.2 var(--font); letter-spacing: .22em; text-transform: uppercase; }
.cert-city { color: #6b7280; font-size: .72rem; letter-spacing: .08em; }
.paper .cert-title { font-family: 'Times New Roman', Times, Georgia, serif; text-transform: uppercase; letter-spacing: .06em; font-size: clamp(1.5rem, 4vw, 2.4rem); color: #12161f; margin: 28px 0 10px; }
.cert-divider { position: relative; height: 12px; margin: 0 auto 26px; width: 300px; max-width: 80%; border-top: 1px solid #b08c3d; top: 6px; }
.cert-divider span { position: absolute; left: 50%; top: -6px; width: 10px; height: 10px; background: #b08c3d; transform: translateX(-50%) rotate(45deg); }
.cert-body { font-family: 'Times New Roman', Times, Georgia, serif; font-size: 1.12rem; line-height: 1.6; position: relative; }
.cert-body p { margin: 0 0 .8em; }
.cert-body .hl { display: block; font-style: italic; font-size: 1.9em; color: #12161f; margin: .2em 0; }
.cert-sign { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: end; margin-top: 46px; position: relative; }
.cert-sign > div:not(.cert-seal) { display: flex; flex-direction: column; }
.cert-sign em { margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid #6b7280; font-family: 'Times New Roman', Times, serif; }
.cert-sign em.sig { font-weight: 700; font-size: 1.2rem; color: #12161f; }
.cert-sign span { font-size: .75rem; color: #6b7280; }
.cert-seal { width: 76px; height: 76px; border-radius: 50%; background: #12161f; border: 4px solid #b08c3d; box-shadow: 0 0 0 2px #fcfaf6, 0 0 0 4px #b08c3d; display: grid; place-items: center; }
.cert-foot { margin-top: 26px; font-size: .7rem; color: #8a8f99; letter-spacing: .04em; }
@media (max-width: 640px) { .cert-frame { padding: 28px 16px; } .cert-sign { grid-template-columns: 1fr; } .cert-seal { margin: 0 auto; } }
.unit-short-dim { opacity: .6; }
.dd-list { min-width: 180px; }

/* Dashboard: zwei Spalten, jede stapelt ihre Karten ohne Lücken */
.dash-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dash-pair > .card { height: 100%; }
.dash-pair:has(> .card:only-child) { grid-template-columns: 1fr; }
@media (max-width: 1100px) { .dash-cols { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .dash-pair { grid-template-columns: 1fr; } }

/* Erwähnungen */
.mention { color: #a9c8f2; font-weight: 700; background: rgba(122,167,230,.12); border-radius: 4px; padding: 0 3px; }
.mention-box { position: fixed; z-index: 200; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; display: flex; flex-direction: column; }
.mention-item { display: flex; flex-direction: column; align-items: flex-start; gap: 0; text-align: left; padding: 7px 10px; border: 0; border-radius: 7px; background: none; color: var(--text); font: inherit; cursor: pointer; }
.mention-item small { color: var(--muted); font-size: .75rem; }
.mention-item.active, .mention-item:hover { background: var(--surface-3); }

/* Privatnachrichten */
.dm-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.dm-list { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.dm-threads { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow-y: auto; }
.dm-threads a { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 9px 10px; border-radius: 8px; color: var(--text-2); }
.dm-threads a:hover { background: var(--surface-2); color: #fff; }
.dm-threads a.active { background: var(--surface-3); color: #fff; }
.dm-name { display: flex; align-items: center; gap: 6px; }
.dm-snippet { grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-threads time { grid-row: 1; grid-column: 2; }
.dm-placeholder { min-height: 300px; display: grid; place-content: center; justify-items: center; gap: 8px; }
.dm-placeholder .icon { width: 36px; height: 36px; opacity: .5; }
.dm-back { display: none; }
@media (max-width: 860px) {
  .dm-layout { grid-template-columns: 1fr; }
  .dm-layout.has-thread .dm-list { display: none; }
  .dm-layout:not(.has-thread) .dm-thread { display: none; }
  .dm-back { display: inline-flex; }
}

/* Chat: Bearbeiten/Löschen, Systemmeldungen, Auswahlliste */
.msg-tools { position: absolute; top: 4px; right: 6px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; background: var(--surface-3); border-radius: 6px; padding: 1px 4px; }
.msg:hover .msg-tools, .msg:focus-within .msg-tools { opacity: 1; }
@media (hover: none) { .msg-tools { opacity: .8; } }
.msg-deleted { opacity: .7; }
.msg.editing { max-width: 100%; width: 100%; }
.msg-edit { width: 100%; }
.msg-edit-actions { margin-top: 6px; }
.msg-system { align-self: center; background: none; border: 0; color: var(--muted); font-size: .8rem; display: flex; gap: 8px; padding: 2px 8px; }
.msg-system time { opacity: .7; }
.pick-filter { margin-bottom: 6px; }
.pick-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* Karriere im Bürgerportal hervorheben – passend zum Silber/Schwarz-Design, mit dezentem Gold-Akzent */
.site-nav a.nav-cta {
  position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 14px; border-radius: 999px;
  font-weight: 700; color: #fff; letter-spacing: .01em;
  border: 1px solid transparent;
  background: linear-gradient(180deg, #1c2027, #12151a) padding-box, linear-gradient(135deg, #f3dc9b, #b8913f 45%, #6d7480) border-box;
  box-shadow: 0 6px 20px -10px rgba(212,175,90,.55);
  transition: box-shadow .2s, transform .2s;
}
.site-nav a.nav-cta:hover, .site-nav a.nav-cta.active { color: #fff; box-shadow: 0 8px 24px -8px rgba(212,175,90,.75); transform: translateY(-1px); }
.site-nav a.nav-cta::after { display: none; }
.nav-cta-dot { width: 7px; height: 7px; border-radius: 50%; background: #e8c874; box-shadow: 0 0 0 0 rgba(232,200,116,.6); animation: ctaPulse 2.4s ease-out infinite; }
.nav-cta-arrow { display: inline-flex; color: #e8c874; transition: transform .2s; }
.nav-cta-arrow .icon { width: 14px; height: 14px; }
.site-nav a.nav-cta:hover .nav-cta-arrow { transform: translateX(2px); }
@keyframes ctaPulse { 0% { box-shadow: 0 0 0 0 rgba(232,200,116,.55); } 70% { box-shadow: 0 0 0 7px rgba(232,200,116,0); } 100% { box-shadow: 0 0 0 0 rgba(232,200,116,0); } }
@media (prefers-reduced-motion: reduce) { .nav-cta-dot { animation: none; } }
.tabs a.tab-danger { color: var(--bad); margin-left: auto; }
.reg-card { display: flex; flex-direction: column; gap: 8px; }
.reg-card h3 { margin: 4px 0 0; }
.reg-card .btn { align-self: flex-start; }
.msg-internal { background: var(--warn-bg); border-color: rgba(224,164,58,.35); }
.cleanup-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.lead-text { font-size: 1.05rem; }

/* Aufklapplisten schweben fest im Fenster (siehe nvpdFloat in app.js) */
.dd-list { z-index: 1000; }
.dtp-pop { z-index: 1000; }

/* Winter-Modus */
.snow-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: -1; } /* hinter Karten, Menü und Text */
.snow-toggle { color: var(--muted); }
.snow-toggle.active { color: #cfe3ff; }
.snow-toggle .icon { width: 18px; height: 18px; }
.gap-sm { gap: 4px; }
.site-nav .snow-toggle { margin-left: 2px; }
.sidebar-brand .brand-text small { white-space: nowrap; }
.sidebar-brand .gap-sm { gap: 0; flex-shrink: 0; }
.sidebar-brand .snow-toggle { width: 32px; }

/* Lagebild */
.intel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.intel-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.intel-card-img { aspect-ratio: 16 / 9; background: var(--bg-2); display: grid; place-items: center; color: var(--muted); overflow: hidden; border-bottom: 1px solid var(--border); }
.intel-card-img img { width: 100%; height: 100%; object-fit: cover; }
.intel-card-img .icon { width: 34px; height: 34px; opacity: .5; }
.intel-card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.badge.intel-route { background: rgba(122,167,230,.14); color: #a9c8f2; }
.badge.intel-property { background: rgba(241,200,120,.12); color: #f1c878; }
.badge.intel-blackmarket { background: var(--bad-bg); color: var(--bad); }
.intel-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.intel-slot { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.intel-thumb { display: flex; gap: 10px; align-items: center; }
.intel-thumb img { width: 96px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.intel-points { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; counter-reset: pt; }
.intel-points li { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: 10px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.intel-points-route li:not(:last-child)::after, .intel-points-blackmarket li:first-child::after { content: '→'; position: absolute; right: -13px; top: 50%; color: var(--muted); font-weight: 700; }
.intel-pt-head { display: flex; align-items: center; gap: 8px; }
.intel-pt-no { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-text); font-weight: 800; font-size: .8rem; flex-shrink: 0; }
.intel-points-blackmarket li:first-child .intel-pt-no { background: var(--ok); color: #fff; }
.intel-points-blackmarket li:last-child .intel-pt-no { background: var(--bad); color: #fff; }
.intel-pt-img { display: block; aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; background: var(--bg-2); }
.intel-pt-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.intel-pt-img:hover img { transform: scale(1.03); }
.intel-pt-noimg { display: grid; place-content: center; justify-items: center; color: var(--muted); font-size: .8rem; gap: 4px; }
.intel-pt-noimg .icon { opacity: .5; }
.intel-points p { margin: 0; color: var(--text-2); }
.intel-media { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.intel-media li { display: flex; gap: 10px; align-items: center; }
.intel-media li > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.intel-media img { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.intel-link { width: 64px; height: 44px; border-radius: 6px; border: 1px solid var(--border); display: grid; place-content: center; justify-items: center; font-size: .6rem; color: var(--text-2); background: var(--bg-2); }
.intel-link .icon { width: 16px; height: 16px; }
.btn-reject { color: #ff9a9a; }
.btn-reject:hover { border-color: rgba(239, 91, 91, .4); color: #ffc0c0; }
body.public .snow-canvas { z-index: 30; } /* Bürgerportal: Schnee auch über dem Titelbild, aber unter dem Menü */

/* ---------- Seitenmenü: einklappbare Gruppen, Zähler ---------- */
.side-nav { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.side-group { padding: 4px 0; }
.side-group + .side-group { margin-top: 2px; padding-top: 6px; }
button.side-label { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; width: 100%; cursor: pointer; font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 6px 10px; border-radius: 6px; }
button.side-label:hover { color: var(--text-2); }
button.side-label:focus-visible { outline: 2px solid var(--silver-dim); }
button.side-label > span:first-child { flex: 1; }
button.side-label .icon { width: 14px; height: 14px; transform: rotate(90deg); transition: transform .15s; }
.side-group.collapsed button.side-label .icon { transform: rotate(0deg); }
.side-group.collapsed .side-items { display: none; }
.side-group:not(.collapsed) .nav-count-sum { display: none; }
.side-nav a { padding: 7px 10px; }
.side-nav a > span:not(.nav-count) { flex: 1; min-width: 0; }
.nav-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: .7rem; font-weight: 800; letter-spacing: 0; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.nav-count-sum { background: rgba(239, 91, 91, .25); color: #ffb3b3; }

/* ---------- Dashboard ---------- */
.dash { display: flex; flex-direction: column; gap: 16px; }
.dash .page-header { margin-bottom: 0; }
.dash-hero { position: relative; overflow: hidden; display: flex; align-items: stretch; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 28px 30px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
  background: radial-gradient(700px 320px at 85% 20%, rgba(255, 255, 255, .07), transparent 60%), radial-gradient(500px 260px at 0% 100%, rgba(122, 167, 230, .08), transparent 60%), linear-gradient(180deg, var(--surface), var(--bg-2));
  box-shadow: var(--shadow); }
.dash-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px); background-size: 40px 40px; mask-image: radial-gradient(ellipse at 75% 40%, #000 10%, transparent 70%); }
.dash-hero-crest { position: absolute; right: clamp(260px, 26vw, 380px); top: 50%; transform: translateY(-50%); width: 230px; opacity: .09; filter: grayscale(1) drop-shadow(0 0 40px rgba(255, 255, 255, .4)); pointer-events: none; }
.dash-hero-main { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; min-width: 0; flex: 1 1 380px; }
.dash-hero h1 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); line-height: 1.08; margin: 6px 0 12px; font-weight: 900; letter-spacing: -.01em; }
.dash-name { background: linear-gradient(180deg, #fff 30%, #9aa3ad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dash-id { align-items: center; color: var(--text-2); font-size: .92rem; }
.dash-rank { font-weight: 700; color: var(--text); }
.dash-duty { position: relative; z-index: 1; flex: 0 1 300px; display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--border); background: rgba(7, 8, 10, .55); backdrop-filter: blur(6px); }
.dash-duty.on { border-color: rgba(63, 185, 122, .45); background: rgba(63, 185, 122, .07); box-shadow: 0 0 40px rgba(63, 185, 122, .08) inset; }
.dash-duty-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-duty.on .clock-led { background: var(--ok); box-shadow: 0 0 0 4px rgba(63, 185, 122, .2); animation: pulse 2s infinite; }
.dash-duty-timer { font-family: var(--mono); font-size: 2.2rem; font-weight: 800; color: #fff; line-height: 1.1; }
.dash-duty form { margin-top: 4px; }
.dash-duty .btn { width: 100%; justify-content: center; }

.dash-todo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-todo-label { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.dash-todo-label .icon { width: 14px; height: 14px; }
.todo-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .88rem; transition: border-color .15s, transform .1s; }
a.todo-chip:hover { border-color: var(--border-strong); transform: translateY(-1px); color: #fff; }
.todo-chip .icon { width: 16px; height: 16px; }
.todo-chip strong { font-weight: 900; }
.todo-bad { border-color: rgba(239, 91, 91, .45); background: rgba(239, 91, 91, .08); } .todo-bad .icon, .todo-bad strong { color: #ff9a9a; }
.todo-warn { border-color: rgba(224, 164, 58, .4); background: rgba(224, 164, 58, .07); } .todo-warn .icon, .todo-warn strong { color: #f1c878; }
.todo-info .icon, .todo-info strong { color: #9cc3ff; }
.todo-ok { border-color: rgba(63, 185, 122, .35); color: #8de0b3; }

.quick-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.quick-tile { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: linear-gradient(180deg, var(--surface), var(--bg-2)); color: var(--text); font-weight: 600; font-size: .9rem; transition: border-color .15s, transform .1s, background .15s; min-width: 0; }
.quick-tile > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-tile:hover { border-color: var(--border-strong); transform: translateY(-2px); color: #fff; background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.quick-tile > .icon:last-child { width: 14px; height: 14px; color: var(--muted); }
.quick-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); flex: none; }
.quick-ic .icon { width: 18px; height: 18px; }

.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 1500px) {
  /* zwei Spalten, Karten fließen ausgeglichen (keine großen Lücken) */
  .dash-grid { display: block; columns: 2; column-gap: 16px; }
  .dash-col { display: contents; }
  .dash-grid .card { break-inside: avoid; margin-bottom: 16px; }
  .quick-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .dash-grid { columns: 1; }
  .quick-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .quick-tile { flex-direction: column; gap: 6px; padding: 12px 6px; text-align: center; font-size: .78rem; line-height: 1.2; }
  .quick-tile > span:nth-child(2) { white-space: normal; overflow: visible; }
  .quick-tile > .icon:last-child { display: none; }
  .dash-todo-label { width: 100%; }
  .dash-hero { padding: 20px; }
  .dash-hero-crest { right: -40px; top: 30px; transform: none; width: 180px; }
  .dash-duty { flex: 1 1 100%; }
}

.progress-card .clock-state { margin-bottom: 12px; }
.goal { margin-bottom: 14px; }
.goal-num { font-size: 1.5rem; font-weight: 900; color: #fff; }
.goal-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.goal-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6f8fb8, #cfe3ff); }
.goal-bar span.done { background: linear-gradient(90deg, #2f8f5f, var(--ok)); }
.ok-text { color: #8de0b3; display: inline-flex; align-items: center; gap: 3px; } .ok-text .icon { width: 13px; height: 13px; }
.day-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 110px; margin-bottom: 14px; }
.day-bar { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.day-bar-fill { flex: 1; width: 100%; max-width: 34px; border-radius: 7px; background: var(--bg); border: 1px solid var(--border); display: flex; align-items: flex-end; overflow: hidden; }
.day-bar-fill span { display: block; width: 100%; background: linear-gradient(180deg, #cfe3ff, #6f8fb8); border-radius: 5px; min-height: 0; }
.day-bar.today .day-bar-fill { border-color: rgba(207, 227, 255, .5); }
.day-bar.today small { color: #fff; font-weight: 800; }
.day-bar.future .day-bar-fill { opacity: .45; }
.day-bar small { color: var(--muted); font-size: .72rem; }
.progress-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.progress-facts > div { display: flex; flex-direction: column; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border); min-width: 0; }
.progress-facts strong { font-size: 1.15rem; font-weight: 900; color: #fff; }
.progress-facts span { color: var(--muted); font-size: .76rem; }
.lic-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(63, 185, 122, .18); animation: pulse 2s infinite; display: inline-block; }
.duty-count { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.duty-num { font-size: 2rem; font-weight: 900; color: #fff; line-height: 1; }
.duty-list { list-style: none; margin: 0; padding: 0; }
.duty-list li > a, .duty-list li > div { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); color: var(--text); }
.duty-list li > a:hover { color: #fff; }
.duty-av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; background: rgba(63, 185, 122, .12); color: #8de0b3; border: 1px solid rgba(63, 185, 122, .35); flex: none; }
.duty-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.duty-who strong, .duty-who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.duty-since { font-size: .8rem; color: var(--silver); }
.agenda-day { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 10px 0 2px; }
.agenda-day:first-of-type { margin-top: 0; }
.agenda-empty { margin: 4px 0 6px; }

/* breitere Inhalte auf großen Bildschirmen */
.portal-content { max-width: 1800px; }

/* ---------- Handy-Feinschliff ---------- */
.tabs { scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
@media (max-width: 600px) {
  .dash-hero-crest { display: none; }
  .dash-hero h1 { font-size: 1.7rem; }
  .dash-duty-timer { font-size: 1.9rem; }
  .matrix .sticky { min-width: 150px; max-width: 170px; white-space: normal; }
  .matrix .sticky small { display: none; }
  .week-nav { display: grid; grid-template-columns: 1fr 1fr; }
  .week-nav strong { grid-column: 1 / -1; order: -1; }
  .week-nav .btn { justify-content: center; }
  .portal-content { padding: 20px 16px 48px; }
  .page-header h1 { font-size: 1.6rem; }
  .record-actions { width: 100%; }
}

/* ---------- Unit-Dokumente ---------- */
.ud-list { list-style: none; margin: 0; padding: 0; }
.ud-list li { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border); }
.ud-list li:first-child { border-top: 0; }
.ud-main { flex: 1; min-width: 0; display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 10px 6px; color: var(--text); border-radius: var(--radius-sm); }
.ud-main:hover { color: #fff; background: var(--surface-2); }
.ud-ic { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); flex: none; }
.ud-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; text-align: left; }
.ud-text small { overflow: hidden; text-overflow: ellipsis; }
.ud-actions { display: flex; gap: 2px; flex: none; }
.ud-note { margin-top: 12px; }
.field-block { display: flex; flex-direction: column; gap: 4px; }
.field-block[hidden] { display: none; }
.task-people { list-style: none; margin: 0; padding: 0; }
.task-people li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); }
.task-people li:first-child { border-top: 0; }
.task-people li > span:nth-child(2) { flex: 1; min-width: 0; }
.tp-check { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-strong); display: grid; place-items: center; flex: none; }
.task-people li.done .tp-check { background: rgba(63, 185, 122, .15); border-color: rgba(63, 185, 122, .5); color: #8de0b3; }
.tp-check .icon { width: 13px; height: 13px; }

/* ---------- Weihnachtsmodus (nur wenn eingeschaltet: body.xmas) ---------- */
.xmas-only { display: none; }
body.xmas .xmas-only { display: inline; }
body.xmas .xmas-off { display: none; }
body.xmas .hero-xmas { display: block; }
.hero-xmas { margin: -14px 0 24px; color: #f1c878; font-weight: 600; letter-spacing: .02em; }
.brand-logo { position: relative; display: inline-flex; flex: none; }
.xmas-scene { display: none; position: fixed; left: 0; right: 0; bottom: 0; height: max(150px, calc(100vw * .1875)); z-index: -2; pointer-events: none; } /* Seitenverhältnis wie die Grafik (1600×300), damit oben nichts abgeschnitten wird */
body.xmas .xmas-scene { display: block; }
.portal .xmas-scene { left: var(--sidebar); height: max(150px, calc((100vw - var(--sidebar)) * .1875)); }
.xmas-scene svg { width: 100%; height: 100%; display: block; }
.xmas-scene .xl { animation: xmas-twinkle 2.4s ease-in-out infinite; }
.xmas-scene .xl1 { animation-delay: .6s; } .xmas-scene .xl2 { animation-delay: 1.2s; } .xmas-scene .xl3 { animation-delay: 1.8s; }
.xmas-scene .x-star { animation: xmas-star 3s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.xmas-scene .xw-glow { animation: xmas-glow 5s ease-in-out infinite; }
@keyframes xmas-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes xmas-star { 0%, 100% { opacity: .85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes xmas-glow { 0%, 100% { opacity: .3; } 50% { opacity: .45; } }
@media (max-width: 900px) { .portal .xmas-scene { left: 0; height: max(150px, calc(100vw * .1875)); } }
@media (prefers-reduced-motion: reduce) { .xmas-scene .xl, .xmas-scene .x-star, .xmas-scene .xw-glow { animation: none; } }
.snow-toggle.active { color: #ffd27a; }

/* Weihnachts-Wappen: ersetzt das normale Wappen an derselben Stelle (Mütze ragt nach oben hinaus) */
.logo-xmas { display: none; position: absolute; width: 106.25%; max-width: none; height: auto; left: -1.5625%; top: -41.46%; pointer-events: none; }
body.xmas .logo-xmas { display: block; }
body.xmas .brand-logo > img:first-child { visibility: hidden; }
.push-hint { align-items: center; gap: 10px; flex-wrap: wrap; }
.push-hint > span { flex: 1; min-width: 200px; }
.pick-list-short { max-height: 170px; }

/* ---------- Verfügbare Ausbildungen (groß) ---------- */
.trainings { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 12px; }
.training { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); }
.training.mine { border-color: rgba(63, 185, 122, .45); background: rgba(63, 185, 122, .06); }
.tr-date { flex: none; width: 66px; height: 70px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(180deg, #2a3442, #1a212b); border: 1px solid var(--border-strong); line-height: 1; }
.tr-date strong { font-size: 1.7rem; font-weight: 900; color: #fff; }
.tr-date span { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: #9cc3ff; margin-top: 4px; }
.tr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tr-main > a strong { font-size: 1.08rem; color: #fff; }
.tr-meta { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.tr-meta .icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
.tr-act { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
@media (max-width: 600px) { .trainings { grid-template-columns: 1fr; } .training { flex-wrap: wrap; } .tr-act { flex-direction: row; width: 100%; justify-content: flex-end; } }

/* ---------- Chat: Emojis & Reaktionen ---------- */
.chat-form .emoji-btn { font-size: 1.25rem; width: 44px; height: 44px; flex: none; }
.emoji-pop { position: fixed; z-index: 300; display: grid; gap: 2px; padding: 8px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .55); }
.emoji-pop.emoji-write { grid-template-columns: repeat(8, 38px); }
.emoji-pop.emoji-react { grid-template-columns: repeat(10, 36px); border-radius: 999px; padding: 6px 10px; }
.emoji-pop button { all: unset; cursor: pointer; width: 36px; height: 36px; display: grid; place-items: center; font-size: 1.35rem; border-radius: 9px; transition: transform .1s, background .1s; }
.emoji-pop button:hover { background: var(--surface-3); transform: scale(1.18); }
@media (max-width: 480px) { .emoji-pop.emoji-write { grid-template-columns: repeat(7, 38px); } .emoji-pop.emoji-react { grid-template-columns: repeat(5, 36px); border-radius: 14px; } }
.msg-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.msg-reacts:empty { display: none; }
.react { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .95rem; background: rgba(255, 255, 255, .06); border: 1px solid var(--border); }
.react span { font-size: .75rem; font-weight: 700; color: var(--text-2); }
.react.mine { background: rgba(122, 167, 230, .18); border-color: rgba(122, 167, 230, .55); }
.react:hover:not([disabled]) { border-color: var(--border-strong); }
.react[disabled] { cursor: default; }
.change-list.removable li { grid-template-columns: 140px 1fr auto auto; }
@media (max-width: 600px) { .change-list.removable li { grid-template-columns: 1fr auto; } .change-list.removable li .change-text { grid-column: 1 / -1; } }
.tr-act { min-width: 120px; align-items: stretch; }
.tr-act .badge { justify-content: center; padding: 6px 10px; }
.tr-act form { display: flex; }
.tr-act form .btn { width: 100%; justify-content: center; }
.training { align-items: center; }
.trainings-card + .grid, .trainings-card + .card { margin-top: 18px; }
/* Schlüssel/Wert-Listen: nichts darf aus der Karte laufen */
.kv { grid-template-columns: minmax(0, max-content) minmax(0, 1fr); }
.kv dt, .kv dd { min-width: 0; overflow-wrap: anywhere; }
.kv dd .lic-row { justify-content: flex-end; }
/* Gestapelt (schmale Seitenkarten): Bezeichnung oben, Wert darunter */
.kv.kv-stack { grid-template-columns: 1fr; gap: 0; }
.kv.kv-stack dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 12px; }
.kv.kv-stack dt:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.kv.kv-stack dd { text-align: left; padding-top: 4px; }
.kv.kv-stack dd .lic-row { justify-content: flex-start; }
.kv dd .lic-row { margin-top: 0; }
/* Reaktionen unter Tickets, Kommentaren, Notizen, Verlauf */
.react-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; }
.react-row .msg-reacts { margin-top: 0; }
.react-add { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 1px; padding: 2px 7px; border-radius: 999px; font-size: .85rem; border: 1px dashed var(--border); opacity: .55; transition: opacity .15s, background .15s; }
.react-add span { font-size: .7rem; font-weight: 700; color: var(--text-2); }
.react-add:hover, .react-add:focus-visible { opacity: 1; background: rgba(255, 255, 255, .06); }
.msg .react-row { margin-top: 4px; }
/* Akte schreiben */
.rg-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.rg-preview-wrap { position: sticky; top: 16px; }
.rg-preview { margin: 0; white-space: pre-wrap; word-break: break-word; font: .88rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; max-height: calc(100vh - 150px); overflow: auto; }
.pick-list-sm { max-height: 200px; }
.rg-witness { padding-top: 10px; border-top: 1px dashed var(--border); }
.rg-witness:first-child { padding-top: 0; border-top: 0; }
@media (max-width: 1000px) {
  .rg-grid { grid-template-columns: 1fr; }
  .rg-preview-wrap { position: static; }
  .rg-preview { max-height: 60vh; }
}
.rg-mobile-only { display: none; }
@media (max-width: 1000px) { .rg-mobile-only { display: inline-flex; } }
/* Live-Aktualisierung */
.live-flash { animation: live-flash 1.2s ease-out; }
@keyframes live-flash { 0% { box-shadow: 0 0 0 2px rgba(91, 141, 239, .45); } 100% { box-shadow: 0 0 0 2px rgba(91, 141, 239, 0); } }
.live-banner { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90; display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-3, #1f242c); color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; box-shadow: 0 8px 30px rgba(0, 0, 0, .45); }
.live-toasts { position: fixed; right: 16px; top: 16px; z-index: 95; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.live-toast { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 34px 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-3, #1f242c); color: var(--text); text-decoration: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: toast-in .25s ease-out; transition: opacity .35s, transform .35s; }
.live-toast span { font-size: .85rem; color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.live-toast.out { opacity: 0; transform: translateX(20px); }
.live-toast-x { all: unset; position: absolute; top: 6px; right: 10px; cursor: pointer; font-size: 1.1rem; color: var(--muted); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) { .live-toasts { top: auto; bottom: 16px; right: 16px; } }
/* Bilder in Chats */
.chat-form .attach-btn { font-size: 1.2rem; width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.chat-attach { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 8px; border: 1px dashed var(--border); border-radius: var(--radius-sm); font-size: .85rem; color: var(--text-2); }
.chat-attach img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
.chat-attach span { flex: 1; min-width: 0; }
.msg-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msg-img-link { display: block; line-height: 0; }
.msg-img { max-width: min(320px, 100%); max-height: 260px; border-radius: 10px; border: 1px solid var(--border); object-fit: cover; background: var(--bg); }
.msg-img-gone { font-size: .82rem; color: var(--muted); font-style: italic; }
.table tbody tr:has(a[href]) { cursor: pointer; }
.table tbody tr:has(a[href]):hover td { background: rgba(255, 255, 255, .025); }
/* Anwesenheit */
.att-choice { display: inline-flex; gap: 4px; }
.att-opt { position: relative; cursor: pointer; }
.att-opt input { position: absolute; opacity: 0; pointer-events: none; }
.att-opt span { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); font-size: .82rem; color: var(--text-2); }
.att-opt span svg { width: 14px; height: 14px; }
.att-yes input:checked + span { background: rgba(63, 185, 122, .16); border-color: rgba(63, 185, 122, .5); color: #8fe0b4; }
.att-no input:checked + span { background: rgba(229, 83, 83, .16); border-color: rgba(229, 83, 83, .5); color: #f2a3a3; }
.att-opt input:checked + span { font-weight: 700; }
.att-opt input:focus-visible + span { outline: 2px solid var(--accent, #5b8def); }
tr.att-absent td { background: rgba(229, 83, 83, .05); }
.mention-all { background: rgba(224, 164, 58, .18); color: #f1d39c; }
/* Angeheftete Nachrichten */
.chat-pins { margin-bottom: 10px; border: 1px solid rgba(224, 164, 58, .35); background: rgba(224, 164, 58, .07); border-radius: var(--radius-sm); padding: 8px 12px; font-size: .88rem; }
.chat-pins summary { cursor: pointer; font-weight: 700; }
.chat-pins ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.chat-pins li { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.chat-pins li a { color: var(--text-2); text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-pins li a:hover { color: var(--text); }
.msg-pinned { border-color: rgba(224, 164, 58, .45) !important; }
.pin-mark { margin-left: 6px; font-size: .8rem; }

/* ===== DOJ (Department of Justice) – dunkel-goldenes Theme ===== */
body.org-doj {
  --bg: #090a0f; --bg-2: #0d0f17; --surface: #141620; --surface-2: #1a1d2a; --surface-3: #232736;
  --border: #2b3040; --border-strong: #3d4660;
  --accent: #c9a227; --accent-text: #15120a;
  --silver: #e6d29a; --silver-dim: #b9a670;
  --info: #c9a227; --info-bg: rgba(201, 162, 39, .14);
}
body.org-doj .brand-logo img, body.org-doj .footer-brand img, body.org-doj .auth-logo { filter: drop-shadow(0 2px 8px rgba(201, 162, 39, .25)); }
body.org-doj .nav-cta { background: linear-gradient(180deg, rgba(201,162,39,.18), rgba(201,162,39,.08)); border-color: rgba(201,162,39,.4); }
