/* =====================================================================================================================
   2026-11-14 (Claude Code) — Live Meeting held sideways (phones + touch tablets). Owner: "footer overlays chat and board" →
   "footer move to left hand side, keep chat full screen". The meeting's control bar becomes a column on the LEFT; the header,
   chat and board use all the space to its right, nothing sits behind the bar. An open Chat (or Participants, etc.) fills the
   whole area (cameras step aside while it is open; voices keep playing). Computers (mouse) keep the bottom bar.
   Also: "rotate key on tablet — more space, not professional, add the name": wider screens show the key as a pill with
   "Rotate" next to the icon. Remove this file's <link> in index.html to go back.
   ===================================================================================================================== */

@media (orientation: landscape) and (max-height: 520px), (orientation: landscape) and (pointer: coarse) {
  /* the control bar: a column on the left */
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live) .mt-bar {
    left: max(8px, env(safe-area-inset-left)) !important; right: auto !important; top: 50% !important; bottom: auto !important;
    transform: translateY(-50%) !important; flex-direction: column !important; align-items: stretch !important;
    width: 80px !important; max-width: none !important; max-height: calc(100dvh - 16px) !important; box-sizing: border-box !important;
    overflow-x: hidden !important; overflow-y: auto !important; padding: 6px !important; gap: 3px !important; border-radius: 22px !important;
  }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live) .mt-bar .mt-ctl {
    flex: 0 0 auto !important;   /* never squeezed (the Mic key shrank to 1 px) */
    width: 100% !important; min-width: 0 !important; height: 56px !important; padding: 0 2px !important; font-size: .6rem !important;
  }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live) .mt-bar .mt-ctl span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Leave: same size as the other keys, a red rounded key at the end of the column */
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live) .mt-bar .mt-leave {
    flex: 0 0 auto !important; width: 100% !important; height: 50px !important; min-height: 0 !important; border-radius: 16px !important; margin: 4px 0 0 !important;
  }
  /* everything else starts right of the bar; no space kept at the bottom any more */
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live) {
    padding-left: calc(max(8px, env(safe-area-inset-left)) + 80px + 10px) !important;
    padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
  }
  /* owner 2026-11-14: "hide class name" — the header keeps the meeting ID and the clock */
  #v-meet .mt-head-live #mtTitle { display: none !important; }
  /* "More" opens beside the bar */
  #v-meet#v-meet#v-meet .mt-more-sheet {
    left: calc(max(8px, env(safe-area-inset-left)) + 80px + 10px) !important; transform: none !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important; max-height: calc(100dvh - 16px); overflow-y: auto;
  }

  /* the board view keeps its own layout; it just loses the space it kept for a bottom bar */
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage { padding-bottom: max(8px, env(safe-area-inset-bottom)) !important; }
}

/* phone sideways (short screen): compact keys so the whole column fits without scrolling */
@media (orientation: landscape) and (max-height: 520px) {
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live) .mt-bar { width: 72px !important; padding: 4px !important; gap: 1px !important; }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live) .mt-bar .mt-ctl { height: 44px !important; gap: 2px !important; font-size: .56rem !important; }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live) .mt-bar .mt-ctl .ic { width: 19px !important; height: 19px !important; }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live) .mt-bar .mt-leave { height: 42px !important; margin-top: 2px !important; }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live) .mt-bar .mt-micpick { display: none !important; }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live) { padding-left: calc(max(8px, env(safe-area-inset-left)) + 72px + 8px) !important; padding-top: 6px !important; }
  #v-meet#v-meet#v-meet .mt-more-sheet { left: calc(max(8px, env(safe-area-inset-left)) + 72px + 8px) !important; }
  /* an open Chat / Participants / … (not the board): full height and width right of the bar (phones — owner: "keep chat full screen") */
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live):has(> #mtPanel:not([hidden]):not(.mt-full)):not(:has(#mtBoardWrap)) {
    display: grid !important; grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: auto auto minmax(0, 1fr) !important;
    grid-template-areas: none !important; row-gap: 8px !important; column-gap: 0 !important;
    height: var(--tg-viewport-stable-height, 100dvh) !important; box-sizing: border-box !important; overflow: hidden !important;
  }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live):has(> #mtPanel:not([hidden]):not(.mt-full)):not(:has(#mtBoardWrap)) > .mt-head-live { grid-column: 1; grid-row: 1; }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live):has(> #mtPanel:not([hidden]):not(.mt-full)):not(:has(#mtBoardWrap)) > .mt-note,
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live):has(> #mtPanel:not([hidden]):not(.mt-full)):not(:has(#mtBoardWrap)) > .mt-tgbar { grid-column: 1; grid-row: 2; }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live):has(> #mtPanel:not([hidden]):not(.mt-full)):not(:has(#mtBoardWrap)) > .mt-stage { display: none !important; }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live):has(> #mtPanel:not([hidden]):not(.mt-full)):not(:has(#mtBoardWrap)) > #mtPanel {
    grid-column: 1; grid-row: 3; min-height: 0; max-height: none !important; margin: 0 !important; position: static !important;
    align-self: stretch !important; display: flex !important; flex-direction: column; overflow-y: auto;
  }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live) > #mtPanel:not(.mt-full) > .mt-msgs { flex: 1 1 auto; max-height: none !important; min-height: 0; overflow-y: auto; }

}

/* tablets sideways (touch, taller than a phone) — owner 2026-11-14 (tablet photos):
   "close board → see video like normal and keep chat bar so user can video call and chat": Chat / Participants open as a
   column on the right, the videos stay on the left; "move teacher and student to left hand side, on top of the Mute key, level
   with Thin / Medium": in the board view the people on camera stand in the left column, the keys move to its bottom. */
@media (orientation: landscape) and (pointer: coarse) and (min-height: 521px) {
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live):has(> #mtPanel:not([hidden]):not(.mt-full)):not(:has(#mtBoardWrap)) {
    display: grid !important; grid-template-columns: minmax(0, 1fr) clamp(300px, 30vw, 380px) !important; grid-template-rows: auto auto minmax(0, 1fr) !important;
    grid-template-areas: none !important; column-gap: 12px !important; row-gap: 8px !important;
    height: var(--tg-viewport-stable-height, 100dvh) !important; box-sizing: border-box !important; overflow: hidden !important;
  }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live):has(> #mtPanel:not([hidden]):not(.mt-full)):not(:has(#mtBoardWrap)) > .mt-head-live { grid-column: 1 / -1; grid-row: 1; }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live):has(> #mtPanel:not([hidden]):not(.mt-full)):not(:has(#mtBoardWrap)) > .mt-note,
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live):has(> #mtPanel:not([hidden]):not(.mt-full)):not(:has(#mtBoardWrap)) > .mt-tgbar { grid-column: 1 / -1; grid-row: 2; }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live):has(> #mtPanel:not([hidden]):not(.mt-full)):not(:has(#mtBoardWrap)) > .mt-stage { grid-column: 1; grid-row: 3; min-height: 0; overflow-y: auto; }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live):has(> #mtPanel:not([hidden]):not(.mt-full)):not(:has(#mtBoardWrap)) > #mtPanel {
    grid-column: 2; grid-row: 3; min-height: 0; max-height: none !important; margin: 0 !important; position: static !important;
    align-self: stretch !important; display: flex !important; flex-direction: column; overflow-y: auto;
  }
  /* (2026-11-14 later: the videos left of the board became one row above it — see the video strip below) */
  /* owner 2026-11-14: "move button Mute down to the same level as the whiteboard" — with the board open the key column starts
     level with the board panel (MeetScreen.js keeps --mt-board-top current) */
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage .mt-bar {
    top: var(--mt-board-top, 50%) !important; bottom: auto !important; transform: none !important;
    max-height: calc(100dvh - var(--mt-board-top, 0px) - 8px) !important;
  }
  /* "move class UI to the left, push chat UI up to the top": the header stays over the board; the chat column runs to the top */
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage.mt-with-side { grid-template-areas: "head side" "stage side" "board side" !important; }
}

/* 2026-11-14 owner (reference image + spec): the LUXURY GOLD ROTATE KEY — black-to-charcoal body, thin metallic champagne-gold
   edge (two-layer background: body on the padding box, gold gradient on the border box), gold two-arrow icon, gold "Rotate".
   Sizes: desktop ≥1024 px 210×54, tablet 600–1023 px 185×48, mobile ≤599 px 155×42 (touch area kept at 44 px). Only the look
   changes: the same key, label, click handler (MeetScreen.js) and visibility (touch devices). */
#v-meet .mt-head-live #mtTurn {
  --rt-w: 155px; --rt-h: 42px; --rt-ic: 19px; --rt-fs: 15px; --rt-gap: 8px; --rt-pad: 16px;
  --rt-body: linear-gradient(180deg, #353331 0%, #191919 52%, #100F0E 100%);
  --rt-gold: linear-gradient(180deg, #FFF1B0 0%, #F8D875 18%, #DDAA42 50%, #B67A20 84%, #FFE28A 100%);
  --rt-gold-hi: linear-gradient(180deg, #FFF6CC 0%, #FBE08A 18%, #E8B850 50%, #C48A2A 84%, #FFE9A3 100%);
  position: relative; box-sizing: border-box !important; flex: 0 0 auto !important;
  width: var(--rt-w) !important; height: var(--rt-h) !important; min-width: 0; padding: 0 var(--rt-pad) !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: var(--rt-gap) !important;
  border-radius: calc(var(--rt-h) / 2) !important; border: 1.5px solid transparent !important;
  background: var(--rt-body) padding-box, var(--rt-gold) border-box !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .35), 0 0 9px rgba(218, 165, 58, .18), inset 0 1px 0 rgba(255, 240, 185, .20) !important;
  overflow: visible; cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
#v-meet .mt-head-live #mtTurn[hidden] { display: none !important; }   /* still hidden where it was (computers with a mouse) */
/* subtle internal reflection on the upper half */
#v-meet .mt-head-live #mtTurn::before {
  content: ""; position: absolute; inset: 1px 10px 50% 10px; border-radius: calc(var(--rt-h) / 2) calc(var(--rt-h) / 2) 40% 40% / 100% 100% 30% 30%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, 0)); pointer-events: none;
}
/* the touch area is at least 44 px tall even when the key looks 42 px */
#v-meet .mt-head-live #mtTurn::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: max(44px, 100%); transform: translateY(-50%); }
#v-meet .mt-head-live #mtTurn .mt-turn-ic { width: var(--rt-ic); height: var(--rt-ic); flex: none; display: block; overflow: visible; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .35)); }
#v-meet .mt-head-live #mtTurn .mt-turn-lb {
  display: inline-block !important; font: 600 var(--rt-fs)/1 Inter, Arial, sans-serif !important; letter-spacing: .1px; white-space: nowrap;
  background: linear-gradient(180deg, #FFF3C2 0%, #F1CC70 55%, #D6A443 100%); -webkit-background-clip: text; background-clip: text;
  color: transparent !important; -webkit-text-fill-color: transparent; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .4));
}
@media (hover: hover) {
  #v-meet .mt-head-live #mtTurn:hover {
    transform: translateY(-1px);
    background: var(--rt-body) padding-box, var(--rt-gold-hi) border-box !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .38), 0 0 14px rgba(218, 165, 58, .32), inset 0 1px 0 rgba(255, 240, 185, .26) !important;
  }
}
#v-meet .mt-head-live #mtTurn:active { transform: scale(.98); }
#v-meet .mt-head-live #mtTurn:focus-visible { outline: 2px solid #FFE28A !important; outline-offset: 3px; }
#v-meet .mt-head-live #mtTurn[aria-busy="true"] { cursor: progress; }
/* press: the arrows turn once clockwise (600 ms) */
#v-meet .mt-head-live #mtTurn.is-turning .mt-turn-ic { animation: mt-turn-spin .6s cubic-bezier(.45, .05, .25, 1) 1; }
@keyframes mt-turn-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  #v-meet .mt-head-live #mtTurn { transition: none; }
  #v-meet .mt-head-live #mtTurn.is-turning .mt-turn-ic { animation: none; }
  #v-meet .mt-head-live #mtTurn:hover { transform: none; }
}
@media (min-width: 600px) and (max-width: 1023px) {
  #v-meet .mt-head-live #mtTurn { --rt-w: 185px; --rt-h: 48px; --rt-ic: 21px; --rt-fs: 17px; --rt-gap: 10px; --rt-pad: 18px; }
}
@media (min-width: 1024px) {
  #v-meet .mt-head-live #mtTurn { --rt-w: 210px; --rt-h: 54px; --rt-ic: 23px; --rt-fs: 19px; --rt-gap: 11px; --rt-pad: 22px; }
}

/* owner 2026-11-14: "move Thin / Medium / Thick / Full screen down to join the board" — the board starts right under its tool row */
#v-meet .mt-wrap.mt-board-stage > #mtPanel > .mt-boardwrap { align-items: flex-start !important; }
/* "key view tool left and right for computer": ‹ › at the ends of the one-row toolbar (MeetScreen.js toolArrows) */
#v-meet .mt-toolrow { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 0 0 auto; }
#v-meet .mt-toolrow > .mt-toolbox { flex: 1 1 auto; min-width: 0; }
#v-meet .mt-tarrow {
  flex: none; width: 34px; height: 34px; padding: 0 0 2px; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  border: 1px solid var(--zm-line, var(--vt-line)); background: var(--zm-key, var(--mc-glass-2)); color: var(--zm-ink, var(--vt-ink));
  font: 700 1.35rem/1 system-ui, sans-serif;
}
#v-meet .mt-tarrow:hover { filter: brightness(1.2); }
#v-meet .mt-tarrow[hidden] { display: none; }

/* 2026-11-14 owner: "enlarge view video, too small to see; videos in only one row, keys left and right in case of more
   students" — board view on tablets (sideways / big) and computers: one row of 16:10 videos right above the board's tool
   row (replaces the small floating pictures), as tall as the screen allows (≈123 px on a 1280×770 tablet, 150 px on a big
   screen); ‹ › keys (MeetScreen.js videoArrows) appear when more videos are hidden to the side. Tap a video = full screen. */
#v-meet .mt-varrow { display: none; }
@media (min-width: 900px) and (min-height: 521px), (orientation: landscape) and (min-width: 700px) and (min-height: 521px), (orientation: portrait) and (min-width: 600px) and (min-height: 900px) {   /* + upright tablets (owner 2026-11-14: "vertical: move the whiteboard down, below the videos") */
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage { --vrow-h: clamp(96px, 16dvh, 150px); }
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage > .mt-stage {
    display: block !important; position: relative !important; height: auto !important; min-height: 0 !important; flex: none !important;
    overflow: visible !important; padding: 0 !important; margin: 0 !important;
  }
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage .mt-grid:not(.is-audio):has(> .mt-tile.has-video) {
    position: static !important; top: auto !important; left: auto !important; right: auto !important; bottom: auto !important;
    width: 100% !important; max-height: none !important; height: var(--vrow-h) !important; box-sizing: border-box;
    display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; align-items: stretch !important; justify-content: flex-start !important;
    gap: 10px !important; overflow-x: auto !important; overflow-y: hidden !important; scrollbar-width: none; scroll-behavior: smooth;
  }
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage .mt-grid:not(.is-audio)::-webkit-scrollbar { display: none; }
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage .mt-grid:not(.is-audio) > .mt-tile.has-video:not(.is-big) {
    flex: 0 0 auto !important; height: 100% !important; width: calc(var(--vrow-h) * 1.6) !important; min-height: 0 !important; max-height: none !important;
    border-radius: 14px !important;
  }
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage .mt-grid:not(.is-audio) > .mt-tile:not(.is-big) .mt-tag { font-size: 12px !important; padding: 3px 8px !important; left: 6px !important; bottom: 6px !important; right: auto !important; }
  /* ‹ › over the ends of the row */
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage > .mt-stage > .mt-varrow:not([hidden]) {
    display: grid; place-items: center; position: absolute; top: 50%; transform: translateY(-50%); z-index: 6;
    width: 40px; height: 40px; padding: 0 0 3px; border-radius: 50%; cursor: pointer;
    font: 700 1.5rem/1 system-ui, sans-serif; color: #F6E3A6;
    background: rgba(16, 15, 14, .82); border: 1.5px solid rgba(221, 170, 66, .85); box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage > .mt-stage > .mt-varrow.is-l { left: 6px; }
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage > .mt-stage > .mt-varrow.is-r { right: 6px; }
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage > .mt-stage > .mt-varrow:hover { filter: brightness(1.2); }
}

/* upright tablets, board view — owner 2026-11-14 (upright tablet photo): "footer convert to vertical; chat move down to the
   bottom and also increase up to the whiteboard so users can read the text". The key bar becomes the left column (starting
   level with the whiteboard, like sideways); the board's frame is exactly the board (no empty band, no "turn sideways" line);
   the chat runs from just under the board to the bottom of the screen. */
@media (orientation: portrait) and (min-width: 600px) and (min-height: 900px) {
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage {
    padding-left: calc(max(8px, env(safe-area-inset-left)) + 80px + 10px) !important;
    padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
    height: calc(var(--tg-viewport-stable-height, 100dvh) - 4px) !important; min-height: 0 !important; box-sizing: border-box !important; overflow: hidden !important;   /* (#v-meet has 4 px on top) */
  }
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage .mt-bar {
    left: max(8px, env(safe-area-inset-left)) !important; right: auto !important; top: var(--mt-board-top, 50%) !important; bottom: auto !important;
    transform: none !important; flex-direction: column !important; align-items: stretch !important; justify-content: flex-start !important;
    width: 80px !important; max-width: none !important; max-height: calc(100dvh - var(--mt-board-top, 0px) - 8px) !important; box-sizing: border-box !important;
    overflow-x: hidden !important; overflow-y: auto !important; padding: 6px !important; gap: 3px !important; border-radius: 22px !important;
  }
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage .mt-bar .mt-ctl { flex: 0 0 auto !important; width: 100% !important; min-width: 0 !important; height: 56px !important; padding: 0 2px !important; font-size: .6rem !important; }
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage .mt-bar .mt-ctl span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage .mt-bar .mt-leave { flex: 0 0 auto !important; width: 100% !important; height: 50px !important; min-height: 0 !important; border-radius: 16px !important; margin: 4px 0 0 !important; }
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage ~ .mt-more-sheet, #v-meet:has(.mt-board-stage) .mt-more-sheet {
    left: calc(max(8px, env(safe-area-inset-left)) + 80px + 10px) !important; transform: none !important; bottom: max(8px, env(safe-area-inset-bottom)) !important;
  }
  /* the board panel = tool row + the board, nothing more */
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage > #mtPanel { flex: 0 0 auto !important; }
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage > #mtPanel > .mt-boardwrap { flex: none !important; height: auto !important; min-height: 0 !important; aspect-ratio: 1.6; }
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage > #mtPanel > .mt-boardwrap::after { content: none !important; display: none !important; }
  /* the chat: everything from under the board to the bottom */
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage > #mtSide { flex: 1 1 auto !important; min-height: 160px !important; max-height: none !important; display: flex !important; flex-direction: column; overflow: hidden; }
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage > #mtSide .mt-msgs { flex: 1 1 auto !important; max-height: none !important; min-height: 0 !important; overflow-y: auto !important; }
}

/* 2026-11-15 owner (upright tablet): "header bar class name — I need it full from left to right". The key column starts level with
   the whiteboard, so the header above it can use the whole width: it is pulled left over the column space (80 + 10 px). */
@media (orientation: portrait) and (min-width: 600px) and (min-height: 900px) {
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage > .mt-head-live { margin-left: -90px !important; }
}

/* 2026-11-15 owner (tablet sideways): "move the video more left, and the header bar too". With the board open, the key column now
   starts level with the board (like the upright tablet), so the header and the camera row above it use the space to its left. */
@media (orientation: landscape) and (max-height: 520px), (orientation: landscape) and (pointer: coarse) {
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage .mt-bar { top: var(--mt-board-top, 50%) !important; transform: none !important; max-height: calc(100dvh - var(--mt-board-top, 0px) - 8px) !important; }
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage > .mt-head-live, #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage > .mt-stage { margin-left: -90px !important; }
}
@media (orientation: landscape) and (max-height: 520px) {
  #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage > .mt-head-live, #v-meet#v-meet#v-meet .mt-wrap.mt-board-stage > .mt-stage { margin-left: -80px !important; }
}

/* 2026-11-15 owner (computer photo: Chat open alone was one huge empty box across the whole screen — "not professional"):
   on computers Chat / Participants open as a column on the RIGHT, full height; the videos (or a shared screen) stay on the left
   — like Zoom / Google Meet. (The board view already has its own side column.) */
@media (pointer: fine) and (min-width: 900px) {
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live):has(> #mtPanel:not([hidden]):not(.mt-full)):not(:has(#mtBoardWrap)) {
    display: grid !important; grid-template-columns: minmax(0, 1fr) clamp(320px, 27vw, 400px) !important; grid-template-rows: auto auto minmax(0, 1fr) !important;
    grid-template-areas: none !important; column-gap: 12px !important; row-gap: 8px !important;
    height: var(--tg-viewport-stable-height, 100dvh) !important; box-sizing: border-box !important; overflow: hidden !important;
    padding-bottom: calc(max(10px, env(safe-area-inset-bottom)) + 88px) !important;
  }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live):has(> #mtPanel:not([hidden]):not(.mt-full)):not(:has(#mtBoardWrap)) > .mt-head-live { grid-column: 1 / -1; grid-row: 1; }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live):has(> #mtPanel:not([hidden]):not(.mt-full)):not(:has(#mtBoardWrap)) > .mt-note,
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live):has(> #mtPanel:not([hidden]):not(.mt-full)):not(:has(#mtBoardWrap)) > .mt-tgbar { grid-column: 1 / -1; grid-row: 2; }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live):has(> #mtPanel:not([hidden]):not(.mt-full)):not(:has(#mtBoardWrap)) > .mt-stage { grid-column: 1; grid-row: 3; min-height: 0; overflow-y: auto; }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live):has(> #mtPanel:not([hidden]):not(.mt-full)):not(:has(#mtBoardWrap)) > #mtPanel {
    grid-column: 2; grid-row: 3; min-height: 0; max-height: none !important; margin: 0 !important; position: static !important;
    align-self: stretch !important; display: flex !important; flex-direction: column; overflow: hidden;
  }
  #v-meet#v-meet#v-meet .mt-wrap:has(> .mt-head-live) > #mtPanel:not(.mt-full) > .mt-msgs { flex: 1 1 auto; max-height: none !important; min-height: 0; overflow-y: auto; }
}
