/* Aosei Meet — page web des réunions. Couleurs de la marque : Nuit, Terre brune,
   Latérite, Ocre, Sable, Ivoire cauri. Coins arrondis 8 / 16 / 24. */
:root {
  --nuit: #1E120A; --terre: #4A2814; --laterite: #9A5F2E; --ocre: #D49A5C;
  --sable: #F3EBDD; --ivoire: #F6E7CF; --rouge: #C2452D;
  --panel: #2A190E; --panel2: #352013; --line: rgba(246, 231, 207, .12);
  --muted: rgba(246, 231, 207, .66);
  font-family: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--nuit); color: var(--ivoire); display: flex; flex-direction: column; min-height: 100vh; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--ocre); }

.top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); min-height: 56px; }
.logo { height: 28px; width: auto; }
.product { font-weight: 700; color: var(--ocre); letter-spacing: .02em; }
.spacer { flex: 1; }
.meeting-title { color: var(--muted); font-size: 14px; max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.screen.card { width: min(560px, calc(100% - 32px)); margin: 48px auto; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 28px; text-align: center; }
.screen.card.wide { width: min(980px, calc(100% - 32px)); text-align: left; }
h1 { font-size: 24px; margin: 0 0 8px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: #F1A08D; min-height: 1.2em; margin: 8px 0 0; }
.row { display: flex; gap: 8px; margin: 20px 0; }
.row input { flex: 1; }
input, select { background: var(--nuit); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; width: 100%; outline: none; }
input:focus, select:focus { border-color: var(--ocre); }
label { display: block; font-size: 14px; color: var(--muted); margin: 14px 0 0; }
label input, label select { margin-top: 6px; color: var(--ivoire); }

.btn { border: 1px solid var(--line); background: var(--panel2); border-radius: 16px; padding: 11px 18px; cursor: pointer; font-weight: 600; }
.btn:hover { border-color: var(--ocre); }
.btn.primary { background: var(--ocre); border-color: var(--ocre); color: var(--nuit); }
.btn.primary:hover { background: #E0AC72; }
.btn.big { width: 100%; padding: 14px; margin-top: 20px; font-size: 16px; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }

.prejoin { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
.preview { position: relative; aspect-ratio: 16 / 10; background: #000; border-radius: 16px; overflow: hidden; }
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview-off { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); background: var(--terre); }
.preview-bar { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; gap: 12px; justify-content: center; }
.round { width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(30, 18, 10, .7); display: grid; place-items: center; cursor: pointer; }
.round[aria-pressed="false"] { background: var(--rouge); }
@media (max-width: 760px) { .prejoin { grid-template-columns: 1fr; } .screen.card { margin: 16px auto; padding: 20px; } }

.spinner { width: 44px; height: 44px; margin: 8px auto 18px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--ocre); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* ---- Réunion ---- */
.room { flex: 1; display: grid; grid-template-columns: 1fr auto; grid-template-rows: 1fr auto; min-height: 0; height: calc(100vh - 57px); }
.stage { position: relative; min-height: 0; padding: 12px; overflow: hidden; }
.grid { height: 100%; display: grid; gap: 10px; grid-template-columns: repeat(var(--cols, 1), 1fr); grid-auto-rows: 1fr; }
.grid.has-screen { grid-template-columns: 1fr; grid-template-rows: 1fr 140px; }
.grid.has-screen .thumbs { display: flex; gap: 10px; overflow-x: auto; }
.grid.has-screen .thumbs .tile { flex: 0 0 200px; }
.tile { position: relative; background: var(--terre); border-radius: 16px; overflow: hidden; min-height: 0; border: 2px solid transparent; }
.tile.speaking { border-color: var(--ocre); }
.tile video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.tile.screen video, .tile.contain video { object-fit: contain; }
.tile.local video { transform: scaleX(-1); }
.tile.local.screen video { transform: none; }
.tile .avatar { position: absolute; inset: 0; display: grid; place-items: center; }
.tile .avatar span { width: 84px; height: 84px; border-radius: 50%; background: var(--laterite); display: grid; place-items: center; font-size: 34px; font-weight: 700; }
.tile .name { position: absolute; left: 10px; bottom: 10px; background: rgba(30, 18, 10, .72); padding: 4px 10px; border-radius: 8px; font-size: 13px; display: flex; gap: 6px; align-items: center; max-width: calc(100% - 20px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tile .hand { position: absolute; top: 10px; right: 10px; background: var(--ocre); color: var(--nuit); border-radius: 8px; padding: 2px 8px; font-weight: 700; }
.tile .muted-ic { width: 14px; height: 14px; }

.captions { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(820px, calc(100% - 40px)); background: rgba(30, 18, 10, .86); border-radius: 16px; padding: 10px 16px; font-size: 17px; line-height: 1.4; }
.captions .who { color: var(--ocre); font-weight: 600; margin-right: 6px; }
.captions .orig { display: block; color: var(--muted); font-size: 13px; }

.side { width: 340px; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; grid-row: 1; grid-column: 2; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tab { flex: 1; background: none; border: 0; padding: 14px 8px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; }
.tab.on { color: var(--ivoire); border-bottom-color: var(--ocre); }
.close { background: none; border: 0; font-size: 24px; padding: 0 14px; cursor: pointer; color: var(--muted); }
.pane { flex: 1; overflow-y: auto; padding: 4px 16px 16px; display: flex; flex-direction: column; }
#pane-people { display: block; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.list li .who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list li .tag { font-size: 12px; color: var(--muted); }
.chat { list-style: none; padding: 0; margin: 0; flex: 1; overflow-y: auto; }
.chat li { margin: 10px 0; }
.chat .from { font-size: 12px; color: var(--ocre); font-weight: 600; }
.chat .text { background: var(--panel2); border-radius: 16px 16px 16px 4px; padding: 8px 12px; display: inline-block; max-width: 100%; word-wrap: break-word; white-space: pre-wrap; }
.chat .mine { text-align: right; }
.chat .mine .text { background: var(--laterite); border-radius: 16px 16px 4px 16px; text-align: left; }
.chat .note { font-size: 12px; color: var(--muted); display: block; }
.chat-form { display: flex; gap: 8px; padding-top: 10px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ocre); }

.controls { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: center; align-items: center; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); flex-wrap: wrap; }
.ctl { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; padding: 8px 10px; border-radius: 16px; border: 0; background: var(--panel2); cursor: pointer; }
.ctl .lbl { font-size: 11px; color: var(--muted); }
.ctl.off { background: var(--rouge); }
.ctl.off .lbl { color: var(--ivoire); }
.ctl.on { background: var(--ocre); color: var(--nuit); }
.ctl.on .lbl { color: var(--nuit); }
.ctl.leave { background: var(--rouge); }
.ctl.leave .lbl { color: var(--ivoire); }
.ctl.end { background: none; border: 1px solid var(--rouge); }
.ctl.end .lbl { color: #F1A08D; font-size: 13px; }
.badge { position: absolute; top: 2px; right: 8px; background: var(--ocre); color: var(--nuit); border-radius: 10px; padding: 0 6px; font-size: 11px; font-weight: 700; }
@media (max-width: 760px) {
  .room { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 57px 0 76px 0; width: auto; z-index: 5; }
  .ctl { min-width: 52px; padding: 8px 6px; }
  .ctl .lbl { display: none; }
  .ctl.end .lbl { display: inline; }
}
.toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: var(--ivoire); color: var(--nuit); padding: 10px 16px; border-radius: 16px; font-weight: 600; z-index: 10; box-shadow: 0 6px 24px rgba(0, 0, 0, .4); max-width: calc(100% - 32px); }

/* Icônes (masques SVG) */
.i { width: 22px; height: 22px; display: inline-block; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.i-mic { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0M12 18v3'/%3E%3C/svg%3E"); }
.i-cam { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='3' y='6' width='12' height='12' rx='3'/%3E%3Cpath d='M15 10l6-3v10l-6-3z'/%3E%3C/svg%3E"); }
.i-screen { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='4' width='18' height='12' rx='2'/%3E%3Cpath d='M8 20h8M12 16v4M12 13V7M9 10l3-3 3 3'/%3E%3C/svg%3E"); }
.i-hand { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 13V5a1.5 1.5 0 0 1 3 0v6M11 11V4a1.5 1.5 0 0 1 3 0v7M14 11V5.5a1.5 1.5 0 0 1 3 0V14a7 7 0 0 1-7 7h-.5a6 6 0 0 1-5-2.7L3 15.5a1.5 1.5 0 0 1 2.5-1.6L8 16'/%3E%3C/svg%3E"); }
.i-people { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 7M18 14a6 6 0 0 1 3.5 6'/%3E%3C/svg%3E"); }
.i-chat { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v11H9l-5 4z'/%3E%3C/svg%3E"); }
.i-link { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1'/%3E%3C/svg%3E"); }
.i-leave { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 14c5-5 13-5 18 0l-2.5 2.5-3-1.5v-2.5a10 10 0 0 0-7 0V15l-3 1.5z'/%3E%3C/svg%3E"); }
.i-micoff { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M9 9v2a3 3 0 0 0 5 2.2M15 9.5V6a3 3 0 0 0-5.8-1M5 11a7 7 0 0 0 11.5 5.3M19 11a7 7 0 0 1-.6 2.8M12 18v3M3 3l18 18'/%3E%3C/svg%3E"); }
