/* Light/Dark/System as one segmented control, once per page in its own row at the top right of the content (_appearance_switch.html),
   so it never covers a heading or a page action. The saved choice sits on a thumb sized to its grid track via :has (an explicit span: an abspos child's auto end line is the padding edge, BUR-6261), and app-shell.js
   switches the page straight away and saves in the background. The thumb is the only fill: ink in both themes, so the chosen
   segment stays clear (it inverts in dark); unselected options are full ink so they never look disabled (BUR-6197). Phones keep
   only the icons; each button's aria-label is its name. */
.appearance-bar { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; padding: 12px 40px 0; }
body:has(.rail) .appearance-bar { max-width: var(--main-max, 2560px); margin: 0 auto; box-sizing: border-box; } /* main's width and centring (app-shell.css) */
.appearance-switch { --thumb: var(--ink); position: relative; isolation: isolate; display: grid; grid-auto-flow: column; grid-auto-columns: auto;
  margin: 0; padding: 3px; border-radius: 11px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.appearance-switch::before { content: ""; position: absolute; z-index: -1; inset: 0; grid-row: 1; grid-column: 1 / span 1; width: 100%; border-radius: 8px; background: var(--thumb); }
.appearance-switch:has(button[value=dark][aria-pressed=true])::before { grid-column: 2 / span 1; }
.appearance-switch:has(button[value=system][aria-pressed=true])::before { grid-column: 3 / span 1; }
.appearance-switch button { grid-row: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; margin: 0;
  padding: 4px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: 12px; font-weight: 650; line-height: 1; cursor: pointer; }
.appearance-switch button:hover { color: var(--ink); }
.appearance-switch button[aria-pressed=true] { color: var(--on-ink); }
.appearance-switch button:focus-visible { outline: 2px solid var(--tomato); outline-offset: 2px; }
.appearance-switch svg { flex: none; }
/* Rail pages put their one EN/ES switch (_language_switch.html) in this row, left of the slider: visible at every width, never in More.
   Same 3px track and ink thumb as the slider, 44px targets; the masthead's band styles (auth.css, landing.css) do not reach it. */
.appearance-bar .language-switch { display: flex; margin: 0; padding: 3px; border: 0; border-radius: 11px; overflow: visible; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.appearance-bar .language-switch button { min-width: 44px; min-height: 44px; margin: 0; padding: 4px 12px; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 650; line-height: 1; letter-spacing: .04em; cursor: pointer; }
.appearance-bar .language-switch button:hover { background: transparent; color: var(--ink); }
.appearance-bar .language-switch button[aria-pressed=true] { background: var(--ink); color: var(--on-ink); }
.appearance-bar .language-switch button:focus-visible { outline: 2px solid var(--tomato); outline-offset: 2px; }
/* The order composer's basket fills the right edge from the top on wide screens; the slider sits left of it. */
@media (min-width: 901px) { body:has([data-composer]) .appearance-bar { max-width: none; margin-right: var(--panel-w); padding-right: 28px; } }
@media (max-width: 900px) { .appearance-bar { padding: 10px 16px 0; } }
@media (max-width: 640px) {
  /* BUR-6197: icons only; each button's aria-label (_appearance_form.html) is its name, so no hidden text is clipped in the 44px slot. */
  .appearance-switch__label { display: none; }
  .appearance-switch button { padding: 4px 10px; }
}
@media (prefers-reduced-motion: no-preference) {
  .appearance-switch button { transition: color .25s ease-out; }
}
@media (forced-colors: active) {
  .appearance-switch, .appearance-bar .language-switch { border: 1px solid CanvasText; }
  .appearance-bar .language-switch button[aria-pressed=true] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .appearance-switch::before { forced-color-adjust: none; background: Highlight; }
  .appearance-switch button[aria-pressed=true] { forced-color-adjust: none; color: HighlightText; }
}
