/* On-screen keyboard (shared/onscreen-keyboard.js), used by the Editor and the side panel. */
.osk {
  margin-top: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; user-select: none;
}
.osk[hidden] { display: none; }
.osk-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.osk-title { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.osk-title .muted { font-size: 12.5px; }
.osk-langs { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.osk-langs button { border: 0; background: transparent; padding: 5px 12px; cursor: pointer; color: var(--text-2); font-size: 14px; }
.osk-langs button[aria-checked='true'] { background: var(--purple); color: #fff; }
.osk-hint { margin: 0; }
.osk-keys { display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); border-radius: 12px; padding: 8px; }
.osk-row { display: flex; gap: 6px; }
.osk-key {
  position: relative; flex: 1 1 0; min-width: 0; height: 56px; border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 9px; background: var(--surface); color: var(--text); cursor: pointer; font-weight: 600; font-size: 13px;
  padding: 14px 2px 10px; overflow: hidden;
}
.osk-key:hover { border-color: var(--purple); }
.osk-key:active { transform: translateY(1px); }
.osk-key.inert { opacity: .45; }
.osk-main { font-size: 20px; line-height: 1; font-weight: 500; white-space: nowrap; }
.osk-alt { position: absolute; top: 3px; right: 5px; font-size: 11px; color: var(--text-3); line-height: 1; white-space: nowrap; }
/* The English key to press (bottom left): large enough to read at a glance. */
.osk-us { position: absolute; bottom: 4px; left: 6px; font: 700 12.5px/1 var(--font-mono); color: var(--text-2); }
.osk-key .osk-main.lang-ta { font-size: 17px; }
/* Shift held: the shifted character becomes the big label. */
.osk.shifted .osk-key[data-base] .osk-main { display: none; }
.osk.shifted .osk-key .osk-alt { position: static; display: inline; font-size: 20px; color: var(--purple); }
.osk.shifted .osk-key .osk-alt.lang-ta { font-size: 17px; }
.osk-ctrl .osk-key { height: 40px; background: var(--purple-50); color: var(--purple); border-color: var(--purple-100); }
.osk-ctrl .osk-space { flex: 3 1 0; }
.osk-shift[aria-pressed='true'] { background: var(--purple); color: #fff; }
.osk-section { display: flex; flex-direction: column; gap: 6px; }
.osk-sec-title { font-size: 13px; }
details.osk-section > summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--purple); }
details.osk-section[open] > summary { margin-bottom: 6px; }
.osk-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.osk-pkey {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 46px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); cursor: pointer; padding: 4px;
}
.osk-pkey:hover { border-color: var(--purple); }
.osk-pkey.captioned { min-height: 60px; }
.osk-palette.wide { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.osk-palette.wide .osk-main { font-size: 18px; white-space: normal; line-height: 1.5; text-align: center; }
.osk-layout { width: auto; max-width: 100%; }
.osk-cap { font-size: 10.5px; color: var(--text-2); text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .osk-row { gap: 4px; }
  .osk-key .osk-main, .osk.shifted .osk-key .osk-alt { font-size: 16px; }
  .osk-key .osk-main.lang-ta, .osk.shifted .osk-key .osk-alt.lang-ta { font-size: 13px; }
  .osk-alt { font-size: 9.5px; }
  .osk-us { font-size: 11px; left: 4px; bottom: 3px; }
}
