/* BOOK staging UX repair: mobile drawer dismissal + capture actions + mobile runtime composition. */
@media(max-width:899px){
  .mobile-overlay{display:block;position:fixed;inset:0;background:rgba(8,16,29,.45);opacity:0;pointer-events:none;transition:.2s;z-index:200}
  .mobile-overlay.is-visible{opacity:1;pointer-events:auto}
  body.mmabs-mobile-nav-open{overflow:hidden}
}
.sidebar-capture-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:0 0 2px;padding:0 2px}
.sidebar-capture-actions button{min-width:0;min-height:40px;border:1px solid rgba(255,255,255,.14);border-radius:9px;background:rgba(255,255,255,.07);color:#eef2ff;display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 7px;font:600 12px/1.2 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.sidebar-capture-actions button:hover{background:rgba(255,255,255,.12)}
.sidebar-capture-actions button:focus-visible{outline:3px solid rgba(174,148,255,.45);outline-offset:2px}
.capture-dialog{width:min(560px,calc(100vw - 28px));border:0;border-radius:18px;padding:0;box-shadow:0 28px 90px rgba(10,18,32,.3);color:#172033}
.capture-dialog::backdrop{background:rgba(8,16,29,.58);backdrop-filter:blur(4px)}
.capture-dialog form{display:grid;gap:14px;padding:22px}
.capture-dialog header{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.capture-dialog h2{margin:0;font-size:20px}.capture-dialog p{margin:5px 0 0;color:#68718a;font-size:13px;line-height:1.5}
.capture-dialog label{display:grid;gap:6px;font-size:12px;font-weight:700}.capture-dialog input,.capture-dialog textarea{width:100%;border:1px solid #d0d5dd;border-radius:9px;padding:10px 11px;font:400 14px/1.5 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}.capture-dialog textarea{min-height:150px;resize:vertical}
.capture-dialog .capture-status{min-height:18px;color:#667085;font-size:12px;line-height:1.45}.capture-dialog .capture-status.is-error{color:#b42318}.capture-dialog menu{display:flex;justify-content:flex-end;gap:8px;padding:0;margin:0}.capture-dialog button{min-height:40px;border:1px solid #d0d5dd;border-radius:9px;background:#fff;padding:8px 12px;font-weight:600}.capture-dialog button.primary{border-color:#6650c8;background:#6650c8;color:#fff}.capture-dialog button.recording{border-color:#b42318;color:#b42318;background:#fff5f3}.capture-audio{width:100%;min-height:42px}

/* Screenshot-driven fixes: status words, labels and actions may not be split into unreadable fragments. */
.status-chip,.gate-status,.operation-status,.release-status,.review-status,.approval-badge{white-space:nowrap!important;word-break:normal!important;overflow-wrap:normal!important;max-width:100%}
.primary-button,.secondary-button,.compact-button,.real-pilot-gate-actions button,.editor-toolbar button{word-break:normal!important;overflow-wrap:normal!important;hyphens:none}
.responsibility-check{display:grid!important;grid-template-columns:22px minmax(0,1fr)!important;align-items:start!important;gap:9px!important;width:100%;min-width:0}
.responsibility-check input{display:block!important;width:20px!important;height:20px!important;min-width:20px!important;margin:1px 0 0!important;opacity:1!important;position:static!important;appearance:auto!important}
.responsibility-check>span{display:flex!important;align-items:flex-start;gap:6px;min-width:0;line-height:1.5;overflow-wrap:anywhere}

@media(max-width:640px){
  .sidebar-capture-actions{grid-template-columns:1fr}
  .capture-dialog form{padding:18px}.capture-dialog menu{flex-direction:column-reverse}.capture-dialog menu button{width:100%}
  /* Session controls belong to document flow on mobile; never cover app content. */
  body>.session-bar{position:static!important;inset:auto!important;width:auto!important;max-width:none!important;margin:12px!important;display:grid!important;grid-template-columns:1fr!important;gap:8px!important;transform:none!important;box-shadow:none!important}
  body>.session-bar>span,body>.session-bar>button{min-width:0!important;width:100%!important;max-width:100%!important;white-space:normal!important;text-align:left}

  /* Project/source icon tiles stay compact and leave the copy the available width. */
  .project-card,.project-type-preview>div{grid-template-columns:36px minmax(0,1fr)!important;gap:10px!important}
  .project-card-icon,.processing-icon,.file-thumb{width:36px!important;height:36px!important;min-width:36px!important;border-radius:10px!important}
  .project-card>em,.project-card>svg{grid-column:2!important;justify-self:start}

  /* KPI/readiness surfaces are readable lists on phones rather than squeezed 2x2/4x1 cards. */
  .stats-grid,.compliance-stats,.saas-owner-stats,.roadmap-summary-grid{grid-template-columns:1fr!important;gap:10px!important}
  .roadmap-summary-grid .stat-card,.stats-grid .stat-card,.compliance-stats .stat-card,.saas-owner-stats .stat-card{min-height:0!important;padding:13px!important}
  .operations-overview-meta.launch-candidate-summary{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;width:100%!important}
  .operations-overview-meta.launch-candidate-summary>span{min-width:0!important;width:100%!important;padding:10px!important}
  .operations-overview-meta.launch-candidate-summary strong{overflow-wrap:anywhere;word-break:normal}

  /* Gate rows use a status header followed by full-width copy. */
  .gate-list>div,.runtime-verification-grid>article{display:grid!important;grid-template-columns:1fr!important;gap:7px!important;align-items:start!important;padding:12px!important}
  .gate-list .gate-status,.runtime-verification-grid .gate-status{justify-self:start!important;width:auto!important;min-width:0!important}

  /* Pilot gate actions remain one compact segmented row instead of three giant vertical buttons. */
  .real-pilot-gate-actions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;width:100%!important}
  .real-pilot-gate-actions>*{min-width:0!important;min-height:42px!important;padding:7px 5px!important;font-size:12px!important;line-height:1.2!important;white-space:nowrap!important}

  /* Structure rows reserve the first line for content, actions move below. */
  .outline-list.detailed{padding:8px 10px!important}
  .outline-card{grid-template-columns:32px minmax(0,1fr)!important;grid-template-areas:"number copy" "actions actions"!important;gap:8px 10px!important;align-items:start!important;padding:13px 4px!important}
  .outline-card>.drag-handle{display:none!important}.outline-card>.chapter-number{grid-area:number!important}.outline-card>.outline-copy{grid-area:copy!important;min-width:0!important}.outline-card>.outline-actions{grid-area:actions!important;justify-content:flex-end!important;width:100%!important}
  .outline-copy input,.outline-copy strong,.outline-copy span,.outline-copy small{max-width:100%!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere!important}
  .outline-actions button{width:42px!important;height:42px!important}

  /* Material editor toolbar becomes a vertical mobile form; badge/button text stays intact. */
  .note-editor-panel .editor-toolbar{display:grid!important;grid-template-columns:1fr!important;gap:10px!important;align-items:stretch!important;padding:12px!important}
  .note-editor-panel .editor-toolbar>div{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;min-width:0!important;width:100%!important}
  .note-editor-panel .editor-toolbar .origin-badge{justify-self:start!important;width:auto!important;max-width:100%!important;white-space:normal!important;line-height:1.35!important}
  .note-editor-panel .editor-toolbar strong{white-space:normal!important;overflow-wrap:anywhere!important}
  .note-editor-panel .editor-toolbar select,.note-editor-panel .editor-toolbar button{width:100%!important;max-width:100%!important;min-height:44px!important;white-space:normal!important}
  .source-review-grid{grid-template-columns:1fr!important}.source-original-pane,.source-transcription-pane{min-width:0!important}

  /* Processing/material rows do not sacrifice the title to decorative chrome. */
  .processing-item{grid-template-columns:36px minmax(0,1fr)!important;gap:10px!important;padding:12px!important;min-height:0!important}
  .processing-copy{min-width:0!important}.processing-copy strong,.processing-copy small,.processing-copy span{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere!important}
  .processing-footer{grid-column:1/-1!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;min-width:0!important}
  .processing-footer button{position:static!important;min-width:0!important;white-space:normal!important}
}

@media(max-width:390px){
  .operations-overview-meta.launch-candidate-summary{grid-template-columns:1fr!important}
  .real-pilot-gate-actions{grid-template-columns:1fr 1fr 1fr!important}
  .saas-topbar{gap:6px!important}
}
