/* BASTION – Behördenportal Caltera Roleplay
   Palette: Nachtschicht-Blau, Messing (Staatssiegel), Orgafarbe als Kennung */
/* Schriften lokal gehostet (SIL Open Font License) – keine Verbindung zu Google */
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/static/fonts/public-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/static/fonts/public-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/static/fonts/public-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/static/fonts/public-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 500; font-display: swap; src: url('/static/fonts/barlow-condensed-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('/static/fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('/static/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }

:root {
  --bg: #131b26;
  --bg-deep: #0f161f;
  --panel: #19232f;
  --panel-2: #1f2b3a;
  --line: #2a384b;
  --line-soft: #223041;
  --text: #e3e8ef;
  --muted: #93a2b6;
  --faint: #63748b;
  --brass: #c9a54c;
  --brass-hi: #e0c171;
  --brass-ink: #1b1508;
  --ok: #45b374;
  --warn: #dba43c;
  --bad: #e2585d;
  --info: #5f9de6;
  --org: #c9a54c;
  --radius-s: 5px;
  --radius-m: 8px;
  --font: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.5 var(--font); font-feature-settings: 'tnum' 1;
}
a { color: var(--text); text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--brass); }
:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.2; }
h1 { font: 600 30px/1.1 var(--font-cond); letter-spacing: .01em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 .75em; }
small, .muted { color: var(--muted); }
.faint { color: var(--faint); }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
code, .mono { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------------ Gerüst */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--bg-deep); border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 18px; text-decoration: none; }
.brand-mark {
  width: 34px; height: 38px; flex: none; color: var(--brass);
}
.brand-name { font: 700 22px/1 var(--font-cond); letter-spacing: .12em; color: var(--text); }
.brand-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.25; }

.org-switch { margin: 0 12px 8px; position: relative; }
.org-switch summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--panel);
}
.org-switch summary::-webkit-details-marker { display: none; }
.org-switch summary::after { content: ''; margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translateY(-2px); }
.org-switch[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.org-switch .menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--radius-m); padding: 6px; box-shadow: 0 12px 30px rgba(0,0,0,.45);
}
.org-switch .menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-s); text-decoration: none; }
.org-switch .menu a:hover, .org-switch .menu a[aria-current] { background: var(--line-soft); }
.org-chip {
  display: inline-grid; place-items: center; min-width: 42px; height: 24px; padding: 0 6px; border-radius: 4px;
  font: 700 13px/1 var(--font-cond); letter-spacing: .06em; color: #fff; background: var(--c, var(--org));
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.org-switch .org-full { font-size: 13px; color: var(--muted); line-height: 1.2; }

.nav { padding: 6px 10px 14px; }
.nav-group { margin-top: 14px; }
.nav-title { padding: 0 10px 6px; font-size: 12px; color: var(--faint); }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-s);
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14.5px;
}
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a[aria-current="page"] { color: var(--text); background: var(--panel-2); box-shadow: inset 3px 0 0 var(--org); }
.nav a .count { margin-left: auto; font-size: 12px; color: var(--faint); }

.side-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--panel-2); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--muted); overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { font-size: 12px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { padding: 28px 36px 60px; max-width: 1280px; width: 100%; }

/* Lackierungsband: Kennung der Orga über dem Seitenkopf */
.livery { height: 5px; background: linear-gradient(90deg, var(--org) 0 72%, transparent 72% 73.2%, var(--org) 73.2% 76%, transparent 76% 77.2%, var(--org) 77.2% 79%, transparent 79%); opacity: .9; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--muted); font-size: 13.5px; }
.page-head .eyebrow a { color: var(--muted); text-decoration: none; }
.page-head .eyebrow a:hover { color: var(--text); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lead { color: var(--muted); max-width: 70ch; margin-top: 6px; }

/* ------------------------------------------------------------------ Bausteine */
.panel { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius-m); }
.panel-pad { padding: 18px 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { font-size: 15.5px; }
.section { margin-top: 28px; }
.section > h2 { margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  font: 600 14px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #3a4c63; background: #243244; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brass); border-color: var(--brass); color: var(--brass-ink); }
.btn-primary:hover { background: var(--brass-hi); border-color: var(--brass-hi); }
.btn-danger { background: transparent; border-color: rgba(226,88,93,.5); color: #f08a8d; }
.btn-danger:hover { background: rgba(226,88,93,.12); border-color: var(--bad); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-discord { background: #5865f2; border-color: #5865f2; color: #fff; height: 46px; font-size: 15px; width: 100%; }
.btn-discord:hover { background: #6a75f5; border-color: #6a75f5; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok { color: #6fd39a; background: rgba(69,179,116,.12); }
.pill-warn { color: #efc067; background: rgba(219,164,60,.12); }
.pill-bad { color: #f2888c; background: rgba(226,88,93,.12); }
.pill-info { color: #8dbcf2; background: rgba(95,157,230,.12); }
.pill-neutral { color: var(--muted); background: rgba(147,162,182,.1); }
.pill-plain::before { display: none; }

.badge-no { font: 600 14px/1 var(--font-cond); letter-spacing: .05em; padding: 3px 7px; border-radius: 4px; border: 1px solid var(--line); background: var(--bg-deep); color: var(--text); white-space: nowrap; }
.duty-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(69,179,116,.18); }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { font-size: 12.5px; font-weight: 600; color: var(--faint); background: var(--panel); position: sticky; top: 0; }
tbody tr:hover td { background: rgba(255,255,255,.015); }
tbody tr:last-child td { border-bottom: 0; }
td .sub { display: block; font-size: 12.5px; color: var(--muted); }
tr.is-dim td { opacity: .55; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); margin-bottom: 4px; font-size: 15px; }

/* Formulare */
.form { display: grid; gap: 16px; }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
label.field, .field { display: grid; gap: 6px; align-content: end; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.field .hint { font-weight: 400; font-size: 12.5px; color: var(--faint); }
input[type=text], input[type=search], input[type=date], input[type=number], input:not([type]), select, textarea {
  width: 100%; height: 38px; padding: 0 11px; border-radius: var(--radius-s); border: 1px solid var(--line);
  background: var(--bg-deep); color: var(--text); font: 400 14.5px var(--font);
}
textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px rgba(201,165,76,.18); }
input[type=color] { width: 44px; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--bg-deep); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--brass); flex: none; }
.check small { display: block; font-weight: 400; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { max-width: 280px; }
.filters select { width: auto; min-width: 150px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.seg a { padding: 7px 12px; font-size: 13.5px; text-decoration: none; color: var(--muted); border-right: 1px solid var(--line); }
.seg a:last-child { border-right: 0; }
.seg a[aria-current] { background: var(--panel-2); color: var(--text); }

.alert { padding: 12px 16px; border-radius: var(--radius-m); border: 1px solid; margin-bottom: 16px; font-size: 14.5px; }
.alert-ok { border-color: rgba(69,179,116,.4); background: rgba(69,179,116,.08); }
.alert-error { border-color: rgba(226,88,93,.45); background: rgba(226,88,93,.09); }
.alert-warn { border-color: rgba(219,164,60,.45); background: rgba(219,164,60,.08); }
.alert-info { border-color: rgba(95,157,230,.4); background: rgba(95,157,230,.08); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current] { color: var(--text); border-bottom-color: var(--org); }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 9px 18px; margin: 0; font-size: 14.5px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
dialog::backdrop { background: rgba(7,11,16,.7); }
dialog .dlg-head { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; }
dialog .dlg-body { padding: 18px 20px; }
dialog .dlg-foot { padding: 14px 20px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 8px; }

/* ------------------------------------------------------------------ Dashboard */
.org-hero { display: flex; align-items: center; gap: 18px; }
.org-hero .org-logo { width: 56px; height: 56px; border-radius: 10px; object-fit: contain; background: var(--panel); border: 1px solid var(--line-soft); }
.org-hero .org-letters { font: 700 44px/1 var(--font-cond); letter-spacing: .06em; color: var(--org); }
.kpis { display: flex; gap: 0; border: 1px solid var(--line-soft); border-radius: var(--radius-m); background: var(--panel); margin-bottom: 20px; flex-wrap: wrap; }
.kpi { flex: 1 1 160px; padding: 14px 18px; border-right: 1px solid var(--line-soft); }
.kpi:last-child { border-right: 0; }
.kpi b { display: block; font: 600 26px/1.1 var(--font-cond); }
.kpi span { font-size: 13px; color: var(--muted); }
.duty-card { display: flex; align-items: center; gap: 16px; padding: 16px 20px; }
.duty-card.on { box-shadow: inset 4px 0 0 var(--ok); }
.duty-card .state { font: 600 20px/1.1 var(--font-cond); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line-soft); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }

.org-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.org-tile { display: block; text-decoration: none; padding: 18px; border-radius: var(--radius-m); background: var(--panel); border: 1px solid var(--line-soft); border-top: 4px solid var(--c); }
.org-tile:hover { border-color: var(--line); border-top-color: var(--c); background: var(--panel-2); }
.org-tile .letters { font: 700 30px/1 var(--font-cond); letter-spacing: .06em; color: var(--c); }
.org-tile .full { color: var(--muted); font-size: 13.5px; margin: 4px 0 14px; }
.org-tile .nums { display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
.org-tile .nums b { color: var(--text); font-size: 15px; }

/* ------------------------------------------------------------------ Streifenboard */
.board-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; align-items: start; }
.units { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.unit { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius-m); display: flex; flex-direction: column; overflow: hidden; }
.unit-head { display: flex; align-items: stretch; border-bottom: 1px solid var(--line-soft); }
.callsign { flex: 1; padding: 12px 16px 10px; font: 700 30px/1 var(--font-cond); letter-spacing: .05em; }
.unit-code { display: grid; place-items: center; min-width: 116px; padding: 0 12px; background: var(--code, #555); color: #0c1117; font: 700 18px/1 var(--font-cond); letter-spacing: .04em; text-align: center; }
.unit-code small { display: block; font: 600 11px/1.25 var(--font); color: rgba(12,17,23,.78); margin-top: 3px; max-width: 136px; }
.unit-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 9px 16px 0; font-size: 13px; color: var(--muted); }
.crew { list-style: none; margin: 0; padding: 8px 16px 12px; flex: 1; }
.crew li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; }
.crew li .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew .x { background: none; border: 0; color: var(--faint); cursor: pointer; padding: 2px 6px; border-radius: 4px; font-size: 16px; line-height: 1; }
.crew .x:hover { color: var(--bad); background: rgba(226,88,93,.1); }
.unit-foot { padding: 10px 16px 14px; border-top: 1px dashed var(--line-soft); display: grid; gap: 10px; }
.codes { display: flex; flex-wrap: wrap; gap: 5px; }
.code-btn { border: 1px solid var(--line); background: var(--bg-deep); color: var(--text); border-radius: 4px; height: 26px; padding: 0 8px; font: 600 13px/1 var(--font-cond); letter-spacing: .03em; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.code-btn::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: var(--c); }
.code-btn:hover { border-color: var(--c); }
.code-btn[aria-pressed="true"] { background: var(--c); color: #0c1117; border-color: var(--c); }
.code-btn[aria-pressed="true"]::before { background: #0c1117; }
.unit-foot .row select { flex: 1; height: 32px; font-size: 13.5px; }
.since { font-size: 12px; color: var(--faint); padding: 0 16px; }
.legend { display: grid; gap: 6px; font-size: 13px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--c); flex: none; }
.legend b { font-family: var(--font-cond); font-size: 14px; min-width: 52px; }

/* ------------------------------------------------------------------ Ausbildungsmatrix */
.matrix th.rot { white-space: nowrap; }
.matrix td.cell { text-align: center; padding: 6px; }
.cell-btn { width: 100%; min-width: 92px; background: none; border: 1px dashed transparent; border-radius: 5px; padding: 4px; cursor: default; color: inherit; }
.cell-btn.can { cursor: pointer; }
.cell-btn.can:hover { border-color: var(--line); background: var(--panel-2); }
.cell-none { color: var(--faint); font-size: 13px; }

/* ------------------------------------------------------------------ Akten & Stempel */
.dossier { position: relative; padding: 22px 24px; }
.dossier-head { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; }
.doc-no { font: 600 15px/1 var(--font-cond); letter-spacing: .08em; color: var(--muted); }
.doc-title { font: 700 32px/1.05 var(--font-cond); margin: 6px 0 4px; }
.stamp {
  display: inline-block; flex: none; padding: 6px 14px; border: 3px solid currentColor; border-radius: 6px;
  font: 700 24px/1 var(--font-cond); letter-spacing: .14em; text-transform: uppercase; transform: rotate(-7deg);
  box-shadow: inset 0 0 0 2px var(--panel), inset 0 0 0 3.5px currentColor; opacity: .92; margin: 6px 8px 0 0;
}
.stamp-valid { color: #5fcf8f; }
.stamp-expired { color: #e3b14f; }
.stamp-revoked { color: #ef6d72; }
.stamp-sm { font-size: 13px; padding: 3px 8px; border-width: 2px; box-shadow: none; transform: rotate(-4deg); letter-spacing: .1em; margin: 0; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); }
.timeline li:last-child { border-bottom: 0; }
.timeline time { font-size: 12.5px; color: var(--faint); padding-top: 2px; }
.timeline .ev-type { font-weight: 600; font-size: 13.5px; }
.timeline .ev-type.t-lob { color: #6fd39a; }
.timeline .ev-type.t-verwarnung, .timeline .ev-type.t-entlassung, .timeline .ev-type.t-degradierung { color: #f2888c; }
.timeline .ev-type.t-befoerderung { color: var(--brass-hi); }
.timeline .ev-by { font-size: 12.5px; color: var(--faint); }

.person-head { display: flex; gap: 18px; align-items: center; }
.person-head .avatar { width: 64px; height: 64px; font-size: 20px; border: 2px solid var(--org); }

/* Personen-Picker */
.picker { position: relative; }
.picker-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: 0 16px 40px rgba(0,0,0,.5); max-height: 320px; overflow-y: auto; }
.picker-results button { display: flex; width: 100%; text-align: left; gap: 10px; align-items: center; padding: 9px 12px; background: none; border: 0; border-bottom: 1px solid var(--line-soft); color: var(--text); cursor: pointer; font: inherit; }
.picker-results button:hover, .picker-results button.active { background: var(--line-soft); }
.picker-results .src { margin-left: auto; font-size: 12px; color: var(--faint); }
.picker-results .note { padding: 10px 12px; font-size: 13px; color: var(--muted); }
.picker-chosen { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid rgba(201,165,76,.5); background: rgba(201,165,76,.07); border-radius: var(--radius-s); }
.picker-chosen .grow { flex: 1; }
.picker-manual { display: grid; gap: 12px; grid-template-columns: 1fr 1fr 150px; margin-top: 10px; padding: 12px; border: 1px dashed var(--line); border-radius: var(--radius-s); }
[hidden] { display: none !important; }

/* Rechte-Editor */
details.rank { border-bottom: 1px solid var(--line-soft); }
details.rank:last-child { border-bottom: 0; }
details.rank > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 12px 20px; }
details.rank > summary::-webkit-details-marker { display: none; }
details.rank > summary .lvl { font: 600 14px/1 var(--font-cond); color: var(--faint); min-width: 34px; }
details.rank > summary .nm { font-weight: 600; flex: 1; }
details.rank[open] > summary { background: var(--panel-2); }
.rank-body { padding: 16px 20px 20px; }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px 24px; margin: 16px 0; }
.perm-group h3 { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.perm-group .check { margin-bottom: 7px; font-size: 13.5px; }
.perm-group .check.unavail { opacity: .45; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { position: relative; background: var(--bg-deep); border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; justify-content: space-between; padding: 44px; overflow: hidden; }
.login-art .seal { width: 92px; color: var(--brass); }
.login-art h1 { font: 700 64px/0.95 var(--font-cond); letter-spacing: .14em; margin-top: 26px; }
.login-art .sub { color: var(--muted); font-size: 16px; margin-top: 10px; max-width: 40ch; }
.login-orgs { display: flex; flex-wrap: wrap; gap: 8px; }
.login-form { display: grid; place-items: center; padding: 40px 24px; }
.login-box { width: min(380px, 100%); }
.login-box h2 { font: 600 28px/1.1 var(--font-cond); margin-bottom: 8px; }
.login-box p { color: var(--muted); }

/* ------------------------------------------------------------------ Mobil */
@media (max-width: 1100px) {
  .grid-side, .board-layout { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(7,11,16,.6); }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); background: var(--bg-deep); position: sticky; top: 0; z-index: 40; }
  .topbar .brand-name { font-size: 18px; }
  .content { padding: 20px 16px 48px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { padding: 28px 24px; min-height: auto; }
  .login-art h1 { font-size: 44px; }
  .picker-manual { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
