/* Responsive core (layout only, DS classes untouched). Desktop (1280 and up) is not affected: every rule sits inside a max-width query.
   Copied into 10-reskin/css, 04-onboarding/nuf-v3/css and 04-onboarding/settings-v1/css. Loaded last.
   DS-GAP: responsive (no DS bottom sheet, nav sheet or touch-size tokens yet; the rules below are layout only). */
html { -webkit-text-size-adjust: 100%; }
img, video, iframe, canvas { max-width: 100%; }
.p-wp-scrim, .p-navbtn, .p-navsheet, .p-sheet-scrim { display: none; }

/* ---- WordPress chrome mock: scrim behind the open admin menu (below 782) ---- */
@media (max-width: 782px) {
  body.p-wpmenu-open .p-wp-scrim { display: block; position: fixed; inset: 46px 0 0 0; z-index: 35; background: rgba(0, 0, 0, .32); }
  .p-wp-toggle { width: 44px !important; height: 44px !important; right: 0 !important; top: 1px !important; }
  .nuf-wp-side { overflow-y: auto; }
}

/* ---- Touch targets: 44px at 1024 and below, and on any touch screen (iPad Pro landscape) ---- */
@media (max-width: 1024px), (pointer: coarse) {
  :is(.btn-wp, .btn-wpo, .btn-text, .btn-surface, .btn-surface-2, .btn-danger, .btn-ghost):not(.rs-hit) { min-height: 44px; min-width: 44px; }
  :is(.btn-wp, .btn-wpo, .btn-text, .btn-surface, .btn-surface-2).icon-only:not(.rs-hit) { padding: 12px; }
  :is(.inp, input.ds-input, .ds-select, .ds-filter-btn, select) { min-height: 44px; }
  .ds-navicon { width: 44px; height: 44px; }
  .ds-tab { min-height: 44px; }
  .ds-menu a, .ds-ctxitem { min-height: 44px; }
  :is(.lnk-wp, .btn-link):not(.rs-hit):not(p .lnk-wp):not(.rs-who__n .lnk-wp) { min-height: 44px; display: inline-flex; align-items: center; }
  .seg-in { min-height: 40px; }
  .ds-seg > label { min-height: 44px; }
  .ds-seg .seg-in { min-height: 44px; }
  /* checkboxes, radios, chips: 44px hit area on a pseudo-element, the drawn control keeps its size (--hit-w/--hit-h are read by the QA sweep) */
  :is(.ds-check, .ds-radio, input[type=checkbox], input[type=radio], button.chip) { position: relative; }
  :is(.ds-check, .ds-radio, input[type=checkbox], input[type=radio])::before { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); --hit-w: 44px; --hit-h: 44px; }
  button.chip::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); --hit-w: 44px; --hit-h: 44px; }
  :is(main, .tplmodal, .ds-topnav, .ds-filter-panel, .rs-pop, .ds-ctxmenu) :is(button, a.lnk-wp, [role=button]):not(.chip):not(.tog):not(.rs-hit):not(.dash-tag__x):not(.p-wp-toggle):not(.ds-tab):not(.ds-seg *):not(p .lnk-wp):not(.rs-who__n .lnk-wp):not(.tcb *):not(.tcb-shot *) { min-height: 44px !important; min-width: 44px !important; }
  a.ds-topnav-logo, [role=option] { min-height: 44px !important; }
  .toast :is(.undo, .act, button) { min-height: 44px; min-width: 44px; }
  .ovv__b { width: 44px; height: 44px; }
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]) { min-height: 44px; }
}

/* ---- Ovation top nav: below 783 (the inline nav no longer fits on one row) the tabs move into a menu button + sheet (js/nav-sheet.js) ---- */
@media (max-width: 782px) {
  .ds-topnav { flex-wrap: nowrap !important; height: 60px !important; padding-inline: 16px; gap: 4px; }
  .ds-topnav-tabs { display: none !important; }
  .ds-topnav-logo { flex: 1 1 auto; }
  .ds-topnav-actions { flex: 0 0 auto; gap: 0; }
  .p-navbtn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--surface-screen); color: var(--type-secondary); cursor: pointer; }
  .p-navbtn:hover { background: var(--surface-overlay-1); }
  .p-navbtn:focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring-color); outline-offset: var(--focus-ring-offset); }
  .p-navbtn svg { width: 20px; height: 20px; }
  .p-sheet-scrim { display: block; position: fixed; inset: 0; z-index: 1190; background: rgba(0, 0, 0, .32); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .p-navsheet { display: flex; flex-direction: column; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1191; max-height: 85dvh; background: var(--surface-screen); border-radius: var(--radius-16) var(--radius-16) 0 0; box-shadow: 0 -4px 24px rgba(0, 0, 0, .12); transform: translateY(100%); visibility: hidden; transition: transform .24s cubic-bezier(.16, 1, .3, 1), visibility 0s .24s; padding-bottom: env(safe-area-inset-bottom); }
  body.p-navsheet-open .p-sheet-scrim { opacity: 1; pointer-events: auto; }
  body.p-navsheet-open .p-navsheet { transform: none; visibility: visible; transition-delay: 0s; }
  .p-navsheet__head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--stroke-tertiary); font: var(--heading-sm); color: var(--type-primary); }
  .p-navsheet__body { overflow-y: auto; padding: 8px 0 12px; }
  .p-navsheet__lbl { display: block; padding: 12px 20px 4px; font: var(--body-sm); color: var(--type-tertiary); }
  .p-navsheet a, .p-navsheet button.p-navsheet__item { display: flex; align-items: center; width: 100%; min-height: 48px; padding: 0 20px; border: 0; background: none; font: var(--body-md); color: var(--type-primary); text-align: left; text-decoration: none; cursor: pointer; }
  .p-navsheet a.sub { padding-left: 36px; color: var(--neutral-400); }
  .p-navsheet a:hover, .p-navsheet button.p-navsheet__item:hover { background: var(--surface-overlay-1); }
  .p-navsheet a[aria-current=page] { color: var(--brand-200, var(--type-primary)); background: var(--brand-10, var(--surface-overlay-1)); }
  .p-navsheet :is(a, button):focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring-color); outline-offset: -2px; }
  .p-navsheet__hr { height: 1px; margin: 8px 0; background: var(--stroke-tertiary); }
}

@media (max-width: 599px) { .ds-topnav-logo img { width: 140px; height: auto; } }

/* ---- Modals: bottom sheets below 768; confirm dialogs (.sm) stay centred ---- */
@media (max-width: 767px) {
  .tplmodal { align-items: flex-end; padding: 0 !important; }
  .tplmodal .tpldialog:not(.sm) { width: 100% !important; max-width: 100% !important; min-width: 0 !important; max-height: 92dvh; border-radius: var(--radius-16) var(--radius-16) 0 0; padding-bottom: env(safe-area-inset-bottom); animation: p-sheet-up .26s cubic-bezier(.16, 1, .3, 1) both; }
  .tplmodal .tpldialog:not(.sm) .tpl-head { padding-inline: 16px; }
  .tplmodal .tpldialog:not(.sm) .tpl-body { padding: 20px 16px; }
  .tplmodal .tpldialog:not(.sm) .tpl-foot { flex-direction: column-reverse; align-items: stretch; padding: 16px; flex: none; }
  .tplmodal .tpldialog:not(.sm) .tpl-foot > :is(button, a, .btn-wp, .btn-wpo, .btn-text, .btn-surface) { width: 100%; justify-content: center; margin: 0; }
  .tplmodal .tpldialog.sm { width: min(346px, calc(100vw - 32px)) !important; max-width: calc(100vw - 32px); }
  .tplmodal:has(.tpldialog.sm) { align-items: center; padding: 16px !important; }
  .tpldialog .mx { min-width: 44px; min-height: 44px; }
}
@keyframes p-sheet-up { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tplmodal .tpldialog { animation: none !important; } .p-navsheet, .p-sheet-scrim { transition: none !important; } }

/* ---- Toasts and the video modal fit the width; fixed elements respect the safe area ---- */
@media (max-width: 767px) {
  .toast { bottom: max(16px, env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); width: max-content; }
  .ovv__stage { width: min(1100px, calc(100vw - 32px), calc((100dvh - 168px) * 16 / 9)); }
  .ovv__x { top: -56px; width: 44px; height: 44px; }
}
@supports (padding: env(safe-area-inset-bottom)) { .toast { bottom: max(24px, env(safe-area-inset-bottom)); } }

/* WordPress sidebar folds to icons at 960 and below (real WP: 782 to 960) */
@media (min-width: 783px) and (max-width: 960px) {
  .nuf-wp-side { width: 36px; } .nuf-wp-side .nuf-wp-lbl { display: none; } .nuf-wp-active { width: 36px; }
  main.rs, main.set, main.nuf-content { margin-left: 36px; }
}

/* ---- Focus (QA 2026-10-31 D8-D11): orange ring on fields, chips, tag remove and card links; no ring on programmatic focus ---- */
.ds-topnav-logo:focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring-color); outline-offset: -2px; }
.inp:focus-visible, textarea:focus-visible, select:focus-visible, .rs-rte__body:focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring-color); outline-offset: 0; }
.inp-act:focus-within { outline: var(--focus-ring-width) solid var(--focus-ring-color); outline-offset: 0; }
.rs-chipcode input:focus-visible, .rs-sl input:focus-visible, input.rs-code:focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring-color); outline-offset: 2px; }
a.act:focus-visible, button.chip:focus-visible, button.x:focus-visible, .dash-tag__x:focus-visible, .tagchip .remove:focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring-color); outline-offset: 2px; }
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }
.tpldialog:focus, .tpldialog:focus-visible { outline: none; }

/* tag chips keep their natural width (the 44px tap rule must not stretch them); 44px hit area on a pseudo-element */
.dash-tag__x { position: relative; }
@media (max-width: 1024px), (pointer: coarse) {
  .dash-tag__x { min-width: 0 !important; min-height: 0 !important; }
  .dash-tag__x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); --hit-w: 44px; --hit-h: 44px; }
}

/* Notification pager and drawer buttons: 44px hit areas at 1024 and below (D16) */
@media (max-width: 1024px), (pointer: coarse) { .nc button, .nc .ds-pager .pg, .ds-pager .pg { min-width: 44px !important; min-height: 44px !important; } }

@media (max-width: 599px) { .nc__foot { flex-wrap: wrap; justify-content: center; gap: 8px; } .nc__foot .ds-pager { flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 100%; } }

/* compact in-row controls keep their drawn size at every width; the 44px touch target is an invisible hit area on a pseudo-element */
@media (max-width: 1024px), (pointer: coarse) {
  .rs-hit { position: relative; }
  .rs-hit::before { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: 44px; transform: translate(-50%, -50%); --hit-w: 44px; --hit-h: 44px; }
}
