/* Bridge maintainer - web layer styles. CANONICAL COPY: bridge-maintainer/web/maint.css; both relays serve a
   byte-identical copy as /maint.css (see web/README-web.md). Every selector is prefixed bm- so nothing here can
   restyle the host page. Layers: host content < toast (55) < host menus (60) < host dialogs (70) < these
   dialogs (75) < SNLW focus lock (90). Pure ASCII. */

.bm-overlay,.bm-toast,.bm-fab{
  --bm-bg:#252423;--bm-card:#2b2a29;--bm-line:#3d3c3b;--bm-line2:#4a4948;--bm-text:#e8e6e3;--bm-muted:#a9a7a5;
  --bm-accent:#4f6bd8;--bm-accent2:#6a83e6;--bm-ok:#3fb950;--bm-bad:#f85149;--bm-warn:#f5c518;--bm-unk:#8a8886}

/* ---- dialogs ---- */
.bm-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:75;background:rgba(0,0,0,.6);display:flex;
  align-items:center;justify-content:center;padding:16px;box-sizing:border-box}
.bm-overlay *,.bm-overlay *::before,.bm-overlay *::after{box-sizing:border-box}
.bm-modal{background:var(--bm-bg);color:var(--bm-text);border:1px solid var(--bm-line);border-radius:12px;
  width:640px;max-width:100%;max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);display:flex;
  flex-direction:column;overflow:hidden;box-shadow:0 16px 48px rgba(0,0,0,.55);font-size:14px;line-height:1.45;
  font-family:inherit;text-align:left}
.bm-modal.bm-modal-fix,.bm-modal.bm-modal-report{width:520px}
.bm-head{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--bm-line);flex:0 0 auto}
.bm-title{flex:1;min-width:0;margin:0;font-size:16px;font-weight:600;line-height:1.3;overflow-wrap:anywhere}
.bm-body{flex:1 1 auto;min-height:0;overflow:auto;padding:12px 14px;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.bm-foot{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;align-items:center;padding:10px 14px;
  border-top:1px solid var(--bm-line);flex:0 0 auto}
.bm-foot:empty{display:none}
.bm-modal p{margin:0 0 8px}
.bm-modal ul{margin:0;padding:0;list-style:none}

/* buttons: beat the host pages' global button{...} / button.ic{...} rules */
.bm-modal button.bm-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;
  padding:7px 14px;border-radius:7px;border:1px solid transparent;font:inherit;font-size:13.5px;font-weight:600;
  cursor:pointer;line-height:1.2;filter:none;transform:none}
.bm-modal button.bm-btn:disabled{opacity:.55;cursor:default}
.bm-modal button.bm-btn-primary{background:var(--bm-accent);color:#fff}
.bm-modal button.bm-btn-primary:hover:not(:disabled){background:var(--bm-accent2)}
.bm-modal button.bm-btn-secondary{background:#3d3c3b;color:var(--bm-text);border-color:#4a4948}
.bm-modal button.bm-btn-secondary:hover:not(:disabled){background:#474645}
.bm-modal button.bm-btn-ghost{background:transparent;color:var(--bm-muted);border-color:var(--bm-line)}
.bm-modal button.bm-btn-ghost:hover:not(:disabled){background:#2e2d2c;color:var(--bm-text)}
.bm-modal button.bm-btn-danger{color:#ff9a95;border-color:#5a2a28}
.bm-modal button.bm-btn-danger:hover:not(:disabled){background:#432120;color:#ffb3ae}
.bm-modal button.bm-link{background:transparent;border:0;color:#8ab4f8;padding:7px 4px;margin-right:auto;font-weight:500}
.bm-modal button.bm-link:hover{text-decoration:underline}
.bm-modal button.bm-sm{min-height:30px;padding:5px 11px;font-size:12.5px}
.bm-modal button.bm-x{background:transparent;border:0;color:var(--bm-muted);font-size:16px;line-height:1;padding:6px 9px;
  border-radius:7px;cursor:pointer;min-width:34px;min-height:34px}
.bm-modal button.bm-x:hover{background:#3a3938;color:var(--bm-text)}
.bm-modal button:focus-visible,.bm-modal textarea:focus-visible{outline:2px solid var(--bm-accent2);outline-offset:2px}

/* status lines */
.bm-muted{color:var(--bm-muted)}
.bm-small{font-size:12px}
.bm-empty{color:var(--bm-muted);padding:18px 4px;text-align:center;font-size:14.5px}
.bm-loading{padding:18px 4px;text-align:center}
.bm-notice{background:#16241f;border:1px solid #24463a;color:#8fe3c6;border-radius:8px;padding:9px 11px;margin-bottom:10px;font-size:13px}
.bm-error{color:#ff9a95;font-size:13px;min-height:0}
.bm-error:empty{display:none}
p.bm-error,div.bm-error{margin:8px 0 0}
.bm-warnline{color:var(--bm-warn);font-size:12.5px}
.bm-busyline{background:#16241f;border:1px solid #24463a;color:#8fe3c6;border-radius:8px;padding:8px 11px;font-size:13px}
.bm-warnbox{background:#3a2a12;border:1px solid #5c441d;color:var(--bm-warn);border-radius:8px;padding:10px 12px;margin:10px 0 4px;font-size:13px}

/* project cards */
.bm-cards{display:flex;flex-direction:column;gap:12px}
.bm-card{background:var(--bm-card);border:1px solid var(--bm-line);border-radius:10px;padding:12px}
.bm-card-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.bm-dot{width:10px;height:10px;border-radius:50%;flex:0 0 auto;background:var(--bm-unk)}
.bm-dot-ok{background:var(--bm-ok);box-shadow:0 0 0 3px rgba(63,185,80,.18)}
.bm-dot-bad{background:var(--bm-bad);box-shadow:0 0 0 3px rgba(248,81,73,.18)}
.bm-card-title{font-weight:600;font-size:15px}
.bm-state{font-size:12px;color:var(--bm-muted)}
.bm-state-ok{color:var(--bm-ok)}
.bm-state-bad{color:var(--bm-bad)}
.bm-checked{margin-left:auto;font-size:12px;color:var(--bm-muted);white-space:nowrap}
.bm-current,.bm-forminfo{font-size:13px;margin:8px 0 2px;overflow-wrap:anywhere}
.bm-k{color:var(--bm-muted)}
.bm-sub{font-size:10.5px;letter-spacing:.6px;text-transform:uppercase;color:#8d8b89;margin:12px 0 5px}
.bm-ready{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:10px;padding:8px 10px;border-radius:8px;
  background:#1d2438;border:1px solid #33406b;font-size:13px}
.bm-ready-t{flex:1;min-width:0;color:#c9d4ff;font-weight:600}
.bm-versions{display:flex;flex-direction:column;gap:6px}
.bm-ver{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"meta btn" "sum btn";column-gap:10px;
  row-gap:2px;align-items:center;padding:8px 10px;border:1px solid #363534;border-radius:8px;background:#262524}
.bm-ver-meta{grid-area:meta;display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:12.5px}
.bm-ver-date{font-weight:600}
.bm-ver-sum{grid-area:sum;font-size:13px;color:#d6d4d1;overflow-wrap:anywhere}
.bm-ver>button{grid-area:btn}
.bm-chip{font-size:11px;padding:1px 7px;border-radius:9px;background:#33322f;color:#c8c6c4;white-space:nowrap}
.bm-chip-good{background:#12331d;color:#7ee29a}
.bm-chip-deploy{background:#1d2438;color:#aebfff}
.bm-chip-now{background:#3a3b63;color:#cfd0f5}
.bm-chip-app{background:#3a2a12;color:var(--bm-warn)}
.bm-card-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.bm-jobs{display:flex;flex-direction:column;gap:4px}
.bm-job{font-size:12.5px;padding:6px 9px;border-radius:7px;background:#262524;border-left:3px solid var(--bm-unk)}
.bm-job-top{display:flex;gap:8px;flex-wrap:wrap;align-items:baseline}
.bm-job-kind{font-weight:600}
.bm-job-st{color:var(--bm-muted)}
.bm-job-when{margin-left:auto;color:var(--bm-muted);font-size:11.5px;white-space:nowrap}
.bm-job-progress{color:#c8c6c4;margin-top:2px;overflow-wrap:anywhere}
.bm-job-queued,.bm-job-claimed,.bm-job-running,.bm-job-deploying{border-left-color:var(--bm-accent2)}
.bm-job-done{border-left-color:var(--bm-ok)}
.bm-job-failed{border-left-color:var(--bm-bad)}
.bm-job-fix-ready{border-left-color:var(--bm-warn)}

/* roll back / report form */
.bm-label{display:block;font-weight:600;margin:10px 0 6px}
.bm-modal textarea.bm-problem{display:block;width:100%;min-height:110px;max-height:40vh;resize:vertical;background:#1f1e1d;
  color:var(--bm-text);border:1px solid var(--bm-line2);border-radius:8px;padding:9px 10px;font:inherit;font-size:14px;line-height:1.45}
.bm-modal textarea.bm-problem:focus{border-color:var(--bm-accent2);outline:none}
.bm-count{text-align:right;font-size:11.5px;color:var(--bm-muted);margin-top:3px;font-variant-numeric:tabular-nums}
.bm-hint{font-size:12.5px;color:var(--bm-muted);margin-top:6px}

/* fix-ready popup */
.bm-section{margin-bottom:12px}
.bm-h{font-size:10.5px;letter-spacing:.6px;text-transform:uppercase;color:#8d8b89;margin-bottom:4px}
.bm-p{overflow-wrap:anywhere;white-space:pre-wrap}
.bm-quote{border-left:3px solid var(--bm-line2);padding-left:9px;color:#c8c6c4}
.bm-changes{display:flex;flex-direction:column;gap:5px}
.bm-changes li{padding:6px 9px;border-radius:7px;background:#262524;overflow-wrap:anywhere}
.bm-what{display:block}
.bm-file{display:block;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11.5px;color:var(--bm-muted);margin-top:2px}
.bm-tested{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center}
.bm-tick{font-weight:600}
.bm-pass{color:var(--bm-ok)}
.bm-fail{color:var(--bm-bad)}
.bm-unk{color:var(--bm-unk)}

/* morning report popup */
.bm-rep{display:flex;flex-direction:column;gap:10px}
.bm-rep-line{display:flex;align-items:baseline;gap:7px;flex-wrap:wrap}
.bm-rep-ic{flex:0 0 auto;width:18px;text-align:center;font-weight:700}
.bm-rep-label{font-weight:600}
.bm-oc-ok{color:var(--bm-ok)}
.bm-oc-bad{color:var(--bm-bad)}
.bm-oc-warn{color:var(--bm-warn)}
.bm-oc-unk{color:var(--bm-unk)}
.bm-rep-lines{margin:3px 0 0 25px!important}
.bm-rep-lines li{font-size:12.5px;color:#c8c6c4;padding:1px 0;overflow-wrap:anywhere}
.bm-rep-lines li::before{content:"- ";color:var(--bm-muted)}

/* ---- toast: top-right, directly below the page header (maint.js sets top from the header's bottom) ---- */
.bm-toast{position:fixed;top:64px;right:12px;z-index:55;max-width:360px;max-width:calc(100vw - 24px);
  background:#16241f;color:#8fe3c6;border:1px solid #24463a;border-radius:8px;padding:8px 12px;font-size:13px;
  line-height:1.4;box-shadow:0 6px 18px rgba(0,0,0,.45);pointer-events:none;overflow-wrap:anywhere;box-sizing:border-box;
  font-family:inherit}
.bm-toast[hidden]{display:none}
.bm-toast-done{background:#12331d;border-color:#1f5a2f;color:#7ee29a}
.bm-toast-note{background:#2b2a29;border-color:#3d3c3b;color:var(--bm-text)}

/* ---- menu entry fallbacks ---- */
.bm-fab{position:fixed;left:12px;bottom:12px;z-index:55;background:#3d3c3b;color:#e8e6e3;border:1px solid #4a4948;
  border-radius:18px;padding:7px 12px;font:inherit;font-size:13px;cursor:pointer;box-shadow:0 4px 14px rgba(0,0,0,.4)}
.bm-hbtn{white-space:nowrap}

@media (max-width:720px){
  .bm-overlay{padding:0;align-items:flex-end}
  .bm-modal,.bm-modal.bm-modal-fix,.bm-modal.bm-modal-report{width:100%;max-width:100%;max-height:94vh;max-height:94dvh;
    border-radius:14px 14px 0 0;border-left:0;border-right:0;border-bottom:0}
  .bm-body{padding:12px}
  .bm-foot{padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px))}
  .bm-foot button.bm-btn{flex:1 1 auto;min-height:42px;font-size:15px}
  .bm-foot button.bm-link{flex:1 1 100%;order:9;margin-right:0}
  .bm-modal button.bm-sm{min-height:38px;font-size:13.5px}
  .bm-ver{grid-template-columns:minmax(0,1fr);grid-template-areas:"meta" "sum" "btn"}
  .bm-ver>button{justify-self:start;margin-top:6px}
  .bm-checked{margin-left:0;flex:1 0 100%}
  .bm-modal textarea.bm-problem{font-size:16px}
  .bm-hbtn .bm-hbtn-lbl{display:none}
}
@media (prefers-reduced-motion:no-preference){
  .bm-toast{transition:opacity .2s ease}
}
