/*
 * Badaael Product UI Layer
 * Converts shared templates from content-first pages to task-first interfaces.
 */

body.badaael-product-ui {
  --bp-task-max: 1180px;
  --bp-task-gap: clamp(1rem, 2vw, 1.5rem);
  --bp-task-pad: clamp(1rem, 2.4vw, 1.75rem);
  --bp-result-bg: #ffffff;
  --bp-support-bg: #f7faf8;
  --bp-action-bg: #fff7ed;
}

body.badaael-product-ui :where(.sarkosa-page, .sarkosa-tool-page, .wrap.section, .dk-page, .dn-content, .tameensa-main) {
  padding-block-start: clamp(1rem, 2vw, 1.75rem);
}

body.badaael-product-ui :where(.sarkosa-content__header, .stp-tool__header, .article-header, .dk-single-header, .dk-archive-header, .dn-page-header, .tameensa-hero, .tameensa-page-header) {
  background: linear-gradient(180deg, #ffffff 0%, var(--bd-color-surface-soft) 100%);
  border: 1px solid var(--bd-color-border);
  border-radius: var(--bd-radius-lg);
  box-shadow: var(--bd-shadow-card);
  color: var(--bd-color-text);
  display: grid;
  gap: 0.75rem;
  margin-block-end: var(--bp-task-gap);
  padding: var(--bp-task-pad);
}

body.badaael-product-ui :where(.sarkosa-content__header, .stp-tool__header, .article-header, .dk-single-header, .dk-archive-header, .dn-page-header, .tameensa-hero, .tameensa-page-header) h1 {
  margin-block-end: 0;
  max-width: 900px;
}

body.badaael-product-ui :where(.sarkosa-content__header, .stp-tool__header, .article-header, .dk-single-header, .dk-archive-header, .dn-page-header, .tameensa-hero, .tameensa-page-header) p {
  color: var(--bd-color-muted);
  margin: 0;
  max-width: 860px;
}

body.badaael-product-ui :where(.stp-workspace, .sarkosa-home-hero__grid, .hero-inner, .dk-hero-grid, .dn-hero > .dn-wrap, .tameensa-workspace, .tameensa-archive-grid, .tameensa-single-layout) {
  align-items: start;
  display: grid;
  gap: var(--bp-task-gap);
}

body.badaael-product-ui :where(.stp-workspace, .sarkosa-home-hero__grid, .dk-hero-grid, .dn-hero > .dn-wrap, .tameensa-single-layout) {
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
}

body.badaael-product-ui :where(.stp-workspace__inputs, .stp-calculator, .archive-search, .hero-search, .single-search, .sarkosa-product-input, .dk-task-search, .dk-hero-search, .dn-product-input, .dn-section.alt, .tameensa-search-panel, .tameensa-contact-form, form[role="search"]) {
  background: var(--bd-color-surface);
  border: 1px solid var(--bd-color-border);
  border-radius: var(--bd-radius);
  box-shadow: var(--bd-shadow-card);
  padding: clamp(0.875rem, 2vw, 1.25rem);
}

body.badaael-product-ui :where(.action-row, .hero-actions, .dn-actions, .tameensa-actions, .stp-actions, .stp-result-actions) {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-block: 0 1rem;
}

body.badaael-product-ui :where(.stp-workspace__result, .stp-result, .card-grid, .topic-grid, .sarkosa-grid, .dk-grid, .dk-directory-grid, .dn-list, .dn-grid, .tameensa-card-grid, .tameensa-results) {
  margin-block: var(--bp-task-gap);
}

body.badaael-product-ui :where(.stp-workspace__result, .stp-result, .dk-hero-panel, .dn-status-panel, .tameensa-result-panel, .mdd-meta-panel, .content-meta-panel) {
  background: var(--bp-result-bg);
  border: 1px solid var(--bd-color-border);
  border-radius: var(--bd-radius);
  box-shadow: var(--bd-shadow-card);
  padding: clamp(1rem, 2vw, 1.5rem);
}

body.badaael-product-ui :where(.article-shell, .dk-single, .dn-content, .sarkosa-content, .stp-tool, .tameensa-single) {
  display: grid;
  gap: var(--bp-task-gap);
}

body.badaael-product-ui :where(.article-content, .dk-content, .dn-content > :where(p, h2, h3, ul, ol, table), .sarkosa-content__body, .stp-content, .tameensa-content) {
  background: var(--bd-color-surface);
  border: 1px solid var(--bd-color-border);
  border-radius: var(--bd-radius);
  box-shadow: var(--bd-shadow-card);
  padding: clamp(1rem, 2vw, 1.5rem);
}

body.badaael-product-ui :where(.stp-task-source, .stp-task-support, .source-box, .review-box, .related-content, .disclaimer-box, .notice, .dk-disclaimer, .dk-related, .dn-card.alignwide, .tameensa-support, .tameensa-related) {
  background: var(--bp-support-bg);
  border: 1px solid var(--bd-color-border);
  border-radius: var(--bd-radius);
  box-shadow: none;
  margin-block-start: 0;
  padding: clamp(0.875rem, 1.8vw, 1.25rem);
}

body.badaael-product-ui :where(.card-grid, .topic-grid, .sarkosa-grid, .dk-grid, .dk-directory-grid, .dn-grid, .dn-list, .tameensa-card-grid) {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.badaael-product-ui :where(.content-card, .topic-card, .sarkosa-card, .dk-card, .dn-card, .tameensa-card) {
  min-height: 100%;
}

body.badaael-product-ui :where(input, select, textarea) {
  inline-size: 100%;
}

body.badaael-product-ui :where(.stp-workspace-field-grid, .form-grid, .tameensa-form-grid) {
  display: grid;
  gap: 0.875rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.badaael-product-ui :where(.stp-field--full, textarea, .field-full) {
  grid-column: 1 / -1;
}

body.badaael-product-ui :where(.article-content, .dk-content, .dn-content, .sarkosa-content__body, .tameensa-content) > :first-child {
  margin-block-start: 0;
}

body.badaael-product-ui :where(.article-content, .dk-content, .dn-content, .sarkosa-content__body, .tameensa-content) > :last-child {
  margin-block-end: 0;
}

body.badaael-product-ui :where(.article-content h2, .dk-content h2, .dn-content h2, .sarkosa-content__body h2, .tameensa-content h2) {
  border-block-start: 1px solid var(--bd-color-border);
  margin-block-start: 1.5rem;
  padding-block-start: 1rem;
}

body.badaael-product-ui :where(.article-content h2:first-child, .dk-content h2:first-child, .dn-content h2:first-child, .sarkosa-content__body h2:first-child, .tameensa-content h2:first-child) {
  border-block-start: 0;
  margin-block-start: 0;
  padding-block-start: 0;
}

body.badaael-product-ui :where(.dk-primary-action, .mdd-primary-action, .dn-actions, .tameensa-primary-action) {
  order: 2;
}

body.badaael-product-ui :where(.single-search, .archive-search, .hero-search, .sarkosa-product-input, .dk-task-search, .dk-hero-search, .dn-product-input, .dn-section.alt) {
  order: 3;
}

body.badaael-product-ui :where(.sarkosa-product-input, .dk-task-search, .dn-product-input) {
  margin-block: 0 var(--bp-task-gap);
}

body.badaael-product-ui :where(.sarkosa-product-input form, .dk-task-search form, .dn-product-input form) {
  align-items: end;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

body.badaael-product-ui :where(.article-content, .dk-content, .dn-content, .sarkosa-content__body, .tameensa-content) {
  order: 4;
}

@media (max-width: 1024px) {
  body.badaael-product-ui :where(.stp-workspace, .sarkosa-home-hero__grid, .dk-hero-grid, .dn-hero > .dn-wrap, .tameensa-single-layout) {
    grid-template-columns: 1fr;
  }

  body.badaael-product-ui :where(.card-grid, .topic-grid, .sarkosa-grid, .dk-grid, .dk-directory-grid, .dn-grid, .dn-list, .tameensa-card-grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body.badaael-product-ui :where(.card-grid, .topic-grid, .sarkosa-grid, .dk-grid, .dk-directory-grid, .dn-grid, .dn-list, .tameensa-card-grid, .stp-workspace-field-grid, .form-grid, .tameensa-form-grid) {
    grid-template-columns: 1fr;
  }

  body.badaael-product-ui :where(.sarkosa-content__header, .stp-tool__header, .article-header, .dk-single-header, .dk-archive-header, .dn-page-header, .tameensa-hero, .tameensa-page-header) {
    padding: 1rem;
  }
}

body.badaael-product-ui .badaael-link-graph {
  margin-block: clamp(1.25rem, 3vw, 2rem);
  padding-inline: clamp(1rem, 3vw, 2rem);
}

body.badaael-product-ui .badaael-link-graph__inner {
  background: color-mix(in srgb, var(--bd-surface, #ffffff) 92%, var(--bd-accent, #f97316) 8%);
  border: 1px solid var(--bd-border, rgba(15, 23, 42, 0.12));
  border-radius: var(--bd-radius-lg, 18px);
  box-shadow: var(--bd-shadow-sm, 0 12px 32px rgba(15, 23, 42, 0.08));
  inline-size: min(100%, var(--bd-container, 1180px));
  margin-inline: auto;
  padding: clamp(1rem, 2.4vw, 1.5rem);
}

body.badaael-product-ui .badaael-link-graph__header {
  margin-block-end: 1rem;
}

body.badaael-product-ui .badaael-link-graph__header p {
  color: var(--bd-accent, #c65300);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 0.25rem;
}

body.badaael-product-ui .badaael-link-graph__header h2 {
  color: var(--bd-text, #101827);
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

body.badaael-product-ui .badaael-link-graph__grid {
  display: grid;
  gap: 0.875rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.badaael-product-ui .badaael-link-graph__group {
  background: var(--bd-surface, #ffffff);
  border: 1px solid var(--bd-border, rgba(15, 23, 42, 0.12));
  border-radius: var(--bd-radius-md, 14px);
  padding: 0.875rem;
}

body.badaael-product-ui .badaael-link-graph__group h3 {
  color: var(--bd-text, #101827);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 0.625rem;
}

body.badaael-product-ui .badaael-link-graph__group ul {
  display: grid;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

body.badaael-product-ui .badaael-link-graph__group a {
  align-items: center;
  border-radius: var(--bd-radius-sm, 10px);
  color: var(--bd-link, #0f5f58);
  display: flex;
  font-size: 0.9375rem;
  font-weight: 600;
  gap: 0.45rem;
  justify-content: space-between;
  line-height: 1.55;
  min-block-size: 42px;
  padding: 0.45rem 0.55rem;
  text-decoration: none;
}

body.badaael-product-ui .badaael-link-graph__group a::after {
  background: color-mix(in srgb, var(--bd-link, #0f5f58) 14%, transparent);
  border-radius: 999px;
  color: var(--bd-link, #0f5f58);
  content: "←";
  display: inline-grid;
  flex: 0 0 auto;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.875rem;
  inline-size: 1.65rem;
  min-block-size: 1.65rem;
  place-items: center;
}

body.badaael-product-ui .badaael-link-graph__group a:hover {
  background: color-mix(in srgb, var(--bd-link, #0f5f58) 10%, transparent);
}

body.badaael-product-ui .badaael-link-graph__group a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--bd-accent, #f97316) 55%, transparent);
  outline-offset: 2px;
}

@media (max-width: 1024px) {
  body.badaael-product-ui .badaael-link-graph__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body.badaael-product-ui .badaael-link-graph__grid {
    grid-template-columns: 1fr;
  }
}

/* Sarkosa mobile tool containment */
@media (max-width: 820px) {
  html,
  body.sarkosa-theme,
  body.sarkosa-theme .sarkosa-main,
  body.sarkosa-theme .stp-template {
    max-inline-size: 100%;
    overflow-x: hidden;
  }

  body.badaael-product-ui .sarkosa-container,
  body.badaael-product-ui .stp-template,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow > *,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-workspace,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-task-support,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-tool-article-links {
    box-sizing: border-box !important;
    inline-size: min(100%, calc(100vw - 1rem)) !important;
    margin-inline: auto !important;
    max-inline-size: min(100%, calc(100vw - 1rem)) !important;
    min-inline-size: 0 !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-workspace,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-workspace:has(.stp-workspace__result[hidden]),
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-workspace-field-grid,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-result__items,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-actions.stp-workspace-actions,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-result-actions,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-tool-article-links {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-workspace__inputs,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-workspace__result {
    grid-column: 1 !important;
    inline-size: 100% !important;
    max-inline-size: 100% !important;
    position: static !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-detail,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__list,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__list li,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__list a,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-tool-article-links a {
    min-inline-size: 0 !important;
    max-inline-size: 100% !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__list {
    display: grid !important;
    gap: 0.45rem !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support {
    display: grid !important;
    gap: 0.5rem !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-detail--faq,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-tool-article-links {
    grid-column: 1 / -1 !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-detail > summary,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__list a,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-tool-article-links a {
    font-size: 0.9rem !important;
    line-height: 1.45 !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-number-control__buttons {
    inline-size: 40px !important;
    min-inline-size: 40px !important;
  }
}

@media (max-width: 440px) {
  body.badaael-product-ui .stp-tool.stp-tool--task-flow,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow > *,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-workspace,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-task-support,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-tool-article-links {
    inline-size: min(100%, calc(100vw - 0.75rem)) !important;
    max-inline-size: min(100%, calc(100vw - 0.75rem)) !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__list,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 360px) {
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__list,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Keep calculator support accordions and after-calculation links adjacent on usable mobile widths. */
@media (min-width: 380px) and (max-width: 820px) {
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-task-support {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support {
    align-items: start !important;
    display: grid !important;
    gap: 0.55rem !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    inline-size: 100% !important;
    max-inline-size: 100% !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support > .stp-reference-details {
    display: grid !important;
    gap: 0.55rem !important;
    grid-column: 1 !important;
    min-inline-size: 0 !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-details > .stp-reference-detail {
    grid-column: auto !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support > .stp-reference-detail {
    grid-column: 1 !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow.stp-tool--reference-layout .stp-reference-support:has(> .stp-reference-detail#stp-tool-faq) > .stp-reference-detail {
    grid-column: 1 !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support > .stp-reference-detail--faq {
    grid-column: 1 !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support > .stp-reference-links {
    align-self: start !important;
    block-size: auto !important;
    grid-column: 2 !important;
    grid-row: auto !important;
    max-block-size: none !important;
    overflow: visible !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support > .stp-tool-article-links {
    grid-column: 2 !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-detail > summary,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links h2,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__list a,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__group a,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-tool-article-links a {
    font-size: 0.84rem !important;
    line-height: 1.45 !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links h2 {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__grid {
    display: grid !important;
    gap: 0.4rem !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__group {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    display: grid !important;
    gap: 0.35rem !important;
    padding: 0 !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__group h3 {
    display: none !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__group ul {
    display: grid !important;
    gap: 0.35rem !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__group a {
    min-block-size: 34px !important;
    padding: 0.38rem 0.45rem !important;
    text-align: center !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__list {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (min-width: 560px) and (max-width: 820px) {
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__list {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Sarkosa final support layout: full-width mobile, balanced desktop. */
@media (max-width: 780px) {
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-task-support,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-details,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-tool-article-links {
    box-sizing: border-box !important;
    inline-size: 100% !important;
    max-inline-size: 100% !important;
    min-inline-size: 0 !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-task-support {
    padding-inline: clamp(0.75rem, 3vw, 1rem) !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support {
    display: grid !important;
    gap: 0.75rem !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support > .stp-reference-details,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support > .stp-reference-detail,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support > .stp-reference-links,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support > .stp-tool-article-links {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-details {
    display: grid !important;
    gap: 0.55rem !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-detail,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-tool-article-links {
    block-size: auto !important;
    max-block-size: none !important;
    overflow: visible !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-detail > summary,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links h2 {
    font-size: 0.95rem !important;
    line-height: 1.45 !important;
    text-align: center !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__list,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__grid,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-tool-article-links {
    display: grid !important;
    gap: 0.45rem !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__group {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__group h3 {
    display: none !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__group ul {
    display: grid !important;
    gap: 0.45rem !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links a,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-tool-article-links a {
    font-size: 0.88rem !important;
    line-height: 1.55 !important;
    min-block-size: 40px !important;
    text-align: center !important;
  }
}

@media (min-width: 781px) {
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-task-support {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-task-support > .stp-reference-support {
    grid-column: 1 / -1 !important;
    inline-size: 100% !important;
    max-inline-size: 100% !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support {
    align-items: start !important;
    display: grid !important;
    gap: clamp(0.85rem, 1.6vw, 1.1rem) !important;
    grid-template-columns: minmax(18rem, 0.9fr) minmax(0, 1.1fr) !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support > .stp-reference-details,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support > .stp-reference-detail {
    grid-column: 1 !important;
    min-inline-size: 0 !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support > .stp-reference-links {
    block-size: auto !important;
    grid-column: 2 !important;
    grid-row: auto !important;
    max-block-size: none !important;
    overflow: visible !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support > .stp-tool-article-links {
    grid-column: 1 / -1 !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links__list {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Sarkosa global block centering: final loaded layer. */
body.badaael-product-ui :where(.sarkosa-container, .stp-template > .stp-tool) {
  box-sizing: border-box !important;
  inline-size: min(var(--sarkosa-container, 1180px), calc(100% - 32px)) !important;
  margin-inline: auto !important;
  max-inline-size: var(--sarkosa-container, 1180px) !important;
}

body.badaael-product-ui.home .sarkosa-hero__grid.sarkosa-home-first-view {
  align-items: start !important;
  display: grid !important;
  gap: clamp(1.1rem, 2vw, 1.8rem) !important;
  grid-template-columns: minmax(320px, 0.95fr) minmax(380px, 1.05fr) !important;
  inline-size: min(var(--sarkosa-container, 1180px), calc(100% - 32px)) !important;
  justify-content: center !important;
  margin-inline: auto !important;
  max-inline-size: var(--sarkosa-container, 1180px) !important;
}

body.badaael-product-ui.home .sarkosa-home-number-panel,
body.badaael-product-ui.home .sarkosa-home-search-zone {
  align-self: start !important;
  box-sizing: border-box !important;
  display: grid !important;
  inline-size: 100% !important;
  justify-content: center !important;
  margin-inline: auto !important;
  min-inline-size: 0 !important;
}

body.badaael-product-ui.home .sarkosa-home-number-panel {
  grid-column: 1 !important;
  grid-row: 1 !important;
}

body.badaael-product-ui.home .sarkosa-home-search-zone {
  grid-column: 2 !important;
  grid-row: 1 !important;
}

body.badaael-product-ui.home .sarkosa-home-number-panel > :where(.sarkosa-result-sample, .sarkosa-home-metrics, .sarkosa-decision-steps) {
  inline-size: min(100%, 430px) !important;
  margin-inline: auto !important;
}

body.badaael-product-ui.home .sarkosa-home-search-zone > :where(.sarkosa-home-search, .sarkosa-home-title-block, .sarkosa-home-quick-categories) {
  inline-size: min(100%, 620px) !important;
  margin-inline: auto !important;
}

body.badaael-product-ui.home :where(.sarkosa-knowledge, .sarkosa-knowledge__links) {
  box-sizing: border-box !important;
  inline-size: min(var(--sarkosa-container, 1180px), calc(100% - 32px)) !important;
  margin-inline: auto !important;
}

body.badaael-product-ui .stp-tool.stp-tool--task-flow {
  box-sizing: border-box !important;
  inline-size: min(var(--sarkosa-container, 1180px), calc(100% - 32px)) !important;
  margin-inline: auto !important;
  max-inline-size: var(--sarkosa-container, 1180px) !important;
}

body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-workspace,
body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-task-support,
body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support {
  box-sizing: border-box !important;
  inline-size: 100% !important;
  margin-inline: auto !important;
  max-inline-size: 100% !important;
}

body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-workspace {
  align-items: start !important;
  justify-content: center !important;
}

body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-workspace__inputs,
body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-workspace__result,
body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-details,
body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-links,
body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-tool-article-links,
body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-content-block {
  box-sizing: border-box !important;
  inline-size: 100% !important;
  margin-inline: auto !important;
  min-inline-size: 0 !important;
}

body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-task-support {
  justify-items: center !important;
}

body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support {
  justify-content: center !important;
}

body.badaael-product-ui :where(.stp-layout, .stp-content, .stp-content-block, .stp-panel, .stp-info-bar, .stp-tool-grid, .stp-hub-grid, .stp-guide-links, .stp-link-network, .stp-link-network__grid, .sarkosa-related-content, .article-content) {
  box-sizing: border-box !important;
  margin-inline: auto !important;
  max-inline-size: 100% !important;
}

body.badaael-product-ui :where(.stp-layout, .stp-link-network, .sarkosa-related-content) {
  inline-size: min(100%, var(--sarkosa-container, 1180px)) !important;
}

@media (max-width: 1080px) {
  body.badaael-product-ui.home .sarkosa-hero__grid.sarkosa-home-first-view {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.badaael-product-ui.home .sarkosa-home-search-zone,
  body.badaael-product-ui.home .sarkosa-home-number-panel {
    grid-column: 1 !important;
    inline-size: min(100%, 760px) !important;
  }

  body.badaael-product-ui.home .sarkosa-home-search-zone {
    grid-row: 1 !important;
  }

  body.badaael-product-ui.home .sarkosa-home-number-panel {
    grid-row: 2 !important;
  }
}

@media (max-width: 780px) {
  body.badaael-product-ui :where(.sarkosa-container, .stp-template > .stp-tool),
  body.badaael-product-ui.home .sarkosa-hero__grid.sarkosa-home-first-view,
  body.badaael-product-ui.home :where(.sarkosa-knowledge, .sarkosa-knowledge__links),
  body.badaael-product-ui .stp-tool.stp-tool--task-flow {
    inline-size: min(100%, calc(100vw - 20px)) !important;
  }

  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-workspace,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-task-support,
  body.badaael-product-ui .stp-tool.stp-tool--task-flow .stp-reference-support {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* SARKOSA FINAL MOBILE NAV WIDTH FIX */
@media (max-width: 760px) {
  body.badaael-product-ui.sarkosa-theme .sarkosa-nav,
  body.badaael-product-ui.sarkosa-theme .sarkosa-nav.is-open {
    gap: 0.16rem !important;
    justify-content: space-between !important;
    overflow-x: hidden !important;
  }

  body.badaael-product-ui.sarkosa-theme .sarkosa-nav a {
    flex: 0 1 auto !important;
    font-size: 0.66rem !important;
    inline-size: auto !important;
    max-inline-size: none !important;
    min-inline-size: 0 !important;
    padding-inline: 0.36rem !important;
    width: auto !important;
  }
}

@media (max-width: 380px) {
  body.badaael-product-ui.sarkosa-theme .sarkosa-nav a {
    font-size: 0.6rem !important;
    padding-inline: 0.28rem !important;
  }
}
/* END SARKOSA FINAL MOBILE NAV WIDTH FIX */
