/* Visual no estilo dos apps da Apple: fonte do sistema, vidro fosco, cantos arredondados e ícones de linha */
:root {
  --bg: #000000;
  --surface: #1c1c1e;
  --panel: rgba(28, 28, 30, 0.78);
  --panel-solid: #1c1c1e;
  --fill: rgba(118, 118, 128, 0.24);
  --fill-hover: rgba(118, 118, 128, 0.34);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f5f5f7;
  --muted: #98989d;
  --accent: #0a84ff;
  --accent-2: #0071e3;
  --danger: #ff453a;
  --ok: #30d158;
  --warn: #ffd60a;
  --radius: 18px;
  --blur: saturate(180%) blur(24px);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font-size: 15px; letter-spacing: -0.01em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.error { color: #ff6961; min-height: 1em; }
.error a { color: var(--accent); }
h1 { font-size: 30px; font-weight: 700; margin: 8px 0; letter-spacing: -0.03em; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.ico { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }

input, select, textarea {
  width: 100%; background: var(--fill); color: var(--text); border: 0;
  border-radius: 10px; padding: 11px 13px; font: inherit; outline: none;
  transition: box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #8e8e93; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.55); }
label { display: block; color: var(--muted); font-size: 13px; margin: 12px 0; }
label > input, label > select { margin-top: 6px; color: var(--text); font-size: 15px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  background: var(--fill); color: var(--text); border: 0; border-radius: 999px;
  padding: 10px 18px; font: inherit; font-weight: 600; white-space: nowrap;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--fill-hover); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: #2a95ff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 7px 13px; font-size: 13px; }
.btn.big { width: 100%; padding: 14px; font-size: 16px; margin-top: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; transition: background .15s, color .15s; }
.icon-btn:hover { color: var(--text); background: var(--fill); }
.row { display: flex; gap: 8px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.brand-dot { width: 14px; height: 14px; border-radius: 4px; background: linear-gradient(135deg, #0a84ff, #5e5ce6); }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--fill); border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 500; color: var(--muted); }
.pill.ok { color: var(--ok); }
.pill.warn { color: var(--warn); }

/* Lobby e painel */
body.lobby { display: grid; place-items: center; padding: 16px; min-height: 100%;
  background: radial-gradient(900px 500px at 15% -10%, rgba(10, 132, 255, 0.22), transparent),
              radial-gradient(800px 500px at 100% 110%, rgba(94, 92, 230, 0.18), transparent), var(--bg); }
.lobby-card { width: 100%; max-width: 560px; background: var(--panel); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-radius: 24px; padding: 30px; box-shadow: var(--shadow); }
.lobby-block { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.lobby-block .row { margin-top: 10px; }
.lobby-card.wide { max-width: 820px; }
body.panel-page { place-items: start center; padding-top: 40px; }
.list { display: flex; flex-direction: column; margin-top: 12px; background: rgba(255, 255, 255, 0.04); border-radius: 14px; overflow: hidden; }
.list > p { padding: 14px; margin: 0; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item-main { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.item-main b { font-weight: 600; }
.item-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
a.btn { text-decoration: none; }
@media (max-width: 600px) { .item { flex-direction: column; align-items: stretch; } }

/* Pré-entrada */
.prejoin { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.prejoin-card { width: 100%; max-width: 1000px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; }
.prejoin-preview { position: relative; aspect-ratio: 16/9; background: var(--surface); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); }
.prejoin-preview video { width: 100%; height: 100%; object-fit: cover; }
.prejoin-ctrls { position: absolute; bottom: 16px; left: 0; right: 0; display: flex; justify-content: center; gap: 14px; }
.round { width: 52px; height: 52px; border-radius: 50%; border: 0; color: #fff; background: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); cursor: pointer; display: grid; place-items: center; transition: background .15s, transform .1s; }
.round:hover { background: rgba(255, 255, 255, 0.28); }
.round:active { transform: scale(0.94); }
.round.off { background: #f5f5f7; color: #1c1c1e; }
@media (max-width: 760px) { .prejoin-card { grid-template-columns: 1fr; } }

/* Sala */
.call { height: 100%; display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; gap: 10px; }
.top-info { display: flex; gap: 8px; align-items: center; }
.body { flex: 1; display: flex; min-height: 0; gap: 12px; padding: 0 12px; }
.stage { flex: 1; position: relative; min-width: 0; background: var(--surface); border-radius: 22px; overflow: hidden; }

.media-wrap { position: absolute; overflow: hidden; background: var(--surface); }
.media-wrap video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.media-wrap.main { inset: 0; }
#remoteCamWrap.main video { object-fit: cover; }
#remoteCamWrap.tile video, .tile video { object-fit: cover; }
.mirror { transform: scaleX(-1); }
.tag { position: absolute; left: 10px; bottom: 10px; background: rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.tag:empty { display: none; }
.tag-right { position: absolute; right: 10px; bottom: 10px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: var(--danger); }

.tiles { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 10px; z-index: 5; }
.media-wrap.tile { position: relative; width: 240px; aspect-ratio: 16/9; border-radius: 16px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.12); }
@media (max-width: 760px) { .media-wrap.tile { width: 130px; } }
/* Quando a câmera do outro vira miniatura, ela entra na coluna de miniaturas */
#remoteCamWrap.tile { position: absolute; right: 12px; top: 12px; z-index: 6; }
/* Slides ou tela ocupam o palco à esquerda das miniaturas, sem ficar cobertos */
.stage.side #presentation, .stage.side #remoteScreenWrap { right: 264px; }
@media (max-width: 760px) { .stage.side #presentation, .stage.side #remoteScreenWrap { right: 154px; } }

.avatar { position: absolute; inset: 0; display: grid; place-items: center; background: var(--surface); }
.avatar span { width: 104px; height: 104px; border-radius: 50%; background: linear-gradient(180deg, #a1a1a6, #636366); display: grid; place-items: center; font-size: 42px; font-weight: 600; color: #fff; }
.tile .avatar span { width: 48px; height: 48px; font-size: 20px; }

.waiting { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: var(--surface); text-align: center; padding: 16px; }
.pulse { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(10, 132, 255, 0.5); } 70% { box-shadow: 0 0 0 28px rgba(10, 132, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(10, 132, 255, 0); } }

.banner { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: rgba(10, 132, 255, 0.9); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  padding: 6px 6px 6px 14px; border-radius: 999px; display: flex; gap: 10px; align-items: center; z-index: 7; font-size: 13px; font-weight: 500; }

/* Apresentação */
.presentation { position: absolute; inset: 0; display: flex; flex-direction: column; background: #111113; z-index: 2; }
.pres-surface { flex: 1; display: grid; place-items: center; min-height: 0; padding: 14px; }
.pres-surface canvas { max-width: 100%; max-height: 100%; background: #fff; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6); border-radius: 8px; }
.pres-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--panel); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-top: 1px solid var(--line); }
.pres-nav { display: flex; align-items: center; gap: 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.pres-name { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30%; }
.viewer .pres-nav button, .viewer #presClose { display: none; }

/* Chat (estilo Mensagens) */
.chat { width: 340px; display: flex; flex-direction: column; background: var(--surface); border-radius: 22px; overflow: hidden; }
.chat header { display: flex; justify-content: space-between; align-items: center; padding: 14px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 85%; }
.msg .meta { font-size: 11px; color: var(--muted); margin: 0 6px 3px; }
.msg .bubble { background: #3a3a3c; padding: 8px 13px; border-radius: 18px; white-space: pre-wrap; word-break: break-word; line-height: 1.35; }
.msg.mine { align-self: flex-end; }
.msg.mine .meta { text-align: right; }
.msg.mine .bubble { background: var(--accent); }
.msg a { color: #fff; }
.file-link { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 500; }
.chat-form { display: flex; gap: 6px; align-items: flex-end; padding: 10px; border-top: 1px solid var(--line); }
.chat-form textarea { resize: none; max-height: 120px; border-radius: 18px; padding: 8px 14px; }
.chat-form .icon-btn { width: 36px; height: 36px; flex-shrink: 0; }
.send-btn { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; margin-bottom: 1px; }
.send-btn:hover { background: #2a95ff; }
@media (max-width: 900px) {
  .chat { position: fixed; inset: 60px 12px 92px 12px; width: auto; z-index: 20; box-shadow: var(--shadow); }
}

/* Barra da chamada (estilo FaceTime) */
.toolbar { display: flex; justify-content: center; padding: 12px; }
.dock { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 999px; background: var(--panel);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--line); box-shadow: var(--shadow); flex-wrap: wrap; justify-content: center; }
.dock-sep { width: 1px; height: 28px; background: rgba(255, 255, 255, 0.12); margin: 0 2px; }
.tool { position: relative; width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.1); color: var(--text); cursor: pointer; transition: background .15s, transform .1s, color .15s; }
.tool:hover { background: rgba(255, 255, 255, 0.2); }
.tool:active { transform: scale(0.93); }
.tool.off { background: #f5f5f7; color: #1c1c1e; }
.tool.on { background: var(--accent); color: #fff; }
.tool.leave { width: 64px; border-radius: 999px; background: var(--danger); color: #fff; }
.tool.leave:hover { background: #ff5e55; }
.badge { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; display: grid; place-items: center; background: var(--danger); border-radius: 999px; font-size: 11px; font-weight: 600; padding: 0 5px; border: 2px solid var(--panel-solid); }
@media (max-width: 600px) { .tool { width: 42px; height: 42px; } .tool.leave { width: 54px; } .dock-sep { display: none; } .top-info .pill:first-child { display: none; } }

/* Modais (folhas do macOS) */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-card { width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; background: var(--panel); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-radius: 22px; padding: 20px; box-shadow: var(--shadow); }
.modal-card > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 17px; }
.opt { padding: 16px 0; border-top: 1px solid var(--line); }
.opt:first-of-type { border-top: 0; }
.opt .btn, .opt .row { margin-top: 10px; }
.bg-preview { aspect-ratio: 16/9; background: #000; border-radius: 14px; overflow: hidden; }
.bg-preview video { width: 100%; height: 100%; object-fit: cover; }
.bg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.bg-opt { aspect-ratio: 16/10; border-radius: 12px; border: 0; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; background: var(--fill) center/cover; display: grid; place-items: center;
  font: inherit; font-size: 12px; font-weight: 600; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); padding: 4px; text-align: center; transition: transform .1s; }
.bg-opt:hover { transform: scale(1.03); }
.bg-opt.sel { box-shadow: 0 0 0 3px var(--accent); }
.meter { height: 6px; background: var(--fill); border-radius: 99px; overflow: hidden; }
.meter div { height: 100%; width: 0; background: var(--ok); transition: width .08s; }

.toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); background: var(--panel); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--line); padding: 10px 18px; border-radius: 999px; z-index: 60; font-size: 14px; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

/* Transcrição e legendas */
.pill.rec { color: #ff6961; }
.pill.rec.off { color: var(--muted); }
.pill-select { width: auto; padding: 5px 10px; font-size: 12px; font-weight: 500; border-radius: 999px; }
.notice { display: flex; align-items: center; gap: 8px; background: rgba(10, 132, 255, 0.12); border-radius: 12px; padding: 10px 12px; color: #9ecbff; margin: 14px 0 0; }
.captions { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(820px, calc(100% - 300px)); display: flex; flex-direction: column; gap: 6px; z-index: 8; pointer-events: none; }
.caption { background: rgba(0, 0, 0, 0.6); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); padding: 8px 14px; border-radius: 14px; font-size: 18px; line-height: 1.35; }
.caption b { color: #64b5ff; margin-right: 6px; font-weight: 600; }
@media (max-width: 760px) { .captions { width: calc(100% - 24px); } .caption { font-size: 15px; } }

/* Lousa (estilo Freeform: painéis flutuantes claros) */
.board { position: absolute; inset: 0; display: flex; flex-direction: column; background: #f2f2f7; z-index: 2; color: #1d1d1f; }
.stage.side #board { right: 264px; }
@media (max-width: 760px) { .stage.side #board { right: 154px; } }
.wb-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 10px 0; padding: 6px 8px; background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-radius: 14px; box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08), 0 0 0 0.5px rgba(0, 0, 0, 0.08); }
.wb-group { display: flex; gap: 2px; align-items: center; padding-right: 8px; margin-right: 2px; border-right: 1px solid rgba(0, 0, 0, 0.08); }
.wb-group:last-child { border-right: 0; margin-left: auto; padding-right: 0; gap: 4px; }
.wb-top select { width: auto; background: rgba(0, 0, 0, 0.05); color: #1d1d1f; padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.wb-top select:focus { box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.35); }
.wb-btn { display: inline-grid; place-items: center; background: transparent; border: 0; color: #1d1d1f; border-radius: 8px; min-width: 32px; height: 32px; padding: 0 8px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 500; transition: background .12s; }
.wb-btn:hover { background: rgba(0, 0, 0, 0.06); }
.wb-page { font-size: 13px; min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; color: #3a3a3c; }
.wb-lock { display: flex; gap: 6px; align-items: center; color: #3a3a3c; margin: 0 4px 0 0; font-size: 13px; }
.wb-lock input { width: auto; margin: 0; accent-color: #007aff; }
.wb-color { width: 22px; height: 22px; border-radius: 50%; border: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); cursor: pointer; padding: 0; margin: 0 2px; transition: transform .1s; }
.wb-color:hover { transform: scale(1.12); }
.wb-color.sel { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #007aff; }
.wb-color.big { width: 40px; height: 40px; border-radius: 10px; }
.wb-size { width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.wb-size:hover { background: rgba(0, 0, 0, 0.06); }
.wb-size span { background: #1d1d1f; border-radius: 50%; display: block; }
.wb-size.sel { background: rgba(0, 122, 255, 0.12); }
.wb-size.sel span { background: #007aff; }
.wb-main { flex: 1; display: flex; min-height: 0; position: relative; }
.wb-tools { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); z-index: 3; display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: rgba(255, 255, 255, 0.9); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-radius: 14px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08), 0 0 0 0.5px rgba(0, 0, 0, 0.08); max-height: calc(100% - 20px); overflow-y: auto; }
.wb-tool { width: 38px; height: 38px; border-radius: 9px; border: 0; background: none; cursor: pointer; color: #3a3a3c; display: grid; place-items: center; transition: background .12s, color .12s; }
.wb-tool:hover { background: rgba(0, 0, 0, 0.06); }
.wb-tool.sel { background: rgba(0, 122, 255, 0.12); color: #007aff; }
.wb-surface { flex: 1; position: relative; display: grid; place-items: center; min-width: 0; overflow: hidden; padding-left: 58px; }
.wb-canvas { box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1), 0 0 0 0.5px rgba(0, 0, 0, 0.06); border-radius: 10px; touch-action: none; background: #fff; }
.wb-edit { position: absolute; border: 2px solid #007aff; outline: none; resize: none; overflow: hidden; line-height: 1.25; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, sans-serif; border-radius: 6px; white-space: pre; z-index: 3; box-shadow: none; }
.wb-edit:focus { box-shadow: none; }
.wb-edit.note { white-space: pre-wrap; line-height: 1.25; }
.wb-locked { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; background: rgba(29, 29, 31, 0.85); color: #fff; padding: 7px 14px; border-radius: 999px; font-size: 13px; z-index: 4; }
.wb-readonly .wb-tool:not([data-tool="laser"]), .wb-readonly .wb-top .wb-group:not(:last-child):not(.wb-pages) { opacity: .35; pointer-events: none; }
.wb-pop { position: absolute; left: 62px; top: 120px; background: rgba(255, 255, 255, 0.95); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-radius: 14px; padding: 8px; display: flex; gap: 4px; flex-wrap: wrap; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.1); z-index: 5; max-width: 340px; }
.wb-pop .wb-btn { font-size: 20px; width: 40px; height: 40px; }
.wb-ipa { left: auto; right: 12px; top: 64px; flex-direction: column; gap: 8px; color: #6e6e73; }
.wb-ipa-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.wb-pop .wb-btn.ipa { font-size: 17px; background: rgba(0, 0, 0, 0.04); font-family: -apple-system, "SF Pro Text", "Lucida Sans Unicode", "Segoe UI", sans-serif; }
@media (max-width: 760px) { .wb-tool { width: 32px; height: 32px; } .wb-top { gap: 3px; } .wb-surface { padding-left: 48px; } }
/* Com a lousa aberta, as câmeras ficam menores para sobrar espaço para desenhar */
.stage.side.board-mode .media-wrap.tile { width: 180px; }
.stage.side.board-mode #board { right: 204px; }
@media (max-width: 760px) { .stage.side.board-mode .media-wrap.tile { width: 110px; } .stage.side.board-mode #board { right: 130px; } }

/* Registro da aula */
.modal-card.narrow { max-width: 480px; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.status-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 14px; border-radius: 14px; border: 0;
  background: var(--fill); color: var(--text); cursor: pointer; font: inherit; transition: background .15s, box-shadow .15s; }
.status-btn:hover { background: var(--fill-hover); }
.status-btn b { font-size: 14px; font-weight: 600; }
.status-btn > span:last-child { font-size: 12px; color: var(--muted); }
.status-btn .ico { color: var(--accent); margin-bottom: 4px; }
.status-btn[data-status="noshow"] .ico, .status-btn[data-status="falta_reposicao"] .ico { color: var(--danger); }
.status-btn.sel { box-shadow: 0 0 0 2px var(--accent); background: rgba(10, 132, 255, 0.14); }
.row.end { justify-content: flex-end; margin-top: 8px; }

/* Contagem regressiva do professor */
.countdown { font-variant-numeric: tabular-nums; color: var(--text); }
.countdown.soon { color: var(--warn); background: rgba(255, 214, 10, 0.14); }
.countdown.over { color: #fff; background: var(--danger); }
.row.between { justify-content: space-between; align-items: center; }
.month-input { width: auto; padding: 6px 10px; font-size: 13px; color-scheme: dark; }
input[type="date"], input[type="time"] { color-scheme: dark; }
.tag-status { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: rgba(10, 132, 255, 0.16); color: #64b5ff; }
.tag-status.s-reposicao, .tag-status.s-falta_reposicao { background: rgba(191, 90, 242, 0.16); color: #da8fff; }

/* Coordenação */
.segmented { display: inline-flex; gap: 2px; padding: 3px; background: var(--fill); border-radius: 10px; margin-top: 20px; }
.seg { border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; font-weight: 500; padding: 6px 14px; border-radius: 8px; cursor: pointer; }
.seg.sel { background: #636366; }
.teacher-card { margin-top: 18px; padding: 16px; background: rgba(255, 255, 255, 0.04); border-radius: 16px; }
.teacher-head h3 { margin: 0; font-size: 17px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.stat { background: var(--fill); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.stat b { font-size: 22px; font-weight: 600; }
.stat span { font-size: 12px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.summaries { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.summary { background: rgba(255, 255, 255, 0.04); border-radius: 14px; padding: 4px 16px; }
.summary summary { cursor: pointer; padding: 10px 0; list-style: none; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.summary summary::-webkit-details-marker { display: none; }
.summary[open] { padding-bottom: 14px; }
.summary-body h4 { margin: 14px 0 4px; font-size: 14px; }
.summary-body p, .summary-body li { font-size: 14px; line-height: 1.45; color: #d1d1d6; }
.summary-body ul { margin: 0; padding-left: 20px; }
.talk-bar { display: flex; border-radius: 8px; overflow: hidden; font-size: 12px; font-weight: 500; margin: 6px 0; }
.talk-bar div { padding: 6px 8px; white-space: nowrap; overflow: hidden; }
.talk-bar div:first-child { background: var(--accent); }
.talk-bar div:last-child { background: #248a3d; text-align: right; }
.warn-text { color: var(--warn); }
@media (max-width: 600px) { .stats { grid-template-columns: 1fr 1fr; } }
.notice.block { display: block; line-height: 1.45; }

/* YouTube e mídia da aula */
.media-view { position: absolute; inset: 0; display: flex; flex-direction: column; background: #000; z-index: 2; }
.stage.side .media-view { right: 264px; }
@media (max-width: 760px) { .stage.side .media-view { right: 154px; } }
.media-surface { flex: 1; min-height: 0; display: grid; place-items: center; }
.media-surface #ytHost, .media-surface iframe { width: 100%; height: 100%; border: 0; }
.media-surface video { max-width: 100%; max-height: 100%; }
.media-surface.audio { background: radial-gradient(circle at 50% 40%, #1c1c1e, #000); }
.modal-card.wide-modal { max-width: 860px; }
.search-row { display: flex; align-items: center; gap: 8px; background: var(--fill); border-radius: 12px; padding: 4px 4px 4px 12px; margin-bottom: 6px; }
.search-row input { background: none; padding: 8px 4px; }
.search-row input:focus { box-shadow: none; }
.yt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.yt-item { border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; padding: 0; font: inherit; }
.yt-item img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 12px; display: block; transition: transform .15s; }
.yt-item:hover img { transform: scale(1.03); }
.yt-item b { display: block; font-size: 13px; font-weight: 600; margin-top: 6px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-item span { font-size: 12px; color: var(--muted); }
@media (max-width: 700px) { .yt-grid { grid-template-columns: 1fr 1fr; } }

/* Acervo */
.level-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 10px; }
.chip { border: 0; background: var(--fill); color: var(--text); font: inherit; font-weight: 600; padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.chip.sel { background: var(--accent); }
.lib-list { max-height: 50vh; overflow-y: auto; }
.lib-item { cursor: pointer; }
.lib-item:hover { background: rgba(255, 255, 255, 0.05); }
.lib-item .ico { color: var(--accent); }
.lib-extra { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 12px; }

/* Avisos */
.alert { display: flex; gap: 10px; align-items: flex-start; background: rgba(255, 159, 10, 0.14); color: #ffd28a; border-radius: 12px; padding: 12px; font-size: 13px; line-height: 1.45; margin-bottom: 8px; }
.alert .ico { color: #ff9f0a; flex-shrink: 0; margin-top: 1px; }
.alert.ok { background: rgba(48, 209, 88, 0.12); color: #a5f0b9; }
.alert.ok .ico { color: var(--ok); }
.end-icon { width: 64px; height: 64px; border-radius: 50%; background: rgba(255, 159, 10, 0.16); color: #ff9f0a; display: grid; place-items: center; margin: 4px auto 10px; }
.status-grid .status-btn:last-child:nth-child(odd) { grid-column: span 2; }
.status-btn[data-status="a_repor"] .ico { color: #bf5af2; }

/* Lousa: descrição das ferramentas e imagens */
.wb-tip { position: absolute; z-index: 9; transform: translateY(-50%); width: 240px; display: flex; flex-direction: column; gap: 4px;
  background: rgba(29, 29, 31, 0.94); color: #f5f5f7; padding: 10px 12px; border-radius: 12px; font-size: 12px; line-height: 1.4;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); pointer-events: none; }
.wb-tip b { font-size: 13px; font-weight: 600; }
.wb-tip span { color: #d1d1d6; }
.wb-tip kbd { align-self: flex-start; font: 600 11px -apple-system, sans-serif; background: rgba(255, 255, 255, 0.14); padding: 1px 6px; border-radius: 5px; margin-top: 2px; }
.wb-images { left: 62px; top: 70px; width: 420px; max-width: calc(100% - 80px); flex-direction: column; gap: 8px; }
.wb-img-search { display: flex; gap: 6px; width: 100%; }
.wb-img-search input { background: rgba(0, 0, 0, 0.05); color: #1d1d1f; padding: 8px 10px; font-size: 14px; }
.wb-img-search input:focus { box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3); }
.wb-img-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-height: 320px; overflow-y: auto; width: 100%; }
.wb-img-grid .muted { grid-column: 1 / -1; color: #6e6e73; margin: 6px 2px; }
.wb-img { border: 0; padding: 0; background: #f2f2f7; border-radius: 8px; overflow: hidden; aspect-ratio: 1; cursor: pointer; transition: transform .12s; }
.wb-img:hover { transform: scale(1.04); box-shadow: 0 0 0 2px #007aff; }
.wb-img.loading { opacity: .4; }
.wb-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wb-surface.drop { box-shadow: inset 0 0 0 3px #007aff; }
.stats { grid-template-columns: repeat(5, 1fr); }
.times { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); margin: 6px 0; }
.times b { color: var(--text); font-weight: 600; }
.tag-status.s-a_repor { background: rgba(255, 159, 10, 0.16); color: #ffb340; }
.quality-info { background: var(--fill); border-radius: 12px; padding: 10px 12px; line-height: 1.6; margin: 0 0 6px; }
.quality-info:empty { display: none; }

/* Câmeras maiores ao lado da tela compartilhada, slides, vídeo e lousa (tamanho acompanha a tela) */
.stage { --tile-w: clamp(280px, 25vw, 440px); }
.stage.tiles-s { --tile-w: 220px; }
.stage.tiles-l { --tile-w: clamp(360px, 33vw, 580px); }
.stage.side.board-mode { --tile-w: clamp(240px, 20vw, 360px); }
.stage.side.board-mode.tiles-s { --tile-w: 190px; }
.stage.side.board-mode.tiles-l { --tile-w: clamp(320px, 27vw, 480px); }
.media-wrap.tile, .stage.side.board-mode .media-wrap.tile { width: var(--tile-w); }
.stage.side #presentation, .stage.side #remoteScreenWrap, .stage.side #board, .stage.side .media-view, .stage.side.board-mode #board { right: calc(var(--tile-w) + 24px); }
@media (max-width: 760px) { .stage, .stage.tiles-l, .stage.tiles-s, .stage.side.board-mode { --tile-w: 130px; } }
.tile-size { position: absolute; top: 8px; right: 8px; z-index: 3; width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.5); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.stage.side .tile-size { opacity: .85; }
.stage.side .tile-size:hover { opacity: 1; }
.stage:not(.side) .tile-size { display: none; }
/* Lista de fundos: colunas sempre cabem na janela e nomes legíveis em qualquer fundo */
.bg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bg-opt { overflow: hidden; align-items: end; padding: 6px; text-shadow: none; }
.bg-opt span { background: rgba(0, 0, 0, 0.55); color: #fff; padding: 3px 7px; border-radius: 6px; font-size: 11px; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bg-opt:not([style*="background-image"]) { align-items: center; }
.bg-opt:not([style*="background-image"]) span { background: none; font-size: 12px; white-space: normal; }

/* Relatório sob medida */
#askInput { resize: vertical; min-height: 96px; line-height: 1.45; margin-top: 10px; }
.ask-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip-ex { border: 0; background: var(--fill); color: var(--muted); font: inherit; font-size: 12px; padding: 6px 10px; border-radius: 999px; cursor: pointer; text-align: left; }
.chip-ex:hover { color: var(--text); background: var(--fill-hover); }
.ask-result { margin-top: 18px; background: rgba(255, 255, 255, 0.04); border-radius: 16px; padding: 16px 18px; }
.ask-actions { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 6px; }
.ask-body { line-height: 1.55; font-size: 14px; color: #e5e5ea; }
.ask-body h2 { font-size: 20px; margin: 4px 0 10px; color: var(--text); }
.ask-body h3 { font-size: 16px; margin: 18px 0 6px; color: var(--text); }
.ask-body h4 { font-size: 14px; margin: 14px 0 4px; color: var(--text); }
.ask-body p { margin: 6px 0; }
.ask-body ul, .ask-body ol { margin: 6px 0; padding-left: 22px; }
.ask-body .table-wrap { margin: 10px 0; }
.ask-body hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* Login e usuários */
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; max-width: 380px; }
.auth-form .btn { align-self: flex-start; }
.user-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.user-who b { font-weight: 600; }
.temp-pass { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 17px; letter-spacing: .5px; color: var(--text); user-select: all; }
.role-tag { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--fill); color: var(--muted); }
.role-tag.off { color: #ff6961; }
.add-user { display: grid; grid-template-columns: 1.2fr 1.4fr 1fr auto; gap: 8px; margin-top: 12px; }
@media (max-width: 700px) { .add-user { grid-template-columns: 1fr; } }

/* Marca: Fluency Room by Fluency House */
.brand-logo { width: 26px; height: 26px; border-radius: 8px; background: #844B32; display: inline-grid; place-items: center; flex-shrink: 0; }
.brand-logo img { width: 17px; height: 17px; display: block; }
.brand-name { font-weight: 650; letter-spacing: -0.01em; }
.brand-name small { font-weight: 500; font-size: 12px; color: var(--muted); margin-left: 3px; }
.brand-area { color: var(--muted); font-weight: 500; }
.brand-area::before { content: '·'; margin: 0 8px 0 2px; }
@media (max-width: 480px) { .brand { flex-wrap: wrap; } .brand-area { flex-basis: 100%; margin-left: 34px; } .brand-area::before { display: none; } }
