/* Shared single-screen mission control for live scans and the demo. */
.rc-demo-controls { display:none; }
body:has(#rank-checker-app[data-stage="3"]) { height:100dvh; overflow:hidden; display:flex; flex-direction:column; }
body:has(#rank-checker-app[data-stage="3"])>.rc-header { flex:none; position:relative; }
body:has(#rank-checker-app[data-stage="3"])>main { flex:1; min-height:0; display:flex; }
body:has(#rank-checker-app[data-stage="3"])>main>.rc-hero { flex:1; min-height:0; display:flex; }
body:has(#rank-checker-app[data-stage="3"])>.rc-footer { display:none; }
#rank-checker-app[data-stage="3"] { display:flex; flex-direction:column; max-width:1200px; min-height:0; padding-block:10px; gap:0; }
#rank-checker-app[data-stage="3"]>.rc-intro { display:none; }
#rank-checker-app[data-stage="3"]>.rc-report:not([hidden]) { display:flex; flex-direction:column; width:100%; flex:1; min-height:0; }
#rank-checker-app[data-stage="3"] .rc-report-heading { flex:none; margin:0 0 8px; flex-wrap:nowrap; }
#rank-checker-app[data-stage="3"] .rc-report-heading>div { flex:1; min-width:0; }
#rank-checker-app[data-stage="3"] .rc-report-title h2 { font-size:1.125rem; }
#rank-checker-app[data-stage="3"] .rc-report-heading>.rc-back { flex-shrink:0; }
#rank-checker-app[data-stage="3"] .rc-report-layout { flex:1; min-height:0; display:flex; flex-direction:column; align-items:stretch; margin:0; gap:8px; }
#rank-checker-app[data-stage="3"] .rc-map-column { flex:1; min-height:0; display:flex; }
#rank-checker-app[data-stage="3"] .rc-map-card { flex:1; display:flex; flex-direction:column; min-height:0; }
#rank-checker-app[data-stage="3"] .rc-map-viewport { flex:1; min-height:0; overflow:hidden; display:flex; }
#rank-checker-app[data-stage="3"] .rc-map-surface { flex:1; min-height:0; aspect-ratio:auto; }
#rank-checker-app[data-stage="3"] .rc-report-sidebar { display:block; flex:none; }
#rank-checker-app[data-stage="3"] .rc-report-sidebar>#rank-business-panel,
#rank-checker-app[data-stage="3"] .rc-report-sidebar>#rank-competitor-panel,
#rank-checker-app[data-stage="3"] .rc-report>#rank-comparison-panel,
#rank-checker-app[data-stage="3"] #rank-report-actions,
#rank-checker-app[data-stage="3"] #rank-report-method,
#rank-checker-app[data-stage="3"] #rank-share-status { display:none; }
#rank-checker-app[data-stage="3"] .rc-visibility-heading { padding:6px 10px 0; }
#rank-checker-app[data-stage="3"] .rc-stat-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; margin:6px; }
#rank-checker-app[data-stage="3"] .rc-stat { padding:6px; }
#rank-checker-app[data-stage="3"] .rc-stat>strong { font-size:1.5rem; }
#rank-checker-app[data-stage="3"] .rc-scan-progress { padding:8px 12px; }
#rank-checker-app[data-stage="3"] .rc-scan-progress-heading { gap:8px; margin:0 0 5px; }
#rank-checker-app[data-stage="3"] .rc-scan-progress h3 { font-size:1rem; }
#rank-checker-app[data-stage="3"] .rc-scan-eyebrow,
#rank-checker-app[data-stage="3"] .rc-scan-counts,
#rank-checker-app[data-stage="3"] .rc-scan-progress-actions { display:none; }
#rank-checker-app[data-stage="3"] .rc-discovery-icon { width:28px; height:28px; border-radius:9px; font-size:1.125rem; }
#rank-checker-app[data-stage="3"] .rc-progress-track { height:6px; padding:0; }
#rank-checker-app[data-stage="3"] .rc-scan-percent { font-size:1.25rem; }
#rank-checker-app[data-stage="3"] .rc-demo-controls { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:8px; flex:none; }
.rc-demo-controls button { min-height:48px; padding:8px 5px; border:1px solid #b8d7fb; border-bottom:4px solid #a8c9ef; border-radius:12px; background:#fff; color:#0757bc; font:inherit; font-size:1rem; font-weight:750; cursor:pointer; transition:transform .15s,background .15s; }
.rc-demo-controls button:nth-child(2) { background:#ffdf52; border-color:#e4ba28; color:#12345b; }
.rc-demo-controls button:hover { transform:translateY(-2px); background:#eff7ff; }
.rc-demo-controls button:active { transform:translateY(1px); }
.rc-demo-controls button:focus-visible { outline:3px solid #ff8b3d; outline-offset:2px; }
.rc-demo-dialog { width:min(680px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); overflow:auto; }
#rank-demo-dialog-content { padding:12px; }
#rank-demo-dialog-content>section { margin:0; }
@media(max-width:360px) { #rank-checker-app[data-stage="3"] .rc-report-title { gap:4px; } #rank-checker-app[data-stage="3"] .rc-report-title h2 { font-size:1rem; } .rc-demo-controls button { font-size:.875rem; } }
@media(prefers-reduced-motion:reduce) { .rc-demo-controls button { transition:none; } }
@media(max-height:500px) and (min-width:600px) {
  body:has(#rank-checker-app[data-stage="3"]) .rc-header-inner { min-height:56px; }
  #rank-checker-app[data-stage="3"] .rc-report-layout { flex-direction:row; }
  #rank-checker-app[data-stage="3"] .rc-report-sidebar { width:220px; }
  #rank-checker-app[data-stage="3"] .rc-stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #rank-checker-app[data-stage="3"] .rc-report-query { display:inline-block; }
  #rank-checker-app[data-stage="3"] .rc-report-heading { margin-bottom:4px; }
}

@media(max-width:600px) {
  #rank-checker-app[data-stage="3"] .rc-report-title h2 { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
  #rank-checker-app[data-stage="3"] .rc-stat { padding:6px 4px; }
  #rank-checker-app[data-stage="3"] .rc-stat>span { white-space:nowrap; }
}
.rc-demo-controls button { display:flex; align-items:center; justify-content:center; gap:4px; }

/* Secondary actions remain one tap away while the map stays in view. */
#rank-checker-app[data-stage="3"] .rc-report>#rank-tools-panel { display:none; }
#rank-checker-app[data-mode="sample"] .rc-live-tools-button { display:none; }
#rank-checker-app[data-stage="3"][data-mode="live"] .rc-demo-controls { grid-template-columns:repeat(4,minmax(0,1fr)); }
#rank-checker-app[data-stage="3"] #rank-demo-dialog #rank-report-actions,
#rank-checker-app[data-stage="3"] #rank-demo-dialog #rank-report-method,
#rank-checker-app[data-stage="3"] #rank-demo-dialog #rank-share-status { display:block; }
#rank-tools-panel .rc-report-actions { margin:0; padding:12px 0; border:0; box-shadow:none; background:transparent; }
#rank-tools-panel .rc-report-buttons { display:grid; width:100%; min-width:0; gap:10px; }
#rank-tools-panel .rc-save-card { display:block; margin:0 0 8px; padding:12px; background:#fff; }
#rank-tools-panel .rc-save-card[hidden] { display:none; }
#rank-tools-panel .rc-save-card h3 { margin-bottom:12px; font-size:1.125rem; }
#rank-tools-panel .rc-save-action { min-width:0; }
#rank-tools-panel .rc-save-action .rc-button { width:100%; }
#rank-tools-panel .rc-report-method { margin:12px 0 0; font-size:.875rem; }
#rank-checker-app[data-stage="3"] .rc-water-summary { margin:0 0 4px; font-size:.875rem; }
#rank-checker-app[data-stage="3"] .rc-visibility-heading h3 { overflow-wrap:anywhere; }
#rank-checker-app[data-stage="3"][data-mode="live"] .rc-demo-controls button { flex-direction:column; gap:0; font-size:.875rem; }
/* Dialog actions sit on a light surface and need their own strong contrast. */
#rank-tools-panel .rc-button-outline { color:#0757bc; background:#fff; border-color:#9cc3ef; font-weight:700; box-shadow:0 2px 0 #d7e6f6; }
#rank-tools-panel .rc-button-outline:hover { color:#064da6; background:#eaf4ff; border-color:#0963d6; }
#rank-tools-panel .rc-button-outline:focus-visible { outline:3px solid #ff8b3d; outline-offset:3px; }
#rank-tools-panel .rc-share-status:empty { display:none!important; }
.rc-point-dialog-close { display:flex; align-items:center; justify-content:center; }
.rc-point-dialog-close svg { display:block; flex:none; }
/* Two compact next steps, separate from the report detail controls. */
.rc-result-controls { flex:none; }
.rc-next-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:8px; }
.rc-next-actions>a,.rc-next-actions>button { display:flex; align-items:center; justify-content:center; min-height:44px; padding:8px; border:1px solid #0963d6; border-radius:10px; font:inherit; font-size:1rem; font-weight:750; line-height:1.3; text-align:center; text-decoration:none; cursor:pointer; }
.rc-improve-action { color:#fff; background:#0963d6; }
.rc-improve-action:hover { color:#fff; background:#0757bc; }
.rc-track-action { color:#0757bc; background:#fff; }
.rc-track-action:hover { color:#0757bc; background:#edf6ff; }
.rc-next-actions :focus-visible { outline:3px solid #ff8b3d; outline-offset:2px; }
.rc-next-actions>button:disabled { opacity:.65; cursor:default; }
#rank-checker-app[data-mode="live"] .rc-track-demo,
#rank-checker-app[data-mode="sample"] .rc-track-live { display:none; }
@media(max-width:360px) { .rc-next-actions>a,.rc-next-actions>button { font-size:.875rem; padding:8px 5px; } }
@media(max-height:500px) and (min-width:600px) {
  .rc-result-controls { display:block; }
  #rank-checker-app[data-stage="3"] .rc-report-heading>div { display:flex; align-items:center; gap:12px; }
  #rank-checker-app[data-stage="3"] .rc-report-query { margin:0; }
  #rank-checker-app[data-stage="3"] .rc-demo-controls button { min-height:44px; }
  #rank-checker-app[data-stage="3"][data-mode="live"] .rc-demo-controls button { flex-direction:row; gap:4px; }
}
/* Finished scans give the map back the space used by the progress banner. */
#rank-checker-app[data-stage="3"] .rc-scan-progress[data-progress-state="complete"]:not([data-empty-results="true"]) { display:none; }
