/* goyo Layer 2 r9 (K-T1): state and facility frames. Scoped to article.page.rb-state / .rb-facility; no rule on main, crumbs or shell.
   Colors: SITE_FORMAT_STANDARD 3a tokens only. No font-family (headings keep Literata from Layer 1, body keeps GoyoZero + Atkinson).
   PENDING KIT: final spacing; the design office's v3 Layer 1 fixes (double rules, heading tracking) are not repeated here. */
@layer site21 {
@media screen {
  article.page:is(.rb-state,.rb-facility) { max-width: 72rem !important; }
  article.page:is(.rb-state,.rb-facility) > .vhead:empty { margin: 0; }
  .rb-plate { margin: 1.25rem 0 1.75rem; background: #15335e; color: #fbfbfa; border: 1px solid #15335e; }
  .rb-plate .rb-cart { padding: clamp(.75rem, 2vw, 1.25rem); background-image: linear-gradient(#35506b 1px, #15335e 1px), linear-gradient(90deg, #35506b 1px, #15335e 1px); background-size: 28px 28px; background-blend-mode: normal; }
  .rb-plate .rb-svg { display: block; width: 100%; height: auto; max-height: 20rem; }
  @media (max-width: 839px) {
    .rb-plate .rb-svg { max-height: 11rem; }
    html body main#main > article.page:is(.rb-state,.rb-facility) > .vhead:empty { margin: 0 !important; padding: 0 !important; min-height: 0 !important; }
    html body main#main > article.page.rb-state { padding-block-start: .5rem !important; }
  }
  .rb-plate .rb-svg .rb-base { fill: #d9e3ec; stroke: #35506b; stroke-width: 1.4; stroke-linejoin: round; }
  .rb-plate .rb-svg .rb-outline { fill: none; stroke: #e8c46a; stroke-width: 4; stroke-linejoin: round; }
  .rb-plate .rb-svg .rb-marked { fill: #e8c46a; stroke: #15335e; stroke-width: 4; stroke-linejoin: round; }
  .rb-plate figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1.1rem; padding: .7rem clamp(.75rem, 2vw, 1.25rem); border-top: 1px solid #35506b; }
  html body main#main article.page .rb-plate figcaption, html body main#main article.page .rb-plate figcaption * { color: #fbfbfa !important; }
  html body main#main article.page .rb-plate figcaption .rb-state-name { color: #e8c46a !important; }
  .rb-plate .rb-state-name { color: #e8c46a; font-family: var(--serif); font-size: 1.35rem; font-weight: 600; line-height: 1.2; }
  .rb-plate .rb-key { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; color: #fbfbfa; }
  .rb-plate .rb-swatch { display: inline-block; width: 1rem; height: 1rem; background: #e8c46a; border: 2px solid #fbfbfa; }
  .rb-plate .rb-qual { color: #fbfbfa; }
  /* R6 (HQ R6 item 2): space held for the native Medicare card (heights measured per record shape, qa/card_calib.cjs); hidden once the
     card is in. If no card arrives within 4 s the slot closes. Reduced motion: no slot (no animation runs). */
  article.page.rb-facility > .rb-qslot { display: block; margin: 0; padding: 0; }
  @media (prefers-reduced-motion: no-preference) {
    article.page.rb-facility > .rb-qslot { animation: rb-qslot-close 0s 4s forwards; }
    article.page.rb-facility > .rb-qslot[data-q="h1"] { min-height: 15.4375rem; }
    article.page.rb-facility > .rb-qslot[data-q="h0"] { min-height: 13.125rem; }
    article.page.rb-facility > .rb-qslot[data-q="ns"] { min-height: 31rem; }
    article.page.rb-facility > .rb-qslot[data-q="nsv"] { min-height: 36.875rem; }
    article.page.rb-facility > .rb-qslot[data-q="nv"] { min-height: 35.9375rem; }
    @media (min-width: 840px) {
      article.page.rb-facility > .rb-qslot[data-q="h1"] { min-height: 15.375rem; }
      article.page.rb-facility > .rb-qslot[data-q="h0"] { min-height: 13.0625rem; }
      article.page.rb-facility > .rb-qslot[data-q="ns"] { min-height: 22.6875rem; }
      article.page.rb-facility > .rb-qslot[data-q="nsv"] { min-height: 24.625rem; }
      article.page.rb-facility > .rb-qslot[data-q="nv"] { min-height: 24.375rem; }
    }
  }
  article.page.rb-facility > .rb-qslot:has(~ section.facility-quality) { display: none; }
  @media (min-width: 840px) {
    article.page:is(.rb-state,.rb-facility) { display: grid; grid-template-columns: minmax(0, 55fr) minmax(18rem, 45fr); column-gap: clamp(1.5rem, 3vw, 3rem); align-items: start; }
    article.page:is(.rb-state,.rb-facility) > * { grid-column: 1 / -1; }
    article.page:is(.rb-state,.rb-facility) > .head { grid-column: 1; grid-row: 2; }
    article.page.rb-facility > p.rb-id { grid-column: 1; grid-row: 3; }
    article.page.rb-facility > .rb-plate { grid-column: 2; grid-row: 2 / span 2; margin-top: 0; }
    article.page.rb-state > .rb-plate { grid-column: 2; grid-row: 2; margin-top: 0; align-self: start; } /* decorative figure only: placed beside the heading on desktop; DOM order (after the first filing section) is kept for mobile */
    article.page:is(.rb-state,.rb-facility) > .vhead { grid-row: 1; }
    /* Design R3 review: Spanish state H1 stays inside its grid column (no size change; Layer 1 v3 owns heading size and color). */
    html:lang(es) body main#main > article.page.rb-state:has(> #sp.sp-static) > .head > h1 { inline-size: auto !important; max-inline-size: 100% !important; }
    /* Register: topic choices in a narrow column beside the rows; rows on the right. */
    html body main#main > article.page.rb-state #sp-out:has(> .g2-controls) { display: grid; grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr); column-gap: clamp(1.25rem, 2.5vw, 2.25rem); align-items: start; }
    html body main#main > article.page.rb-state #sp-out:has(> .g2-controls) > * { grid-column: 2; }
    html body main#main > article.page.rb-state #sp-out > .g2-controls { grid-column: 1; grid-row: 1 / span 400; position: static; margin-block: 0; } /* R5 (DRAFT_REVIEW_R4): the filter panel scrolls with the page; desktop columns kept */
    html body main#main > article.page.rb-state #sp-out > .g2-controls .g2-topics { flex-direction: column; }
  }
  /* Binder controls (state pages); from KIT atlas-layout.css with legacy #a2b3c4 / #7790a4 mapped to line / slate. */
  #main .g2-controls { padding: clamp(1rem, 3vw, 1.6rem); border-block: 2px solid #15335e; background: #e9eff5; margin-block: 1rem; }
  #main .g2-controls h3 { margin: 0 0 .75rem; }
  #main .g2-controls p { margin: .7rem 0; }
  #main :is(.g2-topics, .g2-actions) { display: flex; flex-wrap: wrap; gap: .45rem; }
  #main :is(.g2-controls, .rb-state .sp-jump) button { font: inherit; text-align: start; min-height: 44px; padding: .42rem .7rem; border: 1px solid #35506b; color: #15335e; background: #fbfbfa; cursor: pointer; }
  /* Active filter: ink ground, paper text and a persistent inset rule (non-color cue); wins the live button cascade. */
  html body main#main .g2-controls .g2-topics button[aria-pressed="true"] { background: #15335e !important; color: #fbfbfa !important; border-color: #15335e !important; box-shadow: inset 6px 0 0 #e8c46a !important; font-weight: 700; }
  html body main#main .g2-controls .g2-topics button[aria-pressed="true"]:focus-visible { outline: 3px solid #15335e; outline-offset: 3px; }
  html body main#main .g2-actions button:first-child, html body main#main article.page.rb-state .sp-jump .g2-cover-download { background: #15335e !important; color: #fbfbfa !important; font-weight: 700; border-color: #15335e !important; }
  #main .g2-controls button:disabled { cursor: default; color: #35506b; border-color: #d7e0eb; }
  #main .g2-select { display: flex; align-items: center; gap: .55rem; min-height: 44px; padding: .3rem 0 .6rem; color: #15335e; overflow-wrap: anywhere; }
  #main .g2-select input { width: 1.2rem; height: 1.2rem; flex: none; }
  #main :is(.g2-controls, .g2-select, .sp-jump) :focus-visible { outline: 3px solid #15335e; outline-offset: 3px; box-shadow: 0 0 0 3px #fbfbfa; }
  .g2-paper-frame { position: fixed; left: 0; bottom: 0; width: 1px; height: 1px; border: 0; pointer-events: none; }
}
@media print {
  .rb-plate, .g2-controls, .g2-select, .g2-cover-download, .g2-paper-frame { display: none !important; }
  html body main#main button.g2-cover-download { display: none !important; } /* R9 (QA_R8 FAIL 4): beats goyo.css v3 html body main#main :is(button,...) { display: inline-flex !important } */
  #main #sp-out :is(details.sp-grp, .sp-card, .sp-seeabove, #sp-cong-h, .sp-note)[hidden] { display: block !important; }
}
}
@keyframes rb-qslot-close { to { min-height: 0; } }
