:root {
  --ink: #15141c;
  --ink-2: #5b5a6b;
  --ink-3: #8b8a9c;
  --line: rgba(21, 20, 28, .08);
  --paper: #f3f2f7;
  --card: #ffffff;
  --accent: #ff5a36;
  --accent-2: #ff8a5c;
  --accent-soft: rgba(255, 90, 54, .12);

  /* glass */
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-edge: rgba(255, 255, 255, .85);
  --glass-blur: blur(22px) saturate(160%);
  --hover: rgba(21, 20, 28, .06);

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 1px rgba(30, 24, 60, .04), 0 8px 24px rgba(30, 24, 60, .08), 0 24px 60px rgba(30, 24, 60, .06);
  --shadow-lift: 0 2px 2px rgba(30, 24, 60, .05), 0 16px 40px rgba(30, 24, 60, .14), 0 40px 90px rgba(30, 24, 60, .10);
  --font: "Inter Tight", "Rubik", "Segoe UI", "Heebo", "Arial Hebrew", Arial, system-ui, sans-serif; /* Rubik covers Hebrew text on boards */

  --bg-gradient:
    radial-gradient(60vw 60vw at 92% -10%, rgba(196, 181, 253, .55), transparent 60%),
    radial-gradient(55vw 55vw at -10% 30%, rgba(167, 243, 208, .55), transparent 60%),
    radial-gradient(50vw 50vw at 70% 110%, rgba(254, 205, 170, .65), transparent 60%),
    radial-gradient(40vw 40vw at 30% 80%, rgba(191, 219, 254, .55), transparent 60%),
    linear-gradient(180deg, #f6f4fb, #eef1f7);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: var(--font); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
button { font-family: inherit; }
.hidden { display: none !important; }

/* ---------- glass surface ---------- */
.glass, .panel, .dialog, .board-card, .login-box {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .9);
}

/* ---------- buttons ---------- */
.btn { border: 1px solid rgba(21, 20, 28, .1); background: rgba(255, 255, 255, .55); color: var(--ink); border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: background .15s, border-color .15s, transform .15s, box-shadow .15s; }
.btn:hover { background: rgba(255, 255, 255, .95); border-color: rgba(21, 20, 28, .18); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 6px 18px rgba(21, 20, 28, .22); }
.btn.primary:hover { background: #2a2834; }
.btn.danger { color: #c62828; }
.btn.primary.danger-fill { background: #d93025; border-color: #d93025; color: #fff; box-shadow: 0 6px 18px rgba(217, 48, 37, .3); }
.btn.primary.danger-fill:hover { background: #b9271d; }
.btn.danger:hover { background: rgba(198, 40, 40, .08); border-color: rgba(198, 40, 40, .25); }
.icon-btn { width: 38px; height: 38px; border: 0; background: transparent; border-radius: 12px; cursor: pointer; display: grid; place-items: center; color: var(--ink); font-size: 16px; font-weight: 600; transition: background .15s; }
.icon-btn:hover { background: var(--hover); }
.icon-btn.active { background: var(--ink); color: #fff; box-shadow: 0 4px 12px rgba(21, 20, 28, .25); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- home ---------- */
/* height: auto so the background covers the whole page, not just the first screen */
body.home { height: auto; min-height: 100%; background: var(--bg-gradient); background-attachment: fixed; }
/* home header: no bar, just the logo on one side and the New board button on the other */
.home-header { position: relative; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 auto; padding: 14px 0 0; width: min(1200px, calc(100% - 32px)); }
.brand-logo { height: 26px; width: auto; flex: none; display: block; }
.title-panel .brand-logo { height: 20px; }
.brand { font-weight: 700; font-size: 17px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; direction: ltr; }
.brand-dot { width: 14px; height: 14px; border-radius: 5px; background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 0 2px 8px rgba(255, 90, 54, .45); flex: none; }
.home-main { padding: 56px 16px 80px; width: min(1200px, calc(100% - 32px)); margin: 0 auto; padding-inline: 0; }
.hero { margin-bottom: 40px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .5); border: 1px solid var(--glass-edge); margin-bottom: 18px; }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #2bb673; box-shadow: 0 0 0 3px rgba(43, 182, 115, .18); }
.hero h1 { font-size: clamp(40px, 7vw, 76px); line-height: .98; font-weight: 800; letter-spacing: -.035em; margin: 0 0 14px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent), #c06bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 17px; color: var(--ink-2); margin: 0; max-width: 520px; line-height: 1.55; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 16px; }
.section-tools { display: flex; align-items: center; gap: 14px; flex: none; }
/* folder tabs on the home page */
.folder-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.ftab { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; background: transparent; border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.ftab svg { width: 16px; height: 16px; }
.ftab i { font-style: normal; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.ftab:hover { background: rgba(255, 255, 255, .6); color: var(--ink); }
.ftab.on { background: rgba(255, 255, 255, .85); border-color: var(--glass-edge); color: var(--ink); box-shadow: var(--shadow); }
.ftab.drop { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.ftab-new { color: var(--ink-3); font-weight: 500; }
.fmenu-wrap { position: relative; display: inline-flex; }
.ftab-more { width: 30px; height: 30px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font-size: 18px; cursor: pointer; }
.ftab-more:hover { background: rgba(255, 255, 255, .6); }
.card-menu.fmenu { top: 36px; bottom: auto; left: 0; right: auto; }
.menu-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 8px 12px 2px; border-top: 1px solid rgba(21, 20, 28, .08); margin-top: 4px; }
.board-card.dragging { opacity: .5; }
.section-head h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin: 0; }
.section-head .count { font-size: 13px; color: var(--ink-3); }

.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.board-card { --t1: #c4b5fd; --t2: #a7f3d0; border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 6px; transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s; }
.board-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift), inset 0 1px 0 rgba(255, 255, 255, .9); }
.board-card:nth-child(6n+2) { --t1: #fecdaa; --t2: #fda4af; }
.board-card:nth-child(6n+3) { --t1: #bfdbfe; --t2: #c4b5fd; }
.board-card:nth-child(6n+4) { --t1: #a7f3d0; --t2: #bfdbfe; }
.board-card:nth-child(6n+5) { --t1: #fde68a; --t2: #fecdaa; }
.board-card:nth-child(6n+6) { --t1: #f5d0fe; --t2: #a5b4fc; }
.board-card .thumb { position: relative; height: 150px; border-radius: 16px; cursor: pointer; overflow: hidden; display: flex; align-items: flex-end; padding: 14px; color: rgba(21, 20, 28, .7); font-size: 13px; font-weight: 500;
  background:
    radial-gradient(rgba(255, 255, 255, .7) 1.2px, transparent 1.4px) 0 0/16px 16px,
    radial-gradient(120% 120% at 100% 0%, var(--t1), transparent 60%),
    radial-gradient(120% 120% at 0% 100%, var(--t2), transparent 60%),
    #f7f6fb; }
.board-card .thumb .mini { position: absolute; top: 0; left: 0; transform-origin: 0 0; opacity: 0; transition: opacity .35s; pointer-events: none; direction: ltr; }
.board-card .thumb.has-mini .mini { opacity: 1; }
.board-card .thumb.is-empty::before { content: attr(data-label); position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-size: 13px; }
.mini-item { position: absolute; overflow: hidden; }
.mini-item img, .mini-item video { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 4px; }
.mini-image, .mini-video { border-radius: 4px; background: #e9e9ee; }
.mini-video { background: #1d1c24; }
.mini-note { padding: 18px; line-height: 1.35; white-space: pre-wrap; unicode-bidi: plaintext; }
.mini-text { font-weight: 600; line-height: 1.2; white-space: pre-wrap; unicode-bidi: plaintext; overflow: visible; }
.mini-frame { border-radius: 18px; border: 2px solid rgba(21, 20, 28, .08); box-shadow: 0 10px 40px rgba(30, 24, 60, .12); }
.mini-link { background: #fff; border-radius: 18px; padding: 16px; font-size: 18px; font-weight: 700; }
.board-card .thumb::after { content: "↗"; position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .7); border: 1px solid var(--glass-edge); font-size: 15px; opacity: 0; transform: translate(-4px, 4px); transition: opacity .2s, transform .2s; }
.board-card:hover .thumb::after { opacity: 1; transform: none; }
.board-card .card-foot { position: relative; display: flex; align-items: flex-start; gap: 6px; padding: 10px 2px 2px 6px; }
.board-card .card-text { flex: 1; min-width: 0; }
.board-card .name { font-weight: 700; font-size: 22px; letter-spacing: -.02em; unicode-bidi: plaintext; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-card .when { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.card-more { flex: none; width: 36px; height: 36px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); font-size: 20px; line-height: 1; cursor: pointer; }
.card-more:hover { background: var(--hover); color: var(--ink); }
.card-menu { position: absolute; right: 0; bottom: 44px; z-index: 5; min-width: 210px; padding: 6px; border-radius: 14px; background: rgba(255, 255, 255, .97); box-shadow: var(--shadow-lift); display: flex; flex-direction: column; }
.card-menu.hidden { display: none; }
.card-menu button { display: flex; align-items: baseline; gap: 6px; border: 0; background: transparent; text-align: left; padding: 9px 12px; border-radius: 9px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.card-menu button small { color: var(--ink-3); font-size: 12px; }
.card-menu button:hover { background: var(--hover); }
.card-menu button.danger { color: #e2462a; }
.empty-state { text-align: center; padding: 80px 20px; color: var(--ink-2); border-radius: var(--radius); background: rgba(255, 255, 255, .4); border: 1px dashed rgba(21, 20, 28, .15); }

/* ---------- login ---------- */
body.login { background: var(--bg-gradient); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; padding: 32px 28px; border-radius: var(--radius); }
.login-box h1 { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 0; line-height: 1.05; }
.login-box .sub { color: var(--ink-2); font-size: 15px; margin-bottom: 6px; }
.login-box input { font: inherit; font-size: 15px; padding: 12px 16px; border: 1px solid rgba(21, 20, 28, .12); border-radius: 14px; background: rgba(255, 255, 255, .7); direction: ltr; text-align: left; outline: none; transition: border-color .15s, box-shadow .15s; }
.login-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.login-box .btn { justify-content: center; padding: 12px; font-size: 15px; }
.login-err { color: #c0392b; min-height: 1.2em; font-size: 14px; }

/* ---------- board chrome ---------- */
body.board { overflow: hidden; touch-action: none; }
.topbar { position: fixed; top: 14px; right: 14px; left: 14px; height: 54px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; z-index: 20; }
.topbar > * { pointer-events: auto; }
.panel { border-radius: 18px; display: flex; align-items: center; gap: 4px; padding: 6px; }
.title-panel { padding: 6px 14px 6px 8px; gap: 10px; }
.title-panel a { color: inherit; text-decoration: none; display: flex; align-items: center; padding: 8px; border-radius: 10px; }
.title-panel a:hover { background: var(--hover); }
.title-panel .home-link { gap: 4px; padding: 7px 10px 7px 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.title-panel .home-link:hover { color: var(--ink); }
.title-panel .home-link svg { width: 18px; height: 18px; }
.title-sep { width: 1px; height: 20px; background: rgba(21, 20, 28, .12); flex: none; }
.view-brand { display: none; }
.mode-view .view-brand { display: block; margin-left: 6px; }
.board-name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; outline: none; padding: 4px 8px; border-radius: 8px; min-width: 40px; unicode-bidi: plaintext; }
.board-name[contenteditable="true"]:hover, .board-name:focus { background: var(--hover); }
.badge { white-space: nowrap; font-size: 12px; background: var(--accent-soft); color: var(--accent); padding: 4px 10px; border-radius: 99px; font-weight: 600; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #bbb; flex: none; }
.status-dot.on { background: #2bb673; box-shadow: 0 0 0 3px rgba(43, 182, 115, .18); }
.people { display: flex; gap: 0; padding: 0 8px; }
.person.me { cursor: pointer; }
.person { width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; margin-inline-start: -8px; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }

.toolbar { position: fixed; top: 50%; left: 14px; transform: translateY(-50%); flex-direction: column; z-index: 20; }
.toolbar .sep { width: 22px; height: 1px; background: var(--line); margin: 4px 0; }

.zoombar { position: fixed; bottom: 14px; right: 14px; z-index: 20; }
.zoom-label { min-width: 54px; text-align: center; font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums; }

/* floating toolbar: placed next to the selection by the board script */
.selbar { position: fixed; top: 0; left: 0; z-index: 22; padding: 4px; gap: 2px; border-radius: 13px; transition: opacity .12s; }
.selbar.busy { opacity: 0; pointer-events: none; }
.selbar .icon-btn { width: 32px; height: 32px; border-radius: 9px; }
.selbar .icon-btn svg { width: 18px; height: 18px; }
.selbar .icon-btn.active-soft { background: var(--hover); box-shadow: inset 0 0 0 1.5px rgba(21, 20, 28, .55); }
.selbar .btn { border: 0; background: transparent; padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.selbar .btn:hover, .selbar .btn.on { background: var(--hover); }
.selbar .vsep { width: 1px; height: 20px; background: var(--line); margin: 0 3px; flex: none; }
.selbar .size-dot { width: 28px; height: 28px; }
.selbar .sel-input { margin: 0; padding: 5px 8px; border-radius: 9px; border-color: transparent; background: transparent; cursor: pointer; }
.selbar .sel-input:hover { background: var(--hover); }
.selbar .fs-sel { width: 58px; font-variant-numeric: tabular-nums; }
.bold-b { font-size: 15px; font-weight: 800; }
.cwrap { position: relative; display: flex; }
.cbtn i { display: block; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(21, 20, 28, .2); }
.cbtn i.clear, .swatch.clear { background: linear-gradient(135deg, #fff 45%, #e53935 45% 55%, #fff 55%) !important; }
.cpop { position: absolute; top: calc(100% + 8px); left: -4px; display: grid; grid-template-columns: repeat(5, 28px); gap: 6px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, .94); }
.cpop .swatch { width: 26px; height: 26px; margin: 0; }
.cpop .swatch.on { box-shadow: 0 0 0 2px var(--ink); }

/* right-click menu */
.ctxmenu { position: fixed; z-index: 60; flex-direction: column; align-items: stretch; gap: 0; min-width: 220px; padding: 5px; border-radius: 13px; background: var(--glass-strong); }
.ctxmenu button { display: flex; justify-content: space-between; align-items: center; gap: 28px; border: 0; background: transparent; padding: 7px 10px; border-radius: 8px; font-size: 13px; color: var(--ink); text-align: left; cursor: pointer; }
.ctxmenu button:hover { background: var(--hover); }
.ctxmenu kbd { font: inherit; font-size: 12px; color: var(--ink-3); }
.ctxmenu .danger { color: #d93025; }
.ctxmenu .danger:hover { background: rgba(217, 48, 37, .08); }
.ctxmenu hr { border: 0; height: 1px; background: var(--line); margin: 4px 6px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line), 0 2px 6px rgba(0, 0, 0, .1); cursor: pointer; margin: 0 2px; transition: transform .15s; }
.swatch:hover { transform: scale(1.12); }

/* ---------- canvas ---------- */
/* the board script resizes #viewport's background for zoom, so the soft tint lives on body */
body.board { background:
    radial-gradient(70vw 70vw at 100% 0%, rgba(196, 181, 253, .28), transparent 60%),
    radial-gradient(70vw 70vw at 0% 100%, rgba(254, 205, 170, .32), transparent 60%),
    radial-gradient(50vw 50vw at 10% 10%, rgba(167, 243, 208, .22), transparent 60%),
    var(--paper); }
#viewport { position: fixed; inset: 0; overflow: hidden; cursor: default; background-color: transparent;
  background-image: radial-gradient(rgba(21, 20, 28, .16) 1.2px, transparent 1.2px); }
#viewport.panning, #viewport.space { cursor: grab; }
#viewport.panning:active { cursor: grabbing; }
#viewport.tool-note, #viewport.tool-text, #viewport.tool-frame { cursor: crosshair; }
#world { position: absolute; left: 0; top: 0; transform-origin: 0 0; --inv: 1; }

.item { position: absolute; user-select: none; -webkit-user-select: none; }
.item.selected { outline: calc(2px * var(--inv)) solid var(--accent); outline-offset: calc(3px * var(--inv)); }
.item .content { width: 100%; height: 100%; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; outline: none; unicode-bidi: plaintext; }
.item .content[contenteditable="true"] { user-select: text; -webkit-user-select: text; cursor: text; }

/* sticky note with its top-right corner folded down: the corner is cut out of the background
   and the flap (a darker triangle) sits in its place. --nc is the note colour, --fold the size. */
.item.note { --fold: 16px; padding: .75em; border-radius: 4px; font-size: 22px; line-height: 1.35; overflow: hidden;
  background: linear-gradient(225deg, transparent calc(var(--fold) * .7071), var(--nc, #fff6a8) calc(var(--fold) * .7071));
  filter: drop-shadow(0 0 .6px rgba(21, 20, 28, .3)); }
.item.note::after { content: ""; position: absolute; top: 0; right: 0; width: var(--fold); height: var(--fold); pointer-events: none; border-bottom-left-radius: 2px;
  background: linear-gradient(to bottom left, transparent 50%, rgba(21, 20, 28, .14) 50%), linear-gradient(to bottom left, transparent 50%, var(--nc, #fff6a8) 50%);
  filter: drop-shadow(-1px 1px 1px rgba(21, 20, 28, .12)); }
.item.note .content { height: auto; min-height: 1.35em; }
.item.text { line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
.item.text .content { min-height: 1.2em; }
.item.frame { border: calc(1.5px * var(--inv)) solid rgba(21, 20, 28, .1); border-radius: 18px; background: rgba(255, 255, 255, .35); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8); }
.item.frame .frame-title { position: absolute; bottom: 100%; right: 0; left: 0; margin-bottom: calc(8px * var(--inv)); font-size: calc(16px * var(--inv)); font-weight: 700; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: auto; }
/* storyboard: title + grid of panels (image with a description under it). The sizes match SB in shared/storyboard.js */
/* --k scales the whole storyboard (corner handles); --u is one board pixel at that scale */
.item.storyboard { --k: 1; --u: calc(1px * var(--k)); background: #fff; border-radius: calc(14 * var(--u)); padding: calc(20 * var(--u)); box-sizing: border-box; box-shadow: 0 0 0 1px rgba(21, 20, 28, .1), 0 8px 30px rgba(30, 24, 60, .08); color: var(--ink); }
.item.storyboard.sb-hot { box-shadow: 0 0 0 3px var(--accent), 0 8px 30px rgba(30, 24, 60, .12); }
.sb-head { height: calc(52 * var(--u)); overflow: hidden; display: flex; align-items: flex-start; gap: calc(12 * var(--u)); }
.item.storyboard .sb-title { display: block; flex: 0 1 auto; width: auto; height: auto; min-width: calc(60 * var(--u)); font-size: calc(26 * var(--u)); font-weight: 700; letter-spacing: -.01em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item.storyboard.selected .sb-title { cursor: text; }
.item.storyboard .sb-title[contenteditable="true"] { background: #fff8dc; border-radius: 4px; text-overflow: clip; }
.sb-pdf { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: calc(6 * var(--u)); height: calc(32 * var(--u)); padding: 0 calc(12 * var(--u)); border-radius: calc(8 * var(--u)); font-size: calc(14 * var(--u)); font-weight: 600; color: var(--ink); text-decoration: none; background: #f1f1f5; cursor: pointer; }
.sb-pdf:hover { background: var(--accent); color: #fff; }
.sb-pdf svg { width: calc(16 * var(--u)); height: calc(16 * var(--u)); }
.mode-edit .item.storyboard:not(:hover):not(.selected) .sb-pdf { opacity: 0; }
.sb-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: calc(16 * var(--u)); }
.sb-panel { position: relative; min-width: 0; --bu: min(calc(1px * var(--inv, 1)), calc(2 * var(--u))); } /* --bu: the corner buttons stay one screen size at any zoom, but never outgrow a far-away panel */
.sb-panel.dragging { opacity: .3; }
.sb-media { position: relative; aspect-ratio: var(--ar, 1.7778); background: #eeeef2; border-radius: calc(6 * var(--u)); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(21, 20, 28, .1); }
.sb-media img, .sb-media video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; pointer-events: none; }
.item.storyboard.sb-contain .sb-media img, .item.storyboard.sb-contain .sb-media video { object-fit: contain; }
.sb-num { position: absolute; left: calc(8 * var(--bu)); top: calc(8 * var(--bu)); z-index: 1; min-width: calc(26 * var(--bu)); height: calc(26 * var(--bu)); padding: 0 calc(8 * var(--bu)); box-sizing: border-box; border-radius: 99px; background: rgba(22, 22, 26, .78); color: #fff; font-size: calc(13 * var(--bu)); font-weight: 700; line-height: calc(26 * var(--bu)); text-align: center; }
.sb-empty { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: calc(6 * var(--u)); color: #8a8a96; font-size: calc(14 * var(--u)); }
.sb-empty .ui-ico { width: calc(34 * var(--u)); height: calc(34 * var(--u)); opacity: .7; }
.sb-panel.empty .sb-empty { display: flex; }
/* quick buttons in the panel's corner: remove (×) and more options (⋯), on hover */
.sb-x, .sb-more { position: absolute; top: calc(6 * var(--bu)); z-index: 1; width: calc(30 * var(--bu)); height: calc(30 * var(--bu)); border: 0; border-radius: calc(8 * var(--bu)); background: rgba(255, 255, 255, .94); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); display: none; place-items: center; cursor: pointer; padding: 0; color: var(--ink); }
.sb-x { right: calc(6 * var(--bu)); }
.sb-more { right: calc(42 * var(--bu)); }
.sb-x .ui-ico, .sb-more .ui-ico { width: calc(18 * var(--bu)); height: calc(18 * var(--bu)); }
.sb-x:hover { background: #fff; color: #e2462a; }
.mode-edit .sb-panel:hover :is(.sb-x, .sb-more) { display: grid; }
.item.storyboard.selected .sb-media { cursor: grab; }
.item.storyboard.selected .sb-panel.empty .sb-media { cursor: pointer; }
.sb-cap { min-height: calc(62 * var(--u)); box-sizing: border-box; padding: calc(8 * var(--u)) calc(2 * var(--u)) calc(4 * var(--u)); font-size: calc(15 * var(--u)); line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; outline: none; unicode-bidi: plaintext; }
.mode-edit .sb-cap:empty::before { content: "Add a description…"; color: #a5a5b0; }
.item.storyboard.selected .sb-cap { cursor: text; }
.sb-cap[contenteditable="true"] { user-select: text; -webkit-user-select: text; background: #fff8dc; border-radius: 4px; box-shadow: 0 0 0 2px #fff8dc; }
.sb-cap[contenteditable="true"]:empty::before { content: ""; }
.sb-add { aspect-ratio: var(--ar, 1.7778); border: calc(2 * var(--u)) dashed rgba(21, 20, 28, .16); border-radius: calc(6 * var(--u)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(2 * var(--u)); color: #8a8a96; font-size: calc(14 * var(--u)); cursor: pointer; box-sizing: border-box; }
.sb-add b { font-size: calc(34 * var(--u)); font-weight: 400; line-height: 1; }
.sb-add:hover { border-color: var(--accent); color: var(--accent); }
.mode-view .sb-add, .mode-view .sb-more, .mode-view .sb-x, .mode-view .sb-empty { display: none !important; }
.sb-panel.drop-before::before, .sb-panel.drop-after::after { content: ""; position: absolute; top: 0; bottom: 0; width: 4px; border-radius: 2px; background: var(--accent); z-index: 2; }
.sb-panel.drop-before::before { left: -10px; }
.sb-panel.drop-after::after { right: -10px; }
.sb-panel.drop-into .sb-media { box-shadow: inset 0 0 0 4px var(--accent); }
.sb-ghost { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; border-radius: 8px; opacity: .92; box-shadow: 0 14px 34px rgba(0, 0, 0, .28); }
.sb-ghost :is(.sb-x, .sb-more, .sb-ver) { display: none !important; }
/* versions: a badge in the panel's corner when it has more than one, and the strip it opens */
.sb-ver { position: absolute; right: calc(6 * var(--bu)); bottom: calc(6 * var(--bu)); z-index: 1; height: calc(24 * var(--bu)); padding: 0 calc(8 * var(--bu)); border: 0; border-radius: 99px; background: rgba(22, 22, 26, .8); color: #fff; font-family: inherit; font-weight: 700; font-size: calc(12 * var(--bu)); line-height: calc(24 * var(--bu)); white-space: nowrap; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.sb-ver:hover { background: var(--accent); }
/* a panel with versions: one card peeks out behind it, turned a little, no outline */
.sb-peek { position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: var(--ar, 1.7778); border-radius: calc(6 * var(--u)); background: #ececf0; box-shadow: 0 calc(1 * var(--u)) calc(4 * var(--u)) rgba(20, 20, 40, .1); transform: rotate(1.6deg); transform-origin: 50% 50%; display: none; pointer-events: none; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.mode-edit .sb-panel.has-vers .sb-peek { display: block; }
.mode-edit .sb-panel.has-vers:hover .sb-peek { transform: rotate(3deg); }
.sb-ghost .sb-peek { display: none !important; }
/* the versions fanned out like a hand of cards */
.ver-fan { position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; }
.fan-card { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; border-radius: 10px; overflow: hidden; background: #eeeef2;
  box-shadow: 0 10px 28px rgba(20, 20, 40, .22), 0 2px 6px rgba(20, 20, 40, .12);
  transform: translate(var(--x), var(--y)) rotate(var(--r)); transform-origin: 50% 100%; transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s; }
.fan-card:hover { transform: translate(var(--x), calc(var(--y) - 14px)) rotate(0deg) scale(1.06); z-index: 9; box-shadow: 0 18px 40px rgba(20, 20, 40, .3), 0 3px 8px rgba(20, 20, 40, .14); }
.fan-card.on { box-shadow: 0 0 0 3px var(--accent), 0 10px 28px rgba(20, 20, 40, .22); }
.fan-card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.fan-card .vs-n { position: absolute; left: 7px; bottom: 7px; padding: 2px 7px; border-radius: 99px; background: rgba(22, 22, 26, .78); color: #fff; font-size: 11px; font-weight: 700; }
.fan-card .vs-x { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; border: 0; border-radius: 7px; padding: 0; background: rgba(255, 255, 255, .94); display: none; place-items: center; cursor: pointer; color: var(--ink); }
.fan-card .vs-x .ui-ico { width: 15px; height: 15px; }
.fan-card .vs-x:hover { color: #e2462a; }
.fan-card:hover .vs-x { display: grid; }
.sb-ver[hidden], .mode-view .sb-ver { display: none !important; }
/* font picker in the floating bar */
.fwrap { position: relative; }
.font-btn { max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 5; width: 260px; padding: 8px; display: flex; flex-direction: column; gap: 6px; background: rgba(255, 255, 255, .97); }
.fsearch { border: 1px solid rgba(21, 20, 28, .12); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13px; outline: none; }
.fsearch:focus { border-color: var(--accent); }
.flist { max-height: 300px; overflow: auto; display: flex; flex-direction: column; }
.fitem { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; text-align: left; padding: 7px 10px; border-radius: 8px; font-size: 17px; cursor: pointer; color: var(--ink); }
.fitem:hover { background: var(--hover); }
.fitem.on { background: var(--accent-soft); color: var(--accent); }
.fitem.fother { font-size: 13px; font-family: inherit; color: var(--accent); }
.fitem.hidden { display: none; }
.fhe { margin-left: auto; font-family: Rubik, sans-serif; font-size: 11px; color: var(--ink-3); border: 1px solid rgba(21, 20, 28, .12); border-radius: 6px; padding: 1px 5px; }
.item.image img, .item.video video { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 8px; pointer-events: none; background: #e9e9ee; }
.item.video .play { position: absolute; left: 50%; top: 50%; width: min(calc(56px * var(--inv)), 22%); aspect-ratio: 1; height: auto; transform: translate(-50%, -50%); border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 0; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .35); background: rgba(20, 20, 26, .45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='white'/%3E%3C/svg%3E") center/45% no-repeat; pointer-events: auto; cursor: pointer; }
.item.video.playing .play { opacity: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 5h4v14H7zM13 5h4v14h-4z' fill='white'/%3E%3C/svg%3E"); }
.item.video.playing:hover .play { opacity: 1; }
/* video card chrome: sized in screen pixels via scale(var(--inv)) */
.item.video .vchrome { position: absolute; left: 0; top: 0; width: calc(100% / var(--inv)); height: calc(100% / var(--inv)); transform: scale(var(--inv)); transform-origin: 0 0; border-radius: 8px; overflow: hidden; pointer-events: none; color: #fff; font-size: 13px; }
.vchrome .vtop, .vchrome .vbottom { position: absolute; left: 0; right: 0; display: flex; gap: 10px; padding: 12px; opacity: 0; transition: opacity .2s; }
.vchrome .vtop { top: 0; align-items: flex-start; justify-content: space-between; background: linear-gradient(180deg, rgba(10, 10, 16, .72), rgba(10, 10, 16, 0)); padding-bottom: 36px; }
.vchrome .vbottom { bottom: 0; align-items: center; background: linear-gradient(0deg, rgba(10, 10, 16, .72), rgba(10, 10, 16, 0)); padding-top: 32px; }
.item.video:hover .vtop, .item.video:hover .vbottom, .item.video.selected .vtop, .item.video.selected .vbottom { opacity: 1; }
.vchrome .vtop > *, .vchrome .vbottom > * { pointer-events: auto; }
.vchrome .vinfo { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.vchrome .vsrc { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: 4px 9px 4px 7px; border-radius: 999px; background: rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .2); }
.vchrome .vsrc-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.vchrome .vsrc[data-kind="dropbox"] .vsrc-dot { background: #4f8cff; box-shadow: 0 0 0 2px rgba(79, 140, 255, .3); }
.vchrome .vsrc[data-kind="upload"] .vsrc-dot { background: #2bb673; box-shadow: 0 0 0 2px rgba(43, 182, 115, .3); }
.vchrome .vname { font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; text-shadow: 0 1px 6px rgba(0, 0, 0, .35); }
.vchrome .vmeta { display: flex; gap: 8px; font-size: 12px; color: rgba(255, 255, 255, .75); font-variant-numeric: tabular-nums; }
.vchrome .vmeta span:empty { display: none; }
.vchrome .vmeta span + span::before { content: "·"; margin-right: 8px; }
.vchrome .vbtns { display: flex; gap: 6px; flex: none; }
.vchrome button, .vchrome .vbtns a { width: 32px; height: 32px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; transition: background .15s, transform .15s; }
.vchrome button:hover, .vchrome .vbtns a:hover { background: rgba(255, 255, 255, .3); }
.vchrome button:active { transform: scale(.94); }
.vchrome svg { width: 17px; height: 17px; }
.vchrome .vplay { width: 36px; height: 36px; border-radius: 50%; background: #fff; color: var(--ink); border: 0; }
.vchrome .vplay:hover { background: #fff; transform: scale(1.06); }
.vchrome .vplay svg { width: 15px; height: 15px; }
.vchrome .vbar { position: relative; flex: 1; height: 18px; cursor: pointer; }
.vchrome .vbar::before, .vchrome .vbuf, .vchrome .vfill { content: ""; position: absolute; left: 0; top: 7px; height: 4px; border-radius: 4px; }
.vchrome .vbar::before { right: 0; background: rgba(255, 255, 255, .22); }
.vchrome .vbuf { width: 0; background: rgba(255, 255, 255, .35); }
.vchrome .vfill { width: 0; background: #fff; }
.vchrome .vfill::after { content: ""; position: absolute; right: -6px; top: -4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); opacity: 0; transition: opacity .15s; }
.vchrome .vbar:hover .vfill::after { opacity: 1; }
.vchrome .vtime { font-size: 12px; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .85); white-space: nowrap; }
/* the big centre button only while paused; controls take over while playing */
.item.video.playing .play { display: none; }
.item.video.vtiny .vchrome, .item.video.broken .vchrome { display: none; }
.item.video .vfail { display: none; }
.item.video.broken .play { display: none; }
.item.video.broken .vfail { display: grid; place-items: center; position: absolute; inset: 0; padding: calc(16px * var(--inv)); border-radius: 8px; background: #1d1c24; color: #fff; text-align: center; font-size: calc(14px * var(--inv)); font-weight: 500; text-decoration: none; }
.item.link { background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: 1px solid rgba(21, 20, 28, .08); border-radius: 18px; padding: 16px 18px; display: flex; flex-direction: column; justify-content: center; gap: 4px; overflow: hidden; }
.item.link .domain { font-size: 13px; color: var(--accent); font-weight: 600; direction: ltr; text-align: left; }
.item.link .url { font-size: 14px; color: var(--ink-2); direction: ltr; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item.link .ltitle { font-size: 18px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.item.link .lthumb { display: none; }
.item.link .ltext { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.item.link .ltext .domain { order: 2; }
.item.link .ltext .url { order: 3; }
/* thumbnail card: the preview image fills the card, text sits on a soft shade at the bottom */
.item.link.has-thumb { padding: 0; justify-content: flex-end; border: 0; background: #e9e9ee; border-radius: 14px; }
.item.link.has-thumb .lthumb { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.item.link.has-thumb .ltext { position: relative; padding: 40px 16px 14px; background: linear-gradient(0deg, rgba(10, 10, 16, .72), rgba(10, 10, 16, 0)); color: #fff; }
.item.link.has-thumb .ltitle { color: #fff; font-size: 16px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-shadow: 0 1px 6px rgba(0, 0, 0, .3); }
.item.link.has-thumb .ltext .domain { order: 0; color: rgba(255, 255, 255, .85); font-size: 12px; }
.item.link.has-thumb .url { display: none; }
/* video platform cards: play button on the thumbnail, inline player on demand */
/* a card for a video in the review system: a Review tag, and a play button on the still */
/* What kind of card it is, said loudly: a tag in the corner (Link / Video / Video review) and a big
   Open button. They keep a readable size on screen when zoomed out (--k grows up to 3×). */
.item.link, .item.video { --k: min(var(--inv), 3); }
.item.link .ktag { display: none; position: absolute; z-index: 3; top: calc(12px * var(--k)); left: calc(12px * var(--k)); width: calc(36px * var(--k)); height: calc(36px * var(--k)); border-radius: 50%; place-items: center; color: #fff; text-decoration: none; background: rgba(21, 20, 28, .86); box-shadow: 0 calc(4px * var(--k)) calc(14px * var(--k)) rgba(0, 0, 0, .3); cursor: pointer; transition: transform .15s, box-shadow .15s; }
.item.link .ktag svg { width: calc(17px * var(--k)); height: calc(17px * var(--k)); flex: none; }
.item.link .ktag:hover { transform: scale(1.1); box-shadow: 0 calc(6px * var(--k)) calc(18px * var(--k)) rgba(0, 0, 0, .38); }
.item.link.has-thumb .ktag, .item.link.has-embed .ktag, .item.link.is-review .ktag { display: grid; }
.item.link .ktag[data-kind="link"] { background: #2f6fed; }
.item.link .ktag[data-kind="video"] { background: #e5322d; }
.item.link .ktag[data-kind="review"] { background: linear-gradient(135deg, #ff9a1f, #e0237a 55%, #7b3fe4); }
/* a plain link card (no picture): a big link sign on the left */
.item.link .lglyph { display: none; }
.item.link:not(.has-thumb):not(.has-embed):not(.is-review) { padding-left: calc(18px + 46px * var(--k)); }
.item.link:not(.has-thumb):not(.has-embed):not(.is-review) .lglyph { display: grid; place-items: center; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: calc(36px * var(--k)); height: calc(36px * var(--k)); border-radius: 50%; background: #2f6fed; color: #fff; box-shadow: 0 4px 12px rgba(47, 111, 237, .35); }
.item.link .lglyph svg { width: 55%; height: 55%; }
.item.link a.lglyph { cursor: pointer; transition: transform .15s; }
.item.link a.lglyph:hover { transform: translateY(-50%) scale(1.1); }
/* the review card: a frame in the logo's colours around the still, and a big play button */
.item.link.is-review { background: linear-gradient(135deg, #ff9a1f, #e0237a 55%, #7b3fe4); border: 0; box-shadow: 0 10px 30px rgba(123, 63, 228, .25); }
.item.link.is-review.has-thumb .lthumb { inset: calc(6px * var(--k)); width: calc(100% - 12px * var(--k)); height: calc(100% - 12px * var(--k)); border-radius: 10px; }
.item.link.is-review.has-thumb .ltext { margin: 0 calc(6px * var(--k)) calc(6px * var(--k)); border-radius: 0 0 10px 10px; }
.item.link.is-review:not(.has-thumb) { padding-top: calc(16px + 34px * var(--k)); color: #fff; }
.item.link.is-review:not(.has-thumb) .ltitle, .item.link.is-review:not(.has-thumb) .domain { color: #fff; }
.item.link .rvplay { display: none; }
.item.link.is-review.has-thumb .rvplay { display: grid; place-items: center; position: absolute; left: 50%; top: 45%; width: min(calc(64px * var(--k)), 26%); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--ink); box-shadow: 0 6px 20px rgba(0, 0, 0, .3); pointer-events: none; z-index: 2; }
.item.link.is-review .rvplay svg { width: 40%; height: 40%; margin-left: 8%; }
/* a video on the board: a VIDEO tag in the corner while its controls are hidden */
.item.video::after { content: ""; position: absolute; top: calc(12px * var(--k)); left: calc(12px * var(--k)); width: calc(36px * var(--k)); height: calc(36px * var(--k)); border-radius: 50%; background: #e5322d url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='%23fff'/%3E%3C/svg%3E") center / 47% no-repeat; pointer-events: none; box-shadow: 0 calc(4px * var(--k)) calc(14px * var(--k)) rgba(0, 0, 0, .3); transition: opacity .2s; }
/* the circle makes way for the player's own bar; when zoomed out that bar is hidden, so the circle stays */
.item.video:not(.vtiny):hover::after, .item.video:not(.vtiny).selected::after, .item.video.playing::after { opacity: 0; }
.item.link .eframe, .item.link .eplay, .item.link .echrome { display: none; }
.item.link.has-embed { background: #111015; }
.item.link.has-embed .eplay { display: grid; place-items: center; position: absolute; left: 50%; top: 50%; width: min(calc(64px * var(--inv)), 24%); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 1px solid rgba(255, 255, 255, .4); background: rgba(20, 20, 26, .5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; cursor: pointer; padding: 0; transition: transform .15s, background .15s; z-index: 2; }
.item.link.has-embed .eplay:hover { background: rgba(20, 20, 26, .7); transform: translate(-50%, -50%) scale(1.06); }
.item.link.has-embed .eplay svg { width: 42%; height: 42%; margin-left: 8%; }
.item.link.embedding { overflow: visible; } /* let the bar above the card show */
.item.link.embedding .eplay, .item.link.embedding .ltext, .item.link.embedding .lthumb, .item.link.embedding .ktag { display: none; }
.item.link.embedding .eframe { display: block; position: absolute; inset: 0; border-radius: inherit; overflow: hidden; background: #000; }
.item.link .eframe iframe { width: 100%; height: 100%; border: 0; display: block; }
/* bar above a playing card: drag here, stop, open at the source. Drawn at screen size. */
.item.link.embedding .echrome { display: block; position: absolute; left: 0; bottom: 100%; width: calc(100% / var(--inv)); transform: scale(var(--inv)); transform-origin: 0 100%; }
.echrome .ebar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; padding: 5px 5px 5px 12px; border-radius: 12px; background: rgba(21, 20, 28, .82); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #fff; font-size: 12px; cursor: grab; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.echrome .eprov { font-weight: 700; flex: none; }
.echrome .etitle { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: rgba(255, 255, 255, .75); }
.echrome button, .echrome a { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.echrome button:hover, .echrome a:hover { background: rgba(255, 255, 255, .25); }
.echrome svg { width: 15px; height: 15px; }

/* selection box with 8 resize handles, drawn at screen size */
#selbox { position: absolute; pointer-events: none; z-index: 2147483000; outline: calc(1.5px * var(--inv)) solid var(--accent); }
#world.sel-one .item.selected { outline: none; }
.sh { position: absolute; pointer-events: auto; width: calc(11px * var(--inv)); height: calc(11px * var(--inv)); transform: translate(-50%, -50%); background: #fff; border: calc(1.5px * var(--inv)) solid var(--accent); border-radius: calc(3px * var(--inv)); box-shadow: 0 1px calc(3px * var(--inv)) rgba(0, 0, 0, .18); }
.sh::before { content: ""; position: absolute; inset: calc(-7px * var(--inv)); } /* bigger hit area */
.sh-nw { left: 0; top: 0; cursor: nwse-resize; }
.sh-n  { left: 50%; top: 0; cursor: ns-resize; }
.sh-ne { left: 100%; top: 0; cursor: nesw-resize; }
.sh-e  { left: 100%; top: 50%; cursor: ew-resize; }
.sh-se { left: 100%; top: 100%; cursor: nwse-resize; }
.sh-s  { left: 50%; top: 100%; cursor: ns-resize; }
.sh-sw { left: 0; top: 100%; cursor: nesw-resize; }
.sh-w  { left: 0; top: 50%; cursor: ew-resize; }
/* side handles are slim pills */
.sh-n, .sh-s { width: calc(18px * var(--inv)); height: calc(7px * var(--inv)); border-radius: calc(4px * var(--inv)); }
.sh-e, .sh-w { width: calc(7px * var(--inv)); height: calc(18px * var(--inv)); border-radius: calc(4px * var(--inv)); }
#selbox[data-handles="corners"] :is(.sh-n, .sh-s, .sh-e, .sh-w) { display: none; }
#selbox[data-handles="text"] :is(.sh-n, .sh-s) { display: none; }
#selbox[data-handles="none"] .sh { display: none; }
/* locked: grey frame and a lock badge; group: dashed frame */
#selbox.locked { outline-color: #8a8a96; }
#selbox.locked::after { content: ""; position: absolute; right: 0; top: 0; width: 22px; height: 22px; transform: translate(50%, -50%) scale(var(--inv)); border-radius: 50%; background: #8a8a96 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linejoin='round'%3E%3Crect x='6' y='11' width='12' height='9' rx='2'/%3E%3Cpath d='M9 11V8a3 3 0 0 1 6 0v3'/%3E%3C/svg%3E") center / 13px no-repeat; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
#selbox.grouped { outline-style: dashed; }
.sel-note { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 8px; }
.size-tag { display: none; position: absolute; left: 50%; top: 100%; transform: translate(-50%, calc(12px * var(--inv))) scale(var(--inv)); transform-origin: 50% 0; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
#selbox.resizing .size-tag { display: block; }
/* ---------- pen drawing ---------- */
.item.draw { pointer-events: none; }
.item.draw svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.item.draw path { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.item.draw .dhit { stroke: transparent; stroke-width: calc(14px * var(--inv)); pointer-events: stroke; cursor: move; }
.item.draw.marker { mix-blend-mode: multiply; }
.item.draw.marker .dline { opacity: .5; stroke-linecap: square; }
#viewport.tool-eraser .item.draw .dhit { cursor: inherit; }
#inkLayer { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; z-index: 2147482000; }
#inkLayer path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
#inkLayer .ink-live.marker { opacity: .5; mix-blend-mode: multiply; stroke-linecap: square; }
#inkLayer .cprev { stroke: var(--accent); stroke-width: calc(2px * var(--inv)); stroke-dasharray: calc(6px * var(--inv)) calc(4px * var(--inv)); }

/* ---------- shapes ---------- */
.item.shape .sbg { position: absolute; inset: 0; border: 2px solid #16161a; box-sizing: border-box; }
.item.shape .spoly { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.item.shape .spoly path { stroke-width: 2px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.item.shape .content { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 10% 12%; line-height: 1.25; font-weight: 500; overflow: hidden; }
.item.shape[data-shape="triangle"] .content { padding: 40% 22% 6%; }
.item.shape[data-shape="diamond"] .content, .item.shape[data-shape="star"] .content { padding: 22% 24%; }
.item.shape[data-shape="bubble"] .content { padding: 6% 10% 30%; }
.item.shape[data-shape="arrow"] .content { padding: 26% 30% 26% 8%; }

/* ---------- connectors ---------- */
.item.connector { pointer-events: none; }
.item.connector.selected { outline: none; }
.item.connector .csvg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.item.connector path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.item.connector .cline { stroke: var(--cc); stroke-width: var(--cw); }
.item.connector.dashed .cline { stroke-dasharray: calc(var(--cw) * 4) calc(var(--cw) * 3); }
.item.connector .ccap { fill: var(--cc); stroke: var(--cc); stroke-width: var(--cw); }
.item.connector .chit { stroke: transparent; stroke-width: calc(16px * var(--inv)); pointer-events: stroke; cursor: pointer; }
.item.connector .csel { stroke: var(--accent); stroke-width: calc(var(--cw) + 7px * var(--inv)); opacity: 0; transition: opacity .12s; }
.item.connector:hover .csel { opacity: .18; }
.item.connector.selected .csel { opacity: .35; }
.item.connector .clabel { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 3px 9px; font-size: 14px; font-weight: 500; color: var(--cc); white-space: nowrap; }
.item.connector .clabel { width: max-content; max-width: 320px; }
.item.connector .clabel .content { width: auto; height: auto; min-width: 1em; white-space: pre; }
.item.connector .clabel.empty { display: none; }
/* ---------- small animations (see "small animations" in main.js) ---------- */
@keyframes item-in { 0% { transform: scale(.86); opacity: 0; } 60% { transform: scale(1.03); opacity: 1; } 100% { transform: scale(1); } }
@keyframes item-out { to { transform: scale(.85); opacity: 0; } }
@keyframes stamp-land { 0% { transform: scale(2.2) rotate(-8deg); opacity: 0; } 55% { transform: scale(.86) rotate(2deg); opacity: 1; } 78% { transform: scale(1.07); } 100% { transform: scale(1); } }
@keyframes item-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 54, .45); } 100% { box-shadow: 0 0 0 calc(16px * var(--inv)) rgba(255, 90, 54, 0); } }
@keyframes remote-glow { 0%, 70% { box-shadow: 0 0 0 calc(3px * var(--inv)) var(--who), 0 0 calc(26px * var(--inv)) var(--who); } 100% { box-shadow: 0 0 0 0 transparent, 0 0 0 transparent; } }
@keyframes who-tag { 0% { opacity: 0; transform: translateY(-100%) translateY(calc(4px * var(--inv))); } 12%, 80% { opacity: 1; transform: translateY(-100%); } 100% { opacity: 0; transform: translateY(-100%); } }
.item.anim-in { animation: item-in .26s cubic-bezier(.2, .8, .3, 1.15) both; transform-origin: 50% 50%; }
.item.anim-out { animation: item-out .18s ease-in forwards; transform-origin: 50% 50%; }
.item.anim-stamp { animation: stamp-land .4s cubic-bezier(.3, .7, .4, 1) both; }
.item.anim-pulse { animation: item-pulse .55s ease-out; }
.item.anim-remote { animation: remote-glow 1.8s ease-out; }
.who-tag { position: absolute; margin-top: calc(-6px * var(--inv)); padding: calc(2px * var(--inv)) calc(8px * var(--inv)); border-radius: calc(6px * var(--inv)); color: #fff; font-size: calc(12px * var(--inv)); font-weight: 600; white-space: nowrap; pointer-events: none; animation: who-tag 1.9s ease-out forwards; }
.burst { position: absolute; pointer-events: none; line-height: 1; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
@media (prefers-reduced-motion: reduce) { .item.anim-in, .item.anim-out, .item.anim-stamp, .item.anim-pulse, .item.anim-remote { animation: none; } }
.item.ctarget { outline: calc(2px * var(--inv)) solid var(--accent) !important; outline-offset: calc(3px * var(--inv)); }
/* connection points around the hovered item, and the ends of a selected connector */
#cdots, #cends { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 2147482600; pointer-events: none; }
.cdot, .cend { position: absolute; pointer-events: auto; width: calc(12px * var(--inv)); height: calc(12px * var(--inv)); border-radius: 50%; box-sizing: border-box; }
.cdot { background: #fff; border: calc(2px * var(--inv)) solid var(--accent); cursor: crosshair; transition: transform .12s; box-shadow: 0 1px calc(4px * var(--inv)) rgba(0, 0, 0, .15); }
.cdot[data-side="top"] { transform: translate(-50%, calc(-50% - 16px * var(--inv))); }
.cdot[data-side="bottom"] { transform: translate(-50%, calc(-50% + 16px * var(--inv))); }
.cdot[data-side="left"] { transform: translate(calc(-50% - 16px * var(--inv)), -50%); }
.cdot[data-side="right"] { transform: translate(calc(-50% + 16px * var(--inv)), -50%); }
.cdot:hover { background: var(--accent); }
.cend { background: var(--accent); border: calc(2px * var(--inv)) solid #fff; transform: translate(-50%, -50%); cursor: move; box-shadow: 0 1px calc(4px * var(--inv)) rgba(0, 0, 0, .25); }

/* ---------- comments ---------- */
#pins { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 2147482500; }
.pin { position: absolute; margin-top: -32px; width: 32px; height: 32px; transform-origin: 0 100%; --ps: clamp(calc(.45 * var(--inv)), 2, var(--inv)); transform: scale(var(--ps)); /* screen size down to 50% zoom, then shrinks with the board, never under 45% */ border-radius: 50% 50% 50% 4px; background: var(--pc, var(--accent)); border: 2px solid #fff; box-shadow: 0 4px 12px rgba(30, 24, 60, .25); display: grid; place-items: center; cursor: pointer; transition: box-shadow .15s; }
.pin:hover, .pin.open { box-shadow: 0 0 0 3px rgba(255, 90, 54, .35), 0 4px 12px rgba(30, 24, 60, .25); }
.pin .pin-av { color: #fff; font-weight: 700; font-size: 13px; }
.pin .pin-n { position: absolute; top: -7px; right: -9px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--ink); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.pin.resolved { filter: grayscale(1); opacity: .55; }
.pin.draft { animation: pinpop .2s ease; }
@keyframes pinpop { from { transform: scale(calc(var(--ps) * .5)); } }
#thread { position: fixed; z-index: 45; width: 320px; max-width: calc(100vw - 24px); border-radius: 18px; background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-lift); display: flex; flex-direction: column; overflow: hidden; }
.th-head { display: flex; align-items: center; gap: 2px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); }
.th-head .th-title { flex: 1; font-weight: 700; font-size: 14px; }
.th-head .icon-btn { width: 30px; height: 30px; font-size: 14px; }
.th-msgs { max-height: 280px; overflow-y: auto; padding: 6px 0; }
.th-msg { padding: 8px 16px; }
.th-who { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.th-av { width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.th-time { color: var(--ink-3); font-size: 12px; margin-left: auto; }
.th-del { border: 0; background: transparent; color: var(--ink-3); width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; }
.th-del svg { width: 13px; height: 13px; }
.th-del:hover { color: #c62828; background: rgba(198, 40, 40, .08); }
.pin.dragging-own { cursor: grabbing; box-shadow: 0 10px 24px rgba(30, 24, 60, .35); }
.th-tag { font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.th-text { margin: 4px 0 0 32px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; }
/* view-only client links: comments can be read, not added */
body.no-comment [data-tool="comment"], body.no-comment [data-cp="add"], body.no-comment [data-ca="reply"] { display: none !important; }
.th-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px 10px 10px 14px; border-top: 1px solid var(--line); }
.th-compose textarea { flex: 1; resize: none; font: inherit; font-size: 14px; border: 1px solid rgba(21, 20, 28, .12); border-radius: 12px; padding: 8px 12px; background: rgba(255, 255, 255, .8); outline: none; max-height: 480px; line-height: 1.4; unicode-bidi: plaintext; }
.th-compose textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.th-compose .btn { padding: 8px 14px; }
.comments-btn { position: relative; }
.comments-btn .ccount { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
/* comments: a docked side panel with every thread */
.cpanel { position: fixed; right: 14px; top: 80px; bottom: 84px; z-index: 30; width: 350px; max-width: calc(100vw - 28px); flex-direction: column; align-items: stretch; padding: 0; overflow: hidden; }
.cp-head { display: flex; align-items: center; gap: 8px; padding: 12px 8px 8px 18px; }
.cp-head b { flex: 1; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.cp-head .btn { padding: 6px 12px; font-size: 13px; }
.cp-tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.cp-tabs button { flex: 1; border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-3); padding: 9px 4px 10px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.cp-tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.cp-tabs button i { font-style: normal; font-weight: 600; font-size: 11px; margin-left: 2px; padding: 1px 6px; border-radius: 99px; background: var(--hover); }
.cp-tabs button i:empty { display: none; }
.cp-who { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.cp-who button { border: 1px solid rgba(21, 20, 28, .1); background: rgba(255, 255, 255, .5); font: inherit; font-size: 12px; font-weight: 500; padding: 4px 11px; border-radius: 99px; cursor: pointer; color: var(--ink-2); }
.cp-who button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.cp-list { overflow-y: auto; flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.cp-item { padding: 12px 14px; cursor: pointer; border-radius: 14px; background: rgba(255, 255, 255, .6); border: 1px solid var(--line); transition: background .15s, box-shadow .15s; }
.cp-item:hover { background: rgba(255, 255, 255, .95); box-shadow: 0 4px 14px rgba(30, 24, 60, .08); }
.cp-item.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cp-item.resolved { opacity: .62; }
.cp-ctx { font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--ink-3); margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.cp-msg { display: flex; gap: 10px; }
.cp-body { min-width: 0; flex: 1; }
.cp-top { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.cp-text { font-size: 13.5px; color: var(--ink); margin-top: 2px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.cp-last { margin: 10px 0 0 12px; padding-left: 12px; border-left: 2px solid var(--line); }
.cp-more { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 6px; }
.cp-msg.small .th-av { width: 20px; height: 20px; font-size: 10px; }
.cp-msg.small .cp-text { -webkit-line-clamp: 2; font-size: 13px; }
.cp-actions { display: flex; gap: 6px; margin-top: 10px; justify-content: flex-end; }
.cp-actions .btn { padding: 4px 11px; font-size: 12px; }
.cp-actions .cp-del { width: 30px; height: 30px; margin-right: auto; color: var(--ink-3); border-radius: 10px; }
.cp-actions .cp-del svg { width: 16px; height: 16px; }
.cp-actions .cp-del:hover { color: #c62828; background: rgba(198, 40, 40, .08); }
.cp-actions .cp-del.sure { color: #fff; background: #d93025; }
.cp-empty { padding: 32px 16px; color: var(--ink-3); font-size: 13px; text-align: center; line-height: 1.6; }

/* ---------- tool options (pen colours and sizes, shapes) ---------- */
.toolopts { position: fixed; left: 72px; z-index: 21; transform: translateY(-50%); flex-wrap: wrap; }
.toolopts.shapes { width: 170px; }
.toolopts.stamps { width: 176px; gap: 2px; }
.stamp-pick { width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.stamp-pick:hover { background: var(--hover); }
.stamp-pick.on { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
/* stamps on the board: an emoji with who placed it (on hover), and × to remove */
.item.stamp { display: grid; place-items: center; line-height: 1; }
.stamp-face { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .22)); pointer-events: none; }
.stamp-by { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: calc(4px * var(--inv)); padding: calc(2px * var(--inv)) calc(7px * var(--inv)); border-radius: calc(6px * var(--inv)); background: rgba(22, 22, 26, .82); color: #fff; font-size: calc(11px * var(--inv)); font-family: var(--font); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; }
.item.stamp:hover .stamp-by:not(:empty) { opacity: 1; }
.stamp-x { position: absolute; top: calc(-6px * var(--inv)); right: calc(-6px * var(--inv)); width: calc(20px * var(--inv)); height: calc(20px * var(--inv)); border: 0; border-radius: 50%; background: #fff; color: #e2462a; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); font-size: calc(14px * var(--inv)); line-height: 1; padding: 0; cursor: pointer; display: none; place-items: center; font-family: var(--font); }
.item.stamp.mine:hover .stamp-x, .item.stamp.can-del:hover .stamp-x { display: grid; }
.mode-view .item.stamp.mine { cursor: grab; }
.item.stamp.dragging-own { cursor: grabbing; opacity: .85; }
.viewport.tool-stamp, #viewport.tool-stamp { cursor: copy; }
.toolopts .swatch.on, .selbar .swatch.on { box-shadow: 0 0 0 2px var(--ink); }
.opt-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.size-dot { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; display: grid; place-items: center; padding: 0; }
.size-dot:hover { background: var(--hover); }
.size-dot.on { background: var(--hover); box-shadow: inset 0 0 0 1.5px var(--ink); }
.size-dot i { display: block; border-radius: 50%; background: var(--ink); }
.swatch.clear { background: repeating-conic-gradient(#ddd 0 25%, #fff 0 50%) 50% / 8px 8px !important; }
.sel-input { font: inherit; font-size: 13px; border: 1px solid rgba(21, 20, 28, .12); border-radius: 999px; padding: 6px 10px; background: rgba(255, 255, 255, .7); margin-right: 4px; }
.btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
/* each tool shows its own pointer, also over items (they'd otherwise show their own move/grab pointer) */
#viewport.tool-shape, #viewport.tool-connector { cursor: crosshair; }
#viewport.tool-text { cursor: text; }
#viewport.tool-pen { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M2 22l1.5-5.5L16 4l4 4L7.5 20.5z' fill='%23fff' stroke='%2315141c' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M3.5 16.5l4 4M13.5 6.5l4 4' stroke='%2315141c' stroke-width='1.4'/%3E%3Cpath d='M2 22l.9-3.3 2.4 2.4z' fill='%2315141c'/%3E%3C/svg%3E") 2 22, crosshair; }
#viewport.tool-marker { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M6 14.5L15 5.5l4 4-9 9z' fill='%23fff' stroke='%2315141c' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M6 14.5l4 4-3 1.5L3 21l1.5-3.5z' fill='%23ffd400' stroke='%2315141c' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 3 21, crosshair; }
#viewport.tool-eraser { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M8.5 20.5L3 15 13 5l7 7-8.5 8.5z' fill='%23fff' stroke='%2315141c' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M3 15l5-5 7 7-3.5 3.5h-3z' fill='%23ff8fa3' stroke='%2315141c' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M12 20.5h9' stroke='%2315141c' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") 6 17, cell; }
#viewport:is(.tool-note, .tool-text, .tool-frame, .tool-shape, .tool-connector, .tool-pen, .tool-marker, .tool-eraser, .tool-comment, .tool-stamp) .item:not(.cdot),
#viewport:is(.tool-note, .tool-text, .tool-frame, .tool-shape, .tool-connector, .tool-pen, .tool-marker, .tool-eraser, .tool-comment, .tool-stamp) .item *:not(.cdot) { cursor: inherit !important; }
#viewport.tool-comment { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'%3E%3Cpath d='M2 24V12A10 10 0 1 1 12 22H4z' fill='%23ff5a36' stroke='white' stroke-width='2'/%3E%3C/svg%3E") 2 24, crosshair; }

/* ---------- version history ---------- */
.hp-note { font-size: 12px; color: var(--ink-3); padding: 0 18px 12px; border-bottom: 1px solid var(--line); line-height: 1.5; }
.hp-list { gap: 2px; }
.hp-day { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 12px 8px 4px; }
.hp-item { display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; font: inherit; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.hp-item:hover { background: rgba(255, 255, 255, .9); }
.hp-time { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; width: 58px; white-space: nowrap; }
.hp-label { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.hp-item.named .hp-label { color: var(--ink); font-weight: 600; }
.hp-item.named .hp-time::before { content: "★ "; color: var(--accent); }
.hp-count { font-size: 12px; color: var(--ink-3); flex: none; }
.hv-dialog { width: min(980px, calc(100vw - 32px)) !important; }
.hv-head h3 { margin: 0; }
.hv-sub { margin: 4px 0 0 !important; }
.hv-stage { position: relative; height: min(58vh, 560px); margin-top: 14px; border-radius: 16px; overflow: hidden; background: #f3f2f7 radial-gradient(rgba(21, 20, 28, .12) 1px, transparent 1.2px) 0 0 / 18px 18px; border: 1px solid var(--line); }
.hv-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.hv-item { position: absolute; overflow: hidden; white-space: pre-wrap; line-height: 1.3; unicode-bidi: plaintext; }
.hv-item img, .hv-item video { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 6px; }
.hv-note { padding: 16px; }
.hv-shape { display: grid; place-items: center; text-align: center; border: 2px solid #16161a; border-radius: 6px; }
.hv-frame { border-radius: 16px; border: 2px solid rgba(21, 20, 28, .1); }
.hv-draw { background: rgba(21, 20, 28, .12); border-radius: 4px; }
.hv-text { font-weight: 600; overflow: visible; }
.hv-link { border-radius: 14px; background: #e4e4ea; }
.hv-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-size: 14px; }

/* ---------- minimap ---------- */
.minimap { position: fixed; right: 14px; bottom: 76px; z-index: 20; padding: 5px; border-radius: 16px; }
.minimap canvas { display: block; border-radius: 11px; background: rgba(243, 242, 247, .7); cursor: pointer; touch-action: none; }
body.minimap-on .cpanel { bottom: 232px; }
body.presenting .minimap { display: none !important; }
@media (max-width: 700px) { .minimap { display: none !important; } }

/* ---------- presentation mode ---------- */
.present-btn svg { width: 13px; height: 13px; }
body.presenting { background: #0b0b0f; }
body.presenting .topbar, body.presenting .toolbar, body.presenting .zoombar, body.presenting .selbar, body.presenting .toolopts,
body.presenting .cpanel, body.presenting #pins, body.presenting #thread, body.presenting #cdots, body.presenting #cends,
body.presenting #selbox, body.presenting #guides, body.presenting .cursor { display: none !important; }
body.presenting #viewport { background-image: none; cursor: default; }
body.presenting.p-idle #viewport { cursor: none; }
body.presenting .item.connector .chit, body.presenting .item.draw .dhit { cursor: default; }
/* everything outside the slide is covered by the mask's giant shadow */
#pmask { position: fixed; z-index: 25; pointer-events: none; box-shadow: 0 0 0 200vmax #0b0b0f; transition: border-radius .2s; }
#pbar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 16px; background: rgba(28, 27, 36, .82); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid rgba(255, 255, 255, .1); color: #fff; box-shadow: 0 12px 40px rgba(0, 0, 0, .4); transition: opacity .3s, transform .3s; max-width: calc(100vw - 32px); }
#pbar.idle { opacity: 0; transform: translate(-50%, 12px); }
#pbar button { width: 38px; height: 38px; border: 0; border-radius: 11px; background: transparent; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
#pbar button:hover:not(:disabled) { background: rgba(255, 255, 255, .12); }
#pbar button:disabled { opacity: .3; cursor: default; }
#pbar button svg { width: 17px; height: 17px; }
#pbar .p-count { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 0 6px; white-space: nowrap; }
#pbar .p-title { font-size: 13px; color: rgba(255, 255, 255, .7); max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 6px; unicode-bidi: plaintext; }
#pbar .p-title:empty { display: none; }
#pbar .p-sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .15); margin: 0 4px; }
@media (max-width: 640px) { .present-btn { padding: 8px 10px; font-size: 0; gap: 0; } .present-btn svg { width: 14px; height: 14px; } }

/* alignment guides */
#guides { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 2147483001; }
.guide { position: absolute; background: #ff2fb3; }
.guide.gv { width: calc(1px * var(--inv)); transform: translateX(-50%); }
.guide.gh { height: calc(1px * var(--inv)); transform: translateY(-50%); }

#marquee { position: fixed; border: 1px solid var(--accent); border-radius: 4px; background: rgba(255, 90, 54, .08); pointer-events: none; z-index: 15; }

.cursor { position: absolute; left: 0; top: 0; pointer-events: none; transform-origin: 0 0; z-index: 100000; transition: transform 60ms linear; }
.cursor svg { width: 20px; height: 20px; display: block; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .2)); }
.cursor .tag { position: absolute; top: 18px; left: 12px; color: #fff; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }

/* ---------- dialogs & toasts ---------- */
.overlay { position: fixed; inset: 0; background: rgba(30, 26, 50, .22); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 50; animation: fade .2s ease; }
.dialog { background: var(--glass-strong); border-radius: 24px; padding: 26px; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-lift), inset 0 1px 0 rgba(255, 255, 255, .9); animation: pop .24s cubic-bezier(.1, .9, .2, 1); }
.dialog h3 { margin: 0 0 8px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.dialog p { margin: 0 0 14px; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.dialog label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--ink-2); }
.dialog .row { display: flex; gap: 8px; }
.dialog input { flex: 1; border: 1px solid rgba(21, 20, 28, .12); border-radius: 12px; padding: 10px 14px; font-size: 14px; font-family: inherit; min-width: 0; background: rgba(255, 255, 255, .75); outline: none; transition: border-color .15s, box-shadow .15s; }
.dialog input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.dialog input.ltr { direction: ltr; text-align: left; }
.dialog .foot { display: flex; flex-direction: row-reverse; justify-content: flex-start; gap: 8px; margin-top: 20px; }
.update-bar { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 60; border: 0; border-radius: 99px; padding: 10px 18px; background: var(--ink); color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, .22); }
.update-bar:hover { background: var(--accent); }
.link-off { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; padding: 24px; }
.link-off h3 { margin: 0 0 8px; font-size: 24px; font-weight: 800; }
.link-off p { margin: 0; color: var(--ink-2); font-size: 15px; }
/* share window: client links with their part, access, last opened, copy and block */
.dialog.share-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; }
.share-dialog .sh-opts { margin-top: 8px; flex-wrap: wrap; }
.share-dialog .sh-opts .sel-input { flex: 1; min-width: 150px; height: 40px; border-radius: 12px; }
.share-dialog .sh-scope { flex: 1; height: 40px; border-radius: 12px; font-weight: 600; }
.share-dialog .sh-opts input { min-width: 180px; }
.ln-all { margin-top: 12px; }
.ln-all summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 4px 0; user-select: none; }
.ln-all summary:hover { color: var(--ink); }
.ln-all[open] summary { margin-bottom: 6px; }
.ln-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.ln-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .6); border: 1px solid rgba(21, 20, 28, .07); }
.ln-row.off { opacity: .55; }
.ln-row.off b { text-decoration: line-through; }
.ln-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ln-main b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; text-align: start; }
.ln-main span { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ln-empty { font-size: 13px; color: var(--ink-3); padding: 6px 2px; }
.ln-sub { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); padding: 6px 2px 0; }
.ln-sub:first-child { padding-top: 0; }
.ln-sub { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 8px 2px 0; }
.ln-row .ln-del { width: 34px; height: 34px; flex: none; color: var(--ink-3); border-radius: 10px; }
.ln-row .ln-del svg { width: 17px; height: 17px; }
.ln-row .ln-del:hover { color: #c62828; background: rgba(198, 40, 40, .08); }
.ln-row .ln-del.sure { color: #fff; background: #d93025; }
.ln-del-space { width: 34px; flex: none; }
.dialog .note-small { font-size: 12px; color: var(--ink-3); margin-top: 10px; line-height: 1.5; }
.shortcuts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.shortcuts kbd { background: rgba(255, 255, 255, .8); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; font-family: inherit; font-size: 12px; direction: ltr; display: inline-block; }

#toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 8px); background: rgba(21, 20, 28, .88); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 60; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#dropzone { position: fixed; inset: 12px; border: 2px dashed var(--accent); border-radius: 28px; background: rgba(255, 90, 54, .06); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); z-index: 40; pointer-events: none; display: grid; place-items: center; font-size: 22px; font-weight: 700; color: var(--accent); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.92); } }
/* closing: a quick fade and shrink, like Windows */
.overlay.closing { animation: fadeOut .15s ease forwards; pointer-events: none; }
.overlay.closing .dialog { animation: popOut .15s ease forwards; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popOut { to { opacity: 0; transform: scale(.95); } }

@media (max-width: 640px) {
  .home-header { padding-top: 10px; }
  .home-main { padding-top: 36px; }
  .board-grid { grid-template-columns: 1fr; }
  .toolbar { top: auto; bottom: 14px; left: 50%; transform: translateX(-50%); flex-direction: row; }
  .toolbar .sep { width: 1px; height: 22px; margin: 0 4px; }
  .toolbar { max-width: calc(100vw - 20px); overflow-x: auto; }
  .toolopts { left: 50% !important; top: auto !important; bottom: 74px; transform: translateX(-50%); }
  .cpanel { top: 76px; right: 10px; left: 10px; width: auto; }
  .people { display: none; }
  .board-name { max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* line icons in bars and panels */
.ui-ico { width: 18px; height: 18px; display: block; flex: none; }
.btn .ui-ico { width: 16px; height: 16px; }
.icon-btn.danger-icon:hover { color: #d93025; background: rgba(217, 48, 37, .08); }
.sel-note { display: inline-flex; align-items: center; gap: 6px; }
.sel-note .ui-ico { width: 16px; height: 16px; }

/* shared with a client right now: a cyan glow (orange is Claude's colour) around the frame / storyboard, and on the Share button for the whole board */
.item.frame.shared-out, .item.storyboard.shared-out { box-shadow: 0 0 0 calc(3px * var(--inv)) #06b6d4, 0 0 calc(28px * var(--inv)) calc(4px * var(--inv)) rgba(6, 182, 212, .45); }
.item.storyboard.shared-out.sb-hot { box-shadow: 0 0 0 calc(3px * var(--inv)) var(--accent), 0 0 calc(28px * var(--inv)) calc(4px * var(--inv)) rgba(6, 182, 212, .45); }
#shareBtn.shared-out { box-shadow: 0 0 0 3px #06b6d4, 0 0 14px rgba(6, 182, 212, .6); }

/* Claude's frame: a terracotta outline and a bold "Claude" badge above its top-right corner (studio only) */
.mode-edit .item.frame.claude { border: calc(3px * var(--inv)) solid #d97757; }
.mode-edit .item.frame.claude .frame-title { right: calc(240px * var(--inv)); width: auto; text-align: left; } /* width: auto, or the general full width wins over "right" */
#agents { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 2147482400; pointer-events: none; }
.mode-view #agents, body.presenting #agents { display: none; }
#agents .agent-badge { position: absolute; transform: translate(-100%, calc(-100% - 6px * var(--inv))); display: inline-flex; align-items: center; gap: calc(8px * var(--inv)); height: calc(40px * var(--inv)); padding: 0 calc(18px * var(--inv)) 0 calc(12px * var(--inv)); border-radius: calc(20px * var(--inv)); background: #d97757; color: #fff; font-size: calc(18px * var(--inv)); font-weight: 700; letter-spacing: -.01em; box-shadow: 0 calc(3px * var(--inv)) calc(10px * var(--inv)) rgba(217, 119, 87, .45); white-space: nowrap; }
#agents .agent-badge svg { width: calc(24px * var(--inv)); height: calc(24px * var(--inv)); }
/* who a comment is for: a small initial on the pin, a picker in the thread, a tag in the list */
.pin .pin-for { position: absolute; bottom: -6px; right: -9px; width: 17px; height: 17px; border-radius: 50%; color: #fff; font-size: 9.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.pin.for-me::after { content: ""; position: absolute; inset: -6px; border-radius: 50% 50% 50% 6px; border: 2px solid var(--pc, var(--accent)); opacity: .55; animation: forme 1.8s ease-out infinite; pointer-events: none; }
@keyframes forme { from { transform: scale(.85); opacity: .7 } to { transform: scale(1.25); opacity: 0 } }
.th-for { display: flex; align-items: center; gap: 4px; margin-right: 4px; font-size: 12px; color: var(--ink-3); }
.th-for select { font: inherit; font-size: 12px; font-weight: 600; color: var(--ink); border: 1px solid rgba(21, 20, 28, .12); border-radius: 8px; padding: 3px 6px; background: rgba(255, 255, 255, .7); cursor: pointer; }
.cp-for { margin-left: 8px; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; color: var(--fc); background: color-mix(in srgb, var(--fc) 12%, transparent); }
.cp-item.for-me { box-shadow: inset 3px 0 0 var(--accent); }
.cp-who button { position: relative; }
.cp-who .cp-dot { display: none; position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
.cp-who button.has .cp-dot { display: block; }
#commentsBtn.for-me { position: relative; }
#commentsBtn.for-me::after { content: ""; position: absolute; top: 4px; left: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
/* quick translation under a message */
.th-trbtn { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 2px 6px 2px 4px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 11.5px; color: var(--ink-3); cursor: pointer; opacity: 0; transition: opacity .15s; }
.th-trbtn .ui-ico { width: 14px; height: 14px; }
.th-text { user-select: text; -webkit-user-select: text; }
.th-edited { color: var(--ink-3); font-size: 11.5px; font-style: italic; margin-left: auto; }
.th-edited + .th-time { margin-left: 0; }
.th-edit { margin: 6px 0 0 32px; }
.th-edit textarea { width: 100%; box-sizing: border-box; resize: none; font: inherit; font-size: 14px; line-height: 1.45; padding: 7px 9px; border: 1px solid var(--accent, #2f6fed); border-radius: 10px; background: #fff; outline: none; unicode-bidi: plaintext; }
.th-edit-btns { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.th-edit-btns .btn { padding: 4px 12px; font-size: 13px; }
.th-msg:hover .th-trbtn, .th-trbtn:focus-visible, .th-msg:has(.th-tr:not([hidden])) .th-trbtn { opacity: 1; }
.th-trbtn:hover { background: rgba(21, 20, 28, .06); color: var(--ink); }
@media (hover: none) { .th-trbtn { opacity: 1; } }
.th-tr { margin-top: 4px; padding: 8px 10px; border-radius: 8px; background: rgba(47, 111, 237, .07); font-size: 13.5px; line-height: 1.4; white-space: pre-wrap; unicode-bidi: plaintext; }
.th-tr.busy { color: var(--ink-3); font-style: italic; }
.th-tr-foot { margin-top: 4px; font-size: 11px; color: var(--ink-3); }
.th-tr-lang { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
/* Pin and Freeze marks on frames and storyboards (studio only): a small badge on the top-right corner, one screen size */
.mode-edit .item.frame.pinned::after, .mode-edit .item.storyboard.pinned::after,
.mode-edit .item.frame.frozen::after, .mode-edit .item.storyboard.frozen::after {
  content: ""; position: absolute; right: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; pointer-events: none; z-index: 5;
  transform: translate(50%, -50%) scale(var(--inv)); background: #fff center / 14px no-repeat; box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316161a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4h6l-1 6 3 3H7l3-3z'/%3E%3Cpath d='M12 13v7'/%3E%3C/svg%3E");
}
.mode-edit .item.frame.frozen::after, .mode-edit .item.storyboard.frozen::after {
  background-color: #e8f4ff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f6fed' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 3v18M4.2 7.5l15.6 9M4.2 16.5l15.6-9'/%3E%3C/svg%3E");
}
.pin-btn { display: inline-flex; align-items: center; gap: 5px; }
.pin-btn .ui-ico { width: 15px; height: 15px; }
.pin-btn.on { background: var(--ink); color: #fff; }
/* the comment window's corner grip: drag to make it wider and the writing space taller */
#thread .th-grip { position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px; cursor: nwse-resize; z-index: 2; opacity: .45;
  background: linear-gradient(135deg, transparent 0 50%, var(--ink-3) 50% 56%, transparent 56% 68%, var(--ink-3) 68% 74%, transparent 74% 86%, var(--ink-3) 86% 92%, transparent 92%); }
#thread .th-grip:hover { opacity: .9; }
#thread { position: fixed; }
#thread .th-av.th-claude svg { width: 13px; height: 13px; color: #fff; }
/* how heavy the board is: a small bar next to its name, and the list it opens (studio only) */
.load-meter { position: relative; width: 34px; height: 8px; margin-left: 8px; padding: 0; border: 0; border-radius: 99px; background: rgba(21, 20, 28, .1); cursor: pointer; overflow: hidden; flex: none; }
.load-meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: #1f9d55; transition: width .4s, background .4s; }
.load-meter.mid i { background: #e6a100; }
.load-meter.heavy i { background: #e2462a; }
.load-meter:hover { box-shadow: 0 0 0 3px rgba(21, 20, 28, .06); }
.load-pop { display: block; flex-direction: column; align-items: stretch; height: auto; background: rgba(255, 255, 255, .97); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 18px 50px rgba(30, 24, 60, .22), 0 0 0 1px rgba(21, 20, 28, .08); position: fixed; z-index: 2147482000; width: 340px; max-width: calc(100vw - 24px); padding: 14px 0 8px; border-radius: 16px; animation: pop .18s ease-out; }
.load-pop .lp-head { padding: 0 16px 10px; }
.load-pop .lp-head b { font-size: 14px; }
.load-pop .lp-sum { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.load-pop p { margin: 8px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); }
.lp-bar { position: relative; height: 8px; margin-top: 10px; border-radius: 99px; background: rgba(21, 20, 28, .08); overflow: hidden; }
.lp-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: #1f9d55; }
.lp-bar.mid i { background: #e6a100; }
.lp-bar.heavy i { background: #e2462a; }
.lp-bar span { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255, 255, 255, .9); }
.load-pop .lp-sub { padding: 8px 16px 4px; border-top: 1px solid var(--line); font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); }
.load-pop .lp-list { max-height: 300px; overflow-y: auto; }
.load-pop .lp-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 16px; border: 0; background: none; font: inherit; font-size: 13px; text-align: left; cursor: pointer; color: var(--ink); }
.load-pop .lp-row:hover { background: rgba(21, 20, 28, .05); }
.load-pop .lp-ico { width: 30px; height: 24px; border-radius: 6px; background: rgba(21, 20, 28, .07); color: var(--ink-3); display: grid; place-items: center; font-size: 14px; flex: none; }
.load-pop .lp-ico.sb { color: var(--accent); }
.load-pop .lp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.load-pop .lp-name em { font-style: normal; color: var(--ink-3); }
.load-pop .lp-row b { font-size: 12px; font-weight: 600; color: var(--ink-2); }
/* a short flash on what the load list jumped to */
.jump-flash { animation: jumpflash 1.6s ease-out; }
@keyframes jumpflash { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 90, 54, 0); } 15%, 55% { box-shadow: 0 0 0 calc(6px * var(--inv, 1)) rgba(255, 90, 54, .85); } }

/* ---------- reference pins: a click goes to another place on the board ---------- */
.item.ref { --rc: #2f6fed; --ps: clamp(calc(.45 * var(--inv)), 2, var(--inv)); }
.item.ref .ref-pin { position: absolute; left: 0; top: 0; width: 30px; height: 30px; margin-top: -30px; box-sizing: border-box; transform-origin: 0 100%; transform: scale(var(--ps)); border-radius: 50% 50% 50% 4px; background: var(--rc); border: 2px solid #fff; box-shadow: 0 4px 12px rgba(30, 24, 60, .25); display: grid; place-items: center; color: #fff; cursor: pointer; transition: box-shadow .15s, background .15s; }
.item.ref .ref-pin svg { width: 15px; height: 15px; }
.item.ref:hover .ref-pin { box-shadow: 0 0 0 3px rgba(47, 111, 237, .3), 0 4px 12px rgba(30, 24, 60, .25); }
.item.ref.selected { outline: none; }
.item.ref.selected .ref-pin { box-shadow: 0 0 0 3px var(--accent), 0 4px 12px rgba(30, 24, 60, .25); }
.item.ref .ref-label { position: absolute; left: 0; top: 0; transform-origin: 0 0; transform: scale(var(--ps)) translate(34px, -26px); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; padding: 3px 9px; border-radius: 8px; background: rgba(255, 255, 255, .92); box-shadow: 0 2px 8px rgba(30, 24, 60, .15); color: var(--rc); font-size: 12.5px; font-weight: 600; line-height: 16px; cursor: pointer; unicode-bidi: plaintext; }
.item.ref .ref-label[hidden] { display: none; }
.item.ref.missing { --rc: #9a9aa6; }
.item.ref-ghost { pointer-events: none; opacity: .7; }
body.ref-picking #viewport, body.ref-picking #viewport * { cursor: crosshair !important; }
#viewport.tool-ref { cursor: crosshair; }
#viewport.tool-ref .item, #viewport.tool-ref .item * { cursor: inherit !important; }
.ref-tip { position: fixed; z-index: 70; pointer-events: none; max-width: 260px; padding: 8px; border-radius: 12px; background: var(--glass-strong, #fff); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-edge, rgba(0, 0, 0, .08)); box-shadow: var(--shadow-lift, 0 8px 24px rgba(0, 0, 0, .18)); font-size: 13px; }
.ref-tip img { display: block; max-width: 244px; max-height: 150px; border-radius: 8px; margin-bottom: 7px; object-fit: contain; }
.ref-tip .rt-text { display: flex; flex-direction: column; gap: 2px; }
.ref-tip .rt-text b { font-weight: 700; color: #2f6fed; }
.ref-tip .rt-text span { color: var(--ink-2, #444); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ref-tip .rt-text em { font-style: normal; font-size: 11.5px; color: var(--ink-3, #888); }
.ref-comet { position: absolute; z-index: 2147483100; overflow: visible; pointer-events: none; filter: drop-shadow(0 0 calc(4px * var(--inv)) rgba(47, 111, 237, .7)); }
.ref-comet rect { fill: none; stroke: #2f6fed; stroke-linecap: round; }
.ref-back { position: absolute; z-index: 2147483200; transform-origin: 0 0; transform: scale(var(--inv)) translate(-50%, calc(-100% - 10px)); display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px 6px 9px; border: 0; border-radius: 999px; background: #2f6fed; color: #fff; font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; box-shadow: 0 4px 14px rgba(47, 111, 237, .35); cursor: pointer; }
.ref-back.over-title { transform: scale(var(--inv)) translate(-50%, calc(-100% - 40px)); }
.ref-back:hover { background: #2559c9; }
.ref-back svg { width: 15px; height: 15px; }
body.ctx-right #selbar { visibility: hidden; }

/* ---------- follow someone's screen ---------- */
.person[data-cid] { cursor: pointer; transition: transform .15s; }
.person[data-cid]:hover { transform: translateY(-2px); z-index: 1; }
.person.followed { box-shadow: 0 0 0 2px var(--pc), 0 2px 6px rgba(0, 0, 0, .12); z-index: 2; }
.follow-frame { position: fixed; inset: 0; z-index: 55; pointer-events: none; box-shadow: inset 0 0 0 3px var(--fc, #2f6fed); }
.follow-tag { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 5px 5px 5px 14px; border-radius: 999px; background: var(--fc, #2f6fed); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); pointer-events: auto; }
.follow-tag button { border: 0; border-radius: 999px; padding: 4px 12px; background: rgba(255, 255, 255, .22); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.follow-tag button:hover { background: rgba(255, 255, 255, .34); }

/* a panel dragged out of its storyboard: it lands on the board (Alt: a copy) */
.sb-ghost.out { outline: 3px solid var(--accent); outline-offset: 2px; }
.sb-ghost.copy::after { content: "+"; position: absolute; right: 8px; top: 8px; z-index: 3; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font: 700 17px/24px sans-serif; text-align: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }

/* ---------- who a comment is for: people circles in the thread ---------- */
.th-forchips { display: flex; gap: 3px; margin-right: 6px; }
.fchip { width: 22px; height: 22px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; font: inherit; font-size: 11px; font-weight: 700; line-height: 1; color: var(--pc); background: color-mix(in srgb, var(--pc) 14%, #fff); cursor: pointer; transition: transform .12s, background .12s, color .12s, box-shadow .12s; }
.fchip svg { width: 12px; height: 12px; }
.fchip:hover { transform: scale(1.1); }
.fchip.on { background: var(--pc); color: #fff; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--pc); }
/* ---------- right-click with the comment tool: the people in a ring ---------- */
.radial { position: fixed; z-index: 80; width: 0; height: 0; }
.radial .rd-dot { position: absolute; left: 0; top: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(0, 0, 0, .25); transform: scale(.4); opacity: 0; transition: transform .18s ease-out, opacity .18s; }
.radial .rd-item { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; transform: translate(-50%, -50%) scale(.35); opacity: 0;
  transition: transform .26s cubic-bezier(.2, .9, .3, 1.15) var(--d), opacity .18s ease-out var(--d); }
.radial .rd-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--pc); color: #fff; font-size: 15px; font-weight: 700; border: 2.5px solid #fff; box-shadow: 0 6px 18px rgba(30, 24, 60, .22); transition: transform .14s; }
.radial .rd-av svg { width: 18px; height: 18px; }
.radial .rd-name { padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .94); box-shadow: 0 2px 8px rgba(30, 24, 60, .14); color: var(--ink); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.radial .rd-item:hover .rd-av { transform: scale(1.12); }
.radial .rd-item:hover .rd-name { color: var(--pc); }
.radial.open .rd-dot { transform: scale(1); opacity: 1; }
.radial.open .rd-item { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 9px)) scale(1); opacity: 1; }
.radial.closing .rd-item { transition: transform .16s ease-in, opacity .14s ease-in; transition-delay: 0s; }
.radial.closing .rd-dot { transition-duration: .12s; }
@media (prefers-reduced-motion: reduce) { .radial .rd-item, .radial .rd-dot { transition: none; } }

/* the comment people: more than five fold behind "+" */
.th-forchips { flex-wrap: wrap; justify-content: flex-end; max-width: 150px; }
.th-forchips .fchip.fx { display: none; }
.th-forchips.more .fchip.fx { display: grid; }
.th-forchips.more .fmore { display: none; }
.fchip.fmore { --pc: #8a8a96; font-size: 14px; }
/* once per browser: which one is you */
.who-bubble { position: fixed; z-index: 60; display: flex; align-items: center; gap: 6px; padding: 7px 8px 7px 14px; border-radius: 999px; background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-lift); font-size: 13px; font-weight: 600; color: var(--ink); opacity: 0; transform: translateY(-6px); transition: opacity .2s, transform .22s cubic-bezier(.2, .9, .3, 1.1); }
.who-bubble.in { opacity: 1; transform: none; }
.who-bubble span { margin-right: 4px; }
.who-bubble .fchip { width: 26px; height: 26px; font-size: 12px; }
.who-bubble .who-x { border: 0; background: none; color: var(--ink-3); width: 24px; height: 24px; display: grid; place-items: center; cursor: pointer; border-radius: 50%; padding: 0; }
.who-bubble .who-x:hover { background: rgba(21, 20, 28, .06); color: var(--ink); }
.who-bubble .who-x svg { width: 14px; height: 14px; }
/* home: the Team window */
.team-dialog .team-list { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; max-height: 50vh; overflow: auto; }
.team-row { display: flex; align-items: center; gap: 8px; }
.team-row.off input { color: var(--ink-3); text-decoration: line-through; }
.team-row.off .team-sw { opacity: .4; }
.team-sw { width: 30px; height: 30px; flex: none; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(21, 20, 28, .12); cursor: pointer; padding: 0; }
.team-dialog input { flex: 1; border: 1px solid rgba(21, 20, 28, .12); border-radius: 12px; padding: 9px 13px; font-size: 14px; font-family: inherit; background: rgba(255, 255, 255, .75); outline: none; min-width: 0; }
.team-dialog input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.team-add { margin-bottom: 4px; }

/* dragging images over a storyboard: the panel under the pointer lifts a little and says what will happen */
.sb-panel { transition: transform .18s cubic-bezier(.2, .9, .3, 1.25); }
.sb-panel.drop-into { transform: scale(1.05); z-index: 3; }
.sb-panel.drop-into .sb-media { box-shadow: inset 0 0 0 calc(4 * var(--u)) var(--accent), 0 calc(10 * var(--u)) calc(28 * var(--u)) rgba(30, 24, 60, .28); }
.sb-panel.drop-into .sb-media::after { content: "New version"; position: absolute; left: 50%; top: 50%; z-index: 3; transform: translate(-50%, -50%); padding: max(calc(5 * var(--u)), calc(3px * var(--inv))) max(calc(12 * var(--u)), calc(8px * var(--inv))); border-radius: 999px; background: var(--accent); color: #fff; font-size: max(calc(13 * var(--u)), calc(11px * var(--inv))); /* readable even when the storyboard is small on screen */ font-weight: 700; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); animation: drop-tag .2s ease-out; pointer-events: none; }
.sb-panel.empty.drop-into .sb-media::after { content: "Drop here"; }
@keyframes drop-tag { from { opacity: 0; transform: translate(-50%, -35%) scale(.85); } }
@media (prefers-reduced-motion: reduce) { .sb-panel { transition: none; } .sb-panel.drop-into .sb-media::after { animation: none; } }

/* the card a dragged image becomes over a storyboard: on top of everything, rounded, with a soft shadow */
.item.drag-card { z-index: 2147483000 !important; border-radius: calc(10px * var(--ck, 1) * var(--inv)); overflow: hidden; box-shadow: 0 calc(10px * var(--ck, 1) * var(--inv)) calc(26px * var(--ck, 1) * var(--inv)) rgba(30, 24, 60, .32), 0 0 0 calc(2px * var(--ck, 1) * var(--inv)) #fff; }
.item.drag-card :is(img, video) { border-radius: inherit; }
body.drag-carding :is(#selbox, #selbar, #guides) { visibility: hidden; }
body.drag-carding .item.drag-card.selected { outline: none; }

/* ---------- crop ---------- */
.item.image.cropped, .hv-item.cropped, .mini-item.cropped { overflow: hidden; }
.item.image.cropped { border-radius: 8px; }
.hv-item.cropped { border-radius: 6px; }
.mini-item.cropped { border-radius: 4px; }
.item.image.cropped img, .hv-item.cropped img, .mini-item.cropped img { border-radius: 0; }
.item.cropping-src { visibility: hidden; }
body.cropping :is(#selbox, #selbar, #guides) { visibility: hidden; }
.crop-ui { position: absolute; z-index: 2147483100; }
.crop-ui img { position: absolute; display: block; max-width: none; pointer-events: none; user-select: none; }
.crop-dim { left: 0; top: 0; width: 100%; height: 100%; filter: brightness(.42) saturate(.7); opacity: .92; border-radius: calc(4px * var(--inv)); }
.crop-frame { position: absolute; cursor: move; touch-action: none; }
.crop-win { position: absolute; inset: 0; overflow: hidden; outline: calc(2px * var(--inv)) solid #fff; box-shadow: 0 0 0 calc(3px * var(--inv)) rgba(20, 18, 30, .25), 0 calc(8px * var(--inv)) calc(28px * var(--inv)) rgba(0, 0, 0, .35); }
.crop-grid { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .15s; }
.crop-grid::before, .crop-grid::after { content: ""; position: absolute; border: 0 solid rgba(255, 255, 255, .6); }
.crop-grid::before { left: 33.333%; right: 33.333%; top: 0; bottom: 0; border-left-width: calc(1px * var(--inv)); border-right-width: calc(1px * var(--inv)); }
.crop-grid::after { top: 33.333%; bottom: 33.333%; left: 0; right: 0; border-top-width: calc(1px * var(--inv)); border-bottom-width: calc(1px * var(--inv)); }
.crop-ui.dragging .crop-grid { opacity: 1; }
.crop-h { position: absolute; width: calc(14px * var(--inv)); height: calc(14px * var(--inv)); transform: translate(-50%, -50%); background: #fff; border: calc(1.5px * var(--inv)) solid #15141c; border-radius: calc(3px * var(--inv)); box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.crop-h[data-h="n"], .crop-h[data-h="s"] { width: calc(24px * var(--inv)); height: calc(8px * var(--inv)); border-radius: 999px; }
.crop-h[data-h="e"], .crop-h[data-h="w"] { width: calc(8px * var(--inv)); height: calc(24px * var(--inv)); border-radius: 999px; }
.crop-h[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.crop-h[data-h="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.crop-h[data-h="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.crop-h[data-h="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.crop-h[data-h="n"] { left: 50%; top: 0; cursor: ns-resize; }
.crop-h[data-h="s"] { left: 50%; top: 100%; cursor: ns-resize; }
.crop-h[data-h="e"] { left: 100%; top: 50%; cursor: ew-resize; }
.crop-h[data-h="w"] { left: 0; top: 50%; cursor: ew-resize; }
.crop-bar { position: absolute; left: 50%; top: 100%; transform-origin: 0 0; transform: scale(var(--inv)) translate(-50%, 16px); display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, .97); box-shadow: 0 6px 22px rgba(30, 24, 60, .2); white-space: nowrap; cursor: default; }
.crop-bar button { border: 0; border-radius: 8px; padding: 6px 13px; font: inherit; font-size: 13px; font-weight: 600; background: transparent; color: var(--ink); cursor: pointer; }
.crop-bar button:hover { background: rgba(20, 18, 30, .07); }
.crop-bar .crop-done { background: var(--accent); color: #fff; }
.crop-bar .crop-done:hover { background: var(--accent); filter: brightness(1.06); }
