/* Shared mobile safeguards for every page template. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
video,
canvas,
svg {
  max-width: 100%;
}

@media screen and (max-width: 640px) {
  /* Product groups stay compact, scannable tiles on mobile. */
  .category-tiles,
  .marking-page .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .category-tile,
  .category-more {
    width: 100%;
    min-height: 118px;
    padding: 16px;
    border-radius: 18px;
  }

  .category-tile i {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .category-tile span {
    font-size: 13px;
    line-height: 1.25;
  }

  .category-more {
    grid-column: span 2 !important;
    font-size: 14px;
  }

  .marking-page .category-card {
    width: 100%;
    min-height: 150px;
    padding: 14px 10px;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    text-align: center;
  }

  .marking-page .category-card__image {
    width: 68px;
    height: 68px;
    margin: 0 auto 10px;
  }

  .marking-page .category-card h3 {
    font-size: 13px;
    line-height: 1.25;
  }

  .home-system__core > div {
    width: 150px;
    text-align: center;
  }

  .home-system__core strong {
    display: block;
    line-height: 0.95;
  }

  .home-system__core span {
    width: 140px;
    margin: 10px auto 0;
    font-size: 11px;
    line-height: 1.25;
    white-space: normal;
  }

  .home-hero__grid,
  .product-hero__grid,
  .content-hero__grid,
  .category-landing-hero__grid,
  .role-detail__hero-grid,
  .final-cta__inner,
  .product-final__box,
  .content-cta {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .home-hero__grid > *,
  .product-hero__grid > *,
  .content-hero__grid > *,
  .category-landing-hero__grid > *,
  .role-detail__hero-grid > *,
  .product-heading > *,
  .content-heading > *,
  .section-heading > * {
    min-width: 0;
    max-width: 100%;
  }

  .final-cta__inner > *,
  .product-final__box > *,
  .content-cta > * {
    min-width: 0;
    max-width: 100%;
  }

  .home-hero h1,
  .product-hero h1,
  .content-hero h1,
  .category-landing-hero h1,
  .role-detail__hero h1,
  .product-heading h2,
  .content-heading h2,
  .section-heading h2 {
    max-width: 100%;
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  .final-cta h2,
  .product-final h2,
  .content-cta h2 {
    max-width: 100%;
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  .home-hero__actions,
  .product-actions,
  .content-actions,
  .category-landing-actions,
  .hero__actions,
  .final-cta__actions,
  .product-final__actions,
  .content-cta__actions,
  .product-proof {
    min-width: 0;
    max-width: 100%;
  }

  .final-cta__actions > *,
  .product-final__actions > *,
  .content-cta__actions > * {
    max-width: 100%;
  }

  .product-visual,
  .product-visual__window,
  .product-visual__bar,
  .product-visual__body,
  .product-visual__rows,
  .product-visual__row {
    min-width: 0;
    max-width: 100%;
  }

  .product-visual__brand {
    min-width: 0;
    max-width: calc(100% - 46px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .product-visual__row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .product-visual__row > span {
    display: none;
  }

  .marking-page .container,
  .category-landing-page .container {
    max-width: calc(100% - 28px);
  }

  #rec1379951091 .tn-elem[data-elem-id="1734615831935"] {
    left: calc(50% - 160px + 20px) !important;
    width: 280px !important;
  }

  #rec1379951091 .tn-elem[data-elem-id="1734615831935"] .tn-atom {
    font-size: 25px !important;
    line-height: 1.08 !important;
    letter-spacing: -1px !important;
  }

  .cit-lead-dialog,
  .cit-lead-card,
  .cit-lead-form,
  .cit-lead-success {
    max-width: 100%;
  }

  /* Repeated page content uses the same compact 2×N rhythm on mobile. */
  .solutions-grid,
  .process-grid,
  .competencies-grid,
  .all-solutions,
  .office-grid,
  .equipment-list,
  .certificates-grid,
  .certificate-product-group .certificates-grid,
  .agent-steps,
  .agent-products,
  .agent-audience,
  .agent-rules,
  .agent-flow,
  .agent-grades__grid,
  .agent-trust__stats,
  .product-audiences,
  .product-benefits,
  .product-capabilities,
  .product-process,
  .product-process--full,
  .product-scope-grid,
  .product-trust__stats,
  .product-guides,
  .challenge-grid,
  .solution-grid,
  .result-grid,
  .project-grid,
  .ref-step-grid,
  .ref-difference,
  .marking-page .benefits-bar,
  .marking-page .role-grid,
  .marking-page .package-grid,
  .marking-page .problem-grid,
  .marking-page .extras,
  .marking-page .why-layout,
  .marking-page .workflow__body,
  .marking-page .category-modal__timeline,
  .marking-page .category-modal__roles,
  .marking-page .role-detail__steps,
  .marking-page .role-detail__cards,
  .category-landing-timeline,
  .category-landing-roles,
  .category-landing-process {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  /* Homepage and catalogue cards. */
  .solution-card,
  .process-step,
  .competence-card,
  .office-card,
  .solution-group {
    min-width: 0;
    min-height: 190px;
    padding: 16px;
    border-radius: 18px;
  }

  .solution-card h3,
  .process-step h3,
  .competence-card h3,
  .office-card h3 {
    margin-top: 24px;
    font-size: 17px;
    overflow-wrap: anywhere;
  }

  .solution-card p,
  .process-step p,
  .competence-card p,
  .office-card p {
    font-size: 11px;
    line-height: 1.45;
  }

  .solution-group {
    padding: 0;
  }

  .solution-group summary {
    min-height: 72px;
    padding: 14px;
    font-size: 14px;
  }

  .solution-group ul {
    padding: 0 14px 14px;
  }

  .certificate-card__preview,
  .certificate-product-group .certificate-card__preview {
    height: 190px;
    padding: 8px;
  }

  .certificate-card__label {
    min-height: 58px;
    padding: 10px;
    font-size: 10px;
    line-height: 1.25;
  }

  /* Agent programme: steps and grades stay readable in two columns. */
  .agent-steps article,
  .agent-products article,
  .agent-audience article,
  .agent-rules article,
  .agent-grades__grid article,
  .agent-trust__stats div {
    min-width: 0;
    min-height: 190px !important;
    padding: 16px !important;
    border-radius: 18px;
  }

  .agent-steps h3,
  .agent-products h3,
  .agent-audience h3 {
    margin: 26px 0 9px;
    font-size: 16px;
    line-height: 1.18;
    overflow-wrap: anywhere;
  }

  .agent-steps p,
  .agent-products p,
  .agent-audience p,
  .agent-rules p,
  .agent-grades__grid p {
    font-size: 11px;
    line-height: 1.45;
  }

  .agent-grades {
    padding: 20px 14px !important;
    border-radius: 22px;
  }

  .agent-grades__grid strong,
  .agent-grades__grid .agent-grade--accent strong,
  .agent-grades__grid .agent-grade--top strong {
    margin-top: 15px;
    font-size: 21px;
    overflow-wrap: anywhere;
  }

  .agent-grades__grid h4 {
    margin: 22px 0 8px;
    font-size: 14px;
    line-height: 1.25;
  }

  .agent-flow {
    padding: 14px !important;
  }

  .agent-flow li {
    min-width: 0;
    min-height: 158px;
    padding: 14px !important;
  }

  .agent-flow i {
    position: static !important;
    width: 36px !important;
    height: 36px !important;
    margin: 0 0 14px !important;
    border-width: 4px !important;
  }

  .agent-flow b {
    min-height: 0 !important;
    font-size: 12px;
    line-height: 1.25;
  }

  .agent-flow span {
    margin-top: 6px;
    font-size: 10px;
    line-height: 1.35;
  }

  /* Full product landings. FAQ remains one column because it is long-form content. */
  .product-audience,
  .product-card,
  .product-capability,
  .product-step,
  .product-scope,
  .product-guides article,
  .product-trust__stats div {
    min-width: 0;
    min-height: 190px !important;
    padding: 16px !important;
    border-radius: 18px;
  }

  .product-capability {
    display: block;
  }

  .product-capability i,
  .product-card__icon,
  .product-audience__icon,
  .product-scope i {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 19px;
  }

  .product-audience h3,
  .product-card h3,
  .product-step h3,
  .product-scope h3,
  .product-guides h3 {
    margin: 26px 0 9px;
    font-size: 16px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .product-audience p,
  .product-card p,
  .product-capability p,
  .product-step p,
  .product-scope p,
  .product-guides p {
    font-size: 11px;
    line-height: 1.45;
  }

  .product-audience .product-btn--text {
    width: auto !important;
    font-size: 11px;
    line-height: 1.25;
    text-align: left;
  }

  /* Marking and category pages. */
  .marking-page .benefits-bar div,
  .marking-page .role-card,
  .marking-page .package-card,
  .marking-page .problem-card,
  .marking-page .extra-card,
  .marking-page .role-detail__steps li,
  .marking-page .role-detail__cards article,
  .category-landing-timeline article,
  .category-landing-role,
  .category-landing-process li {
    min-width: 0;
    min-height: 180px !important;
    padding: 16px !important;
    border-radius: 18px;
  }

  .marking-page .benefits-bar div {
    min-height: 118px !important;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .marking-page .role-card h3,
  .marking-page .package-card h3,
  .marking-page .problem-card h3,
  .marking-page .role-detail__steps h3,
  .marking-page .role-detail__cards h3,
  .category-landing-timeline h3,
  .category-landing-role h3 {
    font-size: 16px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .marking-page .role-card p,
  .marking-page .package-card p,
  .marking-page .problem-card p,
  .marking-page .role-detail__steps p,
  .marking-page .role-detail__cards p,
  .category-landing-role p,
  .category-landing-process span {
    font-size: 11px;
    line-height: 1.45;
  }

  /* Keep compact 2-column marking grids orderly on narrow screens. */
  .marking-page .problem-grid {
    grid-auto-rows: 1fr;
    align-items: stretch;
  }

  .marking-page .problem-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .marking-page .problem-card__dot {
    position: static;
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 11px;
    height: 11px;
    margin: 0 0 12px;
    border-width: 3px;
  }

  .marking-page .problem-card h3 {
    min-height: 38px;
    margin: 0 0 8px;
    font-size: 15px;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: auto;
  }

  .marking-page .problem-card p {
    margin: 0 0 14px;
  }

  .marking-page .problem-card b {
    display: block;
    margin-top: auto;
    font-size: 11px;
    line-height: 1.35;
  }

  .marking-page .role-card--accent {
    transform: none !important;
  }

  .marking-page .role-card,
  .marking-page .package-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .marking-page .role-card__tag,
  .marking-page .package-card__badge {
    position: static;
    align-self: flex-start;
    margin: 0 0 10px;
    padding: 5px 7px;
    font-size: 8px;
  }

  .marking-page .role-card__icon,
  .marking-page .role-card__icon img {
    width: 56px;
    height: 56px;
  }

  .marking-page .role-card__icon {
    margin: 0 0 12px;
  }

  .marking-page .role-card h3,
  .marking-page .package-card h3 {
    margin: 0 0 8px;
  }

  .marking-page .role-card p,
  .marking-page .package-card > p {
    min-height: 0;
    margin: 0 0 12px;
  }

  .marking-page .role-card ul,
  .marking-page .package-card ul {
    margin: 0 0 14px;
  }

  .marking-page .role-card li,
  .marking-page .package-card li {
    margin: 7px 0;
    padding-left: 18px;
    font-size: 10px;
    line-height: 1.35;
  }

  .marking-page .role-card .button,
  .marking-page .package-card .button {
    margin-top: auto;
  }

  .marking-page .why-card--main {
    grid-row: auto !important;
  }

  /* Case and referral cards. */
  .challenge-card,
  .solution-card-new,
  .result-card,
  .project-card,
  .ref-step,
  .ref-note {
    min-width: 0;
    min-height: 180px;
    padding: 16px;
    border-radius: 18px;
  }

  .challenge-card h3,
  .solution-card-new h3,
  .result-card h3,
  .project-card h3,
  .ref-step h3 {
    margin-top: 24px;
    font-size: 16px;
    overflow-wrap: anywhere;
  }

  .challenge-card p,
  .solution-card-new p,
  .result-card p,
  .project-card p,
  .ref-step p,
  .ref-note p {
    font-size: 11px;
    line-height: 1.45;
  }
}

@media screen and (max-width: 360px) {
  .home-hero h1,
  .content-hero h1 {
    font-size: 40px !important;
  }

  .product-hero h1,
  .category-landing-hero h1,
  .role-detail__hero h1 {
    font-size: 37px !important;
  }

  .marking-page .integration-map {
    margin-right: -18px;
    margin-left: -18px;
    transform: scale(0.82);
  }

  .site-header-new__bar {
    width: calc(100% - 16px);
  }

  .site-header-new__logo {
    width: 104px;
    flex-basis: 104px;
  }
}

@media screen and (max-width: 960px) {
  .site-header-new__bar {
    position: relative;
    justify-content: center;
  }

  .site-header-new__logo {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    width: auto;
    height: 48px;
    flex-basis: auto;
    transform: translate(-50%, -50%);
  }

  .site-header-new__actions {
    position: static;
    width: 100%;
    min-height: 46px;
    margin-left: 0;
  }

  .site-header-new__burger {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 8px;
    margin: 0;
    transform: translateY(-50%);
  }
}
