/* Phone-width page rules for the new layout only (body.hub-v12).
   Widths 360, 390, and 412 are all under 560px, so one block covers them.
   This file does not style the phone top bar, side panel, or tab bar. */

body.hub-v12 .v12-quick { display: none; }

@media (max-width: 560px) {
  body.hub-v12 .modal-overlay {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }
  body.hub-v12 .modal-box,
  body.hub-v12 #modalBox {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }
  body.hub-v12 .v12-sheet,
  body.hub-v12 .v12-askpanel {
    width: 100%;
    max-width: none;
  }
  body.hub-v12 .modal-box > h2,
  body.hub-v12 .modal-box > .row:first-child,
  body.hub-v12 .v12-sheet > h2 {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
    padding-bottom: 8px;
  }
  body.hub-v12 .modal-box > .row:last-child,
  body.hub-v12 .v12-sheet > p:last-child {
    position: sticky;
    bottom: 0;
    z-index: 1;
    background: #fff;
    padding-top: 8px;
  }

  body.hub-v12 .v12-stats { grid-template-columns: 1fr 1fr; }
  body.hub-v12 .v12-grid,
  body.hub-v12 .grid-2,
  body.hub-v12 .vwrap,
  body.hub-v12 .v12-split,
  body.hub-v12 .v12-lanes { grid-template-columns: 1fr !important; }

  body.hub-v12 #mainContent button,
  body.hub-v12 #mainContent select,
  body.hub-v12 #mainContent textarea,
  body.hub-v12 #mainContent input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  body.hub-v12 .modal-box button,
  body.hub-v12 .modal-box select,
  body.hub-v12 .modal-box textarea,
  body.hub-v12 .modal-box input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  body.hub-v12 .v12-sheet button,
  body.hub-v12 .v12-askpanel button,
  body.hub-v12 .v12-askpanel select,
  body.hub-v12 .v12-askpanel textarea {
    min-height: 44px;
  }
  body.hub-v12 .modal-close,
  body.hub-v12 button.v12-x,
  body.hub-v12 .icon-btn {
    min-height: 0;
    min-width: 0;
  }

  body.hub-v12 table.v12-cardtable:not(.v12-keep) { border: 0; }
  body.hub-v12 table.v12-cardtable:not(.v12-keep) thead { display: none; }
  body.hub-v12 table.v12-cardtable:not(.v12-keep),
  body.hub-v12 table.v12-cardtable:not(.v12-keep) tbody,
  body.hub-v12 table.v12-cardtable:not(.v12-keep) tr,
  body.hub-v12 table.v12-cardtable:not(.v12-keep) td {
    display: block;
    width: auto;
  }
  body.hub-v12 table.v12-cardtable:not(.v12-keep) tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    margin: 0 0 10px;
    padding: 8px 10px;
    background: #fff;
  }
  body.hub-v12 table.v12-cardtable:not(.v12-keep) td { border: 0; padding: 4px 0; }
  body.hub-v12 table.v12-cardtable:not(.v12-keep) td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 650;
    color: var(--hub-ink-muted);
  }

  body.hub-v12 .v12-quick {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0;
  }
}
