/* Composition adjustments. Font sizes stay in typography.css. */
#main .problem-card > p:first-child {text-align:center}
#main .case-heading {padding-block:24px}
#main .case-heading b {margin:0 0 12px}
.landing-page #main #features .feature-card {padding-top:32px}
.landing-page #main #cases .case-heading {padding-block:20px}
/* Align each number with the first heading line, keeping card widths unchanged. */
.landing-page #main #flow .step-disc {margin-top:8px}
.landing-page #main #flow .timeline::before {left:36px}
.landing-page #main #environment .env-card {padding-top:26px}
.landing-page #main #environment .env-card h3 {column-gap:8px}
/* Keep the main price and tax-inclusive total together, then lead into the scope. */
.landing-page #main :is(#price,#apply) .price-amount {margin:12px 0 6px;row-gap:4px}
.landing-page #main :is(#price,#apply) .price-tax {margin:0}
.landing-page #main #price .price-sub {margin-top:12px}
.landing-page #main #apply .apply-card > .price-tax + p {margin-top:12px}
.landing-page #main #apply .apply-card > .button {margin-top:20px}
@media (max-width:760px) {
  /* Separate application help links and complete note sentences on phones. */
  .landing-page #main #apply .apply-card > .secondary-link {margin-top:16px}
  .landing-page #main #apply .apply-card > .secondary-link + .secondary-link {margin-top:12px}
  .landing-page #main #apply .apply-note {margin-top:20px}
  .landing-page #main #apply .apply-note > .mobile-copy-line + .mobile-copy-line {margin-top:6px}
  .landing-page #main #apply .apply-note > a {display:block;margin-top:10px}
  /* Keep section boundaries clear with less empty space on the main LP. */
  .landing-page #main > :is(.section,.apply) {padding-block:44px}
  .landing-page #main #features .feature-card {padding-top:28px}
  .landing-page #main #features .feature-grid {gap:24px}
  .landing-page #main #flow .flow-step {grid-template-columns:48px minmax(0,1fr);column-gap:8px}
  .landing-page #main #flow .step-disc {width:48px;height:48px;margin-top:12px}
  .landing-page #main #flow .timeline::before {left:22.5px}
  .landing-page #main #environment .env-card {padding-top:20px}
  /* Center the numeral on the heading's first line, including multiline titles. */
  .landing-page #main #environment .env-card h3 > span {margin-top:.0875rem}

  #main .type-section-title,
  #main .type-section-summary,
  #main .type-page-summary,
  #main :is(.section-head,.detail-section-head,.section-heading) > .type-section-summary {
    text-align:center;
    margin-inline:auto;
  }

  #main :where(.section,.chapter,.bridge,.directory-cta) p:not(:where(.type-section-summary,.type-page-summary)) {
    text-align:left;
  }
  #main :is(.section-head,.detail-section-head,.section-heading) > p:not(.type-section-summary),
  #main :is(.human-note,.work-foot,.gallery-note,.env-note,.apply .lead) {
    text-align:left;
  }
  #main .directory-heading > div:first-child {width:100%}
  #main :is(.section-head,.intro-grid) p:not(.type-section-summary) br {display:none}

  /* Introductory prose outside cards follows the centered heading rhythm. */
  #main p.mobile-centered-copy,
  #main p.mobile-centered-copy:is(.gallery-note,.env-note),
  #main :is(.section-head,.detail-section-head,.section-heading) > p.mobile-centered-copy,
  #main .apply .lead.mobile-centered-copy {
    text-align:center;
    max-width:32rem;
    margin-inline:auto;
    text-wrap:pretty;
  }
  #main p.mobile-centered-copy br {display:none}
  #main .mobile-copy-phrase {display:inline-block;max-width:100%;vertical-align:top}
  #main .mobile-copy-line {display:block;max-width:100%}

  /* Keep each note readable as short, centered thoughts without changing its size. */
  #main .work-foot > p.mobile-centered-copy:last-child,
  #main #environment .section-head > p.mobile-centered-copy {max-width:20em}
  #main p.gallery-note.mobile-centered-copy {max-width:22em}
  #main .gallery-note .mobile-copy-sentence {display:block}
  #main .gallery-note .mobile-copy-sentence + .mobile-copy-sentence {margin-top:.5em}

  /* The number and title form one compact blue header, without a repeated label. */
  #main .case-heading {padding:16px 20px;grid-template-columns:32px minmax(0,1fr);column-gap:12px}
  #main .case-heading :is(b,h3) {margin:0}
  /* Grow the numbers while preserving the width available to each heading. */
  .landing-page #main #cases .case-heading {
    padding:14px 18px;
    grid-template-columns:2.5rem minmax(0,1fr);
    column-gap:8px;
  }


  /* Keep short phrases together; allow them to wrap on very narrow screens. */
  #main .mobile-phrase {display:inline-block;max-width:100%;vertical-align:top}
  #main .mobile-line {display:block;max-width:100%}
  #main br.mobile-join {display:none}
  #main .support-band {padding:24px 16px}
  #main .support-band :is(h3,p) {text-align:center}
  #main .support-band p {margin-top:10px}
  #main .support-band .button {padding-inline:12px}
  #main :is(.greeting,.visual-label,.vertical-type) {text-align:center}

  /* Compact work cards: a heading row, full-width copy, and a right-aligned toggle. */
  #main .work-card {
    padding:16px 18px;
    grid-template-columns:32px minmax(0,1fr);
    column-gap:10px;
    row-gap:0;
    align-items:start;
  }
  #main .work-card .icon {grid-column:1;grid-row:1;width:32px;height:32px;margin:0}
  #main .work-card .icon svg {width:32px;height:32px}
  #main .work-card h3 {grid-column:2;grid-row:1;align-self:center;margin:0}
  #main .work-card > p {grid-column:1 / -1;margin:8px 0 0}
  #main .work-card details {grid-column:1 / -1;margin:2px 0 0;min-width:0}
  #main .work-card summary {
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:8px;
    width:fit-content;
    min-height:44px;
    margin-left:auto;
    padding:0;
    list-style:none;
    text-align:right;
  }
  #main .work-card summary::-webkit-details-marker {display:none}
  #main .work-card summary::after {content:'＋'}
  #main .work-card details[open] summary::after {content:'−'}
  #main .work-card details ul {margin-top:8px;padding-left:1.25rem}

  /* One line for the AI-employee label and name, with compact, even spacing. */
  #main .company-card-copy {padding:20px;gap:8px}
  #main .company-card h3 {min-height:0;margin:0}
  #main .company-sector {margin:0}
  #main .company-employee {
    display:flex;
    flex-wrap:wrap;
    align-items:baseline;
    gap:0 10px;
    /* Legacy component margins use !important; override only those margins. */
    margin:0 !important;
  }
  #main .company-employee > span {display:inline;flex:0 0 auto;margin:0;white-space:nowrap}
  .landing-page #main .faq-question {min-width:0}

  /* Balance short Japanese text blocks at every mobile width, preserving alignment. */
  .landing-page #main :is(.section,.apply,.adoption-proof) :is(p,li,dt,dd,h3,h4,summary),
  .landing-page #main :is(.mobile-copy-phrase,.mobile-copy-line,.mobile-phrase,.faq-answer,.flow-intro small,.flow-intro b,.text-button),
  .landing-page .site-footer p {
    text-wrap:balance;
  }

  /* Long prose shares the inset of card text: 24px padding plus a 1px border.
     Keep headings and brief centered messages on their existing layout. */
  .landing-page #main :is(
    #about .mobile-centered-copy,
    .gallery-note.mobile-centered-copy,
    .env-note.mobile-centered-copy,
    #price .mobile-centered-copy,
    .flow-intro small
  ) {
    width:calc(100% - 50px);
    max-width:32rem;
    margin-inline:auto;
    text-align:left;
  }
  /* Center the short about paragraph as a unit while keeping its lines left-aligned. */
  .landing-page #main #about .mobile-centered-copy {
    width:fit-content;
    max-width:calc(100% - 40px);
  }
  .landing-page #main .flow-intro b {display:block}

  #main .company-role {margin:0 !important}
  #main .company-more {margin-top:4px;padding-top:10px}
}
