/* Tablet puzzle controls share the existing board column's outer edges.
   Native puzzle-app-v4 adds its root class only for installed touch apps
   and the authenticated app preview. Keep the phone and desktop UI intact. */
@media (min-width: 701px) and (max-width: 1366px) and (min-height: 600px) {
  html.mca-puzzle-app-v4 .mca-puzzles-studio .mca-app-top-controls {
    box-sizing: border-box;
    width: var(--mca-app-board-size);
    max-width: 760px;
    margin-inline: auto;
    grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1fr) 40px 40px;
  }
}

/* In landscape the native board occupies the first workspace grid column.
   Follow that column, including its existing 760px board cap, without
   moving or resizing the board, header, notation or other controls. */
@media (min-width: 900px) and (max-width: 1366px) and (min-height: 600px) and (orientation: landscape) {
  html.mca-puzzle-app-v4 .mca-puzzles-studio .mca-app-top-controls {
    width: var(--mca-app-landscape-board);
    margin-inline-start: max(0px, calc((var(--mca-app-landscape-board) - 760px) / 2));
    margin-inline-end: auto;
  }
}
