/* Manrope (SIL OFL), bundled so it works offline and looks the same everywhere; latin-ext = Slovak letters */
@font-face { font-family: Manrope; src: url(fonts/manrope-latin-400.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: Manrope; src: url(fonts/manrope-latin-ext-400.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: Manrope; src: url(fonts/manrope-latin-600.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: Manrope; src: url(fonts/manrope-latin-ext-600.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: Manrope; src: url(fonts/manrope-latin-700.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: Manrope; src: url(fonts/manrope-latin-ext-700.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  color-scheme: light;   /* explicit, so Windows dark mode never restyles form controls */
  --bg: #f4f4f1;
  --dot: #cfcfca;
  --ui: #ffffff;
  --ui-2: #f1f1ef;
  --line: #e2e2de;
  --ink: #1d1d1f;
  --muted: #7a7a80;
  --accent: #2f6bff;
  --accent-soft: rgba(47, 107, 255, .12);
  --danger: #e5484d;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.08);
  --font: Manrope, Arial, Helvetica, sans-serif;
  /* letter spacing: gaps between letters at about 80 % of Arial's default */
  --tracking: -0.025em;
}
* { box-sizing: border-box; }
/* set on every element so the em value scales with that element's own font size */
*, *::before, *::after { letter-spacing: var(--tracking); }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
  font: 13px/1.35 var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
input { font: inherit; color: inherit; }
svg { display: block; }

/* ------------------------------------------------------------ top bar */
#top { position: fixed; z-index: 30; top: 10px; left: 10px; right: 10px; height: 44px; display: flex;
  align-items: center; gap: 6px; pointer-events: none; }
#top > * { pointer-events: auto; }
#top .spacer { flex: 1; pointer-events: none; }
.ib, #btn-zoom { height: 40px; min-width: 40px; border: 0; border-radius: 5px; background: var(--ui);
  box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; padding: 0 10px; }
.ib svg { width: 20px; height: 20px; fill: currentColor; }
.ib:hover, #btn-zoom:hover { background: var(--ui-2); }
#board-name { height: 40px; border: 0; border-radius: 5px; background: var(--ui); box-shadow: var(--shadow);
  padding: 0 12px; font-weight: 600; width: 280px; outline: none; }
#board-name:focus { box-shadow: 0 0 0 2px var(--accent); }
#status { color: var(--muted); font-size: 12px; padding: 0 6px; min-width: 60px; }
#status.err { color: var(--danger); font-weight: 600; }

/* ------------------------------------------------------------ tools */
#tools { position: fixed; z-index: 30; left: 10px; top: 50%; transform: translateY(-50%); background: var(--ui);
  border-radius: 6px; box-shadow: var(--shadow); padding: 5px; display: flex; flex-direction: column; gap: 2px; }
#tools button { width: 40px; height: 40px; border: 0; border-radius: 4px; background: none; cursor: pointer;
  display: grid; place-items: center; color: #3a3a40; }
#tools button svg { width: 22px; height: 22px; fill: currentColor; }
#tools button:hover { background: var(--ui-2); }
#tools button.on { background: var(--accent-soft); color: var(--accent); }
#tools hr { border: 0; border-top: 1px solid var(--line); margin: 3px 4px; }

/* ------------------------------------------------------------ stage */
#stage { position: fixed; inset: 0; overflow: hidden; touch-action: none; outline: none; user-select: none; -webkit-user-select: none;
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.2px); }
#stage.t-hand, #stage.panning { cursor: grab; }
#stage.panning { cursor: grabbing; }
#stage.t-note, #stage.t-text, #stage.t-rect, #stage.t-ellipse, #stage.t-frame, #stage.t-gantt,
#stage.t-arrow, #stage.t-pen, #stage.t-kanban { cursor: crosshair; }
#world { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; }
#world.moving { will-change: transform; }
#overlay { position: absolute; inset: 0; pointer-events: none; }
#drop-hint { position: absolute; inset: 14px; border: 3px dashed var(--accent); border-radius: 9px;
  display: none; place-items: center; font-size: 22px; color: var(--accent); background: rgba(47,107,255,.05);
  pointer-events: none; }
#stage.dropping #drop-hint { display: grid; }

/* ------------------------------------------------------------ elements */
.el { position: absolute; }
.el img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.el .txt { white-space: pre-wrap; word-wrap: break-word; outline: none; }
.el .txt[contenteditable], .el [contenteditable] { cursor: text; user-select: text; -webkit-user-select: text; }

.el-note { padding: 14px; display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.12)) drop-shadow(0 9px 11px rgba(0,0,0,.26)); }
.el-note .nbg { position: absolute; inset: 0; overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--fold)), calc(100% - var(--fold)) 100%, 0 100%); }
.el-note .nbg::after { content: ""; position: absolute; right: 0; bottom: 0; width: var(--fold); height: var(--fold);
  background: linear-gradient(135deg, rgba(0,0,0,.13) 50%, transparent 50%); }
.el-note .txt { position: relative; }
[data-theme="dark"] .el-note { filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)) drop-shadow(0 8px 10px rgba(0,0,0,.5)); }
.el-note .txt { width: 100%; max-height: 100%; text-align: left; line-height: 1.25; }

.el-text .txt { line-height: 1.3; min-height: 1.3em; }
.el-text { height: auto !important; }

.el-shape { display: flex; align-items: center; justify-content: center; padding: 8px; border-style: solid; }
.el-shape.ellipse { border-radius: 50%; }
.el-shape.rect { border-radius: 4px; }
.el-shape .txt { text-align: center; width: 100%; }

.el-image { background: #e9e9e6; }
.el-image.ok, [data-theme="dark"] .el-image.ok { background: transparent; }
.el-image.err { background: repeating-linear-gradient(45deg, #eee, #eee 10px, #e2e2e2 10px, #e2e2e2 20px); }

.el-pdf { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.el-pdf canvas.hi { position: absolute; pointer-events: none; }
.el-pdf .pslots { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.el-pdf .pslot { position: absolute; background: #fff; overflow: hidden; }
.el-pdf.strip { background: transparent; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.el-pdf.strip .pslots { background: #c4c4c4; }
.el-pdf .ptitle { position: absolute; left: 0; top: 0; font-weight: 600; line-height: 1.12;
  letter-spacing: var(--tracking); overflow: hidden; overflow-wrap: anywhere; white-space: pre-wrap; }
.el-pdf .pdfbar { position: absolute; left: 0; right: 0; bottom: 100%; display: flex; align-items: center; gap: 4px;
  padding-bottom: 4px; white-space: nowrap; font-size: 12px; color: var(--muted); transform-origin: 0 100%;
  transform: scale(var(--iz, 1)); width: calc(100% * var(--z, 1)); }
.el-pdf .pdfbar b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.el-pdf .pdfbar button { border: 0; background: var(--ui); border-radius: 2.5px; box-shadow: 0 0 0 1px var(--line);
  cursor: pointer; padding: 0 6px; height: 20px; line-height: 20px; }
.el-pdf .pdfbar button:hover { background: var(--accent-soft); }

.el-file { background: var(--ui); border-radius: 10px; box-shadow: 0 0 0 1px var(--line), 0 2px 6px rgba(0,0,0,.06);
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; overflow: hidden; }
.el-file .ficon { flex: none; width: 44px; height: 52px; border-radius: 6px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 11px; text-transform: uppercase; }
.el-file .fname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.el-file .fmeta { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.el-file > div:last-child { min-width: 0; }

.el-frame { border: 1px solid rgba(0,0,0,.12); pointer-events: none; }
.el-frame .ftitle { position: absolute; left: 0; bottom: 100%; padding-bottom: 4px; font-size: 14px; color: var(--muted);
  white-space: nowrap; transform-origin: 0 100%; outline: none; transform: scale(var(--iz, 1)); pointer-events: auto; cursor: move; }
.el-frame .ftitle[contenteditable] { cursor: text; color: var(--ink); }

.el-pen, .el-arrow { pointer-events: none; }
.el-pen svg, .el-arrow svg { position: absolute; left: 0; top: 0; overflow: visible; }
.el-pen path.hit, .el-arrow path.hit { pointer-events: stroke; stroke: transparent; fill: none; }
.el-arrow path.hit { cursor: move; }

/* locked elements stay clickable: a click selects them (to unlock), a drag starts a marquee */
.el.locked.el-frame { pointer-events: none; }
.el.locked.el-frame .ftitle { pointer-events: auto; }

/* ------------------------------------------------------------ selection overlay */
.selbox { position: absolute; border: 1.5px solid var(--accent); pointer-events: none; }
.selbox.multi { border-width: 1px; border-style: dashed; }
.selbox.group { border: 1px solid var(--accent); }
.handle { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; background: #fff;
  border: 1.5px solid var(--accent); border-radius: 3px; pointer-events: auto; }
.handle.round { border-radius: 50%; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; }
.handle[data-h=nw], .handle[data-h=se] { cursor: nwse-resize; }
.handle[data-h=ne], .handle[data-h=sw] { cursor: nesw-resize; }
.handle[data-h=e], .handle[data-h=w] { cursor: ew-resize; }
.handle[data-h=n], .handle[data-h=s] { cursor: ns-resize; }
.handle[data-h=a], .handle[data-h=b] { cursor: move; }
.marquee { position: absolute; border: 1px solid var(--accent); background: rgba(47,107,255,.08); }
.hover-target { position: absolute; border: 2px solid var(--accent); border-radius: 4px; background: rgba(47,107,255,.06); }

/* ------------------------------------------------------------ context bar */
#ctxbar { position: fixed; z-index: 25; background: var(--ui); border-radius: 5px; box-shadow: var(--shadow);
  padding: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; user-select: none;
  max-width: calc(100vw - 76px); }
#ctxbar[hidden] { display: none; }
#ctxbar button { border: 0; background: none; height: 30px; min-width: 30px; border-radius: 3px; cursor: pointer;
  padding: 0 7px; display: grid; place-items: center; white-space: nowrap; }
#ctxbar button:hover { background: var(--ui-2); }
#ctxbar button.on { background: var(--accent-soft); color: var(--accent); }
#ctxbar .sw { width: 20px; height: 20px; min-width: 20px; padding: 0; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); margin: 0 1px; }
#ctxbar .sw.on { box-shadow: inset 0 0 0 1px rgba(0,0,0,.15), 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
#ctxbar .sep { width: 1px; align-self: stretch; background: var(--line); margin: 3px 4px; }
#ctxbar svg { width: 18px; height: 18px; fill: currentColor; }
#ctxbar .danger:hover { color: var(--danger); }

/* ------------------------------------------------------------ home */
#home { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow: auto; }
.home-inner { max-width: 1100px; margin: 0 auto; padding: 48px 24px; }
.home-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.home-head h1 { font-size: 26px; margin: 0; font-weight: 650; }
button.primary { border: 0; background: var(--accent); color: #fff; height: 38px; padding: 0 16px; border-radius: 4.5px;
  cursor: pointer; font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
#board-list { display: block; }
.bcard { background: var(--ui); border-radius: 6px; box-shadow: var(--shadow); padding: 16px; cursor: pointer;
  position: relative; min-height: 96px; display: flex; flex-direction: column; justify-content: space-between; }
.bcard:hover { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.bcard .bn { font-weight: 600; font-size: 15px; padding-right: 26px; word-break: break-word; }
.bcard .bm { color: var(--muted); font-size: 12px; margin-top: 10px; }
.bcard .bdel { position: absolute; right: 8px; top: 8px; border: 0; background: none; width: 26px; height: 26px;
  border-radius: 3px; cursor: pointer; color: var(--muted); opacity: 0; }
.bcard:hover .bdel { opacity: 1; }
.bcard .bdel:hover { background: #fde8e8; color: var(--danger); }
.empty { color: var(--muted); padding: 30px 0; }
.settings { margin-top: 36px; background: var(--ui); border-radius: 6px; padding: 14px 18px; box-shadow: var(--shadow); }
.settings summary { cursor: pointer; font-weight: 600; }
.settings .row { display: flex; gap: 8px; }
.settings input { flex: 1; height: 36px; border: 1px solid var(--line); border-radius: 4px; padding: 0 10px;
  background: var(--ui); color: var(--ink); outline: none; }
.settings input:focus { border-color: var(--accent); }
.settings button { height: 36px; border: 0; border-radius: 4px; background: var(--ui-2); padding: 0 14px; cursor: pointer; }
.muted { color: var(--muted); }

/* ------------------------------------------------------------ toast */
#toast { position: fixed; z-index: 60; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex;
  flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
#toast div { background: #1d1d1f; color: #fff; padding: 9px 14px; border-radius: 4.5px; box-shadow: var(--shadow);
  font-size: 13px; max-width: 70vw; }
#toast div.err { background: var(--danger); }

/* ------------------------------------------------------------ gantt */
.g-wrap { transform-origin: 0 0; }
.el-gantt { background: #fff; border-radius: 10px; box-shadow: 0 0 0 1px var(--line), 0 4px 14px rgba(0,0,0,.06);
  overflow: hidden; font-size: 13px; user-select: none; }
.g-title { height: 40px; display: flex; align-items: center; padding: 0 12px; gap: 10px; border-bottom: 1px solid var(--line);
  cursor: move; }
.g-title .gt { font-weight: 650; font-size: 15px; outline: none; min-width: 40px; }
.g-title .gr { color: var(--muted); font-size: 12px; }
.g-body { position: relative; display: flex; }
.g-labels { flex: none; border-right: 1px solid var(--line); background: #fcfcfb; position: relative; z-index: 2; }
.g-grid { position: relative; flex: none; overflow: hidden; }
.g-head { height: 44px; border-bottom: 1px solid var(--line); position: relative; }
.g-month { position: absolute; top: 0; height: 22px; line-height: 22px; padding-left: 6px; font-weight: 600; font-size: 12px;
  border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.g-day { position: absolute; top: 22px; height: 22px; line-height: 22px; text-align: center; font-size: 11px;
  color: var(--muted); border-left: 1px solid #f0f0ee; }
.g-day.we { color: #b0b0b5; }
.g-day.today { color: #fff; background: var(--danger); border-radius: 4px; }
.g-labels .g-head { display: flex; align-items: flex-end; padding: 0 12px 4px; color: var(--muted); font-size: 12px; }
.g-row { height: 32px; border-bottom: 1px solid #f1f1ef; position: relative; }
.g-labels .g-row { display: flex; align-items: center; gap: 7px; padding: 0 6px 0 10px; }
.g-labels .g-row .dot { width: 12px; height: 12px; border-radius: 3px; flex: none; cursor: pointer; }
.g-labels .g-row .dot.ms { transform: rotate(45deg) scale(.85); border-radius: 2px; }
.g-labels .g-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; outline: none; cursor: default; }
.g-labels .g-row .nm[contenteditable] { cursor: text; background: #fff; box-shadow: 0 0 0 1px var(--accent); border-radius: 3px; padding: 0 3px; text-overflow: clip; }
.g-labels .g-row .rb { border: 0; background: none; width: 20px; height: 20px; border-radius: 4px; cursor: pointer;
  color: var(--muted); display: none; padding: 0; font-size: 13px; line-height: 20px; }
.g-labels .g-row:hover .rb { display: block; }
.g-labels .g-row .rb:hover { background: var(--ui-2); color: var(--ink); }
.g-labels .g-row .rb.del:hover { color: var(--danger); }
.g-labels .g-row.drag-over { box-shadow: inset 0 2px 0 var(--accent); }
.g-labels .g-row .grip { cursor: grab; color: #c4c4c8; width: 10px; flex: none; font-size: 11px; }
.g-we { position: absolute; top: 0; bottom: 0; background: #f6f6f4; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 3; opacity: .7; }
.g-vline { position: absolute; top: 0; bottom: 0; width: 1px; background: #ececea; }
.g-bar { position: absolute; top: 6px; height: 20px; border-radius: 5px; cursor: grab; z-index: 2; color: #fff;
  font-size: 11px; line-height: 20px; padding: 0 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.12); }
.g-bar:active { cursor: grabbing; }
.g-bar::before, .g-bar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.g-bar::before { left: 0; } .g-bar::after { right: 0; }
.g-bar .pg { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0,0,0,.18); pointer-events: none; }
.g-bar span { position: relative; }
.g-ms { position: absolute; top: 8px; width: 16px; height: 16px; transform: rotate(45deg); border-radius: 2px; cursor: grab; z-index: 2; }
.g-ms-label { position: absolute; top: 7px; font-size: 11px; white-space: nowrap; color: var(--ink); pointer-events: none; z-index: 2; }
.g-add { height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 8px; }
.g-add button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 6px; font-size: 12px; }
.g-add button:hover { background: var(--ui-2); color: var(--ink); }
.g-tip { position: fixed; z-index: 70; background: #1d1d1f; color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 3px; pointer-events: none; }

.g-deps { position: absolute; left: 0; top: 0; overflow: visible; z-index: 1; pointer-events: none; }
.g-deps .dl { fill: none; stroke: #8a8a90; stroke-width: 1.5; }
.g-deps .dh { fill: #8a8a90; }
.g-deps .bad .dl { stroke: var(--danger); } .g-deps .bad .dh { fill: var(--danger); }
.g-deps .sel .dl { stroke: var(--accent); stroke-width: 2.5; } .g-deps .sel .dh { fill: var(--accent); }
.g-deps .dhit { fill: none; stroke: transparent; stroke-width: 10; pointer-events: stroke; cursor: pointer; }
.g-deps .dtmp { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 3; }
.g-link { position: absolute; top: 11px; width: 10px; height: 10px; margin-left: 3px; border-radius: 50%; background: #fff;
  border: 2px solid var(--accent); cursor: crosshair; z-index: 4; display: none; }
.g-rows > .g-row:hover .g-link { display: block; }
.g-rows > .g-row.link-target { background: var(--accent-soft); }
.g-depdel { position: absolute; z-index: 5; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; border: 0;
  background: var(--danger); color: #fff; font-size: 11px; line-height: 20px; cursor: pointer; padding: 0; }

.guide { position: absolute; background: #ff3d71; pointer-events: none; }
.guide.gap { background: #8e4ec6; box-shadow: 0 0 0 0.5px #8e4ec6; }

/* ------------------------------------------------------------ loader */
#loader { position: fixed; z-index: 80; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--ui);
  box-shadow: var(--shadow); border-radius: 6px; padding: 16px 22px; display: flex; align-items: center; gap: 14px;
  font-size: 14px; pointer-events: none; }
#loader[hidden] { display: none; }
#loader .ls { color: var(--muted); font-size: 12px; margin-top: 2px; }
#loader .ls:empty { display: none; }
#loader .spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--accent-soft);
  border-top-color: var(--accent); animation: wb-spin .8s linear infinite; }
@keyframes wb-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ Android app / touch */
.native-only { display: none; }
body.native .native-only { display: block; }
body.native #local-store .row, body.native #data-dir-msg { display: none; }
/* Dropbox storage (Android, iPad, Mac browser): offered where there is no PC server; in Dropbox mode it replaces the folder setting */
#dbx-store { display: none; margin-top: 14px; }
.settings button.primary { background: var(--accent); color: #fff; }
body.dbx-ok #dbx-store { display: block; }
body.dbx-mode #local-store, body.hosted #local-store { display: none; }
body.dbx-mode #dbx-store, body.hosted #dbx-store { margin-top: 0; }
body.hosted:not(.dbx-mode) #btn-new { display: none; }
@media (pointer: coarse) {
  .handle { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
  .handle.round { width: 24px; height: 24px; margin: -12px 0 0 -12px; }
  #ctxbar button { height: 38px; min-width: 38px; }
  #ctxbar .sw { width: 26px; height: 26px; min-width: 26px; }
}
@media (max-width: 640px) {
  #board-name { width: auto; flex: 1; min-width: 0; }
  #top .spacer, #status { display: none; }
  .home-inner { padding: 24px 14px; }
}

/* ------------------------------------------------------------ dialog (resample) */
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(20,20,22,.28); display: grid; place-items: center; padding: 16px; }
.dlg { background: var(--ui); border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.25); padding: 20px 22px; width: min(420px, 100%); }
.dlg h2 { margin: 0 0 4px; font-size: 18px; font-weight: 650; }
.dlg p { margin: 0 0 14px; }
.dlg .opts { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.dlg .opts label { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 4px; cursor: pointer; }
.dlg .opts label:hover { background: var(--ui-2); }
.dlg .opts label:has(input:checked) { background: var(--accent-soft); }
.dlg .opts span { flex: 1; }
.dlg .opts em { font-style: normal; color: var(--muted); font-size: 12px; }
.dlg .fmt { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; color: var(--muted); }
.dlg .fmt label { color: var(--ink); cursor: pointer; display: flex; gap: 5px; align-items: center; }
.dlg .remember { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); cursor: pointer; }
.dlg .btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dlg .btns .cancel { border: 0; background: var(--ui-2); height: 38px; padding: 0 16px; border-radius: 4px; cursor: pointer; }
.dlg input[type=radio], .dlg input[type=checkbox] { accent-color: var(--accent); margin: 0; }

/* ------------------------------------------------------------ tool options: expand inside the toolbox */
/* anchored under the top bar (not centred): expanding options only push the tools below, nothing jumps */
#tools { top: 62px; transform: none; max-height: calc(100vh - 72px); overflow-y: auto; scrollbar-width: none; }
#tools .ex .cols { display: grid; grid-template-columns: 16px 16px; gap: 4px; padding: 2px 0; }
#tools .ex .cols i.c { width: 16px; height: 16px; margin: 0; }
#tools .ex { width: 40px; background: var(--ui-2); border-radius: 4px; padding: 5px 0; margin: 1px 0 3px;
  display: flex; flex-direction: column; align-items: center; gap: 1px; user-select: none; }
#tools .ex hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 26px; }
#tools .ex .lbl { font-size: 10px; color: var(--muted); margin: 2px 0 1px; }
#tools .ex i.c { display: block; width: 20px; height: 20px; border-radius: 50%; margin: 2px 0; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
#tools .ex i.c.on { box-shadow: inset 0 0 0 1px rgba(0,0,0,.15), 0 0 0 2px var(--ui-2), 0 0 0 4px var(--accent); }
#tools .ex i.c.none { background: repeating-linear-gradient(45deg, #fff 0 4px, #ddd 4px 8px); }
#tools .ex b { width: 34px; height: 25px; border-radius: 4px; display: grid; place-items: center; cursor: pointer;
  font-weight: 400; font-size: 13px; color: var(--ink); }
#tools .ex b:hover { background: var(--ui); }
#tools .ex b.on { background: var(--accent-soft); color: var(--accent); }
#tools .ex b span { display: block; border-radius: 50%; background: currentColor; }
#tools .ex b svg { width: 20px; height: 20px; }
#ecur { position: fixed; z-index: 40; border: 1.5px solid var(--ink); border-radius: 50%; pointer-events: none;
  background: rgba(255,255,255,.35); }
#ecur[hidden] { display: none; }
#stage.t-eraser { cursor: none; }
@media (pointer: coarse) { #stage.t-eraser { cursor: crosshair; } }

/* ------------------------------------------------------------ tabs */
#tabs { display: flex; gap: 4px; align-items: center; min-width: 0; flex: 0 1 auto; overflow-x: auto; scrollbar-width: none; }
#tabs::-webkit-scrollbar { display: none; }
.tab { height: 40px; min-width: 90px; max-width: 220px; display: flex; align-items: center; gap: 6px; padding: 0 6px 0 12px;
  border-radius: 5px; background: rgba(255,255,255,.55); box-shadow: 0 0 0 1px var(--line); cursor: pointer; color: var(--muted);
  font-size: 13px; flex: 0 1 auto; user-select: none; }
.tab:hover { background: var(--ui); }
.tab.on { background: var(--ui); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.tab .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; outline: none; }
.tab .nm[contenteditable] { background: var(--ui-2); border-radius: 3px; padding: 0 3px; text-overflow: clip; cursor: text; }
.tab .x { width: 22px; height: 22px; border-radius: 4px; display: grid; place-items: center; font-size: 12px; color: var(--muted); flex: none; }
.tab .x:hover { background: var(--ui-2); color: var(--ink); }
.tab .dot { width: 6px; height: 6px; border-radius: 50%; background: #f5b400; flex: none; display: none; }
.tab.busy .dot { display: block; }
#btn-tab-add svg { width: 18px; height: 18px; }
#tab-menu { position: fixed; z-index: 45; width: 250px; max-height: 60vh; overflow-y: auto; background: var(--ui); border-radius: 6px;
  box-shadow: var(--shadow); padding: 4px; font-size: 13px; }
#tab-menu[hidden] { display: none; }
#tab-menu .it { padding: 8px 10px; border-radius: 4px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tab-menu .it:hover { background: var(--ui-2); }
#tab-menu .sub { color: var(--muted); font-size: 11px; padding: 6px 10px 3px; }
#tab-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
@media (max-width: 640px) { .tab { min-width: 70px; max-width: 140px; } }

/* ------------------------------------------------------------ drop into an album */
#album-mark { position: fixed; z-index: 35; width: 4px; border-radius: 2px; background: var(--accent); pointer-events: none;
  box-shadow: 0 0 0 3px rgba(47,107,255,.25); }
#album-mark[hidden] { display: none; }
#stage.into-album #drop-hint { display: none; }

/* ------------------------------------------------------------ file name captions */
.el-image .icap { position: absolute; left: 0; top: 100%; max-width: 100%; padding-top: .35em; color: #7a7a80; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; pointer-events: none; line-height: 1.2; }
.el-image .icap[hidden] { display: none; }
.el-pdf .pcaps { position: absolute; top: 0; right: 0; bottom: 0; pointer-events: none; }
.el-pdf .pcaps div { position: absolute; color: #3a3a3c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------ light / dark switch */
#theme { height: 40px; border: 0; border-radius: 5px; background: var(--ui); box-shadow: var(--shadow); display: flex;
  align-items: center; gap: 8px; padding: 0 12px; cursor: pointer; color: var(--muted); font-size: 13px; }
#theme .on { color: var(--ink); font-weight: 600; }
#theme .tr { width: 34px; height: 18px; border-radius: 9px; background: var(--ui-2); box-shadow: inset 0 0 0 1px var(--line); position: relative; }
#theme .tr i { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); transition: left .15s; }
[data-theme="dark"] #theme .tr i { left: 18px; }
@media (max-width: 640px) { #theme .lt { display: none; } #theme { padding: 0 8px; } }

/* ------------------------------------------------------------ dark theme */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #18181a; --dot: #38383c; --ui: #262629; --ui-2: #323236; --line: #3a3a3e;
  --ink: #ececee; --muted: #9a9aa2; --accent: #5b8cff; --accent-soft: rgba(91, 140, 255, .2);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.45);
}
[data-theme="dark"] #tools button { color: var(--ink); }
[data-theme="dark"] .el-image { background: #2a2a2d; }
[data-theme="dark"] .el-image.err { background: repeating-linear-gradient(45deg, #2a2a2d, #2a2a2d 10px, #333337 10px, #333337 20px); }
[data-theme="dark"] .el-image .icap { color: var(--muted); }
[data-theme="dark"] .el-frame { border-color: rgba(255,255,255,.12); }
[data-theme="dark"] .handle { background: var(--ui); }
[data-theme="dark"] #ctxbar .sw.on { box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 0 0 2px var(--ui), 0 0 0 4px var(--accent); }
[data-theme="dark"] #ctxbar .sw, [data-theme="dark"] #tools .ex i.c { box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
[data-theme="dark"] #tools .ex i.c.on { box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 0 0 2px var(--ui-2), 0 0 0 4px var(--accent); }
[data-theme="dark"] .bcard .bdel:hover { background: rgba(229,72,77,.18); }
[data-theme="dark"] .settings input { background: var(--ui-2); }
[data-theme="dark"] #toast div, [data-theme="dark"] .g-tip { background: #3a3a3e; }
[data-theme="dark"] .tab { background: rgba(255,255,255,.04); }
[data-theme="dark"] .tab:hover, [data-theme="dark"] .tab.on { background: var(--ui); }
[data-theme="dark"] .modal { background: rgba(0,0,0,.5); }
[data-theme="dark"] .el-gantt { background: #202023; }
[data-theme="dark"] .g-labels { background: #232326; }
[data-theme="dark"] .g-day { border-left-color: #2e2e32; }
[data-theme="dark"] .g-day.we { color: #6e6e76; }
[data-theme="dark"] .g-row { border-bottom-color: #2c2c30; }
[data-theme="dark"] .g-labels .g-row .nm[contenteditable] { background: var(--ui-2); }
[data-theme="dark"] .g-labels .g-row .grip { color: #5a5a60; }
[data-theme="dark"] .g-we { background: #1b1b1e; }
[data-theme="dark"] .g-vline { background: #2c2c30; }
[data-theme="dark"] .g-link { background: var(--ui); }
[data-theme="dark"] .g-ms-label { color: var(--ink); }

/* ------------------------------------------------------------ kanban */
.el-kanban { user-select: none; }
.k-wrap { transform-origin: 0 0; display: inline-block; width: max-content; background: #fff; border-radius: 8px;
  box-shadow: 0 0 0 1px var(--line), 0 4px 14px rgba(0,0,0,.06); font-size: 13px; }
.k-title { height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-bottom: 1px solid var(--line); cursor: move; }
.k-title .kt { font-weight: 650; font-size: 15px; outline: none; min-width: 30px; white-space: nowrap; }
.k-title .kn { color: var(--muted); font-size: 12px; white-space: nowrap; }
.k-cols { display: flex; gap: 10px; padding: 10px; align-items: flex-start; }
.k-col { width: 210px; flex: none; background: #f1f1ef; border-radius: 6px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.k-head { display: flex; align-items: center; gap: 6px; font-weight: 650; padding: 2px 2px 4px; position: relative; }
.k-head .kh { outline: none; min-width: 20px; }
.k-head .kc { font-weight: 400; color: var(--muted); font-size: 12px; }
.k-head .k-more { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 4px; width: 22px; height: 20px; padding: 0; }
.k-head .k-more:hover { background: rgba(0,0,0,.06); color: var(--ink); }
.k-menu { position: absolute; right: 0; top: 24px; z-index: 5; background: #fff; border-radius: 5px; box-shadow: var(--shadow); padding: 4px; font-weight: 400; min-width: 130px; }
.k-menu div { padding: 6px 10px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.k-menu div:hover { background: #f1f1ef; }
.k-menu .danger { color: var(--danger); }
.k-card { background: #fff; border-radius: 5px; box-shadow: 0 1px 2px rgba(0,0,0,.12); padding: 8px 9px 8px 13px; line-height: 1.3;
  position: relative; cursor: grab; }
.k-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 5px 0 0 5px; background: var(--kc); }
.k-card .k-text { white-space: pre-wrap; overflow-wrap: anywhere; outline: none; padding-right: 2px; }
.k-card .k-text[contenteditable] { cursor: text; }
.k-due { display: inline-block; margin-top: 6px; font-size: 11px; color: var(--muted); background: #f1f1ef; border-radius: 3px; padding: 1px 6px; }
.k-due.late { color: #a32d2d; background: #fcebeb; }
.k-tools { position: absolute; right: 4px; top: 4px; display: none; gap: 2px; background: #fff; border-radius: 4px; padding: 1px; }
.k-card:hover .k-tools { display: flex; }
.k-tools i { width: 18px; height: 18px; border-radius: 3px; display: grid; place-items: center; font-style: normal; font-size: 11px; color: var(--muted); cursor: pointer; }
.k-tools i:hover { background: #f1f1ef; color: var(--ink); }
.k-tools .k-color::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--kc); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.k-tools .k-del:hover { color: var(--danger); }
.k-add { color: var(--muted); font-size: 12px; padding: 4px 2px; cursor: pointer; }
.k-add:hover { color: var(--ink); }
.k-newcol { width: 140px; flex: none; height: 40px; border: 1.5px dashed #d0d0cc; border-radius: 6px; display: grid; place-items: center; font-size: 12px; color: var(--muted); cursor: pointer; }
.k-newcol:hover { color: var(--ink); border-color: var(--muted); }
.k-dragging { opacity: .35; }
.k-ph { border-radius: 5px; background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.k-ghost { position: fixed; z-index: 95; pointer-events: none; transform-origin: 0 0; box-shadow: 0 8px 24px rgba(0,0,0,.22); opacity: .95; font-family: var(--font); font-size: 13px; }
.k-ghost .k-tools { display: none !important; }
.k-dateinput { position: fixed; z-index: 96; opacity: 0; width: 1px; height: 1px; }
[data-theme="dark"] .k-wrap { background: #202023; }
[data-theme="dark"] .k-col { background: #2a2a2e; }
[data-theme="dark"] .k-card, [data-theme="dark"] .k-tools, [data-theme="dark"] .k-menu { background: #333337; }
[data-theme="dark"] .k-due { background: #2a2a2e; }
[data-theme="dark"] .k-due.late { background: rgba(229,72,77,.2); color: #ff8b8e; }
[data-theme="dark"] .k-menu div:hover, [data-theme="dark"] .k-tools i:hover { background: #3c3c41; }
[data-theme="dark"] .k-newcol { border-color: #45454b; }
[data-theme="dark"] .k-head .k-more:hover { background: rgba(255,255,255,.08); }

/* ------------------------------------------------------------ toolbox side switch */
#tools #btn-side { height: 34px; }
#tools #btn-side svg { width: 28px; height: 24px; }
#btn-side .o { fill: var(--ui); stroke: var(--line); stroke-width: 1; }
#btn-side .bar { fill: var(--ink); transition: transform .18s; }
.tools-right #btn-side .bar { transform: translateX(13.8px); }
.tools-right #tools { left: auto; right: 10px; }
/* right toolbox too tall for the space under the top bar: toolbox in the top right corner, top bar buttons follow the tabs */
.tools-tall #tools { top: 10px; max-height: calc(100vh - 20px); }
.tools-tall #top { right: 68px; }
.tools-tall #top .spacer { display: none; }
.tools-measure #tools { max-height: none !important; }

#tools #btn-bin:hover { color: var(--danger); }

/* colour swatches: small rounded squares instead of circles */
#ctxbar .sw { width: 18px; min-width: 18px; height: 18px; border-radius: 3px; }
#tools .ex .cols { grid-template-columns: 16px 16px; gap: 4px 4px; }
#tools .ex .cols i.c { width: 16px; height: 16px; border-radius: 3px; }
@media (pointer: coarse) { #ctxbar .sw { width: 24px; min-width: 24px; height: 24px; } }

#tools .ex .off { opacity: .3; pointer-events: none; }
#tools .ex b.sp { visibility: hidden; pointer-events: none; }

/* while drawing, the pen options replace the pen button (the button itself would look like a second pen) */
#tools button[data-tool="pen"].on { display: none; }

#tools .ex b span.ring { border: none; border-radius: 50%; background: repeating-linear-gradient(-45deg, currentColor 0 1px, transparent 1px 2.2px); }

/* ------------------------------------------------------------ foils: see-through colour sheets */
.el-foil { mix-blend-mode: multiply; border-radius: 2px; }
[data-theme="dark"] .el-foil { mix-blend-mode: screen; }
.android .el-foil, .android[data-theme="dark"] .el-foil { mix-blend-mode: normal; opacity: .45; }
#tools button[data-tool="foil"] svg rect { mix-blend-mode: multiply; }
#tools button[data-tool="foil"] .f1 { fill: #ffe600; }
#tools button[data-tool="foil"] .f2 { fill: #ff3df5; }
[data-theme="dark"] #tools button[data-tool="foil"] svg rect { mix-blend-mode: screen; }

/* ------------------------------------------------------------ tracing roll */
#stage.t-roll { cursor: crosshair; }
.el-roll { user-select: none; }
.r-wrap { transform-origin: 0 0; position: absolute; left: 0; top: 0; display: flex; flex-direction: column; }
.r-strip { display: flex; height: 500px; flex: none; box-shadow: 0 2px 5px rgba(0,0,0,.2), 0 12px 34px rgba(0,0,0,.2);
  transition: opacity .12s; }
/* sheet = a fixed piece of tracing paper: no title block, grip or preview strip; title sits by the sheet tabs */
.r-wrap.sheet .r-title, .r-wrap.sheet .r-grip, .r-wrap.sheet .r-map { display: none; }
.r-wrap.sheet .r-sheets { padding-left: 0; }
/* sheet: a colour mark in the top-left corner (also the handle to move it), numbered tabs in the same colour */
.rm { display: none; }
.r-wrap.sheet .r-sheets { gap: 3px; position: absolute; left: 0; top: 0; height: 21px; z-index: 2; align-items: stretch; }
.r-wrap.sheet .rm { display: flex; align-items: center; justify-content: center; width: 126px; height: 21px; background: var(--mark);
  cursor: move; flex: none; font-size: 10px; white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; }
.r-wrap.sheet .r-chips { gap: 3px; align-items: stretch; }
.r-wrap.sheet .r-chip { width: 60px; height: 21px; padding: 0 0 0 2px; border-radius: 0; background: #c8c8c8; color: #3a3a3a; }
.r-wrap.sheet .r-chip:hover { background: #b9b9b9; }
.r-wrap.sheet .r-chip.on { height: 21px; background: #808080; color: #fff; font-weight: 400; }
.r-wrap.sheet .r-chip.off { color: #8a8a8a; }
.r-wrap.sheet .r-chip b { width: 17px; height: 17px; border-radius: 9px; }
.r-wrap.sheet .r-chip b svg { width: 13px; height: 13px; }
.r-wrap.sheet .r-chip b:hover { background: rgba(0,0,0,.1); }
.r-wrap.sheet .r-chip.add { width: 23px; padding: 0; justify-content: center; background: none; color: #3a3a3a; font-size: 17px; font-weight: 300; }
.r-wrap.sheet .r-chip.add:hover { color: var(--accent); background: none; }
.r-chips { display: flex; gap: 4px; align-items: flex-end; height: 100%; }
/* "Hold to lift": the paper is lifted away while the button is held */
.el-roll.lifted .r-strip { opacity: .06; }
.r-title { width: 64px; flex: none; background: #6b5a40; color: #fff; display: flex; flex-direction: column; align-items: center;
  padding: 14px 0 12px; cursor: move; }
.r-title .rt { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 600; font-size: 26px; line-height: 1.1;
  white-space: nowrap; overflow: hidden; max-height: 420px; outline: none; }
.r-title .rl { margin-top: auto; font-size: 14px; color: #d9ccb2; white-space: nowrap; }
#stage .r-title { cursor: move; }
.r-paper { position: relative; flex: none; height: 500px; overflow: hidden; }
.r-paper canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
#stage.t-select .r-paper { cursor: crosshair; }
.r-grip { width: 30px; flex: none; background: #e3dcc6; border-left: 1px solid #cfc6aa; cursor: ew-resize;
  display: flex; align-items: center; justify-content: center; gap: 3px; }
.r-grip i { width: 2px; height: 34px; border-radius: 1px; background: #a99d7c; }
.r-grip:hover { background: #ddd4b9; }
.r-map { position: relative; height: 56px; flex: none; margin-top: 10px; border-radius: 4px; overflow: hidden; cursor: grab;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 3px 10px rgba(0,0,0,.08); }
.r-map:active { cursor: grabbing; }
.r-map canvas { display: block; width: 100%; height: 100%; }
.r-frame { position: absolute; box-shadow: inset 0 0 0 3px var(--accent); border-radius: 2px; pointer-events: none;
  background: rgba(47,107,255,.08); }
/* sheets = tabs standing on the top edge of the paper; the active one is cut from the same paper */
.r-sheets { height: 46px; flex: none; display: flex; gap: 4px; align-items: flex-end; padding-left: 70px; }
.r-chip { height: 40px; padding: 0 18px 0 8px; border-radius: 10px 10px 0 0; background: #e3dcc6; color: #6b5a40;
  display: inline-flex; align-items: center; gap: 4px; font-size: 22px; cursor: pointer; white-space: nowrap; }
.r-chip:hover { background: #ebe4cf; }
.r-chip.on { height: 46px; background: var(--paper); color: #2b2a27; font-weight: 600; }
.r-chip.off { color: #a99d7c; }
.r-chip.add { padding: 0 16px; background: none; color: var(--muted); }
.r-chip.add:hover { color: var(--ink); background: none; }
.r-chip b { width: 34px; height: 34px; border-radius: 17px; display: grid; place-items: center; font-weight: 400; }
.r-chip b:hover { background: rgba(0,0,0,.07); }
.r-chip b svg { width: 26px; height: 26px; fill: currentColor; }
/* fullscreen roll: covers the board, toolbox and top bar stay on top */
#rollfs { position: absolute; inset: 0; z-index: 20; background: var(--bg); }
#rollfs .el-roll { position: absolute; }
#rollfs .r-title { cursor: zoom-out; }
#rollfs .fs-x { position: absolute; z-index: 2; width: 36px; height: 36px; border: 0; border-radius: 6px; background: var(--ui);
  box-shadow: var(--shadow); color: var(--ink); font-size: 16px; cursor: pointer; }
#rollfs .fs-x:hover { color: var(--accent); }

/* ------------------------------------------------------------ Claude about the selection */
#ctxbar button.claude { color: #c15f3c; background: #f4ebe5; padding: 0 9px; font-weight: 500; gap: 5px; margin-left: 2px; }
#ctxbar button.claude:hover { background: #ecdcd1; }
#ctxbar button.claude { display: inline-flex; align-items: center; white-space: nowrap; }
#ctxbar button.claude svg.cl-star { width: 14px; height: 14px; fill: currentColor; }
[data-theme="dark"] #ctxbar button.claude { background: #4a3127; color: #f0a585; }
#claude-pop { position: fixed; z-index: 40; width: 360px; background: var(--ui); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.22); padding: 10px; color: var(--ink); }
#claude-pop .cp-what { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
#claude-pop textarea { width: 100%; height: 70px; box-sizing: border-box; resize: vertical; font: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 8px; background: var(--ui-2); color: var(--ink); outline: none; }
#claude-pop textarea:focus { border-color: #c15f3c; }
#claude-pop .cp-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 7px 0; }
#claude-pop .cp-chips span { font-size: 12px; padding: 3px 9px; border-radius: 20px; background: var(--ui-2); cursor: pointer; }
#claude-pop .cp-chips span:hover { background: var(--accent-soft); }
#claude-pop .cp-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#claude-pop small { font-size: 11px; color: var(--muted); }
#claude-pop .cp-go { background: #c15f3c; color: #fff; border: 0; border-radius: 7px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
#claude-pop .cp-go:hover { background: #a94f30; }
.claude-wait { position: absolute; background: #fff; border: 1px solid #e3d6cc; box-shadow: 0 2px 8px rgba(0,0,0,.08);
  color: #1d1d1f; line-height: 1.4; box-sizing: border-box; pointer-events: none; }
.claude-wait .cw-h { display: flex; align-items: center; gap: .5em; color: #c15f3c; margin-bottom: .35em; }
.claude-wait .cw-spin { display: inline-block; border-style: solid; border-color: #ecd6cb; border-top-color: #c15f3c;
  border-radius: 50%; animation: cw-spin .8s linear infinite; }
.claude-wait .cw-q { color: #7a7a80; font-size: .92em; }
@keyframes cw-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ board <-> Claude Code conversation */
.tab .pair { width: 18px; height: 22px; display: grid; place-items: center; color: #c15f3c; flex: none; border-radius: 4px; cursor: pointer; }
.tab .pair:hover { background: var(--ui-2); }
.tab .pair svg { width: 15px; height: 15px; }
#tab-menu .pair-it { display: flex; align-items: center; gap: 7px; }
#tab-menu .pair-it svg { width: 14px; height: 14px; color: #c15f3c; flex: none; }
#pair-pop { position: fixed; z-index: 46; width: 290px; background: var(--ui); border-radius: 9px; box-shadow: 0 6px 22px rgba(0,0,0,.18);
  padding: 10px 12px; font-size: 12px; color: var(--ink); }
#pair-pop b { font-weight: 600; font-size: 13px; display: block; }
#pair-pop .m { color: var(--muted); margin: 3px 0 9px; overflow-wrap: anywhere; }
#pair-pop .acts { display: flex; gap: 6px; }
#pair-pop button, #pair-dlg .pd-row button { border: 1px solid var(--line); background: var(--ui); color: var(--ink); border-radius: 7px; padding: 5px 11px; font: inherit; cursor: pointer; }
#pair-pop button:hover, #pair-dlg .pd-row button:hover { background: var(--ui-2); }
#pair-dlg .dlg { width: 470px; max-width: calc(100vw - 32px); }
#pair-dlg .pd-q { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; font: inherit;
  background: var(--ui-2); color: var(--ink); margin: 6px 0 8px; outline: none; }
#pair-dlg .pd-list { border: 1px solid var(--line); border-radius: 8px; max-height: 300px; overflow-y: auto; }
#pair-dlg .pd-it { padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
#pair-dlg .pd-it:last-child { border-bottom: 0; }
#pair-dlg .pd-it:hover { background: var(--ui-2); }
#pair-dlg .pd-it.on { background: #f4ebe5; }
[data-theme="dark"] #pair-dlg .pd-it.on { background: #4a3127; }
#pair-dlg .pd-it b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#pair-dlg .pd-it small, #pair-dlg .pd-row small, #pair-dlg .sub { color: var(--muted); font-size: 11px; }
#pair-dlg .sub { padding: 10px; }
#pair-dlg .pd-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
#pair-dlg .pd-row .pd-ok { background: #c15f3c; border-color: #c15f3c; color: #fff; }
#pair-dlg .pd-row .pd-ok:hover { background: #a94f30; }
#claude-pop .cp-pair { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #c15f3c; margin: -2px 0 6px; }
#claude-pop .cp-pair svg { width: 13px; height: 13px; flex: none; }
.claude-wait.err { border-color: #e5484d; pointer-events: auto; cursor: pointer; }
.claude-wait.err .cw-h { color: #e5484d; }
.claude-wait.err .cw-q { white-space: pre-wrap; color: #3a3a3c; }
.claude-wait .cw-x { margin-left: auto; color: #9a9aa0; }

/* images inside kanban cards: full card width, stacked */
.k-imgs { display: flex; flex-direction: column; gap: 5px; margin-top: 7px; }
.k-img { position: relative; width: 100%; border-radius: 3px; overflow: hidden; background: #ececea; cursor: grab; }
.k-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.k-img.k-dragging { opacity: .35; }
.k-imgx { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.92);
  display: none; place-items: center; font-style: normal; font-size: 10px; color: #55555a; cursor: pointer; }
.k-img:hover .k-imgx { display: grid; }
.k-imgx:hover { color: var(--danger); }
.k-card:has(.k-img:hover) .k-tools { display: none; }
.k-card.k-drop { outline: 2px solid #2f6bff; outline-offset: 1px; background: #eef3ff; }
.k-imgghost { position: fixed; z-index: 96; pointer-events: none; object-fit: cover; border-radius: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.25); opacity: .9; }
#imgview { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.82); display: grid; place-items: center; cursor: zoom-out; }
#imgview img { max-width: 94vw; max-height: 94vh; object-fit: contain; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
[data-theme="dark"] .k-img { background: #2a2a2e; }
[data-theme="dark"] .k-card.k-drop { background: #26324d; }

/* pedal jacks and patch cables */
.jks { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.jk { position: absolute; width: 0; height: 0; visibility: hidden; }
.el:hover .jk, html.wiring .jk, html.jacks-on .jk { visibility: visible; }
/* zoomed far out: no jack markers (except while editing jacks or dragging a cable) */
#world.far .jk { visibility: hidden; }
#world.far .el.jedit .jk, html.wiring #world.far .jk { visibility: visible; }
.jk i { position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; box-sizing: border-box; border-radius: 50%;
  background: #fff; border: 2.5px solid #2f6bff; transform: scale(var(--iz, 1)); cursor: crosshair; pointer-events: auto; }
.jk.dc i { border-color: #e0a100; }
.jk i:hover { background: #2f6bff; }
.jk.dc i:hover { background: #e0a100; }
.jk span { position: absolute; left: 0; top: 0; transform-origin: 0 0; white-space: nowrap; pointer-events: none;
  font: 600 11px/1.3 var(--font); color: #1f4fd1; background: rgba(255,255,255,.88); padding: 0 3px; border-radius: 3px; }
.jk.dc span { color: #8a6100; }
/* labels sit inside the pedal: a neighbour standing close never covers them */
.jk span.r { transform: scale(var(--iz, 1)) translate(calc(-100% - 11px), -50%); }
.jk span.l { transform: scale(var(--iz, 1)) translate(11px, -50%); }
.jk span.t { transform: scale(var(--iz, 1)) translate(-50%, 11px); }
.jk span.b { transform: scale(var(--iz, 1)) translate(-50%, calc(-100% - 11px)); }
html.wiring, html.wiring * { cursor: crosshair !important; }
#ctxbar .ctxinfo { align-self: center; font-size: 12px; color: var(--muted); padding: 0 6px; white-space: nowrap; }
.el.jedit .jk { visibility: visible; }
.el.jedit .jk i { cursor: move; border-style: dashed; background: #fff8d6; }
.el.jedit { outline: 2px dashed #2f6bff; outline-offset: 4px; }
.el.jedit .jk.picked i { background: #2f6bff; border-style: solid; }
.el.jedit .jk.dc.picked i { background: #e0a100; }
.el.jedit .jk.picked span { background: #2f6bff; color: #fff; }

/* ------------------------------------------------------------ sharing boards (Dropbox shared folders) */
.av { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff;
  box-shadow: 0 0 0 2px var(--ui); margin-left: -5px; flex: none; letter-spacing: 0; }
.av.big { width: 34px; height: 34px; font-size: 13px; margin: 0; box-shadow: none; }
.avs { display: inline-flex; }
.avs .av:first-child { margin-left: 0; }
.ico-people { width: 15px; height: 15px; fill: currentColor; flex: none; }
.bcard .sh { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.badge { font-size: 11px; padding: 1px 7px; border-radius: 9px; background: var(--ui-2); color: var(--muted); }
.badge.view { background: #fff3d6; color: #8a6200; }
.bcard .more { position: absolute; right: 8px; top: 8px; border: 0; background: none; width: 26px; height: 26px; border-radius: 4px;
  cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; }
.bcard .more:hover { background: var(--ui-2); }
.bcard .menu { position: absolute; right: 8px; top: 38px; background: var(--ui); border-radius: 6px; box-shadow: 0 6px 22px rgba(0,0,0,.18);
  padding: 4px; z-index: 5; min-width: 170px; display: none; }
.bcard .menu.open { display: block; }
.bcard .menu div { padding: 8px 10px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.bcard .menu div:hover { background: var(--ui-2); }
.bcard .menu .danger { color: #d33; }
#board-list .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
#board-list .hsec { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.invite { display: flex; align-items: center; gap: 14px; background: var(--ui); border-radius: 6px; box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow);
  padding: 14px 16px; margin-bottom: 10px; }
.invite .t { flex: 1; min-width: 0; } .invite b { font-size: 15px; } .invite small { display: block; color: var(--muted); margin-top: 3px; }
.invite .later { border: 0; background: var(--ui-2); height: 38px; padding: 0 14px; border-radius: 4px; cursor: pointer; font: inherit; color: var(--ink); }
.filters { display: flex; gap: 6px; margin: 22px 0 14px; }
.filters button { border: 0; background: var(--ui); color: var(--ink); box-shadow: var(--shadow); border-radius: 15px; height: 30px; padding: 0 14px; cursor: pointer; font: inherit; font-size: 13px; }
.filters button.on { background: var(--ink); color: var(--ui); }
.share-note { background: #fff3d6; color: #6b4d00; border-radius: 6px; padding: 10px 14px; margin: 0 0 14px; font-size: 13px; }
.sharebtn { height: 40px; border: 0; border-radius: 5px; background: var(--ui); color: var(--ink); box-shadow: var(--shadow); display: flex; align-items: center;
  gap: 8px; padding: 0 12px 0 10px; cursor: pointer; font: inherit; font-weight: 600; }
.sharebtn[hidden] { display: none; }
.sharebtn:hover { background: var(--ui-2); }
.sharebtn .av { box-shadow: 0 0 0 2px var(--ui); }
#ro-banner { position: fixed; z-index: 31; top: 62px; left: 50%; transform: translateX(-50%); background: #fff3d6; color: #6b4d00; border-radius: 6px;
  padding: 8px 14px; box-shadow: var(--shadow); font-size: 13px; max-width: calc(100vw - 140px); text-align: center; }
#ro-banner[hidden] { display: none; }
.ro #tools, .ro #ctxbar, .ro #btn-undo, .ro #btn-redo { display: none !important; }
#share-dlg .dlg { width: 500px; max-width: calc(100vw - 32px); }
#share-dlg .sd-add { display: flex; gap: 6px; margin: 4px 0 6px; }
#share-dlg input, #share-dlg select { height: 38px; border: 1px solid var(--line); border-radius: 4px; padding: 0 8px; font: inherit; background: var(--ui); color: var(--ink); }
#share-dlg .sd-mail { flex: 1; min-width: 0; padding: 0 10px; }
#share-dlg .sd-mail:focus { outline: none; border-color: var(--accent); }
#share-dlg .sd-list { margin: 14px 0 0; border-top: 1px solid var(--line); }
#share-dlg .sd-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
#share-dlg .sd-row .av { width: 30px; height: 30px; font-size: 12px; margin: 0; box-shadow: none; }
#share-dlg .who { flex: 1; min-width: 0; } #share-dlg .who b { font-weight: 600; display: block; overflow-wrap: anywhere; }
#share-dlg .who small { color: var(--muted); }
#share-dlg .sd-row select { height: 32px; font-size: 13px; }
#share-dlg .x { border: 0; background: none; width: 28px; height: 28px; border-radius: 4px; cursor: pointer; color: var(--muted); font-size: 16px; }
#share-dlg .x:hover { background: #fde8e8; color: #d33; }
#share-dlg .role { color: var(--muted); font-size: 13px; }
#share-dlg .sd-note { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.45; }
#share-dlg .sd-msg { font-size: 13px; color: var(--accent); margin-top: 10px; min-height: 1em; }
#share-dlg .sd-foot { display: flex; align-items: center; margin-top: 14px; }
#share-dlg .sd-foot .spacer { flex: 1; }
#share-dlg .stop { border: 0; background: none; color: #d33; cursor: pointer; font: inherit; padding: 0; }
#share-dlg .pending { font-size: 11px; color: #8a6200; background: #fff3d6; padding: 1px 6px; border-radius: 8px; margin-left: 6px; font-weight: 400; }
#share-dlg .private-box { background: var(--ui-2); border-radius: 6px; padding: 12px 14px; color: var(--muted); font-size: 13px; margin-top: 12px; }
body.dbx-share #dbx-root, body.dbx-share #btn-dbx-root { display: none; }
body.dbx-share #dbx-store { margin-top: 18px; }
