:root {
  --bg: #e9eaec;
  --chrome: #ffffff;
  --toolbar: #f5f5f6;
  --border: #dcdde1;
  --text: #222326;
  --muted: #8a8e96;
  --card: #ffffff;
  --card-border: rgba(0, 0, 0, .06);
  --col-body: #f1f1f3;
  --hover: rgba(0, 0, 0, .05);
  --ink: #222326; --ink-muted: #8a8e96; --ink-hover: rgba(0, 0, 0, .05);
  --sel: #1f2023;
  --focus: #3d7efd;
  --accent: #ef4f45;
  --line: #3a3c40;
  --danger: #e5484d;
  --tile: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 1px 5px rgba(0, 0, 0, .05);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .18);
  --font: 'Inter', 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Lora', 'Vazirmatn', Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1c1f; --chrome: #232427; --toolbar: #202124; --border: #35373c; --text: #e9e9ea; --muted: #9a9ea6;
    --card: #2a2c30; --card-border: rgba(255, 255, 255, .06); --col-body: #222327; --hover: rgba(255, 255, 255, .07);
    --ink: #e9e9ea; --ink-muted: #9a9ea6; --ink-hover: rgba(255, 255, 255, .07);
    --sel: #f2f2f2; --line: #b9bcc2; --tile: #2e3034;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 1px 5px rgba(0, 0, 0, .3); --shadow-lg: 0 10px 30px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1c1f; --chrome: #232427; --toolbar: #202124; --border: #35373c; --text: #e9e9ea; --muted: #9a9ea6;
  --card: #2a2c30; --card-border: rgba(255, 255, 255, .06); --col-body: #222327; --hover: rgba(255, 255, 255, .07);
    --ink: #e9e9ea; --ink-muted: #9a9ea6; --ink-hover: rgba(255, 255, 255, .07);
  --sel: #f2f2f2; --line: #b9bcc2; --tile: #2e3034;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 1px 5px rgba(0, 0, 0, .3); --shadow-lg: 0 10px 30px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); overflow: hidden; display: grid;
  grid-template-rows: auto minmax(0, 1fr); grid-template-columns: 72px minmax(0, 1fr);
  grid-template-areas: "top top" "tools main";
}
button { font: inherit; color: inherit; }
.ic { width: 18px; height: 18px; flex: none; }
.offscreen { position: fixed; left: -100px; top: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; }
.muted { color: var(--muted); font-size: 12px; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }

/* ---------- header ---------- */
#topbar { grid-area: top; background: var(--chrome); border-bottom: 1px solid var(--border); z-index: 20; min-width: 0; }
.row1 { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 12px; }
.row2 { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 42px; padding: 0 12px 4px; }
#crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; overflow: hidden; }
.crumb {
  display: flex; align-items: center; gap: 7px; border: 0; background: none; padding: 4px 8px; border-radius: 6px;
  cursor: pointer; white-space: nowrap; max-width: 200px; min-width: 0; font-size: 13px; font-weight: 500;
}
.crumb span { overflow: hidden; text-overflow: ellipsis; }
.crumb:hover { background: var(--hover); }
.crumb .logo { width: 18px; height: 18px; border-radius: 50%; background: var(--text); color: var(--chrome); display: grid; place-items: center; font-size: 10px; font-weight: 700; flex: none; }
.crumb .chip { width: 13px; height: 13px; border-radius: 3px; background: var(--cc, #b5bd8a); flex: none; }
.spacer { flex: 1; }
.icon-btn { width: 32px; height: 32px; border: 0; background: none; border-radius: 6px; cursor: pointer; display: grid; place-items: center; color: var(--text); }
.icon-btn .ic { width: 19px; height: 19px; }
.icon-btn:hover:not(:disabled) { background: var(--hover); }
.icon-btn:disabled { opacity: .3; cursor: default; }
#status { font-size: 11px; color: var(--muted); white-space: nowrap; }
#status.bad { color: var(--danger); font-weight: 600; }
#boardTitle {
  margin: 0; font: 700 21px/1.2 var(--serif); letter-spacing: -.01em; text-align: center; padding: 2px 10px; border-radius: 6px;
  max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; outline: none;
}
#boardTitle.editable { cursor: text; }
#boardTitle.editable:hover { background: var(--hover); }
#boardTitle[contenteditable] { background: var(--hover); text-overflow: clip; }
#status { grid-column: 1; }
#boardTitle { grid-column: 2; }
.row2-actions { grid-column: 3; display: flex; justify-content: flex-end; gap: 2px; }
.txt-btn { display: flex; align-items: center; gap: 5px; border: 0; background: none; padding: 5px 9px; border-radius: 6px; cursor: pointer; font-size: 12.5px; font-weight: 500; }
.txt-btn:hover { background: var(--hover); }
.txt-btn .ic { width: 15px; height: 15px; }
.txt-btn .chev { width: 12px; height: 12px; stroke-width: 2.4; }

/* ---------- left toolbar ---------- */
#toolbar {
  grid-area: tools; background: var(--toolbar); border-inline-end: 1px solid var(--border); z-index: 15;
  overflow-y: auto; overflow-x: hidden; padding: 10px 3px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  scrollbar-width: none;
}
.tb {
  display: flex; flex-direction: column; align-items: center; gap: 5px; width: 64px; padding: 6px 0 5px; border: 0; background: none;
  border-radius: 8px; cursor: pointer; font-size: 11px; color: var(--text); touch-action: none; flex: none;
}
.tb > span:last-child { line-height: 1.1; text-align: center; color: color-mix(in srgb, var(--text) 80%, transparent); }
.tb:hover { background: var(--hover); }
.tb.on { background: color-mix(in srgb, var(--focus) 16%, transparent); }
.tb.tool { cursor: grab; }
.tile {
  width: 38px; height: 31px; border-radius: 6px; background: var(--tile); box-shadow: 0 1px 2px rgba(0, 0, 0, .14);
  display: grid; place-items: center;
}
.tile .ic { width: 21px; height: 21px; }
.tile.blue { background: #4f7cf7; color: #fff; box-shadow: none; }
.tile.green { background: #3fae6a; box-shadow: none; }
.tile.art-video { background: linear-gradient(135deg, #5b8cff, #a35cf0); box-shadow: none; }
.tile.art-map { overflow: hidden; padding: 0; box-shadow: none; }
.tile.art-map svg { width: 38px; height: 31px; display: block; }
.art-line { width: 38px; height: 31px; display: grid; place-items: center; color: var(--text); }
.art-line svg { width: 30px; height: 30px; }
.art-color { width: 38px; height: 31px; position: relative; }
.art-color i { position: absolute; width: 23px; height: 20px; border-radius: 4px; }
.art-color i:first-child { left: 4px; top: 1px; background: #2fa7a0; }
.art-color i:last-child { left: 13px; top: 10px; background: #ef5f7a; box-shadow: -1px -1px 0 1px var(--toolbar); }
.tb .plain { width: 38px; height: 31px; display: grid; place-items: center; }
.tb .plain .ic { width: 23px; height: 23px; }
.tb.icon-only { padding: 8px 0; }
.tb .letter { font-size: 16px; font-weight: 700; width: 32px; height: 24px; display: grid; place-items: center; }
.tb-sep { width: 40px; height: 1px; background: var(--border); margin: 8px 0; flex: none; }
.tb-fill { flex: 1; min-height: 12px; }
.tb .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--pen); border: 2px solid var(--toolbar); box-shadow: 0 0 0 1px var(--border); }
.tb.on .dot { box-shadow: 0 0 0 2px var(--focus); }
.tb .size { border-radius: 50%; background: var(--text); }
.tool-ghost {
  position: fixed; z-index: 300; pointer-events: none; width: 150px; height: 70px; border-radius: 3px; background: var(--card);
  box-shadow: var(--shadow-lg); display: grid; place-items: center; color: var(--muted); transform: translate(-50%, -50%); opacity: .95;
}
.tool-ghost .ic { width: 26px; height: 26px; }

/* ---------- canvas ---------- */
#viewport { grid-area: main; position: relative; overflow: clip; touch-action: none; user-select: none; -webkit-user-select: none; background: var(--bg); }
#viewport.space, #viewport.space * { cursor: grab !important; }
#viewport.panning, #viewport.panning * { cursor: grabbing !important; }
#viewport.connecting, #viewport.connecting *, #viewport.line-mode, #viewport.line-mode * { cursor: crosshair !important; }
#viewport.draw-mode, #viewport.draw-mode * { cursor: crosshair !important; }
#viewport.dropping { box-shadow: inset 0 0 0 3px var(--focus); }
#layer { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; }
#marquee { position: absolute; border: 1px solid var(--focus); background: color-mix(in srgb, var(--focus) 10%, transparent); pointer-events: none; z-index: 5; }
#empty { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; color: var(--muted); text-align: center; padding: 24px; white-space: pre-line; font-size: 14px; }
#dropLine { position: fixed; height: 3px; background: var(--focus); border-radius: 2px; z-index: 50; pointer-events: none; }
#zoomToast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--chrome); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; font-size: 11px; box-shadow: var(--shadow); z-index: 30; pointer-events: none; }

/* lines */
#links { position: absolute; overflow: visible; pointer-events: none; z-index: 0; }
#links .hit { fill: none; stroke: transparent; stroke-width: 22; pointer-events: stroke; cursor: pointer; }
#links .ln { fill: none; stroke-linecap: round; }
#links .tmp { stroke-dasharray: 6 5; }
#links .lk.sel .ln, #links .lk.sel polygon { filter: drop-shadow(0 0 1.5px var(--focus)) drop-shadow(0 0 3px var(--focus)); }
#links .lh { fill: var(--chrome); stroke: var(--focus); stroke-width: 2; pointer-events: all; cursor: move; }
#links text {
  font: 500 12px var(--font); fill: var(--text); paint-order: stroke; stroke: var(--bg); stroke-width: 5px;
  text-anchor: middle; dominant-baseline: middle; pointer-events: all; cursor: pointer;
}
#drawSvg { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; z-index: 99999; }
#drawSvg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- cards ---------- */
.card { position: absolute; background: var(--card); border-radius: 2px; box-shadow: var(--shadow); color: var(--text); }
/* like Milanote: a coloured card is filled with the full colour, with dark text (white on the dark colours) */
.card[data-color] { background: var(--cc); --text: #1d1f22; --muted: rgba(29, 31, 34, .6); --hover: rgba(0, 0, 0, .07); }
.card[data-color="black"], .card[data-color="purple"], .card[data-color="blue"] { --text: #fff; --muted: rgba(255, 255, 255, .7); --hover: rgba(255, 255, 255, .12); }
/* plain cards sitting inside a coloured column keep the normal look */
.card[data-color] .card:not([data-color]) { --text: var(--ink); --muted: var(--ink-muted); --hover: var(--ink-hover); }
.card.selected { outline: 1.5px solid var(--sel); outline-offset: 0; }
.card.editing { outline: 1.5px solid var(--sel); }
.card.dragging { box-shadow: var(--shadow-lg); }
.card.flash { animation: flash 1.2s ease; }
.card.connect-target { outline: 2px dashed var(--focus); outline-offset: 3px; }
@keyframes flash { 0%, 60% { outline: 3px solid #f2c94c; outline-offset: 4px; } }
.card.in-col { position: relative; }

[data-edit] { outline: none; overflow-wrap: anywhere; min-height: 1.5em; }
[contenteditable] { user-select: text; -webkit-user-select: text; cursor: text; }
[data-ph]:empty::before { content: attr(data-ph); color: var(--muted); opacity: .8; pointer-events: none; }

.resize {
  position: absolute; right: 1px; bottom: 1px; width: 14px; height: 14px; cursor: nwse-resize; display: none; z-index: 2;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23999ca3' stroke-width='1.4' stroke-linecap='round'%3E%3Cpath d='M12 4 4 12M12 8.5 8.5 12'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.card.selected > .resize, .card:hover > .resize { display: block; }
/* corner arrow: drag it out to draw a line from this card */
.link-handle {
  position: absolute; right: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233a3c40' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M9 7h8v8'/%3E%3C/svg%3E") center / 11px no-repeat;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); cursor: crosshair; opacity: 0; transform: scale(.7); transition: opacity .12s, transform .12s; z-index: 3;
}
.card:hover > .link-handle { opacity: 1; transform: none; }
.link-handle:hover { background-color: #e8f0ff; box-shadow: 0 0 0 2px var(--focus); }
.t-board > .link-handle { right: calc(50% - 41px); top: -4px; }
.card.locked > .resize { display: none !important; }
#lineDel {
  position: absolute; z-index: 6; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--chrome); color: var(--danger); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer;
}
#lineDel .ic { width: 16px; height: 16px; }
#lineDel:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.icon-grid { display: grid; grid-template-columns: repeat(3, 34px); gap: 4px; }
.icon-grid.two { grid-template-columns: repeat(2, 34px); }
.icon-grid .mini { width: 34px; height: 32px; }
.icon-grid .mini .ic { width: 18px; height: 18px; }
body.is-dragging .link-handle, .card.editing > .link-handle { display: none; }

.mini { border: 0; background: var(--hover); border-radius: 5px; height: 26px; min-width: 26px; padding: 0 8px; display: inline-grid; place-items: center; cursor: pointer; font-size: 12px; flex: none; }
.mini .ic { width: 15px; height: 15px; }
.mini:hover { background: color-mix(in srgb, var(--text) 12%, transparent); }

.reacts { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 12px 10px; }
.react { border: 1px solid var(--border); background: var(--chrome); border-radius: 12px; padding: 0 7px; font-size: 13px; line-height: 22px; cursor: pointer; }
.react:hover { border-color: var(--muted); }

/* note */
.rich { padding: 13px 15px; min-height: 46px; }
.rich > :first-child { margin-top: 0; }
.rich > :last-child { margin-bottom: 0; }
.rich p, .rich div { margin: 0; }
.rich h1 { font: 700 1.45em/1.25 var(--serif); margin: .2em 0 .35em; }
.rich h2 { font-size: 1.15em; line-height: 1.3; margin: .2em 0 .3em; }
.rich ul, .rich ol { margin: .25em 0; padding-inline-start: 1.4em; }
.rich a { color: var(--focus); }
.rich blockquote { margin: .3em 0; padding-inline-start: 10px; border-inline-start: 3px solid var(--border); color: var(--muted); }
.rich code { font: .9em ui-monospace, Menlo, monospace; background: var(--hover); padding: 1px 4px; border-radius: 3px; }

/* to-do */
.todo-head { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px 6px; }
.todo-title { font-weight: 600; flex: 1; }
.due { font-size: 11px; color: var(--muted); background: var(--hover); border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.due.late { color: #fff; background: var(--danger); }
.todo-bar { height: 3px; background: var(--hover); margin: 0 14px 6px; border-radius: 2px; overflow: hidden; }
.todo-bar i { display: block; height: 100%; background: #46a865; transition: width .2s; }
.todo-list { list-style: none; margin: 0; padding: 0 8px; }
.todo-list li { display: flex; gap: 8px; align-items: flex-start; padding: 2px 6px; }
.todo-text { flex: 1; min-width: 0; }
.tmeta { display: inline-flex; align-items: center; gap: 3px; flex: none; cursor: pointer; height: 1.5em; }
.tmeta .avatar { width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 9.5px; font-weight: 700; display: grid; place-items: center; letter-spacing: .02em; }
.tmeta.empty { opacity: 0; color: var(--muted); transition: opacity .1s; }
.tmeta.empty .ic { width: 14px; height: 14px; }
.todo-list li:hover .tmeta.empty { opacity: .7; }
.task-del { flex: none; height: 1.5em; display: none; align-items: center; border: 0; background: none; padding: 0; color: var(--muted); cursor: pointer; }
.task-del .ic { width: 14px; height: 14px; }
.todo-list li:hover .task-del { display: inline-flex; }
.task-del:hover { color: var(--danger); }
.done .tmeta .avatar { opacity: .5; }
.task-pop { width: 260px; max-height: calc(100vh - 16px); overflow-y: auto; }
.tp-row { display: grid; grid-template-columns: 56px 1fr; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.tp-note { font-size: 12px; margin: 2px 0 10px; line-height: 1.4; }
.tp-remind { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.tp-remind .vlink-switch { margin-bottom: 8px; }
.tp-check { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; padding-inline-start: 24px; cursor: pointer; }
.tp-check input { width: 15px; height: 15px; accent-color: #4f7cf7; margin: 0; }
.tp-check.off { opacity: .45; cursor: default; }
.tp-rem-opts input[type="datetime-local"] { margin: 4px 0 6px; margin-inline-start: 24px; width: calc(100% - 24px); }
.tp-rem-opts .tp-note { margin: 4px 0 2px; margin-inline-start: 24px; }
.chk { width: 15px; height: 15px; border: 1.5px solid #b8bcc3; border-radius: 3px; flex: none; margin-top: 3px; display: grid; place-items: center; cursor: pointer; color: #fff; }
.chk .ic { width: 11px; height: 11px; stroke-width: 3; }
.done .chk { background: #46a865; border-color: #46a865; }
.done .todo-text { text-decoration: line-through; color: var(--muted); }
.add-item { display: flex; gap: 6px; align-items: center; color: var(--muted); padding: 4px 14px 12px; cursor: pointer; font-size: 13px; }
.todo-head.no-title .todo-title { display: none; }
.todo-head.no-title { padding-top: 8px; padding-bottom: 2px; }
.add-title { margin-inline-end: auto; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; padding: 0; cursor: pointer; opacity: 0; transition: opacity .1s; }
.card.selected .add-title, .card.editing .add-title { opacity: 1; }
.add-title:hover { color: var(--text, inherit); text-decoration: underline; }
.add-item .ic { width: 14px; height: 14px; }
.add-item:hover { color: var(--text); }

/* image */
.t-image .img { display: block; width: 100%; pointer-events: none; min-height: 40px; background: var(--hover); }
.caption { padding: 8px 12px; font-size: 13px; color: var(--muted); }
.card:not(.selected):not(.editing) .caption:empty { display: none; }
.credit { padding: 0 12px 9px; font-size: 11px; color: var(--muted); }
.credit a { color: var(--accent); }

/* link */
.link-thumb { position: relative; }
.link-thumb img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; pointer-events: none; background: var(--hover); }
.link-thumb.yt::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 54px; height: 38px; margin: -19px 0 0 -27px; border-radius: 10px;
  background: #f00 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7l8 5-8 5z' fill='white'/%3E%3C/svg%3E") center / 26px no-repeat;
}
.link-row { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.fav { width: 18px; height: 18px; border-radius: 4px; flex: none; }
.link-meta { flex: 1; min-width: 0; }
.link-title { font-weight: 600; line-height: 1.35; }
.link-host { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-input { display: flex; gap: 8px; align-items: center; padding: 12px 14px; color: var(--muted); }
.link-input .ic { width: 15px; height: 15px; }
.link-input [data-edit] { flex: 1; color: var(--text); }

.link-thumb.playing { aspect-ratio: 16 / 9; }
.link-thumb.playing::after { display: none; }
.link-thumb iframe { display: block; width: 100%; height: 100%; border: 0; }

/* video */
.t-video { overflow: hidden; }
.vwrap { position: relative; background: #000; cursor: pointer; }
.vid { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; pointer-events: none; }
.vid:fullscreen { pointer-events: auto; }
.vplay {
  position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; border: 0;
  background: rgba(20, 20, 22, .62); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(4px);
  transition: transform .12s, background .12s;
}
.vplay svg { width: 26px; height: 26px; margin-left: 3px; }
.vplay:hover { transform: scale(1.07); background: rgba(20, 20, 22, .8); }
.vwrap.playing .vplay { display: none; }
.vdur { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 4px; pointer-events: none; font-variant-numeric: tabular-nums; }
.card.selected .vdur, .vwrap.playing .vdur, .vwrap:hover .vdur, #theater .vdur { display: none; }
.vctl {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 6px; padding: 18px 8px 6px; cursor: default;
  background: linear-gradient(transparent, rgba(0, 0, 0, .7)); color: #fff; opacity: 0; transition: opacity .15s; pointer-events: none;
}
.card.selected .vctl, .vwrap.playing .vctl, .vwrap:hover .vctl, #theater .vctl, .vwrap:fullscreen .vctl { opacity: 1; pointer-events: auto; }
.vbtn { border: 0; background: none; color: #fff; width: 26px; height: 26px; display: grid; place-items: center; cursor: pointer; border-radius: 4px; padding: 0; flex: none; }
.vbtn:hover { background: rgba(255, 255, 255, .18); }
.vbtn svg { width: 17px; height: 17px; }
.vtime { font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vseekbox { flex: 1; min-width: 40px; position: relative; display: flex; align-items: center; }
.vseek { flex: 1; min-width: 40px; accent-color: #fff; height: 4px; cursor: pointer; }
/* comments at a second of the video: dots just above the time bar */
.vmarks { position: absolute; left: 7px; right: 7px; bottom: calc(50% + 5px); height: 0; pointer-events: none; z-index: 1; } /* the circles stay clickable above the stretch strip */
.vmark { position: absolute; bottom: 0; width: 9px; height: 9px; margin-left: -4.5px; padding: 0; border-radius: 50%; border: 1.5px solid #fff; cursor: pointer; pointer-events: auto; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
.vmark:hover { transform: scale(1.35); }
.vmeta { display: flex; align-items: center; gap: 8px; padding: 9px 12px 10px; }
.vinfo { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.vdl { display: inline-flex; align-items: center; gap: 4px; border: 0; background: var(--hover); color: var(--text); border-radius: 4px; padding: 2px 7px 2px 5px; font-size: 11.5px; font-weight: 500; cursor: pointer; }
.vdl .ic { width: 13px; height: 13px; }
.vdl:hover { background: var(--focus); color: #fff; }
.vmeta-text { flex: 1; min-width: 0; }
.vtitle { font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }

.vwrap-ph { background: #111; }
.vwrap:fullscreen { display: flex; align-items: center; justify-content: center; }
.vwrap:fullscreen .vid { width: 100vw; height: 100vh; }
.vwrap:fullscreen .vctl { padding: 30px 18px 12px; }
#theater { position: fixed; inset: 0; z-index: 380; background: rgba(12, 12, 14, .82); display: grid; place-items: center; }
#theater.vside { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 0 16px; }
.theater-side { width: 320px; flex: none; height: min(80vh, calc(100vh - 140px)); background: var(--chrome); color: var(--text); border-radius: 6px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.theater-side[hidden] { display: none; }
.tside-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.tside-list { flex: 1; overflow-y: auto; padding: 6px 0; }
.tside-empty { padding: 14px; line-height: 1.5; }
.tcmt { display: flex; gap: 9px; padding: 8px 14px; cursor: pointer; }
.tcmt:hover { background: var(--hover); }
.tcmt .cmt-meta { display: flex; align-items: center; gap: 6px; }
.tcmt .cmt-meta span { margin: 0; }
.tcmt .cmt-text { font-size: 13px; margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tcode, .tside-at { font-variant-numeric: tabular-nums; font-size: 11.5px; font-weight: 600; color: #fff; background: #4f7cf7; border-radius: 4px; padding: 1px 6px; }
.tcmt .cmt-meta .tcode { color: #fff; }
.tdel { margin-inline-start: auto; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 2px 4px; border-radius: 4px; visibility: hidden; }
.tcmt:hover .tdel { visibility: visible; }
.tdel:hover { background: var(--hover); color: var(--text); }
.tside-form { border-top: 1px solid var(--border); padding: 10px 12px 12px; }
.tside-form textarea { width: 100%; box-sizing: border-box; resize: none; border: 1px solid var(--border); border-radius: 6px; padding: 7px 9px; font: inherit; font-size: 13px; background: var(--bg); color: var(--text); }
.tside-row { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 8px; }
.tside-row .fd-toggle { width: 26px; }
.tside-row .rv-vis-btn { padding: 3px 6px; margin-inline-start: auto; }
.tside-tools { display: flex; align-items: center; gap: 1px; }
.tside-row button[type="submit"] { border: 0; background: #4f7cf7; color: #fff; font-weight: 600; font-size: 12.5px; border-radius: 6px; padding: 6px 11px; cursor: pointer; }
.tside-row button[type="submit"]:disabled { opacity: .5; }
.vlink-dl { margin: 12px 0 2px; }
.vlink-dl-note { margin: 0; }
.tguest { color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; font-size: 11px; }
.vlink-switch { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; margin: 0 0 10px; cursor: pointer; }
.vlink-switch input { width: 16px; height: 16px; accent-color: #4f7cf7; }
.vlinkon { color: #2e6be6; }
.tside-ro { border-top: 1px solid var(--border); padding: 12px 14px; }
@media (max-width: 760px) {
  #theater.vside { flex-direction: column; gap: 10px; padding: 56px 10px 10px; }
  #theater.vside .theater-box { width: 100% !important; }
  .theater-side { width: 100%; height: auto; flex: 1; min-height: 0; }
}
.theater-box { width: min(70vw, 70vh * 1.78); max-height: 80vh; box-shadow: var(--shadow-lg); border-radius: 6px; overflow: hidden; }
.theater-box.doc { height: 88vh; max-height: none; background: #525659; }
.pdf-frame { width: 100%; height: 100%; border: 0; display: block; }
.docx-view { width: 100%; height: 100%; overflow: auto; background: #525659; }
.docx-view [class$="-wrapper"] { background: #525659; padding: 24px 0; }
.docx-loading { height: 100%; display: grid; place-items: center; color: #fff; opacity: .6; }
.docx-loading .ic { width: 48px; height: 48px; }
.theater-box .vwrap { width: 100%; height: 100%; max-height: 80vh; }
/* a big file on its way to R2 */
.upbar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.15); z-index: 5; pointer-events: none; }
.upbar i { display: block; height: 100%; width: 0; background: #4f7cf7; transition: width .2s; }
.theater-close { position: fixed; top: 16px; right: 18px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.theater-close .ic { width: 22px; height: 22px; transform: rotate(45deg); }
.theater-close:hover { background: rgba(255, 255, 255, .26); }

/* pdf */
.t-pdf { overflow: hidden; }
.pdf-prev { background: #fff; border-bottom: 1px solid var(--card-border); overflow: hidden; }
.pdf-prev img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; pointer-events: none; }
.pdf-ph { height: 100%; display: grid; place-content: center; justify-items: center; gap: 6px; color: #e5484d; font-weight: 700; font-size: 13px; background: #fafafa; }
.pdf-ph .ic { width: 40px; height: 40px; stroke-width: 1.3; }
.vinfo { flex-wrap: wrap; }

/* board */
.card.t-board { background: none; box-shadow: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 4px 6px; text-align: center; }
.card.t-board[data-color] { background: none; box-shadow: none; --text: var(--ink); --muted: var(--ink-muted); --hover: var(--ink-hover); }
/* Milanote-style board: a rounded colour tile, no frame; selection rings the tile only */
.card.t-board.selected { outline: none; }
.board-icon { width: 64px; height: 64px; border-radius: 14px; background: var(--cc, #8d8f94); color: #fff; display: grid; place-items: center; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); transition: box-shadow .12s; }
.board-icon .ic { width: 30px; height: 30px; }
.board-icon.has-icon { color: color-mix(in srgb, var(--cc, #8d8f94) 38%, #15171a); }
.board-icon .bsvg { width: 34px; height: 34px; }
.board-icon { position: relative; }
.board-icon .bpic { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; display: block; pointer-events: none; object-position: 50% 22%; } /* a tall photo shows its upper part, where faces usually are */
.board-icon .bemoji { font-size: 34px; line-height: 1; }
.board-icon .bnum { font-size: 32px; font-weight: 500; color: #fff; }
/* like Milanote: a person on a board that is shared with others, a curved arrow on a board someone shared with you */
.board-icon .bb-people { position: absolute; right: -6px; bottom: -6px; width: 23px; height: 23px; border-radius: 50%; background: #26282c; box-shadow: 0 0 0 2px #fff; display: grid; place-items: center; pointer-events: none; }
.board-icon .bb-people svg { width: 13px; height: 13px; fill: #fff; }
.board-icon .bb-arrow { position: absolute; left: -7px; bottom: -7px; width: 22px; height: 22px; fill: #26282c; stroke: #fff; stroke-width: 1.8px; stroke-linejoin: round; paint-order: stroke; pointer-events: none; }
.card.t-board.in-col .board-icon .bb-people { right: -5px; bottom: -5px; width: 18px; height: 18px; }
.card.t-board.in-col .board-icon .bb-people svg { width: 10px; height: 10px; }
.card.t-board.in-col .board-icon .bb-arrow { left: -6px; bottom: -6px; width: 17px; height: 17px; }
.card.t-board.selected .board-icon { box-shadow: 0 0 0 3px var(--sel), 0 2px 8px rgba(0, 0, 0, .25); }
.board-title { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.t-board .muted { font-size: 11.5px; }
/* like Milanote: inside a column a board is a row: small tile on one side, name and count beside it */
.card.t-board.in-col, .card.t-board.in-col[data-color] { display: grid; grid-template-columns: 44px 1fr; column-gap: 12px; align-items: center; text-align: start; padding: 10px 12px; background: var(--card); box-shadow: var(--shadow); }
.card.t-board.in-col .board-icon { grid-row: span 2; width: 44px; height: 44px; border-radius: 9px; margin: 0; }
.card.t-board.in-col .board-icon .ic { width: 22px; height: 22px; }
.card.t-board.in-col .board-icon .bsvg { width: 24px; height: 24px; }
.card.t-board.in-col .board-icon .bemoji { font-size: 24px; }
.card.t-board.in-col .board-icon .bnum { font-size: 22px; }
.card.t-board.in-col .board-title { align-self: end; font-size: 13px; }
.card.t-board.in-col .muted { align-self: start; }
.card.t-board.in-col.selected { outline: 1.5px solid var(--sel); }
.card.t-board.in-col.selected .board-icon { box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.t-board.in-col > .link-handle { right: -9px; top: -9px; }

/* column */
.t-column { padding: 0 0 8px; }
.col-head { padding: 12px 10px 8px; text-align: center; }
.col-title { font: 700 15px/1.3 var(--serif); }
.col-body { display: flex; flex-direction: column; gap: 8px; margin: 0 8px; }
.col-empty { margin: 0 8px; background: var(--col-body); border-radius: 2px; padding: 22px 8px; text-align: center; color: var(--muted); font-size: 12px; }
.col-body:not(:empty) + .col-empty { display: none; }
.t-column .col-body:not(:empty) { background: var(--col-body); padding: 8px; margin: 0 8px; }
.t-column[data-color] .col-body:not(:empty) { background: none; padding: 0 8px; margin: 0; }
.t-column[data-color] .col-empty { background: rgba(0, 0, 0, .08); }
.t-column.drop-target { outline: 2px dashed var(--focus); outline-offset: 2px; }
.card.into-board { opacity: .72; transition: opacity .15s; }
.t-board .board-icon { transition: box-shadow .18s ease-out, transform .18s cubic-bezier(.3, 1.4, .5, 1), filter .18s; }
.t-board.file-over .board-icon { transform: scale(1.18); filter: brightness(.82); box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.t-board.just-in .board-icon { filter: brightness(.8); }

/* comment */
.cmt-list { padding: 10px 12px 0; display: flex; flex-direction: column; gap: 10px; }
.cmt { display: flex; gap: 9px; }
.av { width: 26px; height: 26px; border-radius: 50%; background: #e86fb0; color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.cmt-body { flex: 1; min-width: 0; }
.cmt-meta { font-size: 12px; }
.cmt-meta span { color: var(--muted); margin-inline-start: 6px; }
.cmt-reply { margin: 10px 12px 12px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
/* comments under any card (like Milanote): the thread hangs under the card and moves with it */
.card-cmts { --text: var(--ink); --muted: var(--ink-muted); --hover: var(--ink-hover); background: var(--card); color: var(--text);
  border-top: 1px solid var(--border); text-align: start; cursor: default; }
.card-cmts .cmt-list:empty { display: none; }
.card-cmts .cmt-list:empty + .cmt-reply { margin-top: 12px; }
.card-cmts .cmt-text { font-size: 13px; margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.card-cmts .cmt-reply { cursor: text; }
.card-cmts .cmt-meta { display: flex; align-items: center; }
.cmt-del { margin-inline-start: auto; border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 5px; border-radius: 4px; cursor: pointer; opacity: 0; }
.cmt:hover .cmt-del { opacity: 1; }
.cmt-del:hover { background: var(--hover); color: var(--danger); }
/* a board tile is narrow: its thread is a small card of its own under the tile */
.t-board > .card-cmts { width: 240px; align-self: center; margin-top: 6px; border: 0; border-radius: 2px; box-shadow: var(--shadow); }

/* table */
.tbl { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 13px; }
.tbl th { background: var(--hover); color: var(--muted); font-weight: 500; font-size: 11px; height: 22px; }
.tbl th:first-child { width: 28px; }
.tbl td { border: 1px solid var(--border); padding: 0; vertical-align: top; }
.tbl td [data-edit] { padding: 5px 7px; min-height: 30px; }
.tbl tr > :first-child { border-inline-start: 0; }
.tbl .tc { white-space: pre-wrap; overflow-wrap: anywhere; }
.tbl .tc.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .tc.err { color: var(--danger); font-weight: 500; }
.tbl .tc:not([contenteditable]) { user-select: none; }
.tbl .tchk-cell { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tbl .tchk-cell .chk { margin: 0; }
.tbl .tchk-cell .chk.on { background: #46a865; border-color: #46a865; }
.card.selected .tbl td.tsel { background: color-mix(in srgb, var(--focus) 12%, transparent); box-shadow: inset 0 0 0 1px var(--focus); }
.fx-pop { position: fixed; z-index: 210; background: var(--chrome); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); width: 290px; max-width: calc(100vw - 16px); overflow: hidden; font-size: 13px; }
.fx-list { max-height: 228px; overflow: auto; padding: 4px; }
.fx-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; border: 0; background: none; padding: 6px 9px; border-radius: 5px; cursor: pointer; text-align: start; font: inherit; color: var(--text); }
.fx-item b { font-weight: 600; font-size: 12.5px; letter-spacing: .02em; }
.fx-item span { color: var(--muted); font-size: 11.5px; }
.fx-item.on, .fx-item:hover { background: var(--hover); }
.fx-more { display: block; width: 100%; border: 0; border-top: 1px solid var(--border); background: none; padding: 8px 12px; text-align: start; color: var(--muted); font: 12.5px var(--font); cursor: pointer; }
.fx-more:hover { color: var(--text); background: var(--hover); }
.fx-hint { display: flex; flex-direction: column; gap: 2px; padding: 8px 11px; }
.fx-hint b { font-weight: 600; font-size: 12.5px; }
.fx-hint span { color: var(--muted); font-size: 11.5px; }
.modal-card.fx-help { width: min(680px, 100%); }
.modal-card.fx-help p { margin: 0 0 12px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.modal-card.fx-help kbd { white-space: normal; word-break: break-word; }

/* swatch */
.card.t-swatch { overflow: hidden; }
.sw { aspect-ratio: 150 / 122; cursor: pointer; position: relative; }
.sw-hex { position: absolute; left: 10px; top: 9px; font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.sw-meta { padding: 9px 10px 11px; }
.sw-name { font-weight: 500; font-size: 12.5px; line-height: 1.3; }
.sw-name[data-ph]:empty::before { color: var(--text); opacity: 1; }

/* file */
.t-file { display: flex; align-items: center; gap: 10px; padding: 10px; }
.t-file:has(.docx-prev) { flex-wrap: wrap; padding-top: 0; }
.docx-prev { flex: 0 0 calc(100% + 20px); margin: 0 -10px 4px; aspect-ratio: 1 / 1.414; overflow: hidden; position: relative; background: #fff; border-radius: 6px 6px 0 0; pointer-events: none; }
.docx-page { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.docx-page [class$="-wrapper"] { background: none !important; padding: 0 !important; display: block !important; }
.docx-page section { margin: 0 !important; box-shadow: none !important; }
.docx-ph { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; color: #2b579a; font-weight: 600; font-size: 13px; background: #f3f6fb; }
.docx-ph .ic { width: 36px; height: 36px; }
.file-ic { width: 40px; height: 48px; border-radius: 4px; background: #4f7cf7; color: #fff; flex: none; display: grid; place-items: center; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.file-meta { flex: 1; min-width: 0; }
.file-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* sketch & drawing */
.t-sketch { overflow: hidden; background: #fff; }
.sketch-img { display: block; width: 100%; background: #fff; pointer-events: none; }
.sketch-empty { aspect-ratio: 3 / 2; display: grid; place-content: center; justify-items: center; gap: 6px; color: #9a9ea6; background: #fff; font-size: 11px; text-align: center; padding: 8px; }
.sketch-empty .ic { width: 24px; height: 24px; }
.card.t-drawing, .card.t-drawing[data-color] { background: none; box-shadow: none; }
.card.t-drawing[data-color] { --text: var(--ink); --muted: var(--ink-muted); --hover: var(--ink-hover); }
.t-drawing svg { display: block; width: 100%; height: auto; overflow: visible; }
.t-drawing path { fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- menus & popovers ---------- */
.menu, .pop { position: fixed; z-index: 200; background: var(--chrome); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); }
.menu { padding: 6px; min-width: 210px; }
.mi { display: flex; width: 100%; align-items: center; gap: 10px; padding: 6px 10px; border: 0; background: none; border-radius: 5px; cursor: pointer; text-align: start; white-space: nowrap; font-size: 13px; }
.mi:hover { background: var(--hover); }
.mi .kbd { margin-inline-start: auto; color: var(--muted); font-size: 12px; padding-inline-start: 16px; }
.mi.danger { color: var(--danger); }
.mi.on { font-weight: 600; }
.mi .ic { width: 16px; height: 16px; color: var(--muted); }
.mhead { padding: 6px 10px 2px; font-size: 12px; font-weight: 600; }
.msep { height: 1px; background: var(--border); margin: 5px 4px; }
.mnote { padding: 4px 10px 2px; font-size: 11.5px; color: var(--muted); }
.mi:disabled { opacity: .4; cursor: default; }
.mi:disabled:hover { background: none; }
.colors { display: flex; flex-wrap: wrap; gap: 7px; padding: 8px 10px; max-width: 220px; }
.cdot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--chrome); box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; background: var(--cc); }
.cdot[data-color="none"], .cdot[data-color=""] { background: linear-gradient(135deg, transparent 45%, var(--danger) 46% 54%, transparent 55%), var(--card); }
.cdot:hover { transform: scale(1.12); }
.cdot.on { box-shadow: 0 0 0 2px var(--focus); }

.pop { padding: 12px; width: 300px; max-height: calc(100vh - 24px); overflow: auto; }
.pop h4 { margin: 0 0 4px; font-size: 13px; }
.pop .tip { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 8px; }
.pop-sep { height: 1px; background: var(--border); margin: 12px -12px; }
.pop-input { width: 100%; height: 32px; border: 1px solid var(--border); border-radius: 6px; padding: 0 10px; font: inherit; font-size: 13px; background: var(--chrome); color: var(--text); outline: none; }
.pop-input:focus { border-color: var(--focus); }
.btn-red { display: block; width: 100%; border: 0; border-radius: 5px; background: var(--accent); color: #fff; font-weight: 600; font-size: 13px; padding: 8px 12px; cursor: pointer; }
.btn-red:hover { filter: brightness(1.05); }
.btn-outline { display: block; width: 100%; border: 1px solid var(--border); border-radius: 5px; background: none; padding: 6px 10px; cursor: pointer; font-size: 12.5px; }
.btn-outline:hover { background: var(--hover); }
.btn-dark { display: block; width: 100%; border: 0; border-radius: 5px; background: var(--text); color: var(--chrome); font-weight: 600; padding: 8px 10px; cursor: pointer; font-size: 13px; }
.upload-art { display: grid; place-items: center; height: 90px; color: var(--accent); }
.upload-art .ic { width: 52px; height: 52px; stroke-width: 1.4; }
.img-results { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; max-height: 300px; overflow: auto; }
.img-results img { width: 100%; height: 90px; object-fit: cover; border-radius: 4px; cursor: pointer; background: var(--hover); display: block; }
.img-results img:hover { outline: 2px solid var(--focus); }
.img-results .muted { grid-column: 1 / -1; text-align: center; padding: 10px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-grid button { border: 0; background: none; font-size: 20px; padding: 3px; border-radius: 5px; cursor: pointer; }
.emoji-grid button:hover { background: var(--hover); }
.trash-list { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow: auto; }
.trash-item { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 6px; }
.trash-item:hover { background: var(--hover); }
.trash-thumb { width: 44px; height: 44px; border-radius: 4px; background: var(--hover); display: grid; place-items: center; flex: none; overflow: hidden; color: var(--muted); }
.trash-thumb img { width: 100%; height: 100%; object-fit: cover; }
.trash-text { flex: 1; min-width: 0; font-size: 12.5px; }
.trash-text div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-pop .zoom-row { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.view-pop input[type=range] { flex: 1; accent-color: var(--text); }
.view-pop .zv { font-size: 12px; width: 40px; text-align: end; font-variant-numeric: tabular-nums; }
.check-row { display: flex; align-items: center; gap: 8px; padding: 4px 10px 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.search-pop .res-list { margin-top: 8px; display: flex; flex-direction: column; }
.res { display: flex; gap: 10px; width: 100%; text-align: start; border: 0; background: none; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.res:hover, .res.active { background: var(--hover); }
.res .ic { margin-top: 2px; color: var(--muted); }
.res-body { min-width: 0; flex: 1; }
.res-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.res mark { background: rgba(255, 210, 0, .45); color: inherit; border-radius: 2px; }
.res-empty { padding: 12px; color: var(--muted); text-align: center; font-size: 13px; }

/* ---------- overlays ---------- */
#lightbox { position: fixed; inset: 0; z-index: 400; background: rgba(0, 0, 0, .85); display: grid; place-items: center; cursor: zoom-out; }
#lightbox img { max-width: 92vw; max-height: 92vh; box-shadow: var(--shadow-lg); }
#modal { position: fixed; inset: 0; z-index: 400; background: rgba(0, 0, 0, .45); display: grid; place-items: center; padding: 16px; }
.modal-card { background: var(--chrome); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 18px 20px; width: min(540px, 100%); max-height: 85vh; overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 16px; }
.modal-card table { width: 100%; border-collapse: collapse; }
.modal-card td { padding: 6px 4px; border-bottom: 1px solid var(--border); font-size: 13px; }
kbd { font: 12px ui-monospace, Menlo, monospace; background: var(--toolbar); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
#toast { position: fixed; left: 50%; bottom: 50px; transform: translateX(-50%); z-index: 1000; background: #222326; color: #fff; padding: 9px 15px; border-radius: 7px; box-shadow: var(--shadow-lg); font-size: 13px; max-width: calc(100vw - 32px); text-align: center; }

#sketchModal { position: fixed; inset: 0; z-index: 350; background: rgba(30, 30, 32, .72); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px; }
#sketchModal canvas { display: block; background: #fff; box-shadow: var(--shadow-lg); touch-action: none; cursor: crosshair; max-width: 100%; }
.sk-bar { display: flex; align-items: center; gap: 4px; background: #fff; color: #222; border-radius: 10px; padding: 5px; box-shadow: var(--shadow-lg); }
.sk-bar button { border: 0; background: none; color: #222; height: 32px; min-width: 32px; border-radius: 6px; display: grid; place-items: center; cursor: pointer; padding: 0 8px; font-size: 13px; font-weight: 500; }
.sk-bar button:hover:not(:disabled) { background: rgba(0, 0, 0, .06); }
.sk-bar button:disabled { opacity: .3; }
.sk-bar button.on { background: rgba(0, 0, 0, .09); }
.sk-bar .sw-btn span { width: 18px; height: 18px; border-radius: 3px; background: var(--pen); display: block; }
.sk-bar .sep { width: 1px; height: 22px; background: #ddd; margin: 0 4px; }
.sk-bar .save { background: var(--accent); color: #fff; }
.sk-bar .save:hover { background: var(--accent) !important; filter: brightness(1.06); }

#exitPresent { position: fixed; top: 14px; right: 14px; z-index: 60; border: 1px solid var(--border); background: var(--chrome); border-radius: 6px; padding: 5px 12px; cursor: pointer; font-size: 12px; opacity: .6; }
#exitPresent:hover { opacity: 1; }
body.presenting { grid-template-rows: 0 minmax(0, 1fr); grid-template-columns: 0 minmax(0, 1fr); }
body.presenting #topbar, body.presenting #toolbar { display: none; }
body.presenting .link-handle, body.presenting .resize { display: none !important; }

/* boards shared with you that you may only look at or comment on: no tools, no handles */
body.readonly { grid-template-columns: 0 minmax(0, 1fr); }
body.readonly #toolbar { display: none; }
body.readonly .link-handle, body.readonly .resize { display: none !important; }
#shareBtn.shared-in { color: var(--muted); }
/* like Milanote: who else is on this board, and the card each of them picked or is writing in */
#people { display: flex; align-items: center; margin-inline-end: 6px; }
#people[hidden] { display: none; }
#people .pav { width: 24px; height: 24px; border-radius: 50%; background: var(--pc); color: #fff; font-size: 10.5px; font-weight: 600; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--chrome); }
#people .pav + .pav { margin-inline-start: -6px; }
.pres-box { position: absolute; pointer-events: none; z-index: 99990; box-sizing: content-box; border: 2px solid var(--pc); border-radius: 6px; padding: 3px; margin: -5px 0 0 -5px; }
.pres-tag { position: absolute; pointer-events: none; z-index: 99991; transform: translate(-5px, calc(-100% - 7px)); background: var(--pc); color: #fff; font: 600 11px/1.2 var(--font); padding: 3px 7px; border-radius: 5px; white-space: nowrap; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }

/* the Share window */
.share-pop { width: 360px; }
.share-note { font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
.share-add, .share-link { display: flex; gap: 6px; }
.share-add input, .share-link input { flex: 1; min-width: 0; }
.share-add input, .share-add select, .share-link input, .share-row select {
  font: inherit; font-size: 12.5px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text);
}
.share-add button, .share-copy {
  border: 0; border-radius: 6px; background: var(--accent); color: #fff; font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 12px; cursor: pointer;
}
.share-add button:disabled { opacity: .5; }
/* the people you shared with before, under the field (like Milanote) */
.share-who { flex: 1; min-width: 0; position: relative; display: flex; }
.share-sugg { position: absolute; top: calc(100% + 4px); inset-inline-start: 0; width: max(100%, 250px); max-height: 300px; overflow-y: auto; z-index: 5;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 5px; }
.share-sugg[hidden] { display: none; }
.share-add .share-person { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: var(--text); font: inherit; font-weight: 400; text-align: start; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.share-add .share-person:hover, .share-add .share-person.on { background: var(--hover); }
.share-person .avatar { width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.share-person .sp-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.share-person b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-person small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.share-list p { margin: 0; }
.share-row { display: flex; align-items: center; gap: 8px; }
.share-row > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.share-del { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 5px; }
.share-del:hover { background: var(--hover); color: var(--danger); }
.user-add { flex-wrap: wrap; }
.user-add input { flex: 1 1 140px; }
.user-row small { display: block; font-size: 11px; }
.user-pw { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 5px; display: grid; }
.user-pw:hover { background: var(--hover); color: var(--text); }
.user-pw svg { width: 16px; height: 16px; }
@media (max-width: 480px) { .share-pop { width: calc(100vw - 32px); } .share-add { flex-wrap: wrap; } }

/* ---------- Share: a window in the middle, like Milanote (people on the left, the read-only link on the right) ---------- */
.share-modal { position: fixed; inset: 0; z-index: 500; background: rgba(0, 0, 0, .55); display: grid; place-items: center; padding: 16px; overflow: auto; }
.sm-box { position: relative; width: min(760px, 100%); display: grid; grid-template-columns: 1fr 1fr; background: var(--chrome); color: var(--text);
  border-radius: 6px; box-shadow: var(--shadow-lg); font-size: 13px; }
.sm-col { padding: 30px 30px 22px; display: flex; flex-direction: column; min-width: 0; min-height: 400px; }
.sm-left { border-inline-end: 1px solid var(--border); }
.sm-col h2 { margin: 0 0 12px; font-size: 18px; font-weight: 600; }
.sm-col h4 { margin: 18px 0 8px; font-size: 13px; font-weight: 600; }
.sm-note { margin: 0; color: var(--muted); line-height: 1.5; }
.sm-note a { color: inherit; text-decoration: underline; }
.sm-close { position: absolute; top: 10px; inset-inline-end: 12px; border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; padding: 4px 8px; border-radius: 5px; cursor: pointer; z-index: 2; }
.sm-close:hover { background: var(--hover); color: var(--text); }
.share-modal .share-add input, .share-modal .share-add select { padding: 8px 10px; }
.share-modal .share-add button[type=submit] { background: #e8532d; padding: 8px 14px; }
.share-modal .share-list { max-height: 210px; overflow-y: auto; }
.sm-foot { margin-top: auto; padding-top: 18px; }
.sm-left .sm-foot .sm-opt { justify-content: flex-start; flex-direction: row-reverse; gap: 10px; color: var(--muted); }
.sm-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 6px 0; cursor: pointer; color: var(--text); }
.sm-opt[hidden] { display: none; }
.sm-main { margin: 18px 0 8px; }
.sm-link { margin-bottom: 12px; }
.sm-link input { color: var(--muted); }
.sm-opts .sm-opt { color: var(--muted); font-size: 12.5px; }
.sm-more { display: flex; gap: 6px; align-items: flex-start; margin: 2px 0 8px; }
.sm-more[hidden] { display: none; }
.sm-more textarea, .sm-more input { flex: 1; min-width: 0; font: inherit; font-size: 12.5px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); resize: vertical; }
.sm-more textarea[readonly] { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.sm-save { border: 1px solid var(--border); background: var(--card); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.sm-save:hover { background: var(--hover); }
.sm-views { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.sm-views .ic { width: 15px; height: 15px; }
.sm-missing { margin: 10px 0 0; font-size: 12px; }
/* the link is off: everything under the switch is faint and cannot be used yet (like Milanote) */
.sm-off .sm-link, .sm-off .sm-opts, .sm-off .sm-views { opacity: .45; pointer-events: none; }
.sm-nosql .sm-main { opacity: .45; pointer-events: none; }
/* a switch, green when on */
input.tg { appearance: none; -webkit-appearance: none; flex: none; width: 30px; height: 17px; border-radius: 9px; background: #c9ccd1; position: relative; cursor: pointer; margin: 0; transition: background .15s; }
input.tg::after { content: ''; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
input.tg:checked { background: #3fb36b; }
input.tg:checked::after { transform: translateX(13px); }
input.tg:focus-visible { outline: 2px solid var(--focus, #4f7cf7); outline-offset: 2px; }
@media (prefers-color-scheme: dark) { input.tg:not(:checked) { background: #4a4d54; } }
@media (max-width: 720px) {
  .sm-box { grid-template-columns: 1fr; }
  .sm-left { border-inline-end: 0; border-bottom: 1px solid var(--border); }
  .sm-col { min-height: 0; padding: 26px 18px 18px; }
  .share-modal .share-add { flex-wrap: wrap; }
  .share-modal .share-who { flex: 1 1 100%; }
  .share-modal .share-add select { flex: 1; }
}

/* ---------- the bell ---------- */
#bellBtn { position: relative; }
#bellBtn[hidden] { display: none; }
.bell-n { position: absolute; top: 1px; inset-inline-end: 0; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: #e5484d; color: #fff;
  font-size: 9.5px; font-weight: 700; line-height: 15px; text-align: center; pointer-events: none; }
.bell-pop { width: 340px; padding: 0; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; }
.bell-all { border: 0; background: none; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; padding: 2px 4px; }
.bell-list { display: flex; flex-direction: column; padding: 0 6px 6px; max-height: 60vh; overflow-y: auto; }
.bell-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; border: 0; background: none; color: var(--text); font: inherit; font-size: 12.5px; text-align: start; padding: 9px 8px; border-radius: 6px; cursor: pointer; position: relative; }
.bell-item:hover { background: var(--hover); }
.bell-item.unread { background: rgba(79, 124, 247, .08); }
.bell-item.unread::after { content: ''; position: absolute; top: 14px; inset-inline-end: 8px; width: 7px; height: 7px; border-radius: 50%; background: #4f7cf7; }
.bell-item .avatar { width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.bi-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-inline-end: 12px; line-height: 1.4; }
.bi-text q { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bi-text small { color: var(--muted); font-size: 11px; }
.bell-empty { margin: 0; padding: 6px 14px 16px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

/* ---------- someone who opened a read-only link: nothing to change, only to look (and comment, if allowed) ---------- */
body.link-mode #shareBtn, body.link-mode #exportBtn, body.link-mode #settingsBtn, body.link-mode #quickBtn, body.link-mode #undoBtn,
body.link-mode #redoBtn, body.link-mode #bellBtn, body.link-mode #people, body.link-mode #status, body.link-mode #quickPanel,
body.link-mode #quickBar, body.link-mode #phoneNav, body.link-mode #quickView, body.link-mode #toolbar, body.link-mode #phoneBar { display: none !important; }
body.link-mode { grid-template-columns: 0 minmax(0, 1fr); }
body.link-nodl .file-dl, body.link-nodl .vdl:not(.vcount):not(.mopen):not(.msearch):not(.vlinkon) { display: none !important; }
body.embed #topbar .row1 { display: none; }
.link-msg p { font-size: 14px; color: var(--text); }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  body { grid-template-rows: auto minmax(0, 1fr) 64px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main" "tools"; }
  #status, #helpBtn { display: none; }
  #boardTitle { font-size: 17px; }
  .txt-btn { padding: 5px 6px; }
  #toolbar { flex-direction: row; overflow-x: auto; overflow-y: hidden; border-inline-end: 0; border-top: 1px solid var(--border); padding: 4px; }
  .tb-sep { width: 1px; height: 32px; margin: 0 6px; }
  .tb-fill { display: none; }
}

/* board icon picker */
.pop.icon-pop { width: 316px; padding: 8px; }
.ip-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.ip-tabs button { flex: 1; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; padding: 6px; border-radius: 6px; cursor: pointer; }
.ip-tabs button.on { background: var(--hover, rgba(127, 127, 127, .15)); color: var(--text); }
.ip-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; max-height: 260px; overflow-y: auto; align-content: start; }
.ip-grid .bi { height: 36px; border: 0; border-radius: 7px; background: none; color: var(--text); display: grid; place-items: center; cursor: pointer; padding: 0; }
.ip-grid .bi:hover { background: var(--hover, rgba(127, 127, 127, .15)); }
.ip-grid .bi.on { box-shadow: inset 0 0 0 2px var(--focus); }
.ip-grid .bi .bsvg { width: 22px; height: 22px; }
.ip-grid .be { font-size: 21px; }
.ip-search { width: 100%; box-sizing: border-box; margin-bottom: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px; background: transparent; color: var(--text); font: inherit; outline: none; }
.ip-search:focus { border-color: var(--focus); }
.ip-none { grid-column: 1 / -1; padding: 18px 0; text-align: center; }
.ip-upload { margin-top: 8px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 7px; padding: 7px; background: var(--hover, rgba(127, 127, 127, .15)); color: var(--text); font: inherit; cursor: pointer; }
.ip-upload .ic { width: 16px; height: 16px; }
.ip-remove { margin-top: 8px; width: 100%; border: 0; border-radius: 7px; padding: 7px; background: var(--hover, rgba(127, 127, 127, .15)); color: var(--text); font: inherit; cursor: pointer; }

/* heading: big text straight on the board */
.card.t-heading { background: none; box-shadow: none; padding: 6px 10px; }
/* like Milanote: a coloured heading gets a filled box with dark text */
.card.t-heading[data-color] { background: var(--cc); box-shadow: var(--shadow); padding: 14px 16px; }
.t-heading[data-color] .heading-text { color: #1d1f22; }
.t-heading[data-color="black"] .heading-text, .t-heading[data-color="purple"] .heading-text, .t-heading[data-color="blue"] .heading-text { color: #fff; }
.heading-text { font-family: Lora, Georgia, serif; font-size: 30px; font-weight: 700; line-height: 1.25; min-height: 1.25em; }
.heading-text p, .heading-text h1, .heading-text h2, .heading-text blockquote { margin: 0; font: inherit; }
.heading-text ul, .heading-text ol { margin: 0; padding-inline-start: 1.2em; }
.heading-text h1 { font-size: 1.3em; }
.heading-text h2 { font-size: .75em; }
.heading-text blockquote { font-style: italic; opacity: .85; }
.heading-text code { font-size: .8em; }

/* document card */
.card.t-doc { padding: 14px 14px 10px; }
.doc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.doc-head .ic { width: 20px; height: 20px; flex: none; color: var(--muted); }
.doc-title { font-weight: 600; font-size: 15px; line-height: 1.3; flex: 1; min-width: 0; }
.doc-snip { font-size: 12.5px; line-height: 1.5; color: color-mix(in srgb, var(--text) 75%, transparent); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; white-space: pre-line; }
#docEditor { position: fixed; inset: 0; z-index: 390; background: rgba(12, 12, 14, .7); display: flex; justify-content: center; overflow-y: auto; padding: 40px 16px; }
.doc-sheet { width: min(760px, 100%); min-height: calc(100vh - 80px); background: var(--card); color: var(--text); border-radius: 6px; box-shadow: var(--shadow-lg); padding: 0 64px 64px; height: fit-content; }
.doc-bar { position: sticky; top: -40px; display: flex; align-items: center; gap: 2px; padding: 12px 0; margin-bottom: 18px; background: var(--card); border-bottom: 1px solid var(--border); z-index: 1; }
.doc-bar button { border: 0; background: none; color: var(--text); min-width: 32px; height: 30px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 14px; display: grid; place-items: center; }
.doc-bar button:hover { background: var(--hover); }
.doc-bar .ic { width: 18px; height: 18px; }
.doc-bar .sp { flex: 1; }
.doc-bar [data-close] .ic { transform: rotate(45deg); width: 22px; height: 22px; }
.doc-ed-title { font-family: Lora, Georgia, serif; font-size: 32px; font-weight: 700; line-height: 1.25; outline: none; margin-bottom: 14px; }
.doc-ed-body { font-size: 16px; line-height: 1.7; outline: none; min-height: 50vh; }
@media (max-width: 640px) { .doc-sheet { padding: 0 20px 40px; } }

/* audio card */
.card.t-audio { padding: 12px; }
.aud { display: flex; gap: 12px; align-items: center; }
.aud audio { display: none; }
.aplay { width: 44px; height: 44px; border-radius: 50%; border: 0; flex: none; background: #3fae6a; color: #fff; display: grid; place-items: center; cursor: pointer; }
.aplay svg { width: 22px; height: 22px; }
.aud-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.aseek { width: 100%; accent-color: #3fae6a; margin: 2px 0; cursor: pointer; }

/* map card */
.card.t-map { padding: 0; overflow: hidden; }
.map-search { display: flex; align-items: center; gap: 8px; padding: 14px; }
.map-search .ic { width: 20px; height: 20px; color: var(--muted); flex: none; }
.map-search [data-edit] { flex: 1; min-width: 0; }
.map-frame { aspect-ratio: 4 / 3; background: #dfe8d8; }
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; pointer-events: none; }

/* a selected map can be zoomed and moved (drag the card by its caption) */
.card.t-map.selected .map-frame iframe { pointer-events: auto; }
body.is-dragging .map-frame iframe { pointer-events: none !important; }
.map-addr { font-size: 11.5px; line-height: 1.4; margin-top: 2px; }

/* swatch toolbar: the Color button is the colour itself, Display shows HEX / RGB */
.sw-chip { width: 26px; height: 22px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 1px 2px rgba(0, 0, 0, .25); }
.hex-badge { min-width: 30px; height: 22px; padding: 0 3px; border-radius: 5px; background: var(--tile); font-size: 9.5px; font-weight: 700; letter-spacing: .02em; display: grid; place-items: center; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }

/* toolbar: tools that don't fit wait in the ••• popup */
.tb[hidden] { display: none; }
.pop.tools-pop { width: auto; padding: 8px; }
.tool-grid { display: grid; grid-template-columns: repeat(2, 64px); gap: 4px; }
.tool-grid .tb { width: 64px; }

/* template chooser on a new board (bottom right, like Milanote) */
#tplPanel {
  position: fixed; right: 18px; bottom: 18px; z-index: 60; width: 272px; padding: 14px; border-radius: 10px;
  background: var(--chrome); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.tp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 15px; }
.tp-x { border: 0; background: none; color: var(--muted); width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; cursor: pointer; }
.tp-x .ic { width: 18px; height: 18px; transform: rotate(45deg); }
.tp-x:hover { background: var(--hover); color: var(--text); }
.tp-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.tp-item { display: flex; align-items: center; justify-content: space-between; border: 0; background: none; color: var(--text); font: inherit; font-size: 13.5px; text-align: start; padding: 7px 12px; border-radius: 6px; cursor: pointer; }
.tp-item:hover { background: var(--hover); }
.tp-item.on { background: color-mix(in srgb, var(--text) 10%, transparent); }
.tp-badge { font-size: 9.5px; font-weight: 700; letter-spacing: .03em; padding: 2px 5px; border-radius: 4px; background: color-mix(in srgb, var(--text) 12%, transparent); }
.tp-go { width: 100%; border: 0; border-radius: 6px; padding: 10px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.tp-go:hover { filter: brightness(1.06); }
.tp-keep { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--muted); cursor: pointer; }
.tp-keep input:disabled + * , .tp-keep:has(input:disabled) { opacity: .6; }
.tp-more { color: var(--muted); }
.tp-more .ic { width: 16px; height: 16px; transform: rotate(-90deg); }
.tp-back { display: flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12.5px; padding: 2px 4px 8px; cursor: pointer; }
.tp-back .ic { width: 15px; height: 15px; }
.tp-back:hover { color: var(--text); }
.tp-scroll { max-height: min(52vh, 420px); overflow-y: auto; }
.tp-group { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 10px 12px 4px; }
.tp-group:first-child { padding-top: 2px; }
[dir="rtl"] .tp-more .ic { transform: rotate(90deg); }
.tp-search { margin: 0 0 6px; }
.tp-none { padding: 10px 12px; font-size: 12.5px; }
/* coloured label chips inside notes (used by the film storyboard) */
.rich .tag { display: inline-block; font-size: 10.5px; font-weight: 600; line-height: 1; padding: 3px 6px; border-radius: 4px; background: var(--tg); color: #fff; margin: 4px 2px 0 0; }
.rich h3 { font-size: 1em; font-weight: 700; margin: 0 0 .35em; }
/* empty image box: click or drop a picture on it */
.img-empty { aspect-ratio: 3 / 2; background: #121315; color: #8b8e94; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-size: 12px; transition: color .12s; }
.img-empty .ic { width: 26px; height: 26px; }
.img-empty:hover { color: #d6d8dc; }
.img-empty.fill-target { color: #fff; box-shadow: inset 0 0 0 3px var(--focus); background: color-mix(in srgb, var(--focus) 18%, #121315); }
/* image in a fixed frame (16:9 …): cropped to fill, picture can be moved inside */
.img-frame { position: relative; overflow: hidden; background: #121315; }
.img-frame .img { width: 100%; height: 100%; object-fit: cover; min-height: 0; }
.img-frame.repos { cursor: grab; box-shadow: inset 0 0 0 2px var(--focus); }
.img-frame.repos .img { outline: 2px solid var(--focus); outline-offset: -2px; }
.repos-hint { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 9px; border-radius: 7px; background: rgba(0, 0, 0, .68); color: #fff; font-size: 11.5px; }
.repos-hint .ic { width: 15px; height: 15px; flex: none; }
.repos-z { border: 0; background: rgba(255, 255, 255, .14); color: #fff; width: 22px; height: 22px; border-radius: 5px; font-size: 15px; line-height: 1; cursor: pointer; flex: none; }
.repos-z:hover { background: rgba(255, 255, 255, .26); }
.repos-range { flex: 1; min-width: 40px; accent-color: #fff; cursor: pointer; }
.repos-done { border: 0; border-radius: 5px; padding: 4px 10px; background: #fff; color: #111; font: inherit; font-weight: 600; cursor: pointer; }

/* sign-in screen */
#auth { position: fixed; inset: 0; z-index: 900; background: var(--bg); display: grid; place-items: center; padding: 16px; }
.auth-box { width: min(360px, 100%); background: var(--chrome); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 28px 24px 18px; display: grid; gap: 12px; text-align: center; }
.auth-logo { width: 44px; height: 44px; margin: 0 auto; border-radius: 50%; background: var(--text); color: var(--chrome); display: grid; place-items: center; font: 700 20px var(--font); }
.auth-box h1 { margin: 0; font: 600 20px var(--font); }
.auth-box p { margin: 0; color: var(--muted); font-size: 13px; }
.auth-box input { font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text); text-align: left; direction: ltr; }
.auth-box input:focus { outline: 2px solid var(--focus); outline-offset: -1px; }
.auth-box button[type=submit] { font: 600 14px var(--font); padding: 10px; border: 0; border-radius: 8px; background: var(--text); color: var(--chrome); cursor: pointer; }
.auth-box button[type=submit]:disabled { opacity: .6; cursor: default; }
.auth-box .auth-sent { color: var(--text); font-size: 14px; }
.auth-box .auth-err { color: var(--danger); }
.auth-alt, .auth-lang, .auth-link { font: 13px var(--font); border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; }
.auth-alt:hover, .auth-lang:hover, .auth-link:hover { color: var(--text); }

/* video comments: small circles and no speed/volume on a card on the board (they show in the large view and full screen) */
.card .vmark.rv-mark { width: 12px; height: 12px; margin-left: -6px; font-size: 0; }
.card .vwrap:not(:fullscreen) .vspeed, .card .vwrap:not(:fullscreen) .rv-vol { display: none; }
.vctl .rv-vol { flex: none; }
.tside-at { cursor: pointer; }

/* questions inside the app (instead of the browser's pop-ups) */
.ask { position: fixed; inset: 0; z-index: 950; background: rgba(0, 0, 0, .45); display: grid; place-items: center; padding: 16px; }
.ask-in { position: absolute; z-index: 20; background: var(--chrome); border-radius: inherit; overflow: auto; }
.ask-box { width: min(340px, 100%); display: grid; gap: 12px; text-align: center; padding: 26px 22px 18px; background: var(--chrome); border-radius: 10px; box-shadow: var(--shadow-lg); }
.ask-in .ask-box { box-shadow: none; background: none; }
.ask-box.cam-box { width: min(720px, 100%); }
.cam-box video { width: 100%; max-height: 60vh; border-radius: 7px; background: #000; transform: scaleX(-1); }
.cam-btn { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 6px; }
.cam-btn .ic { width: 16px; height: 16px; }
.ask-box h3 { margin: 0; font: 600 22px var(--font); }
.ask-box p { margin: 0; font-size: 14px; line-height: 1.45; white-space: pre-line; }
.ask-box .ask-err { color: var(--danger); font-size: 13px; }
.ask-box input { font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 7px; background: var(--card); color: var(--text); }
.ask-box input:focus { outline: 2px solid var(--focus); outline-offset: -1px; }
.ask-ok { font: 600 14px var(--font); padding: 10px; border: 0; border-radius: 6px; background: var(--text); color: var(--chrome); cursor: pointer; margin-top: 4px; }
.ask-ok.danger { background: #e5484d; color: #fff; }
.ask-cancel { font: 14px var(--font); border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 4px; }
.ask-cancel:hover { color: var(--text); }
.pop:has(.ask-in) { min-height: 260px; overflow: hidden; }

/* settings window, like Milanote's */
#settingsWin { position: fixed; inset: 0; z-index: 600; background: rgba(0, 0, 0, .45); display: grid; place-items: center; padding: 16px; }
.sw-box { position: relative; width: min(820px, 100%); height: min(580px, calc(100vh - 32px)); background: var(--chrome); border-radius: 10px; box-shadow: var(--shadow-lg); display: grid; grid-template-columns: 210px 1fr; overflow: hidden; }
.sw-nav { padding: 28px 14px; display: flex; flex-direction: column; gap: 2px; }
.sw-nav button { text-align: start; border: 0; background: none; padding: 10px 14px; border-radius: 6px; font: 14.5px var(--font); color: var(--text); cursor: pointer; }
.sw-nav button:hover, .sw-nav button.on { background: var(--hover); }
.sw-body { padding: 30px 36px; overflow: auto; min-width: 0; }
.sw-body h2 { margin: 0 0 18px; font: 600 22px var(--font); }
.sw-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 14px; }
.sw-daily { font-size: 14px; padding: 9px 0; gap: 16px; }
.sw-row > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-act { border: 0; background: none; color: #e8613c; font: 600 13.5px var(--font); cursor: pointer; padding: 2px 0; }
.sw-act:hover { text-decoration: underline; }
.sw-sep { border-top: 1px solid var(--border); margin: 18px 0 12px; }
.sw-h3 { margin: 0 0 10px; font: 600 15px var(--font); }
.sw-usage { display: grid; gap: 14px; font-size: 14px; }
.us-label { font-weight: 500; margin-bottom: 6px; }
.us-bar { height: 8px; border-radius: 4px; background: var(--hover); overflow: hidden; }
.us-bar span { display: block; height: 100%; border-radius: 4px; background: var(--focus); }
.us-bar span.full { background: var(--danger); }
.us-text { font-size: 12.5px; margin-top: 5px; }
.us-note { font-size: 12.5px; margin: 0; }
.lim-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.lim-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; font-size: 14px; }
.lim-top > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lim-top small { display: block; font-size: 11px; }
.lim-val { font-weight: 600; white-space: nowrap; }
.lim-range { width: 100%; margin-top: 8px; accent-color: var(--focus); }
.us-move { display: grid; gap: 8px; justify-items: start; padding-top: 4px; }
.us-move-msg:empty { display: none; }
.us-move-btn:disabled { opacity: .5; cursor: default; text-decoration: none; }
.sw-close { position: absolute; top: 12px; inset-inline-end: 14px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.sw-close:hover { background: var(--hover); color: var(--text); }
.sw-body .share-list { margin-top: 12px; display: grid; gap: 8px; }
@media (max-width: 640px) {
  .sw-box { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: calc(100vh - 32px); }
  .sw-nav { flex-direction: row; overflow-x: auto; padding: 12px 48px 8px 12px; border-bottom: 1px solid var(--border); }
  .sw-nav button { white-space: nowrap; }
  .sw-body { padding: 20px 18px; }
}

/* ---------- quick notes ("From your phone") ---------- */
#quickBtn { width: auto; min-width: 32px; padding: 0 6px; display: flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); }
#quickBtn .ic { color: var(--text); }
#quickBtn.on { background: var(--hover); }
#quickPanel {
  position: fixed; top: 92px; right: 152px; z-index: 40; width: 376px; max-height: calc(100vh - 110px); display: flex; flex-direction: column;
  background: var(--chrome); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg);
}
#quickPanel h3 { margin: 0; padding: 14px 16px 13px; border-bottom: 1px solid var(--border); text-align: center; font-size: 15px; font-weight: 600; }
.qp-list { overflow-y: auto; padding: 24px 22px; display: flex; flex-direction: column; gap: 12px; min-height: 80px; }
.qn-empty { margin: 0; color: var(--muted); font-size: 13px; text-align: center; line-height: 1.5; }
.qn { position: relative; background: var(--card); box-shadow: var(--shadow); border-radius: 2px; color: var(--text); cursor: default; user-select: none; -webkit-user-select: none; }
#quickPanel .qn { cursor: grab; background: color-mix(in srgb, var(--card) 88%, var(--bg)); }
.qn.selected, .qn.editing { outline: 1.5px solid var(--sel); }
.qn.editing, .qn [contenteditable] { user-select: text; -webkit-user-select: text; cursor: text; }
.qn .rich { padding: 20px 22px; min-height: 64px; }
.qn .rich:empty::before, .qn-title:empty::before { content: attr(data-ph); color: var(--muted); }
.qn [contenteditable] { outline: none; }
.qn-todo { padding: 18px 22px; }
.qn-title { font: 700 16px/1.35 var(--serif); margin-bottom: 8px; }
.qn-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.qn-items li { display: flex; align-items: flex-start; gap: 10px; }
.qn-chk { width: 18px; height: 18px; border: 1.5px solid var(--text); border-radius: 2px; flex: none; margin-top: 2px; display: grid; place-items: center; cursor: pointer; color: #fff; }
.qn-chk .ic { width: 12px; height: 12px; stroke-width: 3; }
.qn-items .done .qn-chk { background: #46a865; border-color: #46a865; }
.qn-items .done .qn-text { color: var(--muted); text-decoration: line-through; }
.qn-text { flex: 1; min-width: 0; min-height: 1.5em; word-break: break-word; }
.qn-add { display: flex; gap: 8px; align-items: center; color: var(--muted); margin-top: 8px; cursor: pointer; font-size: 13px; }
.qn-add .ic { width: 15px; height: 15px; }
.qn-del { position: absolute; top: 6px; inset-inline-end: 6px; width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.qn-del:hover { background: var(--hover); color: var(--danger); }
.qn-del .ic { width: 16px; height: 16px; }
.qn-ghost { position: fixed; z-index: 300; pointer-events: none; opacity: .92; box-shadow: var(--shadow-lg); transform: rotate(-1.5deg); }
.qn-ghost .qn-del, .qn-ghost .qn-add { display: none; }
.qn-lifted { opacity: .35; }
#phoneNav, #quickView, #phoneBar, #quickBar { display: none; }
.qn[data-color] { background: var(--cc) !important; --text: #1d1f22; --muted: rgba(29, 31, 34, .6); color: var(--text); }
.qn[data-color="black"], .qn[data-color="purple"], .qn[data-color="blue"] { --text: #fff; --muted: rgba(255, 255, 255, .7); }
.qn[data-color] .qn-chk { border-color: currentColor; }
.qn-due { display: inline-flex; align-items: center; gap: 5px; margin: 8px 0 0 28px; padding: 2px 8px; border-radius: 5px; font-size: 12.5px; color: #2f8a4a; background: rgba(70, 168, 101, .14); }
.qn-due .ic { width: 13px; height: 13px; }
.qn[data-color] .qn-due:not(.late) { background: rgba(255, 255, 255, .75); color: #23733d; }
.qn-due.late { color: #fff; background: var(--danger); }
.qn-image { overflow: hidden; }
.qn-image img { display: block; width: 100%; height: auto; pointer-events: none; } /* the whole picture, as in Milanote */
.qp-list > *, #quickView > * { flex: none; } /* notes keep their own height; the list scrolls instead of squeezing them */
.qn-imgph { height: 140px; display: grid; place-items: center; color: var(--muted); }
.qn-imgph .ic { width: 30px; height: 30px; }
.qn-up img, .qn-up .qn-imgph { opacity: .45; }
.qn-up::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 40%; background: var(--focus); animation: qn-up 1.2s ease-in-out infinite; }
@keyframes qn-up { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.qn-image .qn-del { background: rgba(0, 0, 0, .45); color: #fff; }
.qn-file { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; padding: 12px 14px; }
.qn-file > .ic { grid-row: span 2; width: 28px; height: 28px; color: var(--muted); }
.qn-fname { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qn-fsize { font-size: 12px; color: var(--muted); }

@media (max-width: 720px) {
  #quickBtn { display: none; }
  /* on the phone: look, find, change text, download; adding cards is for the computer (as in Milanote) */
  #undoBtn, #redoBtn, #searchBtn, #settingsBtn { display: none; }
  /* one bar at the bottom, as in Milanote's app: ⋯ / Your boards / Quick notes / +; ⋯ swaps it for Undo, Redo, Help…;
     a tapped card swaps it for that card's tools (color, reactions, duplicate, delete…) */
  #toolbar { display: none; }
  body.card-tools:not(.quick-tab) #toolbar, body.add-open:not(.quick-tab) #toolbar { display: flex; }
  #toolbar { align-items: center; background: var(--chrome); }
  #toolbar .tb { touch-action: pan-x; flex: none; } /* swipe sideways scrolls the strip; drag a tool up onto the board */
  #toolbar .tb.icon-only { width: 44px; }
  .pb-done { margin-inline-start: auto; width: auto !important; padding: 0 14px !important; color: #e8613c; font-size: 16px !important; font-weight: 600; justify-content: center; flex: none; }
  /* the tools scroll sideways; Done stays at the edge, as in Milanote */
  .bar-scroll { display: flex; align-items: center; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; align-self: stretch; }
  .bar-scroll::-webkit-scrollbar { display: none; }
  #toolbar:has(> .bar-scroll) { overflow: hidden; }
  /* menus and pickers from the bottom bar: a sheet from the bottom, like Milanote's app */
  .menu.sheet, .pop.sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto !important; max-width: none; max-height: 70vh; overflow: auto;
    border-radius: 14px 14px 0 0; border-width: 1px 0 0; padding: 10px 10px calc(18px + env(safe-area-inset-bottom)); }
  .menu.sheet .mi { padding: 13px 12px; font-size: 16px; border-radius: 0; border-bottom: 1px solid var(--border); }
  .menu.sheet .mi .kbd { display: none; }
  .pop.sheet .colors { max-width: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; padding: 14px 8px; justify-items: center; }
  .pop.sheet .cdot { width: 40px; height: 40px; border-radius: 6px; }
  body.has-quick.pb-open #phoneBar, body:not(.has-quick):not(.card-tools) #phoneBar { display: flex; }
  #phoneBar { grid-area: tools; display: none; align-items: center; justify-content: space-around; background: var(--chrome); border-top: 1px solid var(--border); padding: 0 4px; z-index: 15; }
  #phoneBar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; color: var(--text); font-size: 12px; padding: 6px 0; cursor: pointer; }
  #phoneBar button:disabled { opacity: .35; }
  #phoneBar .ic { width: 23px; height: 23px; }
  .pb-sep { width: 1px; height: 36px; background: var(--border); flex: none; }
  .modal-card td { display: block; border: 0 !important; padding: 2px 0 !important; }
  .modal-card tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .modal-card kbd { font-family: inherit; }
  body { grid-template-rows: auto minmax(0, 1fr) calc(64px + env(safe-area-inset-bottom)); }
  #toolbar, #phoneBar { padding-bottom: env(safe-area-inset-bottom); }
  body.has-quick.card-tools:not(.quick-tab) #phoneNav, body.has-quick.add-open:not(.quick-tab) #phoneNav, body.has-quick.pb-open #phoneNav { display: none; }
  body.has-quick #phoneNav {
    grid-area: tools; display: flex; align-items: center; gap: 4px; padding: 0 10px env(safe-area-inset-bottom); z-index: 45;
    background: var(--chrome); border-top: 1px solid var(--border);
  }
  #phoneNav button { border: 0; background: none; border-radius: 6px; padding: 8px 14px; font-size: 16px; font-weight: 500; color: var(--muted); cursor: pointer; }
  #phoneNav button.on { background: var(--hover); color: var(--text); }
  #phoneNav [data-pn="boards"] { margin-inline-start: auto; }
  #phoneNav .pn-add { margin-inline-start: auto; color: var(--text); padding: 6px 10px; }
  #phoneNav .pn-more { color: var(--text); padding: 6px 10px; }
  #phoneNav .ic { width: 24px; height: 24px; }
  /* a tapped quick note: its own bar takes the place of the tabs (right above the keyboard while typing) */
  body.quick-tab.qsel #phoneNav { display: none; }
  body.quick-tab.qsel #quickBar { grid-area: tools; display: flex; align-items: center; gap: 2px; padding: 0 8px env(safe-area-inset-bottom); z-index: 46;
    background: var(--chrome); border-top: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
  #quickBar .tb { flex: none; width: 58px; touch-action: manipulation; }
  #quickBar .tb.icon-only { width: 44px; }
  /* text tools while typing: as big as Milanote's, and dark when on */
  .tb.rt { width: 46px !important; padding: 6px 0 !important; flex: none; }
  .tb.rt .plain { width: 40px; height: 40px; border-radius: 7px; font-size: 21px; line-height: 1; }
  .tb.rt .plain .ic { width: 24px; height: 24px; }
  .tb.rt.on .plain { background: var(--text); color: var(--chrome); }
  #quickView .qn-del { display: none; } /* on the phone: More → Move to trash, as in Milanote */
  body.quick-tab #quickView:not([hidden]) {
    display: flex; flex-direction: column; gap: 16px; position: fixed; inset: 0 0 calc(64px + env(safe-area-inset-bottom)); z-index: 42; bottom: calc(64px + env(safe-area-inset-bottom));
    overflow-y: auto; padding: 24px 16px 40px; background: var(--bg); overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch;
  }
  #quickView .qn { font-size: 17px; }
  #quickView .qn .rich { padding: 22px 26px; min-height: 80px; }
  #quickView .qn-todo { padding: 22px 26px; }
  #quickView .qn-title { font-size: 19px; }
  #quickView .qn-chk { width: 21px; height: 21px; }
  #quickView .qn-empty { padding: 40px 12px; font-size: 14px; }
}
/* a file that is only on this computer so far (Cloud.failed): a red mark on its card, click to try again */
.upfail { position: absolute; left: 6px; bottom: 6px; z-index: 6; border: 0; border-radius: 6px; padding: 3px 8px; font-family: inherit; font-size: 11px; font-weight: 600; line-height: 1.4; background: #eb5757; color: #fff; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.upfail:hover { background: #d64545; }

/* text colours for a task */
.tcolors { display: flex; gap: 8px; align-items: center; padding: 2px 2px 6px; }
.tcolors button { width: 22px; height: 22px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; display: grid; place-items: center; }
.tcolors button:hover { transform: scale(1.12); }
.tcolors .tc-none { background: var(--hover); color: var(--muted); }
.tcolors .tc-none .ic { width: 13px; height: 13px; }
.todo-text b { font-weight: 700; }
.todo-text a { color: var(--focus); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; cursor: pointer; }
/* Milanote-like text style for task words: colour and highlight */
.pop.tstyle-pop { padding: 10px 12px 12px; width: auto; }
.tstyle .ts-h { font-size: 11px; color: var(--muted); margin: 0 0 6px; }
.tstyle .ts-row { display: flex; gap: 3px; }
.tstyle .ts-sep { height: 1px; background: var(--border); margin: 10px -12px; }
.tstyle .ts-a { width: 26px; height: 26px; border: 0; border-radius: 4px; background: none; font: 600 15px/26px var(--font); padding: 0; cursor: pointer; color: var(--text); }
.tstyle .ts-a:hover { box-shadow: 0 0 0 1.5px var(--border); }
.tstyle .ts-a.on { box-shadow: inset 0 0 0 2px var(--text); }
.tstyle .ts-hl.on, .tstyle .ts-hnone.on { box-shadow: 0 0 0 2px var(--card, #fff), 0 0 0 3.5px var(--text); }
.tstyle .ts-hnone { background: var(--text); color: var(--card, #fff); }
.tstyle .ts-hl { color: #222; }
/* words with a comment, and their comment box to the right of the list */
.todo-text .tcm { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }
.todo-text s { color: inherit; }
.wcmt { position: fixed; z-index: 60; width: 260px; background: var(--card); color: var(--text); border-radius: 8px; box-shadow: 0 4px 18px rgba(0,0,0,.16); padding: 10px 12px; font-size: 13px; }
.wcmt .cmt { display: flex; gap: 8px; margin-bottom: 10px; }
.wcmt .av { width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.wcmt .cmt-body { flex: 1; min-width: 0; }
.wcmt .cmt-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.wcmt .cmt-meta span { color: var(--muted); }
.wcmt .cmt-del { margin-inline-start: auto; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.wcmt .cmt-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 1px; }
.wcmt .cmt-text a { color: var(--focus); }
.wc-write { display: flex; align-items: center; gap: 8px; }
.wc-write input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: inherit; color: inherit; padding: 4px 0; }
.wc-send { border: 0; background: none; color: var(--focus); font: 600 12px var(--font); cursor: pointer; padding: 4px; }
/* Persian text a little lighter (Vazirmatn 300 instead of 400); bold stays bold */
.todo-text:dir(rtl), .rich:dir(rtl), .qn-text:dir(rtl), .cmt-text:dir(rtl), .card-cmts .cmt-text:dir(rtl) { font-weight: 300; }
.todo-text:dir(rtl) b, .rich:dir(rtl) b, .rich:dir(rtl) strong, .qn-text:dir(rtl) b { font-weight: 700; }
/* typing in a task: B / I / S that are on look pressed, like Milanote */
#toolbar[data-mode="task"] .tb.on { background: none; }
#toolbar[data-mode="task"] .tb.on .letter { background: var(--text); color: var(--bg); border-radius: 5px; }
#toolbar[data-mode="task"] .tb .letter { display: inline-grid; place-items: center; width: 26px; height: 26px; }
#toolbar[data-mode="task"] .tb.on .plain { background: var(--text); color: var(--bg); border-radius: 5px; }
