/* Tobi's Tech: shared Barlow roles. Content hierarchy is separate from controls.
   Only legacy editorial/product heading sizes need a scoped important override. */
html:root body:is(
  .tt-storefront,
  .tt-design-preview,
  .tt-room-preview,
  :has(.tt-type-scope, .tts-hero, .ttr, .ttki, .tt-studio-title, .tt-studio-product-nav)
) {
  --tt-type-family: var(--font-body-family, "Barlow", system-ui, sans-serif);
  --tt-type-hero: 64px;
  --tt-type-page: 48px;
  --tt-type-category: 40px;
  --tt-type-product: 42px;
  --tt-type-section: 32px;
  --tt-type-detail: 24px;
  --tt-type-h1: var(--tt-type-page);
  --tt-type-h2: var(--tt-type-section);
  --tt-type-h3: var(--tt-type-detail);
  --tt-type-copy: 18px;
  --tt-type-lead: var(--tt-type-copy);
  --tt-type-price: 30px;
  --tt-type-action: 16px;
  --tt-type-dense: 15px;
  --tt-type-note: 15px;
  --font-heading-family: var(--tt-type-family);
  --font-heading-card-family: var(--tt-type-family);
  --font-text-card-family: var(--tt-type-family);
  --font-subtitle-family: var(--tt-type-family);
  --font-button-family: var(--tt-type-family);
  --font-header-menu-family: var(--tt-type-family);
  --font-footer-menu-family: var(--tt-type-family);
  --font-popups-heading-family: var(--tt-type-family);
  --font-popups-text-family: var(--tt-type-family);
  --font-body-weight: 400;
  --font-heading-weight: 600;
  --font-heading-card-weight: 600;
  --font-button-weight: 600;
  --font-header-menu-weight: 600;
  --font-footer-menu-weight: 400;
  --font-heading-letter-spacing: -.02em;
  font-family: var(--tt-type-family);
  font-size: var(--tt-type-copy);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;

  @media (max-width: 749px) {
    --tt-type-hero: 40px;
    --tt-type-page: 32px;
    --tt-type-category: 32px;
    --tt-type-product: 32px;
    --tt-type-section: 26px;
    --tt-type-detail: 22px;
    --tt-type-copy: 17px;
    --tt-type-price: 28px;
  }

  /* Do not replace symbolic icon fonts. */
  & :is(.tts, .tt-compare, .tts-system, .ttr, .ttki, .tt-studio-product-nav,
        .tt-studio-inquiry, .product, .detail, .design-tools, .local-contact,
        header, footer, nav, h1, h2, h3, h4, h5, h6, p, li, dd, dt, th, td,
        figcaption, label, legend, summary, button, input, textarea, select,
        .header__menu-item, .menu-drawer__menu-item, .price-item, .button) {
    font-family: var(--tt-type-family);
  }
  & :where(main, #MainContent) :is(h1, h2, h3, h4) {
    font-family: var(--tt-type-family);
    font-style: normal;
    font-weight: 600;
    letter-spacing: -.02em;
    overflow-wrap: break-word;
    word-break: normal;
    text-transform: none;
  }
  & :is(main, #MainContent) h1 {
    font-size: var(--tt-type-page);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.025em;
    text-wrap: balance;
    -webkit-hyphens: auto;
    hyphens: auto;
  }
  & :is(main, #MainContent) .tts-hero .tts-hero-copy h1 {
    font-size: var(--tt-type-hero);
    line-height: 1.08;
    -webkit-hyphens: none;
    hyphens: none;
  }
  & :is(main, #MainContent) .collection-hero__title {
    font-size: var(--tt-type-category);
  }
  & :is(main, #MainContent) .product :is(.product__title, .tt-studio-title) {
    font-size: var(--tt-type-product);
    line-height: 1.12;
    letter-spacing: -.025em;
    overflow-wrap: break-word;
    -webkit-hyphens: none;
    hyphens: none;
  }
  & :is(main, #MainContent) .card__title .tt-card-title__main {
    display: block;
    font: inherit;
    letter-spacing: inherit;
  }
  & :is(main, #MainContent) .card__title .tt-card-title__details {
    display: block;
    margin-top: 7px;
    color: var(--kb-muted, #c4c1bb);
    font: 400 15px/1.45 var(--tt-type-family);
    letter-spacing: 0;
  }
  & .tts .tts-hero-copy h1 em {
    font: inherit;
    letter-spacing: inherit;
  }

  /* Section headings are opt-in: filters, counts and dialogs retain their roles. */
  & :is(main, #MainContent) :is(.tts, .tt-home, .tt-compare, .tts-system, .ttki, .ttr) h2,
  & :is(main, #MainContent) :is(.tt-studio-inquiry__intro h2,
        .product-recommendations__heading, .contact-form__title) {
    font-size: var(--tt-type-section);
    line-height: 1.2;
    letter-spacing: -.02em;
    text-wrap: balance;
  }
  & :is(main, #MainContent) .rte :is(h2, h3, h4),
  & :is(main, #MainContent) :is(.tts, .tt-home, .tt-compare, .tts-system, .ttki, .ttr) :is(h3, h4),
  & :is(main, #MainContent) .about__title {
    font-size: var(--tt-type-detail);
    line-height: 1.25;
    letter-spacing: -.015em;
    text-wrap: balance;
  }
  /* Page-authored important sizes and product inline styles are deliberately scoped. */
  & :is(main, #MainContent) .rte :is(.tt-editorial, .tt-ref) h2 {
    font-size: var(--tt-type-section) !important;
    line-height: 1.2;
    letter-spacing: -.02em;
  }
  & :is(main, #MainContent) .rte :is(.tt-editorial, .tt-ref) :is(h3, h4) {
    font-size: var(--tt-type-detail) !important;
    line-height: 1.25;
  }
  &.template-product :is(main, #MainContent)
    :is(.about__accordion-description, .product__description, .product-description-full, .product-description-short)
    :is(h2, h3, h4) {
    font-size: var(--tt-type-detail) !important;
    line-height: 1.25 !important;
    font-weight: 600 !important;
    letter-spacing: -.015em !important;
  }
  &.template-product :is(main, #MainContent)
    :is(.about__accordion-description, .product__description, .product-description-full, .product-description-short)
    p:not(table p) {
    font-size: var(--tt-type-copy) !important;
    line-height: 1.6 !important;
    font-weight: 400 !important;
  }
  & :where(main, #MainContent) :is(h1, h2, h3, h4) > p {
    font: inherit;
    letter-spacing: inherit;
  }
  & :where(main, #MainContent) p:not(h1 > p, h2 > p, h3 > p, h4 > p) {
    font-size: var(--tt-type-copy);
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0;
  }
  & :is(main, #MainContent) .rte :is(.tt-editorial, .tt-ref) :is(p, li),
  & :is(.tts-hero .tts-hero-copy > p, .ttki .ttki__intro, .ttr .ttr__intro > p,
        .intro > p, .local-contact-body > p:first-of-type, .model-type,
        .tt-studio-title-detail, .tt-studio-product-kind) {
    font-size: var(--tt-type-copy);
    line-height: 1.6;
  }
  & :is(.tts-price, .price-line strong, .tt-compare__price, .price-wrapper .price-item:not(s)),
  & .product:has(.tt-studio-title) .price--product :is(.price__regular,.price__sale) > dd > .price-item:not(s) {
    font-family: var(--tt-type-family);
    font-size: var(--tt-type-price);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -.018em;
    font-variant-numeric: lining-nums tabular-nums;
  }
  & :where(main, #MainContent) :is(th, td, .tt-compare__spec dt, .tt-compare__spec dd,
        .specblock dt, .specblock dd, .ttki__messages p, .ttki__examples p,
        .tts-system__copy p, .product__info-container .tt-delivery p,
        .product__info-container .tt-studio-delivery, .detail .delivery,
        .detail .variant-hint, .product-form__group-name, .product-form__group-name span) {
    font-size: var(--tt-type-dense);
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0;
  }
  & :where(main, #MainContent) :is(th, .tt-compare__spec dd, .product-form__group-name) {
    font-weight: 600;
  }
  & :where(main, #MainContent) :is(table, dl) {
    font-variant-numeric: lining-nums tabular-nums;
  }
  & :where(main, #MainContent) :is(figcaption, .tts-image-caption, .tts-pricenote,
        .tt-compare__note, .tts-price small, .price-line span, .shipping-note,
        .product__tax, .tt-product-note, .tt-consult__hint, .unit-price, .tt-energy-links a,
        .ttr__source > span, .component .availability,
        .ttr__brand, .component .brand, .ttki__dialog-head > p, .ttki__messages li > span) {
    font-size: var(--tt-type-note);
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0;
  }
  & .tt-legal-bar {
    font-size: var(--tt-type-note);
    line-height: 1.5;
  }
  & :where(main, #MainContent) :is(.ttki__dialog-head > p, .ttki__messages li > span, .component .brand, .ttr__brand) {
    font-weight: 600;
  }
  & :is(.tts-action, .tts-line, .tts-group, .tt-compare__link, .ttki__actions a,
        .tts-system__consult, .ttr__nav a, .ttr__source a, .ttr__case a,
        .tt-studio-inquiry__actions button, .tt-studio-ask, .mailbutton,
        .shopbutton, .detail-actions .ask, .filter, .component .source, .case-study a,
        .product-form__submit, .product-form__controls-group label, #variant-options button,
        .contact-form button, .contact__button button, .tt-editorial__cta, .tt-ref__cta, .button) {
    font-family: var(--tt-type-family);
    font-size: var(--tt-type-action);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
  }
  & :is(.tt-studio-inquiry__form, .contact-form, .contact) :is(input:not([type=checkbox]), select, textarea) {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.45;
  }
  & :is(.tt-studio-inquiry__form, .contact-form, .contact) label {
    font-size: var(--tt-type-dense);
    line-height: 1.4;
    font-weight: 600;
  }
  & :is(.tt-cinema-desktop, .tt-cinema-menu) :is(a, summary),
  & :is(.topbar .navlinks a, .bar a, .header__menu-item, .menu-drawer__menu-item,
        .header__inline-menu a, .tt-studio-product-nav, .crumb) {
    font-family: var(--tt-type-family);
    font-size: var(--tt-type-action);
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0;
  }
  @media (min-width: 1200px) {
    & .tt-cinema-desktop > a,
    & .tt-cinema-desktop > .tt-cinema-dropdown > summary {
      white-space: nowrap;
    }
  }
  @media (min-width: 1200px) and (max-width: 1399px) {
    & .tt-cinema-desktop { gap: 20px; }
  }
  /* The absolute sorting controls can occupy two 60px rows; reserve their space. */
  @media (min-width: 990px) {
    &.template-collection #MainContent .collection-wrapper > .facets__top {
      min-height: 120px !important;
    }
  }
  & :is(footer, .footer, .foot) :is(p, a, summary, small),
  & :is(.footer, .foot, .design-tools-title, .design-tools button, .design-tools .system-preview) {
    font-family: var(--tt-type-family);
    font-size: var(--tt-type-note);
    line-height: 1.5;
    letter-spacing: 0;
  }
  & :is(footer, .footer) :is(h2, h3, h4, .footer-block__heading) {
    font-size: var(--tt-type-action);
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.35;
  }
}

