/* Akkord-Tastatur auf dem iPad. Oben wie die Anzeige am Fire, unten die Bildschirmtastatur. */
html, body { margin: 0; padding: 0; height: 100%; background: #fffdf7; color: #1a1a1a;
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; overflow: hidden;
  overscroll-behavior: none; touch-action: manipulation;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
input, select { -webkit-user-select: auto; user-select: auto; }
button { font: inherit; color: inherit; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }

/* Leiste */
#bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 10px; background: #ece8dc;
  font-size: 17px; min-height: 40px; }
.chip { white-space: nowrap; padding: 4px 9px; border-radius: 6px; background: #fff; color: #999; border: 2px solid #ddd; }
.chip.on { background: #1d5fbf; color: #fff; border-color: #1d5fbf; }
#c-l3.on { background: #cc1a1a; border-color: #cc1a1a; }
#pre { margin-left: auto; min-width: 80px; text-align: center; font-size: 28px; font-weight: bold; color: #1d5fbf; }
#stat { margin-left: 10px; font-size: 15px; color: #555; white-space: nowrap; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 6px; background: #c33; margin-right: 4px; vertical-align: -1px; }
.dot.ok { background: #2a2; }
.dot.aus { background: #bbb; }
.hbtn, #h-th { font-size: 16px; height: 36px; padding: 0 10px; border-radius: 6px; border: 2px solid #bbb; background: #fff; color: #444; }
#h-th { max-width: 240px; }
#gear { font-size: 26px; color: #555; border: 0; background: none; padding: 0 6px; }

/* Text */
#text { flex: 1; min-height: 3em; position: relative; overflow-y: auto; padding: 10px 20px; font-size: 40px; line-height: 1.35;
  white-space: pre-wrap; overflow-wrap: break-word; border: 4px solid transparent; }
.err { border-bottom: 3px solid #e33; }
.ghost { color: #a8a8a8; }
#cur { display: inline-block; width: 3px; height: 1.1em; margin: 0 -1px 0 -2px; vertical-align: text-bottom; background: #e07000;
  animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Vorschläge */
#sug { display: flex; padding: 6px; background: #ece8dc; }
#sug button { flex: 1; min-width: 0; margin: 0 4px; padding: 0 4px; height: 64px; font-size: 30px; border-radius: 10px;
  border: 3px solid #bbb; background: #fff; overflow: hidden; white-space: nowrap; }
#sug button.sel { border-color: #1d5fbf; background: #e6efff; }
#sug button.auto { background: #dff3df; font-weight: bold; }
#sug button.empty { visibility: hidden; }
#sug.stale button { opacity: .5; }
#sug button span { display: inline-block; line-height: 1.1; }

/* Bildschirmtastatur */
#tasten { --kh: 80px; height: 46vh; padding: 6px; box-sizing: border-box; background: #f2f2f2; touch-action: none;
  border-top: 2px solid #ddd; }
@media (orientation: portrait) { #tasten { height: 38vh; } }
.matrix { display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(4, 1fr); gap: 6px; }
.qwertz { display: flex; flex-direction: column; gap: 6px; }
.reihe { flex: 1; display: flex; gap: 6px; min-height: 0; }
.reihe .taste { flex-shrink: 1; min-width: 0; }
#tasten.blk { outline: 5px solid #c33; outline-offset: -5px; }

.taste { position: relative; display: flex; align-items: center; justify-content: center; border-radius: 10px;
  font-size: calc(var(--kh) * .5); font-weight: 600; line-height: 1; box-sizing: border-box; overflow: hidden;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18); touch-action: none; cursor: default; }
.taste.zeichen, .taste.ebene2, .taste.ebene3 { background: #d9d9d9; color: #1a1a1a; }
.taste.funktion { background: #222; color: #ececec; font-size: calc(var(--kh) * .38); }
.taste.leer { background: #d9d9d9; }
.taste.ebene2 { border: 4px solid #1d5fbf; color: #1d5fbf; }
.taste.ebene3 { border: 4px solid #cc1a1a; color: #cc1a1a; }
.taste.ebene2.an { background: #1d5fbf; color: #fff; }
.taste.ebene3.an { background: #cc1a1a; color: #fff; }
.taste.funktion.an { background: #1d5fbf; color: #fff; }
.taste.funktion.fest { box-shadow: inset 0 -4px 0 #ffd400; }
.taste.e2 .gross { color: #1d5fbf; }
.taste.e3 .gross { color: #cc1a1a; }
.taste .gross small { font-size: .45em; }
.taste .ecke { position: absolute; font-size: calc(var(--kh) * .22); font-weight: 700; display: none; }
.taste.ecken .ecke { display: block; }
.taste .l2 { top: 6%; right: 9%; color: #1d5fbf; }
.taste .l3 { bottom: 7%; right: 9%; color: #cc1a1a; }
.taste .n { bottom: 7%; left: 9%; color: #1a1a1a; }
.ikon { width: 1.3em; height: 1.3em; }
.taste.beruehrt, .taste.gedrueckt { transform: translateY(2px); filter: brightness(.82); box-shadow: none; }
.taste.vorschau { outline: 5px solid #e07000; outline-offset: -5px; }
.qwertz .taste { font-size: calc(var(--kh) * .45); font-weight: 500; }
.qwertz .taste.funktion { font-size: calc(var(--kh) * .36); }

/* Meldung */
#msg { position: absolute; left: 50%; top: 60px; transform: translateX(-50%); background: #333; color: #fff;
  padding: 10px 18px; border-radius: 8px; font-size: 22px; display: none; pointer-events: none; z-index: 5; }

/* Zahnrad-Menü */
#cfg { position: fixed; inset: 0; background: #fff; overflow-y: auto; padding: 10px 18px calc(30px + env(safe-area-inset-bottom));
  font-size: 19px; -webkit-overflow-scrolling: touch; touch-action: pan-y; z-index: 10; }
#cfg[hidden] { display: none; }
#cfg h2 { font-size: 22px; margin: 18px 0 6px; border-bottom: 2px solid #ece8dc; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid #f0f0f0; }
.row label { flex: 1; min-width: 240px; }
.row small, #cfg p small { display: block; color: #777; font-size: 14px; }
.row .val { min-width: 80px; text-align: center; font-weight: bold; }
.row button, .btn { font-size: 19px; min-width: 52px; height: 46px; border-radius: 8px; border: 2px solid #bbb; background: #f7f7f7; }
.btn { padding: 0 14px; margin: 2px 4px 2px 0; }
.btn.on { background: #1d5fbf; color: #fff; border-color: #1d5fbf; }
.btn.warn { border-color: #c33; color: #c33; }
.btn.datei { display: inline-flex; align-items: center; box-sizing: border-box; }
.neu input { font-size: 19px; height: 42px; padding: 0 8px; border: 2px solid #bbb; border-radius: 8px; min-width: 0; }
.row.neu input { flex: 1; }
#th-neu { width: 60%; }
.quelle .zustand { font-size: 15px; color: #555; min-width: 140px; }
.quelle input[type=password] { font-size: 19px; height: 42px; width: 160px; padding: 0 8px; border: 2px solid #bbb; border-radius: 8px; }
#files, #version { font-size: 16px; color: #444; }

#laden { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #fffdf7;
  font-size: 28px; color: #777; z-index: 20; }
#laden[hidden] { display: none; }
