/* LaterStages v1.13.0 — targeted mobile UX and national clarity.
   Based ONLY on the known-working v1.11.0 archive; does not import v1.12.
   Keep approved Concept #8 logo art, page structure, menus, and routes unchanged.
   No global body/HTML width clipping; responsive overflow must actually be fixed. */

/* Dark hero sections require readable text. Applied to the existing banner component only. */
@media (max-width: 960px) {
  section.ls-banner.band {
    background: #102b33 !important;
    color: #e7f2ef !important;
  }
  section.ls-banner.band .crumbs,
  section.ls-banner.band .crumbs a,
  section.ls-banner.band .crumbs span,
  section.ls-banner.band p.lede {color: #dbe9e6 !important;}
  section.ls-banner.band h1,
  section.ls-banner.band h2 {color: #ffffff !important;}
  section.ls-banner.band .eyebrow {color: #68d1c4 !important;}
  /* Separate light content cards from dark section backgrounds. */
  .ls-main .ls-intro {background: #f1f8f5 !important; color: #17313a !important;}
  .ls-main .ls-intro :is(h2, h3, p:not(.ls-kicker)),
  .ls-main .ls-intro .ls-feature-n :is(b, span) {color:#17313a !important;}
  .ls-main .ls-intro .ls-kicker {color: #07667b !important;}
  .ls-main .ls-intro .ls-feature-n {background:transparent !important;}
  /* Responsive navigation is always a light, high-contrast surface. */
  html.ls-js header.site nav.site.ls17-topnav .menu-panel,
  header.site nav.site.ls17-topnav .menu-panel {
    background:#fffefa !important; color:#143944 !important;
    border:1px solid #d3e1dc !important;
  }
  header.site nav.site.ls17-topnav .menu-panel :is(a, li, p:not(.menu-title), span:not(.menu-count)) {
    color:#173a45 !important;
  }
  header.site nav.site.ls17-topnav .menu-panel .menu-title {color:#08657a !important;}
  header.site nav.site.ls17-topnav .menu-panel :is(.menu-count, .ls-nav-badge) {
    background:#e2f2ee !important; color:#075b60 !important;
  }
}

@media (max-width: 760px) {
  /* Header: approved raster artwork rendered larger, with predictable flex wrapping. */
  header.site .wrap.ls17-nav-wrap {padding:11px clamp(12px,4vw,20px) 14px;gap:8px 9px;min-height:0;}
  header.site a.ls18-brand {display:inline-flex;align-items:center;gap:clamp(6px,1.6vw,9px);min-width:0;max-width:calc(100% - 87px);}
  header.site a.ls18-brand>img {
    width:clamp(46px,14vw,59px) !important;
    height:clamp(46px,14vw,59px) !important;
    flex:0 0 auto;object-fit:contain;
  }
  header.site .ls18-word-stack b {
    width:clamp(151px,calc(49vw - 12px),192px) !important;
    height:clamp(47px,15vw,62px) !important;
    max-width:100%;background-size:contain !important;
  }
  header.site .ls18-word-stack small {font-size:clamp(.37rem,1.45vw,.47rem) !important;letter-spacing:.04em !important;margin:-4px 0 0 2px !important;}
  html.ls-js header.site .ls-mobile-toggle {
    margin-left:auto;min-width:75px;min-height:42px;
    font-size:.9rem;padding:8px 6px;
  }
  html.ls-js header.site .sl-open {margin-left:0;min-height:43px;padding:8px 14px;font-size:.9rem;}
  html.ls-js header.site nav.site.ls17-topnav {min-width:0;max-width:100%;box-sizing:border-box;}
  html.ls-js header.site nav.site.ls17-topnav > details.menu > summary {padding:10px 12px;min-height:43px;}
  html.ls-js header.site nav.site.ls17-topnav .menu-panel {box-sizing:border-box;width:100%;max-width:100%;padding:17px 16px;}
  header.site nav.site.ls17-topnav .menu-panel .menu-group {min-width:0;}
  header.site nav.site.ls17-topnav .menu-panel .menu-group a {overflow-wrap:anywhere;min-height:39px;}

  /* Hero: actual hierarchy (overline > heading > explainer > state links > search). */
  .ls17-homehero .wrap {padding-top:34px;padding-bottom:35px;}
  .ls17-homehero .ls17-hero-copy {min-width:0;max-width:100%;}
  .ls17-homehero .eyebrow {font-size:.73rem;letter-spacing:.115em;line-height:1.55;max-width:36ch;margin:0 0 20px;}
  .ls17-homehero h1 {
    font-size:clamp(2.6rem,11vw,3.2rem) !important;
    line-height:1.065;letter-spacing:-.043em;max-width:100%;margin:0 0 22px;
    text-wrap:balance;overflow-wrap:normal;
  }
  .ls17-homehero p.lede {
    font-size:clamp(1.025rem,4.35vw,1.12rem);line-height:1.57;
    max-width:39ch;margin:0 0 16px;color:#415e65;
  }
  .ls17-homehero .ls13-states {margin:0 0 19px;padding:0;font-size:.89rem;line-height:1.65;color:#3e5a62;max-width:45ch;}
  .ls17-homehero .ls13-states a {font-weight:750;color:#08657a;text-underline-offset:3px;}
  .ls17-homehero .ls19-language-cta {display:inline-block;margin-bottom:18px;font-size:.96rem;}
  .ls17-homehero .sbox.big {max-width:100%;min-width:0;}
  .ls17-homehero .sbox input {min-width:0;max-width:100%;font-size:16px;}
  .ls17-homehero .small.muted {font-size:.85rem;line-height:1.75;margin-top:14px;}

  /* Sections on older compiled templates should wrap at viewport width. */
  .ls17-page.wrap, .ls17-page .ls17-panel,
  .ls17-page .ls17-grid, .ls17-page .ls17-lede,
  .ls17-page .ls17-table-wrap {min-width:0;max-width:100%;box-sizing:border-box;}
  .ls17-page.wrap {width:100%;}
  .ls17-page h1 {max-width:100%;font-size:clamp(2.15rem,9.5vw,3.05rem) !important;line-height:1.1;overflow-wrap:break-word;}
  .ls17-page .ls17-lede {font-size:1.03rem;line-height:1.58;overflow-wrap:break-word;}
  .ls17-page .ls17-panel {padding:20px 16px;}
  .ls17-page .ls17-panel h2 {font-size:clamp(1.7rem,7vw,2.2rem);line-height:1.15;}
  .ls17-page .ls17-grid {grid-template-columns:minmax(0,1fr) !important;gap:13px;}
  .ls17-filterbar {gap:8px;}
  .ls17-filterbar button {font-size:.83rem;min-height:41px;max-width:100%;}

  /* The 12-category comparison: real mobile cards, not an oversized hidden table. */
  .ls17-table-wrap {overflow:visible !important;width:100%;max-width:100%;}
  .ls17-table {display:block;width:100% !important;min-width:0 !important;max-width:100% !important;border:0;background:transparent;}
  .ls17-table thead {display:none !important;}
  .ls17-table tbody {display:block;width:100%;}
  .ls17-table tbody tr:not([hidden]) {
    display:block !important;width:100%;min-width:0;
    margin:0 0 17px;padding:3px 15px 4px;
    background:#fff;border:1px solid #d6e4df;border-radius:16px;
    box-shadow:0 4px 12px rgba(16,45,54,.045);
  }
  .ls17-table tbody tr[hidden] {display:none !important;}
  .ls17-table tbody td {
    display:block !important;width:auto !important;min-width:0 !important;
    padding:11px 0 !important;border:0;border-bottom:1px solid #e5eeeb;
    color:#26444c;font-size:.93rem;line-height:1.5;overflow-wrap:break-word;
  }
  .ls17-table tbody td:last-child {border-bottom:0;}
  .ls17-table tbody td::before {
    content:attr(data-ls13-label);display:block;
    margin:0 0 5px;color:#08657a;font-size:.72rem;
    font-family:'Public Sans Variable',Arial,sans-serif;
    font-weight:800;letter-spacing:.085em;text-transform:uppercase;
  }
  .ls17-table tbody td:first-child {font-size:1.12rem;font-weight:800;color:#17313a;padding-top:17px !important;}
  .ls17-table tbody td:first-child::before {display:none;}
  .ls17-table tbody td a {color:#075d6b;overflow-wrap:anywhere;}
}

/* Keep text legible and logo inside very narrow phones without blanket clipping. */
@media(max-width:350px) {
  header.site .ls18-word-stack b {width:142px !important;height:46px !important;}
  header.site .ls18-brand>img {width:43px !important;height:43px !important;}
  .ls17-homehero h1 {font-size:2.38rem !important;}
  .ls17-page h1 {font-size:2.1rem !important;}
}

/* Responsive containment for genuine small-screen min-content issues in
   existing California provider, cost and search templates. Not global clipping. */
@media(max-width:760px) {
  section.band > .wrap {min-width:0;max-width:calc(100% - 2.3rem);box-sizing:border-box;}
  section.band .sbox.big,section.band .sbox-field {min-width:0;max-width:100%;box-sizing:border-box;}
  main.wrap .ls110-national-banner,
  main.wrap section.guides,
  main.wrap section.ls17-calculator {
    min-width:0 !important;max-width:100% !important;
    width:100% !important;box-sizing:border-box;
  }
  main.wrap section.guides {grid-template-columns:minmax(0,1fr) !important;}
  main.wrap section.guides .card {min-width:0;max-width:100%;box-sizing:border-box;}
  main.wrap .ls17-calculator .ls17-calc-grid {grid-template-columns:minmax(0,1fr) !important;min-width:0;}
  main.wrap .ls17-calculator :is(input,select) {min-width:0;max-width:100%;box-sizing:border-box;}
  main.wrap .table-wrap {display:block;max-width:100% !important;min-width:0 !important;overflow-x:auto !important;box-sizing:border-box;-webkit-overflow-scrolling:touch;}
  main.wrap .table-wrap table {max-width:none;}
}

/* A landscape phone or small tablet shouldn't have a 1,200px body either.
   Preserve a conventional scrollable data table at tablet widths. */
@media(min-width:761px) and (max-width:1150px) {
  main.ls17-page.wrap, main.ls17-page.wrap .ls17-panel,
  main.ls17-page.wrap .ls17-grid,main.ls17-page.wrap .ls17-table-wrap {
    max-width:100%;min-width:0;box-sizing:border-box;
  }
  main.ls17-page.wrap .ls17-panel {width:100%;}
  main.ls17-page.wrap .ls17-table-wrap {display:block;max-width:100%;overflow-x:auto !important;-webkit-overflow-scrolling:touch;}
  main.ls17-page.wrap .ls17-table {min-width:1050px;}
  .ls13-table-hint {display:block;font-size:.87rem;color:#48646b;line-height:1.5;margin:0 0 10px;}
}
@media(max-width:760px), (min-width:1151px) {.ls13-table-hint {display:none;}}
.ls13-state-note {font-size:.86rem;line-height:1.6;color:#516970;padding:12px 0 0;border-top:1px solid #dbe6e2;}
@media(max-width:760px){
  main.wrap {width:calc(100% - 2.5rem) !important;max-width:calc(100% - 2.5rem) !important;min-width:0 !important;box-sizing:border-box;}
  main.wrap section.card.stack {width:100%;max-width:100%;min-width:0;box-sizing:border-box;}
  main.wrap .table-wrap {width:100% !important;max-width:100% !important;min-width:0 !important;}
}
@media(max-width:350px){
  section.band > .wrap {width:calc(100% - 2.5rem) !important;max-width:calc(100% - 2.5rem) !important;min-width:0 !important;box-sizing:border-box;}
}
/* Avoid inherited min-content grid tracks stretching narrow provider and city pages. */
@media(max-width:760px) {
  main.wrap {grid-template-columns:minmax(0,1fr) !important;}
  main.wrap > section.stack,main.wrap > section.card.stack,
  main.wrap .cats,main.wrap .counties {min-width:0 !important;max-width:100% !important;box-sizing:border-box;}
  main.wrap .cats,main.wrap .counties {grid-template-columns:minmax(0,1fr) !important;}
}
@media(max-width:480px) {
  main.wrap .ls17-calculator .ls17-output {display:grid;grid-template-columns:minmax(0,1fr) !important;gap:12px;min-width:0;}
  main.wrap .ls17-calculator .ls17-metric {min-width:0;max-width:100%;}
}
@media(max-width:760px) {
  .band .sbox.big input {min-width:0 !important;max-width:100% !important;box-sizing:border-box;}
  main.wrap .cols {min-width:0 !important;max-width:100% !important;grid-template-columns:minmax(0,1fr) !important;}
  main.wrap .cols > :is(.card,.stack) {min-width:0 !important;max-width:100% !important;box-sizing:border-box;}
}
@media(max-width:480px) {
  main.wrap dl.kv,main.wrap dl.kv > div {
    min-width:0 !important;max-width:100% !important;width:100% !important;
    display:grid !important;grid-template-columns:minmax(0,1fr) !important;
    box-sizing:border-box;
  }
  main.wrap dl.kv :is(dt,dd) {min-width:0;max-width:100%;margin-inline:0;overflow-wrap:anywhere;}
  main.wrap :is(ul.nearby-cities,.ls-page-related) {min-width:0 !important;max-width:100% !important;width:100% !important;box-sizing:border-box;}
  main.wrap ul.nearby-cities {grid-template-columns:minmax(0,1fr) !important;}
}
