/* ═══ Buchstaben-Raster (Sprachen) – aufgeräumt, Liquid Glass ═══ */
.lp-shell {
  padding: 16px !important;
  border-radius: 26px !important;
  text-align: left;
}
.lp-shell::before { opacity: .7; }

/* Kopfzeile: Vorschau · Fortschritt · Sprache */
.lp-top-row {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px !important;
  margin-bottom: 12px !important;
  justify-content: stretch !important;
}
.lp-preview {
  position: static !important;
  width: 56px !important; height: 56px !important;
  border-radius: 16px !important;
  box-shadow: 0 0 0 1px rgba(168,85,247,0.16), 0 6px 20px rgba(168,85,247,0.28), inset 0 1px 0 rgba(255,255,255,0.22) !important;
}
.lp-preview-letter { font-size: 28px !important; text-shadow: 0 0 14px rgba(168,85,247,0.6) !important; }
.lp-progress-area { width: auto !important; align-items: stretch !important; text-align: left !important; gap: 7px !important; min-width: 0; }
.lp-progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lp-progress-label { font-size: 10.5px !important; }
.lp-progress-count { font-size: 12.5px !important; font-variant-numeric: tabular-nums; }
.lp-progress-fill { animation: none !important; background-size: 100% 100% !important; box-shadow: 0 0 10px rgba(168,85,247,0.5) !important; }
.lp-progress-track { height: 6px !important; border-radius: 4px !important; }

.lp-lang-btn {
  display: flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 12px 0 11px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.10);
  border-top-color: rgba(255,255,255,0.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 4px 14px rgba(0,0,0,0.25);
  color: var(--text); font-family: inherit; cursor: pointer;
  transition: background .15s, border-color .15s;
  max-width: 230px;
}
.lp-lang-btn:hover, .lp-lang-btn[aria-expanded="true"] { background: linear-gradient(160deg, rgba(168,85,247,0.28), rgba(192,132,252,0.12)); border-color: rgba(168,85,247,0.45); }
.lp-lang-btn > svg:first-child { color: #d8b4fe; flex-shrink: 0; }
.lp-lang-btn-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; text-align: left; }
.lp-lang-btn-name { font-size: 13.5px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-lang-btn-sub { font-size: 10.5px; color: var(--text-3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-chev { color: var(--text-3); flex-shrink: 0; transition: transform .2s; }
.lp-lang-btn[aria-expanded="true"] .lp-chev { transform: rotate(180deg); }

/* Sprach-Liste */
.lp-lang-pop {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: min(360px, 100%); max-height: 420px;
  display: flex; flex-direction: column;
  z-index: 40;
  border-radius: 20px;
  background: linear-gradient(170deg, rgba(52,34,92,0.96) 0%, rgba(18,13,36,0.97) 30%, rgba(12,9,26,0.98) 100%);
  border: 1px solid rgba(255,255,255,0.12);
  border-top-color: rgba(255,255,255,0.24);
  box-shadow: 0 24px 60px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.16), 0 0 0 0.5px rgba(168,85,247,0.2);
  overflow: hidden;
  animation: lpPopIn .18s cubic-bezier(.3,1.3,.6,1);
}
.lp-lang-pop[hidden] { display: none; }
@keyframes lpPopIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.lp-lang-search-wrap { display: flex; align-items: center; gap: 8px; margin: 10px; padding: 0 12px; height: 40px; border-radius: 12px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.10); color: var(--text-3); }
.lp-lang-search-wrap:focus-within { border-color: rgba(168,85,247,0.55); box-shadow: 0 0 0 3px rgba(168,85,247,0.16); }
.lp-lang-search { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--text); font: 600 13.5px inherit; font-family: inherit; }
.lp-lang-list { overflow-y: auto; padding: 0 6px 8px; scrollbar-width: thin; scrollbar-color: rgba(168,85,247,0.35) transparent; }
.lp-lang-group { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(216,180,254,0.7); padding: 10px 10px 5px; }
.lp-lang-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 11px; border: 1px solid transparent;
  background: transparent; color: var(--text); font-family: inherit; cursor: pointer; text-align: left;
}
.lp-lang-item:hover { background: rgba(255,255,255,0.06); }
.lp-lang-item.active { background: linear-gradient(150deg, rgba(168,85,247,0.30), rgba(192,132,252,0.12)); border-color: rgba(168,85,247,0.4); }
.lp-li-main { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.2; }
.lp-li-name { font-size: 13.5px; font-weight: 700; }
.lp-li-sub { font-size: 11px; color: var(--text-3); font-weight: 600; }
.lp-li-sample { font-size: 13px; color: rgba(245,245,247,0.55); white-space: nowrap; letter-spacing: .04em; }
.lp-li-pct { font-size: 10.5px; font-weight: 800; color: #6efaaa; min-width: 30px; text-align: right; }

/* Reiter + „nur fehlende“ */
.lp-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.lp-tabs { flex: 1; margin-bottom: 0 !important; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.lp-tabs::-webkit-scrollbar { display: none; }
.lp-tab { display: inline-flex !important; align-items: center; justify-content: center; gap: 5px; padding: 8px 10px !important; font-size: 12px !important; flex: 1 0 auto !important; }
.lp-tab-count { font-size: 9.5px; font-weight: 800; color: rgba(110,250,170,0.85); font-variant-numeric: tabular-nums; }
.lp-tab-count:empty { display: none; }
.lp-missing-toggle { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--text-3); cursor: pointer; white-space: nowrap; user-select: none; }
.lp-missing-toggle input { accent-color: #a855f7; width: 15px; height: 15px; margin: 0; cursor: pointer; }

.lp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -2px 0 10px; }
.lp-rtl-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 100px; font-size: 11px; font-weight: 700; color: #fcd34d; background: rgba(251,191,36,0.10); border: 1px solid rgba(251,191,36,0.30); }
.lp-note { font-size: 11.5px; color: var(--text-3); line-height: 1.5; flex: 1 1 240px; }

/* Raster: gleichmäßige Kacheln */
.lp-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 6px !important;
  max-height: 232px !important;
  padding: 4px !important;
  margin: 0 -4px !important;
}
.lp-grid-script { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); }
.lp-grid[dir="rtl"] .lp-pill { font-size: 20px !important; }
.lp-pill {
  min-width: 0 !important; width: 100%;
  height: 42px !important; padding: 0 !important;
  border-radius: 12px !important;
  font-size: 17px !important;
  line-height: 1;
}
.lp-pill:hover { transform: translateY(-1px) !important; }
.lp-pill.lp-selected { transform: none !important; }
.lp-pill.lp-saved::after { content: '' !important; width: 6px; height: 6px; border-radius: 50%; background: #34d37a; top: 5px; right: 5px; bottom: auto !important; box-shadow: 0 0 6px rgba(52,211,122,0.8); }
.lp-pill.lp-selected.lp-saved::after { background: #fff; box-shadow: none; }
.lp-pill:focus-visible { outline: 2px solid rgba(216,180,254,0.9); outline-offset: 2px; }
.lp-empty { grid-column: 1 / -1; text-align: center; padding: 22px 8px; font-size: 13px; color: var(--text-3); }

@media (max-width: 600px) {
  .lp-shell { padding: 12px !important; }
  .lp-top-row { grid-template-columns: auto minmax(0,1fr); gap: 10px !important; }
  .lp-lang-btn { grid-column: 1 / -1; max-width: none; width: 100%; height: 42px; }
  .lp-lang-btn-text { flex: 1; flex-direction: row; align-items: baseline; gap: 8px; }
  .lp-lang-pop { left: 0; right: 0; width: auto; max-height: 60vh; }
  .lp-preview { width: 48px !important; height: 48px !important; }
  .lp-toolbar { flex-wrap: wrap; }
  .lp-tabs { flex-basis: 100%; }
  .lp-missing-toggle { margin-left: auto; }
  .lp-grid { grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); max-height: 200px !important; }
  .lp-pill { height: 38px !important; font-size: 15px !important; }
}

/* Sprach-Liste liegt über den folgenden Karten (z. B. „Gespeicherte Buchstaben“) */
#lp-injected { position: relative; z-index: 60; }
.lp-shell { z-index: auto; }
