/* Viewport shell: the banner and account area must not compete with navigation. */
body { --banner-height: 0px; }
body:has(#environment-banner:not([hidden])) { --banner-height: 34px; }
#environment-banner { line-height: 16px; }
.shell { min-height: calc(100dvh - var(--banner-height)); grid-template-columns: 240px minmax(0,1fr); }
.shell > aside { top: var(--banner-height); height: calc(100dvh - var(--banner-height)); min-height: 0; }
.shell > aside .brand, .aside-foot { flex-shrink: 0; }
#nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; align-content: start; scrollbar-gutter: stable; }
.aside-foot { margin-top: 12px; overflow-wrap: anywhere; }
#logout { min-height: 36px; }
.shell > main, #view, .panel, .review-grid > *, .eic-workspace-grid > *, .eic-decision-grid > *, .dashboard-grid > * { min-width: 0; }
.shell header, .row, .tabs { flex-wrap: wrap; }
.header-actions, .actions, .filters { min-width: 0; }
button, .pill, .safety { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
input, select, textarea { min-width: 0; max-width: 100%; }
.filters input, .filters select { max-width: 100%; }
.panel, .notice, .fact, .editorial-body, .ProseMirror, .review-status-panel dd, .eic-details dd { overflow-wrap: anywhere; }
.table-wrap { max-width: 100%; overscroll-behavior-x: contain; }
img, video, canvas { max-width: 100%; }
.editor-toolbar { flex-wrap: wrap; }
.ProseMirror { min-width: 0; }
.ProseMirror img { height: auto; }
dialog { max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; }
@media(max-width:1280px) {
  .shell > main { padding: 22px; }
  .review-grid, .eic-workspace-grid, .eic-decision-grid { grid-template-columns: minmax(0,1fr); }
  .social-grid, .config-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,260px),1fr)); }
  .review-grid:has(.next-action-panel) { grid-template-areas: "next" "article" "tabs" "stack"; }
  .review-grid:has(.next-action-panel) > .panel:first-child { grid-area: article; }
  .review-grid:has(.next-action-panel) > .panel:last-child { display: contents; }
  .review-grid .next-action-panel { grid-area: next; position: static; max-height: none; overflow: visible; }
  .review-grid:has(.next-action-panel) .tabs { grid-area: tabs; }
  .review-grid:has(.next-action-panel) .stack { grid-area: stack; }
}
/* Keep guidance and review tabs together; a sticky child must not cover its siblings. */
@media(min-width:1281px) {
  .review-grid:has(.next-action-panel) > .panel:last-child {
    position: sticky; top: calc(var(--banner-height) + 1rem); align-self: start;
    max-height: calc(100dvh - var(--banner-height) - 2rem); overflow: auto;
  }
  .review-grid .next-action-panel { position: static; max-height: none; overflow: visible; }
}
@media(max-height:720px) {
  .shell > aside { padding-block: 12px; }
  .brand { padding-bottom: 12px; }
  .aside-foot { gap: 5px; padding-block: 6px; margin-top: 6px; }
}
@media(max-width:760px) {
  .shell { grid-template-columns: minmax(0,1fr); }
  .shell > aside { position: relative; top: auto; height: auto; max-height: calc(100dvh - var(--banner-height)); }
  #nav { max-height: 25dvh; flex: 0 1 auto; }
  .aside-foot { display: flex; flex-wrap: wrap; align-items: center; }
  .shell > main { padding: 16px; }
  .cards, .dashboard-grid { grid-template-columns: minmax(0,1fr); }
  .review-status-panel dl, .eic-details { grid-template-columns: minmax(0,1fr); }
  .article-reference { min-width: 0; }
  .login-card { padding: 24px; }
}

/* Owner administration stays beside Sign out, outside primary editorial navigation. */
.account-actions {display:flex;align-items:center;flex-wrap:wrap;gap:8px;position:relative;}
#owner-settings summary {cursor:pointer;min-height:36px;display:flex;align-items:center;}
#settings-menu {position:absolute;bottom:100%;left:0;z-index:20;width:200px;max-height:40dvh;overflow:auto;padding:8px;background:var(--cimer-paper,#F4F0E6);color:#041719;border:1px solid #C89A32;border-radius:8px;box-shadow:0 4px 16px #0003;}
#settings-menu button {display:block;width:100%;margin:4px 0;}
.queue-view-control {display:flex;align-items:center;gap:12px;margin-bottom:16px;max-width:360px;}

.cms-release-panel {border:1px solid var(--cimer-gold,#C89A32);border-radius:10px;padding:14px;margin-bottom:18px;background:var(--cimer-paper,#F4F0E6);}
.cms-release-heading {display:flex;align-items:center;flex-wrap:wrap;gap:10px 18px;}
.cms-release-heading h2 {font-size:18px;margin:0;}.cms-release-heading button {margin-left:auto;min-height:40px;}
.cms-readiness-checklist {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 16px;margin:12px 0;}
.cms-readiness-checklist div {min-width:0;}.cms-readiness-checklist dt {font-size:12px;color:#53605b;}.cms-readiness-checklist dd {margin:2px 0;font-weight:600;overflow-wrap:anywhere;}
.cms-release-panel p {font-size:13px;margin:6px 0;}
@media(max-width:1050px){.cms-readiness-checklist{grid-template-columns:repeat(2,minmax(0,1fr));}}

/* Editorial Queue controls never resize article/editor typography. */
.queue-tools,.queue-pagination { display:flex; flex-wrap:wrap; align-items:center; gap:.8rem; margin:1rem 0; }
.queue-tools [role="group"] { display:flex; align-items:center; gap:.5rem; }
.queue-scroll { overflow:auto; max-height:65vh; isolation:isolate; border:1px solid var(--border,#d9dfe4); }
.queue-scroll .editorial-queue { min-width:1700px; width:100%; border-collapse:separate; border-spacing:0; }
.queue-scroll thead th { position:sticky; top:0; z-index:1; background:var(--paper,#fff); color:var(--ink,#19272d); }
.queue-sort { font:inherit; color:inherit; background:transparent; border:0; text-align:left; padding:.3rem; min-height:40px; white-space:normal; }
.queue-sort:focus-visible,.queue-scroll:focus-visible { outline:3px solid #1c7472; outline-offset:-3px; }
.queue-scroll .editorial-queue { font-size:14px; line-height:1.45; }
.queue-scroll .editorial-queue td { padding:10px 8px; vertical-align:top; overflow-wrap:anywhere; min-width:90px; max-width:300px; }
.queue-scroll .editorial-queue td:first-child { min-width:55px; }
.queue-scroll .editorial-queue td:nth-child(3) { min-width:230px; }
.queue-scroll .editorial-queue td:nth-child(4) { min-width:240px; }
.queue-scroll .editorial-queue td:nth-child(10) { min-width:240px; }
.queue-scroll .editorial-queue small,.queue-scroll .editorial-queue .article-reference-open,.queue-scroll .editorial-queue .story-reference { font-size:inherit; line-height:inherit; }
.queue-scroll .editorial-queue[data-density="0"] { font-size:13px; line-height:1.35; }
.queue-scroll .editorial-queue[data-density="0"] td { padding:6px; }
.queue-scroll .editorial-queue[data-density="2"] { font-size:16px; line-height:1.55; }
.queue-scroll .editorial-queue[data-density="2"] td { padding:14px 10px; }
.queue-productivity label { max-width:100%; }
.queue-productivity select { max-width:100%; }
.queue-scroll .editorial-queue th { font-size:inherit; line-height:inherit; }
