/* Shared homepage header controls. */
html .home-converter .header-tools { gap:8px; }
html .home-converter .header-note { margin-right:16px; }
html .home-converter .theme-toggle,
html .home-converter .language-menu summary {
  height:40px; min-height:40px; display:inline-flex; align-items:center;
  justify-content:center; gap:8px; padding:0 12px; border:1px solid transparent;
  border-radius:8px; background:transparent; color:var(--secondary);
  font-size:13px; font-weight:500; line-height:1; cursor:pointer;
  transition:background .15s, color .15s, border-color .15s;
}
html .home-converter .theme-toggle { width:40px; padding:0; }
html .home-converter .theme-toggle[hidden] { display:none; }
html .home-converter .theme-label { display:none; }
html .home-converter .theme-icon {
  display:block; width:19px; height:19px; font-size:0; background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.8 13.2A9 9 0 0 1 10.8 3.2 9 9 0 1 0 20.8 13.2Z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.8 13.2A9 9 0 0 1 10.8 3.2 9 9 0 1 0 20.8 13.2Z'/%3E%3C/svg%3E") center/contain no-repeat;
}
html[data-theme="dark"] .home-converter .theme-icon {
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2m0 16v2M2 12h2m16 0h2M5 5l1.4 1.4m11.2 11.2L19 19M5 19l1.4-1.4M17.6 6.4 19 5'/%3E%3C/svg%3E");
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2m0 16v2M2 12h2m16 0h2M5 5l1.4 1.4m11.2 11.2L19 19M5 19l1.4-1.4M17.6 6.4 19 5'/%3E%3C/svg%3E");
}
html .home-converter .language-menu summary { list-style:none; }
html .home-converter .language-menu summary::-webkit-details-marker { display:none; }
html .home-converter .language-icon { width:18px; height:18px; }
html .home-converter .language-chevron { width:14px; height:14px; color:var(--subtle); transition:transform .15s; }
html .home-converter .language-menu[open] .language-chevron { transform:rotate(180deg); }
html .home-converter .theme-toggle:hover,
html .home-converter .language-menu summary:hover,
html .home-converter .language-menu[open] summary { background:var(--output); border-color:var(--line); color:var(--text); }
html .home-converter .language-options {
  top:calc(100% + 10px); min-width:224px; padding:6px; border:1px solid var(--line);
  border-radius:12px; background:var(--surface); color:var(--secondary);
  box-shadow:0 8px 32px #0000000f, 0 2px 6px #00000005;
}
html .home-converter .language-options a {
  display:flex; align-items:center; justify-content:space-between; min-height:38px;
  padding:9px 12px; border-radius:6px; font-size:13px; font-weight:400;
}
html .home-converter .language-options a:hover { background:var(--output); color:var(--text); }
html .home-converter .language-options a[aria-current] { background:var(--output); color:var(--green); font-weight:600; }
html .home-converter .language-options a[aria-current]::after { content:'✓'; font-size:14px; }
@media(max-width:700px) {
  html .home-converter .header-tools { gap:2px; }
  html .home-converter .language-menu summary { padding-inline:8px; gap:6px; }
  html .home-converter .language-menu summary > span { max-width:90px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  html .home-converter .language-menu summary > svg { flex-shrink:0; }
}
@media(prefers-reduced-motion:reduce) {
  html .home-converter .theme-toggle,
  html .home-converter .language-menu summary,
  html .home-converter .language-chevron { transition:none; }
}

/* Give language selection a clearer resting state. */
html .home-converter .language-menu summary {
  border-color:var(--control-border);
  background:var(--output);
  color:var(--text);
  font-weight:600;
}
html .home-converter .language-chevron { color:var(--secondary); }
html .home-converter .language-menu summary:hover,
html .home-converter .language-menu[open] summary {
  border-color:var(--green);
  background:var(--soft);
}
