/* 2026-09-08: only the explicitly authorized containment and scrolling repairs. */
.featured-product-link {
  display: grid !important;
  grid-template-columns: 64px minmax(0, 1fr) !important;
  grid-template-rows: 64px !important;
  gap: 12px;
  box-sizing: border-box;
  height: 90px;
  min-height: 90px;
  max-height: 90px;
  min-width: 0;
  overflow: hidden;
}

.featured-product-link > img,
.featured-product-link > picture,
.featured-product-link > picture > img,
.featured-product-link > [data-product-image-fallback] {
  grid-area: 1 / 1;
  display: block;
  width: 64px !important;
  height: 64px !important;
  min-width: 0 !important;
  max-width: 64px !important;
  max-height: 64px !important;
  flex: none !important;
  overflow: hidden;
  object-fit: contain !important;
  object-position: center !important;
  background: #050608 !important;
}

.featured-product-link > [data-product-image-fallback][hidden] {
  display: none !important;
}

.featured-product-link > span:last-child {
  grid-area: 1 / 2;
  min-width: 0;
  max-height: 64px;
  overflow: hidden;
}

.featured-product-link strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

/* Keep the frame at its original cover position. Fit only its inner image.
   The old 176px crop width exceeded the button's content box on phones.
   Retain its existing height so the frame and following content do not move. */
@media (max-width: 620px) {
  .profile-hero > .profile-story-button > .profile-avatar-crop-shell {
    width: 100%;
    height: min(176px, 62vw);
  }

  .profile-hero > .profile-story-button > .profile-avatar-crop-shell > img {
    display: block;
    box-sizing: border-box;
  }
}

/* Preserve the input's approved footprint while making Return a real newline. */
.chat-composer > textarea[name="body"] {
  grid-area: body;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.42);
  font: inherit;
  line-height: 22px;
  resize: none;
  overflow: auto;
  touch-action: auto;
}

.chat-bubble [data-message-body] {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .chat-composer > textarea[name="body"] {
    font-size: 16px;
  }
}

/* One bounded native scroller, including when a soft keyboard reduces the view. */
body > .modal-backdrop:not(.is-hidden) {
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

body > .modal-backdrop:not(.is-hidden) > [role="dialog"] {
  min-height: 0 !important;
  max-height: calc(var(--trimnetic-viewport-height, 100dvh) - 40px) !important;
  box-sizing: border-box;
  overscroll-behavior: contain !important;
}

body > .modal-backdrop > .upload-modal {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  overflow-anchor: none;
  scroll-behavior: auto;
  touch-action: auto;
}

/* Hiding rails never disables the associated scrolling surfaces. */
.modal-backdrop,
.modal-backdrop *,
.chat-messages,
.chat-composer > textarea,
.feed-comments,
.instrumentarium-grid {
  scrollbar-width: none !important;
}

.modal-backdrop::-webkit-scrollbar,
.modal-backdrop *::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.chat-composer > textarea::-webkit-scrollbar,
.feed-comments::-webkit-scrollbar,
.instrumentarium-grid::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* Hide only scrollbar chrome; keep existing overflow and input behavior. */
html, body, body * {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
html::-webkit-scrollbar, body::-webkit-scrollbar, body *::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Floating presentation layer: supported cards/buttons are marked by the
   isolated controller. Standard transform transitions also work on iOS 15. */
@media (min-width: 1181px) {
  .insight-column {
    /* Paint gutter around the existing scroller; inner coordinates unchanged. */
    padding-left: 18px !important;
    padding-right: 18px !important;
    width: calc(100% + 36px) !important;
    max-width: calc(100% + 36px) !important;
    margin-left: -18px;
    margin-right: -18px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  [data-floating-kind] {
    --floating-lift: -3px;
    --floating-scale: 1.008;
    --floating-shadow: 0 10px 28px rgba(212,175,55,.20);
    --floating-ease: cubic-bezier(.22,.61,.36,1);
    transition: transform 380ms var(--floating-ease), box-shadow 380ms var(--floating-ease);
  }
  [data-floating-kind="featured"], [data-floating-kind="job"],
  [data-floating-kind="notification"], [data-floating-kind="product-item"] {
    --floating-lift: -2px;
    --floating-scale: 1.006;
    --floating-shadow: 0 7px 16px -4px rgba(212,175,55,.20);
  }
  [data-floating-kind="button"] {
    --floating-lift: -1px;
    --floating-scale: 1.004;
    --floating-shadow: 0 5px 12px -3px rgba(212,175,55,.18);
  }
  [data-floating-kind="product"] > .product-media,
  [data-floating-kind="featured"] > picture,
  [data-floating-kind="product-item"] > .product-media,
  [data-floating-kind="product-item"] > .cart-product-media,
  [data-floating-kind="product-item"] > .instrument-product-media { overflow: hidden !important; }
  .floating-inner-image {
    transform: scale(1);
    transition: transform 420ms var(--floating-ease), clip-path 420ms var(--floating-ease);
  }
  .floating-self-clipped { clip-path: inset(0 round 8px); }
  [data-floating-kind].is-floating-active {
    transform: translateY(var(--floating-lift)) scale(var(--floating-scale));
    box-shadow: var(--floating-shadow);
  }
  [data-floating-kind="profile"].is-floating-active .floating-inner-image { transform: scale(1.06); }
  [data-floating-kind="profile"].is-floating-active .floating-self-clipped { clip-path: inset(2.830189% round 7.547170px); }
  [data-floating-kind="product"].is-floating-active .floating-inner-image { transform: scale(1.09); }
  [data-floating-kind="product"].is-floating-active .floating-self-clipped { clip-path: inset(4.128441% round 7.339450px); }
  [data-floating-kind="featured"].is-floating-active .floating-inner-image { transform: scale(1.09); }
  [data-floating-kind="featured"].is-floating-active .floating-self-clipped { clip-path: inset(4.128441% round 7.339450px); }
  [data-floating-kind="job"].is-floating-active .floating-inner-image { transform: scale(1.04); }
  [data-floating-kind="job"].is-floating-active .floating-self-clipped { clip-path: inset(1.923077% round 7.692308px); }
  [data-floating-kind="product-item"].is-floating-active .floating-inner-image { transform: scale(1.08); }
  @media (hover: hover) and (pointer: fine) {
    html:not(.floating-touch-input) [data-floating-kind]:not(.floating-control-hover):hover {
      transform: translateY(var(--floating-lift)) scale(var(--floating-scale));
      box-shadow: var(--floating-shadow);
    }
    html:not(.floating-touch-input) [data-floating-kind="product-item"]:not(.floating-control-hover):hover .floating-inner-image { transform: scale(1.08); }
    html:not(.floating-touch-input) [data-floating-kind="profile"]:hover .floating-inner-image { transform: scale(1.06); }
    html:not(.floating-touch-input) [data-floating-kind="profile"]:hover .floating-self-clipped { clip-path: inset(2.830189% round 7.547170px); }
    html:not(.floating-touch-input) [data-floating-kind="product"]:hover .floating-inner-image { transform: scale(1.09); }
    html:not(.floating-touch-input) [data-floating-kind="product"]:hover .floating-self-clipped { clip-path: inset(4.128441% round 7.339450px); }
    html:not(.floating-touch-input) [data-floating-kind="featured"]:hover .floating-inner-image { transform: scale(1.09); }
    html:not(.floating-touch-input) [data-floating-kind="featured"]:hover .floating-self-clipped { clip-path: inset(4.128441% round 7.339450px); }
    html:not(.floating-touch-input) [data-floating-kind="job"]:hover .floating-inner-image { transform: scale(1.04); }
    html:not(.floating-touch-input) [data-floating-kind="job"]:hover .floating-self-clipped { clip-path: inset(1.923077% round 7.692308px); }
  }
}
/* Scoped polish: Menu, desktop product form and video product-button elevation. */
@media (prefers-reduced-motion: no-preference) {
  .product-bubble[data-floating-kind="button"].is-floating-active { box-shadow: var(--floating-shadow) !important; }
  @media (hover: hover) and (pointer: fine) {
    html:not(.floating-touch-input) .product-bubble[data-floating-kind="button"]:hover { box-shadow: var(--floating-shadow) !important; }
  }
}
#mobileMenu .mobile-menu-drawer {
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#mobileMenu .mobile-menu-drawer::-webkit-scrollbar { display: none; width: 0; height: 0; }
@media (min-width: 1181px) {
  #instrumentariumForm {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  #instrumentariumForm > .rights-confirmation,
  #instrumentariumForm > .profile-links { grid-column: 1 / -1; }
}

/* September 18: requested system typography, compact copy and containment. */
html body, html body *, html body *::before, html body *::after {
  font-family: Georgia, "Times New Roman", serif !important;
}
#routeEyebrow:empty, #routeTitle:empty, #routeSubtitle:empty,
#sectionEyebrow:empty, #sectionTitle:empty { display: none; }
.feed-column > .section-head:has(#sectionEyebrow:empty):has(#sectionTitle:empty) { display: none; }
.upload-catalog-picker, .upload-catalog-picker select { min-width: 0; max-width: 100%; width: 100%; box-sizing: border-box; }
body > #followListModal:not(.is-hidden), body > #buyModal:not(.is-hidden),
body > #curatedRemovalModal:not(.is-hidden), body > #reportModal:not(.is-hidden) {
  top: 0 !important;
  overscroll-behavior: none !important;
}
#followListModal > [role="dialog"], #buyModal > [role="dialog"],
#curatedRemovalModal > [role="dialog"], #reportModal > [role="dialog"] { overscroll-behavior: none !important; }
#curatedRemovalForm input[name="email"]::placeholder { color: #999; opacity: 1; }

@media (min-width: 1181px) {
  .workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 310px); column-gap: clamp(20px, 2.4vw, 38px); row-gap: 24px; align-items: start; }
  .workspace > .topbar, .workspace > .content-grid { display: contents; }
  .topbar > div:first-child { grid-column: 1; grid-row: 1; min-height: var(--desktop-controls-height, 146px); }
  .feed-column { grid-column: 1; grid-row: 2; min-width: 0; }
  .desktop-context-rail { grid-column: 2; grid-row: 1 / 3; position: sticky; top: 32px; height: calc(100vh - 50px); height: calc(100dvh - 50px); min-height: 0; display: flex; flex-direction: column; }
  .desktop-context-rail > .topbar-tools { flex: 0 0 auto; width: 100%; min-width: 0; max-width: 100%; align-self: stretch; }
  .desktop-context-rail > .topbar-tools .search-wrap { min-width: 0; width: 100%; max-width: 100%; box-sizing: border-box; }
  .desktop-context-rail > .topbar-tools .search-wrap input { min-width: 0; width: 100%; max-width: 100%; box-sizing: border-box; }
  .desktop-context-rail > .insight-column { position: relative !important; top: auto !important; flex: 1 1 auto; min-height: 0; max-height: none !important; overflow-y: auto !important; padding-bottom: 18px; }
}

/* Hide only the Search frame, retaining its border space and dimensions. */
.topbar-tools .search { border-color: transparent; }

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  #feedList .instrument-card[data-floating-kind] { transform: none !important; }
  #feedList .instrument-card .instrument-product-media { overflow: hidden; }
  #feedList .instrument-card .instrument-product-media img.shelf-fixed-image-frame {
    transform: scale(1);
    transform-origin: center;
    clip-path: inset(calc(50% - var(--shelf-half-y)) calc(50% - var(--shelf-half-x)));
    transition: transform 420ms var(--floating-ease), clip-path 420ms var(--floating-ease);
  }
  html:not(.floating-touch-input) #feedList .instrument-card:hover .instrument-product-media img.shelf-fixed-image-frame {
    transform: scale(1.06);
    clip-path: inset(calc(50% - var(--shelf-half-y) / 1.06) calc(50% - var(--shelf-half-x) / 1.06));
  }
}

/* Let the Menu count grow inward for multi-digit totals without changing its font. */
#mobileMenuBadge:not([hidden]), #tabletMenuBadge:not([hidden]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  box-sizing: border-box;
  border-radius: 999px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

/* Three mobile profile tabs per row; optional Admin occupies the last cell. */
@media (max-width: 620px) {
  .profile-tabs { display: grid; grid-template-columns: 1fr 0.85fr 1.65fr; }
  .profile-tabs button { min-width: 0; padding-inline: 6px; font-size: clamp(12px, 3.5vw, 14px); white-space: nowrap; }
}

/* Only pages whose redundant large heading was removed reclaim its space. */
.topbar:has(#routeTitle:empty) #routeSubtitle { margin-bottom: 0; }
.topbar:has(#routeTitle:empty):has(#routeSubtitle:empty) #routeEyebrow { margin-bottom: 0; }
@media (min-width: 1181px) {
  .workspace:has(#routeTitle:empty) { grid-template-rows: min-content minmax(0, 1fr); }
  .topbar:has(#routeTitle:empty) > div:first-child { min-height: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  #feedList.directory-grid > .product-card[data-floating-kind="product"] { transform: none !important; }
  #feedList.directory-grid > .product-card .product-media { overflow: hidden !important; }
  #feedList.directory-grid > .product-card .product-media .floating-inner-image { transform: scale(1); transform-origin: center; transition: transform 420ms var(--floating-ease), clip-path 420ms var(--floating-ease); }
  #feedList.directory-grid > .product-card .shelf-fixed-image-frame { clip-path: inset(calc(50% - var(--shelf-half-y)) calc(50% - var(--shelf-half-x))); }
  #feedList.directory-grid > .product-card.is-floating-active .product-media .floating-inner-image { transform: scale(1.06); }
  #feedList.directory-grid > .product-card.is-floating-active .shelf-fixed-image-frame { clip-path: inset(calc(50% - var(--shelf-half-y) / 1.06) calc(50% - var(--shelf-half-x) / 1.06)); }
  @media (hover: hover) and (pointer: fine) {
    html:not(.floating-touch-input) #feedList.directory-grid > .product-card:hover .product-media .floating-inner-image { transform: scale(1.06); }
    html:not(.floating-touch-input) #feedList.directory-grid > .product-card:hover .shelf-fixed-image-frame { clip-path: inset(calc(50% - var(--shelf-half-y) / 1.06) calc(50% - var(--shelf-half-x) / 1.06)); }
  }
}
