/* Shared page frame. Loaded after component styles; local exceptions remain explicit. */
@layer frame {
  :root {
    --site-width:1440px;
    --content-width:1200px;
    --reading-width:860px;
    --site-gutter:32px;
    --space-1:8px;
    --space-2:12px;
    --space-3:16px;
    --space-4:24px;
    --space-5:32px;
    --space-6:48px;
    --space-7:64px;
    --section-space:64px;
    --related-space:48px;
    --font-body:'Inter','Segoe UI',Arial,sans-serif;
    --type-caption:14px;
    --type-small:14px;
    --type-ui:14px;
    --type-body:16px;
    --type-reading:16px;
  }
  .site-container,.container {
    box-sizing:border-box;
    width:100%;
    max-width:var(--site-width);
    min-width:0;
    margin-inline:auto;
    padding-inline:var(--site-gutter);
  }
  
  
  .header,.home-hero,.footer,main {width:100%;max-width:none}
  body {font-family:var(--font-body);font-size:16px;line-height:1.6}
  button,input,select,textarea {font-family:inherit}
  h1,h2,h3 {font-family:var(--font-body);overflow-wrap:break-word}
  h1 {font-size:48px;font-weight:800;line-height:1.1;letter-spacing:-.035em}
  h2 {font-size:28px;font-weight:700;line-height:1.25;letter-spacing:-.025em}
  h3 {font-size:18px;font-weight:700;line-height:1.4}
  .section {padding-block:var(--section-space)}
  .section+.section {padding-top:0}
  main>.site-container {padding-bottom:var(--related-space)}
  main>.home-content {padding-bottom:0}
  main>.site-container:not(.home-content)>.section:last-child {padding-bottom:0}
  .section-head {gap:24px;margin-bottom:24px}
  .section-head h2,.home-catalog-head h2 {font-size:28px;line-height:1.25}
  .section-head p:not(.eyebrow) {font-size:16px;line-height:1.6}
  .section-head .text-link {flex-shrink:0}

  /* The same content edges as main, with no secondary width calculation. */
  .header .nav {min-height:72px;column-gap:24px;padding-block:0}
  .header .navlinks {gap:24px;padding-inline:0;min-width:0}
  .header .navlinks a {font-size:14px;line-height:1.5}
  .header .nav-actions {gap:12px;min-width:0}
  .header .brand-name {font-size:24px;font-weight:700}
  .header .header-sheet-link {font-size:14px;min-height:48px;padding:12px 16px;gap:8px}
  .header .header-sheet-link>[data-sheet-label],.header .mobile-sheet-link>[data-sheet-label] {white-space:nowrap}
  .header .header-sheet-link>.icon,.header .mobile-sheet-link>.icon {flex-shrink:0}
  .header .mobile-sheet-link {padding-block:12px;gap:12px}
  @media(min-width:1101px) {
    .header .nav {grid-template-columns:160px minmax(0,1fr) auto}
  }
  .breadcrumbs {padding-block:16px 0;line-height:1.5;font-size:14px;gap:8px}
  .page-head {padding-block:32px;margin-bottom:32px}
  .page-head h1 {font-size:48px;line-height:1.1;max-width:100%;font-weight:800}
  .page-head p {font-size:16px;line-height:1.65;max-width:760px;margin-top:16px}
  .page-head .eyebrow {font-size:14px;line-height:1.5;margin:0 0 12px}
  .article-meta {padding-bottom:24px}

  /* Brand opening: bounded text and full-width background. */
  .home-hero {padding-block:64px}
  .home-hero-layout {grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:48px}
  .home-hero-copy {max-width:680px;min-width:0}
  .home-title {max-width:680px;line-height:1.1}
  .home-title-keyword {font-size:48px;line-height:1.1;font-weight:800}
  .home-title-purpose {font-size:22px;font-weight:600;color:var(--ink);line-height:1.4;margin-top:16px}
  .home-hero-description {font-size:16px;line-height:1.65;max-width:620px;margin-top:24px}
  .home-sheet-variants {font-size:14px;line-height:1.6;margin-top:8px}
  .home-hero-actions {gap:12px 24px;margin-top:24px}
  .home-visual {height:360px;width:100%;max-width:600px}
  .home-sheet-mascot {right:0;max-width:336px}
  .home-sheet-sample {left:20px;top:40px;width:calc(48% - 20px)}
  .home-sheet-sample table,.home-sheet-sample caption,.home-sheet-sample tbody td,
  .home-sheet-sample thead th,.home-sheet-sample p {font-size:14px;line-height:1.5}
  .home-catalog {padding-block:32px 48px}
  .home-catalog .catalog-section {padding:0}
  .home-catalog-head {margin-bottom:24px}
  .home-catalog-head p:not(.eyebrow) {font-size:14px}
  .home-content .welcome-cards {max-width:none;padding-block:16px}
  .home-content .welcome-card h2 {font-size:16px;line-height:1.4}
  .home-content .welcome-card p {font-size:14px;line-height:1.6}

  /* Explanatory modules stay narrower and share the main left edge. */
  .article-layout,.calculator,.guide-grid,.route-band,.faq-layout,
  .home-content .compact-source-note {width:100%;max-width:var(--content-width);min-width:0}

  /* Reading width is independent of the site frame. */
  .article-layout {grid-template-columns:minmax(0,1fr) 280px;gap:48px;align-items:start}
  .prose {width:100%;max-width:var(--reading-width);min-width:0}
  .prose p,.prose li {font-size:16px;line-height:1.65;max-width:72ch}
  .prose p {margin-bottom:16px}
  .prose h2 {font-size:28px;line-height:1.25;margin-block:32px 16px}
  .prose h3 {font-size:18px;line-height:1.4;margin-block:24px 12px}
  .article-aside {min-width:0}
  .table-wrap {max-width:100%;min-width:0;overflow-x:auto}
  .table-wrap table,.prose table {width:100%;min-width:0;max-width:100%}
  .prose th,.prose td {overflow-wrap:anywhere;white-space:normal}
  .guide-grid {grid-template-columns:repeat(3,minmax(0,1fr));gap:24px}
  .guide-card h2 {font-size:24px;line-height:1.35}
  .guide-card p {font-size:16px;line-height:1.6}
  .faq-layout {gap:48px}

  /* Extra space adds columns; the sidebar has its own available-width budget. */
  .catalog-workspace {grid-template-columns:200px minmax(0,1fr);gap:32px}
  .catalog-workspace>*,.home-product-layout>*,.detail-layout>* {min-width:0}
  .product-grid:not(.is-table) {grid-template-columns:repeat(5,minmax(0,1fr));gap:20px}
  .catalog-workspace .product-grid:not(.is-table) {grid-template-columns:repeat(4,minmax(0,1fr))}
  .product-grid:not(.is-table) .product-content {padding:16px}
  .product-grid:not(.is-table) .product-title {font-size:16px;line-height:1.45;min-height:46.4px;margin-bottom:12px;-webkit-line-clamp:2}
  .product-grid:not(.is-table) .product-title a {display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;min-height:46.4px}
  .product-grid:not(.is-table) .product-cat {font-size:14px;line-height:1.5;margin-bottom:8px;letter-spacing:0}
  .product-grid:not(.is-table) .price-row {gap:12px;padding-top:12px;margin-top:auto}
  .price-row small {font-size:14px;line-height:1.5}
  .price-row strong {font-size:20px;line-height:1.4}
  .product-grid .price-row strong {font-size:16px;font-weight:600;line-height:1.5}
  .product-grid .product-go {background:transparent;color:var(--ink);border:1px solid var(--line);border-radius:8px}
  .product-grid .product-go:hover {background:var(--brand-soft);border-color:var(--brand-link);color:var(--ink)}
  .catalog-controls {display:grid;grid-template-columns:minmax(0,720px) 160px 144px auto;justify-content:start;gap:12px;padding:12px;margin-bottom:24px}
  .home-catalog .catalog-controls {padding:0;margin-bottom:24px}
  .catalog-controls.has-quick-budgets {grid-template-columns:minmax(0,720px) 160px auto}
  .catalog-controls .searchbox {min-width:0;min-height:48px;gap:10px}
  .catalog-controls .searchbox input {min-width:0;font-size:16px}
  .catalog-controls .select-control {width:100%;min-width:0;min-height:48px;font-size:14px;padding:12px 40px 12px 14px}
  .catalog-controls .view-toggle {gap:8px}
  .catalog-controls .icon-button {width:44px;height:48px}
  .results-meta {gap:12px 24px;font-size:14px;line-height:1.5;margin-block:0 24px}
  .catalog-disclaimer {font-size:14px;line-height:1.65;margin-top:24px}
  .pagination {gap:12px;margin-top:24px}
  .pagination [data-page-info],.home-category-tabs a small {font-size:14px;line-height:1.5}
  .detail-layout {gap:48px;margin-block:32px 0}
  .detail-info h1 {font-size:48px;line-height:1.1}
  .detail-actions {gap:12px;flex-wrap:wrap}
  .detail-note,.detail-facts {font-size:14px;line-height:1.6}
  .detail-sheet-discovery {margin-block:20px 0;padding-top:16px;border-top:1px solid var(--line);min-width:0}
  .detail-sheet-discovery p {font-size:14px;line-height:1.6;margin:0 0 4px;max-width:60ch}
  .detail-sheet-discovery>.text-link {display:inline-flex;align-items:center;min-height:44px;gap:8px;max-width:100%;padding-block:8px;font-size:14px;line-height:1.5}
  .detail-sheet-discovery>.text-link>.icon {flex-shrink:0}
  .detail-tools {gap:24px;margin-top:32px}
  .calculator {grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:32px}
  .calc-form {gap:24px;padding:32px;min-width:0}
  .field {min-width:0}
  .field label {display:block;font-size:14px;line-height:1.5;margin-bottom:8px}
  .field small {display:block;font-size:14px;line-height:1.5;margin-top:8px}
  .field input {width:100%;min-width:0;min-height:48px;font-size:16px;padding:12px 14px}
  .calc-result {padding:32px;min-width:0}
  .calc-result h2 {font-size:24px}
  .route-band {gap:32px;margin-block:0}
  .route-band p {font-size:16px;line-height:1.65}

  /* Compact footer: width follows the frame, groups retain their hierarchy. */
  .footer {padding-block:32px}
  .footer-main {gap:32px;padding-bottom:24px}
  .footer-navigation {gap:24px}
  .footer-brand p {font-size:14px;line-height:1.6}
  .footer-bottom,.footer-maintenance {font-size:14px;line-height:1.5}
  .footer-bottom {gap:12px 24px;padding-top:16px}
  .footer-meta {gap:8px 24px}
  .footer-legal {gap:8px 16px}

  @media(max-width:1439px) {
    :root {--site-gutter:24px}
    .product-grid:not(.is-table) {grid-template-columns:repeat(4,minmax(0,1fr))}
  }
  @media(max-width:1279px) {
    .product-grid:not(.is-table) {grid-template-columns:repeat(3,minmax(0,1fr))}
    .catalog-workspace {grid-template-columns:176px minmax(0,1fr);gap:24px}
    .catalog-workspace .product-grid:not(.is-table) {grid-template-columns:repeat(3,minmax(0,1fr))}
    .article-layout {grid-template-columns:minmax(0,1fr) 240px;gap:32px}
  }
  @media(max-width:1100px) {
    .header .navlinks {padding:12px var(--site-gutter) 20px;gap:4px}
  }
  @media(min-width:651px) and (max-width:1100px) {
    .home-sheet-mascot {right:50%;transform:translateX(50%)}
  }
  @media(max-width:1024px) {
    :root {--site-gutter:24px;--section-space:48px;--related-space:32px}
    .home-hero {padding-block:48px}
    .home-title-purpose {font-size:20px}
    .home-hero-layout {grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:32px}
    .home-visual {height:300px}
    .home-sheet-mascot {max-width:280px}
    .home-catalog {padding-block:48px 32px}
    .article-layout {grid-template-columns:minmax(0,1fr);gap:32px}
    .prose {max-width:860px}
    .catalog-controls {grid-template-columns:160px 144px auto minmax(0,1fr)}
    .catalog-controls .searchbox {grid-column:1/-1;width:100%;max-width:720px}
    .catalog-controls.has-quick-budgets {grid-template-columns:160px auto minmax(0,1fr)}
    .guide-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
    .calculator {grid-template-columns:minmax(0,1fr);gap:24px}
  }
  @media(max-width:1023px) {
    .catalog-workspace {grid-template-columns:minmax(0,1fr);gap:24px}
    .catalog-sidebar {position:static;padding:0}
    .catalog-sidebar nav {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;overflow:visible}
    .catalog-sidebar nav a {min-width:0;white-space:normal}
    .catalog-sidebar .sidebar-tool {display:none}
  }
  @media(max-width:799px) {
    .product-grid:not(.is-table),.catalog-workspace .product-grid:not(.is-table) {grid-template-columns:repeat(2,minmax(0,1fr))}
  }
  @media(max-width:899px) {
    .detail-layout {grid-template-columns:minmax(0,1fr);gap:24px}
    .faq-layout {grid-template-columns:minmax(0,1fr);gap:24px}
  }
  @media(max-width:650px) {
    .header .nav {min-height:68px;gap:16px}
    .header .navlinks {padding:12px var(--site-gutter) 20px;gap:0}
    .header .nav-actions {gap:8px}
    .header .header-sheet-link {display:none}
    .home-hero-layout {grid-template-columns:minmax(0,1fr) 88px;gap:0 12px}
    .home-visual {height:88px;width:88px;margin-top:0}
    .home-sheet-mascot {width:88px;max-width:none;right:0;bottom:6px}
    .home-hero-description {grid-column:1/-1}
    .home-hero-actions {gap:12px}
    .home-content .welcome-cards {padding-block:8px}
    .home-content .welcome-card {padding-block:12px}
    .home-catalog-head {gap:8px;margin-bottom:16px}
    .catalog-controls,.catalog-controls.has-quick-budgets,.home-catalog .catalog-controls {grid-template-columns:repeat(2,minmax(0,1fr));padding:12px}
    .catalog-controls .view-toggle {display:none}
    .catalog-controls.has-quick-budgets>[data-sort] {grid-column:1/-1}
    .calc-form,.calc-result {padding:24px}
    .calc-form {grid-template-columns:minmax(0,1fr)}
    .detail-tools {grid-template-columns:minmax(0,1fr);gap:16px}
    .footer {padding-block:24px max(24px,env(safe-area-inset-bottom))}
    .footer-main {gap:24px;padding-bottom:16px}
    .footer-sheet-link {font-size:14px;max-width:100%;white-space:normal}
    .footer-bottom {padding-top:16px}
  }
  @media(max-width:767px) {
    :root {--site-gutter:16px}
    .product-grid:not(.is-table),.catalog-workspace .product-grid:not(.is-table) {grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
    .product-grid:not(.is-table) .product-content {padding:12px}
    .product-grid:not(.is-table) .product-title {font-size:14px;line-height:1.5;min-height:63px;-webkit-line-clamp:3}
    .product-grid:not(.is-table) .product-cat {min-height:21px;margin-bottom:8px}
    .product-grid:not(.is-table) .product-card-category {display:none}
    .product-grid:not(.is-table) .product-title a {min-height:63px;max-height:63px;-webkit-line-clamp:3}
    .mobile-category-picker:not([hidden]) {display:grid;gap:8px;margin:0 0 20px;min-width:0}
    .mobile-category-picker>span {font-size:14px;font-weight:700;color:var(--ink)}
    .mobile-category-picker select {display:block;width:100%;min-width:0;min-height:48px;padding:12px 40px 12px 14px;background-color:var(--white);color:var(--ink);border:1px solid var(--line);border-radius:8px;font:inherit;font-size:16px;line-height:1.5}
    .has-mobile-picker>[data-category-links],.has-mobile-picker>.sidebar-label {display:none}
    .home-category-sidebar.has-mobile-picker .home-category-tabs {display:none}
    .home-category-sidebar .mobile-category-picker,.catalog-sidebar .mobile-category-picker {margin-bottom:0}
    .home-catalog .catalog-controls {grid-template-columns:repeat(2,minmax(0,1fr))}
    .home-catalog .catalog-controls .searchbox {grid-column:1/-1}
    .home-catalog .catalog-controls .view-toggle {display:none}
  }
  @media(max-width:640px) {
    :root {--section-space:32px;--related-space:24px}
    h1,.page-head h1,.detail-info h1,.home-title-keyword {font-size:32px;line-height:1.1}
    h2,.section-head h2,.home-catalog-head h2,.prose h2 {font-size:24px;line-height:1.3}
    h3,.prose h3 {font-size:18px;line-height:1.4}
    .home-hero {padding-block:32px}
    .home-title-purpose {font-size:18px;line-height:1.45;margin-top:12px}
    .home-hero-description {margin-top:16px}
    .home-catalog {padding-block:32px 24px}
    .page-head {padding-block:24px;margin-bottom:24px}
    .page-head p {margin-top:12px}
    .guide-grid {grid-template-columns:minmax(0,1fr);gap:16px}
    .guide-card h2 {font-size:22px}
    .guide-card {display:flex;flex-direction:column}
    .guide-card .guide-visual {flex-direction:row;align-items:center;justify-content:flex-start;min-height:64px;height:auto;gap:12px;padding:16px}
    .guide-card .guide-visual>.icon {margin-left:auto}
    .guide-card .guide-visual small {min-width:0;white-space:normal;overflow-wrap:anywhere;text-align:right;font-size:14px}
    .guide-card .guide-body {padding:20px}
    .product-grid:not(.is-table) .product-content {padding:12px}
    .price-row strong {font-size:18px}
    .results-meta {gap:8px;font-size:14px;margin-bottom:20px}
    .route-band {padding:24px;gap:24px}
  }
  @media(max-width:359px) {
    .product-grid:not(.is-table),.catalog-workspace .product-grid:not(.is-table) {grid-template-columns:minmax(0,1fr)}
    .product-grid:not(.is-table) .product-title,.product-grid:not(.is-table) .product-title a {min-height:46.4px;max-height:46.4px;-webkit-line-clamp:2}
    .product-grid:not(.is-table) .product-card-category {display:inline}
    .home-hero-layout {grid-template-columns:minmax(0,1fr) 76px;gap:0 12px}
    .home-title-keyword {max-width:calc(100% - 88px)}
    .home-visual {width:76px;height:96px}
    .home-sheet-mascot {width:76px}
  }
}
