:root {
  --panel-w: 360px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  /* von der Farbpalette gesetzt (app.js) */
  --accent: #c9413b; --c-w: #d0403a; --c-m: #2f59b0; --c-nb: #e2b30c;
}
/* Dunkel-/Hellmodus der Oberfläche (unabhängig von der Farbpalette des Diagramms) */
html.dark  { --surround: #07080c; --panel: rgba(16,18,26,.72); --card: rgba(30,33,44,.62); --field: rgba(6,7,11,.78); --line: rgba(255,255,255,.1);
              --bg-grid: rgba(255,255,255,.085); --bg-diag: rgba(255,255,255,.035); --g1: #99b9ea; --g2: #f5b4be; --g3: #ffe08b; --g1o: .22; --g2o: .16; --g3o: .10; --ink: #e8eaf0; --muted: #8c91a1; color-scheme: dark; }
html.light { --surround: #f6f7fb; --panel: rgba(255,255,255,.72); --card: rgba(255,255,255,.85); --field: #ffffff; --line: rgba(30,40,80,.12);
              --bg-grid: rgba(30,40,80,.07); --bg-diag: rgba(30,40,80,.035); --g1: #99b9ea; --g2: #f5b4be; --g3: #ffe08b; --g1o: .35; --g2o: .30; --g3o: .18; --ink: #2a3352; --muted: #7c8296; color-scheme: light; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; color: var(--ink); font-family: var(--font); }
html { background: var(--surround); }
body { background: transparent; }
/* Hintergrund wie auf resources.vid-oeaw.at/lexis: feines Lexis-Raster + weiche Farbflecken */
.bgfx { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bgfx .lexis-bg { position: absolute; inset: 0;
  background-image: linear-gradient(var(--bg-grid) 1px, transparent 1px), linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px),
    repeating-linear-gradient(135deg, transparent 0 44.25px, var(--bg-diag) 44.25px 45.25px);
  background-size: 64px 64px, 64px 64px, auto;
  -webkit-mask-image: radial-gradient(85% 65% at 50% 0%, #000 15%, transparent 75%); mask-image: radial-gradient(85% 65% at 50% 0%, #000 15%, transparent 75%); }
.bgfx .glow { position: absolute; border-radius: 50%; filter: blur(100px); }
.bgfx .g1 { width: 60vmax; height: 60vmax; background: var(--g1); top: -28vmax; left: -18vmax; opacity: var(--g1o); }
.bgfx .g2 { width: 62vmax; height: 62vmax; background: var(--g3); bottom: -34vmax; right: -22vmax; opacity: var(--g2o); }
.bgfx .g3 { width: 34vmax; height: 34vmax; background: var(--g2); top: 28%; left: 48%; opacity: var(--g3o); }
#panel, #stage { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
button, input { font: inherit; color: inherit; }

#app { display: flex; gap: 14px; height: 100vh; height: 100dvh; padding: 14px; }
#stage { position: relative; flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: row; }
/* Desktop: Diagrammbereich als Karte umrandet, wie das Panel (am Handy zurückgesetzt) */
:root { --plot-bg: transparent; }
#stage { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 8px 8px 4px; }
/* Desktop: Überschrift und Karte nur so breit wie das Diagramm (--content-w setzt app.js), Gruppe mittig */
#maincol > .intro, #maincol > #stage, #maincol > .credit { width: var(--content-w, 100%); max-width: 100%; }
#plot { position: relative; flex: 1; min-height: 0; min-width: 0; }
/* Altersverteilung rechts neben dem Diagramm (Breite setzt app.js über --age-w) */
#ages { flex: none; width: var(--age-w, 0px); height: 100%; margin-left: 6px; display: block; }
/* Überschrift über dem Diagramm (außerhalb der Karte, linksbündig) – Stil wie die Lexis Birthday Card */
#maincol { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
#maincol { align-items: center; }
/* Desktop: Panel direkt neben dem Diagramm, beides zusammen mittig */
#app { justify-content: center; }
#maincol { flex: 0 1 calc(var(--content-w, 100%) + 14px); min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-gutter: stable; scrollbar-color: var(--line) transparent; }
#maincol > .intro, #maincol > #stage { flex-shrink: 0; }
.intro { flex: none; padding: 2px 4px 0; font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif; }
.intro h1 { margin: 6px 0 10px; font-size: clamp(34px, min(4.2vw, 6.6vh), 68px); line-height: .98; font-weight: 800; letter-spacing: -.04em; color: var(--ink); }
.intro h1 span { background: linear-gradient(100deg, #b3caef, #f7c7ce 50%, #ffe8a8); -webkit-background-clip: text; background-clip: text; color: transparent; }
html.light .intro h1 span { background-image: linear-gradient(100deg, #3a61ac, #c9413b 50%, #d9a400); }
.intro .cta { margin: 6px 0 0; font-size: clamp(13px, min(1vw, 1.65vh), 16px); line-height: 1.5; color: var(--ink); }
/* Link zur Lexis Birthday Card: Text im Farbverlauf der Überschrift, unterstrichen */
.cta-link { font-weight: 750; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px;
            text-decoration-color: #f7c7ce; white-space: nowrap;
            background: linear-gradient(100deg, #b3caef, #f7c7ce 50%, #ffe8a8); -webkit-background-clip: text; background-clip: text;
            -webkit-text-fill-color: transparent; color: #f7c7ce; }
.cta-link:hover, .cta-link:focus-visible { text-decoration-thickness: 3px; filter: brightness(1.15); }
html.light .cta-link { background-image: linear-gradient(100deg, #3a61ac, #c9413b 60%, #d9a400); text-decoration-color: #c9413b; color: #c9413b; }
/* Zusatzinfo unter dem Diagramm, ohne Fläche und Rahmen */
/* Desktop: belegt keinen Platz im Layout (das Diagramm bleibt so groß wie möglich), ist aber durch Scrollen erreichbar */
.credit { flex: none; height: 0; overflow: visible; margin: 0; padding: 0 4px; font-size: 12px; line-height: 1.45; color: var(--muted); text-align: left; }
.credit > :first-child { margin-top: 12px; }
.credit > :last-child { margin-bottom: 20px; }
.credit p { margin: 0 0 3px; }
.credit strong { color: var(--ink); font-weight: 750; }
.credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.credit a:hover { color: var(--ink); }
.credit .cc-badge { display: inline-block; vertical-align: middle; height: 22px; width: auto; margin-left: 6px; }
.credit .license { display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; }
.intro .lede { margin: 0; max-width: 960px; font-size: clamp(13px, min(1vw, 1.65vh), 16px); line-height: 1.55; color: var(--muted); }
#lexis, #hl-layer, #hover-layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#hover-layer { pointer-events: none; }
#stage, #lexis { -webkit-tap-highlight-color: transparent; }   /* kein blaues Aufblitzen beim Antippen am Handy */   /* Person unter der Maus: ganz im Vordergrund */
#hl-layer { pointer-events: none; animation: blink 2.4s ease-in-out infinite; }   /* pulsierende Linie der zuletzt eingetragenen Person */

#panel {
  width: var(--panel-w); flex: none; display: flex; flex-direction: column; gap: 10px;
  padding: 16px 16px 14px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
}
#app.panel-hidden #panel { display: none; }
.pcol { display: contents; }   /* Spalten-Hüllen wirken nur im Handy-Querformat */
#panel h1 { font-size: 20px; margin: 0; font-weight: 700; white-space: nowrap; }
#panel h2 { font-size: 12px; margin: 0 0 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px; }

/* Sprachauswahl */
.langs { display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 3px; }
.langs button { border: 1px solid var(--line); background: var(--card); border-radius: 7px; padding: 3px 5px; font-size: 11px; font-weight: 600; letter-spacing: .04em; cursor: pointer; color: var(--muted); }
.langs button.active { color: var(--ink); border-color: var(--ink); }

/* Legende */
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 10px; }
.legend li.sep { margin-top: 5px; }
.legend b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.sw { width: 28px; height: 12px; flex: none; position: relative; }
.sw.line::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 4px; border-radius: 2px; background: var(--c); }
.sw.chip { background: var(--cell); border-radius: 3px; }
.sw.chip::before { left: 3px; right: 3px; }
.sw.dash::before { content: ""; position: absolute; left: 0; right: 0; top: 5px; border-top: 3px dashed var(--muted); }
.sw.dot::before { content: ""; position: absolute; left: 9px; top: 1px; width: 10px; height: 10px; border-radius: 50%; background: var(--alive, #2EAD4B); }
.sw.dead::before { content: ""; position: absolute; left: 9px; top: 1px; width: 10px; height: 10px; border-radius: 50%; background: #000; }
html.dark .sw.dead::before { box-shadow: 0 0 0 1.5px var(--ink); }
.sw.blink::before { content: ""; position: absolute; left: 8px; top: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); animation: blink 2.4s ease-in-out infinite; }

/* Formular */
form { display: grid; gap: 9px; }
.input { width: 100%; min-width: 0; padding: 7px 9px; border-radius: 9px; border: 1px solid var(--line); background: var(--field); font-size: 14px; }
.input::placeholder { color: var(--muted); }
.hint { margin: -4px 0 0; font-size: 11.5px; line-height: 1.35; color: var(--muted); }
select.input:disabled { opacity: .45; }
.input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.date-group { border: 0; padding: 0; margin: 0; }
.date-group legend { font-size: 13px; margin-bottom: 5px; padding: 0; }
.date-row { display: grid; grid-template-columns: 1fr 1.35fr 0.9fr; gap: 6px; }
input[type=number].input { -moz-appearance: textfield; }
input[type=number].input::-webkit-inner-spin-button, input[type=number].input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.seg { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg legend { font-size: 13px; margin-bottom: 5px; padding: 0; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; text-align: center; padding: 7px 4px; border-radius: 9px; border: 1px solid var(--line); background: var(--field); font-size: 13px; cursor: pointer; }
.seg input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.primary { padding: 9px; border: 0; border-radius: 9px; background: var(--ink); color: var(--panel); font-weight: 600; cursor: pointer; }
.primary:disabled { opacity: .5; cursor: wait; }
.submit-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.undo-btn { width: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--field); font-size: 17px; line-height: 1; cursor: pointer; }
.undo-btn:hover:not(:disabled) { border-color: var(--ink); }
.undo-btn:disabled { opacity: .3; cursor: default; }
.msg { margin: 0; min-height: 1.2em; font-size: 13px; }
.msg.err { color: var(--accent); font-weight: 600; }

/* Paletten-Auswahl */
.palettes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
/* weitere Paletten: eingeklappt, klappen per Mini-Button weich auf */
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.card-head h2 { margin: 0 !important; }
.mini-btn { width: 24px; height: 20px; padding: 0; border-radius: 6px; border: 1px solid var(--line); background: var(--field); color: var(--muted); font-size: 12px; line-height: 1; cursor: pointer; transition: transform .25s, color .2s; }
.mini-btn:hover { color: var(--ink); }
.mini-btn[aria-expanded="true"] { transform: rotate(180deg); }
#plot { overflow: hidden; }
/* Zoomen: ungezoomt darf am Handy senkrecht gescrollt werden, gezoomt gehören alle Gesten dem Diagramm */
#lexis { touch-action: pan-y; }
.zoomed #lexis { touch-action: none; }
@media (pointer: fine) { #lexis { cursor: crosshair; } }   /* Desktop: Fenster zum Zoomen aufziehen */
#zoom-box { position: absolute; pointer-events: none; z-index: 4; border: 1.5px dashed var(--accent);
            background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 2px; }
#zoom-box[hidden] { display: none; }
.zoom-reset { position: absolute; top: 6px; right: 48px; z-index: 6; display: inline-flex; align-items: center; gap: 5px;
              padding: 5px 9px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
              font-size: 12px; font-weight: 600; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.zoom-reset[hidden] { display: none; }
.pal-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s ease; }
.pal-more > .palettes { overflow: hidden; min-height: 0; padding-top: 0; transition: padding-top .35s ease; }
.pal-more.open { grid-template-rows: 1fr; }
.pal-more.open > .palettes { padding-top: 6px; }
.pal { text-align: left; padding: 6px 7px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); cursor: pointer; display: grid; gap: 5px; }
.pal.active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pal .strip { display: flex; height: 16px; border-radius: 5px; overflow: hidden; }
.pal .strip i { flex: 1; }
.pal .strip i.end { display: grid; place-items: center; }
.pal .strip i.end b { width: 8px; height: 8px; border-radius: 50%; }
.pal .name { font-size: 11px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Fußbereich: Modus-Schalter, Logos, Status */
footer { margin-top: auto; display: grid; grid-template-columns: 1fr auto; gap: 12px 14px; padding-top: 2px; }
footer .controls { grid-column: 1; grid-row: 1; }
footer .logos { grid-column: 1; grid-row: 2; }
footer .qr { grid-column: 2; grid-row: 1 / span 2; align-self: center; line-height: 0; }
footer #status { grid-column: 1 / -1; }
#status { text-align: center; }
.controls { display: flex; align-items: center; gap: 8px; }
.controls .btns { margin-left: auto; display: flex; gap: 6px; }
.switch { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; cursor: pointer; user-select: none; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 36px; height: 20px; border-radius: 10px; background: var(--line); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); transition: transform .2s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.logos { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 2px 2px 0; }
.logos a { display: block; line-height: 0; }
.logos img { height: 38px; width: auto; display: block; }
html.dark .logos img { filter: grayscale(1) brightness(0) invert(1); }
.qr img { height: 90px; width: 90px; border-radius: 6px; display: block; }   /* 45 QR-Module × 2 px; bleibt immer schwarz auf weiß, damit er sicher scannbar ist */
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 16px; line-height: 1; }
.icon-btn.floating { position: absolute; top: 4px; right: 4px; opacity: .4; transition: opacity .2s; }
.icon-btn.floating:hover { opacity: 1; }

/* Blinkender Punkt der zuletzt hinzugefügten bzw. der mit der Maus berührten Person */
.pulse { position: absolute; width: var(--s, 18px); height: var(--s, 18px); transform: translate(-50%, -50%); pointer-events: none; }
.pulse .dot, .pulse .ring { position: absolute; border-radius: 50%; }
.pulse .dot { inset: 0; background: var(--accent); box-shadow: 0 0 0 2px var(--halo, #fff); animation: blink 2.4s ease-in-out infinite; }
.pulse .ring { inset: -55%; border: 2px solid var(--accent); opacity: .45; animation: ring 2.4s ease-in-out infinite; }

@media (max-width: 1100px) { :root { --panel-w: 290px; } .palettes { grid-template-columns: 1fr; } }
/* niedrige Bildschirme: Untertitel ausblenden, Paletten nur als Farbstreifen (Name als Tooltip) */
@media (max-height: 940px) {
  #panel header .muted { display: none; }
  .palettes { grid-template-columns: repeat(4, 1fr); }
  .pal .name { display: none; }
  .legend { gap: 2px; }
  #panel { gap: 8px; padding-top: 12px; padding-bottom: 8px; }
  form { gap: 7px; }
  footer { gap: 8px; }
  .logos img { height: 32px; }
  /* Überschrift "Geburtsdatum" ausblenden – die Felder heißen selbst Jahr / Monat / Tag */
  .date-group legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* ---------- Handy-Ansicht im Hochformat (schmale Bildschirme) ----------
   Alles untereinander und scrollbar: Titel + Sprache, Diagramm (quadratisch), Formular, Legende, Paletten, Fußbereich */
@media (max-width: 760px) and (orientation: portrait) {
  html, body { height: auto; overflow: auto; }
  #app { flex-direction: column; height: auto; min-height: 100vh; min-height: 100dvh; padding: 10px; gap: 10px; }
  #panel, #app.panel-hidden #panel { display: contents; }   /* Karten des Panels werden direkt untereinander angeordnet */
  #panel header { order: 1; padding: 6px 4px 0; }
  #panel header h1, #panel header .muted { display: none; }   /* Überschrift steht über dem Diagramm */
  .title-row { justify-content: flex-end; margin-bottom: 0; }
  #stage { order: 2; flex: none; width: 100%; flex-direction: column; background: none; border: 0; border-radius: 0; padding: 0; }
  #ages { width: 100%; height: auto; aspect-ratio: 1 / 0.7; margin: 14px 0 0; touch-action: pan-y; }   /* Altersverteilung unter dem Diagramm */
  :root { --plot-bg: transparent; }
  #plot { flex: none; width: 100%; aspect-ratio: 1 / 1; }
  #maincol { display: contents; }
  .intro { order: 2; padding: 0 4px 2px; }
  .intro h1 { font-size: clamp(32px, 9vw, 46px); line-height: 1.02; margin: 2px 0 8px; }
  .intro .lede { font-size: 15px; line-height: 1.5; }
  #card-add { order: 3; }
  #card-legend { order: 4; }
  #card-palette { order: 5; }
  .credit { order: 7; height: auto; overflow: visible; margin: 0; padding: 0 8px 16px; text-align: center; }
  .credit .license { justify-content: center; }
  #maincol { overflow: visible; }
  #panel > footer { order: 6; margin-top: 0; padding: 4px 4px 14px; gap: 12px; }
  #panel-open, #btn-fs, #btn-hide { display: none !important; }
  .input, .seg span { font-size: 16px; }   /* verhindert automatisches Hineinzoomen auf dem iPhone */
  .legend { grid-template-columns: 1fr 1fr; column-gap: 16px; row-gap: 5px; }
  .legend li.sep { margin-top: 0; }
  .palettes { grid-template-columns: repeat(4, 1fr); }
  .pal .name { display: none; }
  .logos img { height: 34px; }
  footer .qr { display: none; }   /* am Handy ist man schon auf der Seite */
  footer .controls, footer .logos { grid-column: 1 / -1; }
}

/* ---------- Handy im Querformat ----------
   Panel mit zwei echten Spalten: links Formular + Paletten, rechts Titel, Legende und Fußbereich.
   Das Diagramm nimmt den restlichen Platz – so muss nichts gescrollt werden. */
@media (orientation: landscape) and (max-height: 500px) {
  #app { padding: 8px; gap: 10px; }
  #ages { display: none; }
  #stage { flex: 1; min-width: 0; background: none; border: 0; border-radius: 0; padding: 0; }
  :root { --plot-bg: transparent; }
  .intro, .credit { display: none; }   /* Handy quer: zu wenig Höhe, Diagramm hat Vorrang */
  #maincol { gap: 0; flex: 1 1 auto; }
  #panel {
    flex: none; width: auto; padding: 8px 12px; gap: 8px 12px; border-radius: 14px;
    display: grid; grid-template-columns: 232px 196px; grid-template-rows: auto 1fr;
    overflow-y: auto;   /* nur nötig, wenn die Paletten aufgeklappt werden */
  }
  .pcol { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
  .pcol-a { grid-column: 1; grid-row: 1 / span 2; }
  .pcol-b { grid-column: 2; grid-row: 1; }
  #panel > footer { grid-column: 2; grid-row: 2; align-self: end; margin-top: 0; gap: 6px 10px; }
  #panel header .muted { display: none; }
  .title-row { flex-wrap: wrap; justify-content: flex-start; gap: 4px 8px; margin-bottom: 0; }
  #panel h1 { font-size: 18px; }
  .langs { justify-content: flex-start; }
  .card { padding: 8px 10px; }
  #panel h2 { margin-bottom: 5px; }
  .legend { font-size: 12px; gap: 1px; }
  .legend li { gap: 7px; }
  .sw { width: 22px; }
  .legend li.sep { margin-top: 2px; }
  form { gap: 6px; }
  .input { font-size: 16px; padding: 5px 7px; }   /* 16 px: kein Hineinzoomen am iPhone */
  .seg { gap: 4px; }
  .seg span { font-size: 12.5px; padding: 6px 1px; white-space: nowrap; }
  .hint { font-size: 11px; margin-top: -2px; }
  .date-row { grid-template-columns: 0.9fr 1.3fr 0.9fr; gap: 4px; }
  .date-group legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .primary { padding: 7px; }
  .msg { min-height: 0; }
  .palettes { grid-template-columns: repeat(4, 1fr); }
  .pal .name { display: none; }
  .logos { gap: 12px; }
  .logos img { height: 24px; }
  footer .qr, #btn-fs, #btn-hide, #panel-open { display: none !important; }   /* am Handy ist man schon auf der Seite */
  footer .controls, footer .logos { grid-column: 1 / -1; }
  #status { font-size: 11px; }
}
/* sehr schmale Geräte quer (z. B. iPhone SE): eine Spalte, das Panel scrollt bei Bedarf in sich */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 700px) {
  #panel { display: flex; flex-direction: column; width: 260px; overflow-y: auto; }
  .pcol { display: contents; }
  #panel > footer { align-self: stretch; }
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }
@keyframes ring { 0%, 100% { opacity: .5; transform: scale(1); } 50% { opacity: .1; transform: scale(1.25); } }
