/* Mango Meet — HGMAG CI: orange #EE7D00, text #333, band #EBEBEB, lines #D9D2CA */
:root {
  --orange: #EE7D00;
  --orange-10: #FDF2E6;
  --text: #333333;
  --muted: #7A7A7A;
  --page: #F8F8F8;
  --band: #EBEBEB;
  --line: #D9D2CA;
  --card: #FFFFFF;
  --danger: #C62828;
  --call-bg: #1E1E1E;
  --tile-bg: #2C2C2C;
  --font: "Open Sans", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 var(--font); color: var(--text); background: var(--page); }
[hidden] { display: none !important; }
.defs { position: absolute; }
svg { width: 22px; height: 22px; fill: currentColor; }
svg.ico { width: 15px; height: 15px; vertical-align: -2px; }
a { color: var(--orange); }

/* header and band */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
.brand b, h1 b { color: var(--orange); }
.brand.small { font-size: 15px; color: #fff; }
.who { font-size: 13px; color: var(--muted); }
.who a { margin-left: 8px; }
main { max-width: 1210px; margin: 0 auto; padding: 0 16px 32px; }
.band { background: var(--band); margin: 0 0 24px; padding: 18px 0;
  box-shadow: 0 0 0 100vmax var(--band); clip-path: inset(0 -100vmax); } /* grey band over the full width */
.band h1 { margin: 0; font-size: 24px; }
.band p { margin: 4px 0 0; }
h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 17px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.center { text-align: center; padding: 64px 0; }
.note { color: var(--muted); font-size: 13px; max-width: 670px; }
.note.small { font-size: 12px; margin: 12px 0 0; }
.error { color: var(--danger); font-size: 13px; margin: 6px 0; }

/* cards, forms, buttons */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 20px; }
.card.narrow { max-width: 560px; margin: 48px auto; }
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 10px; }
input[type=text], select { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; font: inherit;
  color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 4px; }
input[type=text]:focus, select:focus { outline: 2px solid var(--orange); outline-offset: 0; }
.btn { display: inline-block; padding: 9px 18px; font: 600 15px var(--font); color: var(--text); background: #fff;
  border: 1px solid var(--line); border-radius: 4px; cursor: pointer; text-decoration: none; }
.btn.primary { color: #fff; background: var(--orange); border-color: var(--orange); font-weight: 700; }
.btn.wide { display: block; width: 100%; margin-top: 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .round:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* pre-join */
.prejoin { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.preview { position: relative; background: var(--call-bg); border-radius: 6px; overflow: hidden; aspect-ratio: 16 / 9; }
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.novideo { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #bbb; }
.preview.has-video .novideo { display: none; }
.preview:not(.has-video) video { visibility: hidden; }
.meter { position: absolute; left: 12px; top: 12px; width: 90px; height: 6px; background: rgba(255,255,255,.25); border-radius: 3px; overflow: hidden; }
.meter div { height: 100%; width: 0; background: var(--orange); transition: width 80ms linear; }
.preview-bar { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 12px; }

/* round buttons (pre-join and call) */
.round { width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; color: #fff; background: rgba(255,255,255,.18); }
.round:hover { background: rgba(255,255,255,.28); }
.round .off { display: none; }
.round[aria-pressed=false] { background: var(--danger); }
.round[aria-pressed=false] .on { display: none; }
.round[aria-pressed=false] .off { display: inline; }
.round.leave { background: var(--danger); width: 56px; }

/* call */
body[data-view=v-call] { background: var(--call-bg); color: #eee; }
body[data-view=v-call] .top { display: none; }
body[data-view=v-call] main { max-width: none; padding: 0; height: 100%; }
#v-call { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.call-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; font-size: 13px; }
.call-top .muted { color: #aaa; }
.badge { background: rgba(255,255,255,.12); border-radius: 12px; padding: 2px 10px; }
.badge:last-child { margin-left: auto; }
.banner { margin: 0 16px 8px; padding: 8px 12px; background: var(--orange-10); color: var(--text); border-radius: 4px; font-size: 13px; }
.tiles { flex: 1; min-height: 0; display: grid; gap: 8px; padding: 0 16px;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 1), minmax(0, 1fr)); }
.tile { position: relative; background: var(--tile-bg); border-radius: 6px; overflow: hidden; min-height: 0;
  border: 2px solid transparent; transition: border-color 120ms; }
.tile.speaking { border-color: var(--orange); }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.local video { transform: scaleX(-1); }
.tile:not(.has-video) video { visibility: hidden; }
.avatar { position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%;
  background: var(--orange); color: #fff; font-weight: 700; font-size: 30px; display: flex; align-items: center; justify-content: center; }
.tile.has-video .avatar { display: none; }
.label { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); display: flex; align-items: center; gap: 6px;
  padding: 3px 8px; font-size: 13px; color: #fff; background: rgba(0,0,0,.55); border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label svg { width: 15px; height: 15px; flex: none; color: #ff8a80; }
.warn { position: absolute; left: 8px; right: 8px; top: 8px; padding: 4px 8px; font-size: 12px; color: var(--text);
  background: var(--orange-10); border-radius: 4px; }
.call-bar { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; }

/* dialog, toast */
dialog { border: 1px solid var(--line); border-radius: 6px; padding: 20px; width: min(420px, calc(100vw - 32px)); color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.45); }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); max-width: calc(100vw - 32px);
  padding: 10px 16px; background: #333; color: #fff; border-radius: 4px; font-size: 14px; z-index: 10; }

@media (max-width: 720px) {
  .prejoin { grid-template-columns: 1fr; }
  .tiles { gap: 6px; padding: 0 8px; }
  .call-top { padding: 8px; }
  .round { width: 44px; height: 44px; }
  .avatar { width: 56px; height: 56px; font-size: 20px; }
}
