/* Couch Board v2 — dark glass chrome around a bright canvas. RTL-first (Hebrew), LTR-safe. */
:root {
  --bg0: #0b0c18;
  --bg1: #11132a;
  --panel: rgba(20, 22, 42, 0.82);
  --panel-solid: #171a33;
  --panel-2: #1e2142;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #eef0ff;
  --muted: #a6abc8;
  --dim: #6f7496;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-soft: rgba(139, 92, 246, 0.22);
  --grad: linear-gradient(135deg, #8b5cf6 0%, #22d3ee 100%);
  --grad-strong: linear-gradient(135deg, #7c3aed 0%, #0e7490 100%);
  --danger: #f43f5e;
  --ok: #22c55e;
  --warn: #f59e0b;
  --p2p: #22d3ee;
  --r: 16px;
  --tool: 46px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.3);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Rubik", "Heebo", "Noto Sans Hebrew", "Arial Hebrew", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --vh: 1vh;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  min-height: 100%;
  background: var(--bg0);
  color: var(--text);
  font: 400 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
small { font-size: 0.82em; }
kbd {
  font: 600 12px/1 var(--mono);
  padding: 5px 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  white-space: nowrap;
}
:focus { outline: none; }
:focus-visible { outline: 3px solid #a78bfa; outline-offset: 2px; }

.ic { width: 22px; height: 22px; flex: none; display: block; }
.ic.tiny { width: 14px; height: 14px; }
[dir="rtl"] .ic.flip { transform: scaleX(-1); }
[dir="ltr"] .ic.flip-ltr { transform: scaleX(-1); }

body.on-board { position: fixed; inset: 0; overflow: hidden; overscroll-behavior: none; }
body.on-home { overflow-y: auto; }

/* ------------------------------------------------------------ boot / no-js */
.boot {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(60% 50% at 50% 40%, rgba(139, 92, 246, 0.18), transparent 70%), var(--bg0);
}
.boot-logo { animation: boot-pulse 1.6s ease-in-out infinite; filter: drop-shadow(0 10px 30px rgba(139, 92, 246, 0.45)); }
.boot-t { font-weight: 800; font-size: 22px; letter-spacing: 0.01em; }
.boot-s { color: var(--muted); font-size: 14px; }
@keyframes boot-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.nojs { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 18px; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  font-weight: 650; font-size: 15px; white-space: nowrap;
  transition: background 0.15s, transform 0.1s, border-color 0.15s, box-shadow 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.12); }
.btn:active { transform: scale(0.97); }
.btn .ic { width: 20px; height: 20px; }
.btn.primary { background: var(--grad-strong); border-color: transparent; color: #fff; box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { background: #e11d48; border-color: transparent; color: #fff; }
.btn.danger:hover { background: #f43f5e; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.45; filter: grayscale(0.4); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px; color: var(--text);
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.09); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.small { width: 36px; height: 36px; border-radius: 10px; }
.icon-btn.small .ic { width: 18px; height: 18px; }
.icon-btn.ghost { color: var(--muted); }
.icon-btn.popped, .tool.popped { background: rgba(255, 255, 255, 0.12); }

/* ------------------------------------------------------------ fields */
.field {
  width: 100%; height: 48px; padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.05);
  font-size: 17px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.25); }
.lbl { display: block; margin: 14px 0 8px; color: var(--muted); font-size: 13px; font-weight: 600; }

/* ------------------------------------------------------------ toasts */
.ui-layer { position: relative; z-index: 900; }
.toasts {
  position: fixed; z-index: 1200; left: 50%; transform: translateX(-50%);
  bottom: calc(96px + var(--sab));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; width: min(560px, calc(100vw - 24px));
}
body.on-home .toasts { bottom: calc(24px + var(--sab)); }
.on-tv .toasts { bottom: auto; top: 24px; }
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  max-width: 100%;
  padding: 11px 16px;
  border-radius: 14px;
  background: rgba(23, 26, 51, 0.96);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  font-size: 14.5px; font-weight: 500;
  opacity: 0; transform: translateY(10px) scale(0.98);
  transition: opacity 0.22s, transform 0.22s;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.toast.in { opacity: 1; transform: none; }
.toast.out { opacity: 0; transform: translateY(6px); }
.toast.warn { border-color: rgba(245, 158, 11, 0.45); }
.toast-act {
  flex: none; color: #c4b5fd; font-weight: 700; padding: 6px 10px; margin: -6px -8px; border-radius: 8px;
}
.toast-act:hover { background: rgba(139, 92, 246, 0.18); }
.on-tv .toast { font-size: 22px; padding: 16px 24px; }

/* ------------------------------------------------------------ modal */
.modal-back {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  padding: max(12px, var(--sat)) 12px max(12px, var(--sab));
  background: rgba(4, 5, 14, 0.62);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.2s;
}
.modal-back.in { opacity: 1; }
.modal-card {
  width: min(460px, 100%);
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--panel-solid);
  border: 1px solid var(--line-2);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 18px 20px 20px;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-back.in .modal-card { transform: none; }
.modal-card.wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.modal-title { margin: 0; font-size: 19px; font-weight: 750; }
.modal-x { margin-inline-end: -8px; }
.modal-text { margin: 4px 0 4px; color: var(--muted); font-size: 15.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.fine { color: var(--dim); font-size: 13px; margin: 12px 0 0; }

/* ------------------------------------------------------------ popover */
.popover {
  position: fixed; z-index: 1000;
  min-width: 200px;
  max-width: min(380px, calc(100vw - 16px));
  max-height: calc(100vh - 24px);
  max-height: calc(var(--vh) * 100 - 24px);
  overflow: auto; overscroll-behavior: contain;
  padding: 12px;
  background: rgba(23, 26, 51, 0.97);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(6px) scale(0.98);
  transform-origin: 50% 100%;
  transition: opacity 0.16s, transform 0.16s;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.popover[data-side="below"] { transform-origin: 50% 0; transform: translateY(-6px) scale(0.98); }
.popover.in { opacity: 1; transform: none; }
.popover.sheet {
  left: 0 !important; right: 0; bottom: 0; top: auto !important;
  max-width: none; width: 100%;
  border-radius: 22px 22px 0 0;
  padding: 10px 14px calc(14px + var(--sab));
  max-height: 82vh;
  transform: translateY(30px);
}
.popover.sheet::before {
  content: ""; display: block; width: 44px; height: 5px; border-radius: 3px;
  background: var(--line-2); margin: 2px auto 10px;
}
.popover.sheet.in { transform: none; }
.pop-label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  color: var(--muted); font-size: 12.5px; font-weight: 650; letter-spacing: 0.02em;
  margin: 4px 4px 8px;
}
.pop-label:not(:first-child) { margin-top: 14px; }

/* menu */
.menu { display: flex; flex-direction: column; gap: 2px; min-width: 260px; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 6px 10px; border-radius: 12px; text-align: start;
  transition: background 0.12s;
}
.menu-item:hover, .menu-item:focus-visible { background: rgba(255, 255, 255, 0.07); }
.menu-item .ic { color: var(--muted); }
.mi-t { display: flex; flex-direction: column; line-height: 1.2; font-weight: 600; }
.mi-t small { color: var(--dim); font-weight: 500; }
.menu-item.danger, .menu-item.danger .ic { color: #fb7185; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* segmented */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.seg-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 56px; padding: 8px 6px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.15;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.seg-btn small { display: block; color: var(--dim); font-weight: 500; font-size: 11px; }
.seg-btn:hover { background: rgba(255, 255, 255, 0.09); }
.seg-btn.on { background: var(--accent-soft); border-color: rgba(139, 92, 246, 0.75); color: var(--text); }
.bg-thumb { width: 44px; height: 30px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; }
.bg-thumb[data-bg="grid"] {
  background-color: #fbfbfd;
  background-image: linear-gradient(rgba(30, 41, 59, 0.18) 1px, transparent 1px), linear-gradient(90deg, rgba(30, 41, 59, 0.18) 1px, transparent 1px);
  background-size: 8px 8px;
}
.bg-thumb[data-bg="dots"] { background-color: #fbfbfd; background-image: radial-gradient(rgba(30, 41, 59, 0.45) 1px, transparent 1.4px); background-size: 7px 7px; }
.bg-thumb[data-bg="dark"] { background: #161a2b; }

/* toggle */
.toggle-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 48px; padding: 6px 10px; border-radius: 12px; text-align: start; font-weight: 600;
}
.toggle-row:hover { background: rgba(255, 255, 255, 0.06); }
.toggle-row small { display: block; color: var(--dim); font-weight: 500; }
.tg-sw {
  flex: none; position: relative; width: 42px; height: 24px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.16); transition: background 0.18s;
}
.tg-sw::after {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: inset-inline-start 0.18s;
}
.tg-sw.on { background: var(--accent); }
.tg-sw.on::after { inset-inline-start: 21px; }

/* ------------------------------------------------------------ board */
.board {
  position: fixed; inset: 0;
  height: 100%;
  overflow: hidden;
  background: #fff;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
.board.bg-dark { background: #161a2b; }
.stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
.cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cv-fx { pointer-events: none; }
.overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.board[data-tool="pen"] .stage,
.board[data-tool="highlighter"] .stage,
.board[data-tool="line"] .stage,
.board[data-tool="arrow"] .stage,
.board[data-tool="rect"] .stage,
.board[data-tool="ellipse"] .stage,
.board[data-tool="laser"] .stage { cursor: crosshair; }
.board[data-tool="text"] .stage { cursor: text; }
.board[data-tool="hand"] .stage, .board.space-pan .stage { cursor: grab; }
.stage.panning, .board.space-pan .stage.panning { cursor: grabbing !important; }
@media (pointer: fine) { .board[data-tool="eraser"] .stage { cursor: none; } }
.tv-mode .stage { cursor: crosshair; }
.tv-mode[data-tool="hand"] .stage { cursor: grab; }
.tv-mode.tv-idle .stage { cursor: none; }

/* chrome: floating glass bars over the canvas */
.chrome { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.chrome > * { pointer-events: auto; }
.topbar {
  position: absolute;
  top: calc(10px + var(--sat));
  left: calc(10px + var(--sal));
  right: calc(10px + var(--sar));
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  pointer-events: none;
}
.tb-group {
  pointer-events: auto;
  display: flex; align-items: center; gap: 4px;
  min-height: 56px; padding: 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  min-width: 0;
}
.tb-start { flex: 0 1 auto; }
.tb-end { flex: none; }
.title-wrap { display: flex; align-items: center; gap: 6px; min-width: 0; padding-inline-end: 6px; }
.title-chip {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  height: 44px; padding: 0 10px; border-radius: 12px;
  font-weight: 700; font-size: 16px;
}
.title-chip:hover { background: rgba(255, 255, 255, 0.07); }
.title-chip .ic { color: var(--dim); opacity: 0; transition: opacity 0.15s; }
.title-chip:hover .ic, .title-chip:focus-visible .ic { opacity: 1; }
.title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34vw; }
.code-chip {
  flex: none;
  height: 32px; padding: 0 10px; border-radius: 9px;
  font: 700 14px/32px var(--mono); letter-spacing: 0.16em;
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.35);
}
.code-chip:hover { background: rgba(139, 92, 246, 0.24); }

.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 44px; min-width: 44px; padding: 0 12px; border-radius: 12px;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  white-space: nowrap;
}
.chip:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.sdot {
  flex: none; width: 10px; height: 10px; border-radius: 50%;
  background: var(--dim); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}
.sdot[data-s="online"] { background: var(--ok); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2), 0 0 10px rgba(34, 197, 94, 0.6); }
.sdot[data-s="p2p"] { background: var(--p2p); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2), 0 0 10px rgba(34, 211, 238, 0.6); }
.sdot[data-s="connecting"] { background: var(--warn); animation: pulse 1.2s ease-in-out infinite; }
.sdot[data-s="offline"] { background: #64748b; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.avatars { display: inline-flex; align-items: center; }
.avatars .avatar + .avatar { margin-inline-start: -8px; }
.avatar {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--c, #8b5cf6);
  color: #fff; font-weight: 800; line-height: 1;
  border: 2px solid var(--panel-solid);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  -webkit-user-select: none; user-select: none;
}
.dcount { font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.devices-chip.solo .avatars { display: none; }
.btn.share-btn { min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 12px; }

/* toolbar */
.toolbar {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: calc(12px + var(--sab));
  display: flex; align-items: center; gap: 3px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  max-width: calc(100vw - 20px);
}
.tb-tools { display: flex; align-items: center; gap: 3px; }
.tb-sep { flex: none; width: 1px; height: 28px; background: var(--line-2); margin: 0 5px; }
.tool {
  position: relative;
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--tool); height: var(--tool);
  border-radius: 15px;
  color: var(--muted);
  transition: background 0.14s, color 0.14s, transform 0.1s, box-shadow 0.14s;
}
.tool:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.tool:active { transform: scale(0.93); }
.tool.on {
  color: #fff;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.42), rgba(34, 211, 238, 0.22));
  box-shadow: inset 0 0 0 1.5px rgba(167, 139, 250, 0.75), 0 4px 14px rgba(124, 58, 237, 0.3);
}
.tool:disabled { opacity: 0.3; }
.tool:disabled:hover { background: none; color: var(--muted); }
.tool.group { gap: 0; }
.gcaret { position: absolute; bottom: 3px; inset-inline-end: 3px; opacity: 0.6; }
.gcaret .ic { width: 11px; height: 11px; }
.gicon { display: flex; }

.style-btn { width: 50px; }
.style-dot {
  position: relative;
  width: 30px; height: 30px; border-radius: 50%;
  display: block;
}
.style-dot::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
}
.style-dot::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  background: var(--c, #1e1e2e);
  transform: scale(var(--s, 0.6));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
  transition: transform 0.15s, background 0.15s;
}
.style-btn.is-eraser .style-dot::after { background: transparent; border: 2px dashed #cbd5e1; box-shadow: none; }

.tb-swatches { display: flex; align-items: center; gap: 4px; padding: 0 2px; }
.swatch {
  position: relative; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink, var(--c));
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.28);
  transition: transform 0.12s, box-shadow 0.12s;
}
.swatch:hover { transform: scale(1.1); }
.swatch.sel { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.3), 0 0 0 2.5px var(--panel-solid), 0 0 0 4.5px #fff; }
.swatch.big { width: 40px; height: 40px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 10px; padding: 4px; justify-items: center; }
.swatches.people .swatch { width: 38px; height: 38px; }
.swatch.custom {
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  background: conic-gradient(#ef4444, #eab308, #22c55e, #06b6d4, #3b82f6, #8b5cf6, #ec4899, #ef4444);
  color: #fff; cursor: pointer;
}
.swatch.custom .ic { width: 18px; height: 18px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); pointer-events: none; }
.color-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }

.pop-style { width: 300px; max-width: 100%; }
.pop-style .swatches { grid-template-columns: repeat(5, 1fr); }
/* 8 palette swatches + the custom picker as a 2-cell pill = two full rows of 5, no hole */
.pop-style .swatch.custom {
  grid-column: span 2; justify-self: stretch; width: auto;
  border-radius: 20px; gap: 6px; padding: 0 12px;
  font-size: 13.5px; font-weight: 750; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.pop-style .swatch.custom .cs-t { pointer-events: none; }
.pop-style .swatch.custom:hover { transform: scale(1.04); }
.range-row { padding: 6px 6px 2px; }
.range-val { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 700; }
.range { width: 100%; height: 32px; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgba(139, 92, 246, 0.9), rgba(34, 211, 238, 0.9)); }
.range::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgba(139, 92, 246, 0.9), rgba(34, 211, 238, 0.9)); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.range::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); }
[dir="rtl"] .range { direction: ltr; }
.width-preview {
  display: block; width: 100%; height: auto; aspect-ratio: 520 / 120;
  margin-top: 8px; border-radius: 12px;
  background: #fff;
}

.pop-group { width: 280px; max-width: 100%; }
.pop-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pop-tool {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  min-height: 64px; border-radius: 14px; font-size: 12px; font-weight: 600; color: var(--muted);
  background: rgba(255, 255, 255, 0.04); border: 1px solid transparent;
}
.pop-tool:hover { background: rgba(255, 255, 255, 0.09); color: var(--text); }
.pop-tool.on { background: var(--accent-soft); border-color: rgba(139, 92, 246, 0.7); color: #fff; }
.pop-tool .ic { width: 24px; height: 24px; }

/* zoom pill */
.zoom-pill {
  position: absolute;
  left: calc(12px + var(--sal));
  bottom: calc(14px + var(--sab));
  display: flex; align-items: center; gap: 2px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  direction: ltr;
}
.zoom-pct {
  min-width: 58px; height: 36px; padding: 0 8px; border-radius: 10px;
  font: 700 13px/36px var(--font); color: var(--muted); font-variant-numeric: tabular-nums;
}
.zoom-pct:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }

/* empty-board hint */
.empty-hint {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  pointer-events: none !important;
  color: rgba(30, 30, 46, 0.42);
  opacity: 0; transition: opacity 0.4s;
  width: min(440px, calc(100vw - 40px));
}
.board.ready.is-empty .empty-hint { opacity: 1; }
.board.bg-dark .empty-hint { color: rgba(226, 232, 240, 0.4); }
.empty-hint .eh-art { width: 84px; height: 84px; opacity: 0.85; }
.empty-hint b { font-size: 22px; font-weight: 750; }
.empty-hint span { font-size: 15px; }
.empty-hint .eh-invite { pointer-events: auto; margin-top: 6px; }

/* remote cursors */
.cursors { position: absolute; inset: 0; pointer-events: none; }
.rcursor {
  position: absolute; left: 0; top: 0;
  will-change: transform;
  transition: transform 90ms linear, opacity 0.3s;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}
.rcursor svg { display: block; margin: -2px 0 0 -3px; }
.rcursor.down svg { transform: scale(0.86); }
.rname {
  position: absolute; left: 14px; top: 18px;
  padding: 3px 9px; border-radius: 9px 9px 9px 3px;
  background: var(--c, #8b5cf6); color: #fff;
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}
.rcursor.gone { opacity: 0; }
.rcursor.off { display: none; }
.cursors.tv .rcursor svg { width: 34px; height: 34px; }
.cursors.tv .rname { font-size: 20px; left: 22px; top: 28px; padding: 5px 13px; }

/* text editing */
.text-editor {
  position: absolute; z-index: 5;
  pointer-events: auto;
  margin: 0; padding: 0; border: 0;
  background: rgba(139, 92, 246, 0.06);
  outline: 1.5px dashed rgba(139, 92, 246, 0.85); outline-offset: 4px;
  border-radius: 2px;
  resize: none; overflow: hidden;
  white-space: pre; word-break: keep-all;
  min-width: 24px;
  -webkit-user-select: text; user-select: text;
}

/* ------------------------------------------------------------ status / devices popovers */
.pop-status { width: 320px; max-width: 100%; display: flex; flex-direction: column; gap: 4px; }
.srow { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 10px; }
.srow .st { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.srow .st small { color: var(--dim); }
.srow .sv { color: var(--muted); font-size: 13px; font-weight: 600; }
.pop-devices { width: 320px; max-width: 100%; }
.dev-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; max-height: 50vh; overflow: auto; }
.dev { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 12px; }
.dev.self { background: rgba(255, 255, 255, 0.04); }
.dev .avatar { border-color: rgba(255, 255, 255, 0.12); }
.dev-n { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.dev-n b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-n small { color: var(--dim); }

/* ------------------------------------------------------------ share */
.share { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.share-qr {
  background: #fff; padding: 14px; border-radius: 22px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 20px 50px rgba(124, 58, 237, 0.35);
}
.qr-svg { display: block; width: 100%; height: auto; }
.share-qr .qr { width: min(300px, 64vw); }
.share-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.share-lead { margin: 0; color: var(--muted); font-size: 15.5px; }
.code-big { display: flex; gap: 8px; direction: ltr; justify-content: flex-start; flex-wrap: wrap; }
[dir="rtl"] .code-big { justify-content: flex-end; }
.code-big span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 50px; height: 62px; border-radius: 14px;
  font: 800 34px/1 var(--mono); color: #fff;
  background: linear-gradient(var(--panel-2), var(--panel-2)) padding-box, var(--grad) border-box;
  border: 2px solid transparent;
}
.share-url {
  font: 600 14px/1.4 var(--mono); color: var(--muted);
  padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
  overflow-wrap: anywhere; text-align: left;
}
.share-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.steps { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; align-items: flex-start; gap: 12px; }
.step-n {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad-strong); color: #fff; font-weight: 800; font-size: 14px;
}
.step-ic { flex: none; color: var(--accent-2); padding-top: 4px; }
.step-t { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-top: 4px; }
.step-t small { color: var(--dim); }
.tv-url {
  font: 700 16px/1.4 var(--mono); color: #c4b5fd; overflow-wrap: anywhere;
  padding: 10px 12px; border-radius: 12px; background: rgba(139, 92, 246, 0.12); border: 1px solid rgba(139, 92, 246, 0.3);
  text-align: left;
}
.tv-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.sc { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sc span { color: var(--muted); font-size: 14px; }

.profile-preview { display: flex; align-items: center; gap: 14px; padding: 6px 0 4px; }
.pp-name { font-size: 20px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------ TV mode */
.tv-corner {
  position: absolute; z-index: 12;
  top: calc(18px + var(--sat)); right: calc(18px + var(--sar));
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px 14px 14px;
  background: rgba(13, 15, 32, 0.84);
  border: 1px solid var(--line-2);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s;
  transform-origin: top right;
}
.tv-qr { width: clamp(120px, 15vmin, 230px); background: #fff; border-radius: 14px; padding: 8px; }
.tv-info { display: flex; flex-direction: column; gap: 4px; }
.tv-join { color: var(--muted); font-size: clamp(15px, 1.7vmin, 24px); font-weight: 600; }
.tv-code { font: 800 clamp(30px, 4.6vmin, 64px)/1 var(--mono); letter-spacing: 0.12em; color: #fff; }
.tv-code { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tv-url { padding: 0; background: none; border: 0; font-size: clamp(12px, 1.3vmin, 18px); color: var(--dim); }
.tv-info .tv-url { color: var(--dim); }
.tv-count { margin-top: 4px; font-size: clamp(13px, 1.5vmin, 20px); font-weight: 700; color: #86efac; }
.tv-count.none { display: none; }

.tv-mode.tv-big .tv-corner { transform: translate(calc(-50vw + 50% + 18px), calc(50vh - 50% - 18px)) scale(1.9); }

.tv-welcome {
  position: absolute; inset: 0; z-index: 11;
  display: flex; align-items: center; justify-content: center;
  padding: 4vmin;
  background:
    radial-gradient(50% 50% at 30% 40%, rgba(139, 92, 246, 0.35), transparent 70%),
    radial-gradient(40% 40% at 75% 65%, rgba(34, 211, 238, 0.25), transparent 70%),
    var(--bg0);
  opacity: 0; pointer-events: none;
  transition: opacity 0.5s;
}
.tv-mode.tv-empty .tv-welcome { opacity: 1; }
.tv-mode.tv-empty .tv-corner { opacity: 0; pointer-events: none; }
.tvw-card { display: flex; align-items: center; gap: 6vmin; max-width: 1500px; }
.tvw-qr {
  flex: none; width: min(44vmin, 520px);
  background: #fff; border-radius: 4vmin; padding: 2.4vmin;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 40px 120px rgba(124, 58, 237, 0.55);
}
.tvw-side { display: flex; flex-direction: column; gap: 2vmin; min-width: 0; }
.tvw-side h1 { margin: 0; font-size: clamp(32px, 6vmin, 96px); line-height: 1.05; font-weight: 850; }
.tvw-lead { margin: 0; font-size: clamp(18px, 3vmin, 44px); color: var(--muted); max-width: 22em; }
.tvw-or { font-size: clamp(15px, 2.2vmin, 32px); color: var(--dim); margin-top: 1vmin; }
.tvw-code { display: flex; gap: 1.2vmin; direction: ltr; }
[dir="rtl"] .tvw-code { justify-content: flex-end; }
.tvw-code span {
  display: inline-flex; align-items: center; justify-content: center;
  width: clamp(44px, 8vmin, 120px); height: clamp(56px, 10vmin, 150px);
  border-radius: 2vmin;
  font: 800 clamp(30px, 6.4vmin, 96px)/1 var(--mono); color: #fff;
  background: linear-gradient(var(--panel-2), var(--panel-2)) padding-box, var(--grad) border-box;
  border: max(2px, 0.4vmin) solid transparent;
}
.tvw-url { font: 700 clamp(16px, 2.6vmin, 38px)/1.2 var(--mono); color: #c4b5fd; direction: ltr; text-align: end; }
[dir="rtl"] .tvw-url { text-align: right; }
.tvw-people { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2vmin 2vmin; font-size: clamp(15px, 2.2vmin, 30px); color: var(--muted); margin-top: 1vmin; }
.tvw-p { display: inline-flex; align-items: center; gap: 0.8vmin; color: var(--text); font-weight: 700; }
.tvw-people .muted { color: var(--dim); animation: pulse 2.4s ease-in-out infinite; }

.tv-bar {
  position: absolute; z-index: 13;
  left: 50%; transform: translateX(-50%);
  bottom: calc(18px + var(--sab));
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  width: max-content; max-width: calc(100vw - 24px);
  padding: 10px;
  background: rgba(13, 15, 32, 0.86);
  border: 1px solid var(--line-2);
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: opacity 0.4s, transform 0.4s;
}
.tv-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-width: clamp(84px, 9vmin, 130px); height: clamp(72px, 8.4vmin, 116px);
  padding: 0 12px;
  border-radius: 18px;
  color: var(--muted);
  font-size: clamp(14px, 1.6vmin, 21px); font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  transition: transform 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}
.tv-btn .ic { width: clamp(26px, 3vmin, 40px); height: clamp(26px, 3vmin, 40px); }
.tv-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.tv-btn:focus, .tv-btn:focus-visible {
  outline: none;
  color: #fff;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.55), rgba(34, 211, 238, 0.35));
  border-color: #c4b5fd;
  transform: scale(1.08);
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.35), 0 10px 30px rgba(124, 58, 237, 0.45);
}
.tv-mode.tv-idle .tv-bar { opacity: 0; transform: translateX(-50%) translateY(24px); }
.tv-btn.on { color: #fff; border-color: rgba(167, 139, 250, 0.75); background: rgba(139, 92, 246, 0.28); }
.tv-btn.dim { opacity: 0.45; }
.tv-btn.dim:focus, .tv-btn.dim:focus-visible { opacity: 0.8; }

/* ------------------------------------------------------------ home */
.home {
  min-height: 100vh;
  background:
    radial-gradient(60% 40% at 85% -5%, rgba(139, 92, 246, 0.28), transparent 70%),
    radial-gradient(50% 35% at 0% 20%, rgba(34, 211, 238, 0.16), transparent 70%),
    var(--bg0);
  padding: calc(16px + var(--sat)) calc(16px + var(--sar)) calc(24px + var(--sab)) calc(16px + var(--sal));
}
.home { overflow-x: hidden; }
.home-inner { max-width: 1040px; min-width: 0; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand span[class=""], .brand > span { display: flex; }
.brand b { display: block; white-space: nowrap; font-size: 19px; font-weight: 800; letter-spacing: 0.01em; }
.brand small { color: var(--muted); }
.logo { display: block; filter: drop-shadow(0 6px 18px rgba(139, 92, 246, 0.45)); }
.home-head-end { display: flex; align-items: center; gap: 8px; }
.me-chip {
  display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 12px 0 8px; border-radius: 22px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
  font-weight: 650; max-width: 50vw;
}
[dir="rtl"] .me-chip { padding: 0 8px 0 12px; }
.me-chip span:not(.avatar) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-chip .ic { color: var(--dim); }
.me-chip:hover { background: rgba(255, 255, 255, 0.1); }
.me-chip .avatar { border-color: transparent; }

.home-h1 { margin: 8px 0 0; font-size: clamp(30px, 6vw, 54px); line-height: 1.08; font-weight: 850; letter-spacing: -0.01em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.home-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 14px; }
.home-actions > * { min-width: 0; }
.big-action {
  display: flex; align-items: center; gap: 16px;
  min-height: 112px; padding: 20px 22px; border-radius: 24px;
  background: var(--grad-strong);
  color: #fff; text-align: start;
  box-shadow: 0 16px 40px rgba(124, 58, 237, 0.35);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  position: relative; overflow: hidden;
}
.big-action::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 80% at 90% 10%, rgba(255, 255, 255, 0.22), transparent 60%);
  pointer-events: none;
}
.big-action:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 22px 50px rgba(124, 58, 237, 0.45); }
.big-action:active { transform: scale(0.98); }
.big-action:focus-visible { outline: 4px solid #e9d5ff; outline-offset: 3px; }
.ba-icon {
  flex: none; width: 58px; height: 58px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.18);
}
.ba-icon .ic { width: 32px; height: 32px; }
.ba-t { display: flex; flex-direction: column; gap: 2px; }
.ba-t b { font-size: 22px; font-weight: 800; }
.ba-t small { opacity: 0.85; font-size: 14px; }

.join-card {
  display: flex; flex-direction: column; justify-content: center; gap: 12px;
  padding: 18px 20px; border-radius: 24px;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.jc-t { display: flex; flex-direction: column; }
.jc-t b { font-size: 17px; }
.jc-t small { color: var(--muted); }
.join-row { display: flex; gap: 10px; }
.join-row .btn { min-height: 56px; padding: 0 20px; border-radius: 14px; font-size: 16px; }
.code-input {
  flex: 1 1 auto; width: 0; min-width: 0; height: 56px;
  padding: 0 14px;
  border-radius: 14px; border: 1.5px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04);
  font: 800 26px/56px var(--mono); letter-spacing: 0.32em; text-transform: uppercase; text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.code-input::placeholder { color: rgba(255, 255, 255, 0.16); }
.code-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.25); }
.code-input.full { border-color: rgba(34, 211, 238, 0.7); }
.code-input.shake { animation: shake 0.35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.sec-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.sec-head h2 { margin: 0; font-size: 19px; font-weight: 800; }
.sec-head small { color: var(--dim); }
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.rcard {
  position: relative;
  border-radius: 18px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.rcard:hover { transform: translateY(-2px); border-color: rgba(139, 92, 246, 0.45); box-shadow: var(--shadow); }
.rc-open { display: block; width: 100%; text-align: start; }
.rc-thumb {
  aspect-ratio: 360 / 220; background: #fff; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--line);
}
.rc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rc-thumb.none { background: linear-gradient(135deg, #f8fafc, #e2e8f0); color: #94a3b8; }
.rc-thumb.none .ic { width: 32px; height: 32px; }
.rc-meta { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; min-width: 0; }
.rc-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.rc-sub { color: var(--dim); font-size: 13px; }
.rc-code { font-family: var(--mono); font-weight: 700; color: #c4b5fd; letter-spacing: 0.08em; }
.rc-tools {
  position: absolute; top: 8px; inset-inline-end: 8px;
  display: flex; gap: 4px;
  opacity: 0; transition: opacity 0.15s;
}
.rcard:hover .rc-tools, .rcard:focus-within .rc-tools { opacity: 1; }
@media (hover: none) { .rc-tools { opacity: 1; } }
.rc-tools .icon-btn { background: rgba(15, 16, 32, 0.78); color: #e2e8f0; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.rc-tools .icon-btn:hover { background: rgba(15, 16, 32, 0.95); }

.empty-recent {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: 34px 20px; border-radius: 24px;
  border: 1.5px dashed var(--line-2); color: var(--muted);
}
.empty-recent p { margin: 8px 0 0; font-size: 16px; color: var(--text); font-weight: 650; }
.er-art { opacity: 0.85; }

.tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tip { display: flex; gap: 12px; padding: 16px; border-radius: 18px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.tip-ic {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(34, 211, 238, 0.12); color: var(--accent-2);
}
.tip b { font-size: 15px; }
.tip p { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; }
.home-foot { text-align: center; color: var(--dim); font-size: 12.5px; padding-top: 6px; }

/* ------------------------------------------------------------ responsive */
.narrow-only { display: none !important; }
.xwide-only { display: none !important; }
@media (min-width: 1180px) {
  .xwide-only { display: flex !important; }
}
@media (max-width: 860px) {
  .wide-only { display: none !important; }
  .narrow-only { display: inline-flex !important; }
  .lbl-wide { display: none; }
  .btn.share-btn { padding: 0; width: 44px; }
  .stext { display: none; }
  .status-chip { padding: 0 10px; }
  .dlabel { display: none; }
  .title-text { max-width: 38vw; }
}
@media (max-width: 600px) {
  :root { --tool: 48px; }
  .topbar { top: calc(8px + var(--sat)); left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); gap: 6px; }
  .tb-group { min-height: 52px; padding: 4px; border-radius: 16px; gap: 2px; }
  .code-chip { display: none; }
  .title-chip { padding: 0 6px; font-size: 15px; }
  .title-text { max-width: 30vw; }
  .chip { padding: 0 8px; gap: 5px; }
  .devices-chip .avatars { display: none; }
  .toolbar {
    left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); transform: none;
    bottom: calc(8px + var(--sab));
    max-width: none;
    justify-content: space-between;
    padding: 5px; gap: 0;
    border-radius: 20px;
  }
  .tb-tools { flex: 4 1 0; justify-content: space-around; gap: 0; }
  .tb-tools .tool { flex: 1 1 0; max-width: 56px; width: auto; }
  .tb-sep { margin: 0 2px; height: 26px; }
  .toolbar > .tool { flex: 1 1 0; max-width: 56px; width: auto; }
  .zoom-pill { bottom: calc(76px + var(--sab)); left: calc(8px + var(--sal)); padding: 2px; border-radius: 12px; }
  .zoom-pct { height: 32px; line-height: 32px; min-width: 52px; font-size: 12.5px; }
  .toasts { bottom: calc(124px + var(--sab)); }
  .share { grid-template-columns: 1fr; justify-items: center; gap: 16px; }
  .share-side { width: 100%; align-items: stretch; }
  .code-big, [dir="rtl"] .code-big { justify-content: center; }
  .code-big span { width: 44px; height: 56px; font-size: 30px; }
  .share-actions .btn { flex: 1; }
  .shortcuts { grid-template-columns: 1fr; }
  .home-actions { grid-template-columns: minmax(0, 1fr); }
  .install-btn .ib-t { display: none; }
  .install-btn { width: 44px; padding: 0; }
  .big-action { min-height: 96px; }
  .tips { grid-template-columns: 1fr; }
  .recent-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .rc-meta { padding: 8px 10px 10px; }
  .rc-meta b { font-size: 14px; }
  .brand small { display: none; }
  .install-btn span, .install-btn { font-size: 13px; }
  .modal-card { padding: 16px; border-radius: 20px; }
  .tv-corner { padding: 10px; gap: 10px; }
}
@media (max-width: 380px) {
  .tb-sep { display: none; }
  .title-text { max-width: 24vw; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .tb-group { min-height: 48px; }
  .toolbar { bottom: calc(6px + var(--sab)); }
}
@media (max-width: 760px) {
  .tvw-card { flex-direction: column; gap: 4vmin; text-align: center; }
  .tvw-code, [dir="rtl"] .tvw-code { justify-content: center; }
  .tvw-url, [dir="rtl"] .tvw-url { text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* fullscreen: hide nothing, but give the canvas the whole screen including notch areas */
.board.is-fs .topbar { top: calc(8px + var(--sat)); }
