/* Internal-page composition. Shared tokens, navigation and controls are defined
   in styles.css and redesign/theme.css; do not fork those roles here. */
.site-balance .wrap { width: min(var(--container-main), calc(100% - 2 * var(--gutter))); }
.site-balance h1 { font-weight: 600; line-height: 1.12; letter-spacing: -.045em; }
.site-balance h2 { font-weight: 600; line-height: 1.2; }
.site-balance h3 { font-weight: 600; font-size: 20px; line-height: 1.4; letter-spacing: -.025em; }
.site-balance .page-head { padding: 48px 0 36px; background: transparent; border: 0; }
.site-balance .page-head h1 { max-width: 900px; margin-bottom: 20px; }
.site-balance .page-head p { max-width: 720px; margin-bottom: 0; color: var(--text-secondary); font-size: 16px; line-height: 1.65; }
.site-balance .breadcrumbs { margin-bottom: 22px; }
.site-balance .kicker { display: block; margin-bottom: 14px; text-transform: none; }
.site-balance .band { padding: 48px 0 56px; border: 0; background: transparent; }
.site-balance .band.compact { padding: 32px 0 40px; }
.site-balance .section-head { max-width: 750px; margin-bottom: 32px; }
.site-balance .section-head h2 { margin-bottom: 16px; }
.site-balance .section-head p { color: var(--text-secondary); font-size: 16px; line-height: 1.65; }
.site-balance .section-head.center { margin-inline: 0; text-align: left; }
.site-balance .grid { gap: 28px; }
.site-balance .grid :is(p, li), .site-balance .truth-card li { color: var(--text-secondary); font-size: 16px; line-height: 1.65; }
.site-balance :is(.card, .step-card, .truth-card) { min-width: 0; padding: 24px 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; box-shadow: none; }
.site-balance .role-card { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-large); background: var(--surface); box-shadow: none; }
.site-balance :is(.card-number, .step-number) { border: 1px solid var(--border); border-radius: var(--radius-small); background: var(--surface-secondary); color: var(--brand); font-size: 14px; font-weight: 600; }
.site-balance .role-label { border-radius: var(--radius-small); background: var(--surface-secondary); color: var(--brand); letter-spacing: .025em; }
.site-balance .callout { padding: 20px 24px; border: 0; border-left: 3px solid var(--brand); border-radius: 0 var(--radius-medium) var(--radius-medium) 0; background: var(--surface-secondary); box-shadow: none; }
.site-balance .callout p { color: var(--text-secondary); line-height: 1.65; }
.site-balance .callout.warning { border-left-color: var(--warning); background: var(--warning-surface); }
.site-balance .callout.danger { border-left-color: var(--error); background: var(--error-surface); }
.site-balance .callout h3 { margin-bottom: 12px; font-size: 18px; }
.site-balance .cta-band { padding: 30px 32px; border: 1px solid var(--border); border-radius: var(--radius-large); background: var(--surface-secondary); }
.site-balance .cta-band p { max-width: 750px; font-size: 16px; }
.site-balance .spec-table { border-color: var(--border); background: var(--surface); font-size: 15px; line-height: 1.65; }
.site-balance .spec-table th { background: var(--surface-secondary); color: var(--text-primary); font-weight: 600; }
.site-balance .spec-table td { padding: 18px; color: var(--text-secondary); }
.site-balance .table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-medium); }
.site-balance .table-wrap .spec-table { margin: 0; border: 0; }

/* An index is navigation, not a second document card. Its offset uses the
   measured sticky header height, including the border. */
.site-balance .guide-grid, .faq-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: clamp(32px, 4vw, 64px); align-items: start; }
.site-balance .toc { position: sticky; top: calc(var(--site-header-height) + var(--anchor-gap)); max-height: calc(100svh - var(--site-header-height) - 40px); overflow-y: auto; align-self: start; padding: 0 20px 4px 0; border: 0; border-right: 1px solid var(--border); border-radius: 0; background: transparent; scrollbar-width: thin; }
.site-balance .toc strong { display: block; margin: 0 0 12px; color: var(--text-primary); font-size: 15px; font-weight: 600; line-height: 1.5; }
.site-balance .toc a { display: flex; align-items: center; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-small); color: var(--text-secondary); font-size: 14px; line-height: 1.5; text-decoration: none; overflow-wrap: anywhere; }
.site-balance .toc a:hover { color: var(--brand); background: var(--surface-secondary); }
.site-balance .toc a[aria-current='location'] { color: var(--brand); background: var(--surface-secondary); font-weight: 600; }
.site-balance .guide-content { min-width: 0; max-width: 820px; }
.site-balance .guide-section { margin-bottom: 56px; scroll-margin-top: 0; }
.site-balance .guide-section + .guide-section { padding-top: 36px; border-top: 1px solid var(--border); }
.site-balance .guide-section > h2 { max-width: 720px; margin-bottom: 24px; font-size: clamp(28px, 2.5vw, 34px); }
.site-balance .guide-step { margin-top: 18px; padding: 24px 0 20px 44px; }
.site-balance .guide-step h3 { margin-bottom: 12px; font-size: 20px; line-height: 1.4; }
.site-balance .guide-step .step-number { top: 26px; width: 27px; height: 27px; min-width: 27px; font-size: 13px; }
.site-balance .guide-step :is(p, li) { max-width: 760px; font-size: 16px; line-height: 1.65; }
.site-balance .guide-section .grid.two { gap: 24px; }
.site-balance .guide-section .card { padding: 20px 0 0; border-radius: 0; }
.site-balance .guide-section .need-list { padding-left: 0; }
.site-balance .guide-section .need-list li { margin-bottom: 9px; padding-left: 23px; }
.site-balance .inline-shot { margin: 28px 0 8px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-medium); background: var(--surface-secondary); box-shadow: none; }
.site-balance .inline-shot img { width: 100%; max-height: 550px; border: 0; border-radius: var(--radius-small); box-shadow: none; object-fit: contain; object-position: left; }
.site-balance .inline-shot figcaption { padding: 10px 4px 0; color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.site-balance .doc-jumps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.site-balance .doc-jumps a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-medium); font-size: 14px; line-height: 1.5; text-decoration: none; }
.site-balance .doc-jumps a:hover { color: var(--brand); background: var(--surface-secondary); }

/* Architecture retains the meaningful node and line pattern. */
.site-balance .truth-grid { gap: 28px; }
.site-balance .truth-card.no { background: transparent; }
.site-balance .dark-band { padding-block: 48px 56px; background: var(--surface-secondary); color: var(--text-primary); }
.site-balance .dark-band :is(h2, h3, .kicker) { color: var(--text-primary); }
.site-balance .dark-band p { color: var(--text-secondary); }
.site-balance .system-flow { gap: 14px; align-items: stretch; }
.site-balance .flow-node { min-width: 0; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-medium); background: var(--surface); color: var(--text-primary); }
.site-balance .flow-node strong { font-size: 18px; line-height: 1.45; font-weight: 600; }
.site-balance .flow-node > span:last-child { color: var(--text-secondary); font-size: 15px; line-height: 1.6; }
.site-balance .flow-arrow { align-self: center; color: var(--brand); }
.site-balance .node-number { width: 29px; height: 29px; border-radius: var(--radius-small); background: var(--surface-secondary); color: var(--brand); font-size: 14px; font-weight: 600; }

/* FAQ intro can shrink to clientWidth even with a classic scrollbar at 320px. */
.faq-page :is(main, .page-head, .page-head .wrap, .faq-layout, .faq-search, .faq-search-field) { min-width: 0; max-width: 100%; }
.faq-page .page-head h1 { overflow-wrap: anywhere; }
.faq-layout > * { min-width: 0; }
.site-balance .faq-content { min-width: 0; padding: 0 0 12px; border: 0; border-radius: 0; background: transparent; }
.site-balance .faq-content > .band { padding: 0 0 44px; background: transparent; }
.site-balance .faq-content .narrow { width: 100%; max-width: 820px; }
.site-balance .faq-content .section-head { margin-bottom: 16px; scroll-margin-top: 0; }
.site-balance .faq-content .section-head .kicker { margin-bottom: 8px; }
.site-balance .faq-content h2 { margin-bottom: 0; font-size: clamp(28px, 2.5vw, 34px); }
.site-balance .faq details { border-bottom: 1px solid var(--border); background: transparent; }
.site-balance .faq summary { padding: 20px 36px 20px 0; font-family: var(--font-body); font-size: 17px; font-weight: 500; line-height: 1.6; }
.site-balance .faq summary::after { top: 23px; right: 5px; color: var(--brand); font-size: 22px; }
.site-balance .faq summary:hover { background: transparent; color: var(--brand); }
.site-balance .faq details[open] summary { color: var(--brand); }
.site-balance .faq details[open] summary::after { content: '\2212'; }
.site-balance .faq details :is(p, ul) { padding-right: 28px; padding-bottom: 20px; color: var(--text-secondary); font-size: 16px; line-height: 1.65; }
.faq-search { max-width: 720px; margin-top: 28px; }
.faq-search > label { display: block; margin-bottom: 8px; color: var(--text-primary); font-size: 14px; font-weight: 500; }
.faq-search-field { position: relative; }
.faq-search-field input { width: 100%; min-width: 0; min-height: 52px; padding: 13px 56px 13px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-medium); background: var(--surface); color: var(--text-primary); font-size: 16px; }
.faq-search-field button { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--radius-small); background: transparent; color: var(--text-secondary); font-size: 24px; cursor: pointer; }
.faq-search-field button:hover { background: var(--surface-secondary); }
.faq-search-status { min-height: 25px; margin-top: 8px; color: var(--text-secondary); font-size: 14px; }
.faq-empty { padding: 24px; border-radius: var(--radius-medium); background: var(--surface-secondary); font-size: 16px; }

/* Long legal pages keep a reading column and their existing semantic sections. */
.site-balance .legal-band { padding-top: 20px; }
.site-balance .legal-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); align-items: start; gap: clamp(32px, 4vw, 64px); width: min(var(--container-main), calc(100% - 2 * var(--gutter))); margin: 0 auto; }
.site-balance .legal-document { min-width: 0; max-width: 820px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.site-balance .legal-document > section { margin: 0 0 32px; padding: 0 0 32px; border-bottom: 1px solid var(--border); scroll-margin-top: 0; }
.site-balance .legal-document h2 { margin-bottom: 20px; font-size: 27px; line-height: 1.3; }
.site-balance .legal-document :is(p, li) { color: var(--text-secondary); font-size: 16px; line-height: 1.65; }
.site-balance .legal-document .legal-lead { font-size: 17px; font-weight: 400; }
.site-balance .legal-details { grid-template-columns: minmax(150px, .65fr) minmax(0, 1.35fr); border: 1px solid var(--border); border-radius: var(--radius-medium); background: var(--surface-secondary); }
.site-balance .legal-details :is(dt, dd) { padding: 14px 16px; border-color: var(--border); font-size: 14px; line-height: 1.65; }
.site-balance .legal-details dt { background: var(--surface-secondary); font-weight: 600; }
.site-balance .legal-band .table-wrap { margin: 24px 0; }
.site-balance .processing-grid { gap: 24px; }

@media (max-width: 1100px) {
  .site-balance .guide-grid, .faq-layout, .site-balance .legal-layout { grid-template-columns: 210px minmax(0, 1fr); gap: 32px; }
  .site-balance .guide-section .grid.two { grid-template-columns: 1fr; }
  .site-balance .system-flow { grid-template-columns: 1fr 20px 1fr; }
  .site-balance .system-flow > .flow-arrow:nth-child(4) { display: none; }
}
@media (max-width: 860px) {
  .site-balance .page-head { padding: 36px 0 28px; }
  .site-balance .guide-grid, .faq-layout, .site-balance .legal-layout { grid-template-columns: 1fr; gap: 28px; }
  .site-balance .toc { position: static; display: flex; flex-wrap: wrap; gap: 4px 8px; max-height: none; padding: 0 0 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .site-balance .toc strong { width: 100%; margin-bottom: 8px; }
  .site-balance .toc a { min-height: 44px; padding: 10px 12px; }
  .site-balance .legal-layout .toc { display: block; max-height: 250px; overflow-y: auto; }
  .site-balance .legal-layout .toc strong { position: sticky; top: 0; padding-block: 8px; background: var(--background); }
  .site-balance .guide-content, .site-balance .legal-document { max-width: none; }
  .site-balance .band { padding: 36px 0 44px; }
  .site-balance .band.compact { padding: 28px 0 32px; }
}
@media (max-width: 640px) {
  .site-balance .page-head { padding: 30px 0 26px; }
  .site-balance .page-head h1 { max-width: 100%; margin-bottom: 18px; font-size: clamp(32px, 9vw, 40px); line-height: 1.15; }
  .site-balance .page-head p { font-size: 16px; line-height: 1.65; }
  .site-balance .breadcrumbs { margin-bottom: 18px; }
  .site-balance .section-head { margin-bottom: 24px; }
  .site-balance h2 { font-size: 28px; }
  .site-balance :is(.grid, .truth-grid) { gap: 24px; }
  .site-balance .grid.two, .site-balance .grid.three, .site-balance .truth-grid { grid-template-columns: 1fr; }
  .site-balance .role-card { padding: 22px; }
  .site-balance .callout { padding: 18px 20px; }
  .site-balance .cta-band { display: flex; flex-direction: column; align-items: stretch; gap: 24px; padding: 24px; }
  .site-balance .cta-band h2 { font-size: 28px; }
  .site-balance .guide-section > h2 { font-size: 27px; }
  .site-balance .guide-step { padding-left: 0; padding-top: 22px; }
  .site-balance .guide-step .step-number { position: static; margin-bottom: 12px; }
  .site-balance .guide-section { margin-bottom: 40px; }
  .site-balance .guide-section + .guide-section { padding-top: 30px; }
  .site-balance .system-flow { display: flex; flex-direction: column; gap: 14px; }
  .site-balance .system-flow > .flow-arrow:nth-child(4) { display: block; }
  .site-balance .flow-arrow { transform: rotate(90deg); font-size: 22px; line-height: 1; }
  .site-balance .flow-node { padding: 22px; }
  .site-balance .faq-content h2 { font-size: 27px; }
  .site-balance .faq summary { padding-block: 19px; font-size: 16px; }
  .site-balance .faq details :is(p, ul) { padding-right: 8px; font-size: 16px; }
  .site-balance .legal-document h2 { font-size: 25px; line-height: 1.3; }
  .site-balance .legal-details, .site-balance .processing-grid { grid-template-columns: 1fr; }
  .site-balance .legal-details :is(dt, dd) { padding: 12px 15px; }
  .site-balance .spec-table { font-size: 14px; }
  .site-balance .spec-table :is(th, td) { min-width: 0; padding: 14px; }
  .site-balance .legal-document > section { margin-bottom: 28px; padding-bottom: 24px; }
}
