/* Final control layer: explicit action priority, shared across pages and themes.
   Layout and behavior remain owned by the page styles and existing handlers. */
:root { --control-radius: 10px; --control-height: 44px; }
.btn, .quick-state-go, .filters summary, .dens-btn {
  min-height: var(--control-height); border-radius: var(--control-radius);
  font-weight: 600; text-decoration: none;
}
.btn-primary, .rx-search button, .p-me .me-eligibility .panel-link {
  background: var(--action-bg); color: var(--action-ink);
  border: 1px solid transparent; box-shadow: none;
}
.btn-primary:hover, .rx-search button:hover, .p-me .me-eligibility .panel-link:hover {
  background: var(--action-hover); color: var(--action-ink); box-shadow: none; transform: none;
}
.btn-ghost, .quick-state-go, .filters summary, .dens-btn {
  background: var(--surface); border: 1px solid var(--rule-2); color: var(--ink-2); box-shadow: none;
}
.btn-ghost:hover, .quick-state-go:hover, .filters summary:hover, .dens-btn:hover {
  background: var(--raised); border-color: var(--brand); color: var(--ink); transform: none;
}
.quick-state-go { padding-inline: 16px; white-space: nowrap; font: inherit; font-size: .875rem; font-weight: 600; }
/* Header utilities are available without looking like four competing primary buttons. */
.top .me-btn, .top .theme-btn, .top .srch-btn, .top .lang-switch {
  border-color: transparent; background: transparent; box-shadow: none; border-radius: 10px;
}
.top .me-btn:hover, .top .theme-btn:hover, .top .srch-btn:hover, .top .lang-switch:hover {
  background: var(--raised); border-color: var(--rule); color: var(--ink);
}
.top .me-btn[aria-current="page"], .top .srch-btn[aria-expanded="true"] {
  background: var(--brand-tint); color: var(--brand); border-color: transparent;
}
.dens-btn[aria-pressed="true"], .track-btn[aria-pressed="true"] {
  background: var(--brand-tint); color: var(--brand); border-color: var(--brand);
}
/* A deliberate ring, not a second focus border or hover animation. */
.btn:focus-visible, .quick-state-go:focus-visible, .dens-btn:focus-visible,
.filters summary:focus-visible, .top a:focus-visible, .top button:focus-visible,
.bm:focus-visible, .rx-search button:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 3px; box-shadow: none;
}
.btn:disabled, .btn[aria-disabled="true"], button:disabled {
  cursor: not-allowed; transform: none; box-shadow: none;
}
@media (prefers-reduced-motion: no-preference) {
 .btn, .quick-state-go, .filters summary, .dens-btn, .top .me-btn, .top .lang-switch {
   transition: background-color .16s ease, border-color .16s ease, color .16s ease;
 }
}
@media (prefers-reduced-motion: reduce) {
 .btn, .quick-state-go, .filters summary, .dens-btn, .top a, .top button { transition: none; }
}
@media (forced-colors: active) {
 .btn, .quick-state-go, .filters summary, .dens-btn { border: 1px solid ButtonText; }
 .btn:focus-visible, .quick-state-go:focus-visible, .filters summary:focus-visible { outline-color: Highlight; }
}

/* Reserve one header row for logo, navigation and utilities at tablet widths. */
@media(min-width:820px) and (max-width:1279px) {
 :root:not(.big-text) .top-in { display:grid; grid-template-columns:auto minmax(0,1fr) auto; flex-wrap:nowrap; gap:12px; }
 :root:not(.big-text) .top-in > .brand { grid-column:1; grid-row:1; }
 :root:not(.big-text) .top-in > .nav { grid-column:2; grid-row:1; justify-content:flex-end; gap:0; min-width:0; }
 :root:not(.big-text) .top-in > .top-act { grid-column:3; grid-row:1; margin-left:0; flex-wrap:nowrap; gap:4px; }
 :root:not(.big-text) .top-in .nav a { padding-inline:8px; font-size:.8125rem; }
 :root:not(.big-text) .top-in > .top-search { display:none; }
 :root:not(.big-text).srch-open .top-in > .top-search { display:flex; grid-column:1 / -1; grid-row:2; }
}
@media(min-width:820px) and (max-width:1279px) {
 .js body:not(.p-latest) .top-in .srch-btn { display:inline-flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; }
}

/* Dark-only control cues: preserve muted text, decorative dividers and light colors. */
:root[data-theme="dark"] :is(select, textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="submit"]), .quick-state-go, .filters summary, .dens-btn, .btn-ghost):not(:disabled):not(:focus):not(:hover):not([aria-pressed="true"]) { border-color: #82958A; }
:root[data-theme="dark"] select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23BCCAC2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) :is(select, textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="submit"]), .quick-state-go, .filters summary, .dens-btn, .btn-ghost):not(:disabled):not(:focus):not(:hover):not([aria-pressed="true"]) { border-color: #82958A; }
:root:not([data-theme="light"]) select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23BCCAC2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
}
