/* Shared mobile finish. Loaded after the page styles so every route stays consistent. */
html { -webkit-text-size-adjust: 100%; }

@media screen and (max-width: 960px) {
  :root { --mobile-gutter: 24px; --mobile-header: 76px; }
  html { scroll-padding-top: calc(var(--mobile-header) + 20px); }
  .wrap { width: calc(100% - var(--mobile-gutter) * 2); }
  .header {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    max-width: none;
    height: var(--mobile-header);
    gap: 12px;
    padding-inline: max(var(--mobile-gutter), env(safe-area-inset-left)) max(var(--mobile-gutter), env(safe-area-inset-right));
    background: #f4f3ebf5;
    border-bottom: 1px solid #d5d9cd99;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
  .header .brand .brand-logo { width: 142px; }
  .desktop-nav, .brand-note { display: none; }
  .header-cta {
    margin-left: auto;
    min-height: 44px;
    align-items: center;
    padding: 11px 12px;
    gap: 10px;
    border: 0;
    border-radius: 8px;
    background: var(--ink);
    color: var(--paper);
    font-size: 11px;
    white-space: nowrap;
  }
  .menu-toggle {
    display: flex;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 50%;
  }
  .menu-toggle span { width: 18px; height: 1px; background: var(--ink); transition: transform .2s; }
  .menu-toggle[aria-expanded=true] { background: var(--lime); border-color: var(--lime); }
  .menu-toggle[aria-expanded=true] span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .menu-toggle[aria-expanded=true] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .mobile-nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    inset: calc(100% + 8px) 16px auto;
    max-height: calc(100dvh - var(--mobile-header) - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 22px 20px;
    gap: 0;
    border: 1px solid #ffffff18;
    border-radius: 18px;
    background: var(--dark);
    color: var(--paper);
    box-shadow: 0 20px 45px #10251c33;
    counter-reset: navigation;
  }
  .mobile-nav a { display: flex; align-items: center; gap: 16px; min-height: 58px; padding: 14px 0; font-size: 20px; border-bottom: 1px solid #ffffff26; }
  .mobile-nav a::before { counter-increment: navigation; content: '0' counter(navigation); font-size: 10px; color: #bac6b3; }
  .mobile-nav a:last-child { justify-content: space-between; margin-top: 16px; padding-inline: 16px; border: 0; border-radius: 8px; background: var(--lime); color: var(--ink); font-size: 16px; }
  .mobile-nav a:last-child::before { content: none; }
  .mobile-nav a:focus-visible { outline-color: var(--lime); outline-offset: 2px; }
  .mobile-nav a:last-child:focus-visible { outline-color: var(--paper); }
  .menu-open .quick-contact { visibility: hidden; }
  .article-toc { top: calc(var(--mobile-header) + 20px); }
  .article-section { scroll-margin-top: 20px; }
}

@media screen and (max-width: 780px) {
  :root { --mobile-gutter: 24px; }
  .section-space { padding-block: 64px; }
  .section-top { margin-bottom: 28px; }
  .eyebrow, .hero .eyebrow { font-size: 10px; letter-spacing: 1.2px; }
  .button { min-height: 56px; border-radius: 10px; font-size: 14px; }
  .text-link, .hero-secondary { min-height: 44px; font-size: 14px; align-items: center; }
  h2 { font-size: clamp(34px, 8.7vw, 48px); letter-spacing: -1.5px; line-height: 1.12; }
  .section-heading { gap: 22px; margin-bottom: 32px; }
  .section-heading > p, .method-copy > p, .example-intro > p, .contact-copy > p,
  .sector-text > p, .deliverable-list p, .journal-section-heading p,
  .featured-copy p, .journal-intro p { font-size: 15px; line-height: 1.75; }

  /* A compact first screen and a straight, readable bill explorer. */
  .hero { gap: 30px; padding-block: 32px 40px; }
  .hero-copy { padding-top: 0; }
  .hero h1 { font-size: clamp(50px, 14.4vw, 80px); letter-spacing: -2.8px; line-height: 1.01; margin: 24px 0; }
  .hero h1 em { font-size: 1.16em; letter-spacing: -2px; }
  .hero-description { max-width: 510px; font-size: 15px; line-height: 1.7; margin-bottom: 24px; }
  .hero-actions { width: 100%; gap: 12px 24px; }
  .hero-actions .button { font-size: 14px; min-height: 56px; padding-inline: 20px; }
  .hero-secondary { padding-block: 10px; }
  .hero-trust { gap: 10px 16px; margin-top: 18px; }
  .hero-trust li { font-size: 11px; line-height: 1.5; }
  .hero-footer { font-size: 11px; line-height: 1.7; margin-top: 18px; }
  .hero-visual { min-height: 0; max-width: none; padding: 156px 20px 20px; border-radius: 18px; }
  .hero-visual > img { inset: 0; object-position: 50% 40%; }
  .photo-top { top: 20px; left: 24px; right: 24px; font-size: 8px; letter-spacing: 1px; }
  .photo-top > span:first-child { max-width: 220px; }
  .photo-top > span:last-child, .hero-stamp { display: none; }
  .photo-caption { inset: 52px 24px auto; }
  .photo-caption > span { font-size: 11px; }
  .photo-caption p { font-size: 34px; line-height: 1; margin-top: 8px; }
  .photo-caption a { top: 35px; right: 0; bottom: auto; width: 44px; height: 44px; font-size: 22px; }
  .bill-radar { margin: 0; padding: 22px 24px 12px; transform: none; border-radius: 12px; box-shadow: 0 8px 24px #0b1c1626; }
  .radar-top > span { font-size: 10px; letter-spacing: 1.6px; }
  .radar-intro { font-size: 30px; margin: 12px 0 20px; }
  .radar-options { gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; }
  .radar-options button { min-height: 44px; padding: 10px 4px; margin: 0; border: 0; border-radius: 6px; font-size: 13px; }
  .radar-options button[aria-pressed=true] { background: var(--ink); color: var(--paper); }
  .radar-detail { min-height: 160px; padding-block: 20px 16px; }
  .radar-detail h2 { font-size: 17px; line-height: 1.4; }
  .radar-detail p { font-size: 13px; line-height: 1.7; }
  .radar-bottom { padding-top: 6px; }
  .radar-bottom > span { font-size: 9px; letter-spacing: .6px; }
  .radar-bottom a { display: grid; place-items: center; width: 44px; height: 44px; }

  .principles { gap: 16px; padding-block: 28px; }
  .principles > p { font-size: 15px; }
  .principles > div { font-size: 13px; gap: 14px; }
  .principles > div > span { display: grid; place-items: center; flex: 0 0 28px; height: 28px; background: #e5e9da; border-radius: 50%; font-size: 10px; }
  .question-start { padding-block: 36px; }
  .question-start .eyebrow { font-size: 10px; }
  .question-links { gap: 10px; }
  .question-links a { min-height: 56px; font-size: 14px; padding: 16px; background: #fafaf4; border-radius: 10px; }
  .question-links a > span { margin-left: auto; }
  .services.section-space { padding-top: 64px; }
  .service-row { grid-template-columns: 24px minmax(0, 1fr) 38px; gap: 12px; padding-block: 28px; }
  .service-row h3 { font-size: 24px; }
  .service-row p { font-size: 15px; line-height: 1.75; }
  .service-tag { font-size: 9px; line-height: 1.6; letter-spacing: 1px; }
  .service-number { font-size: 11px; }
  .method h2, .example h2, .deliverable-heading h2, .contact h2 { font-size: clamp(34px, 8.7vw, 48px); }
  .method-steps summary { min-height: 64px; font-size: 14px; line-height: 1.5; gap: 12px; }
  .method-steps summary b, .faq-list summary span { flex-shrink: 0; }
  .method-steps details p { font-size: 14px; line-height: 1.75; padding-left: 27px; }
  .analysis-panel { max-width: none; padding: 24px 20px; border-radius: 16px; }
  .analysis-header { font-size: 10px; letter-spacing: 1px; }
  .analysis-panel h3 { font-size: 30px; }
  .chart-controls, .example-controls { width: 100%; max-width: none; border-radius: 9px; }
  .chart-controls button, .example-controls button { flex: 1; min-height: 44px; font-size: 12px; line-height: 1.4; padding: 10px 8px; border-radius: 6px; }
  .chart-insight strong { font-size: 14px; line-height: 1.5; }
  .chart-insight p { font-size: 13px; line-height: 1.7; }
  .chart-disclaimer { font-size: 11px; line-height: 1.7; }
  .method-bottom { gap: 20px; flex-wrap: wrap; }
  .method-bottom > span { font-size: 10px; max-width: none; }
  .method-bottom > p { font-size: 13px; }
  .deliverable-list { gap: 28px; }
  .deliverable-list article { padding-left: 20px; border-left: 2px solid #bfc8ae; }
  .deliverable-list article > span { font-size: 10px; }
  .deliverable-list h3 { font-size: 24px; }

  .sector-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border: 0; }
  .sector-tabs button { min-height: 52px; padding: 12px; margin: 0; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; line-height: 1.5; gap: 5px; }
  .sector-tabs button[aria-selected=true] { border: 1px solid var(--ink); background: var(--ink); color: var(--paper); }
  .sector-panel { grid-template-columns: 1fr; gap: 24px; }
  .sector-illustration { min-height: 0; border-radius: 14px; padding: 16px 20px; }
  .sector-illustration svg { max-height: 220px; }
  .sector-illustration > div { font-size: 9px; line-height: 1.5; gap: 12px; }
  .sector-text .eyebrow { font-size: 10px; }
  .sector-text h3 { font-size: 34px; }
  .sector-text li { font-size: 14px; line-height: 1.6; }
  .example-label { font-size: 10px; line-height: 1.7; }
  .cost-example { padding: 24px 20px; max-width: none; border: 1px solid var(--line); border-radius: 16px; background: #fafaf4; }
  .cost-bar-row > div:first-child { font-size: 13px; line-height: 1.5; }
  .cost-track { border-radius: 4px; overflow: hidden; }
  .cost-result { flex-wrap: wrap; gap: 8px 16px; }
  .cost-result > span { font-size: 13px; }
  .cost-result small, .example-note { font-size: 11px; line-height: 1.7; }
  .cost-result > strong { font-size: 44px; white-space: nowrap; }
  .cost-detail { font-size: 12px; line-height: 1.7; }
  .faq-list summary { min-height: 64px; font-size: 15px; line-height: 1.6; }
  .faq-list details p { font-size: 15px; line-height: 1.75; }
  .invitation-action { max-width: none; width: 100%; }
  .invitation-action .button { font-size: 14px; width: 100%; min-width: 0; }
  .invitation-action > p { font-size: 12px; }
  .quick-contact { left: 16px; right: 16px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); min-height: 56px; border-radius: 12px; font-size: 14px; padding: 16px 20px; box-shadow: 0 6px 28px #23392e33; }
  html:has(.quick-contact:not([hidden])) { scroll-padding-bottom: 90px; }
  .footer-top > p { font-size: 12px; }
  .footer-guides { gap: 8px 24px; font-size: 13px; padding-block: 16px; }
  .footer-guides a, .footer-bottom button { display: inline-flex; align-items: center; min-height: 44px; }
  .footer-bottom, .footer-bottom button { font-size: 11px; }
  .back-top { min-height: 44px; font-size: 13px; }
  .back-top > span { width: 44px; height: 44px; }
  .footer { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  dialog { max-height: calc(100dvh - 32px); border-radius: 16px; padding: 44px 24px 24px; }
  dialog h2 { font-size: clamp(30px, 8vw, 40px); }
  dialog p { font-size: 15px; overflow-wrap: anywhere; }
  .dialog-close { width: 44px; height: 44px; top: 6px; right: 8px; }

  /* Editorial pages and the enquiry form use the same mobile scale. */
  .guide-cover, .journal-cta, .article-contact { border-radius: 14px; }
  .guide-cover > span { font-size: 9px; letter-spacing: 1px; }
  .guide-category { font-size: 10px; }
  .guide-card p { font-size: 15px; line-height: 1.75; }
  .guide-read { min-height: 44px; align-items: center; padding-top: 10px; font-size: 13px; }
  .journal-intro h1 { font-size: clamp(40px, 10vw, 64px); }
  .article-header h1 { font-size: clamp(36px, 9.5vw, 54px); line-height: 1.12; }
  .article-header .eyebrow { font-size: 10px; }
  .article-deck { font-size: 16px; line-height: 1.75; }
  .article-byline > div { font-size: 12px; }
  .article-byline > div > span:last-child { font-size: 11px; }
  .breadcrumbs { font-size: 12px; align-items: center; padding-top: 16px; gap: 8px; }
  .breadcrumbs a { display: inline-flex; align-items: center; min-height: 44px; }
  .article-toc { padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; background: #eceee3; }
  .article-toc summary { min-height: 44px; align-items: center; padding-bottom: 0; border: 0; font-size: 12px; }
  .article-toc nav a { min-height: 44px; align-items: baseline; font-size: 14px; padding-block: 12px; }
  .article-toc nav a > span { font-size: 10px; }
  .article-body p, .article-body li { font-size: 16px; line-height: 1.85; }
  .article-body { min-width: 0; overflow-wrap: break-word; }
  .editorial-note { border-radius: 0 12px 12px 0; }
  .editorial-note p, .editorial-note li { font-size: 15px; }
  .editorial-calculation p, .article-signoff p { font-size: 13px; }
  .article-signoff > span, .editorial-calculation > span { font-size: 10px; }
  .article-contact p { font-size: 15px; }
  .article-contact .button, .journal-cta .button { font-size: 14px; }
  .journal-cta .eyebrow { font-size: 10px; }
  .library-heading { flex-wrap: wrap; gap: 12px; }
  .library-heading > a { min-height: 44px; display: inline-flex; align-items: center; font-size: 13px; }
  .inquiry-header { height: 76px; width: calc(100% - 40px); gap: 16px; }
  .return-link { min-height: 44px; font-size: 12px; gap: 8px; }
  .inquiry-main { margin-top: 28px; }
  .inquiry-intro .eyebrow { font-size: 10px; }
  .inquiry-intro > p { font-size: 15px; line-height: 1.75; }
  .inquiry-intro h1 { font-size: clamp(38px, 10vw, 56px); }
  .inquiry-intro h1 em { white-space: normal; }
  .inquiry-form { padding: 26px 22px; }
  .inquiry-intro, .inquiry-form { animation: none; }
  .inquiry-field > label, .inquiry-sectors legend { font-size: 14px; line-height: 1.5; }
  .inquiry-field label > span, .inquiry-sectors legend > span { font-size: 12px; }
  .inquiry-field input, .inquiry-field textarea { font-size: 16px; }
  .sector-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sector-options span { display: flex; align-items: center; justify-content: center; min-height: 48px; height: 100%; padding: 10px; font-size: 13px; text-align: center; }
  .inquiry-note { font-size: 12px; }
  .inquiry-note button { min-height: 44px; padding-inline: 4px; }
  .inquiry-direct { font-size: 13px; }
  .inquiry-direct a { min-height: 44px; padding-block: 10px; font-size: 16px; }
  .inquiry-footer { align-items: center; font-size: 11px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .inquiry-footer button, .copy-button { min-height: 44px; }

  /* Keep the first screen immediate; lighter transitions further down. */
  .motion-ready .hero-copy [data-reveal] { opacity: 1; transform: none; transition: none; }
  .motion-ready [data-reveal] { transition-duration: .45s; transition-delay: 0ms; }
  .motion-ready [data-reveal="image"]::before { display: none; }
  .motion-ready .hero-visual > img { transform: none; will-change: auto; }
}

@media screen and (max-width: 540px) {
  :root { --mobile-gutter: 20px; }
  .header { gap: 8px; }
  .header .brand .brand-logo { width: 130px; }
  .hero { padding-top: 28px; }
  .hero-actions .button { width: 100%; }
  .hero-visual { padding-inline: 12px; padding-bottom: 12px; }
  .bill-radar { padding-inline: 20px; }
  .radar-detail { min-height: 174px; }
  .principles { grid-template-columns: 1fr; }
  .principles > p { grid-row: auto; }
  .principles > div:last-child { grid-column: auto; }
  .service-row > div { grid-column: 1 / -1; }
  .guide-grid, .related-grid { gap: 34px; }
  .guide-card > a { padding-bottom: 8px; }
  .journal-section-heading h2 { font-size: 38px; }
  .article-toc nav { grid-template-columns: 1fr; }
  .editorial-calculation > div { flex-wrap: wrap; font-size: 14px; gap: 8px 12px; }
  .inquiry-row { grid-template-columns: 1fr; gap: 0; }
}

@media screen and (max-width: 359px) {
  :root { --mobile-gutter: 16px; }
  .header .brand .brand-logo { width: 138px; }
  .header-cta { display: none; }
  .menu-toggle { margin-left: auto; }
  .hero h1 { font-size: 48px; }
  .hero .eyebrow { font-size: 9px; letter-spacing: .8px; }
  .bill-radar { padding-inline: 16px; }
  .radar-detail { min-height: 196px; }
  .photo-caption p { font-size: 31px; }
  .sector-tabs button { font-size: 12px; }
  .inquiry-header .brand .brand-logo { width: 125px; }
  .inquiry-form { padding-inline: 18px; }
  .inquiry-submit { font-size: 13px; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .motion-ready [data-reveal] { transition: none; }
}
