/* Immediate compiled override for the home service diagrams.
   Keep this after app.css; the same rules also live in home.css for the next full CSS build. */
@media (max-width: 460px) {
  .system-block--business,
  .system-block--core {
    width: 92%;
  }

  .system-map {
    --rule-2: #3a342c;
    padding-right: 0;
    padding-left: 0;
  }

  .system-block--business {
    min-height: 70px;
  }

  .system-block--core {
    min-height: 82px;
  }

  .system-map__trunk {
    height: 34px;
  }

  .system-map__branches {
    --branch-gap: 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--branch-gap);
    width: 100%;
    padding-top: 44px;
  }

  .system-map__branches::before,
  .system-map__branches::after,
  .system-map__branch::before,
  .system-map__branch::after,
  .system-map__branch > i {
    display: block;
  }

  .system-map__branches::after {
    height: 19px;
  }

  .system-map__branch:nth-child(-n + 2)::before {
    top: -26px;
  }

  .system-map__branch > i {
    top: -26px;
    height: 26px;
  }

  .system-map__branch .system-block {
    min-height: 76px;
    gap: 10px;
    padding: 10px 8px;
  }

  .system-map__branch .system-block span {
    font-size: 6px;
    letter-spacing: 0.09em;
  }

  .system-map__branch .system-block strong {
    overflow-wrap: anywhere;
    font-size: clamp(7px, 2.15vw, 9px);
    letter-spacing: 0.08em;
  }

  .system-map__branch + .system-map__branch {
    margin-top: 0;
  }
}

/* Immediate mobile layout fixes. These are mirrored in the source styles and
   remain here so the PHP preview receives them without a full CSS rebuild. */
@media (max-width: 640px) {
  .company-identity,
  .company-identity dl,
  .company-identity dd {
    min-width: 0;
    max-width: 100%;
  }

  .company-identity dl > div {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 5px !important;
  }

  .company-identity dd { overflow: hidden; }

  .email-reveal,
  .email-reveal--compact {
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    gap: 10px;
    padding: 7px 11px 7px 7px;
    font-size: 9px;
    letter-spacing: 0.1em;
  }

  .email-reveal__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .email-reveal__guard {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
  }

  .terminal__body { padding: 18px; }

  .tline {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: start !important;
    padding: 16px 0;
  }

  .tline input,
  .tline textarea,
  .tline select {
    display: block;
    min-width: 0;
    max-width: 100%;
    font-size: 13px;
  }

  .tline select {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 720px) {
  .services-head > div:first-child {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .services-head__title {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    padding-inline: 4px;
    font-size: clamp(50px, 16vw, 72px);
    line-height: 0.94;
    text-align: center;
    text-wrap: balance;
    white-space: normal;
  }

  .service-module__content,
  .service-module--commerce .service-module__content,
  .service-module--systems .service-module__content { min-height: 0; }

  .service-module__copy {
    align-items: center;
    padding: 38px 22px 44px;
    text-align: center;
  }

  .service-module__purpose {
    margin: 0 auto 18px;
    text-align: center;
  }

  .service-module__title,
  .service-module--commerce .service-module__title {
    max-width: 100%;
    font-size: clamp(40px, 11vw, 54px);
    text-align: center;
  }

  .service-module__desc,
  .service-module__capabilities {
    margin-right: auto;
    margin-left: auto;
    text-align: center;
  }

  .service-module__desc { font-size: 14px; }

  .service-module__actions {
    justify-content: center;
    align-items: center;
    width: 100%;
  }

  .service-module__secondary { text-align: center; }

  .trust-card { text-align: center; }

  .trust-card__number {
    display: block;
    text-align: center;
  }

  .trust-card__title,
  .trust-card__text {
    margin-right: auto;
    margin-left: auto;
    text-align: center;
  }

  .service-module__visual,
  .service-module--commerce .service-module__visual {
    min-height: 286px;
    padding: 34px 20px;
  }

  .service-module--systems .service-module__visual { min-height: 320px; }
}
