.header-actions { margin-left: auto; display: flex; align-items: center; gap: 24px; }
.language-picker { position: relative; color: var(--text-primary, #20212b); font: 500 14px/1.4 Arial, sans-serif; }
.language-picker summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px; cursor: pointer; list-style: none; }
.language-picker summary::-webkit-details-marker { display: none; }
.language-picker summary > svg { width: 24px; height: 24px; }
.language-picker summary > .language-chevron { width: 14px; height: 14px; transition: transform .2s; }
.language-picker[open] .language-chevron { transform: rotate(180deg); }
.language-options { position: absolute; top: calc(100% + 8px); right: 0; width: 280px; max-width: calc(100vw - 24px); max-height: min(560px, 70dvh); overflow-y: auto; padding: 8px; background: var(--bg-card, white); border: 1px solid #d5d5df; border-radius: 8px; box-shadow: 0 12px 30px #0002; z-index: 100; }
.language-options button { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; padding: 14px 12px; cursor: pointer; border-radius: 4px; }
.language-options button:hover, .language-options button[aria-pressed="true"] { background: #eeedfb; color: #34306c; }
.language-picker summary:focus-visible, .language-options button:focus-visible { outline: 2px solid #6265b5; outline-offset: 2px; }
@media (max-width: 600px) {
  .header .header-actions { grid-column: 3; grid-row: 1; justify-self: end; gap: 0; }
  .header-actions .page-title { display: none; }
  .language-picker summary { gap: 5px; }
}
.translated-skill-label { font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.translated-best-label { font-weight: 800; font-size: 24px; }
html:not([lang^="en"]) .sidebar .sidebar-label { white-space: normal; }

/* Keep the trigger and dropdown inside narrow screens and device safe areas. */
.header-actions { flex-shrink: 0; margin-right: 16px; }
@media (max-width: 600px) {
  html { zoom: 1; }
  .header .wrap { width: 100%; min-width: 0; grid-template-columns: minmax(44px, 1fr) auto minmax(88px, 1fr); padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); gap: 8px; }
  .header .header-actions { margin: 0; min-width: 0; }
  .language-picker summary { min-width: 76px; padding: 0 8px; }
  .language-options { position: fixed; top: calc(var(--header-height, 64px) + 8px); right: max(16px, env(safe-area-inset-right)); width: min(280px, calc(100vw - 32px)); max-height: calc(100dvh - var(--header-height, 64px) - 32px); box-sizing: border-box; }
  .record-empty { width: 100%; max-width: 480px; margin: 24px auto; padding: 20px; box-sizing: border-box; }
}
