/* HUB Live — live.psbms.com (R495; R496: HUB sign-in look, light and dark
   modes, Select/Text tools, style options, chat).
   Self-contained: this host does not load the HUB stylesheet, so the HUB's
   colour tokens are repeated here — same values, light and dark — and the
   Live pages match HUB in both modes. Touch targets are at least 44px
   wherever a finger is likely, because most people join from a phone or an
   iPad while they are on the call. */

:root {
  color-scheme: light;
  --navy: #1e3a5f;
  --navy-dark: #15273f;
  --navy-light: #2a4d7a;
  --bg: #f4f6f8;
  --card: #ffffff;
  --field-bg: #ffffff;
  --surface-2: #f8fafc;
  --text: #1f2937;
  --text-muted: #69707d;
  --heading: #1e3a5f;
  --border: #e5e7eb;
  --row-hover: #f0f4f8;
  --link: #2a4d7a;
  --info: #2563eb;
  --danger: #dc2626;
  --success: #059669;
  --focus-border: #2a4d7a;
  --focus-ring: rgba(42, 77, 122, .16);
  --stage: #cfd6df;
  --tool-on: #1e3a5f;
  --chip: #e8eef6;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f141c;
  --card: #1a212e;
  --field-bg: #141b27;
  --surface-2: #222b3a;
  --text: #e5e7eb;
  --text-muted: #9aa6b6;
  --heading: #d6e4f7;
  --border: #2d3748;
  --row-hover: #253044;
  --link: #93c5fd;
  --info: #60a5fa;
  --focus-border: #5b8cc9;
  --focus-ring: rgba(147, 197, 253, .22);
  --stage: #0b1017;
  --tool-on: #2a4d7a;
  --chip: #253044;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { flex: 0 0 auto; }

/* ---------- card pages: landing, join, ended — the HUB sign-in look ---------- */
.lv-auth {
  min-height: 100%;
  display: grid; place-items: center;
  padding: 24px 16px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  position: relative;
}
.lv-card {
  background: var(--card); color: var(--text);
  padding: 36px 32px; border-radius: var(--radius-lg);
  width: 100%; max-width: 380px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
}
.lv-brand { text-align: center; margin-bottom: 24px; }
.lv-logo {
  display: block; max-width: 180px; width: 100%; height: auto; margin: 0 auto;
  background: var(--navy); padding: 10px 14px; border-radius: 6px;
}
.lv-tag { font-size: 13px; color: var(--text-muted); margin-top: 6px; letter-spacing: .3px; }
.lv-field { display: block; margin-bottom: 14px; }
.lv-field span { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.lv-field input {
  width: 100%; padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--field-bg); color: var(--text); font-size: 16px;   /* 16px: no iOS zoom-on-focus */
}
.lv-field input:focus { outline: none; border-color: var(--focus-border); box-shadow: 0 0 0 3px var(--focus-ring); }
#lv-code { font-size: 26px; font-weight: 700; letter-spacing: 4px; text-align: center; font-variant-numeric: tabular-nums; }
.lv-submit {
  width: 100%; min-height: 46px; padding: 11px;
  background: var(--navy); color: #fff; border: 0; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600;
}
.lv-submit:hover { background: var(--navy-light); }
.lv-submit:disabled { opacity: .55; }
html[data-theme="dark"] .lv-submit { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.lv-hint { margin: 12px 0 0; font-size: 13px; color: var(--text-muted); text-align: center; }
.lv-err { margin: 10px 0 0; min-height: 18px; color: var(--danger); font-size: 13px; text-align: center; }
.lv-join-title { margin: 0 0 2px; font-size: 18px; color: var(--heading); text-align: center; }
.lv-join-code {
  margin: 0 0 18px; text-align: center; font-size: 28px; font-weight: 800; letter-spacing: 3px;
  color: var(--heading); font-variant-numeric: tabular-nums;
}
.lv-msgcard { text-align: center; }
.lv-msgcard h1 { font-size: 20px; color: var(--heading); margin: 0 0 8px; }
.lv-msgcard p { color: var(--text-muted); margin: 4px 0; }
.lv-msglink { margin-top: 14px !important; }
.lv-msglink a { color: var(--link); font-weight: 600; text-decoration: none; }
.lv-msglink a:hover { text-decoration: underline; }
.lv-theme-fab {
  position: absolute; top: 14px; right: 14px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .1); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.lv-theme-fab:hover { background: rgba(255, 255, 255, .2); }
.lv-theme-fab[hidden] { display: none; }
.lv-theme-fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- room layout ---------- */
.lv-room { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); color: var(--text); }
.lv-top {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: var(--navy); color: #fff; min-height: 54px; flex-wrap: wrap;
}
.lv-toplogo { height: 24px; width: auto; display: block; flex: 0 0 auto; }
.lv-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.lv-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.lv-codechip {
  background: rgba(255, 255, 255, .15); border-radius: 6px; padding: 3px 8px; font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: 1px; font-size: 14px; white-space: nowrap;
}
.lv-pagenav { font-size: 13px; opacity: .85; white-space: nowrap; }
.lv-people { display: flex; gap: 4px; }
.lv-person {
  width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px; border: 2px solid rgba(255, 255, 255, .85);
}
.lv-person.away { opacity: .35; }
.lv-person.host { box-shadow: 0 0 0 2px #ffd400; }
.lv-hostbox { display: flex; gap: 6px; }
.lv-btn {
  min-height: 40px; min-width: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .1); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.lv-btn:hover { background: rgba(255, 255, 255, .2); }
.lv-btn.on { background: rgba(255, 255, 255, .26); border-color: rgba(255, 255, 255, .7); }
.lv-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lv-btn.lv-end { background: var(--danger); border-color: var(--danger); font-weight: 600; }
.lv-badge:empty { display: none; }
.lv-badge { background: #ffd400; color: #111; border-radius: 10px; padding: 0 6px; font-size: 12px; font-weight: 700; line-height: 18px; }

.lv-body { flex: 1; display: flex; min-height: 0; position: relative; }

/* ---------- tools ---------- */
.lv-tools {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px;
  background: var(--card); border-right: 1px solid var(--border); overflow-y: auto; flex: 0 0 auto;
  width: 108px; scrollbar-width: thin;
}
.lv-grid { display: grid; grid-template-columns: repeat(2, 44px); gap: 4px; }
.lv-tool {
  width: 44px; height: 44px; border-radius: 10px; border: 0; background: transparent; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.lv-tool svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lv-tool:hover { background: var(--row-hover); }
.lv-tool.on { background: var(--tool-on); color: #fff; }
.lv-zoom { font-size: 22px; font-weight: 600; }
.lv-sep { width: 80px; height: 1px; background: var(--border); margin: 2px 0; flex: 0 0 auto; }
.lv-swatches { display: grid; grid-template-columns: repeat(4, 22px); gap: 6px; padding: 2px 0; }
.lv-swatch { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .25); padding: 0; }
html[data-theme="dark"] .lv-swatch { border-color: rgba(255, 255, 255, .3); }
.lv-swatch.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--focus-border); }

/* Style options — only the ones that apply to the tool or selected object. */
.lv-opts { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; padding-top: 4px; }
.lv-opts[hidden] { display: none; }
.lv-optgroup { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.lv-optlabel { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.lv-optrow { display: grid; gap: 4px; }
.lv-optrow.two { grid-template-columns: repeat(2, 44px); }
.lv-optrow.three { grid-template-columns: repeat(3, 28px); }
.lv-opt {
  height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--text); padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.lv-opt:hover { background: var(--row-hover); }
.lv-opt.on { background: var(--chip); box-shadow: inset 0 0 0 1.5px var(--focus-border); }
.lv-opt svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.lv-opt .lv-shbox { fill: var(--card); }
.lv-wbar { display: block; width: 26px; background: currentColor; border-radius: 3px; }
.lv-aa { font-weight: 700; line-height: 1; }

/* ---------- stage ---------- */
.lv-stage {
  flex: 1; position: relative; min-width: 0; overflow: hidden; background: var(--stage);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.lv-stage.drop { box-shadow: inset 0 0 0 3px var(--info); }
.lv-canvas { position: absolute; inset: 0; display: block; touch-action: none; cursor: crosshair; }
.lv-canvas[data-tool="hand"] { cursor: grab; }
.lv-canvas[data-tool="select"] { cursor: default; }
.lv-canvas[data-tool="text"] { cursor: text; }
.lv-canvas[data-tool="eraser"] { cursor: cell; }
.lv-canvas[data-tool="pointer"] { cursor: pointer; }

/* Typing on the board: a textarea laid exactly over the page. */
.lv-texted {
  position: absolute; z-index: 5; margin: 0; padding: 0; border: 0; resize: none; overflow: hidden;
  white-space: pre; background: rgba(255, 255, 255, .55); outline: 1.5px dashed var(--info); outline-offset: 3px;
  border-radius: 2px; user-select: text; -webkit-user-select: text; min-width: 20px;
}
.lv-selbar {
  position: absolute; z-index: 6; display: flex; gap: 4px; padding: 3px;
  background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}
.lv-selbar[hidden] { display: none; }
.lv-selbtn {
  width: 38px; height: 38px; border: 0; border-radius: 8px; background: transparent; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
}
.lv-selbtn:hover { background: var(--row-hover); }
.lv-selbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lv-selbtn.lv-danger { color: var(--danger); }

/* ---------- menu (Add pages) ---------- */
.lv-menu {
  position: fixed; z-index: 60; min-width: 250px; padding: 6px;
  background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .24);
}
.lv-menuitem {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 6px 10px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text); text-align: left;
}
.lv-menuitem:hover { background: var(--row-hover); }
.lv-menuitem svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--heading); }
.lv-menuitem b { display: block; font-size: 14px; }
.lv-menuitem small { display: block; font-size: 12px; color: var(--text-muted); }
.lv-menuhint { margin: 6px 10px 4px; font-size: 12px; color: var(--text-muted); }

/* ---------- side panel: Chat and Files ---------- */
.lv-drawer {
  width: 330px; flex: 0 0 auto; background: var(--card); color: var(--text); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; min-height: 0;
}
.lv-drawer[hidden] { display: none; }
.lv-tabs { display: flex; align-items: center; gap: 4px; padding: 6px 6px 0 10px; border-bottom: 1px solid var(--border); }
.lv-tab {
  min-height: 42px; padding: 0 14px; border: 0; background: transparent; color: var(--text-muted);
  font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.lv-tab.on { color: var(--heading); border-bottom-color: var(--heading); }
.lv-x { margin-left: auto; width: 42px; height: 42px; border: 0; background: transparent; font-size: 26px; color: var(--text-muted); }
.lv-x:hover { color: var(--text); }

.lv-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.lv-chatlog { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.lv-chat-empty { margin: 8px 4px; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.lv-msg { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); max-width: 100%; }
.lv-msg.mine { background: var(--chip); }
.lv-msg.pending { opacity: .6; }
.lv-msghead { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 3px; }
.lv-msghead b { font-weight: 700; color: var(--text); }
.lv-msghead time { margin-left: auto; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.lv-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.lv-msgtext { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; font-size: 14px; }
.lv-chatform { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.lv-chatinput {
  flex: 1; min-height: 42px; max-height: 120px; resize: none; padding: 10px 12px; line-height: 1.35;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--field-bg); color: var(--text);
  font-size: 15px;
}
.lv-chatinput:focus { outline: none; border-color: var(--focus-border); box-shadow: 0 0 0 3px var(--focus-ring); }
.lv-send {
  width: 44px; height: 42px; border: 0; border-radius: var(--radius-md); background: var(--navy); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.lv-send:hover { background: var(--navy-light); }
.lv-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.lv-files { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.lv-left { text-align: left; margin: 0; }
.lv-meter { height: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 3px; overflow: hidden; }
.lv-meter i { display: block; height: 100%; background: var(--info); }
.lv-drop {
  border: 2px dashed var(--border); border-radius: 10px; padding: 14px; text-align: center;
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.lv-drop .lv-hint { margin: 0; }
.lv-drop.over { background: var(--row-hover); border-color: var(--info); }
.lv-sharebtn {
  min-height: 42px; padding: 0 16px; border: 0; border-radius: var(--radius-sm); background: var(--navy); color: #fff; font-weight: 600;
}
.lv-sharebtn:hover { background: var(--navy-light); }
.lv-uploads:empty { display: none; }
.lv-up { font-size: 13px; }
.lv-up span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-bar { height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-top: 3px; }
.lv-bar i { display: block; height: 100%; width: 0; background: var(--info); transition: width .15s linear; }
.lv-filelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lv-filelist li { display: flex; align-items: center; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.lv-filelist li.lv-empty { display: block; color: var(--text-muted); font-size: 13px; border: 0; }
.lv-finfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lv-fname { color: var(--link); text-decoration: none; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-fname:hover { text-decoration: underline; }
.lv-fmeta { font-size: 12px; color: var(--text-muted); }
.lv-ficon {
  width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.lv-ficon:hover { background: var(--row-hover); color: var(--text); }
.lv-ficon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- toasts & overlays ---------- */
.lv-toasts {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 50; pointer-events: none;
}
.lv-toast {
  background: #1f2937; color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25); max-width: 90vw;
}
html[data-theme="dark"] .lv-toast { background: #2d3748; }
.lv-toast.bad { background: var(--danger); }
.lv-toast.chat { background: var(--navy); border: 1px solid rgba(255, 255, 255, .25); }
.lv-overlay { position: fixed; inset: 0; background: rgba(10, 18, 30, .6); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.lv-overlay-card { background: var(--card); color: var(--text); border-radius: 14px; padding: 26px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.lv-overlay-card h2 { margin: 0 0 8px; font-size: 20px; color: var(--heading); }
.lv-overlay-card p { margin: 0 0 12px; color: var(--text-muted); }
.lv-overlay-card .lv-btn { color: var(--text); border-color: var(--border); background: var(--surface-2); }

/* ---------- phones: tools along the bottom, the panel over the page ---------- */
@media (max-width: 700px) {
  .lv-toplogo { display: none; }
  .lv-body { flex-direction: column-reverse; }
  .lv-tools {
    flex-direction: row; width: auto; border-right: 0; border-top: 1px solid var(--border);
    overflow-x: auto; overflow-y: hidden; padding: 6px; gap: 6px;
  }
  .lv-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 44px; }
  .lv-sep { width: 1px; height: 32px; margin: 0 2px; align-self: center; }
  .lv-swatches { grid-template-columns: repeat(8, 22px); align-self: center; }
  .lv-opts { flex-direction: row; width: auto; padding: 0; align-items: center; }
  .lv-optgroup { flex-direction: row; }
  .lv-optlabel { display: none; }
  .lv-optrow.two, .lv-optrow.three { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 34px; }
  .lv-drawer { position: absolute; inset: 0; width: auto; z-index: 20; border-left: 0; }
  .lv-title strong { max-width: 38vw; }
  .lv-pagenav { order: 5; }
}
