/* BAM Real Estate — runtime stability and hydration polish */
.bam-modal-bg{
  background:rgba(0,7,16,.58)!important;
  backdrop-filter:blur(8px) saturate(1.08)!important;
  -webkit-backdrop-filter:blur(8px) saturate(1.08)!important;
}
.bam-empty-cover-copy{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  color:rgba(216,173,90,.6);
  text-align:center;
}
.bam-empty-cover-copy svg{width:36px!important;height:36px!important}
.bam-empty-cover-copy span{
  font-size:10px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
}
.bam-progress-pill.working{
  border-color:rgba(120,167,244,.55);
  color:#a9c7ff;
  background:rgba(61,104,187,.18);
}
.bam-jobs-modal{max-height:min(680px,82vh);overflow:auto}
.bam-job-list{display:flex;flex-direction:column;gap:9px}
.bam-job-row{
  display:grid;
  grid-template-columns:12px minmax(0,1fr);
  gap:10px;
  align-items:start;
  padding:12px 13px;
  border:1px solid var(--line-soft);
  border-radius:9px;
  background:rgba(255,255,255,.018);
}
.bam-job-row strong{display:block;font-size:12px;font-weight:500;color:var(--text)}
.bam-job-row small{display:block;margin-top:4px;color:var(--muted);font-size:10px;line-height:1.45}
.bam-job-row em{display:block;margin-top:5px;color:#e9a39e;font-size:10px;font-style:normal;overflow-wrap:anywhere}
.bam-job-status{width:9px;height:9px;margin-top:4px;border-radius:50%;background:var(--muted-2)}
.bam-job-status.working{background:var(--blue);box-shadow:0 0 0 4px rgba(120,167,244,.1)}
.bam-job-status.done{background:var(--green)}
.bam-job-status.failed{background:var(--danger)}

/* Project covers: every card stays visually complete, even before the first upload. */
.bam-cover-premium{
  position:relative;
  overflow:hidden;
  isolation:isolate;
  background:
    radial-gradient(circle at 78% 12%,rgba(226,185,104,.22),transparent 28%),
    linear-gradient(145deg,#173956 0%,#0b213b 44%,#071629 100%);
}
.bam-cover-premium:before{
  content:"";
  position:absolute;
  inset:9% 7% 30%;
  border:1px solid rgba(232,203,151,.18);
  background:linear-gradient(180deg,rgba(206,227,239,.24),rgba(92,132,157,.05));
  box-shadow:inset 0 -45px 80px rgba(2,11,22,.32);
  z-index:-1;
}
.bam-cover-scene{position:absolute;inset:0;overflow:hidden}
.bam-cover-scene i{
  position:absolute;
  top:14%;
  bottom:34%;
  width:1px;
  background:linear-gradient(transparent,rgba(226,190,125,.42),transparent);
}
.bam-cover-scene i:nth-child(1){left:31%}
.bam-cover-scene i:nth-child(2){left:50%}
.bam-cover-scene i:nth-child(3){left:69%}
.bam-cover-scene b{
  position:absolute;
  left:8%;right:8%;bottom:-13%;height:48%;
  transform:perspective(520px) rotateX(58deg);
  transform-origin:bottom;
  background:repeating-linear-gradient(90deg,rgba(180,132,79,.72) 0 3px,rgba(103,71,47,.76) 3px 68px);
  border-top:1px solid rgba(241,210,154,.28);
}
.bam-cover-brand{
  position:absolute;
  left:18px;right:18px;bottom:16px;
  display:flex;
  justify-content:space-between;
  align-items:end;
  gap:12px;
  text-shadow:0 2px 12px rgba(0,0,0,.55);
}
.bam-cover-brand span{font-size:9px;letter-spacing:.28em;color:rgba(222,181,103,.92)}
.bam-cover-brand strong{max-width:62%;font-family:"Cormorant Garamond",serif;font-size:16px;font-weight:500;color:#f3eadb;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bam-detail-cover>.bam-cover-premium{width:100%;height:100%;min-height:154px;border-radius:inherit}
.bam-detail-cover>.bam-cover-empty{
  position:relative;
  overflow:hidden;
  background:
    radial-gradient(circle at 78% 12%,rgba(226,185,104,.22),transparent 28%),
    linear-gradient(145deg,#173956 0%,#0b213b 44%,#071629 100%)!important;
}
.bam-detail-cover>.bam-cover-empty .bam-empty-cover-copy{display:none}
.bam-detail-cover>.bam-cover-empty:after{content:"BAM REAL ESTATE · PROJECT";position:absolute;left:18px;bottom:16px;color:rgba(226,185,104,.9);font-size:9px;letter-spacing:.24em}

.bam-project-modal-wide{width:min(920px,calc(100vw - 32px));max-width:920px;max-height:min(880px,92vh);overflow:auto}
.bam-cover-editor{margin:18px 0 24px;padding:18px;border:1px solid var(--line-soft);border-radius:14px;background:linear-gradient(145deg,rgba(20,49,82,.72),rgba(7,25,47,.76))}
.bam-cover-editor-head{display:flex;justify-content:space-between;align-items:start;gap:18px;margin-bottom:15px}
.bam-cover-editor-head h3{margin:4px 0 3px;font-family:"Cormorant Garamond",serif;font-size:23px;font-weight:500;color:var(--text)}
.bam-cover-editor-head p{margin:0;color:var(--muted);font-size:11px;line-height:1.45}
.bam-cover-mode{padding:6px 10px;border:1px solid rgba(218,178,101,.28);border-radius:999px;color:var(--gold);font-size:9px;letter-spacing:.11em;text-transform:uppercase;white-space:nowrap}
.bam-cover-editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 190px;gap:14px;align-items:stretch}
.bam-cover-preview{display:grid;grid-template-columns:210px minmax(0,1fr);gap:14px;align-items:center;min-height:126px;padding:10px;border:1px solid rgba(255,255,255,.07);border-radius:12px;background:rgba(1,12,25,.28)}
.bam-cover-preview>img,.bam-cover-preview>.bam-cover-premium{width:210px;height:118px;object-fit:cover;border-radius:9px}
.bam-cover-preview strong{display:block;font-family:"Cormorant Garamond",serif;font-size:19px;font-weight:500;color:var(--text)}
.bam-cover-preview small{display:block;margin-top:6px;color:var(--muted);font-size:10px;line-height:1.5}
.bam-cover-controls{display:flex;flex-direction:column;justify-content:center;gap:9px}
.bam-cover-controls button{width:100%;justify-content:center}
.bam-cover-controls .selected{border-color:var(--gold);color:var(--gold);background:rgba(218,178,101,.08)}
.bam-cover-library-head{display:flex;justify-content:space-between;align-items:end;gap:12px;margin:18px 0 9px}
.bam-cover-library-head strong{font-size:12px;color:var(--text)}
.bam-cover-library-head small{font-size:9px;color:var(--muted)}
.bam-cover-library{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}
.bam-cover-choice{position:relative;min-width:0;padding:0;border:1px solid rgba(255,255,255,.08);border-radius:9px;overflow:hidden;background:#07182c;color:var(--text);cursor:pointer;text-align:left}
.bam-cover-choice img{display:block;width:100%;aspect-ratio:16/10;object-fit:cover}
.bam-cover-choice span{display:block;padding:7px 8px;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bam-cover-choice>svg{position:absolute;right:6px;top:6px;width:19px!important;height:19px!important;padding:4px;border-radius:50%;background:var(--gold);color:#06162a}
.bam-cover-choice.selected{border-color:var(--gold);box-shadow:0 0 0 2px rgba(218,178,101,.14)}
.bam-cover-library-empty{display:flex;align-items:center;gap:12px;padding:14px;border:1px dashed rgba(218,178,101,.24);border-radius:10px;color:var(--muted)}
.bam-cover-library-empty>svg{width:25px!important;height:25px!important;color:var(--gold)}
.bam-cover-library-empty strong{display:block;color:var(--text);font-size:11px}
.bam-cover-library-empty small{display:block;margin-top:3px;font-size:9px;line-height:1.45}

@media(max-width:720px){
  .bam-modal-bg{padding:14px}
  .bam-jobs-modal{max-height:78vh}
  .bam-project-modal-wide{width:100%;max-height:90vh}
  .bam-cover-editor-layout{grid-template-columns:1fr}
  .bam-cover-preview{grid-template-columns:130px minmax(0,1fr)}
  .bam-cover-preview>img,.bam-cover-preview>.bam-cover-premium{width:130px;height:92px}
  .bam-cover-controls{display:grid;grid-template-columns:1fr 1fr}
  .bam-cover-library{grid-template-columns:repeat(3,minmax(0,1fr))}
}


/* Immediate controls: no mobile 300ms gesture delay and instant press feedback. */
button,[role="button"],a[data-route],[data-project-id]{
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
button.bam-instant-pressed,[role="button"].bam-instant-pressed,a[data-route].bam-instant-pressed{
  transform:translateY(1px) scale(.995)!important;
  filter:brightness(1.08);
}
button[aria-busy="true"],button:disabled{
  pointer-events:none;
}


/* iPad/Safari shell stability: the app chrome must never scroll away or
   expose an empty blue document area while the studio is being reconciled. */
html,body{
  min-height:100%;
  overscroll-behavior-y:none;
}
.bam-shell,.bam-main{
  min-height:100vh;
  min-height:100dvh;
}
.bam-sidebar{
  height:100vh;
  height:100dvh;
  max-height:100dvh;
  transform:translateZ(0);
  -webkit-transform:translateZ(0);
  contain:layout paint;
}
.bam-content{
  min-height:calc(100vh - 108px);
  min-height:calc(100dvh - 108px);
}
@supports(-webkit-touch-callout:none){
  body{overscroll-behavior:none}
  .bam-sidebar{position:fixed!important}
}
