/* Palettierzelle 3D — Handy hoch und quer, Kompaktmodus der Signaturseite, Vorschlag (Signature App Echelmeyer, 14.11.2026).
   Vorbilder: smart-factory-auftrag (09f5b72e6), perspektiv-labor (50c5c700a), sonnenuhr (Kompaktmodus max-height 480px).
   Grundsätze: erste Handlung unter dem Daumen und leuchtet, Navbar beschriftet, Sheets ≤ 55 %, Touch-Ziele ≥ 44 px, Schrift ≥ 12 px. */

#hud, #daumen { display: none; }
body.buehne-film #hud, body.buehne-film #daumen { display: none !important; }

/* ── Vorschlag: der nächste sinnvolle Schritt (Desktop im Leistungs-Panel, Handy in der Daumenleiste) ── */
.vs { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 9px 12px; border: 0; border-radius: 12px;
  background: var(--pal-accent, #3b6fd8); color: #fff; font: inherit; text-align: left; cursor: pointer;
  animation: vsPuls 1.8s ease-in-out infinite; transition: filter .15s, transform .15s; }
.vs:hover { filter: brightness(1.12); }
.vs:active { transform: scale(.98); }
.vs svg { flex: none; width: 20px; height: 20px; color: #ffd75e; }
.vs-t { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.vs-t b { font-size: 13.5px; font-weight: 750; line-height: 1.2; }
.vs-t small { font-size: 12px; opacity: .88; line-height: 1.25; font-variant-numeric: tabular-nums; }
.vs[hidden] { display: none; }
@keyframes vsPuls { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 215, 94, 0); filter: brightness(1); } 50% { box-shadow: 0 0 0 5px rgba(255, 215, 94, .28); filter: brightness(1.14); } }
#vorschlag-panel { margin-top: 8px; }
#vorschlag-panel:empty { display: none; }

/* ── Anzeige oben (Handy): Ist gegen Soll, tippen öffnet die Leistung ── */
#hud { position: fixed; z-index: 20; left: 10px; right: 10px; top: 10px; padding: 9px 12px 10px; border: 0; border-radius: 14px;
  background: var(--vk-panel-bg); color: inherit; font: inherit; text-align: left; cursor: pointer;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); flex-direction: column; gap: 5px; }
body.theme-dark #hud { color: #e8ecf4; } body.theme-light #hud { color: #1e293b; }
.h-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.h-top b { font-family: 'SF Mono', ui-monospace, monospace; font-size: 26px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.h-top span { font-size: 12.5px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-bar { position: relative; display: block; height: 8px; border-radius: 4px; overflow: hidden; }
body.theme-dark .h-bar { background: rgba(255,255,255,.1); } body.theme-light .h-bar { background: rgba(15,23,42,.09); }
.h-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--pal-accent); transition: width .35s; }
.h-bar em { position: absolute; top: -2px; bottom: -2px; width: 2px; background: currentColor; opacity: .8; }
.h-st { font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.h-st.ok { color: var(--pal-alt-c); } .h-st.bad { color: var(--pal-alt-a); }

/* ── Daumenleiste über der Navbar ── */
#daumen { position: fixed; z-index: 20; left: 10px; right: 10px; bottom: calc(var(--nav-h, 62px) + 20px); gap: 8px; align-items: stretch; padding: 8px; border-radius: 14px;
  background: var(--vk-panel-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
#daumen .vs { flex: 1 1 auto; min-width: 0; }
.d-chip { flex: none; min-width: 52px; min-height: 48px; border: 0; border-radius: 12px; font: inherit; font-size: 14px; font-weight: 750; cursor: pointer;
  font-variant-numeric: tabular-nums; color: inherit; }
body.theme-dark .d-chip { background: rgba(255,255,255,.09); color: #e8ecf4; } body.theme-light .d-chip { background: rgba(15,23,42,.07); color: #1e293b; }
.d-chip:hover { filter: brightness(1.15); }

/* ── Touch: jedes Bedienelement mindestens 44 px ── */
@media (max-width: 768px), (max-height: 500px), (pointer: coarse) {
  .panel-x { width: 44px; height: 44px; margin: -13px -13px -13px auto; }
  .panel .seg button, #desktop-dock .dock-pill { min-height: 44px; }
  .srow input[type="range"] { height: 44px; }
  .panel label.check { min-height: 44px; display: flex; align-items: center; }
}

/* ── Handy hoch: oben die Anzeige, unten der Vorschlag in Daumenhöhe, dazwischen die Zelle ── */
@media (max-width: 768px) and (orientation: portrait), (max-width: 768px) and (min-height: 501px) {
  #hud { display: flex; }
  #daumen { display: flex; }
  body.sheet-offen #daumen { display: none; }
  body.sheet-offen #hud .h-st { display: none; }
  #mobile-navbar { left: 10px; right: 10px; bottom: 10px; padding: 5px; gap: 3px; }
  #mobile-navbar .nav-btn { flex: 1 1 auto; min-width: 44px; min-height: 52px; padding: 6px 4px; gap: 3px; }
  #mobile-navbar .nav-btn svg { width: 20px; height: 20px; }
  #mobile-navbar .nav-btn span { display: block; font-size: 12px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
  .panel { bottom: calc(var(--nav-h, 62px) + 20px) !important; max-height: 52vh; }
  .panel .hint, .panel .hint.sub, .panel .lab, .panel h3, .panel .seg button, .rate-top span, .rate-lim, .rate-st, .leg, .formula,
  .kpi > span, .kpi em, .feas, .srow b, .panel label.check { font-size: 12px; }
  .panel .seg button { padding: 6px 4px; }
}
/* Sehr niedriges Hochformat (kleine Handys mit Browserleisten): Statuszeile kompakt */
@media (max-width: 768px) and (max-height: 640px) and (orientation: portrait) {
  .h-top b { font-size: 22px; }
  #hud { padding: 7px 11px 8px; gap: 4px; }
}

/* ── Kompaktmodus: kleine Einbettung (Signaturseite am Handy ~314 × 393, Vorbild sonnenuhr) ── */
@media (max-width: 768px) and (max-height: 480px) and (orientation: portrait) {
  #mobile-navbar { display: none !important; }
  #hud { left: 8px; right: 8px; top: 8px; padding: 6px 10px 7px; gap: 4px; border-radius: 12px; }
  .h-top b { font-size: 19px; }
  .h-top span { font-size: 12px; }
  .h-st { display: none; }
  #daumen { left: 8px; right: 8px; bottom: 8px; padding: 6px; border-radius: 12px; }
  #daumen .vs { min-height: 44px; padding: 6px 10px; }
  #daumen .vs-t small { display: none; }
  #daumen .vs-t b { font-size: 13px; }
  #d-tempo { display: none; }
}

/* ── Handy quer: links Anzeige und Vorschlag übereinander, rechts die Zelle, Panels rechts, unten die Leiste ── */
@media (max-height: 500px) and (orientation: landscape) {
  #hud { display: flex; right: auto; width: 236px; top: 10px; left: 10px; padding: 8px 11px 9px; }
  .h-top b { font-size: 21px; }
  #daumen { display: flex; flex-direction: column; right: auto; width: 236px; left: 10px; top: auto; bottom: 74px; padding: 7px; }
  #daumen .vs { min-height: 48px; }
  #daumen .d-chip { min-height: 44px; }
  #desktop-dock { bottom: 10px; }
  #mobile-navbar { left: 256px; right: 10px; bottom: 8px; padding: 4px; gap: 3px; }
  #mobile-navbar .nav-btn { flex-direction: row; min-height: 44px; padding: 6px 4px; gap: 5px; }
  #mobile-navbar .nav-btn svg { width: 18px; height: 18px; }
  #mobile-navbar .nav-btn span { display: block; font-size: 12px; font-weight: 700; white-space: nowrap; }
  #daumen { bottom: 66px; }
  .panel, #panel-zelle, #panel-leistung, #panel-prozess, #panel-info { left: auto !important; right: 10px !important; top: 10px !important; bottom: auto !important;
    transform: none !important; width: min(320px, calc(100vw - 270px)) !important; max-height: calc(100vh - 82px) !important; overflow-y: auto; }
  .panel .hint, .panel .hint.sub, .panel .lab, .panel h3, .panel .seg button, .rate-top span, .rate-lim, .rate-st, .leg, .formula,
  .kpi > span, .kpi em, .feas, .srow b, .panel label.check { font-size: 12px; }
}
@media (max-height: 500px) and (orientation: landscape) and (min-width: 769px) {
  #daumen { bottom: 74px; }
  #desktop-dock { left: 256px; right: auto; transform: none; }
}

/* ── Eingriff im Expeditionsfilm am Handy (echte Größe, buehne.js html.buehne-echt): Anzeige und Vorschlag wie in der App allein ── */
@media (max-width: 768px) and (orientation: portrait), (max-width: 768px) and (min-height: 501px) {
  html.buehne-echt body.buehne-film #hud, html.buehne-echt body.buehne-film #daumen { display: flex !important; }
  html.buehne-echt body.buehne-film:not(.film-panels) #daumen { bottom: 12px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  html.buehne-echt body.buehne-film #hud, html.buehne-echt body.buehne-film #daumen { display: flex !important; }
  html.buehne-echt body.buehne-film:not(.film-panels) #daumen { bottom: 12px; }
}
