/*! Copyright (c) 2026 Mark T. Fulwider. All rights reserved. */
/* Workspaces follow the browser viewport, including monitor moves and zoom.
   Keep reading columns bounded; give tools the remaining screen space. */
@media screen {
  :root { --screen-gutter: clamp(18px, 3.5vw, 112px); }
  .public-site:not([data-page=home]) .wrap { width: calc(100% - 2 * var(--screen-gutter)); max-width: none; }
  .public-site:not([data-page=home]) .wrap.narrow { max-width: 780px; }
  .public-site:not([data-page=home]) .compact-header .masthead { width: calc(100% - 2 * var(--screen-gutter)); }
  .public-site :is(.eq-two-panes, .eq-hero-grid, .write-room, .research-workspace) > *,
  .workspace > *, .archive-layout > *, .edit-workbench > * { min-width: 0; }
  .public-site :is(input, select, textarea) { max-width: 100%; }
  .public-site pre { max-width: 100%; overflow-x: auto; }
  .section-shortcuts, .latex-menu .wrap { flex-wrap: wrap; }
  .eq-paper, .manuscript-preview { min-width: 0; max-width: 100%; overflow-x: auto; }
  .archive-shell { max-width: none; }
  .archive-preview { min-width: 0; overflow-wrap: anywhere; }
  .ll-wrap, .lightlab-focus .ll-wrap { width: calc(100% - 2 * var(--screen-gutter)); max-width: none; }


  .workspace { width: 100%; max-width: none; min-height: calc(100dvh - var(--site-header-height, 76px)); }
  body:has(> .workspace) > .masthead { height: auto; min-height: 76px; }
  .workspace :is(.left-rail, .right-rail) {
    top: var(--site-header-height, 76px);
    height: calc(100dvh - var(--site-header-height, 76px));
  }
  .workspace :is(.record-row, .project-card, .breadcrumbs) { overflow-wrap: anywhere; }
  .workspace :is(.form-grid, .local-layout, .preferences-grid) > * { min-width: 0; }
  .flyout { max-height: calc(100dvh - var(--site-header-height, 76px) - 24px); overflow: auto; }
  dialog { max-width: calc(100% - 24px); max-height: calc(100dvh - 24px); }

  @media (min-width: 851px) {
    .eq-two-panes, .eq-hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 850px) {
    .workspace :is(.left-rail, .right-rail) { top: auto; height: auto; }
    .workspace, .workspace:has(.reading-workbench),
    body[data-right-sidebar=hidden] .workspace,
    body[data-edit-room=true] .workspace,
    body[data-entrance=true] .workspace { display: block; }
    .workspace .signin-strip > div { min-width: 0; }
    .flyout { max-height: calc(100dvh - 180px); }
  }
  @media (max-width: 480px) {
        .public-site:not([data-page=home]) .compact-header .brand { min-width: 0; font-size: clamp(16px, 5vw, 24px); }
    .public-site:not([data-page=home]) .compact-header .brand-mark { width: 22px; height: 22px; flex-shrink: 0; }
  }
}
