/* Customer controls retain their existing brand colors and layout at rest. */
:is(button:enabled:not([data-handle]), input:is([type=button],[type=submit]):enabled, summary,
    select:enabled, input:is([type=checkbox],[type=radio]):enabled,
    label:has(>input:is([type=checkbox],[type=radio]):enabled)) { cursor: pointer; }
a[href]:not([class]):where(p *, li *, footer *) {
  text-decoration: underline;
  text-underline-offset: .17em;
}
@media (hover:hover) and (pointer:fine) {
  a[href]:not([aria-disabled=true]):hover, summary:hover {
    text-decoration-line: underline;
    text-underline-offset: .18em;
    text-decoration-thickness: .12em;
  }
  :is(button:enabled:not([data-handle]), input:is([type=button],[type=submit]):enabled,
      a:is(.btn,.ap-button,.account-action,.primary)[href], select:enabled,
      [role=button]:not([aria-disabled=true])):hover {
    box-shadow: inset 0 0 0 1px currentColor;
  }
}
:is(button:enabled:not([data-handle]), a:is(.btn,.ap-button,.account-action,.primary)[href],
    summary, input:is([type=button],[type=submit]):enabled):active {
  box-shadow: inset 0 0 0 2px currentColor;
  filter: brightness(.93);
}
:is(a[href],button,input,select,textarea,summary,[role=button],[tabindex="0"]):focus-visible {
  outline: 3px solid #005bc4;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px white;
}
@media (forced-colors:active) {
  :is(a[href],button,input,select,textarea,summary,[role=button],[tabindex="0"]):focus-visible { outline-color: Highlight; }
}

/* Keep motion on the control, never on the photo being positioned. */
@media (prefers-reduced-motion: no-preference) {
  :where(a[href], summary, select, button:not([data-handle]), input:is([type=button],[type=submit])) {
    transition: background-color 140ms ease-out, color 140ms ease-out,
      border-color 140ms ease-out, text-decoration-color 140ms ease-out, box-shadow 140ms ease-out;
  }
  :where(a.btn[href], a.ap-button[href], .btn:enabled, .account-action[href]) {
    transition: background-color 140ms ease-out, border-color 140ms ease-out,
      box-shadow 140ms ease-out, translate 100ms ease-out;
  }
  :where(a.btn[href], a.ap-button[href], .btn:enabled, .account-action[href]):active {
    translate: 0 1px;
  }
  :where(.faq-item[open] > p, .faq-item[open] > div) {
    animation: ap-dialog-in 150ms ease-out;
  }
  :where(dialog[open]) {
    animation: ap-dialog-in 150ms ease-out;
  }
  dialog[open]::backdrop {
    animation: ap-dialog-in 150ms ease-out;
  }
}
@keyframes ap-dialog-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ap-busy-turn { to { transform: rotate(1turn); } }

@media (prefers-reduced-motion: reduce) {
  :is(a[href], button, input, select, summary, dialog, [role=status]),
  dialog::backdrop, [role=status]::before {
    transition: none !important;
    animation: none !important;
  }
}

/* Keep account access first in keyboard navigation on either layout. */
.auth-skip {
  position: fixed; inset: .5rem auto auto .5rem; z-index: 100;
  transform: translateY(calc(-100% - 1rem)); padding: .75rem 1rem;
  background: white; color: #123c71; border-radius: .5rem;
}
.auth-skip:focus { transform: none; }

@font-face {
  font-family: "AllPrint DM Sans";
  src: url("/assets/type/dm-sans-latin-wght.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
}

:root { --ap-customer-type: "AllPrint DM Sans", "Segoe UI", Arial, sans-serif; }
html body, :root body :is(main, nav, footer, dialog, button, input, select, textarea, label, summary) {
  font-family: var(--ap-customer-type);
}
:root body :is(h1,h2,h3,h4):not(.brand-wordmark) {
  font-family: var(--ap-customer-type);
  font-weight: 600;
  letter-spacing: -.025em;
  overflow-wrap: break-word;
}
:root body h1:not(.brand-wordmark) { letter-spacing: -.035em; }
:root body :is(button,.btn,.primary,.account-action,summary) { letter-spacing: normal; }
:root body :is(.quick-size,.photo-size-matrix,.cart-summary,.print-item-details,.price,output,input[type=number]) {
  font-variant-numeric: lining-nums tabular-nums;
}
:root body :is(.cart-summary,.print-item-details) strong { font-weight: 650; }
@media (max-width: 640px) {
  :root body :is(select,textarea,input:not([type=checkbox],[type=radio],[type=file],[type=range],[type=hidden])) {
    font-size: max(1rem, 16px);
  }
}

/* The order builder has its own more specific heading and price rules. */
:root body.review-build.builder-page :is(h1,h2,h3,.hero-title,.builder-collection-title,.panel-step-title),
:root body #builder-login-heading, :root body .cart-summary h2 {
  font-family: var(--ap-customer-type);
  font-weight: 600;
}
@media (max-width: 420px) {
  :root body .ap-customer-nav summary span { max-width: 100%; }
}

@media (max-width: 480px) {
  .site-header:has(+ #login-card) .header-inner,
  .site-header:has(+ #login-card) .header-nav { flex-wrap: wrap; gap: .35em .75em; }
  #login-card .btn { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  #login-card .two-column-layout > section { min-width: 0; }
  #receipt-main .account-intro > img { max-width: min(28vw, 100%); min-width: 0; }
}
@media (max-width: 480px) {
  #receipt-main .account-intro { flex-wrap: wrap; }
  #receipt-main .account-intro h1, #builder-login-heading { min-width: 0; overflow-wrap: anywhere; }
}
@media (max-width: 480px) {
  .ap-unified-bar .ap-customer-nav > :is(a,span) span,
  .account-shortcuts a.account-link {
    max-width: 100%; min-width: 0; white-space: normal; overflow-wrap: anywhere; text-align: center;
  }
}
@media (max-width: 480px) {
  :root body header .ap-unified-bar,
  :root body header.site-header.builder-header .container.header-inner.ap-unified-bar { flex-wrap: wrap; }
  :root body .ap-unified-bar .ap-customer-nav { min-inline-size: min(100%, 11.5rem); max-inline-size: 100%; }
}

/* The mark keeps its print lettering. Working screens use the existing local DM Sans. */
:root body :is(.brand-wordmark,.brand-name,.account-header .brand-link > span,.phone-transfer-page .phone-brand,.ap-brand-word),
:root body.review-build.builder-page .brand-wordmark {
  font:700 clamp(1.375rem,1.2rem + .45vw,1.625rem)/1.1 Georgia,serif;
  color:#12284b;letter-spacing:-.035em;text-transform:none;
}
:root body .ap-unified-bar :is(.ap-main-toggle,.ap-customer-nav) {font-family:var(--ap-customer-type)}
:root body .hero-section {padding-block:clamp(1.5rem,3vw,2.75rem)}
:root body :is(.hero-section .hero-title,#print-storefront .hero h1,#guide-title,.hero .copy h1) {
  font-size:clamp(2rem,1.55rem + 1.85vw,3.125rem);line-height:1.08;
}
:root body :is(.hero-lead,.account-intro p) {font-size:1.0625rem;line-height:1.5}
:root body #print-storefront .hero-image img {height:clamp(11rem,25vw,21rem)}
:root body #print-storefront .hero {gap:clamp(1rem,2.5vw,2rem)}
:root body #print-storefront .hero .ap-action-row {margin-top:1rem}
:root body :is(.hero-footnote,.photo-card-meta,.photo-preview-caption,.photo-preview-advisory,.frame-resolution) {font-size:.875rem;line-height:1.4}
:root body .account-intro h1 {font-size:clamp(1.75rem,1.55rem + 1vw,2.25rem)}
:root body .phone-transfer-page {padding:clamp(1rem,3vw,1.5rem);margin-block:clamp(1rem,4vh,2.5rem)}
:root body .phone-transfer-page h1 {font-size:clamp(1.625rem,1.4rem + 1vw,2rem);line-height:1.15}
:root body .phone-transfer-page .phone-brand {margin:0 0 .875rem}
:root body .cart-workspace.in-checkout :is(.checkout-main,.cart-summary) {padding:clamp(1rem,1.75vw,1.5rem)}
:root body .cart-summary :is(dt,dd), :root body .cart-product-line {line-height:1.45}
:root body :is(.hero-actions,.ap-action-row) :is(a,button),
:root body .brand-group + nav a {min-height:44px}
@media (min-width:601px) and (max-width:960px) {
  :root body .ap-unified-bar .ap-customer-nav {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));flex:1 1 auto;min-width:0;max-width:36rem;gap:2px}
  :root body .ap-unified-bar .ap-customer-nav > :is(a,span),:root body .ap-unified-bar .ap-customer-nav summary {flex-direction:column;min-width:0;text-align:center;padding:.2rem;gap:2px}
  :root body .ap-unified-bar .ap-customer-nav :is(span,small) {max-width:100%;white-space:normal;overflow-wrap:anywhere}
}
:root body.order-page .order-main .btn {min-height:44px}

/* Customer task screens share the print builder's control and reading scale. */
:root {
  --ap-task-text: 1rem;
  --ap-task-action: .9375rem;
  --ap-task-control-height: 2.75rem;
  --ap-task-panel-padding: clamp(1rem, 2.2vw, 1.5rem);
}
:root body :is(.hero-actions,.ap-action-row) :is(a,button) {
  font-size: var(--ap-task-action);
  font-weight: 600;
  min-block-size: var(--ap-task-control-height);
  white-space: normal;
}

:root body :is(#prints-account-root,#receipt-main,.saved-order,.phone-transfer-page) {
  font-size: var(--ap-task-text);
  line-height: 1.5;
}
:root body :is(#prints-account-root,#receipt-main,.saved-order,.phone-transfer-page)
  :is(.btn,.account-action,button):not(:where(dialog *),[data-handle]) {
  font-size: var(--ap-task-action);
  min-block-size: var(--ap-task-control-height);
  white-space: normal;
}
:root body :is(#prints-account-root,#receipt-main,.saved-order)
  :is(input:not([type=checkbox],[type=radio],[type=hidden],[type=file],[type=range]),select,textarea):not(:where(dialog *)) {
  font-size: var(--ap-task-text);
  min-block-size: var(--ap-task-control-height);
  max-inline-size: 100%;
}
:root body :is(.cart-workspace.in-checkout .checkout-main,.cart-workspace.in-checkout .cart-summary) {
  padding: var(--ap-task-panel-padding);
}
:root body .cart-workspace.in-checkout .cart-summary .btn-primary:disabled {
  background: #dbe7f8;
  border-color: #bed0eb;
  color: #29466a;
  box-shadow: none;
  cursor: default;
}
:root body :is(#builder-login-status,#native-status,.cart-summary [data-loading],.frame-detail [role=status],
  #phone-transfer [role=status]) {
  line-height: 1.55;
  overflow-wrap: anywhere;
}
:root body .phone-transfer-page input[type=file] {
  font: inherit;
  inline-size: 100%;
  min-inline-size: 0;
}
:root body .phone-transfer-page input::file-selector-button {
  font: 600 var(--ap-task-action)/1.35 var(--ap-customer-type);
  min-block-size: var(--ap-task-control-height);
  max-inline-size: 100%;
  white-space: normal;
}
@media (max-width: 640px) {
  :root body :is(#prints-account-root,#receipt-main,.saved-order) :is(
    input:not([type=checkbox],[type=radio],[type=hidden],[type=file],[type=range]),select,textarea
  ):not(:where(dialog *)) { font-size: max(var(--ap-task-text), 16px); }
}

/* Only pending elements get a ring. Existing progress bars keep their actual values. */
:where([data-loading]:not(:empty),
  #prints-account-root[aria-busy="true"] #account-status:not(:empty))::before {
  content: "";
  display: inline-block;
  box-sizing: border-box;
  inline-size: .9em;
  block-size: .9em;
  margin-inline-end: .55em;
  border: .12em solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  vertical-align: -.06em;
}
@media (prefers-reduced-motion: no-preference) {
  :where([data-loading]:not(:empty),
  #prints-account-root[aria-busy="true"] #account-status:not(:empty))::before {
    animation: ap-busy-turn 850ms linear infinite;
  }
}

/* Route notices use the customer shell scale even before application startup. */
.ap-bootstrap-alert,
.ap-drain-notice {
  box-sizing: border-box;
  width: min(calc(100% - 2rem), 46rem);
  margin: 1rem auto;
  padding: .75rem 1rem;
  border: 1px solid #d6dde6;
  border-radius: .625rem;
  background: #f3f7fb;
  color: #17283d;
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.ap-server-notice {
  margin: 0;
  background: #f7f4ed;
  color: #17283d;
  font-size: 1rem;
  line-height: 1.5;
}
.ap-server-notice main {
  width: min(calc(100% - 2rem), 42rem);
  margin-inline: auto;
  padding-block: clamp(1.5rem, 8vh, 4rem);
}
.ap-server-notice main > * { margin-block: 0 1rem; }
.ap-server-notice h1 { font-size: clamp(1.5rem, 1.1rem + 1vw, 2rem); line-height: 1.2; }
.ap-drain-notice h2 { margin: 0 0 .5rem; font-size: 1.125rem; line-height: 1.25; }
.ap-drain-notice p { margin: .5rem 0 0; }
.ap-server-notice a, .ap-drain-notice a { color: #153d68; }

main.ap-not-found {
  box-sizing: border-box;
  max-inline-size: 42rem;
  padding-block: clamp(1.5rem, 8vh, 4rem);
}
.ap-not-found .eyebrow { margin-block-start: 2rem; }
.ap-not-found .hero-title {
  font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.25rem);
  font-weight: 600;
  line-height: 1.2;
}
.ap-not-found .hero-lead { font-size: 1rem; line-height: 1.5; }
.ap-not-found .btn { min-block-size: 2.75rem; font-size: .9375rem; }
