/* Shared "author one model" editor-screen shell — LC list · MC workspace · RC flex. Used by /atmospheres
   and /events. Each screen sets --es-lc/--es-mc/--es-rc to tune column widths. Full-height: the page never
   scrolls; the columns scroll internally. */
body:has(.es-screen) main.app-main {
  flex: 0 0 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; padding-bottom: 0;
  height: calc(100dvh - var(--topbar-h, 3.5rem)); max-height: calc(100dvh - var(--topbar-h, 3.5rem));
}
body:has(.es-screen) main.app-main > #app { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
body:has(.es-screen) footer.app-footer { display: none; }

.es-screen {
  display: grid;
  grid-template-columns: var(--es-lc, 17.5rem) var(--es-mc, 1.7fr) var(--es-rc, minmax(20rem, 1fr));
  gap: var(--sp-8); flex: 1; min-height: 0; padding: var(--sp-8) 0; box-sizing: border-box;
}
.es-screen > aside, .es-screen > main {
  background: var(--panel, #16130d); border: 0.0625rem solid var(--border, #2c2519); border-radius: var(--r-2xl);
  min-height: 0; min-width: 0; box-sizing: border-box;   /* min-width:0 → a wide child (the grid) scrolls itself, not the page */
}

/* MC workspace: a scrollable body + a FIXED action footer pinned to the bottom */
.es-work { display: flex; flex-direction: column; min-height: 0; }
.es-work-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--sp-9) 1.125rem; }
.es-foot { flex: none; display: flex; align-items: center; gap: var(--sp-6); padding: var(--sp-7) 1.125rem;
  border-top: 0.0625rem solid var(--border); background: var(--panel-2); border-radius: 0 0 var(--r-2xl) var(--r-2xl); }
.es-foot .es-spacer { flex: 1 1 auto; }

/* RC flex column */
.es-rc { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }

/* Phone: release the full-height lock, stack to one column, let the page scroll. */
@media (max-width: 900px) {
  body:has(.es-screen) main.app-main { height: auto; max-height: none; overflow: visible; }
  body:has(.es-screen) footer.app-footer { display: block; }
  .es-screen { grid-template-columns: 1fr; min-height: 0; }
  .es-screen > aside, .es-screen > main { overflow: visible; }
  .es-work-body { overflow: visible; }
  .es-rc { overflow: visible; }
}

/* ── shared editor-footer buttons (Atmospheres + Encounters twins — hoisted, audit 2026-07-17) ── */
/* .at-save/.enc-save folded → `btn at-save`/`btn enc-save` (2.1); neutral base from kit, `.dirty` = ember below. */
.at-save, .enc-save { border-radius: var(--r-lg); padding: 0.4375rem var(--sp-8); }
.at-save.dirty, .enc-save.dirty { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.at-btn, .enc-btn { background: none; border: 0.0625rem solid var(--border); color: var(--muted);
  border-radius: var(--r-lg); padding: 0.4375rem var(--sp-7); font-size: var(--fs-smplus); cursor: pointer; }
.at-btn:hover, .enc-btn:hover { border-color: var(--accent); color: var(--text); }
.at-bad:hover, .enc-bad:hover { border-color: var(--bad); color: rgba(var(--bad-rgb), .75); }
