/* Theme switcher (phase 4). The dashboard menu reuses the top bar's notification panel classes
   (static/css/dashboard/topbar.css); this file only turns its rows into buttons. Loaded only when
   THEME_SWITCHER_ENABLED, before topbar.css: hence the doubled classes to win over .p05-tb__item.
   Unlayered on purpose: the legacy top bar CSS is unlayered and would beat any layer. */
.p05-tb__panel.tsw__panel { width: min(240px, calc(100vw - 24px)); }
.tsw__list { display: grid; gap: 2px; margin: 0; padding: 4px; }
.p05-tb__item.tsw__option {
  width: 100%;
  align-items: center;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.p05-tb__item.tsw__option:hover { background: var(--t-accent-soft); }
.p05-tb__item.tsw__option[aria-pressed="true"] { background: var(--t-accent-soft); }
.p05-tb__item.tsw__option[aria-pressed="true"] .p05-tb__item-title { color: var(--t-accent); font-weight: 700; }
.p05-tb__item.tsw__option:focus-visible { outline: 2px solid var(--t-focus); outline-offset: -2px; }
.p05-tb__theme .p05-tb__item-icon { --tone: var(--t-accent); }

/* Public desktop header (2026-11-23, owner's item 6): the theme and language become icon buttons
   (components/theme_switcher.html variant="icon", components/language_toggle.html). Token colours from public-shell. */
.ps-pref-form { margin: 0; }
.ps-pref { position: relative; list-style: none; padding: 0; font: inherit; }
.ps-pref::-webkit-details-marker { display: none; }
.ps-pref:focus-visible { outline: 2px solid rgb(var(--t-c-2fbfa4)); outline-offset: 2px; }
.ps-icon-btn.ps-pref--lang { width: auto; min-width: var(--ps-control, 40px); gap: .35rem; padding-inline: .65rem; }
.ps-icon-btn.ps-pref--lang svg { width: 18px; height: 18px; flex: 0 0 auto; }
.ps-icon-btn.ps-pref svg { flex: 0 0 auto; }
.ps-pref__code { font-size: .78rem; font-weight: 900; line-height: 1; letter-spacing: 0; }
.ps-pref__code:lang(ar) { font-size: .95rem; }
.ps-pref [data-theme-icon] { display: none; }
.ps-pref[data-theme-current="light"] [data-theme-icon="light"],
.ps-pref[data-theme-current="dark"] [data-theme-icon="dark"],
.ps-pref[data-theme-current="system"] [data-theme-icon="system"],
.ps-pref[data-theme-current="custom"] [data-theme-icon="custom"] { display: block; }

.ps-pref-menu { position: relative; }
.ps-pref-menu[open] > .ps-pref { border-color: var(--ps-line-strong); background: rgba(var(--t-c-006b69), 0.3); }
.ps-pref-menu__panel {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 60;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--ps-line);
  border-radius: 14px;
  background: var(--ps-bg, rgb(var(--t-c-04111a)));
  box-shadow: 0 18px 40px rgba(var(--t-c-000000), 0.35);
}
.ps-pref-menu__list { display: grid; gap: 2px; margin: 0; }
.ps-pref-menu__option {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  min-height: 40px;
  padding: 0 .7rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ps-text);
  font: inherit;
  font-size: .86rem;
  font-weight: 700;
  text-align: start;
  cursor: pointer;
}
.ps-pref-menu__option svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--ps-muted); }
.ps-pref-menu__option:hover { background: rgba(var(--t-c-006b69), 0.22); }
.ps-pref-menu__option[aria-pressed="true"] { background: rgba(var(--t-c-006b69), 0.36); color: rgb(var(--t-c-8ff0d2)); }
.ps-pref-menu__option[aria-pressed="true"] svg { color: currentColor; }
.ps-pref-menu__option:focus-visible { outline: 2px solid rgb(var(--t-c-2fbfa4)); outline-offset: -2px; }
