/* 914 Log-Analyse – Copyright © R. Kleinjung */
:root {
  --bg: #15181c;
  --bg2: #1d2126;
  --panel: #23282f;
  --panel2: #2b313a;
  --line: #3a414c;
  --text: #dfe3e8;
  --muted: #8f99a6;
  --accent: #ffb000;
  --accent2: #ffcc4d;
  --lcd: #45f07a;
  --lcd-bg: #08130c;
  --ok: #3fb950;
  --info: #58a6ff;
  --warn: #f2a33a;
  --alarm: #f0524f;
  --mono: "Consolas", "Lucida Console", "DejaVu Sans Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Arial, sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 16px; }
a { color: var(--accent2); }
h1 { font-size: 20px; margin: 0 0 8px; font-weight: 600; }
h2 { font-size: 13px; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 600; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
[hidden] { display: none !important; }

/* ---------- Kopf */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 8px 16px; background: linear-gradient(#262b33, #1b1f25); border-bottom: 1px solid #000; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { font-family: var(--mono); font-weight: 700; color: #111; background: var(--accent); padding: 2px 8px; border-radius: 3px; font-size: 16px; }
.brand-text { font-weight: 600; display: flex; flex-direction: column; line-height: 1.15; }
.brand-text small { font-weight: 400; color: var(--muted); font-size: 11px; }
.copyright { color: var(--muted); font-size: 20.4px; text-align: center; }   /* 12px + 70 % */
.copyright a { color: var(--muted); text-decoration: none; }
.copyright a:hover { color: var(--accent2); text-decoration: underline; }
.topright { justify-self: end; display: flex; align-items: center; gap: 8px; }
.helpbtn { padding: 3px 10px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-weight: 600; font-size: 12px; text-decoration: none; }
.helpbtn:hover { background: var(--accent); color: #111; border-color: var(--accent); }
.langsw { display: flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.langsw a { padding: 3px 10px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 12px; }
.langsw a.on { background: var(--accent); color: #111; }

.menubar { display: flex; gap: 2px; padding: 0 16px; background: var(--bg2); border-bottom: 2px solid var(--accent); overflow-x: auto; }
.menubar a { padding: 8px 16px; color: var(--text); text-decoration: none; font-weight: 600; letter-spacing: .06em; font-size: 13px; white-space: nowrap; border-radius: 4px 4px 0 0; }
.menubar a:hover { background: var(--panel2); }
.menubar a.active { background: var(--accent); color: #111; }
.menubar a.disabled { color: #59616c; pointer-events: none; }

.statusbar { display: flex; justify-content: space-between; padding: 6px 16px; font-size: 12px; color: var(--muted); background: var(--bg2); border-top: 1px solid var(--line); }

/* ---------- Bausteine */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; margin-bottom: 14px; }
.panel.narrow { max-width: 760px; margin-left: auto; margin-right: auto; }
.cols { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; }
.cols > .panel { margin-bottom: 14px; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.actions.left { justify-content: flex-start; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--panel2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #111; }
.btn.primary:hover { background: var(--accent2); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.tiny { padding: 2px 8px; font-size: 11px; }

.msg { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.msg-err { background: #3a1d1f; border: 1px solid var(--alarm); }

.tag { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.tag.ok { background: #1b3a24; color: var(--ok); }
.tag.info { background: #1a2c44; color: var(--info); }
.tag.warn { background: #3d2c12; color: var(--warn); }
.tag.alarm { background: #43191a; color: var(--alarm); }

.tablewrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.grid th.num { text-align: right; }
table.grid td { padding: 6px 8px; border-bottom: 1px solid #2f353e; }
table.grid tr.dim td { color: var(--muted); }
.num { text-align: right; }
td.unit { color: var(--muted); width: 1%; white-space: nowrap; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; vertical-align: -1px; }
.barcol { width: 34%; }
.bar { display: inline-block; width: calc(100% - 60px); height: 8px; background: #161a1f; border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 8px; }
.bar i { display: block; height: 100%; background: var(--accent); }

/* ---------- Upload */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 16px; border: 2px dashed var(--line);
  border-radius: 8px; cursor: pointer; text-align: center; background: var(--bg2); margin-top: 12px; }
.dropzone.over, .dropzone:hover { border-color: var(--accent); }
.dropzone input { display: none; }
.dz-icon { font-size: 32px; color: var(--accent); }
.dz-count { color: var(--accent2); font-weight: 600; }
.filelist { list-style: none; padding: 0; margin: 10px 0 0; max-height: 240px; overflow: auto; }
.filelist li { display: flex; justify-content: space-between; padding: 3px 6px; border-bottom: 1px solid #2f353e; font-size: 13px; }
.filelist li.err { color: var(--alarm); font-weight: 600; }
ul.rules { list-style: none; padding: 0; margin: 0; }
ul.rules li { padding: 4px 0; }

/* ---------- Ergebnis */
.flightsel { margin-bottom: 12px; }
.flightsel select { margin-left: 8px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); padding: 5px 8px; border-radius: 4px; font: inherit; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; }
.card span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.card b { font-size: 18px; font-weight: 600; margin-top: 2px; }
.card small { font-size: 12px; color: var(--muted); font-weight: 400; }
ul.findings { list-style: none; padding: 0; margin: 0; }
ul.findings li { display: grid; grid-template-columns: auto auto 1fr auto; gap: 10px; align-items: center; padding: 7px 4px; border-bottom: 1px solid #2f353e; }
ul.findings .when { color: var(--muted); font-size: 12px; }
.fbtns { display: flex; gap: 4px; }
.okline { color: var(--ok); font-weight: 600; }
.filesline { word-break: break-all; color: var(--muted); }

/* ---------- Instrumente */
.instr-panel { background: radial-gradient(ellipse at top, #22272e, #111418 70%); border: 1px solid #000; border-radius: 10px; padding: 14px;
  box-shadow: inset 0 0 0 1px #2c323b, 0 4px 16px rgba(0,0,0,.4); }
.instr-head { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; margin-bottom: 10px; }
.lcd { background: var(--lcd-bg); border: 1px solid #000; box-shadow: inset 0 0 6px #000; border-radius: 4px; padding: 4px 12px;
  font-family: var(--mono); color: var(--lcd); font-size: 22px; display: flex; flex-direction: column; min-width: 130px; }
.lcd .lbl { font-size: 10px; color: #2a8a47; text-transform: uppercase; letter-spacing: .1em; }
.lamp { font-family: var(--mono); font-weight: 700; font-size: 12px; padding: 8px 12px; border-radius: 4px; border: 1px solid #000; background: #2a2a2a; color: #555; letter-spacing: .08em; }
.lamp.on.boost { background: #1f4fa8; color: #fff; box-shadow: 0 0 12px #3b7bff; }
.lamp.on.warn { background: #d98a10; color: #111; box-shadow: 0 0 12px #ffae2b; }
.lamp.on.alarm { background: #c62828; color: #fff; box-shadow: 0 0 14px #ff4a4a; }
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.gauges canvas { width: 100%; aspect-ratio: 1 / 1; display: block; }
.readouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; margin-top: 10px; }
.readout { background: var(--lcd-bg); border: 1px solid #000; border-radius: 4px; padding: 4px 10px; font-family: var(--mono); }
.readout .lbl { font-size: 10px; color: #2a8a47; text-transform: uppercase; letter-spacing: .06em; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout .val { color: var(--lcd); font-size: 20px; }
.readout .unit { color: #2a8a47; font-size: 12px; margin-left: 4px; }
.lcd-msg { margin-top: 10px; font-family: var(--mono); color: var(--warn); background: var(--lcd-bg); border: 1px solid #000; border-radius: 4px; padding: 6px 10px; min-height: 32px; }
.player { display: flex; gap: 8px; align-items: center; margin: 12px 0 8px; flex-wrap: wrap; }
.player #pl-play { min-width: 90px; justify-content: center; }
.speed select { margin-left: 6px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); padding: 6px; border-radius: 4px; font: inherit; }
.trend { width: 100%; height: 90px; display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }

/* ---------- Graphen */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.toolbar .range { margin-left: auto; color: var(--muted); font-size: 12px; }
.chk { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.navigator { width: 100%; height: 56px; display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; cursor: grab; margin-bottom: 8px; }
.charts { display: flex; flex-direction: column; gap: 6px; }
.chartbox { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; position: relative; }
.chartbox canvas { width: 100%; height: 170px; display: block; cursor: crosshair; touch-action: none; }
.chartbox.tall canvas { height: 220px; }
.card b.smallb { font-size: 15px; white-space: normal; line-height: 1.25; }
.panel table.grid + h2 { margin-top: 18px; }
@media (max-width: 520px) { .gauges { grid-template-columns: 1fr 1fr; } .topbar { grid-template-columns: 1fr auto; } .copyright { display: none; } }

/* ---------- Ergänzungen: Lampenzeile, Höhenprofil, Speicher, Beispiel */
.instr-head { flex-wrap: nowrap; }
.lampbox { display: flex; align-items: stretch; background: var(--lcd-bg); border: 1px solid #000; box-shadow: inset 0 0 6px #000; border-radius: 4px; min-width: 0; }
.lampbox .lamp { display: flex; align-items: center; border-radius: 3px 0 0 3px; flex: 0 0 auto; }
.lampbox.grow { flex: 1 1 0; }
.lamptext { font-family: var(--mono); font-size: 12px; line-height: 1.3; color: #4b5a50; padding: 3px 10px; min-width: 0;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; align-self: center; }
.lamptext.on { color: var(--warn); }
.lb-boost .lamptext.on { color: #8fb6ff; }
.lampbox.grow:last-child .lamptext.on { color: #ff8a87; }
.lb-boost { flex: 0 1 290px; }
@media (max-width: 1000px) {
  .instr-head { flex-wrap: wrap; }
  .lampbox.grow { flex-basis: 100%; }
}
.altprof { width: 100%; height: 130px; display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; margin-top: 8px; }

details.measures { margin-top: 4px; }
details.measures summary { cursor: pointer; color: var(--accent2); font-size: 12px; font-weight: 600; }
details.measures ol { margin: 6px 0 4px; padding-left: 20px; font-size: 13px; color: var(--text); }
details.measures li { margin: 2px 0; }
details.measures .note { font-size: 12px; color: var(--warn); margin: 4px 0 0; }
ul.findings li.nobtn { grid-template-columns: auto auto 1fr; }
ul.findings li { align-items: start; }
ul.findings .tag, ul.findings .when { margin-top: 2px; }

.mempanel h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 8px; }
.mempanel .cols { margin-top: 4px; }
.cols.even { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .cols.even { grid-template-columns: 1fr; } }
table.memtab th small { display: block; font-weight: 400; text-transform: none; letter-spacing: 0; }
table.memtab td { padding: 3px 6px; font-size: 12px; }
td.hot { color: var(--alarm); font-weight: 700; background: rgba(240,82,79,.08); }

.menubar a.example { margin-left: 10px; border: 1px solid var(--accent); color: var(--accent2); border-radius: 4px; margin-top: 3px; margin-bottom: 3px; padding: 5px 14px; }
.menubar a.example:hover { background: var(--accent); color: #111; }

/* ---------- Aufzeichnungslücken */
.instr-panel { position: relative; }
.gapbanner { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); z-index: 2; pointer-events: none;
  background: rgba(21,24,28,.92); border: 1px solid #8f99a6; border-radius: 6px; padding: 10px 18px;
  font-family: var(--mono); font-size: 15px; font-weight: 700; color: #e6e9ed; letter-spacing: .04em; white-space: nowrap; }
.instr-panel.ingap .gauges, .instr-panel.ingap .readouts { opacity: .35; filter: grayscale(.6); }
.gapspanel { border-left: 3px solid #8f99a6; }
.gapsum { margin: 0 0 8px; }
th small { font-weight: 400; text-transform: none; letter-spacing: 0; }

.throttle-avoid { color: #ff6b6b; margin: 10px 0 4px; line-height: 1.4; }
.throttle-avoid b { color: #ff4d4d; }
tr.avoid td { color: #ff8a87; }
.gaptip { position: absolute; z-index: 3; pointer-events: none; background: rgba(21,24,28,.95); border: 1px solid #8f99a6;
  border-radius: 5px; padding: 6px 10px; font-size: 12px; color: #e6e9ed; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.gaptip b { display: block; color: #ffcc4d; font-size: 13px; margin-bottom: 2px; }
.gapbanner b { display: block; color: #ffcc4d; font-size: 17px; margin-bottom: 4px; text-align: center; }
.gaptip[hidden] { display: none; }

.ocrnote { color: #f59e0b; font-weight: 600; margin: 4px 0 10px; }
