/* QO-100 WebSDR DM2NT – neue Oberfläche (nb2) */
:root {
  --bg: #0B0F14;
  --bg2: #0E141B;
  --card: #121820;
  --line: #1F2833;
  --line2: #2A3644;
  --text: #E6EDF3;
  --text2: #C9D3DD;
  --muted: #8B98A5;
  --accent: #38BDF8;
  --accent-bg: #0C2B3D;
  --tune: #F59E0B;
  --ok: #34D399;
  --ok-bg: #0F2A1E;
  --bad: #F87171;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; }
a { color: #7DD3FC; }
a:hover { color: #BAE6FD; }
.mono { font-family: var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Rahmen: alles in einem Bildschirm ---------- */
.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }

/* ---------- Kopfzeile ---------- */
.topbar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 30px; height: 30px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; flex: none; }
.brand-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.brand-sub { font-size: 11px; color: var(--muted); white-space: nowrap; }

.freqblock { min-width: 230px; }
.freq { display: block; border: 0; background: transparent; color: var(--text); padding: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; cursor: text; text-align: left; white-space: nowrap; }
.freq .hz { color: var(--muted); }
.freq .khz { color: var(--tune); }
.freq .unit { font-size: 13px; color: var(--muted); font-weight: 500; }
.freqblock .sub { font-size: 11px; color: var(--muted); white-space: nowrap; }
.modebadge { display: inline-block; padding: 0 5px; border-radius: 4px; background: var(--accent-bg); color: var(--text); border: 1px solid var(--accent); font-size: 10px; font-weight: 700; }
.freqedit { display: flex; gap: 6px; }
.freqedit input { width: 150px; height: 34px; padding: 0 8px; font-size: 16px; border-radius: 8px; border: 1px solid var(--accent); background: var(--bg); color: var(--text); }

.meters { flex: 1 1 220px; min-width: 200px; max-width: 420px; display: flex; flex-direction: column; gap: 6px; }
.meter { display: flex; align-items: center; gap: 8px; }
.mlabel { width: 22px; font-size: 11px; font-weight: 700; color: var(--muted); }
.mbar { flex: 1; height: 11px; display: flex; gap: 2px; }
.mbar span { flex: 1; border-radius: 1px; background: #16351F; }
.mbar span.z2 { background: #3A3510; }
.mbar span.z3 { background: #3D2410; }
.mbar span.z4 { background: #3D1616; }
.mbar span.on { background: #34D399; }
.mbar span.on.z2 { background: #FACC15; }
.mbar span.on.z3 { background: #FB923C; }
.mbar span.on.z4 { background: #F87171; }
/* Spitzenwert in der Farbe seiner Zone */
.mbar span.pk { background: #34D399; box-shadow: 0 0 6px rgba(52,211,153,0.9); }
.mbar span.pk.z2 { background: #FACC15; box-shadow: 0 0 6px rgba(250,204,21,0.9); }
.mbar span.pk.z3 { background: #FB923C; box-shadow: 0 0 6px rgba(251,146,60,0.9); }
.mbar span.pk.z4 { background: #F87171; box-shadow: 0 0 6px rgba(248,113,113,0.9); }
.mval { width: 66px; text-align: right; font-size: 11px; }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; background: #161E28; color: var(--text2); font-size: 12px; white-space: nowrap; }
.chip b { color: var(--text); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.chip.ok { background: var(--ok-bg); color: #6EE7B7; }
.chip.ok .dot { background: var(--ok); }
.chip.bad { background: #2A1414; color: #FCA5A5; }
.chip.bad .dot { background: var(--bad); }
.chip.bad b { display: none; }

.tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.seg { display: inline-flex; height: 32px; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #161E28; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; padding: 0 9px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line2); }
.seg button[aria-pressed="true"] { background: var(--accent-bg); color: var(--text); }
.seg.small { height: 28px; }
/* Sprachwahl: am Rechner Knöpfe, auf schmalen Bildschirmen ein kompaktes Menü */
.langseg button { padding: 0 7px; }
.langpick { display: none; position: relative; align-items: center; gap: 5px; height: 32px; padding: 0 9px; border: 1px solid var(--line2); border-radius: 8px; background: #161E28; color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; }
.langpick svg { width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 1.6; }
.langpick .caret { color: var(--muted); font-size: 10px; }
.langpick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.langpick:focus-within { outline: 2px solid var(--accent, #4C8DFF); outline-offset: 1px; }
@media (max-width: 1600px) {
  .langseg { display: none; }
  .langpick { display: inline-flex; }
}
/* im Namensdialog ist es immer eng: dort nur das Menü */
.gate .langseg { display: none; }
.gate label.langpick { display: inline-flex; flex: none; margin: 0; font-size: 12px; }

.audioctl { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 2px; border: 1px solid var(--line2); border-radius: 8px; background: #161E28; }
.audioctl input[type=range] { width: 80px; }
.iconbtn { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 0; }
.iconbtn.framed { width: 34px; height: 34px; border: 1px solid var(--line2); background: #161E28; border-radius: 8px; }
.iconbtn.framed[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-bg); }
.iconbtn svg { width: 19px; height: 19px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn .cross { display: none; }
.iconbtn.muted svg { stroke: var(--bad); }
.iconbtn.muted .wave1, .iconbtn.muted .wave2 { display: none; }
.iconbtn.muted .cross { display: inline; }

input[type=range] { accent-color: var(--accent); width: 100%; margin: 0; }
input[type=range]:disabled { opacity: 0.35; }

/* ---------- Hauptbereich ---------- */
.layout { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 12px 16px; }
.col-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.col-side { flex: 0 0 320px; min-width: 0; display: flex; flex-direction: column; gap: 12px; min-height: 0; position: relative; }
/* rechte Spalte: eigene Bildlaufleiste, wenn das Fenster zu niedrig ist; Karten schrumpfen nicht */
.col-side { overflow-y: auto; overflow-x: hidden; padding-right: 4px; margin-right: -4px; scrollbar-width: thin; scrollbar-color: #2A3542 transparent; }
.col-side::-webkit-scrollbar { width: 6px; }
.col-side::-webkit-scrollbar-thumb { background: #2A3542; border-radius: 3px; }
.col-side::-webkit-scrollbar-thumb:hover { background: #3A4757; }
.col-side > .card { flex-shrink: 0; }
.col-side > .card.chat { flex: 1 0 auto; min-height: 300px; }
.col-side > .card.chat:has(.decpane:not([hidden])) { min-height: 540px; }
.decpane { min-height: 220px; }
.chatpane { min-height: 170px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; display: flex; flex-direction: column; min-height: 0; }
.card h2, .drawer h2 { margin: 0; font-size: 12px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.06em; }
.card-head { flex: none; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; margin-bottom: 6px; }
.card-tools { display: flex; align-items: center; gap: 10px; }
.hint { font-size: 12px; color: var(--muted); }
.hint.small { font-size: 11px; margin: 6px 0 0; }
.grow3 { flex: 3 1 0; min-height: 260px; }
.grow2 { flex: 2 1 0; min-height: 170px; }

/* ---------- Spektrum / Wasserfall ---------- */
.stack { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 2px; }
.stack canvas { display: block; }
.cv-band { flex: none; width: 100%; height: 16px; border-radius: 4px; }
.cv-axis { flex: none; width: 100%; height: 18px; }
.pane { position: relative; min-height: 0; }
.pane canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pane.spec { flex: 2 1 0; min-height: 70px; border-radius: 6px 6px 0 0; overflow: hidden; }
.pane.wf { flex: 3 1 0; min-height: 80px; }
.pane.zspec { flex: 1 1 0; min-height: 44px; border-radius: 6px 6px 0 0; overflow: hidden; }
.pane.zwf { flex: 2 1 0; min-height: 60px; }
.pane canvas { cursor: crosshair; }
.wfbg { background: #04080F; }

/* ---------- Seitenleiste ---------- */
.users { flex: 0 0 auto; max-height: 260px; }
.chat { flex: 1 1 0; min-height: 140px; }
.tune { flex: none; }
.tunerow { display: flex; align-items: center; gap: 10px; }
.tbtn { flex: none; width: 56px; height: 50px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent-bg); cursor: pointer; display: flex; align-items: center; justify-content: center; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tbtn:active, .tbtn.held { background: #13405A; }
.tbtn svg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; }
.tfreq { flex: 1; min-width: 0; text-align: center; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; }
.tfreq .khz { color: var(--tune); }
.tfreq .hz { color: var(--muted); }
.steprow { display: flex; gap: 6px; margin-top: 10px; }
.steps { flex: 3 1 0; height: 30px; }
.steps button { flex: 1; }
.nickrow, .chatrow { flex: none; display: flex; gap: 6px; }
.nickrow { margin-bottom: 8px; }
.nickrow input, .chatrow input { flex: 1; min-width: 0; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text); font: inherit; }
.chatrow { margin-top: 8px; }
.chatrow .send { width: 38px; height: 34px; border: 1px solid var(--accent); background: var(--accent-bg); border-radius: 8px; }

.userlist { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 2px; }
.userlist li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: var(--bg2); font-size: 13px; }
.userlist li.me { background: var(--accent-bg); }
.userlist .nm { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userlist .nm.guest { color: var(--muted); font-weight: 400; font-style: italic; }
.userlist .qrg { font-family: var(--mono); font-size: 12px; color: #FCD34D; }
.flag { flex: none; width: 22px; text-align: center; font-size: 16px; line-height: 1; }
.flag.code { width: auto; min-width: 22px; padding: 1px 3px; border-radius: 3px; background: #1F2833; color: var(--text2); font-family: var(--mono); font-size: 10px; font-weight: 700; }
.flag svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

.chatlog { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; font-size: 13px; line-height: 1.45; }
.chatlog .msg { overflow-wrap: anywhere; }
.chatlog .tm { font-family: var(--mono); font-size: 11px; color: #6B7785; margin-right: 4px; }
.chatlog .who { font-weight: 700; margin-right: 4px; }
.chatlog .txt { color: var(--text2); }
.chatlog .empty { color: #6B7785; font-style: italic; }

/* Decoder-Auswahl in der Abstimmungskarte */
.decsel { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.decgrp { display: grid; grid-template-columns: 50px 1fr; align-items: center; gap: 6px; }
.decsel .lbl { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.decrow { display: flex; align-items: center; gap: 6px; min-width: 0; }
.decrow .grow { flex: 1; }
.decrow > .lbl { margin-left: 4px; }
.seg.small.decmodes { height: 26px; }
.seg.small.decmodes.wrap { width: 100%; height: auto; flex-wrap: wrap; }
.decmodes button { padding: 0 8px; font-size: 11.5px; }
.seg.decmodes.fill { width: 100%; }
.decrow .seg.decmodes.fill { flex: 1 1 0; width: auto; }
.decmodes.fill button { flex: 1; }
.steps button, .sbsel button { padding: 0 4px; white-space: nowrap; }
.decmodes.wrap button { flex: 1 0 18%; height: 26px; padding: 0 2px; }
.decmodes.wrap button:nth-child(n+6) { border-top: 1px solid var(--line2); }
.decmodes.wrap button:nth-child(6) { border-left: 0; }
.decoff button[aria-pressed="true"] { background: #161E28; color: var(--muted); }

/* Decoder-Ausgabe über dem Chat */
.card.chat { display: flex; flex-direction: column; gap: 10px; }
.decpane { flex: 1.3 1 0; min-height: 150px; display: flex; flex-direction: column; }
.decpane .card-head h2 #decName { color: var(--text); }
.chatpane { flex: 1 1 0; min-height: 110px; display: flex; flex-direction: column; }
.decpane:not([hidden]) + .chatpane { border-top: 1px solid var(--line); padding-top: 8px; }
.decsub { height: 26px; border-radius: 6px; border: 1px solid var(--line2); background: #161E28; color: var(--text2); font: inherit; font-size: 12px; padding: 0 6px; }
.rsidtoast { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; border-radius: 8px; border: 1px solid rgba(250,204,21,0.45); background: rgba(250,204,21,0.08); font-size: 12px; color: #FDE68A; }
.rsidtoast .grow { flex: 1; min-width: 0; }
.btn.small { height: 26px; padding: 0 10px; font-size: 12px; }
.iconbtn.small { width: 24px; height: 24px; }
.iconbtn.small svg { width: 14px; height: 14px; stroke: currentColor; }
.btn.hl { background: var(--accent); color: #06121E; border-color: var(--accent); }
.modal-actions.gap { gap: 8px; flex-wrap: wrap; align-items: center; }
.modal-actions .grow { flex: 1; }
.qtab input[type=text], .qtab input[type=number], .qtab select { height: 26px; border-radius: 6px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text); font: inherit; font-size: 12px; padding: 0 6px; }
.qtab input.qn { width: 110px; } .qtab input.qf { width: 120px; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.qtab td { vertical-align: middle; }
.decstat { flex: none; display: flex; align-items: center; gap: 8px; margin: 8px 0 6px; font-size: 12px; color: var(--text2); min-height: 22px; }
.decstat .grow, .sstvbar .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.led { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #2A3644; }
.led.idle { background: #166534; }
.led.on { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.linkbtn { flex: none; border: 0; background: none; color: #7DD3FC; font: inherit; font-size: 12px; cursor: pointer; padding: 2px 4px; }
.linkbtn:hover { color: #BAE6FD; text-decoration: underline; }
.decout { flex: 1; min-height: 0; overflow-y: auto; border-radius: 8px; background: var(--bg2); padding: 8px; }
.cwtext { font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: #E6EDF3; }
.ft8 { padding: 0; display: flex; flex-direction: column; overflow: hidden; font-size: 12px; }
.fthead, .ftrow { display: grid; grid-template-columns: 52px 30px 30px 38px 1fr; gap: 4px; padding: 2px 8px; }
.fthead { flex: none; color: var(--muted); border-bottom: 1px solid var(--line); padding-top: 6px; padding-bottom: 4px; }
.ftrows { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 0 6px; }
.ftrow span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ftrow span:nth-child(-n+4) { color: var(--muted); text-align: right; }
.ftrow span:first-child { text-align: left; }
.ftrow.cq .m { color: #6EE7B7; font-weight: 700; }
.ftsep { margin: 4px 8px 2px; border-top: 1px dashed var(--line2); }
.sstv { display: flex; flex-direction: column; gap: 6px; }
.sstvwrap { position: relative; flex: 1; min-height: 80px; }
.sstvwrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sstvbar { flex: none; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text2); }
.thumbs { flex: none; display: flex; gap: 4px; overflow-x: auto; }
.thumbs:empty { display: none; }
.thumbs img { height: 34px; border-radius: 3px; border: 1px solid var(--line2); cursor: pointer; }
.thumbs img.sel { border-color: var(--accent); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick button { flex: 1 0 auto; min-width: 52px; height: 26px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line2); background: #161E28; color: var(--text2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.quick button:hover { border-color: var(--accent); color: var(--text); }
.adminlink { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* Einstellungen als Seitenleiste über Zuhörer und Chat */
.drawer { position: absolute; inset: 0; z-index: 6; background: var(--card); border: 1px solid var(--accent); border-radius: 12px; padding: 10px 12px 12px; overflow-y: auto; box-shadow: -8px 0 30px rgba(0,0,0,0.4); }
.settings { display: flex; flex-direction: column; gap: 14px; }
.set { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.set-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 26px; }
.set-head b { color: var(--text2); font-weight: 500; }
.pair { display: flex; flex-direction: column; gap: 8px; }
.pill { height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line2); background: #161E28; color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.pill[aria-pressed="true"] { border-color: var(--ok); background: var(--ok-bg); color: #6EE7B7; }
select { height: 34px; border-radius: 8px; border: 1px solid var(--line2); background: #161E28; color: var(--text); font: inherit; padding: 0 8px; }
.checks { gap: 8px; color: var(--text2); font-size: 13px; }
.checks label { display: flex; align-items: center; gap: 8px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }

.btn { height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent-bg); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn.primary { width: 100%; height: 48px; border: 0; background: var(--accent); color: #06121E; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn.primary svg { width: 20px; height: 20px; fill: none; stroke: #06121E; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.tip { position: fixed; z-index: 20; pointer-events: none; padding: 4px 8px; border-radius: 6px; background: rgba(11,15,20,0.92); border: 1px solid var(--line2); font-size: 12px; color: var(--text); white-space: nowrap; }

/* ---------- Info-Fenster ---------- */
.modal { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(5,9,14,0.7); }
.modal-box { width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; padding: 18px 20px; border-radius: 14px; background: var(--card); border: 1px solid #263241; box-shadow: 0 24px 60px rgba(0,0,0,0.55); }
.modal-box h3 { margin: 14px 0 6px; font-size: 14px; }
.modal-box ul, .modal-box p { margin: 0 0 8px; font-size: 13px; line-height: 1.55; color: var(--text2); }
.modal-box ul { padding-left: 18px; }

/* ---------- Eingangsdialog ---------- */
.gate { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(5,9,14,0.82); backdrop-filter: blur(6px); }
.gate-box { width: 100%; max-width: 460px; padding: 28px; border-radius: 16px; background: var(--card); border: 1px solid #263241; box-shadow: 0 24px 60px rgba(0,0,0,0.55); }
.gate-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.gate .brand-title { font-size: 17px; white-space: normal; }
.gate h1 { margin: 0 0 8px; font-size: 24px; letter-spacing: -0.01em; }
.gate-intro { margin: 0 0 20px; font-size: 14px; line-height: 1.55; color: #A9B4BF; }
.gate label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.gate input#gateName { width: 100%; height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--accent); background: var(--bg2); color: var(--text); font: inherit; font-size: 16px; }
.gate input#gateName:focus { outline: 3px solid rgba(56,189,248,0.25); }
.gate-hint { margin-top: 6px; font-size: 12px; color: var(--muted); }
.gate-hint.err { color: var(--bad); }
.gate-check { display: flex !important; align-items: center; gap: 8px; margin: 16px 0 22px !important; font-weight: 400 !important; font-size: 14px !important; color: var(--text2); }
.gate-note { margin: 12px 0 0; text-align: center; font-size: 12px; color: #6B7785; }

/* ---------- Kleine Bildschirme: untereinander, Scrollen erlaubt ---------- */
@media (max-width: 960px), (max-height: 620px) {
  .app { height: auto; overflow: visible; }
  .layout { flex-direction: column; padding: 10px; }
  .col-side { flex: none; overflow: visible; padding-right: 0; margin-right: 0; }
  .grow3 { flex: none; height: 420px; }
  .grow2 { flex: none; height: 260px; }
  .users { max-height: none; }
  .userlist { max-height: 220px; }
  .chat { flex: none; height: 380px; }
  .tune { order: -1; }
  .drawer { position: fixed; inset: auto 0 0 0; max-height: 75vh; border-radius: 16px 16px 0 0; z-index: 30; }
  .tools { margin-left: 0; }
}
@media (max-width: 560px) {
  .topbar { padding: 8px 10px; }
  .freq { font-size: 22px; }
  .meters { min-width: 0; flex-basis: 100%; max-width: none; }
  .grow3 { height: 360px; }
}

/* Sync-Knopf mit Details */
.syncwrap { position: relative; }
.syncbtn { border: 0; font: inherit; font-size: 12px; cursor: pointer; }
.syncbtn.warn { background: #2A2410; color: #FDE68A; }
.syncbtn.warn .dot { background: #FACC15; }
.syncpop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 250px; padding: 10px 12px; border-radius: 10px; background: var(--card); border: 1px solid #263241; box-shadow: 0 16px 40px rgba(0,0,0,0.5); font-size: 12px; color: var(--text2); }
.syncpop h3 { margin: 0 0 6px; font-size: 13px; color: var(--text); }
.syncpop dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; }
.syncpop dt { color: var(--muted); }
.syncpop dd { margin: 0; text-align: right; font-family: 'JetBrains Mono', ui-monospace, monospace; color: var(--text); }
/* Nutzerliste: Modus und Online-Zeit */
.userlist .meta, #userList .meta { flex: none; color: var(--muted); font-size: 11px; margin-left: 4px; white-space: nowrap; }
.modal-box.small { max-width: 380px; }
.modal-actions { display: flex; justify-content: flex-end; margin-top: 12px; }

/* PSK-Bake: Laufzeile im Wasserfall und Fenster mit den letzten Meldungen */
.grow3 { position: relative; }
.bcnticker { position: absolute; top: 9px; left: 0; z-index: 3; display: flex; align-items: center; gap: 8px; text-align: left; padding: 3px 12px; border-radius: 999px; border: 1px solid rgba(250,204,21,0.35); background: rgba(11,15,20,0.78); color: #E6EDF3; font: 12px 'JetBrains Mono', ui-monospace, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.bcnticker b { flex: none; color: #FACC15; font-weight: 700; }
.bcnview { position: relative; flex: 1; min-width: 0; height: 16px; overflow: hidden; }
.bcnrun { position: absolute; left: 0; top: 0; line-height: 16px; white-space: nowrap; will-change: transform; }
.modal-box.wide { max-width: 640px; }
.bcnframe { margin: 10px 0 0; }
.bcnframe .tm { font-size: 12px; color: var(--muted); }
.bcnframe pre { margin: 4px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--bg2); color: #E6EDF3; font: 12px/1.45 'JetBrains Mono', ui-monospace, monospace; white-space: pre-wrap; overflow-x: auto; }
.bcnstem { position: absolute; z-index: 4; width: 2px; margin-left: -1px; background: #FACC15; pointer-events: none; }
.decscope { flex: none; width: 100%; height: 44px; margin: 0 0 6px; border-radius: 6px; background: var(--bg2); cursor: crosshair; }
.hellbox { padding: 4px; overflow: hidden; }
.hellbox canvas { width: 100%; height: 100%; image-rendering: pixelated; background: #000; border-radius: 4px; }
.sbsel { flex: 2 1 0; height: 30px; }
.sbsel button { flex: 1; }
/* Verwaltung (Heimnetz) */
.admset h3 { margin: 0 0 6px; font-size: 13px; color: var(--text); }
.admset .admrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; font-size: 12px; color: var(--text2); }
.admset .admrow label { flex: 1 0 100%; }
.admset input[type=number] { width: 80px; height: 30px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text); padding: 0 8px; font: inherit; }
.admbtn { flex: none; border: 1px solid var(--line2); background: #161E28; color: var(--text2); border-radius: 6px; font: inherit; font-size: 11px; padding: 2px 6px; margin-left: 4px; cursor: pointer; }
.admbtn:hover { border-color: #F87171; color: #FCA5A5; }
.msg .admbtn { padding: 0 5px; margin-left: 6px; }
/* Sitzungsprotokoll */
.modal-box.xwide { max-width: 1000px; }
.sesstools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.btn.danger { border-color: #F87171; background: #2A1414; color: #FCA5A5; }
.sesswrap { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin: 6px 0 12px; }
.sesstab { width: 100%; border-collapse: collapse; font-size: 12px; }
.sesstab th { position: sticky; top: 0; background: var(--card); color: var(--muted); font-weight: 600; text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sesstab td { padding: 4px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--text2); }
.sesstab td.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.sesstab tr.on td { color: #6EE7B7; }
.sesstab tr:hover td { background: rgba(56,189,248,0.06); }
.sesstab tr.grp td:first-child { cursor: pointer; color: var(--text); font-weight: 600; }
.sesstab tr.grp td:first-child::before { content: '▸ '; color: var(--muted); }
.sesstab tr.grp.open td:first-child::before { content: '▾ '; }
.sesstab tr.grp.on td:first-child { color: #6EE7B7; }
.sesstab tr.sub td { color: var(--muted); background: rgba(255,255,255,0.02); }
.sesstab tr.sub td:first-child { padding-left: 28px; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.bansel { height: 22px; border-radius: 6px; border: 1px solid var(--line2); background: #161E28; color: var(--text2); font: inherit; font-size: 11px; padding: 0 4px; margin-left: 4px; cursor: pointer; }
.bansel:hover { border-color: #F87171; color: #FCA5A5; }
.banned { color: #F87171; font-weight: 600; font-size: 11px; white-space: nowrap; }
.banned .linkbtn { font-size: 11px; color: #FCA5A5; }
.gate-about { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.5; color: var(--muted); }

/* DM2NT: Kontrollaufgabe, Direktnachrichten, Grenzwerte */
.chkimg { display: block; width: 100%; max-width: 448px; height: auto; margin: 10px auto 12px; border-radius: 8px; background: #E9EEF3; image-rendering: pixelated; }
.chkbtns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chkbtns .btn { font-size: 18px; font-weight: 700; height: 44px; justify-content: center; }
.chkleft { text-align: center; margin-top: 10px !important; font-size: 12px !important; color: var(--muted) !important; }
.pmlog { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin: 8px 0 10px; }
.pmmsg { padding: 7px 10px; border-radius: 10px; font-size: 13px; line-height: 1.45; background: #1A2430; max-width: 85%; word-wrap: break-word; }
.pmmsg.mine { align-self: flex-end; background: var(--accent-bg); }
.pmmsg .pmt { display: block; font-size: 10px; color: var(--muted); margin-bottom: 2px; }
.pmform { display: flex; gap: 8px; align-items: center; }
.pmform .btn { flex: none; width: auto; height: 36px; padding: 0 16px; }
.pmform input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line2); background: #0F151C; color: var(--text); font: inherit; font-size: 14px; }
.userlist .pmbtn { margin-left: 6px; border: 1px solid var(--line2); background: #161E28; color: var(--text2); border-radius: 6px; font-size: 12px; padding: 1px 6px; cursor: pointer; }
.pmnote { position: fixed; right: 16px; bottom: 16px; z-index: 39; padding: 10px 14px; border-radius: 10px; background: var(--accent-bg); color: var(--text); border: 1px solid var(--accent); font-size: 13px; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.admgrid { display: grid; grid-template-columns: 1fr 80px; gap: 6px 10px; align-items: center; margin: 10px 0 6px; font-size: 12px; color: var(--text2); }
.admgrid input { height: 30px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line2); background: #0F151C; color: var(--text); font: inherit; }
.admrow.end { justify-content: flex-end; }

/* DM2NT: Nachrichten an den Sysop */
.mailbtn { position: relative; }
.mailbtn svg { width: 18px; height: 18px; fill: none; stroke: var(--text2); stroke-width: 1.7; stroke-linejoin: round; }
.mailbtn.new { border-color: var(--accent); background: var(--accent-bg); }
.mailbtn.new svg { stroke: var(--accent); }
.mailbadge { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #E5484D; color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center; }
.mailform { display: flex; flex-direction: column; gap: 6px; }
.mailform label { font-size: 12px; color: var(--text2); margin-top: 4px; }
.mailform textarea, .mailform input { width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line2); background: #0F151C; color: var(--text); font: inherit; font-size: 14px; resize: vertical; }
.mailcount { align-self: flex-end; font-size: 11px; color: var(--muted); }
.mailnote { font-size: 11px !important; color: var(--muted) !important; margin: 4px 0 0 !important; }
.mailmsg { font-size: 13px !important; min-height: 1.2em; margin: 2px 0 0 !important; color: var(--accent) !important; }
.mailmsg.err { color: #E5484D !important; }
.inbox { display: flex; flex-direction: column; gap: 10px; max-height: 70vh; overflow-y: auto; margin-top: 10px; }
.inbox .empty { color: var(--muted); font-size: 13px; }
.mailitem { border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; background: #131A23; }
.mailitem.unread { border-color: var(--accent); }
.mailitem .mh { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); align-items: center; }
.mailitem .mh b { color: var(--text); font-size: 13px; }
.mailitem .mc { font-size: 12px; color: var(--text2); margin-top: 4px; }
.mailitem .mt { margin-top: 8px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; color: var(--text); }
.mailitem .ma { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.mailitem .ma .btn { height: 28px; font-size: 12px; padding: 0 10px; }

/* DM2NT: UTC-Uhr und Aufnahme */
.utc { margin-left: 14px; padding: 3px 8px; border: 1px solid var(--line2); border-radius: 6px; font-family: var(--mono, ui-monospace, monospace); font-size: 13px; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.utc span { color: var(--muted); font-size: 10px; margin-left: 2px; }
@media (max-width: 1420px) { .utc { display: none; } }
.recbtn { width: auto; min-width: 32px; padding: 0 6px; gap: 4px; }
.recbtn svg { width: 14px; height: 14px; fill: #8A3A3D; stroke: none; }
.recbtn:disabled { opacity: .35; cursor: default; }
.recbtn.on svg { fill: #E5484D; animation: recblink 1s steps(2) infinite; }
.recbtn .rectime { font-size: 12px; font-variant-numeric: tabular-nums; color: #E5484D; }
.recbtn .rectime:empty { display: none; }
@keyframes recblink { 50% { opacity: .35; } }

/* DM2NT: SNR- und Tonanzeige im LCD-Stil */
.meters.lcd { gap: 4px; max-width: 460px; }
.lcd .mrow { display: flex; align-items: center; gap: 10px; }
.lcd .mnum { width: 96px; flex: none; white-space: nowrap; display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.lcd .mlabel { width: auto; font-size: 10px; letter-spacing: .05em; }
.lcd .mbig { font-size: 17px; font-weight: 600; color: var(--text); }
.lcd .msmall { font-size: 11px; color: var(--text2); }
.lcd .mcol { flex: 1; min-width: 0; }
.lcd .mbar { position: relative; gap: 2px; }
.lcd .mbar.big { height: 13px; }
.lcd .mbar.thin { height: 6px; }
.lcd .mbar span { background: #141D27; }
.lcd .mbar span.z1.on { background: #2FBF8F; }
.lcd .mbar span.z2.on { background: #F2C14E; }
.lcd .mbar span.z4.on { background: #E5484D; }
.lcd .mbar span.pk { background: #2FBF8F; box-shadow: 0 0 6px rgba(47,191,143,0.9); }
.lcd .mbar span.pk.z2 { background: #F2C14E; box-shadow: 0 0 6px rgba(242,193,78,0.9); }
.lcd .mbar span.pk.z4 { background: #E5484D; box-shadow: 0 0 6px rgba(229,72,77,0.9); }
.lcd .mscale { display: flex; justify-content: space-between; font-size: 9px; color: var(--muted); margin-top: 1px; line-height: 1; }
.lcd .bcnmark { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: #F87171; border-radius: 1px; pointer-events: none; }
/* groessere Uhr und Aufnahme */
.utc { height: 34px; box-sizing: border-box; display: inline-flex; align-items: center; padding: 0 10px; font-size: 17px; font-weight: 600; border-radius: 8px; background: #161E28; }
.utc span { font-size: 11px; font-weight: 600; margin-left: 5px; }
.recbtn { width: 34px; height: 34px; border: 1px solid var(--line2); background: #161E28; border-radius: 8px; padding: 0; min-width: 34px; }
.recbtn.on { width: auto; padding: 0 8px; border-color: #E5484D; }
.recbtn svg { width: 20px; height: 20px; }
.recbtn .rectime { font-size: 13px; }
@media (max-width: 1420px) { .utc { display: none; } }
