/* Shared UI typography and controls. Keep native select, validation and disclosure behavior. */
:root {
  --studio-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --studio-ink: #192332;
  --studio-muted: #526174;
  --studio-line: #adb9c8;
  --studio-blue: #205cc3;
  --studio-tint: #eaf2ff;
}
html body, html body :is(h1,h2,h3,h4,label,button,input,select,textarea,summary,.primary,.secondary) {
  font-family: var(--studio-font) !important;
}
html body h1 { letter-spacing: -.035em; line-height: 1.12; }
body.admin-page[data-management-theme="ivory"] {
  --bg: #f5f7fa; --panel: #fff; --side: #f8fafc; --soft: #eff3f8;
  --line: #cbd4df; --text: var(--studio-ink); --muted: var(--studio-muted);
  --orange: var(--studio-blue); --blue: #174997; --accent-soft: var(--studio-tint);
}
html body :is(select:not([multiple]):not([size]), input:not([type]), input:is([type="text"],[type="search"],[type="email"],[type="tel"],[type="url"],[type="number"],[type="password"],[type="date"],[type="time"],[type="datetime-local"]), textarea) {
  box-sizing: border-box !important;
  min-width: 0;
  max-width: 100%;
  min-height: 44px !important;
  padding: 8px 12px !important;
  font-size: 1rem !important;
  font-weight: 400;
  line-height: 1.35;
}
html body:where(.admin-page, :has(#customer-studio-back)) :is(select:not([multiple]):not([size]), input:not([type]), input:is([type="text"],[type="search"],[type="email"],[type="tel"],[type="url"],[type="number"],[type="password"],[type="date"],[type="time"],[type="datetime-local"]), textarea) {
  border: 1px solid var(--studio-line) !important;
  border-radius: 7px !important;
  background-color: white !important;
  color: var(--studio-ink) !important;
  color-scheme: light;
}
html body:where(.admin-page, :has(#customer-studio-back)) select:not([multiple]):not([size]) {
  appearance: none;
  padding-inline-end: 36px !important;
  background-image: linear-gradient(45deg, transparent 50%, #43546a 50%), linear-gradient(135deg, #43546a 50%, transparent 50%) !important;
  background-position: right 17px center, right 12px center !important;
  background-repeat: no-repeat !important;
  background-size: 5px 5px !important;
}
html body:where(.admin-page, :has(#customer-studio-back)) :is(input,textarea)::placeholder { color: #637286; opacity: 1; }
html body :is(input,select,textarea,summary,button,a):focus-visible {
  outline: 2px solid #377af0 !important;
  outline-offset: 2px !important;
}
html body :is(.primary,.secondary,.toolbar-storefront,#inventory-heading .simple-inventory-tools > summary) {
  box-sizing: border-box; min-height: 44px; padding: 10px 16px;
  border-radius: 7px !important; font-size: .9375rem; font-weight: 600; line-height: 1.35;
}
html body:where(.admin-page, :has(#customer-studio-back)) :is(button.primary,a.primary,.toolbar-storefront) {
  background: var(--studio-blue) !important; color: white !important; border-color: var(--studio-blue) !important;
}
html body:where(.admin-page, :has(#customer-studio-back)) :is(button.secondary,a.secondary,#inventory-heading .simple-inventory-tools > summary) {
  background: white !important; color: var(--studio-ink) !important; border: 1px solid var(--studio-line) !important;
}
html body:where(.admin-page, :has(#customer-studio-back)) :is(button.primary,a.primary,.toolbar-storefront):hover { background: #194da4 !important; }
html body:where(.admin-page, :has(#customer-studio-back)) :is(button.secondary,a.secondary):hover { background: #eff5ff !important; }
html body.admin-page :is(.manager-filter-main,.manager-filter-grid) {
  gap: 12px; align-items: end;
}
html body.admin-page :is(.manager-filter-main,.manager-filter-grid,.search-label) label,
html body.admin-page label.search-label { font-size: .875rem; font-weight: 600; }
html body.admin-page :is(.manager-filter-main,.manager-filter-grid) label { min-width: 0; }
html body.admin-page :is(.manager-filter-main,.manager-filter-grid,.search-label) :is(input:not([type=checkbox]),select) {
  width: 100%; margin-inline: 0;
}
@media (min-width: 1101px) {
  body.admin-page #stock-filter-controls { grid-template-columns: repeat(5,minmax(0,1fr)); }
}
@media (forced-colors: active) {
  html body:where(.admin-page, :has(#customer-studio-back)) select:not([multiple]):not([size]) { appearance: auto; background-image: none !important; }
}
html body.storefront-page :is(#filters,.results-toolbar) select { max-width: 100%; }
body.admin-page[data-management-theme="ivory"] { color-scheme: light; }
body.admin-page[data-management-theme="ivory"] :is(.admin-topbar,.admin-sidebar) { background: var(--side) !important; }
body.admin-page[data-management-theme="ivory"] .page-heading :is(h1,h2) { font-family: var(--studio-font) !important; }
body.admin-page #inventory-heading .store-tools-links { align-items: center; gap: 8px; }
body.admin-page #inventory-heading :is(.primary,.secondary,.simple-inventory-tools > summary) {
  min-height: 44px; margin-block: 0; padding: 10px 16px; font-size: .9375rem; font-weight: 600;
}
body.admin-page :is(.manager-filter-grid,.manager-filter-main) label > :is(input,select) { display: block; }

/* The header search label already provides the field surface and border. */
body.storefront-page .search #search {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: inherit !important;
  color-scheme: inherit;
}
body.storefront-page .search #search::placeholder {
  color: currentColor !important;
  opacity: .78;
}

/* Keep the same reading rhythm across management workspace sections. */
body.admin-page [data-section] :is(.page-heading,.panel) :is(h1,h2,h3) {
  margin-block: 0;
  line-height: 1.2;
}
body.admin-page [data-section] :is(.page-heading,.panel) p {
  line-height: 1.5;
}
body.admin-page [data-section] :is(h1,h2,h3) + p {
  margin-block: .5rem 1rem;
}
body.admin-page [data-section] .page-heading {
  gap: 1rem;
  flex-wrap: wrap;
}
body.admin-page [data-section] :is(.list-toolbar,.activity-filters,.order-toolbar) {
  gap: .75rem 1rem;
  align-items: end;
}
body.admin-page [data-section] :is(.list-toolbar,.activity-filters,.order-toolbar) label {
  margin: 0;
  min-width: 0;
}
body.admin-page [data-section] :is(.list-toolbar,.activity-filters,.order-toolbar) label > :is(select,input:not([type=checkbox])) {
  display: block;
  margin: .375rem 0 0;
}
body.admin-page #orders-v45 .order-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .75rem 1rem;
}
body.admin-page #orders-v45 .order-toolbar label {
  display: block;
  flex: 1 1 12rem;
}
body.admin-page #orders-v45 .order-toolbar :is(input,select) { width: 100%; }
body.admin-page #orders-v45 .order-toolbar > button { margin: 0; }
body.admin-page #order-summary {
  margin-block: 1rem;
  padding-block: .75rem;
  border-block: 1px solid var(--line);
  line-height: 1.5;
}
body.admin-page #order-error:empty,
body.admin-page #order-summary:empty { display: none; }
body.admin-page #order-list > p { margin: 0; }
@media (max-width: 600px) {
  body.admin-page #orders-v45 .order-toolbar > * { flex: 1 1 100%; }
}

/* The shared account shell includes this back link only in staff Customers. */
.csm-account-page:has(#customer-studio-back) {
  color-scheme: light;
  background: #f5f7fa;
  color: var(--studio-ink);
  --customer-divider: #cbd4df;

  & .account-top { background: #f8fafc; border-color: var(--customer-divider); }
  & .account-card, & .account-skip { background: white; border-color: var(--customer-divider); }
  & a { color: #174997; }
  & .account-brand { color: var(--studio-ink); }
  & .account-main h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1.2; }
  & .account-main p, & .account-items small, & .account-facts dt { color: var(--studio-muted); }
  & .account-heading { gap: 1rem; margin-bottom: 1.25rem; }
  & .account-filter { gap: .75rem 1rem; }
  & .account-main label { font-size: .875rem; }
  & .account-main button, & .account-button {
    background: var(--studio-blue); color: white; padding: 10px 16px;
    border: 1px solid transparent; border-radius: 7px;
    font-size: .9375rem; line-height: 1.35; font-weight: 600;
  }
  & .account-main button:hover, & .account-button:hover { background: #194da4; }
  & #customer-studio-back { background: white; color: var(--studio-ink); border-color: var(--studio-line); }
  & #customer-studio-back:hover { background: #eff5ff; }
  & .account-items { margin: 1rem 0 0; }
  & .account-items li { padding-block: .8rem; border-color: var(--customer-divider); }
  & .account-items li:last-child { border-bottom: 0; }
  & .account-state { background: var(--studio-tint); color: #174997; font-weight: 600; }
  & .account-main .account-message { background: #eaf6ef; border-color: #357151; color: #234d38; }
  & .account-main .account-error { background: #fff1ef; border-color: #b54338; color: #812e26; }
  & .account-danger { border-color: var(--customer-divider); }
  & .account-danger summary { color: #932f27; }
  & .account-danger button { background: #932f27; }
  & .account-danger button:hover { background: #75251f; }
}

/* Lift the whole photo so the full product stays in frame. */
@media (hover: hover) and (pointer: fine) {
  :is(#products .bh-single-photo, .vault-product-image:not([data-next-photo]):has(img)) {
    transition: translate 180ms ease-out, scale 180ms ease-out, box-shadow 180ms ease-out;
  }

  :is(#products .bh-single-photo, .vault-product-image:not([data-next-photo]):has(img)):is(:hover, :focus-visible),
  #products .cg-photo:hover > .bh-single-photo {
    position: relative;
    z-index: 2;
    box-shadow: 0 12px 22px rgb(0 0 0 / 46%);
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  :is(#products .bh-single-photo, .vault-product-image:not([data-next-photo]):has(img)):is(:hover, :focus-visible),
  #products .cg-photo:hover > .bh-single-photo {
    translate: 0 -8px;
    scale: 1.08;
  }
}
