/* ============================================
   FORECAST (REPORTS) PAGE — MOBILE LAYOUT
   Triggers at width=1000 viewport (mobile only)
   Graph edge-to-edge top, meta + table split below
   ============================================ */

@media (max-width: 1000px) {
  /* CSS Grid: graph spans both columns, meta + table side by side below */
  .optimize-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "graph graph"
      "meta  table";
    grid-template-rows: 600px 1fr;
    height: auto;
    overflow: visible;
    padding: 16px 40px 40px;
    gap: 16px;
  }

  /* Dissolve panels — children participate directly in parent grid */
  .left-panel {
    display: contents;
  }

  .right-panel {
    display: contents;
  }

  /* Graph: full width top */
  .graph-card {
    grid-area: graph;
    flex: none;
    min-height: unset;
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  /* Meta card: left column bottom */
  .graph-meta-card {
    grid-area: meta;
    flex: none;
    min-height: 220px;
    display: flex;
    flex-direction: column;
  }

  /* Table: right column bottom */
  .table-card {
    grid-area: table;
    flex: none;
    min-height: 220px;
    display: flex;
    flex-direction: column;
  }

  .table-card .card-body {
    overflow-y: auto;
  }

  /* Meta panel: scale up text to fill available space */
  .graph-meta-card {
    min-height: 300px;
  }

  .graph-meta-card .card-body {
    overflow-y: auto;
  }

  #default-body div {
    font-size: 1rem !important;
  }

  #default-body span {
    font-size: 1rem !important;
  }

  /* Recommendations table: readable text with wrapping */
  .table-card .recommendations-table {
    table-layout: fixed;
    width: 100%;
    min-width: unset;
  }

  .table-card .recommendations-table th,
  .table-card .recommendations-table td {
    font-size: 0.9rem;
    white-space: normal;
    word-break: break-word;
    padding: 8px 5px;
  }

  /* Tour tooltip — larger and full-width on mobile */
  #tour-tooltip-forecast {
    width: calc(100vw - 32px) !important;
    left: 16px !important;
    right: 16px !important;
    font-size: 1rem !important;
    line-height: 1.7 !important;
    padding: 18px 20px !important;
  }
}
