/* parlor — light, product-grade UI. One brand color, soft shadows, no dark theme. */
:root {
  color-scheme: light;

  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e6e9ee;
  --border: #e3e6eb;
  --border-strong: #d3d8df;

  --text: #0f1419;
  --text-muted: #5a6472;
  --text-subtle: #8b95a3;

  --brand: #2453ff;
  --brand-hover: #1a43e6;
  --brand-soft: #edf1ff;
  --brand-text: #ffffff;

  --danger: #e5484d;
  --danger-hover: #d13c41;
  --danger-soft: #fdeded;
  --live: #e5484d;
  --live-bg: #fdeded;
  --soon: #b45d00;
  --soon-bg: #fff3e3;
  --speaking: #16a34a;

  --shadow-xs: 0 1px 2px rgb(16 24 40 / 0.05);
  --shadow-sm: 0 1px 3px rgb(16 24 40 / 0.06), 0 1px 2px rgb(16 24 40 / 0.04);
  --shadow-md: 0 8px 24px -6px rgb(16 24 40 / 0.10), 0 2px 6px -2px rgb(16 24 40 / 0.05);
  --shadow-lg: 0 24px 56px -12px rgb(16 24 40 / 0.22), 0 4px 12px -4px rgb(16 24 40 / 0.06);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  --font: "Inter", "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-feature-settings: "palt" 1;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
  box-shadow: var(--shadow-xs); text-decoration: none;
  transition: background-color .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-text); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: var(--danger-hover); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.small { height: 30px; padding: 0 11px; font-size: 13px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 10px; }
.btn svg { width: 16px; height: 16px; }

.field {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 14px; box-shadow: var(--shadow-xs);
  transition: border-color .12s, box-shadow .12s;
}
textarea.field { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.field:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.field::placeholder { color: var(--text-subtle); }

/* ---------- Brand ---------- */
.logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); text-decoration: none;
}
.logo-mark { width: 26px; height: 26px; flex: none; }

/* =====================================================================
   Dashboard
   ===================================================================== */
.dash-header {
  position: sticky; top: 0; z-index: 3;
  background: rgb(255 255 255 / 0.85); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.dash-header-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 24px; height: 60px;
  display: flex; align-items: center; gap: 20px;
}
.search {
  flex: 1; max-width: 380px; display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid transparent;
  transition: border-color .12s, background-color .12s;
}
.search:focus-within { background: var(--surface); border-color: var(--brand); }
.search svg { width: 16px; height: 16px; color: var(--text-subtle); flex: none; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 14px; }
.header-actions { margin-left: auto; display: flex; gap: 8px; }

.dash { max-width: 1080px; margin: 0 auto; padding: 36px 24px 96px; }
.page-head { margin-bottom: 20px; }
.page-title { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.greeting { margin: 4px 0 0; color: var(--text-muted); font-size: 14px; }

/* Featured "next meeting" card */
.next-card {
  position: relative; overflow: hidden;
  display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  padding: 28px 28px 26px; margin-bottom: 40px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md);
}
.next-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--brand);
}
.next-card.is-live::before { background: var(--live); }
.next-main { min-width: 0; flex: 1 1 320px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px;
  font-size: 12px; font-weight: 600; color: var(--brand);
  padding: 2px 10px; border-radius: 999px; background: var(--brand-soft);
}
.is-live .eyebrow { color: var(--live); background: var(--live-bg); }
.next-title { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.next-customer { margin-top: 4px; font-size: 15px; color: var(--text-muted); }
.next-when {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums;
}
.next-when svg { width: 16px; height: 16px; color: var(--text-subtle); }
.next-people { margin-top: 6px; color: var(--text-muted); font-size: 14px; }
.next-side { display: grid; gap: 14px; justify-items: end; }
.next-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--text-muted);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.pill.soon { background: var(--soon-bg); color: var(--soon); }
.pill.live { background: var(--live-bg); color: var(--live); }
.pill.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.small { height: 20px; font-size: 12px; padding: 0 8px; margin-left: 8px; vertical-align: 1px; }

/* Meeting sections */
.msection { margin-bottom: 28px; }
.msection-label {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 0 2px;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
}
.count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-muted);
}
details.msection > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 0 2px; margin-bottom: 10px;
}
details.msection > summary::-webkit-details-marker { display: none; }
details.msection > summary::before {
  content: ""; width: 6px; height: 6px; border-right: 1.6px solid var(--text-subtle); border-bottom: 1.6px solid var(--text-subtle);
  transform: rotate(-45deg); margin-right: 4px;
}
details.msection[open] > summary::before { transform: rotate(45deg); }
details.msection > summary .msection-label { margin: 0; padding: 0; }

.mlist {
  list-style: none; margin: 0; padding: 0; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow: hidden;
}
.mrow {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 14px 18px; border-top: 1px solid var(--border);
  transition: background-color .12s;
}
.mrow:first-child { border-top: 0; }
.mrow:hover { background: #fafbfc; }
.past .mrow { color: var(--text-muted); }
.mtime { display: grid; font-variant-numeric: tabular-nums; line-height: 1.35; }
.mtime-main { font-weight: 600; font-size: 14px; }
.mtime-sub { color: var(--text-subtle); font-size: 13px; }
.mtitle { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.mmeta { display: flex; gap: 6px; color: var(--text-muted); font-size: 13px; min-width: 0; }
.mmeta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mmeta > span + span::before { content: "·"; margin-right: 6px; color: var(--text-subtle); }
.mmeta > .meta-chip::before, .mmeta > .meta-chip + span::before { content: none; }
.mmeta > .meta-chip { margin-left: 4px; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; }
.mactions { display: flex; gap: 6px; align-items: center; }
.icon-plain {
  width: 30px; height: 30px; border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer;
  display: grid; place-items: center; color: var(--text-subtle);
}
.icon-plain:hover { background: var(--surface-2); color: var(--text); }
.icon-plain svg { width: 16px; height: 16px; }

.empty-state {
  text-align: center; padding: 72px 24px; border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong); background: var(--surface);
}
.empty-state h2 { margin: 0 0 8px; font-size: 18px; }
.empty-state p { margin: 0 0 20px; color: var(--text-muted); font-size: 14px; }
.no-hit, .lk-down { color: var(--text-muted); font-size: 14px; text-align: center; }
.lk-down { color: var(--soon); }

@media (max-width: 640px) {
  .dash-header { position: static; }
  .dash-header-inner { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 12px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .header-actions .btn:not(.primary) { display: none; }
  .dash { padding: 24px 16px 80px; }
  .next-card { padding: 22px 20px; }
  .next-side { justify-items: start; width: 100%; }
  .next-actions { justify-content: flex-start; }
  .mrow { grid-template-columns: 64px minmax(0, 1fr); padding: 14px; }
  .mactions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* Dialogs */
.dialog {
  width: min(560px, calc(100% - 32px)); padding: 28px; border-radius: var(--radius-lg);
  border: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.dialog.narrow { width: min(420px, calc(100% - 32px)); }
.dialog::backdrop { background: rgb(15 20 25 / 0.35); backdrop-filter: blur(2px); }
.dialog h2 { margin: 0 0 20px; font-size: 18px; font-weight: 700; }
.dialog p { line-height: 1.7; }
.dialog form { display: grid; gap: 16px; }
.f { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.f .field { font-weight: 400; }
.f-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; }
@media (max-width: 520px) {
  .f-row { grid-template-columns: 1fr 1fr; }
  .f-row .f:first-child { grid-column: 1 / -1; }
}
.f-note { margin: 0; font-size: 13px; color: var(--text-muted); }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; align-items: center; }
.dialog-actions .spacer { flex: 1; }
.invite-text { margin-top: 14px; font-size: 14px; background: var(--surface-2); box-shadow: none; }

/* =====================================================================
   Room
   ===================================================================== */
body.room-page { background: var(--bg); }

/* Prejoin */
.prejoin { min-height: 100%; display: grid; grid-template-rows: auto 1fr; }
.room-header { min-height: 76px; display: flex; align-items: center; padding: 0 24px; }
.prejoin-body { display: grid; place-items: center; padding: 16px 24px 48px; }
.prejoin-inner {
  width: 100%; max-width: 1000px; display: grid; gap: 48px;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: center;
}
@media (max-width: 760px) {
  .prejoin-inner { grid-template-columns: 1fr; gap: 28px; }
  .prejoin-body { padding: 8px 16px 40px; }
  .room-header { padding: 0 16px; }
}
.preview {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg);
  background: #1b2027; overflow: hidden; box-shadow: var(--shadow-md);
}
.preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview .preview-off {
  position: absolute; inset: 0; display: grid; place-items: center; color: #aab3bf; font-size: 14px;
}
.preview .preview-controls {
  position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 10px;
}
.preview .icon-btn { background: rgb(255 255 255 / 0.95); box-shadow: var(--shadow-sm); }
.preview .icon-btn.off { background: var(--danger); color: #fff; }

.prejoin h1 { margin: 0 0 4px; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.35; }
.prejoin .lead { margin: 0 0 24px; color: var(--text-muted); font-size: 15px; }
.prejoin form { display: grid; gap: 14px; }
.prejoin .btn.primary { height: 44px; font-size: 15px; border-radius: 10px; }
.prejoin .error { color: var(--danger); font-size: 14px; margin: 0; }
.role-badge {
  display: inline-flex; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); margin-bottom: 12px;
}

/* Device pickers + level meter */
.devices { display: grid; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.devices label, .settings-panel label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.devices select, .settings-panel select { height: 36px; font-size: 13px; }
.meter { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter-fill {
  height: 100%; width: 100%; border-radius: inherit; background: var(--speaking);
  transform-origin: left; transform: scaleX(var(--level, 0));
}
.hint { margin: 0; font-size: 12px; color: var(--text-muted); }
.hint.warn { color: var(--soon); }

/* Round icon buttons */
.icon-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--surface-2); color: var(--text);
  transition: background-color .12s;
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn.off { background: var(--danger-soft); color: var(--danger); }
.icon-btn.off:hover { background: #fbdcdc; }
.icon-btn.active { background: var(--brand); color: var(--brand-text); }
.icon-btn.leave { width: 60px; border-radius: 999px; background: var(--danger); color: #fff; }
.icon-btn.leave:hover { background: var(--danger-hover); }
.icon-btn svg { width: 20px; height: 20px; }

/* Mic level: the mic button grows a green ring while your voice is picked up. */
#btn-mic { box-shadow: 0 0 0 calc(var(--level, 0) * 6px) rgb(22 163 74 / 0.35); }

/* In-call layout */
.call { height: 100%; display: grid; grid-template-rows: auto 1fr auto; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; min-width: 0; }
.topbar .title { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .muted {
  color: var(--text-muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums;
  padding: 2px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
}
.topbar .spacer { flex: 1; }

.stage-area { position: relative; min-height: 0; padding: 0 20px; display: flex; gap: 12px; }
.share-stage {
  flex: 1; min-width: 0; border-radius: var(--radius-lg); background: #1b2027; overflow: hidden;
  display: grid; place-items: center; position: relative; box-shadow: var(--shadow-sm);
}
.share-stage video { width: 100%; height: 100%; object-fit: contain; }
.share-stage .self-share { color: #c4ccd6; text-align: center; padding: 16px; font-size: 14px; }

.grid {
  flex: 1; min-width: 0; display: grid; gap: 12px; align-content: center; justify-content: center;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, var(--tile-w, 1fr)));
}
.has-share .grid { flex: 0 0 240px; grid-template-columns: 1fr; align-content: start; overflow-y: auto; }
@media (max-width: 720px) {
  .stage-area { padding: 0 12px; }
  .stage-area.has-share { flex-direction: column; }
  .has-share .grid { flex: 0 0 auto; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow-x: auto; }
}

.tile {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  outline: 3px solid transparent; outline-offset: -3px;
}
.tile.speaking { outline-color: var(--speaking); }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #1b2027; }
.tile .avatar { position: absolute; inset: 0; display: grid; place-items: center; }
.tile .avatar span {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  font-size: 28px; font-weight: 700;
  background: hsl(var(--hue, 226) 90% 94%); color: hsl(var(--hue, 226) 70% 42%);
}
.label {
  position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px;
  max-width: calc(100% - 20px); height: 26px; padding: 0 10px; border-radius: 999px;
  background: rgb(15 20 25 / 0.62); color: #fff; font-size: 12px; font-weight: 500;
  backdrop-filter: blur(6px);
}
.label .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label svg { width: 14px; height: 14px; flex: none; color: #ff9b9e; }

.controls { display: flex; justify-content: center; padding: 16px; }
.controls-bar {
  display: flex; gap: 10px; padding: 8px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md);
}

.settings-panel {
  position: fixed; right: 20px; bottom: 92px; z-index: 5; width: min(340px, calc(100% - 32px));
  display: grid; gap: 12px; padding: 18px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.settings-title { margin: 0; font-size: 14px; font-weight: 700; }

.banner {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 10;
  padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: var(--soon-bg); color: var(--soon); border: 1px solid #f5d9b0; box-shadow: var(--shadow-sm);
}
.toast {
  position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); z-index: 10;
  padding: 10px 16px; border-radius: 10px; background: #111827; color: #fff;
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px);
}
.center-msg { min-height: 100%; display: grid; place-items: center; text-align: center; padding: 24px 16px; }
.center-msg h1 { margin: 0 0 8px; font-size: 22px; }
.center-msg p { color: var(--text-muted); margin: 0 0 20px; }
.nowrap { white-space: nowrap; }

/* =====================================================================
   Auth (login / signup)
   ===================================================================== */
.auth { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-main { display: flex; flex-direction: column; padding: 28px 40px; background: var(--surface); }
.auth-card { width: 100%; max-width: 380px; margin: auto; padding: 40px 0; }
.auth-card h1 { margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.auth-lead { margin: 0 0 28px; color: var(--text-muted); font-size: 14px; }
.auth-card form { display: grid; gap: 16px; }
.auth-card .btn.lg { width: 100%; margin-top: 4px; }
.f-hint { font-size: 12px; font-weight: 400; color: var(--text-subtle); }
.pw-wrap { position: relative; display: block; }
.pw-wrap .field { padding-right: 64px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent;
  font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer;
}
.pw-toggle:hover { background: var(--surface-2); color: var(--text); }
.auth-error {
  margin: 0; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--danger-soft); color: #b42318; font-size: 13px;
}
.auth-switch { margin: 24px 0 0; font-size: 14px; color: var(--text-muted); text-align: center; }
.auth-switch a { color: var(--brand); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.auth-foot { margin: 0; font-size: 12px; color: var(--text-subtle); text-align: center; }

.auth-aside { background: var(--brand); color: var(--brand-text); display: grid; place-items: center; padding: 48px; overflow: hidden; }
.aside-inner { width: 100%; max-width: 440px; }
.aside-kicker { margin: 0 0 16px; font-size: 13px; font-weight: 600; opacity: 0.75; letter-spacing: 0.04em; }
.aside-title { margin: 0 0 24px; font-size: 32px; line-height: 1.4; font-weight: 700; letter-spacing: -0.01em; }
.aside-points { list-style: none; margin: 0 0 40px; padding: 0; display: grid; gap: 12px; font-size: 15px; }
.aside-points li { display: flex; gap: 10px; align-items: baseline; }
.aside-points li::before {
  content: ""; flex: none; width: 14px; height: 8px; margin-top: 2px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translateY(-3px);
}
.aside-mock {
  color: var(--text); background: var(--surface); border-radius: var(--radius-lg); padding: 22px;
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.35); position: relative;
}
.aside-mock::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; border-radius: 16px 16px 0 0; background: #b7c6ff; }
.mock-eyebrow {
  display: inline-block; font-size: 11px; font-weight: 600; color: var(--brand);
  background: var(--brand-soft); padding: 1px 8px; border-radius: 999px; margin-bottom: 8px;
}
.mock-title { font-size: 18px; font-weight: 700; }
.mock-sub { font-size: 13px; color: var(--text-muted); }
.mock-row { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 13px; }
.mock-pill { font-size: 12px; font-weight: 600; color: var(--soon); background: var(--soon-bg); padding: 2px 10px; border-radius: 999px; }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-main { padding: 20px 16px; }
}

/* Account menu */
.account { position: relative; }
.account-btn { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.account-avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font-size: 14px; font-weight: 700;
  background: hsl(var(--hue, 226) 90% 94%); color: hsl(var(--hue, 226) 70% 42%);
  box-shadow: inset 0 0 0 1px rgb(16 24 40 / 0.06);
}
.account-btn:hover .account-avatar, .account-btn[aria-expanded="true"] .account-avatar { box-shadow: 0 0 0 3px var(--brand-soft); }
.account-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.account-who { padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.account-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-email { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 6px;
  background: transparent; font-size: 14px; cursor: pointer;
}
.menu-item:hover { background: var(--surface-2); }

/* Settings dialog blocks */
.settings-block { padding: 18px 0; border-top: 1px solid var(--border); }
.settings-block:first-of-type { border-top: 0; padding-top: 0; }
.settings-block h3 { margin: 0; font-size: 14px; font-weight: 700; }
.settings-block .dialog-actions { margin-top: 0; }
.danger-zone h3 { color: var(--danger); }
#settings-dialog { max-height: calc(100% - 48px); overflow-y: auto; }
.field:disabled { background: var(--surface-2); color: var(--text-muted); box-shadow: none; }

/* =====================================================================
   App shell: nav + page heads
   ===================================================================== */
.main-nav { display: flex; gap: 4px; margin-left: 12px; }
.main-nav a {
  padding: 6px 12px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  color: var(--text-muted); text-decoration: none;
}
.main-nav a:hover { background: var(--surface-2); color: var(--text); }
.main-nav a.active { color: var(--brand); background: var(--brand-soft); }
.dash-header .account { margin-left: auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-actions .search { width: 280px; flex: none; max-width: 100%; }
.plain-link { color: inherit; text-decoration: none; }
.plain-link:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.link-btn { border: 0; background: transparent; padding: 0; color: var(--brand); font-weight: 600; font-size: 13px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.muted-sm { font-size: 12px; color: var(--text-muted); }
.meta-chip { display: inline-flex; align-items: center; gap: 4px; }
.meta-chip svg { width: 13px; height: 13px; color: var(--text-subtle); }
.next-when .meta-chip { margin-left: 8px; color: var(--text-muted); }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--text-muted); text-decoration: none; }
.back-link:hover { color: var(--brand); }
.back-link svg { width: 16px; height: 16px; }
.avatar-chip {
  width: 28px; height: 28px; flex: none; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 700; background: hsl(var(--hue, 226) 90% 94%); color: hsl(var(--hue, 226) 70% 42%);
}
.avatar-chip.lg { width: 40px; height: 40px; font-size: 16px; }
.avatar-chip.xl { width: 56px; height: 56px; font-size: 22px; }
@media (max-width: 640px) {
  .main-nav { order: 3; flex-basis: 100%; margin: 0; overflow-x: auto; }
  .page-actions .search { width: 100%; }
}

/* Editor extras */
.dialog.wide { width: min(640px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow-y: auto; }
.f-label-row { display: flex; align-items: center; justify-content: space-between; }
.picker {
  display: grid; gap: 2px; max-height: 180px; overflow-y: auto; padding: 4px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
}
.picker-empty { margin: 8px; font-size: 13px; font-weight: 400; color: var(--text-muted); }
.pick { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; font-weight: 400; color: var(--text); cursor: pointer; }
.pick:hover { background: var(--surface-2); }
.pick input { width: 16px; height: 16px; accent-color: var(--brand); }
.pick-icon svg { width: 16px; height: 16px; color: var(--text-subtle); display: block; }
.pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.pick-meta { font-size: 12px; color: var(--text-subtle); }
.switch-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; position: relative; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row strong { display: block; font-size: 14px; }
.switch {
  flex: none; width: 38px; height: 22px; margin-top: 1px; border-radius: 999px; background: var(--surface-3);
  position: relative; transition: background-color .15s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s;
}
.switch-row input:checked + .switch { background: var(--brand); }
.switch-row input:checked + .switch::after { transform: translateX(16px); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--brand); outline-offset: 2px; }

/* =====================================================================
   Library
   ===================================================================== */
.dropzone {
  text-align: center; padding: 22px; margin-bottom: 24px; border-radius: var(--radius-lg);
  border: 1.5px dashed var(--border-strong); background: var(--surface); color: var(--text-muted);
}
.dropzone p { margin: 2px 0; }
.dropzone.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.doc-card {
  display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.doc-thumb {
  height: 150px; display: grid; place-items: center; padding: 12px; border: 0; cursor: pointer;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.doc-thumb canvas { max-width: 100%; max-height: 126px; width: auto !important; height: auto !important; box-shadow: var(--shadow-sm); background: #fff; }
.doc-thumb-icon svg { width: 36px; height: 36px; color: var(--text-subtle); }
.doc-body { display: grid; gap: 4px; padding: 12px 14px; }
.doc-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta, .doc-used { font-size: 12px; color: var(--text-muted); }
.doc-used { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--brand); }
.doc-actions { display: flex; gap: 4px; align-items: center; margin-top: 6px; }
.doc-actions .btn { margin-right: auto; }
.dialog.viewer { width: min(1000px, calc(100% - 32px)); padding: 20px; }
.viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.viewer-head h2 { margin: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-stage { height: min(68vh, 640px); display: grid; place-items: center; background: var(--surface-2); border-radius: var(--radius); }
.viewer-stage canvas { box-shadow: var(--shadow-md); background: #fff; }
.viewer-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 12px; }
.viewer-page { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--text-muted); min-width: 64px; text-align: center; }

/* =====================================================================
   Customers
   ===================================================================== */
.customer-list li { border-top: 1px solid var(--border); }
.customer-list li:first-child { border-top: 0; }
.customer-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 14px; align-items: center;
  padding: 14px 18px; color: inherit; text-decoration: none;
}
.customer-row:hover { background: #fafbfc; }
.customer-dates { text-align: right; font-size: 13px; display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.row-chevron svg { width: 18px; height: 18px; color: var(--text-subtle); display: block; }
@media (max-width: 640px) {
  .customer-row { grid-template-columns: auto minmax(0, 1fr); }
  .customer-dates { grid-column: 2 / -1; text-align: left; }
  .row-chevron { display: none; }
}
.customer-head { display: flex; align-items: center; gap: 14px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.tl-item { position: relative; margin-bottom: 14px; }
.tl-dot {
  position: absolute; left: -22px; top: 18px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--text-subtle);
}
.tl-item.upcoming .tl-dot { border-color: var(--brand); background: var(--brand-soft); }
.tl-card { padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.tl-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.tl-when { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 4px; }
.tl-title { font-weight: 700; font-size: 16px; }
.tl-actions { display: flex; gap: 6px; }
.tl-agenda { margin: 8px 0; font-size: 13px; color: var(--text-muted); white-space: pre-line; }

/* =====================================================================
   Meeting detail
   ===================================================================== */
.detail-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.panel-card { padding: 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.card-title, .section-title { margin: 0 0 14px; font-size: 15px; font-weight: 700; }
.card-sub { margin: 18px 0 6px; font-size: 13px; color: var(--text-muted); }
.facts { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 14px; }
.facts dt { color: var(--text-muted); font-size: 13px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts .link-btn { font-weight: 500; text-align: left; font-size: 12px; }
.agenda-text { margin: 0; font-size: 14px; white-space: pre-line; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plain-list li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.plain-list li > svg { width: 16px; height: 16px; color: var(--text-subtle); flex: none; }
.empty-note { padding: 28px; text-align: center; color: var(--text-muted); font-size: 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); }
.session-card { margin-bottom: 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow: hidden; }
.session-head { padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.session-head h3 { margin: 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.block { padding: 16px 20px; border-top: 1px solid var(--border); }
.block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.block-head h4 { margin: 0; font-size: 14px; }
.block-head .spacer { flex: 1; }
.rec-video { width: 100%; max-height: 420px; border-radius: var(--radius); background: #1b2027; display: block; }
.rec-files { display: flex; gap: 8px; margin-top: 10px; }
.voices { margin-top: 12px; }
.voices summary, .chat-log summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.chat-log summary h4 { display: inline; margin: 0; font-size: 14px; color: var(--text); }
.voices .f-note { margin: 8px 0; }
.voice-row audio { height: 32px; flex: 1; min-width: 0; }
.voice-name { width: 120px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.views-file { margin-bottom: 14px; }
.views-name { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.views-name svg { width: 15px; height: 15px; color: var(--text-subtle); }
.views-table-wrap { overflow-x: auto; }
.views-table { border-collapse: separate; border-spacing: 3px; font-size: 12px; font-variant-numeric: tabular-nums; }
.views-table th { font-weight: 600; color: var(--text-muted); text-align: center; padding: 2px 6px; white-space: nowrap; }
.views-table tbody th { text-align: left; color: var(--text); padding-right: 12px; }
.views-table tbody th > * { vertical-align: middle; }
.views-table tbody th .avatar-chip { width: 22px; height: 22px; font-size: 10px; margin-right: 6px; }
.views-table td { min-width: 56px; height: 28px; text-align: center; border-radius: 6px; background: var(--surface-2); color: var(--text-muted); white-space: nowrap; padding: 0 6px; }
.views-table td[style] { background: color-mix(in srgb, var(--brand) calc(8% + var(--heat) * 55%), transparent); color: var(--text); }
.views-table td.total { background: transparent; font-weight: 700; color: var(--text); }
.chat-log .chat-list { margin-top: 12px; max-height: 360px; overflow-y: auto; }

/* Chat messages (shared by the meeting page and the room) */
.chat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; align-content: start; }
.chat-msg { display: flex; gap: 10px; align-items: flex-start; }
.chat-msg.grouped { margin-top: -6px; }
.avatar-spacer { width: 28px; flex: none; }
.chat-body { min-width: 0; }
.chat-meta { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.chat-meta strong { color: var(--text); font-size: 13px; }
.chat-text { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-text a { color: var(--brand); }
.role-tag { font-size: 11px; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: 0 6px; border-radius: 999px; margin-left: 6px; }

/* =====================================================================
   Room additions
   ===================================================================== */
.check-row { display: flex !important; flex-direction: row; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; }
.check-row input { width: 16px; height: 16px; accent-color: var(--brand); }
.check-row input:disabled + span { color: var(--text-subtle); }

.waiting { display: grid; gap: 8px; justify-items: start; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.waiting-title { margin: 4px 0 0; font-size: 16px; font-weight: 700; }
.waiting .f-note { margin-bottom: 8px; }
.waiting-dots { display: flex; gap: 6px; }
.waiting-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: waiting-dot 1.2s infinite ease-in-out; }
.waiting-dots span:nth-child(2) { animation-delay: .15s; }
.waiting-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes waiting-dot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

.call { display: flex; }
.call-main { flex: 1; min-width: 0; display: grid; grid-template-rows: auto 1fr auto; height: 100%; }
.rec-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: var(--live); background: var(--live-bg);
}
.rec-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.bar-sep { width: 1px; align-self: stretch; margin: 6px 2px; background: var(--border); flex: none; }
.icon-btn { position: relative; flex: none; }
.badge {
  position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--danger); color: #fff;
  box-shadow: 0 0 0 2px var(--surface);
}
#btn-rec { color: var(--danger); }
#btn-rec.recording { background: var(--danger); color: #fff; }
.controls-bar { max-width: 100%; overflow-x: auto; }
@media (max-width: 600px) {
  .controls { padding: 10px 8px; }
  .controls-bar { gap: 6px; padding: 6px; }
  .icon-btn { width: 40px; height: 40px; }
  .icon-btn.leave { width: 52px; }
  .bar-sep { display: none; }
}

/* Document stage */
.doc-stage { background: var(--surface-2); border: 1px solid var(--border); }
.doc-canvas { box-shadow: var(--shadow-md); background: #fff; border-radius: 4px; margin-bottom: 48px; }
.doc-label { top: 12px; bottom: auto; }
.doc-bar {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px; white-space: nowrap;
  background: rgb(15 20 25 / 0.78); color: #fff; backdrop-filter: blur(6px); box-shadow: var(--shadow-md);
}
.bar-btn { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; display: grid; place-items: center; }
.bar-btn:hover:not(:disabled) { background: rgb(255 255 255 / 0.14); }
.bar-btn:disabled { opacity: .35; cursor: default; }
.bar-btn svg { width: 18px; height: 18px; }
.bar-page { min-width: 64px; text-align: center; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 0 4px; }
.bar-text { height: 30px; padding: 0 12px; margin-left: 4px; border: 0; border-radius: 999px; background: rgb(255 255 255 / 0.16); color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; }
.bar-text:hover { background: rgb(255 255 255 / 0.26); }
.bar-text.danger { background: var(--danger); }

/* Side panel */
.side-panel {
  width: 340px; flex: none; height: 100%; display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--border);
}
.side-tabs { display: flex; align-items: center; gap: 2px; padding: 10px 10px 0; border-bottom: 1px solid var(--border); }
.side-tab {
  height: 38px; padding: 0 12px; border: 0; background: transparent; cursor: pointer; font-size: 14px; font-weight: 600;
  color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.side-tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.side-tabs .icon-plain { margin-left: auto; margin-bottom: 4px; }
.side-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; }
.chat-pane { display: flex; flex-direction: column; padding: 0; overflow: hidden; position: relative; }
.chat-pane .chat-list { flex: 1; overflow-y: auto; padding: 14px; }
.chat-pane .side-empty { position: absolute; top: 10px; left: 0; right: 0; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--border); }
.chat-form .field { height: auto; min-height: 40px; padding: 9px 12px; resize: none; line-height: 1.5; }
.chat-form .btn { height: 40px; }
.side-empty { margin: 14px; font-size: 13px; color: var(--text-subtle); text-align: center; }
.chat-msg.mine .chat-meta strong { color: var(--brand); }

.people-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.people-head, .lobby-head { font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 4px 6px 8px; display: flex; justify-content: space-between; }
.person { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: var(--radius-sm); }
.person:hover { background: var(--surface-2); }
.person-name { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-muted svg { width: 16px; height: 16px; color: var(--danger); display: block; }
.danger-ghost { color: var(--danger); }
.lobby-list { margin-bottom: 14px; padding: 8px; border-radius: var(--radius); background: var(--soon-bg); }
.lobby-list .person:hover { background: rgb(255 255 255 / 0.5); }

.docs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.doc-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius); border: 1px solid var(--border); }
.doc-row.showing { border-color: var(--brand); background: var(--brand-soft); }
.doc-row-icon svg { width: 20px; height: 20px; color: var(--brand); display: block; }
.doc-row-main { flex: 1; min-width: 0; }
.doc-row-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.call.with-side .settings-panel { right: 360px; }
@media (max-width: 900px) {
  .side-panel { position: fixed; inset: 0 0 0 auto; width: min(100%, 380px); z-index: 8; box-shadow: var(--shadow-lg); }
  .call.with-side .settings-panel { right: 20px; }
}

.knock-card {
  position: fixed; top: 60px; right: 20px; z-index: 9; width: min(360px, calc(100% - 32px));
  display: grid; gap: 12px; padding: 14px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.call.with-side .knock-card { right: 360px; }
.knock-main { display: flex; gap: 10px; align-items: center; }
.knock-title { font-weight: 700; font-size: 14px; }
.knock-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Side panel v2: participants / documents / chat stacked, each collapsible */
.side-panel { overflow: hidden; }
.side-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 52px; flex: none; padding: 0 10px 0 16px; border-bottom: 1px solid var(--border);
}
.side-top-title { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.side-sec { display: flex; flex-direction: column; min-height: 0; border-bottom: 1px solid var(--border); }
.side-sec:not(.chat-sec) { flex: 0 1 auto; max-height: 34%; }
.side-sec.chat-sec { flex: 1 1 auto; border-bottom: 0; }
.side-sec.collapsed { flex: 0 0 auto; }
.side-sec-head {
  display: flex; align-items: center; gap: 10px; width: 100%; flex: none;
  height: 46px; padding: 0 14px 0 16px; border: 0; background: transparent; cursor: pointer; text-align: left;
}
.side-sec-head:hover { background: var(--surface-2); }
.sec-icon { width: 18px; height: 18px; flex: none; color: var(--brand); }
.sec-label { font-size: 14px; font-weight: 700; color: var(--text); }
.side-sec-head .count:empty { display: none; }
.sec-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 700; background: var(--danger); color: #fff;
}
.sec-chevron { width: 16px; height: 16px; margin-left: auto; color: var(--text-subtle); transition: transform .15s; }
.side-sec.collapsed .sec-chevron { transform: rotate(-90deg); }
.side-sec-body { min-height: 0; overflow-y: auto; padding: 0 12px 12px; }
.side-sec.collapsed .side-sec-body { display: none; }
.side-sec .chat-pane { flex: 1; display: flex; flex-direction: column; padding: 0; overflow: hidden; position: relative; }
.side-sec .chat-pane .chat-list { flex: 1; overflow-y: auto; padding: 4px 14px 14px; }
.side-sec.chat-sec:not(.collapsed) { min-height: 220px; }
.people-list .person { padding: 6px; }
@media (max-width: 900px) {
  .side-sec:not(.chat-sec) { max-height: 30%; }
}

/* =====================================================================
   Camera background picker
   ===================================================================== */
.bg-field { display: grid; gap: 6px; }
.bg-field-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.bg-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.bg-opt {
  aspect-ratio: 16 / 10; border-radius: 8px; border: 1px solid var(--border-strong); cursor: pointer;
  background: var(--surface-2) center / cover no-repeat; color: var(--text-muted);
  display: grid; place-items: center; position: relative; overflow: hidden; padding: 0;
}
.bg-opt svg { width: 18px; height: 18px; }
.bg-opt:hover { border-color: var(--text-subtle); }
.bg-opt.on { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.bg-opt:disabled { opacity: .4; cursor: not-allowed; }
.bg-opt.blurred::after {
  content: ""; position: absolute; inset: 0; backdrop-filter: blur(3px);
  background: radial-gradient(circle at 50% 65%, rgb(90 100 115 / 0.55) 0 22%, transparent 23%);
}
.bg-opt-text { font-size: 11px; font-weight: 700; }

/* =====================================================================
   Guest-facing brand (prejoin / call)
   ===================================================================== */
.prejoin { grid-template-rows: auto 1fr auto; }
.room-brand { display: inline-flex; align-items: center; min-height: 32px; }
/* Logos sit on a white card so both transparent and white-background PNGs look intentional on the gray page. */
.brand-logo {
  display: block; max-height: 44px; max-width: 220px; width: auto; height: auto; object-fit: contain; box-sizing: content-box;
  padding: 6px 10px; background: #fff; border: 1px solid var(--border); border-radius: 10px;
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.call-brand { display: inline-flex; align-items: center; padding-right: 12px; margin-right: 2px; border-right: 1px solid var(--border); }
.call-brand .brand-logo { max-height: 28px; max-width: 160px; padding: 3px 8px; border-radius: 8px; }
.call-brand .brand-name { font-size: 14px; }
.powered { margin: 0; padding: 12px; text-align: center; font-size: 11px; color: var(--text-subtle); letter-spacing: 0.02em; }

/* =====================================================================
   Brand settings page
   ===================================================================== */
.brand-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 24px; align-items: start; }
@media (max-width: 980px) { .brand-grid { grid-template-columns: 1fr; } }
.brand-form { display: grid; gap: 16px; }
.form-card { display: grid; gap: 16px; }
.form-card .card-title { margin: 0; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12);
}
.swatch.on { outline: 2px solid var(--text); outline-offset: 2px; }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-input { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.color-row .field { width: 120px; }
.asset-row { display: flex; gap: 16px; align-items: flex-start; }
.asset-actions { display: grid; gap: 8px; justify-items: start; flex: 1; }
.asset-actions .f-hint { margin: 0; }
.asset-preview {
  flex: none; display: grid; place-items: center; border-radius: var(--radius);
  border: 1px dashed var(--border-strong); background: var(--surface-2) center / cover no-repeat;
}
.logo-preview { width: 200px; height: 120px; padding: 10px; background: #fff; overflow: hidden; }
/* Explicit px limits: a percentage max-height does not resolve inside the grid cell, so tall logos overflowed. */
.logo-preview img { display: block; max-width: 180px; max-height: 100px; width: auto; height: auto; object-fit: contain; }
.bg-preview { width: 200px; aspect-ratio: 16 / 9; }
@media (max-width: 560px) { .asset-row { flex-direction: column; } }

.brand-preview-wrap { position: sticky; top: 84px; }
.brand-preview-wrap .card-sub { margin-top: 0; }
.brand-preview {
  border-radius: var(--radius-lg); overflow: hidden; background: var(--bg);
  border: 1px solid var(--border); box-shadow: var(--shadow-md);
}
.bp-head { height: 56px; display: flex; align-items: center; padding: 0 14px; }
.bp-head img { max-height: 30px; max-width: 150px; width: auto; height: auto; object-fit: contain; display: block; box-sizing: content-box; padding: 3px 7px; background: #fff; border: 1px solid var(--border); border-radius: 7px; }
.bp-name { font-weight: 700; font-size: 13px; }
.bp-default { font-size: 13px; }
.bp-default .logo-mark { width: 18px; height: 18px; }
.bp-body { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; padding: 6px 14px 14px; align-items: center; }
.bp-video {
  aspect-ratio: 16 / 9; border-radius: 10px; position: relative; overflow: hidden;
  background: #1b2027 center / cover no-repeat;
}
.bp-person {
  position: absolute; left: 50%; bottom: 0; width: 34%; height: 70%; transform: translateX(-50%);
  border-radius: 50% 50% 8px 8px / 40% 40% 8px 8px; background: #6b7280;
  box-shadow: 0 -38px 0 -10px #6b7280;
}
.bp-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.bp-message { font-size: 10px; color: var(--text-muted); line-height: 1.5; margin-bottom: 8px; white-space: pre-line; max-height: 60px; overflow: hidden; }
.bp-input { height: 22px; border-radius: 5px; border: 1px solid var(--border-strong); background: #fff; font-size: 9px; color: var(--text-subtle); padding: 0 6px; display: flex; align-items: center; margin-bottom: 6px; }
.bp-btn { height: 24px; border-radius: 6px; background: var(--brand); color: var(--brand-text); font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.bp-foot { text-align: center; font-size: 9px; color: var(--text-subtle); padding: 0 0 8px; }

/* Meeting page: other meetings with the same customer */
.related-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.related-item { display: grid; gap: 1px; padding: 8px 10px; border-radius: var(--radius-sm); color: inherit; text-decoration: none; }
.related-item:hover { background: var(--surface-2); }
.related-when { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.related-title { font-size: 14px; font-weight: 600; }


/* Stepping away */
.call-main { position: relative; }
.away-overlay {
  position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; padding: 16px;
  background: rgb(245 246 248 / 0.92); backdrop-filter: blur(6px);
}
.away-card {
  width: min(420px, 100%); display: grid; justify-items: center; gap: 10px; text-align: center;
  padding: 32px 28px; border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.away-card h2 { margin: 4px 0 0; font-size: 22px; }
.away-card p { margin: 0 0 8px; color: var(--text-muted); font-size: 14px; line-height: 1.7; }
.away-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.away-icon svg { width: 28px; height: 28px; }
.away-card .btn.lg { min-width: 180px; }
.tile.away .avatar span { filter: grayscale(1); opacity: .45; }
.away-tag { font-size: 11px; font-weight: 600; color: var(--soon); background: var(--soon-bg); padding: 0 6px; border-radius: 999px; margin-left: 6px; }

/* Self-view mirroring (toggle in prejoin / call settings; others always see the true image). */
.mirror .preview video, .mirror .tile.local video { transform: scaleX(-1); }

/* =====================================================================
   Away tile: the whole tile says it
   ===================================================================== */
.tile.away { border-color: #f5d9b0; }
.away-cover {
  position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 6px;
  background: repeating-linear-gradient(135deg, #fff7ea 0 14px, #fff1dc 14px 28px);
  color: var(--soon); text-align: center;
}
.away-cover[hidden] { display: none; }
.away-cover-icon {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; box-shadow: 0 0 0 6px rgb(180 93 0 / 0.08);
}
.away-cover-icon svg { width: 32px; height: 32px; }
.away-cover strong { font-size: 22px; font-weight: 800; letter-spacing: 0.04em; }
.away-time { font-size: 13px; font-weight: 600; opacity: .8; }
.tile.away .label { z-index: 2; }
.has-share .away-cover-icon { width: 40px; height: 40px; }
.has-share .away-cover-icon svg { width: 20px; height: 20px; }
.has-share .away-cover strong { font-size: 15px; }
.has-share .away-time { display: none; }

/* =====================================================================
   Documents: upload dialog, download flag, room list
   ===================================================================== */
.upload-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; max-height: 50vh; overflow-y: auto; }
.upload-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.upload-icon svg { width: 22px; height: 22px; color: var(--brand); margin-top: 9px; }
.upload-main { flex: 1; min-width: 0; display: grid; gap: 8px; }
.upload-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.upload-dialog h2 { margin-bottom: 14px; }

.dl-chip {
  justify-self: start; display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted);
}
.dl-chip.on { background: #e7f6ec; color: #15803d; border-color: #bfe5cb; }
button.dl-chip { cursor: pointer; font-family: inherit; }
button.dl-chip:hover { filter: brightness(0.97); }

.docs-add {
  width: 100%; margin-bottom: 10px; padding: 10px; border-radius: var(--radius); cursor: pointer;
  border: 1.5px dashed var(--border-strong); background: transparent; color: var(--brand); font-size: 13px; font-weight: 600;
}
.docs-add:hover { background: var(--brand-soft); border-color: var(--brand); }
.doc-row { flex-wrap: wrap; padding: 8px; }
.doc-row-open {
  flex: 1 1 200px; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px; border: 0; border-radius: var(--radius-sm);
  background: transparent; text-align: left; cursor: pointer; color: inherit;
}
.doc-row-open:hover { background: var(--surface-2); }
.doc-row-open:hover .doc-row-popout { opacity: 1; }
.doc-row-main { display: grid; }
.doc-row-popout svg { width: 15px; height: 15px; color: var(--text-subtle); display: block; }
.doc-row-popout { opacity: .5; margin-left: auto; }
.doc-row-actions { display: flex; gap: 6px; align-items: center; margin-left: auto; }

/* Drop targets */
.drop-over .dropzone, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.picker.drop-over, .side-sec.drop-over { outline: 2px dashed var(--brand); outline-offset: -4px; background: var(--brand-soft); }

/* =====================================================================
   Document viewer window
   ===================================================================== */
.viewer-page { display: grid; grid-template-rows: auto 1fr; height: 100%; background: var(--surface-2); }
.vw-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 14px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.vw-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 200px; font-weight: 700; font-size: 14px; }
.vw-title svg { width: 18px; height: 18px; color: var(--brand); flex: none; }
.vw-title #vw-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-private { flex: none; font-size: 11px; font-weight: 600; color: var(--text-muted); background: var(--surface-2); padding: 1px 8px; border-radius: 999px; }
.vw-pager { display: flex; align-items: center; gap: 6px; }
.vw-page-input { width: 56px; height: 32px; text-align: center; padding: 0 6px; }
.vw-actions { display: flex; gap: 8px; }
.vw-stage { min-height: 0; overflow: hidden; display: grid; place-items: center; padding: 16px; }
.vw-stage.scroll { overflow-y: auto; place-items: start center; }
.vw-stage canvas { background: #fff; box-shadow: var(--shadow-md); border-radius: 4px; }
.vw-error { margin: 40px auto; text-align: center; color: var(--text-muted); }

/* Document rows: name on the left, actions stacked on the right (keeps each row to one block). */
.doc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; flex-wrap: nowrap; padding: 6px 8px; }
.doc-row-actions { flex-direction: column; align-items: flex-end; gap: 4px; margin-left: 0; }
.doc-row-actions .btn.small { height: 28px; }
.side-sec[data-sec="docs"]:not(.collapsed) { max-height: 42%; }
.doc-row-open.static { cursor: default; }
.doc-row-open.static:hover { background: transparent; }
.doc-row-actions .btn-icon { display: inline-flex; }

/* =====================================================================
   Help page
   ===================================================================== */
.help-crumb { padding-left: 20px; border-left: 1px solid var(--border); color: var(--text-muted); font-size: 14px; font-weight: 600; }
.help-back { margin-left: auto; }
.help { max-width: 1080px; margin: 0 auto; padding: 40px 24px 120px; }
.help-hero h1 { margin: 0; font-size: 30px; letter-spacing: -0.01em; }
.help-hero > p { margin: 8px 0 0; color: var(--text-muted); max-width: 640px; }
.help-paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 24px; }
.help-path {
  display: grid; gap: 2px; padding: 18px 20px; border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm); color: inherit; text-decoration: none;
}
.help-path:hover { border-color: var(--brand); box-shadow: var(--shadow-md); }
.help-path-label { font-size: 12px; font-weight: 700; color: var(--brand); }
.help-path strong { font-size: 17px; }
.help-path span:last-child { font-size: 13px; color: var(--text-muted); }

.help-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 40px; margin-top: 40px; align-items: start; }
.help-toc { position: sticky; top: 84px; display: grid; gap: 1px; font-size: 13px; }
.help-toc-head { margin: 14px 0 4px; font-size: 11px; font-weight: 700; color: var(--text-subtle); letter-spacing: 0.04em; }
.help-toc-head:first-child { margin-top: 0; }
.help-toc a { padding: 5px 10px; border-radius: var(--radius-sm); color: var(--text-muted); text-decoration: none; border-left: 2px solid transparent; }
.help-toc a:hover { background: var(--surface-2); color: var(--text); }
.help-toc a.active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }

.help-body { min-width: 0; }
.help-part { scroll-margin-top: 84px; padding-top: 8px; margin: 56px 0 8px; }
.help-part:first-child { margin-top: 0; }
.help-part-label { margin: 0; font-size: 12px; font-weight: 700; color: var(--brand); }
.help-part-title { margin: 2px 0 0; font-size: 24px; }
.help-part > p:not(.help-part-label) { color: var(--text-muted); margin: 8px 0 0; }
.help-sec {
  scroll-margin-top: 84px; margin-top: 16px; padding: 26px 28px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
}
.help-sec h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 18px; }
.help-num {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 700;
}
.help-sec p, .help-sec li { font-size: 14.5px; line-height: 1.85; }
.help-sec p { margin: 0 0 12px; }
.help-sec ul, .help-sec ol { margin: 0 0 12px; padding-left: 1.3em; }
.help-sec li + li { margin-top: 4px; }
.help-sec a { color: var(--brand); }
.help-fig { margin: 16px 0 18px; }
.help-fig img {
  display: block; max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow-md); background: var(--surface-2);
}
.help-fig-small img { box-shadow: none; border: 0; background: transparent; }
.help-fig figcaption { margin-top: 8px; font-size: 13px; color: var(--text-muted); }
.help-note {
  margin: 14px 0 0; padding: 12px 16px; border-radius: var(--radius); background: var(--brand-soft);
  font-size: 13.5px; line-height: 1.8; color: #1f2d5c;
}
.help-table { width: 100%; border-collapse: collapse; margin: 4px 0 14px; font-size: 14px; }
.help-table th, .help-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; line-height: 1.7; }
.help-table th { width: 8.5em; white-space: nowrap; font-weight: 700; }
.help-table tr:last-child th, .help-table tr:last-child td { border-bottom: 0; }

.help-faq { display: grid; gap: 10px; margin-top: 16px; }
.help-faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 18px; }
.help-faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 14.5px; }
.help-faq details[open] summary { border-bottom: 1px solid var(--border); }
.help-faq details p { margin: 12px 0 16px; font-size: 14px; line-height: 1.85; color: var(--text-muted); }

@media (max-width: 860px) {
  .help-layout { grid-template-columns: 1fr; gap: 0; }
  .help-toc { display: none; }
  .help-sec { padding: 20px 18px; }
  .help-hero h1 { font-size: 24px; }
  .help-table th { width: auto; white-space: normal; }
}
@media (max-width: 520px) {
  .help { padding: 28px 16px 96px; }
  .help-crumb { display: none; }
}
.pre-help { margin: 10px 0 0; text-align: center; font-size: 12.5px; }
.pre-help a { color: var(--text-muted); }
a.menu-item { display: block; text-decoration: none; color: inherit; }
.header-help {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; color: var(--text-muted); text-decoration: none;
}
.header-help:hover { background: var(--surface-2); color: var(--text); }
.header-help svg, .help-link svg { width: 16px; height: 16px; }
.header-help + .account { margin-left: 0; }
.help-link { text-decoration: none; color: inherit; }
.auth-foot a { margin-left: 6px; color: var(--brand); }
@media (max-width: 520px) { .header-help { padding: 6px 8px; font-size: 0; gap: 0; } .header-help svg { width: 20px; height: 20px; } }
@media (max-width: 640px) { .topbar .help-link { font-size: 0; gap: 0; padding: 0 8px; } }
