/* Brilta Meet. Colours, type and shapes come from the Brilta brand kit
   (L:\brilta-brand\tokens.css, direction "B · Daylight": navy and amber).
   Amber is the only accent: the primary action and anything that is "on".
   Red is functional only: recording, leaving, deleting. */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-VF.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('../fonts/IBMPlexSansArabic-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('../fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('../fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('../fonts/IBMPlexSansArabic-Bold.ttf') format('truetype');
  font-weight: 700 800;
  font-display: swap;
}
/* Manrope (display: the product name and headings). Latin only; Arabic
   headings fall through to IBM Plex Sans Arabic. */
@font-face {
  font-family: 'Manrope';
  src: url('../fonts/manrope-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  src: url('../fonts/manrope-latin-ext-wght-normal.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* brand (verbatim from the kit) */
  --brilta-navy: #0d1321;
  --brilta-navy-2: #1e2637;
  --brilta-navy-3: #2b3447;
  --brilta-cloud: #f2f4f8;
  --brilta-white: #ffffff;
  --brilta-line: #dadfe8;
  --brilta-slate: #5b6472;
  --brilta-mist: #a7b0bf;
  --brilta-amber: #ffb81c;
  --brilta-amber-hover: #ffc94d;
  --brilta-amber-pressed: #e6a200;
  --brilta-record: #d13438;
  --brilta-record-dot: #e5484d;

  --brilta-font-display: 'Manrope', 'Inter', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --brilta-font-ui: 'Inter', 'IBM Plex Sans Arabic', system-ui, sans-serif;

  --brilta-radius-card: 12px;
  --brilta-radius-panel: 20px;
  --brilta-radius-pill: 999px;
  --brilta-control-height: 44px;

  --accent: var(--brilta-amber);
  --accent-hover: var(--brilta-amber-hover);
  --accent-pressed: var(--brilta-amber-pressed);
  --on-accent: var(--brilta-navy);
  --danger: var(--brilta-record);
  --on-danger: var(--brilta-white);
  --radius: var(--brilta-radius-card);
}

/* Dark surfaces: the default, and always the meeting room (the kit keeps the
   room dark and uses light for settings and documents). */
:root,
.meeting {
  --bg: var(--brilta-navy);
  --surface: var(--brilta-navy-2);
  /* Controls that sit on a raised surface, and their hover step. The kit has
     three navies; the hover step is mixed from them rather than invented. */
  --surface2: var(--brilta-navy-3);
  --surface3: color-mix(in srgb, var(--brilta-navy-3) 82%, var(--brilta-cloud));
  --border: var(--brilta-navy-3);
  --text: var(--brilta-cloud);
  --muted: var(--brilta-mist);
  --text-muted: var(--brilta-mist);
  --focus-ring: var(--brilta-amber);
  /* The kit names no colour for error text. Amber reads on dark; on light it must not be used for text. */
  --warn: var(--brilta-amber);
  --red: var(--brilta-record);
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: var(--brilta-cloud);
  --surface: var(--brilta-white);
  --surface2: color-mix(in srgb, var(--brilta-cloud) 60%, var(--brilta-line));
  --surface3: var(--brilta-line);
  --border: var(--brilta-line);
  --text: var(--brilta-navy);
  --muted: var(--brilta-slate);
  --text-muted: var(--brilta-slate);
  --focus-ring: var(--brilta-navy);
  --warn: var(--brilta-navy);
  color-scheme: light;
}
/* The room stays dark in the light theme too. */
:root[data-theme='light'] .meeting {
  --bg: var(--brilta-navy);
  --surface: var(--brilta-navy-2);
  --surface2: var(--brilta-navy-3);
  --surface3: color-mix(in srgb, var(--brilta-navy-3) 82%, var(--brilta-cloud));
  --border: var(--brilta-navy-3);
  --text: var(--brilta-cloud);
  --muted: var(--brilta-mist);
  --text-muted: var(--brilta-mist);
  --focus-ring: var(--brilta-amber);
  --warn: var(--brilta-amber);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html,
body,
#root {
  height: 100%;
  margin: 0;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--brilta-font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3,
p {
  margin: 0;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.ltr {
  direction: ltr;
  unicode-bidi: isolate;
}
.grow {
  flex: 1;
  min-width: 0;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---- controls ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s;
}
.btn:hover {
  background: var(--surface3);
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn.primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 600;
}
.btn.primary:hover {
  opacity: 0.9;
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
}
.btn.ghost:hover {
  background: var(--surface2);
}
.btn.sm {
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 8px;
}
.btn.icon {
  width: 36px;
  height: 36px;
  padding: 0;
}
.btn.danger {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.input,
.select {
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  width: 100%;
  outline: none;
}
textarea.input {
  height: auto;
  padding: 10px 12px;
  resize: none;
}
.input:focus,
.select:focus {
  border-color: var(--muted);
}
:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  cursor: pointer;
}
.switch input {
  appearance: none;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--surface3);
  position: relative;
  cursor: pointer;
  flex: none;
  transition: background 0.15s;
}
.switch input::after {
  content: '';
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: all 0.15s;
}
.switch input:checked {
  background: var(--text);
}
.switch input:checked::after {
  inset-inline-start: 21px;
  background: var(--bg);
}

/* ---- home ---- */
.page {
  height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
  direction: ltr;
}
.brand small {
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}
.home {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 420px);
  gap: 48px;
  align-content: center;
  justify-content: center;
  padding: 24px;
}
.home h1 {
  font-size: 30px;
  line-height: 1.3;
  margin-bottom: 8px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.list-item:first-child {
  border-top: 0;
}
@media (max-width: 900px) {
  .home {
    grid-template-columns: minmax(0, 480px);
    align-content: start;
  }
}

/* ---- pre-join ---- */
.prejoin {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(0, 340px);
  gap: 36px;
  align-content: center;
  justify-content: center;
  padding: 24px;
}
.preview {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}
.preview .center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.preview .bar {
  position: absolute;
  bottom: 12px;
  inset-inline: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
}
.meter {
  height: 4px;
  border-radius: 2px;
  background: var(--surface3);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  background: var(--text);
  width: 0;
  transition: width 0.08s linear;
}
@media (max-width: 900px) {
  .prejoin {
    grid-template-columns: minmax(0, 560px);
    align-content: start;
  }
}

/* ---- meeting ---- */
.meeting {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.m-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  min-height: 52px;
}
.m-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 13px;
  white-space: nowrap;
}
.pill.rec {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 600;
}
.pill.rec i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: blink 1.2s infinite;
}
@keyframes blink {
  50% {
    opacity: 0.25;
  }
}
.m-body {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 12px;
  padding: 0 12px;
}
.stage {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  gap: 10px;
}
.grid {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 10px;
  align-content: center;
  justify-content: center;
}
.focus {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 10px;
}
.focus .main {
  flex: 1;
  min-width: 0;
  display: flex;
}
.focus .strip {
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}
/* height:auto lets aspect-ratio size each strip tile; with the default 100%
   every tile was as tall as the whole strip and only the first was on screen. */
.focus .strip .tile {
  flex: none;
  height: auto;
  aspect-ratio: 16 / 9;
}
.tile {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid transparent;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
}
.tile.speaking {
  border-color: var(--text);
}
.tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  display: block;
}
.tile.screen video {
  object-fit: contain;
}
.tile video.mirror {
  transform: scaleX(-1);
}
.tile .avatar {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.avatar span {
  width: min(30%, 96px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface3);
  display: grid;
  place-items: center;
  font-size: clamp(16px, 3vw, 34px);
  font-weight: 600;
}
.tile .tag {
  position: absolute;
  bottom: 8px;
  inset-inline-start: 8px;
  max-width: calc(100% - 16px);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(13, 19, 33, 0.72);
  color: #f2f4f8;
  font-size: 13px;
}
.tile .tag b {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile .hand {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f2f4f8;
  color: #0d1321;
  display: grid;
  place-items: center;
}
.tile .pin {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  opacity: 0;
}
.tile:hover .pin,
.tile .pin.on {
  opacity: 1;
}
.reaction-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.reaction {
  position: absolute;
  bottom: 0;
  font-size: 34px;
  animation: floatUp 3s ease-out forwards;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.reaction small {
  font-size: 11px;
  background: rgba(13, 19, 33, 0.72);
  color: #f2f4f8;
  padding: 1px 6px;
  border-radius: 6px;
}
@keyframes floatUp {
  to {
    transform: translateY(-60vh);
    opacity: 0;
  }
}
.captions {
  position: absolute;
  bottom: 12px;
  inset-inline: 10%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  pointer-events: none;
}
.captions p {
  background: rgba(13, 19, 33, 0.85);
  color: #f2f4f8;
  padding: 6px 12px;
  border-radius: 8px;
  max-width: 100%;
  font-size: 16px;
}
.captions b {
  color: #a7b0bf;
  font-weight: 500;
  margin-inline-end: 6px;
}

.m-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  position: relative;
}
.m-bar .side {
  position: absolute;
  inset-inline-start: 16px;
  display: flex;
  gap: 8px;
}
.m-bar .side.end {
  inset-inline-start: auto;
  inset-inline-end: 16px;
}
.ctl {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: var(--surface2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.12s;
}
.ctl:hover {
  background: var(--surface3);
}
/* "Off" (muted, camera closed) and "active" (hand up, panel open) are the
   inverse of the surface, so state reads without a second colour. */
.ctl.off,
.ctl.on {
  background: var(--text);
  color: var(--bg);
}
.ctl.leave {
  width: 64px;
  border-radius: 24px;
  background: var(--red);
  color: #fff;
}
.ctl .badge {
  position: absolute;
  top: -2px;
  inset-inline-end: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--text);
  color: var(--bg);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg);
}
.ctl-group {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border-radius: 24px;
}
.ctl-group .ctl {
  background: transparent;
}
.ctl-group .ctl.off {
  background: var(--text);
}
.ctl-group .caret {
  width: 26px;
  height: 48px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--muted);
  border-radius: 0 24px 24px 0;
}
[dir='rtl'] .ctl-group .caret {
  border-radius: 24px 0 0 24px;
}

.menu {
  position: absolute;
  bottom: 68px;
  z-index: 30;
  min-width: 240px;
  max-width: 340px;
  max-height: 60vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.menu h4 {
  margin: 8px 10px 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.menu button.item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: start;
}
.menu button.item:hover {
  background: var(--surface2);
}
.menu button.item .check {
  margin-inline-start: auto;
}
.menu hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 6px 0;
}
.emoji-row {
  display: flex;
  gap: 4px;
  padding: 4px;
}
.emoji-row button {
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  font-size: 24px;
  cursor: pointer;
}
.emoji-row button:hover {
  background: var(--surface2);
}

/* ---- side panel ---- */
.panel {
  width: 340px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 0;
}
.panel header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-weight: 600;
}
.panel .body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 14px 12px;
}
.panel footer {
  padding: 10px;
  border-top: 1px solid var(--border);
}
.msg {
  margin-bottom: 12px;
}
.msg .who {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
}
.msg .text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.person .dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface3);
  display: grid;
  place-items: center;
  font-weight: 600;
  flex: none;
}
.person .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.section-title {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0 4px;
}

/* ---- overlays ---- */
.toasts {
  position: fixed;
  top: 60px;
  inset-inline: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 60;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast .btn {
  height: 28px;
  background: transparent;
  border-color: var(--bg);
  color: var(--bg);
}
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 16px;
}
.modal {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}
.modal.wide {
  width: min(820px, 100%);
}
.modal h2 {
  font-size: 18px;
  margin-bottom: 14px;
}
.modal .actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.sources {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}
.sources button {
  border: 2px solid var(--border);
  background: var(--surface2);
  border-radius: 10px;
  padding: 6px;
  cursor: pointer;
  text-align: center;
}
.sources button:hover {
  border-color: var(--text);
}
.sources img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: #000;
  border-radius: 6px;
}
.sources span {
  display: block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 4px;
}
.board {
  flex: 1;
  min-width: 0;
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.board canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}
.board .tools {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  display: flex;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}
.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}
.swatch.on {
  border-color: var(--muted);
}
.bar-track {
  height: 6px;
  border-radius: 3px;
  background: var(--surface3);
  overflow: hidden;
}
.bar-track i {
  display: block;
  height: 100%;
  background: var(--text);
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: var(--surface3);
  border-radius: 4px;
}

/* ================= menus (second pass) =================
   Every row has an icon, a label and, where it helps, one line saying what it
   does. Things that are on or off show a switch; one-of-many shows a check. */
.anchor {
  position: relative;
}
.menu {
  bottom: 60px;
  min-width: 290px;
  max-width: 340px;
  padding: 8px;
  border-radius: 14px;
  /* Tall enough to show the whole "more" menu on a 768px-high screen. */
  max-height: min(78vh, 600px);
  animation: pop 0.12s ease-out;
}
.menu.center {
  left: 50%;
  transform: translateX(-50%);
}
.menu.start {
  inset-inline-start: 0;
}
.menu.end {
  inset-inline-end: 0;
}
@keyframes pop {
  from {
    opacity: 0;
    translate: 0 6px;
  }
}
.menu h4 {
  margin: 10px 10px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.menu h4:first-child {
  margin-top: 4px;
}
.menu button.item {
  gap: 12px;
  min-height: 44px;
  padding: 7px 10px;
  border-radius: 10px;
  line-height: 1.35;
}
.menu button.item:disabled {
  opacity: 0.45;
  cursor: default;
}
.menu button.item:disabled:hover {
  background: transparent;
}
.menu button.item .ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface2);
  display: grid;
  place-items: center;
  flex: none;
}
.menu button.item:hover:not(:disabled) .ico {
  background: var(--surface3);
}
.menu button.item .label {
  display: block;
  font-weight: 500;
}
.menu button.item .hint {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.menu button.item.danger {
  color: var(--red);
}
.menu button.item.danger .ico {
  background: var(--red);
  color: #fff;
}
.sw {
  width: 34px;
  height: 20px;
  border-radius: 10px;
  background: var(--surface3);
  position: relative;
  flex: none;
  transition: background 0.15s;
}
.sw::after {
  content: '';
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: all 0.15s;
}
.sw.on {
  background: var(--text);
}
.sw.on::after {
  inset-inline-start: 17px;
  background: var(--bg);
}

/* Tooltips that appear at once, instead of the browser's slow native ones. */
[data-tip] {
  position: relative;
}
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 7px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 40;
}
.anchor:has(.menu) [data-tip]::after {
  display: none;
}

/* ================= chat ================= */
.panel {
  width: 360px;
}
.chat-row {
  display: flex;
  margin-top: 3px;
}
.chat-row.head {
  margin-top: 14px;
}
.chat-row.mine {
  justify-content: flex-end;
}
.chat-item {
  max-width: 86%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.chat-row.mine .chat-item {
  align-items: flex-end;
}
.chat-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 3px;
}
.chat-meta b {
  color: var(--text);
  font-weight: 600;
}
.chat-private {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
.bubble {
  background: var(--surface2);
  padding: 7px 12px;
  border-radius: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}
.chat-row.mine .bubble {
  background: var(--surface3);
}
.bubble.private,
.chat-row.mine .bubble.private {
  background: transparent;
  border: 1px dashed var(--muted);
}
.bubble a {
  color: inherit;
  text-decoration: underline;
}
.chat-to {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-to .select {
  height: 34px;
  font-size: 13px;
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px;
}
.composer:focus-within {
  border-color: var(--muted);
}
.composer.private {
  border-style: dashed;
  border-color: var(--muted);
}
.composer textarea {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  resize: none;
  padding: 6px 8px;
  min-height: 34px;
  max-height: 110px;
  line-height: 1.5;
}
.composer .btn.icon {
  border-radius: 10px;
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 40px 12px;
  color: var(--muted);
}
.empty b {
  color: var(--text);
}

/* ================= whiteboard tools ================= */
.board .tools {
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 5px;
  max-width: calc(100% - 20px);
  border-radius: 12px;
}
.board .tools .sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}
.board .tools .btn.icon.sm {
  width: 30px;
  height: 30px;
}
.swatch {
  width: 22px;
  height: 22px;
  padding: 0;
}
.swatch.on {
  border-color: var(--surface2);
  outline: 2px solid var(--text);
}
.board-text {
  position: absolute;
  min-width: 190px;
  background: rgba(13, 19, 33, 0.92);
  border: 1px dashed #a7b0bf;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 18px;
  outline: none;
}

/* ================= camera filter picker ================= */
.chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 2px 8px 6px;
}
.chip {
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface2);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover {
  background: var(--surface3);
}
.chip.on {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 600;
}

/* ================= batch: small essentials ================= */
.menu.down {
  bottom: auto;
  top: 36px;
}
.captions.s p {
  font-size: 13px;
}
.captions.l p {
  font-size: 22px;
}
kbd {
  display: inline-block;
  min-width: 34px;
  padding: 3px 9px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface2);
  font: 600 13px var(--brilta-font-ui);
  text-align: center;
  white-space: nowrap;
}

/* ================= Q&A ================= */
.qa {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.qa:first-child {
  border-top: 0;
}
.qa.done {
  opacity: 0.6;
}
.qa .text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.qa-vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 38px;
  padding: 4px 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  flex: none;
}
.qa-vote:hover {
  background: var(--surface3);
}
.qa-vote.on {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.ctl.dim {
  opacity: 0.45;
}

/* ================= phones (guest joining from a mobile browser) ================= */
@media (max-width: 720px) {
  .m-top {
    padding: 8px 10px;
    gap: 6px;
    min-height: 44px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .m-top::-webkit-scrollbar,
  .m-bar::-webkit-scrollbar {
    display: none;
  }
  .m-title {
    max-width: 34vw;
    font-size: 14px;
  }
  .m-top .grow {
    display: none;
  }
  .m-body {
    padding: 0 6px;
    gap: 6px;
  }
  /* One row of controls that scrolls sideways; nothing overlaps. */
  .m-bar {
    justify-content: flex-start;
    gap: 8px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    overflow-x: auto;
    scrollbar-width: none;
  }
  .m-bar > * {
    flex: none;
  }
  .m-bar .side,
  .m-bar .side.end {
    position: static;
    display: flex;
    gap: 8px;
  }
  .ctl {
    width: 46px;
    height: 46px;
  }
  .ctl.leave {
    width: 58px;
  }
  /* Menus become a sheet above the bar, as wide as the screen. */
  .anchor,
  .ctl-group {
    position: static;
  }
  .menu,
  .menu.center,
  .menu.start,
  .menu.end {
    position: fixed;
    left: 8px;
    right: 8px;
    inset-inline: 8px;
    bottom: calc(70px + env(safe-area-inset-bottom));
    top: auto;
    transform: none;
    min-width: 0;
    max-width: none;
    max-height: 70vh;
  }
  .menu.down {
    top: 48px;
    bottom: auto;
  }
  /* Chat, people, polls and Q&A cover the meeting instead of squeezing it. */
  .panel {
    position: fixed;
    inset: 0 0 calc(64px + env(safe-area-inset-bottom)) 0;
    width: auto;
    border-radius: 0;
    border: 0;
    z-index: 20;
  }
  /* Speaker view: the others in a row under the main picture. */
  .focus {
    flex-direction: column;
  }
  .focus .strip {
    width: auto;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    height: 84px;
    flex: none;
  }
  .focus .strip .tile {
    height: 100%;
    width: auto;
    aspect-ratio: 16 / 9;
  }
  .grid {
    gap: 6px;
  }
  .tile .tag {
    font-size: 12px;
  }
  .captions {
    inset-inline: 4%;
  }
  .captions p {
    font-size: 14px;
  }
  .board .tools {
    inset-inline: 6px;
    top: 6px;
  }
  [data-tip]:hover::after {
    display: none; /* no hover on touch screens */
  }
  .toasts {
    top: 50px;
    padding: 0 10px;
  }
  .toast {
    font-size: 13px;
  }
  .modal {
    padding: 16px;
  }
  .prejoin,
  .home {
    padding: 14px;
    gap: 18px;
  }
  .home h1 {
    font-size: 24px;
  }
}

.pill.done {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 600;
}

/* ================= Brilta identity ================= */
body {
  font-family: var(--brilta-font-ui);
}
.meeting {
  color: var(--text);
}
h1,
h2,
.m-title {
  font-family: var(--brilta-font-display);
  font-weight: 700;
}
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.ltr,
[data-testid='timer'],
.pill.ltr {
  font-variant-numeric: tabular-nums;
}

/* The name: "Brilta" ExtraBold with tight tracking, the product word Regular in the secondary colour. */
.brand {
  align-items: center;
  gap: 10px;
  font-family: var(--brilta-font-display);
  font-size: 20px;
}
.brand img {
  width: 30px;
  height: 30px;
}
.brand b {
  font-weight: 800;
  letter-spacing: -0.04em;
}
.brand span {
  font-weight: 400;
  color: var(--muted);
}
.brand small {
  font-family: var(--brilta-font-ui);
  margin-inline-start: 6px;
}
.only-light {
  display: none;
}
:root[data-theme='light'] .only-light {
  display: inline;
}
:root[data-theme='light'] .only-dark {
  display: none;
}
.meeting .only-light {
  display: none !important;
}
.meeting .only-dark {
  display: inline !important;
}

/* Controls: at least 44 px tall; compact ones inside panels stay smaller on purpose. */
.btn,
.input,
.select {
  height: var(--brilta-control-height);
}
textarea.input {
  height: auto;
}
.btn.sm {
  height: 36px;
}
.btn.icon {
  width: var(--brilta-control-height);
  height: var(--brilta-control-height);
}
.btn.icon.sm {
  width: 36px;
  height: 36px;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  opacity: 1;
}
.btn.primary:active {
  background: var(--accent-pressed);
  border-color: var(--accent-pressed);
}
.btn.danger,
.ctl.leave {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--on-danger);
}
.menu button.item.danger {
  color: var(--danger);
}
.menu button.item.danger .ico {
  background: var(--danger);
  color: var(--on-danger);
}
[dir='rtl'] .only-dark,
[dir='rtl'] .only-light {
  vertical-align: middle;
}

/* Amber means "on": microphone open, camera live, hand up, panel open, a switch that is on. */
.ctl.live,
.ctl.on,
.ctl-group .ctl.live {
  background: var(--accent);
  color: var(--on-accent);
}
.ctl.live:hover,
.ctl.on:hover {
  background: var(--accent-hover);
}
.ctl.off,
.ctl-group .ctl.off {
  background: transparent;
  color: var(--muted);
}
.sw.on,
.switch input:checked {
  background: var(--accent);
}
.sw.on::after,
.switch input:checked::after {
  background: var(--on-accent);
}
.chip.on,
.qa-vote.on,
.pill.done {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.ctl .badge {
  background: var(--accent);
  color: var(--on-accent);
}
.tile.speaking {
  border-color: var(--accent);
}
.meter i,
.bar-track i {
  background: var(--accent);
}
.swatch.on {
  outline-color: var(--accent);
}
.pill.rec {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--on-danger);
}

/* Shapes: pills for bars, 12 px cards, 20 px large panels. */
.pill {
  border-radius: var(--brilta-radius-pill);
}
.card {
  border-radius: var(--brilta-radius-card);
}
.panel,
.modal {
  border-radius: var(--brilta-radius-panel);
}
.menu {
  border-radius: 16px;
}
/* The meeting bar: controls grouped in pill-shaped docks. */
.dock {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: var(--brilta-radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
}
.dock .ctl,
.dock .ctl-group {
  background: transparent;
}
.dock .ctl:hover,
.dock .ctl-group:hover {
  background: var(--surface2);
}
.dock .ctl.live,
.dock .ctl.on {
  background: var(--accent);
}
.dock .ctl.leave {
  background: var(--danger);
}
.dock .ctl-group .caret {
  width: 22px;
}
.m-bar .side.end {
  inset-inline-end: 12px;
}
@media (max-width: 720px) {
  .dock {
    display: contents;
  }
  .panel {
    border-radius: 0;
  }
}

/* Notices sit under dialogs, so a dialog's title is never covered by one. */
.toasts {
  z-index: 45;
}

/* ---------- direction ----------
   Icons that point somewhere (back, send) are drawn for one direction and
   mirrored for the other. */
[dir='ltr'] .flip-ltr,
[dir='rtl'] .flip-rtl {
  transform: scaleX(-1);
}

/* ---------- meeting history ---------- */
.history {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 720px);
  gap: 20px;
  justify-content: center;
  align-items: start;
  padding: 8px 22px 28px;
}
.history-none {
  padding: 40px 22px;
  text-align: center;
}
.history-search {
  position: relative;
  display: block;
}
.history-search svg {
  position: absolute;
  inset-inline-start: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.history-search .input {
  width: 100%;
  padding-inline-start: 36px;
}
.history-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  text-align: start;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 14px 16px;
}
.history-item:hover {
  border-color: var(--muted);
}
.history-item.on {
  border-color: var(--accent);
}
.history-item .hit {
  border-inline-start: 2px solid var(--accent);
  padding-inline-start: 8px;
  margin-top: 4px;
}
.history-detail h2 {
  margin-bottom: 4px;
}
.history-actions {
  flex-wrap: wrap;
  margin: 14px 0 6px;
}
.history-detail .said {
  margin: 6px 0;
  line-height: 1.6;
}
.history-remove {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
@media (max-width: 900px) {
  .history {
    grid-template-columns: minmax(0, 720px);
  }
}
