/* ---- the board (our own editor): card layer under the ink canvas, input layer on top ---- */
.bd2 { position: absolute; inset: 0; overflow: hidden; outline: none; touch-action: none; }
.bd2 .bd-cards { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.bd2 .bd-ink { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.bd2 .bd-input { position: absolute; inset: 0; touch-action: none; z-index: 2; }
.bd2 .bd-curs { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.bd-cur { position: absolute; left: 0; top: 0; will-change: transform; transition: opacity .4s; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .7)); }
.bd-cur span { position: absolute; left: 16px; top: 18px; padding: 2px 8px; border-radius: 6px; font: 800 12px var(--display); color: #0b0c0f; white-space: nowrap; }
.bd-tools { position: absolute; left: 10px; top: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 3px; padding: 6px; border-radius: 14px; background: rgba(20, 23, 28, .95); box-shadow: 0 0 0 1px #05070a, 0 8px 20px rgba(0, 0, 0, .5); overflow-y: auto; scrollbar-width: none; z-index: 5; }
.bd-tools .icon-btn { width: 48px; height: 44px; flex: none; position: relative; }
.bd-tools .bd-t.on { background: var(--accent); color: #04131c; }
.bd-tools .bd-mk { position: absolute; right: 8px; bottom: 8px; width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.bd-sep { height: 1px; background: var(--line); margin: 4px 2px; flex: none; }
.bd-ink-dot { width: 26px; height: 26px; border-radius: 50%; box-shadow: 0 0 0 2px #05070a, 0 0 0 4px rgba(255, 255, 255, .25); }
.bd-size { font: 800 15px var(--display); }
.bd-top { position: absolute; right: 10px; top: 10px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; z-index: 5; max-width: calc(100% - 100px); }
.bd-top .bd-b { background: rgba(20, 23, 28, .95); }
.bd-top .bd-b.on { background: linear-gradient(180deg, #6fd6ff, #1f8fc4); color: #04131c; }
.bd-selbar { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: none; gap: 6px; padding: 6px; border-radius: 14px; background: rgba(20, 23, 28, .95); box-shadow: 0 0 0 1px #05070a, 0 8px 20px rgba(0, 0, 0, .5); z-index: 5; flex-wrap: wrap; justify-content: center; max-width: calc(100% - 140px); }
.bd-selbar.on { display: flex; }
.bd-tray { position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 16px; background: rgba(13, 15, 18, .95); box-shadow: 0 0 0 1px #05070a, 0 10px 30px rgba(0, 0, 0, .6); z-index: 6; transition: .15s; }
.bd-tray.on { opacity: 1; transform: translate(-50%, 0); }
.bd-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 16px; border-radius: 12px; background: var(--plate); box-shadow: inset 0 0 0 2px var(--line); font-weight: 700; }
.bd-chip.hot { background: var(--accent); color: #04131c; box-shadow: 0 0 0 3px #fff; }
.bd-drop { position: absolute; inset: 14px; border: 3px dashed var(--accent); border-radius: 18px; background: rgba(76, 201, 255, .1); display: none; place-items: center; font: 800 20px var(--display); z-index: 7; pointer-events: none; text-align: center; padding: 20px; }
.bd2.dropping .bd-drop { display: grid; }
.bd-edit { position: absolute; z-index: 8; resize: none; border: 0; outline: 2px solid var(--accent); border-radius: 6px; margin: 0; overflow: hidden; line-height: 1.25; }
.bd-card { position: absolute; left: 0; top: 0; transform-origin: 0 0; border-radius: 10px; overflow: hidden; background: #14171c; box-shadow: 0 0 0 1px #05070a, 0 10px 26px rgba(0, 0, 0, .45); display: flex; flex-direction: column; }
.bd-card.sel { box-shadow: 0 0 0 2px var(--accent), 0 10px 26px rgba(0, 0, 0, .45); }
.bd2 .bd-cards:has(.bd-card.active) { z-index: 4; }
.bd-card.active { pointer-events: auto; box-shadow: 0 0 0 3px var(--ok), 0 10px 26px rgba(0, 0, 0, .45); }
.bd-card-h { height: 34px; flex: none; display: flex; align-items: center; padding: 0 10px; background: #1b1f26; font: 700 13px var(--font); color: var(--dim); }
.bd-card-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-card-b { flex: 1; position: relative; min-height: 0; }

/* ---- file viewers (board cards + Files preview) ---- */
.vw { position: relative; width: 100%; height: 100%; background: #0d0f12; overflow: hidden; }
.vw img, .vw video, .vw iframe { width: 100%; height: 100%; object-fit: contain; display: block; border: 0; background: #0d0f12; }
.vw iframe { background: #fff; }
.vw-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.vw-play .ic { width: 30px; height: 30px; }
.vw-playing .vw-play { opacity: .7; transition: opacity .3s; }
.vw-live.vw-playing .vw-play { opacity: 1; }
.vw-bar { position: absolute; left: 10px; right: 10px; bottom: 8px; display: flex; align-items: center; gap: 8px; font: 600 12px var(--font); color: #fff; text-shadow: 0 1px 2px #000; }
.vw-track { flex: 1; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .25); overflow: hidden; cursor: pointer; }
.vw-track i { display: block; height: 100%; background: #ff4757; width: 0; }
.vw-aud { position: absolute; inset: 0; display: flex; align-items: center; gap: 12px; padding: 0 16px 24px 96px; background: linear-gradient(135deg, #2e1e52, #1b1f26); color: #e8ecf1; }
.vw-aud .ic { display: none; }
.vw-audio .vw-play { left: 50px; }
.vw-text { margin: 0; padding: 12px; height: 100%; overflow: auto; font: 13px/1.45 Consolas, "Cascadia Code", monospace; color: #d5dde6; background: #0e1116; white-space: pre; user-select: text; }
.vw-pdf { width: 100%; height: 100%; object-fit: contain; background: #fff; display: block; }
.vw-pages { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, .65); color: #fff; font: 700 13px var(--font); }
.vw-pg { width: 44px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: #fff; display: grid; place-items: center; }
.vw-3d { position: absolute; inset: 0; }
.vw-3d canvas { width: 100% !important; height: 100% !important; display: block; }
.vw-3dbar { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 6px; }
.vw-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 16px; color: var(--dim); }
.vw-sheet { height: 100%; overflow: auto; background: #0e1116; user-select: text; }
.vw-sheet table { border-collapse: collapse; font: 13px var(--font); color: #d5dde6; }
.vw-sheet td, .vw-sheet th { border: 1px solid #2e3542; padding: 4px 8px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.vw-sheet th { background: #1b1f26; position: sticky; top: 0; }
.vw-file { position: absolute; inset: 0; display: flex; align-items: center; gap: 14px; padding: 16px; background: #1b1f26; }
.vw-ic .ic { width: 48px; height: 48px; }
.vw-fn { min-width: 0; display: flex; flex-direction: column; } .vw-fn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .vw-fn small { color: var(--dim); }
.vw-foot { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.bd-card.sel .vw-foot, .bd-card.active .vw-foot, .modal .vw-foot, .vw-file ~ .vw-foot { opacity: 1; }
.modal .vw { height: min(70vh, 640px); border-radius: 12px; }

/* text size: A−  28  A+ (11-07) */
.bd-fs { display: inline-flex; align-items: center; gap: 2px; padding-right: 6px; margin-right: 2px; border-right: 1px solid rgba(255, 255, 255, .12); }
.bd-fs .btn { min-width: 40px; font-weight: 800; }
.bd-fs b { min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }

/* Fill shapes switch (11-07) */
.bd-fill-sq { display: block; width: 18px; height: 18px; border-radius: 4px; border: 3px solid #f5f7fa; box-sizing: border-box; }
.bd-fillsw.on { background: rgba(80, 180, 255, .22); }

/* line width on the selection bar (11-07) */
.bd-lw .btn { min-width: 44px; display: grid; place-items: center; }
.bd-lw .btn.on { background: rgba(80, 180, 255, .3); box-shadow: inset 0 0 0 2px rgba(80, 180, 255, .8); }

/* invisible drag handle over a file card: drag it to the desktop (11-07) */
.bd-proxy { position: absolute; z-index: 3; cursor: move; background: transparent; -webkit-user-drag: element; }
.bd-proxy[hidden] { display: none; }

/* XL sizes (11-07): the size button fits "XXL" */
.bd-size { font-size: 13px; letter-spacing: -.5px; }
.bd-lw .btn { min-width: 40px; }

/* line width slider, top left next to the tools (11-07) */
.bd-lwbox { position: absolute; left: 72px; top: 10px; z-index: 5; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px 0 8px; border-radius: 14px; background: rgba(20, 23, 28, .95); box-shadow: 0 0 0 1px #05070a, 0 8px 20px rgba(0, 0, 0, .5); }
.bd-lwwell { width: 30px; height: 30px; display: grid; place-items: center; flex: none; }
.bd-lwdot { display: block; border-radius: 50%; background: #f5f7fa; }
.bd-lw-range { width: 150px; height: 30px; accent-color: #4cc9ff; cursor: pointer; }
.bd-lw-num { min-width: 28px; text-align: right; font: 800 13px var(--display); color: #e8ecf1; font-variant-numeric: tabular-nums; }
.bd-top { max-width: calc(100% - 340px); }
@media (max-width: 1100px) {
  .bd-lwbox { padding: 0 8px 0 4px; gap: 4px; }
  .bd-lw-range { width: 96px; }
  .bd-top { top: 62px; max-width: calc(100% - 80px); }
}

/* typeable zoom % (11-07) */
input.bd-zoom { width: 64px; text-align: center; border: 0; outline: none; font: 800 13px var(--display); color: inherit; cursor: text; }
input.bd-zoom:focus { box-shadow: inset 0 0 0 2px #4cc9ff; }
.bd-morecolor { width: 36px; height: 36px; display: grid; place-items: center; font-size: 18px; background: conic-gradient(#ff4757, #ffd166, #3ddc84, #4cc9ff, #b28dff, #ff5d8f, #ff4757) !important; }

/* phones: a tidy board (11-07) */
.bd-top [data-a=more] { display: none; }
.bd-moresheet { position: absolute; right: 10px; top: 62px; z-index: 8; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; border-radius: 16px; background: rgba(20, 23, 28, .97); box-shadow: 0 0 0 1px #05070a, 0 12px 30px rgba(0, 0, 0, .6); width: min(320px, calc(100% - 90px)); }
.bd-moresheet .btn { min-height: 46px; justify-content: center; }
.bd-moresheet .btn.on { background: rgba(76, 201, 255, .25); }
.bd-more-lw { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font: 700 13px var(--font); color: #cfd6df; }
.bd-more-lw input { flex: 1; accent-color: #4cc9ff; height: 30px; }
@media (max-width: 760px) {
  .bd-top { top: 10px !important; max-width: none !important; flex-wrap: nowrap; }
  .bd-top > :not([data-a=undo]):not([data-a=redo]):not([data-a=more]) { display: none !important; }
  .bd-top [data-a=more] { display: inline-flex; }
  .bd-lwbox { display: none !important; }
  .bd-selbar .btn span { display: none; }
  .bd-selbar .btn { min-width: 44px; padding: 0 10px; }
  .bd-selbar .bd-fs b { min-width: 24px; }
}
