/* SMART PLAN V33 — TEST-ONLY desktop 100%-browser / 80%-density layout.
   CSS only. No quote engine, data model, policy, API, or monthly logic modifications.
   Applied only to the logged-in application, not login screen.
   Desktop responsive override is deliberately opt-in by viewport width.
 */
@media screen and (min-width: 1440px) and (max-width: 1720px) {
  #appView {
    zoom: .80;
    /* Preserve the WIDE-desktop product-grid layout. EW is separately gated by
       the existing body.ew-admin-enabled feature; do not add/remove grid cells. */
    --product-grid: 40px 92px minmax(220px,2.7fr) 74px 102px 72px repeat(6,minmax(82px,1fr)) 58px 36px;
  }
  body.ew-admin-enabled #appView {
    --product-grid: 40px 88px minmax(205px,2.55fr) 72px 96px 68px 64px repeat(6,minmax(76px,1fr)) 58px 36px;
  }
  /* Source CSS switches to a two-row header under 1720px; restore the 80%
     desktop reference layout when the application itself has 80% scale. */
  #appView .topbar.v3-topbar {
    height: 64px !important;
    min-height: 64px !important;
    display: grid !important;
    grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) !important;
    grid-template-rows: 64px !important;
    column-gap: 12px !important;
    row-gap: 0 !important;
    padding: 0 18px !important;
  }
  #appView .topbar.v3-topbar > .brand-row {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }
  #appView .topbar.v3-topbar > .topbar-tools {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: auto !important;
    min-width: 0 !important;
    justify-self: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border-top: 0 !important;
    overflow: visible !important;
  }
  #appView .topbar.v3-topbar > nav {
    grid-column: 3 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    min-width: 0 !important;
  }
  #appView .topbar.v3-topbar > .topbar-tools > * {flex: 0 0 auto !important}
  #appView .page.v3-page {
    width: min(calc(100% - 32px), 1880px) !important;
  }
  #appView .quote-grid.v3-workspace-grid {
    grid-template-columns: minmax(0,1fr) 394px !important;
    gap: 14px !important;
  }
  #appView .summary-stack.v3-plan-board {position: sticky !important;top: 78px !important;order: 0 !important;min-width: 0 !important}
  #appView .plan-board-card {padding: 0 14px 14px !important;display: block !important}
  #appView .plan-board-head {margin: 0 -14px 12px !important;padding: 15px 14px !important;border-radius: 0 !important}
  #appView .plan-main-metrics {grid-template-columns: 1fr 1fr !important}
  #appView .plan-small-metrics {grid-template-columns: repeat(3,1fr) !important}
  #appView .plan-small-metrics > div:last-child {grid-column: auto !important}
  #appView .quick-workbar > .quick-policy-switches {grid-column: auto !important}
  #appView .auto-promo-board {grid-template-columns: repeat(8,minmax(110px,1fr)) !important;gap: 8px !important}
  /* A desktop strip stays scrollable instead of overlapping the board if a PC
     has unusually large system fonts or an extra browser extension button. */
  #appView .quote-grid.v3-workspace-grid > * {min-width: 0}
  #appView .products-card.v3-products-card {min-width: 0}
}
@media print {
  #appView {zoom: 1 !important}
}
