/* Only existing entry regions on the canonical tool-route allowlist. */
.sm-tool-entry-layout .sm-breadcrumb .sm-bc__list {
  flex-wrap: wrap;
  overflow: visible;
  row-gap: .4rem;
}
.sm-tool-entry-layout .sm-breadcrumb .sm-bc__item--current {
  flex: 0 1 auto;
  overflow: visible;
  min-width: 0;
}
.sm-tool-entry-layout .sm-breadcrumb .sm-bc__current {
  white-space: normal;
  text-overflow: clip;
  overflow: visible;
  overflow-wrap: break-word;
}
.sm-tool-entry-layout .tsh-pyth-layout {
  margin-inline: auto;
  column-gap: clamp(1.5rem, 3vw, 2.5rem);
}
@media (min-width: 1025px) {
  .sm-tool-entry-layout .tsh-pyth-layout { max-width: 90rem; }
}
.sm-tool-entry-layout .tsh-pyth-col--portrait,
.sm-tool-entry-layout .tsh-pyth-col--form {
  min-width: 0;
}
.sm-tool-entry-layout .tsh-pyth-col--form h1,
.sm-tool-entry-layout .xnt-hero-title,
.sm-tool-entry-layout .nh-hero-title,
.sm-tool-entry-layout .vk-hub-title,
.sm-tool-entry-layout .ta-hero-title {
  max-width: 100%;
  white-space: normal;
  overflow: visible;
  overflow-wrap: break-word;
}
.sm-tool-entry-layout .tsh-pyth-info {
  min-width: 0;
  overflow-wrap: break-word;
}
.sm-tool-entry-layout .tsh-pyth-badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .35rem;
}
.sm-tool-entry-layout .tsh-pyth-proof {
  min-width: 0;
}
/* The existing square SVG has fixed width/height attributes. */
.sm-tool-entry-layout .gq-pyth-copper .gq-cycle-diagram {
  width: 100%;
}
.sm-tool-entry-layout .gq-pyth-copper .gq-cycle-diagram > svg {
  display: block;
  width: 100%;
  height: auto;
}
@media (prefers-reduced-motion: reduce) {
  /* Existing animation removal must not leave the entry opacity at zero. */
  .sm-tool-entry-layout .bkieu-form-section .bkieu-entrance,
  .sm-tool-entry-layout .tr-form-section .tr-entrance {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 480px) {
  /* Center witnesses that remain visible; preserve existing display:none policies. */
  .sm-tool-entry-layout .tsh-pyth-col--portrait {
    flex-direction: column;
    align-items: center;
    gap: .75rem;
  }
  .sm-tool-entry-layout .tsh-pyth-col--portrait > .tsh-pyth-frame {
    margin-inline: auto;
  }
  .sm-tool-entry-layout .tsh-pyth-col--portrait > [class*="portrait-deco"] {
    margin-inline: auto;
    align-self: center;
  }
  .sm-tool-entry-layout .tsh-pyth-info {
    width: 100%;
    text-align: center;
  }
  .sm-tool-entry-layout .tsh-pyth-proofs {
    flex-direction: column;
    align-items: center;
    gap: .4rem;
  }
  /* Keep the existing SVG ratio and let its frame contain the full height. */
  .sm-tool-entry-layout .zd-pyth-accent .tsh-pyth-frame {
    height: auto;
  }
}
@media (max-width: 1024px) and (min-width: 481px) {
  .sm-tool-entry-layout .tsh-pyth-layout {
    row-gap: 2rem;
  }
  /* These five families deliberately hide their witness on tablet. */
  .sm-tool-entry-layout .tsh-pyth-col--portrait:has(> .tsh-pyth-frame):not(.pt-pyth-cin, .ct-db-pyth-celestial, .lh-pyth-celadon, .tm-pyth-sienna, .sh-pyth-vermillion) {
    display: grid;
    grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr);
    align-items: center;
    column-gap: 1.5rem;
    row-gap: .75rem;
    width: 100%;
  }
  .sm-tool-entry-layout .tsh-pyth-col--portrait:has(> .tsh-pyth-frame):not(.pt-pyth-cin, .ct-db-pyth-celestial, .lh-pyth-celadon, .tm-pyth-sienna, .sh-pyth-vermillion) > .tsh-pyth-frame {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    max-width: 8.5rem;
    margin: 0;
    justify-self: center;
  }
  .sm-tool-entry-layout .tsh-pyth-col--portrait:has(> .tsh-pyth-frame):not(.pt-pyth-cin, .ct-db-pyth-celestial, .lh-pyth-celadon, .tm-pyth-sienna, .sh-pyth-vermillion) > .tsh-pyth-info {
    grid-column: 2;
    grid-row: 1 / span 3;
    width: 100%;
    text-align: left;
  }
  .sm-tool-entry-layout .tsh-pyth-col--portrait:has(> .tsh-pyth-frame):not(.pt-pyth-cin, .ct-db-pyth-celestial, .lh-pyth-celadon, .tm-pyth-sienna, .sh-pyth-vermillion) > [class*="portrait-deco"] {
    grid-column: 1;
    justify-self: center;
    margin: 0;
  }
  .sm-tool-entry-layout .tsh-pyth-col--portrait:has(> .tsh-pyth-frame):not(.pt-pyth-cin, .ct-db-pyth-celestial, .lh-pyth-celadon, .tm-pyth-sienna, .sh-pyth-vermillion) > [class*="portrait-deco"][class*="--top"] { grid-row: 1; }
  .sm-tool-entry-layout .tsh-pyth-col--portrait:has(> .tsh-pyth-frame):not(.pt-pyth-cin, .ct-db-pyth-celestial, .lh-pyth-celadon, .tm-pyth-sienna, .sh-pyth-vermillion) > [class*="portrait-deco"][class*="--bot"] { grid-row: 3; }
  .sm-tool-entry-layout .tsh-pyth-badge-row { justify-content: flex-start; }
  .sm-tool-entry-layout .tsh-pyth-proofs { flex-direction: column; gap: .4rem; }
}
@media (max-width: 600px) and (min-width: 481px) {
  .sm-tool-entry-layout .tsh-pyth-col--portrait:has(> .tsh-pyth-frame):not(.pt-pyth-cin, .ct-db-pyth-celestial, .lh-pyth-celadon, .tm-pyth-sienna, .sh-pyth-vermillion) {
    grid-template-columns: minmax(0, 6.5rem) minmax(0, 1fr);
    column-gap: 1rem;
  }
}

/* Witness families share alignment, while keeping their illustrations and typography. */
@media (min-width: 1025px) {
  .sm-tool-entry-layout .tsh-pyth-layout { align-items: flex-start; }
}
.sm-tool-entry-layout section:where(:not(.bds-form-section)):has(> .tsh-pyth-layout) > p[class*="-eyebrow"] {
  max-width: 70ch;
  margin-inline: auto;
  letter-spacing: .1em;
  line-height: 1.8;
  text-align: center;
  text-wrap: balance;
}
.sm-tool-entry-layout section:where(:not(.bds-form-section)):has(> .tsh-pyth-layout) > p[class*="-disc"] {
  max-width: 64ch;
  margin-inline: auto;
  line-height: 1.75;
  text-wrap: pretty;
}
.sm-tool-entry-layout .tsh-pyth-col--form .tc-lead-inject {
  max-width: 60ch;
  margin-inline: auto;
  line-height: 1.75;
  text-wrap: pretty;
}
/* Quan Am has one title line; its old two-line reservation separates the introduction. */
.sm-tool-entry-layout .qa-form-title { height: auto; }
@media (max-width: 480px) {
  .sm-tool-entry-layout section:where(:not(.bds-form-section)):has(> .tsh-pyth-layout) > p[class*="-eyebrow"] {
    letter-spacing: .06em;
    font-size: .75rem;
  }
  .sm-tool-entry-layout .tsh-pyth-col--form [class*="-sub-cursor"] {
    display: none;
  }
}

/* BDS entry: keep the existing content and visual vocabulary, group the introduction. */
.sm-tool-entry-layout .bds-form-section {
  padding-top: clamp(1.75rem, 3.5vw, 3rem);
}
.sm-tool-entry-layout .bds-eyebrow {
  max-width: 64rem;
  margin: 0 auto .75rem;
  font-size: .75rem;
  line-height: 1.8;
  letter-spacing: .09em;
  text-align: center;
  text-wrap: balance;
}
.sm-tool-entry-layout .bds-form-disc {
  max-width: 64ch;
  margin: 0 auto 1.75rem;
  line-height: 1.75;
  text-wrap: pretty;
}
.sm-tool-entry-layout .bds-form-section > .tsh-pyth-layout {
  align-items: flex-start;
  column-gap: clamp(2rem, 4vw, 3.5rem);
}
.sm-tool-entry-layout .bds-pyth-midnight {
  flex: 0 0 clamp(18rem, 28vw, 22rem);
  padding-top: 0;
}
.sm-tool-entry-layout .bds-pyth-midnight > .tsh-pyth-frame {
  width: min(100%, 20rem);
  max-width: 20rem;
  height: auto;
  aspect-ratio: 1;
  margin-bottom: 1.25rem;
}
.sm-tool-entry-layout .bds-zodiac-diagram,
.sm-tool-entry-layout .bds-zodiac-diagram > svg {
  width: 100%;
  height: auto;
  display: block;
}
.sm-tool-entry-layout .bds-portrait-deco--top {
  margin: 0 0 .75rem;
}
.sm-tool-entry-layout .bds-portrait-deco--top > svg {
  width: 3rem;
  height: 3rem;
  display: block;
}
.sm-tool-entry-layout .bds-pyth-midnight .tsh-pyth-name {
  letter-spacing: .12em;
  line-height: 1.65;
}
.sm-tool-entry-layout .bds-pyth-midnight .tsh-pyth-dates {
  letter-spacing: .04em;
  line-height: 1.65;
}
.sm-tool-entry-layout .bds-pyth-midnight .tsh-pyth-proof {
  font-size: .75rem;
  line-height: 1.75;
}
.sm-tool-entry-layout .bds-form-section .tsh-form-intro {
  margin: 0 0 1.5rem;
}
.sm-tool-entry-layout .bds-form-title {
  margin: 0 0 1.1rem;
  font-size: clamp(2.25rem, 4vw, 3.5rem);
  line-height: 1.16;
  letter-spacing: -.015em;
}
.sm-tool-entry-layout .bds-form-section .tc-lead-inject {
  max-width: 56ch;
  margin: 0 auto 1rem;
  line-height: 1.75;
  text-wrap: pretty;
}
.sm-tool-entry-layout .bds-form-sub {
  min-height: 3.2em;
  margin: 0 auto;
  max-width: 46ch;
  line-height: 1.6;
  text-align: center;
  display: grid;
  min-height: 0;
}
/* Invisible sizing copy of the existing longest phrase keeps typing from moving the form. */
.sm-tool-entry-layout .bds-form-sub::before {
  content: "Hai bộ kiểm độc lập 83 và 99 lá số: sai lệch lớn nhất quan sát dưới 0,008°";
  visibility: hidden;
  grid-area: 1 / 1;
}
.sm-tool-entry-layout #bds-sub-tw { grid-area: 1 / 1; }
/* Omit the decorative caret so it cannot form a disconnected line. */
.sm-tool-entry-layout .bds-sub-cursor { display: none; }
.sm-tool-entry-layout .bds-ornament {
  margin: .75rem auto 0;
}
@media (min-width: 1025px) {
  .sm-tool-entry-layout .bds-form-section .tsh-pyth-col--form {
    flex: 1 1 0;
  }
  .sm-tool-entry-layout .bds-form-section .tsh-pyth-divider {
    align-self: stretch;
  }
}
@media (min-width: 481px) and (max-width: 1024px) {
  .sm-tool-entry-layout .bds-form-section > .tsh-pyth-layout {
    row-gap: 1.75rem;
  }
  .sm-tool-entry-layout .bds-pyth-midnight.tsh-pyth-col--portrait {
    flex-basis: auto;
    grid-template-columns: minmax(0, clamp(9rem, 25vw, 14rem)) minmax(0, 1fr);
    column-gap: clamp(1.25rem, 3vw, 2rem);
  }
  .sm-tool-entry-layout .bds-pyth-midnight.tsh-pyth-col--portrait > .tsh-pyth-frame {
    max-width: 14rem;
    margin: 0;
  }
  .sm-tool-entry-layout .bds-pyth-midnight .tsh-pyth-badge-row {
    justify-content: flex-start;
  }
}
@media (max-width: 480px) {
  .sm-tool-entry-layout .bds-eyebrow {
    font-size: .75rem;
    letter-spacing: .055em;
    line-height: 1.9;
  }
  .sm-tool-entry-layout .bds-form-disc {
    margin-bottom: 1.5rem;
    font-size: .8125rem;
  }
  .sm-tool-entry-layout .bds-form-title {
    font-size: clamp(1.875rem, 8.8vw, 2.4rem);
    margin-bottom: 1rem;
  }
  .sm-tool-entry-layout .bds-form-section .tc-lead-inject {
    font-size: .875rem;
    line-height: 1.8;
  }
  .sm-tool-entry-layout .bds-form-sub {
    font-size: 1rem;
  }
}
