/* Language controls are always visible; the tip never blocks the page. */
.site-tools { position: relative; display: flex; align-items: center; justify-self: end; margin-left: 0; }
.language-picker { display: flex; align-items: center; gap: 10px; }
.language-label { color: var(--muted); font-size: 11px; line-height: 1.2; white-space: nowrap; }
.language-switch { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--segment-track); }
.language-switch button { min-height: 32px; min-width: 56px; padding: 5px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 500; line-height: 1.4; cursor: pointer; }
.language-switch button:hover { color: var(--ink); background: var(--surface-hover); }
.language-switch button[aria-pressed="true"] { color: var(--ink); background: var(--segment-selected); box-shadow: var(--segment-shadow); font-weight: 650; }
.language-hint { position: absolute; top: calc(100% + 15px); right: 0; z-index: 25; display: flex; align-items: flex-start; gap: 20px; width: 228px; padding: 14px 12px 14px 16px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-raised); color: var(--ink); box-shadow: 0 8px 24px #00000014; }
.language-hint[hidden] { display: none; }
.language-hint::before { content: ""; position: absolute; top: -5px; right: 34px; width: 8px; height: 8px; transform: rotate(45deg); border-top: 1px solid var(--border-strong); border-left: 1px solid var(--border-strong); background: var(--surface-raised); }
.language-hint p { margin: 0; font-size: 12px; line-height: 1.6; }
.language-hint p span { display: block; }
.language-hint p span[lang="en"] { margin-top: 2px; color: var(--muted); font-size: 11px; }
.language-hint button { display: grid; place-items: center; flex: none; width: 24px; height: 24px; margin: -3px -3px 0 auto; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 19px; line-height: 1; cursor: pointer; }
.language-hint button:hover { background: var(--surface-soft); color: var(--ink); }
.dialog-tools { position: sticky; top: -1px; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 44px; margin: 0 0 18px; background: var(--surface); }
.dialog-tools .dialog-close { position: static; float: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 10px 14px 10px 10px; width: auto; height: auto; min-height: 44px; flex: none; border: 1px solid var(--match-border); border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 550; line-height: 1.4; }
.dialog-tools .dialog-close svg { width: 20px; height: 20px; flex: none; }
.dialog-tools .dialog-close:hover { color: var(--accent); border-color: var(--accent); background: var(--match-hover); }
.dialog-tools .dialog-language-switch { margin-left: auto; flex: none; }
.coin-dialog .dialog-tools { padding: 16px 20px 0; }
#dialog-content { padding-top: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.footer { align-items: center; line-height: 1.6; }
.footer-notices { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; }
.footer .footer-credits { padding: 5px 0; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 11px; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.footer .footer-credits:hover { color: var(--ink); text-decoration-color: currentColor; }
html[lang="en"] .course-meta { min-width: 112px; }
html[lang="en"] .asset-filters { gap: 20px; }
html[lang="en"] .article-meta { line-height: 1.8; }
@media (max-width: 1080px) {
  .language-picker { align-items: flex-end; flex-direction: column; gap: 3px; }
  .language-label { font-size: 9px; }
  .language-switch button { min-height: 28px; }
}
@media (max-width: 760px) {
  .site-tools { display: contents; }
  .language-picker { grid-column: 2; grid-row: 1; gap: 4px; }
  .language-label { font-size: 10px; }
  .language-switch button { min-height: 30px; padding: 5px 9px; min-width: 50px; }
  .language-hint { position: static; grid-column: 1 / -1; grid-row: 3; width: 100%; padding: 9px 12px; margin-top: 2px; box-shadow: none; border-color: var(--line); border-radius: 6px; }
  .language-hint::before { display: none; }
  .language-hint p { display: flex; align-items: center; flex-wrap: wrap; gap: 1px 10px; }
  .language-hint p span[lang="en"] { margin-top: 0; }
  .language-hint button { margin-top: 0; }
  .footer { align-items: flex-start; flex-direction: column; gap: 2px; }
  .footer-notices { gap: 4px 14px; }
}
@media (max-width: 680px) {
  html[lang="en"] .course-meta { min-width: 0; }
  html[lang="en"] .asset-filters { gap: 22px; }
}

/* Compact language links beside the main navigation. */
.site-header .language-picker { flex-direction: row; align-items: center; gap: 0; }
.site-header .language-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.site-header .language-switch { padding: 0; gap: 0; border: 0; border-radius: 0; background: transparent; }
.site-header .language-switch button { min-width: 0; min-height: 32px; padding: 5px 8px; border-radius: 3px; font-size: 11px; font-weight: 400; }
.site-header .language-switch button + button { margin-left: 2px; }
.site-header .language-switch button[aria-pressed="true"] { background: transparent; color: var(--ink); box-shadow: none; font-weight: 650; }
.site-header .language-switch button[aria-pressed="false"] { color: var(--muted); }
@media (max-width: 760px) { .site-header .language-picker { grid-column: 2; grid-row: 1; } }
