/* Layout: a column, meeting on top, thin bar below. The bar is outside the meeting, so it never covers video. */
html, body { height: 100%; margin: 0; background: #000; }
body {
  display: flex; flex-direction: column; overflow: hidden;
  font: 14px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #ddd;
}
/* The meeting is centred; js/core/aspect.js sizes it to 16:9 when the area is landscape, the rest stays black. */
#meeting-container { flex: 1 1 auto; min-height: 0; min-width: 0; position: relative; display: flex; align-items: center; justify-content: center; }
#meeting-container > #meetFrame { flex: 0 0 auto; width: 100%; height: 100%; border: 0; }

#bar {
  flex: 0 0 auto; height: 32px; box-sizing: border-box; padding: 0 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #15151a; border-top: 1px solid #2a2a33;
}
#bar-slots { display: flex; align-items: center; gap: 8px; min-width: 0; }
#bar button {
  font: inherit; color: #ddd; background: #2a2a33; border: 1px solid #3a3a46; border-radius: 4px;
  padding: 1px 10px; cursor: pointer;
}
#bar button:hover { background: #3a3a46; }

/* GM panel column (js/gm/, css/gm.css): docked right of the meeting, not over it. */
body.gm { flex-direction: row; flex-wrap: wrap; }
body.gm #meeting-container { flex: 1 1 0; height: calc(100% - 33px); }
body.gm #gm-panel { flex: 0 0 340px; height: calc(100% - 33px); overflow-y: auto; background: #1b1b22; box-sizing: border-box; }
body.gm #bar { flex: 1 0 100%; }

/* ?demo=1 stand-in for the Jitsi meeting (static, no timers). */
.demo-meeting { display: grid; grid-template: 1fr 1fr / 1fr 1fr; gap: 6px; padding: 6px; background: #1c1c22; box-sizing: border-box; }
.demo-tile {
  position: relative; border-radius: 8px; overflow: hidden;
  background: linear-gradient(135deg, #2b4a6b, #6b3b4a);
  display: flex; align-items: flex-end; justify-content: flex-start;
}
.demo-tile.t2 { background: linear-gradient(135deg, #3b6b4a, #1d2f45); }
.demo-tile.t3 { background: linear-gradient(135deg, #7a6a3a, #3b2b4a); }
.demo-tile.t4 { background: linear-gradient(135deg, #4a3b6b, #2f6b6b); }
.demo-tile span { position: relative; z-index: 1; color: #fff; font-size: 14px; padding: 6px 10px; text-shadow: 0 1px 3px #000; }
.demo-face {
  position: absolute; left: 50%; top: 38%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; background: #e8c9a8; box-shadow: 0 min(18vh, 14vw) 0 min(4vh, 3vw) #345;
}

/* Shown instead of the meeting if Jitsi cannot be loaded. */
.meeting-fallback {
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: #1c1c22; color: #ddd; font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.meeting-fallback .why { color: #999; font-size: 13px; max-width: 40em; }
.meeting-fallback button { padding: 6px 14px; }

/* Handouts (js/handouts/): bar button with a badge, side panel right of the meeting. Plain boxes: no transitions,
 * animations, filters, blur or shadows (old machines). */
#bar .hp-badge:not([hidden]) {
  display: inline-block; min-width: 16px; margin-left: 6px; padding: 0 4px; box-sizing: border-box;
  border-radius: 8px; background: #b33; color: #fff; font-size: 12px; line-height: 16px; text-align: center;
}
.hp-badge[hidden], .hp-panel[hidden], .hp-detail[hidden], .hp-list[hidden] { display: none; }
.hp-panel { display: flex; flex-direction: column; box-sizing: border-box; background: #1b1b22; color: #ddd; border-left: 1px solid #2a2a33; min-height: 0; }
.hp-head { flex: 0 0 auto; display: flex; align-items: center; padding: 6px 10px; border-bottom: 1px solid #2a2a33; }
.hp-title { flex: 1; font-size: 15px; }
.hp-panel button, .hp-panel .hp-link { font: inherit; color: #ddd; background: #2a2a33; border: 1px solid #3a3a46; border-radius: 4px; padding: 4px 12px; cursor: pointer; text-decoration: none; }
.hp-panel button:hover, .hp-panel .hp-link:hover { background: #3a3a46; }
.hp-close { font-size: 20px; line-height: 1; padding: 2px 10px; }
.hp-list { list-style: none; margin: 0; padding: 6px 10px; overflow-y: auto; flex: 1 1 auto; }
.hp-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #2a2a33; }
.hp-item .hp-open { flex: 1; min-width: 0; text-align: left; overflow-wrap: anywhere; }
.hp-item a.hp-open { color: #9cf; padding: 4px 0; background: none; border: 0; }
.hp-kind { font-size: 11px; color: #888; }
.hp-new { font-size: 11px; color: #fff; background: #b33; border-radius: 8px; padding: 0 6px; }
.hp-detail { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 8px 10px; }
.hp-detail-bar { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 8px; }
.hp-status { flex: 0 0 auto; color: #aaa; padding: 6px 0; }
.hp-status:empty { display: none; }
.hp-stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; margin-top: 8px; }
.hp-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.hp-panel .hp-mode[hidden], .hp-panel .hp-link[hidden] { display: none; }
.hp-panel .hp-mode[aria-pressed="true"] { background: #4a4a5a; border-color: #8a8a9a; }
.hp-stage.hp-fill { align-items: stretch; }
.hp-frame { flex: 1 1 auto; width: 100%; min-height: 0; border: 0; background: #f3ead6; }
.hp-stage.hp-many { display: block; overflow-y: auto; }
.hp-part { margin: 0 0 16px; }
.hp-part .hp-img { display: block; max-height: none; height: auto; }
.hp-cap { display: block; color: #9cf; font-size: 13px; margin: 0 0 4px; text-decoration: none; }

@media (min-width: 701px) {
  body.hp-open { flex-direction: row; flex-wrap: wrap; }
  body.hp-open #meeting-container { flex: 1 1 0; min-width: 0; height: calc(100% - 33px); }
  body.hp-open .hp-panel { flex: 0 0 min(40vw, 560px); height: calc(100% - 33px); }
  body.hp-open #bar { flex: 1 0 100%; }
}
@media (max-width: 700px) {
  .hp-panel { position: fixed; left: 0; right: 0; top: 0; bottom: 33px; z-index: 10; border-left: 0; }
}
