/* R149: stable direct advisor and opted-in embed; legacy embeds retain R111. */
@media screen {
  body.sa-stable {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  .sa-stable .sa-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 12px;
  }
  .sa-stable.sa-embedded .sa-intro { display: none; }
  .sa-stable #sa-app {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }
  .sa-stable .sa-progress { flex: 0 0 auto; margin-bottom: 12px; }
  .sa-stable .sa-progress button { min-height: 54px; }
  .sa-stable .sa-scroll-region {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overflow-anchor: none;
    scrollbar-gutter: stable;
    scroll-padding: 14px;
    border-radius: 10px;
  }
  .sa-stable .sa-scroll-region:focus-visible,
  .sa-stable #sa-question:focus-visible {
    outline: 3px solid #b5752f;
    outline-offset: -3px;
  }
  .sa-stable .sa-layout { align-items: start; }
  .sa-stable .sa-workspace { padding: 24px; }
  .sa-stable .sa-footer-actions {
    flex: 0 0 auto;
    margin-top: 10px;
    padding: 10px 0 0;
    background: var(--sa-bg);
  }
  .sa-stable .sa-disclaimer { flex: 0 0 auto; margin-top: 10px; }
  .sa-stable .sa-feedback { margin-bottom: 12px; }
}
@media screen and (max-width: 700px) {
  .sa-stable .sa-shell { padding: 8px; }
  .sa-stable .sa-progress { margin-bottom: 8px; }
  .sa-stable .sa-progress button { min-height: 58px; }
  .sa-stable .sa-workspace { padding: 20px 14px; }
  .sa-stable .sa-footer-actions { margin-top: 8px; padding-top: 8px; }
  .sa-stable .sa-disclaimer { font-size: 10px; margin-top: 8px; }
}
/* Print output remains the existing full selection, outside the scroll region. */
@media print {
  .sa-stable .sa-scroll-region,
  .sa-stable #sa-app > .sa-footer-actions { display: none !important; }
}

/* The direct page keeps its brand, page heading and return links above the tool. */
@media screen {
  body.sa-stable.sa-standalone {
    display:flex;
    flex-direction:column;
    min-height:0;
  }
  .sa-standalone .sa-site-header {
    flex:0 0 auto;
    width:100%;
    margin:0 auto;
    padding:12px 24px;
  }
  .sa-standalone.sa-stable .sa-shell {
    flex:1 1 auto;
    width:100%;
    height:auto;
    min-height:0;
    margin:0 auto;
    padding:16px 24px 12px;
  }
  .sa-standalone .sa-intro {
    display:block;
    flex:0 0 auto;
    margin:0 0 12px;
  }
  .sa-standalone .sa-intro .sa-kicker,
  .sa-standalone .sa-edition {display:none;}
  .sa-standalone .sa-intro h1 {font-size:25px;margin:0 0 6px;letter-spacing:-.5px;}
  .sa-standalone .sa-intro p:not(.sa-kicker) {font-size:14px;line-height:1.45;margin:0;max-width:none;}
  .sa-standalone .sa-disclaimer {font-size:11px;line-height:1.4;}
}
@media screen and (max-width:700px) {
  .sa-standalone .sa-site-header {padding:10px 14px;gap:12px;}
  .sa-standalone .sa-brand {font-size:22px;}
  .sa-standalone .sa-site-header nav {font-size:11px;gap:8px;}
  .sa-standalone .sa-site-header nav a {display:inline-flex;align-items:center;min-height:44px;line-height:1.4;padding:4px 0;}
  .sa-standalone .sa-site-header nav a:last-child {display:none;}
  .sa-standalone.sa-stable .sa-shell {padding:10px 8px 8px;}
  .sa-standalone .sa-intro {margin:0 6px 10px;}
  .sa-standalone .sa-intro h1 {font-size:21px;}
  .sa-standalone .sa-intro p:not(.sa-kicker) {font-size:12px;line-height:1.4;}
  .sa-standalone .sa-disclaimer {font-size:10px;margin-top:7px;}
}
/* Short landscape / heavy zoom: keep every control reachable instead of clipping. */
@media screen and (max-height:520px) {
  body.sa-stable.sa-standalone {height:auto;min-height:100vh;overflow:auto;}
  .sa-standalone.sa-stable .sa-shell {flex:none;height:460px;}
  .sa-standalone .sa-intro h1 {font-size:20px;}
  .sa-standalone .sa-intro p:not(.sa-kicker) {font-size:12px;}
}
