/* =============================================================
   v36.133 — TERMINAL SCROLL LAYOUT (desktop >=1200px)

   User directive:
   "Left column menu and right column verdict fixed in place.
    The center section — intake, math trail, operator plays,
    CTA — make that section scrollable. It'll look like a
    real terminal."

   Design:
   - Sidebar left  — fixed (already fixed by outer .v2-shell grid)
   - Gauge right   — fixed via CSS sticky/height cap
   - Center rail   — ONE scroll region wrapping intake + results

   A tiny JS shim (in index.html) wraps .v2-intake-pane and
   #v2-results into a single #v2-center-rail div, so the whole
   center scrolls as one continuous column.

   Mobile (<1200px) is untouched — no wrapper is created, layout
   remains as it was (mobile scroll-to-gauge preserved).
   ============================================================= */

@media (min-width: 1200px) {

  html, body { height: 100%; overflow: hidden; }
  .v2-shell  { height: 100vh; overflow: hidden; }

  /* v36.182: the verdict gauge is no longer a fixed right column — it moved
     into the first results tab. The center rail now owns the full width, so
     the tabbed panels get real room instead of a 568px slot with 360px of
     dead space beside it. */
  .v2-main {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: 20px;
    row-gap: 14px;
    height: 100vh;
    overflow: hidden;
    padding: 18px 22px 22px !important;
    box-sizing: border-box;
  }

  .v2-topbar { grid-column: 1 / -1; grid-row: 1; }

  /* Dissolve .v2-columns so the verdict pane sits directly on
     .v2-main grid (col 2). #v2-center-rail sits directly on
     .v2-main grid too (col 1). */
  .v2-columns { display: contents !important; }

  /* ===== Center rail — ONE scroll region ===== */
  #v2-center-rail {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;   /* room for the scrollbar */
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* Keep the reading measure sane now that the rail is full-bleed.
     box-sizing matters here: #v2-results carries 56px side padding from the
     old two-column layout and is content-box, so width:100% resolved to
     rail width + 112px and silently overflowed the (overflow-x:hidden) rail,
     knocking the tabs and panels out of alignment with the intake pane. */
  #v2-center-rail > .v2-intake-pane,
  #v2-center-rail > #v2-results {
    box-sizing: border-box;
    width: 100%;
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Results no longer live in their own column, so the wide side gutter just
     pushed the tabs inward. Match the intake pane's edges. */
  #v2-center-rail > #v2-results {
    padding-left: 0;
    padding-right: 0;
  }

  /* Intake and results sit naturally in the flex column,
     top-to-bottom, sharing ONE scroll. */
  #v2-center-rail .v2-intake-pane,
  #v2-center-rail #v2-results {
    flex: none;
    order: 0 !important;    /* undo v121-facelift order:1/2 so DOM order wins */
    grid-column: unset !important;
    grid-row: unset !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* ===== v36.182: no more fixed gauge column =====
     The verdict pane lives inside #v2-panel-verdict now. It must NOT keep the
     old grid placement or the 100vh height cap, or it would open a second
     nested scroll region inside the tab panel. */
  .v2-tabpanel .v2-verdict-pane {
    grid-column: auto !important;
    grid-row: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
  }

  /* ===== Scrollbar polish ===== */
  #v2-center-rail::-webkit-scrollbar {
    width: 6px;
  }
  #v2-center-rail::-webkit-scrollbar-track {
    background: transparent;
  }
  #v2-center-rail::-webkit-scrollbar-thumb {
    background: rgba(120, 140, 200, 0.22);
    border-radius: 3px;
  }
  #v2-center-rail::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 140, 200, 0.44);
  }
  #v2-center-rail {
    scrollbar-width: thin;
    scrollbar-color: rgba(120, 140, 200, 0.28) transparent;
  }

}

/* Mobile / narrow — DO NOTHING. Wrapper isn't created below 1200px,
   original layout untouched, mobile scroll-to-gauge (verdict-v2.js:918)
   preserved. */
