/* Header controls follow CodexProxy MainLayout: icon buttons and anchored menus. */
.topbar-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.language-menu, .theme-menu { position: relative; display: inline-flex; align-items: center; }
button.icon-button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 38px; height: 38px; min-height: 38px; min-width: 38px; padding: 0; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; }
button.icon-button:hover, button.icon-button[aria-expanded='true'] { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
button.icon-button:focus-visible { outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 26%, transparent); }
button.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.language-options, .theme-options { position: absolute; top: calc(100% + 12px); right: 0; z-index: 60; border: 1px solid color-mix(in srgb, var(--border) 74%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--bg) 88%, transparent); box-shadow: 0 20px 48px #00000038; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.language-options { display: flex; flex-direction: column; gap: 2px; min-width: 164px; padding: 4px; }
.language-options button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 36px; gap: 18px; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font-size: 14px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.language-options button:hover, .theme-card:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.language-options button[aria-checked='true'] { color: var(--accent); font-weight: 600; }
.language-options button:focus-visible, button.theme-card:focus-visible { outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent); }
.language-check { font-size: 13px; line-height: 1; }
[data-language-choice][aria-checked='false'] .language-check { visibility: hidden; }
.theme-options { display: flex; gap: 4px; width: max-content; max-width: calc(100vw - 32px); padding: 8px 8px 4px; }
button.theme-card { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 0; padding: 6px 6px 4px; border: 2px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font-size: 11px; font-weight: 500; line-height: 1.5; cursor: pointer; }
button.theme-card[aria-checked='true'] { border-color: var(--accent); }
.theme-card > span:last-child { white-space: nowrap; }
.theme-preview { --preview-bg: #fff; --preview-card: #fff; --preview-border: #e5e5e5; --preview-line: #a29c95; display: flex; flex-direction: column; width: 72px; height: 52px; overflow: hidden; border: 1px solid var(--preview-border); border-radius: 6px; background: var(--preview-bg); }
[data-theme-choice='auto'] .theme-preview { --preview-bg: linear-gradient(135deg, #fff 0 50%, #111 50% 100%); --preview-card: linear-gradient(135deg, #fff 0 50%, #1a1a1a 50% 100%); --preview-border: #bdbdbd; --preview-line: linear-gradient(135deg, #c9c9c9 0 50%, #5a5a5a 50% 100%); }
[data-theme-choice='light'] .theme-preview { --preview-bg: #faf9f5; --preview-card: #f0eee8; --preview-border: #e3e1db; }
[data-theme-choice='dark'] .theme-preview { --preview-bg: #151412; --preview-card: #1d1b18; --preview-border: #3a3530; --preview-line: #9c958d; }
.theme-preview-header { display: block; height: 10px; flex-shrink: 0; background: var(--preview-card); border-bottom: 1px solid var(--preview-border); }
.theme-preview-body { display: flex; flex: 1; min-height: 0; }
.theme-preview-sidebar { width: 16px; flex-shrink: 0; background: var(--preview-card); border-right: 1px solid var(--preview-border); }
.theme-preview-content { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 5px 8px; }
.theme-preview-content > span { display: block; height: 3px; border-radius: 1px; background: var(--preview-line); }
.theme-preview-content > span + span { width: 60%; }
@media (max-width: 600px) {
  .topbar-actions { position: relative; gap: 4px; }
  button.icon-button { width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
  .theme-menu { position: static; }
  .theme-preview { width: 48px; height: 40px; }
  .theme-preview-content { padding: 4px; }
  .theme-card > span:last-child { font-size: 10px; }
}
