/* PRISM theme control (A8): three-way radiogroup (segmented) and the rail icon button with a menu.
   Tokens only. Phone rules sit in @media (max-width: 768px); .pr-phone is kept as an extra hook. */
.pr-theme { position: relative; display: grid; gap: 8px; font-size: .85rem; }

.pr-theme__group {
  display: inline-flex; gap: 2px; padding: 2px; width: fit-content; max-width: 100%;
  background: var(--pr-surface-nested); border: 1px solid var(--pr-border-default); border-radius: var(--pr-radius-sm);
}
.pr-theme__opt, .pr-theme__item, .pr-theme__trigger {
  font: inherit; cursor: pointer; color: var(--pr-text-secondary); background: none;
  border: 1px solid transparent; display: inline-flex; align-items: center; gap: 6px;
}
.pr-theme__opt {
  justify-content: center; height: 32px; padding: 0 12px; border-radius: var(--pr-radius-xs);
  font-weight: 500; white-space: nowrap;
}
.pr-theme__opt:hover, .pr-theme__item:hover, .pr-theme__trigger:hover { background: var(--pr-surface-hover); color: var(--pr-text-primary); }
.pr-theme__opt[aria-checked="true"] {
  background: color-mix(in srgb, var(--pr-brand-text) 15%, transparent);
  border-color: var(--pr-brand-text); color: var(--pr-brand-text);
}
.pr-theme__opt:focus-visible, .pr-theme__item:focus-visible, .pr-theme__trigger:focus-visible {
  outline: 2px solid var(--pr-focus-ring); outline-offset: 2px;
}
.pr-theme__ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pr-theme__ico[hidden] { display: none; }

.pr-theme__help { margin: 0; color: var(--pr-text-caption); font-size: .75rem; line-height: 1.4; }
.pr-theme__help--note { color: var(--pr-text-secondary); }
.pr-theme__help[hidden] { display: none; }

/* rail: one icon button, the same three choices in a menu opening beside it */
.pr-theme--rail { display: block; }
.pr-theme__trigger {
  width: 44px; height: 44px; justify-content: center; border-radius: var(--pr-radius-sm);
}
.pr-theme__trigger[aria-expanded="true"] { background: var(--pr-surface-hover); color: var(--pr-text-primary); }
.pr-theme__trigger .pr-theme__ico { width: 20px; height: 20px; }
.pr-theme__menu {
  position: absolute; inset-block-end: 0; inset-inline-start: calc(100% + 8px); z-index: var(--pr-z-popover);
  min-width: 200px; padding: 4px; display: grid; gap: 2px;
  background: var(--pr-surface-elevated); border: 1px solid var(--pr-border-strong);
  border-radius: var(--pr-radius-md); box-shadow: var(--pr-shadow-elevated);
}
.pr-theme__menu[hidden] { display: none; }
.pr-theme__item { height: 36px; padding: 0 10px; border-radius: var(--pr-radius-sm); color: var(--pr-text-primary); width: 100%; }
.pr-theme__item[aria-checked="true"] { color: var(--pr-brand-text); background: var(--pr-brand-tint); }
.pr-theme__item span { flex: 1; text-align: start; }
.pr-theme__check { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.pr-theme__item[aria-checked="true"] .pr-theme__check { visibility: visible; }
.pr-theme__menu .pr-theme__help { padding: 6px 10px 4px; }

@media (max-width: 768px) {
  .pr-theme__group { display: flex; width: 100%; }
  .pr-theme__opt { flex: 1; height: var(--pr-touch-target, 44px); }
  .pr-theme__item { height: 48px; font-size: 1rem; }
}
.pr-phone .pr-theme__group { display: flex; width: 100%; }
.pr-phone .pr-theme__opt { flex: 1; height: var(--pr-touch-target, 44px); }
.pr-phone .pr-theme__item { height: 48px; font-size: 1rem; }
