:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1f23; --bg2: #16181c; --panel: #25292e; --panel2: #2d3238; --line: #353a41; --line2: #444a52;
  --text: #eceef2; --mute: #a2a9b5; --dim: #6f7886;
  --gold: #d9b25f; --gold2: #f1d08a; --goldbg: rgba(217, 178, 95, .12); --btn1: #f1d08a; --btn2: #d9b25f; --btntext: #1d1608;
  --red: #e0303c; --redbg: rgba(224, 48, 60, .14); --brand-red: #b3121c;
  --green: #3ddc97; --greenbg: rgba(61, 220, 151, .12); --blue: #7aa2ff; --amber: #ffb84d; --tabbar: rgba(22, 24, 28, .96);
  --glow1: rgba(217, 178, 95, .07); --glow2: rgba(179, 18, 28, .06);
  --radius: 14px; --nav-w: 230px; --tabbar-h: 62px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}
:root[data-theme="black"] {
  --bg: #000; --bg2: #08090a; --panel: #101113; --panel2: #18191c; --line: #25272b; --line2: #35383d; --tabbar: rgba(0, 0, 0, .96);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f3f6; --bg2: #e7eaef; --panel: #ffffff; --panel2: #f0f2f5; --line: #d8dce3; --line2: #c0c6d0;
  --text: #15181e; --mute: #525a68; --dim: #7a8392;
  --gold: #b88a1f; --gold2: #8a6410; --goldbg: rgba(184, 138, 31, .13); --btn1: #e8c36a; --btn2: #cf9f2f; --btntext: #20170a;
  --red: #c8202c; --redbg: rgba(200, 32, 44, .1); --green: #12805a; --greenbg: rgba(18, 128, 90, .1); --blue: #2e5fd1; --amber: #a86a00; --tabbar: rgba(255, 255, 255, .96);
  --glow1: rgba(184, 138, 31, .08); --glow2: rgba(179, 18, 28, .04);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: radial-gradient(900px 500px at 85% -10%, var(--glow1), transparent 60%), radial-gradient(700px 500px at -10% 110%, var(--glow2), transparent 60%); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
a { color: var(--gold2); }
.hidden { display: none !important; }
.mute { color: var(--mute); } .dim { color: var(--dim); } .small { font-size: 13px; } .mono { font-family: var(--mono); }
::selection { background: rgba(217, 178, 95, .35); }
* { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }

/* ---------- Buttons und Formulare ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); padding: 9px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; min-height: 40px; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--line); border-color: #46506189; }
.btn:active { transform: translateY(1px); }
.btn.gold { background: linear-gradient(180deg, var(--btn1), var(--btn2)); color: var(--btntext); border-color: transparent; }
.btn.gold:hover { filter: brightness(1.06); }
.btn.red { background: var(--brand-red); border-color: transparent; color: #fff; }
.btn.red:hover { background: #cc1621; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 11px; min-height: 32px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > label, .lbl { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mute); }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea { width: 100%; background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; min-height: 42px; outline: none; }
textarea { resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 178, 95, .18); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--gold); width: 17px; height: 17px; flex: none; }
.check small { color: var(--dim); display: block; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; } .gap { gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h3 { font-size: 15px; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--panel2); border: 1px solid var(--line2); color: var(--mute); white-space: nowrap; }
.chip.gold { background: var(--goldbg); border-color: rgba(217, 178, 95, .4); color: var(--gold2); }
.chip.green { background: var(--greenbg); border-color: rgba(61, 220, 151, .4); color: var(--green); }
.chip.red { background: var(--redbg); border-color: rgba(224, 48, 60, .45); color: var(--red); }
.chip.blue { background: rgba(122, 162, 255, .12); border-color: rgba(122, 162, 255, .4); color: var(--blue); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); display: inline-block; flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.bar { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold2)); border-radius: 99px; transition: width .6s; }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand svg { width: 44px; height: 44px; flex: none; }
.brand b { display: block; letter-spacing: .22em; font-size: 15px; color: var(--gold2); }
.brand span { display: block; font-size: 12px; letter-spacing: .3em; color: var(--mute); }
.login-card h1 { font-size: 22px; margin: 26px 0 4px; }
.err { background: var(--redbg); border: 1px solid rgba(224, 48, 60, .45); color: var(--red); padding: 9px 12px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; background: var(--bg2); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; }
.side .brand { padding: 4px 8px 18px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--mute); text-decoration: none; font-weight: 600; position: relative; }
.nav a svg { width: 21px; height: 21px; flex: none; }
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a.on { background: var(--goldbg); color: var(--gold2); }
.nav a .badge { margin-left: auto; background: var(--brand-red); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; }
.side .me { margin-top: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.side .me b { display: block; }
.side .me .bar { margin: 8px 0 4px; }
.main { min-width: 0; padding: 26px 30px 40px; max-width: 1280px; width: 100%; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-h h1 { font-size: 26px; }
.tabbar { display: none; }
@media (max-width: 900px) {
  .shell { display: block; }
  .side { display: none; }
  .main { padding: 16px 16px calc(var(--tabbar-h) + 28px); }
  .page-h h1 { font-size: 22px; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom); background: var(--tabbar); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  .tabbar a { display: grid; place-items: center; align-content: center; gap: 2px; color: var(--mute); text-decoration: none; font-size: 11px; font-weight: 600; position: relative; }
  .tabbar a svg { width: 23px; height: 23px; }
  .tabbar a.on { color: var(--gold2); }
  .tabbar a .badge { position: absolute; top: 6px; left: 55%; background: var(--brand-red); color: #fff; border-radius: 99px; font-size: 10px; padding: 0 6px; }
}

/* ---------- Banner (Notruf, Nothalt) ---------- */
.banners { position: sticky; top: 0; z-index: 40; display: grid; gap: 8px; margin-bottom: 14px; }
.banners:empty { display: none; }
.alert { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-radius: 14px; background: linear-gradient(90deg, #8e0e17, #c0141f); border: 1px solid #ff5a65; color: #fff; box-shadow: 0 10px 40px rgba(224, 48, 60, .4); animation: alertpulse 1s infinite; }
.alert.ack { background: linear-gradient(90deg, #6e5110, #8d6a17); border-color: var(--gold); animation: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.alert .ico { font-size: 26px; }
.alert b { font-size: 17px; letter-spacing: .04em; }
.alert .info { flex: 1; min-width: 200px; }
.alert .btn { background: rgba(0, 0, 0, .3); border-color: rgba(255, 255, 255, .4); color: #fff; }
.alert .btn:hover { background: rgba(0, 0, 0, .5); }
@keyframes alertpulse { 50% { box-shadow: 0 10px 50px rgba(255, 60, 70, .75); filter: brightness(1.12); } }
.alert.nothalt { background: linear-gradient(90deg, #7c1010, #b01818); }

/* ---------- Modals und Toast ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(4, 5, 8, .72); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 18px; padding: 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.modal.wide { width: min(760px, 100%); }
.modal h2 { font-size: 20px; margin-bottom: 16px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: 24px; display: grid; gap: 8px; width: min(440px, calc(100% - 24px)); pointer-events: none; }
@media (max-width: 900px) { .toasts { bottom: calc(var(--tabbar-h) + 14px); } }
.toast { background: var(--panel2); border: 1px solid var(--line2); border-left: 4px solid var(--gold); padding: 11px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: rise .2s; }
.toast.err { border-left-color: var(--red); } .toast.ok { border-left-color: var(--green); }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Tabellen ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--mute); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .02); }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 18px; padding-bottom: 2px; }
.tabs button { background: transparent; border: 1px solid transparent; color: var(--mute); padding: 8px 14px; border-radius: 99px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.on { background: var(--goldbg); border-color: rgba(217, 178, 95, .4); color: var(--gold2); }
.empty { padding: 30px; text-align: center; color: var(--dim); }

/* ---------- Funk-Seite ---------- */
.funk { display: grid; grid-template-columns: 392px minmax(0, 1fr); gap: 26px; align-items: start; }
@media (max-width: 1080px) { .funk { grid-template-columns: 1fr; justify-items: center; } .funk > .panel { width: 100%; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; min-height: 560px; }
.panel .tabs { margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.panel .body { flex: 1; overflow: auto; padding: 14px; max-height: 620px; min-height: 360px; }
.logline { display: grid; grid-template-columns: 58px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.logline:last-child { border-bottom: 0; }
.logline time { color: var(--dim); font-family: var(--mono); font-size: 12px; padding-top: 2px; }
.logline .who { font-weight: 700; }
.logline.k-emergency { color: #ff9aa1; } .logline.k-nothalt { color: #ff9aa1; font-weight: 600; }
.logline.k-duty, .logline.k-voice, .logline.k-level { color: var(--mute); }
.logline.k-zugmeldung .who { color: var(--blue); }
.logline.k-level .who { color: var(--gold2); }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--bg2); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 0; background: var(--bg2); }
.quick button { background: var(--panel2); border: 1px solid var(--line2); border-radius: 99px; padding: 4px 11px; cursor: pointer; font-size: 13px; color: var(--mute); }
.quick button:hover { color: var(--text); border-color: var(--gold); }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #14100a; flex: none; background: var(--gold); }
.person .meta { min-width: 0; flex: 1; }
.person .meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Funkgerät ---------- */
.radio { width: 100%; max-width: 392px; border-radius: 34px 34px 44px 44px; padding: 16px 16px 20px; background: linear-gradient(160deg, #2b303a 0%, #171a20 38%, #101216 100%); border: 1px solid #3a414e; box-shadow: 0 40px 90px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 -3px 12px rgba(0, 0, 0, .55); position: relative; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.radio::before { content: ""; position: absolute; top: -26px; left: 46px; width: 18px; height: 40px; border-radius: 9px 9px 0 0; background: linear-gradient(90deg, #14161a, #2b2f37, #14161a); border: 1px solid #353b46; border-bottom: 0; }
.radio .top { display: flex; justify-content: space-between; align-items: center; padding: 0 8px 10px; }
.radio .top b { font-size: 11px; letter-spacing: .3em; color: var(--gold); }
.radio .top span { font-size: 10px; letter-spacing: .15em; color: var(--dim); }
.leds { display: flex; gap: 6px; } .led { width: 9px; height: 9px; border-radius: 50%; background: #2b3039; border: 1px solid #00000066; }
.led.rx.on { background: var(--green); box-shadow: 0 0 10px var(--green); } .led.tx.on { background: var(--red); box-shadow: 0 0 10px var(--red); } .led.em.on { background: var(--red); animation: blink .5s infinite; }
@keyframes blink { 50% { opacity: .15; } }
.lcd { background: #070f16; border-radius: 12px; border: 3px solid #05080b; box-shadow: inset 0 0 0 1px #1b2a38, inset 0 0 30px rgba(0, 0, 0, .75), 0 1px 0 rgba(255, 255, 255, .06); color: #d7ecff; padding: 8px 12px 10px; min-height: 262px; display: flex; flex-direction: column; position: relative; overflow: hidden; font-family: var(--font); }
.lcd::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px), linear-gradient(160deg, rgba(255, 255, 255, .06), transparent 35%); }
.lcd .sb { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #8fb3cf; padding-bottom: 6px; border-bottom: 1px solid #16293a; }
.lcd .sb .net { flex: 1; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; } .bars i { width: 3px; background: #2b4458; border-radius: 1px; } .bars i.on { background: #6fd4ff; }
.batt { width: 20px; height: 10px; border: 1px solid #8fb3cf; border-radius: 2px; padding: 1px; position: relative; } .batt::after { content: ""; position: absolute; right: -4px; top: 2px; width: 2px; height: 4px; background: #8fb3cf; } .batt i { display: block; height: 100%; width: 85%; background: #6fd4ff; }
.lcd .l1 { margin-top: 8px; font-size: 12px; color: #8fb3cf; display: flex; justify-content: space-between; gap: 8px; }
.lcd .l2 { font-size: 21px; font-weight: 700; color: #fff; margin-top: 2px; line-height: 1.15; min-height: 48px; }
.lcd .l3 { font-size: 12px; color: #8fb3cf; }
.lcd .status { margin-top: auto; text-align: center; padding: 10px 6px; border-radius: 8px; font-weight: 800; letter-spacing: .12em; font-size: 15px; background: #0e2132; color: #6fd4ff; border: 1px solid #1b3a52; }
.lcd .status.tx { background: #4a0d12; color: #ff8a92; border-color: #8e1b24; } .lcd .status.rx { background: #0c3a29; color: var(--green); border-color: #1a6d4d; }
.lcd .status.busy { background: #43310a; color: var(--amber); border-color: #7a5a14; } .lcd .status.off { background: #141a20; color: #5f7487; border-color: #1d2832; }
.lcd .status.em { background: #8e0e17; color: #fff; border-color: #ff5a65; animation: blink .7s infinite; }
.lcd .dial { font-family: var(--mono); font-size: 20px; letter-spacing: .12em; color: var(--amber); min-height: 28px; }
.lcd .soft { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: #8fb3cf; }
.lcd .soft button { background: transparent; border: 0; color: #6fd4ff; cursor: pointer; padding: 2px 4px; font-weight: 700; }
.keys { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 10px; margin: 16px 6px 12px; align-items: center; }
.rk { border: 0; border-radius: 12px; min-height: 46px; background: linear-gradient(180deg, #2f3540, #1d2128); color: #dfe3ea; font-weight: 700; font-size: 17px; cursor: pointer; box-shadow: 0 2px 0 #0a0b0e, inset 0 1px 0 rgba(255, 255, 255, .1); }
.rk:active { transform: translateY(2px); box-shadow: 0 0 0 #0a0b0e, inset 0 1px 0 rgba(255, 255, 255, .06); }
.rk.green { background: linear-gradient(180deg, #2fb67c, #1b7a52); color: #fff; } .rk.endk { background: linear-gradient(180deg, #d63d47, #8e1b24); color: #fff; }
.rk small { display: block; font-size: 9px; font-weight: 600; letter-spacing: .1em; color: #8d95a4; margin-top: -2px; }
.nav2 { display: grid; gap: 6px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 6px; }
.keypad .rk { min-height: 38px; font-size: 16px; }
.ptt-row { display: grid; grid-template-columns: 1fr 74px; gap: 12px; margin: 16px 6px 0; align-items: stretch; }
.ptt { border: 0; border-radius: 18px; min-height: 84px; cursor: pointer; background: linear-gradient(180deg, #3b4350, #20252d); color: #eef0f4; font-weight: 800; letter-spacing: .2em; font-size: 15px; box-shadow: 0 5px 0 #0a0b0e, inset 0 1px 0 rgba(255, 255, 255, .13); position: relative; touch-action: none; }
.ptt small { display: block; letter-spacing: .08em; font-weight: 600; font-size: 10px; color: #9aa3b3; margin-top: 4px; }
.ptt.down { transform: translateY(4px); box-shadow: 0 1px 0 #0a0b0e; background: linear-gradient(180deg, #c42b36, #8a1820); }
.ptt.down small { color: #ffd0d3; }
.ptt[disabled] { opacity: .45; }
.emerg { position: relative; border-radius: 16px; overflow: hidden; }
.emerg .cap { position: absolute; inset: 0; z-index: 2; background: linear-gradient(180deg, #ffd24d, #d9a21f); border: 2px solid #8a6410; border-radius: 16px; display: grid; place-items: center; font-size: 10px; font-weight: 800; letter-spacing: .06em; color: #3a2a05; cursor: pointer; text-align: center; line-height: 1.1; transition: transform .3s cubic-bezier(.5, 0, .2, 1); transform-origin: top left; }
.emerg.open .cap { transform: translateY(-110%) rotate(-12deg); }
.emerg .eb { width: 100%; height: 100%; min-height: 84px; border: 0; border-radius: 16px; background: radial-gradient(circle at 50% 35%, #ff5a64, #b3121c 70%); color: #fff; font-weight: 900; font-size: 12px; letter-spacing: .08em; cursor: pointer; box-shadow: inset 0 0 0 3px #5b0a10; position: relative; overflow: hidden; touch-action: none; }
.emerg .eb i { position: absolute; left: 0; bottom: 0; height: 100%; width: 0; background: rgba(255, 255, 255, .35); }
.emerg .eb.holding i { width: 100%; transition: width 1.2s linear; }
.emerg.active .eb { animation: blink .8s infinite; }
.hintline { text-align: center; margin: 12px 6px 0; font-size: 11px; color: var(--dim); }

/* ---------- Stellwerke ---------- */
.levelcard { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; margin-bottom: 22px; }
.lvbadge { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(160deg, var(--gold2), var(--gold)); color: #1d1608; font-size: 28px; font-weight: 900; box-shadow: 0 8px 30px rgba(217, 178, 95, .25); }
.boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.box.mine { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 14px 40px rgba(217, 178, 95, .12); }
.box.locked { opacity: .78; }
.box .code { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; letter-spacing: .04em; background: #0f1d2a; border: 1px solid #214056; color: #6fd4ff; font-family: var(--mono); }
.box .st { margin-top: auto; display: grid; gap: 8px; }
.box .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.occ { font-size: 13px; color: var(--mute); }

/* ---------- Wissen ---------- */
.wiki { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .wiki { grid-template-columns: 1fr; } .wiki.reading .wikilist { display: none; } .wiki:not(.reading) .article { display: none; } }
.wikilist { position: sticky; top: 14px; max-height: calc(100dvh - 40px); overflow: auto; }
@media (max-width: 900px) { .wikilist { position: static; max-height: none; } }
.wikilist h4 { margin: 18px 0 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.wikilist a { display: block; padding: 8px 12px; border-radius: 9px; color: var(--text); text-decoration: none; font-size: 14px; }
.wikilist a:hover { background: var(--panel); } .wikilist a.on { background: var(--goldbg); color: var(--gold2); }
.article { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; min-width: 0; }
@media (max-width: 600px) { .article { padding: 20px 16px; } }
.md h1 { font-size: 28px; margin-bottom: 8px; } .md h2 { font-size: 21px; margin: 28px 0 8px; color: var(--gold2); } .md h3 { font-size: 17px; margin: 22px 0 6px; }
.md p { margin: 10px 0; } .md ul, .md ol { padding-left: 22px; } .md li { margin: 4px 0; }
.md code { background: var(--bg2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-family: var(--mono); font-size: .9em; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.md table { margin: 14px 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: block; overflow-x: auto; }
.md th, .md td { border-bottom: 1px solid var(--line); padding: 8px 12px; }
.callout { border-left: 4px solid var(--gold); background: var(--goldbg); padding: 10px 16px; border-radius: 0 10px 10px 0; margin: 14px 0; }
.callout.warn { border-color: var(--red); background: var(--redbg); } .callout.tip { border-color: var(--green); background: var(--greenbg); } .callout.info { border-color: var(--blue); background: rgba(122, 162, 255, .1); }
.callout p { margin: 4px 0; }
.funkdlg { display: grid; gap: 8px; margin: 14px 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.funkdlg div { max-width: 86%; padding: 8px 12px; border-radius: 12px; background: var(--panel2); font-size: 14px; }
.funkdlg div b { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold2); }
.funkdlg div.r { justify-self: end; background: #1b2b3a; } .funkdlg div.r b { color: #6fd4ff; }
.signals { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.sig { background: #0a0d12; border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px 10px; text-align: center; font-size: 13px; }
.sig svg { width: 76px; height: 120px; display: block; margin: 0 auto 6px; }
.sig b { display: block; color: var(--gold2); } .sig span { color: var(--mute); font-size: 12px; display: block; line-height: 1.3; }
.sig .lamp.blink { animation: blink 1s steps(1) infinite; }

/* ---------- Tastenbelegung ---------- */
.keyrow { display: grid; grid-template-columns: minmax(150px, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.keyrow:last-child { border-bottom: 0; }
@media (max-width: 640px) { .keyrow { grid-template-columns: 1fr; } .keyrow .row { justify-content: flex-start !important; } }
.chip .x { background: transparent; border: 0; color: inherit; cursor: pointer; font-size: 15px; padding: 0 0 0 4px; line-height: 1; }

/* ---------- Dienst-Dialog, Anruf ---------- */
.callov { position: fixed; inset: 0; z-index: 90; background: rgba(5, 7, 10, .88); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 20px; }
.callbox { width: min(360px, 100%); text-align: center; background: var(--panel); border: 1px solid var(--line2); border-radius: 24px; padding: 30px 24px; }
.callbox .avatar { width: 84px; height: 84px; font-size: 32px; margin: 0 auto 14px; animation: ring 1s infinite; }
@keyframes ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, .5); } 50% { box-shadow: 0 0 0 18px rgba(61, 220, 151, 0); } }
.callbox .row { justify-content: center; margin-top: 22px; }
.pick { display: grid; gap: 8px; margin: 10px 0 4px; }
.pick button { text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 14px; cursor: pointer; }
.pick button:hover:not([disabled]) { border-color: var(--gold); } .pick button[disabled] { opacity: .45; cursor: not-allowed; }

.permgrid h4 { margin: 14px 0 2px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold2); }
.levelrow { display: grid; grid-template-columns: 54px 110px 1fr 40px; gap: 8px; align-items: center; margin-bottom: 8px; }
.stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat > div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 22px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
