/* Boards & canvases (owner: collections): the sidebar tree (js/features/collectiontree.js), child cards on a
   board (boardview.js), the linked-canvas chip after a folder's title, the badge on linked folder tiles and the
   inspector's links (folderlinks.js). Tokens from style.css only; classes prefixed .col-. */

/* ---------- the BOARDS & CANVASES tree ---------- */
.col-row { gap: 6px; padding-left: calc(2px + var(--depth, 0) * 14px); }
.col-row .board-cover { margin-right: 2px; }
.col-tw { display: grid; place-items: center; width: 16px; height: 16px; flex: none; border-radius: 4px; color: var(--faint); cursor: pointer; }
.col-tw:hover { background: var(--raised); color: var(--text); }
.col-tw .ic { transition: transform .15s; }
.col-tw.open .ic { transform: rotate(90deg); }
.col-tw.none { visibility: hidden; pointer-events: none; }
.navrow.on .col-tw { color: var(--accent-icon); }
/* a canvas: its frame icon where a board shows its 2x2 cover */
.board-cover.col-cv { background: var(--panel); color: var(--muted); }
.navrow.on .board-cover.col-cv { color: var(--accent-icon); }
/* drops: before / after are the shared lines (lib-drop-*); inside a board, or tiles added to it */
.col-row.col-drop-into, .col-row.col-drop-add { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent-ink); }
.col-end { min-height: 10px; border-radius: 4px; }
.sb-body.col-drop-top .col-end { box-shadow: inset 0 2px 0 var(--accent); }

/* ---------- a child board or canvas on a board: a card like a folder's ---------- */
.col-mosaic { position: relative; }
.col-kind { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px;
  border-radius: 6px; background: color-mix(in srgb, var(--sunk) 78%, transparent); color: var(--text-2); font-size: 11px; font-weight: 500;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none; }
.col-kind .ic { color: var(--accent-icon); }
.col-card .fname::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M3.5 2.5h9a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1h-9a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1zM6.75 2.5v11M6.75 8h6.75'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M3.5 2.5h9a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1h-9a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1zM6.75 2.5v11M6.75 8h6.75'/%3E%3C/svg%3E") center / contain no-repeat; }
.col-card-canvas .fname::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M3 2.5h10a.5.5 0 0 1 .5.5v10a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V3a.5.5 0 0 1 .5-.5zM5 5h3.25v2.75H5zM8.25 8.75h2.75V11H8.25z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M3 2.5h10a.5.5 0 0 1 .5.5v10a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V3a.5.5 0 0 1 .5-.5zM5 5h3.25v2.75H5zM8.25 8.75h2.75V11H8.25z'/%3E%3C/svg%3E") center / contain no-repeat; }
.col-card .mosaic.n0 .folder-ic { color: var(--faint); }
.board-grid .col-card[draggable=true] { cursor: pointer; }

/* ---------- the chip right after a linked folder's title ---------- */
.col-chip { height: 28px; display: inline-flex; align-items: center; gap: 6px; max-width: min(320px, 60vw); padding: 0 11px 0 9px; flex: none;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 500;
  text-decoration: none; cursor: pointer; white-space: nowrap; }
.col-chip:hover { background: var(--hover); color: var(--text); border-color: var(--line-3); }
.col-chip > .ic:first-child { color: var(--accent-icon); }
.col-chip > .ic:last-child:not(:first-child) { color: var(--faint); margin-right: -3px; }
.col-chip-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-chip[aria-expanded=true] { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.col-tools { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
@media (max-width: 767px) {
  .col-chip.ph { height: 36px; padding: 0 14px 0 12px; font-size: 13px; max-width: 100%; flex: 0 1 auto; min-width: 0; position: relative; }
  .col-chip.ph::before { content: ""; position: absolute; inset: -4px 0; }   /* a 44 px tall target */
}

/* ---------- the badge on a linked folder's tile (bottom right of its cover) ---------- */
.mosaic:has(> .col-badge), .lthumb:has(> .col-badge) { position: relative; }
.col-badge { position: absolute; right: 7px; bottom: 7px; z-index: 2; height: 22px; min-width: 22px; display: inline-flex; align-items: center; justify-content: center;
  gap: 3px; padding: 0 5px; border: 1px solid var(--line-3); border-radius: 7px; background: color-mix(in srgb, var(--sunk) 82%, transparent);
  color: var(--accent-text); font: 600 11px/1 var(--font); font-variant-numeric: tabular-nums; cursor: pointer;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.col-badge:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--text); }
.lthumb > .col-badge { right: 1px; bottom: 1px; height: 16px; min-width: 16px; padding: 0 2px; border-radius: 5px; }
.lthumb > .col-badge span { display: none; }
@media (hover: none), (pointer: coarse) {
  .col-badge::before { content: ""; position: absolute; inset: -10px; }   /* a bigger target for a finger */
}

/* ---------- the inspector: a folder's links; a board's or canvas's linked folders (popover) ---------- */
.col-ins { display: flex; flex-direction: column; gap: 8px; }
.col-ins-head { display: flex; align-items: center; gap: 6px; }
.col-ins-head .ic { color: var(--accent-icon); }
.col-ins-list + .col-ins-head { margin-top: 8px; }
.col-ins-list, .col-links-list { display: flex; flex-direction: column; gap: 6px; }
.col-ins-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.col-ins-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--panel); color: var(--text-2); text-decoration: none; }
.col-ins-link:hover { background: var(--raised); color: var(--text); }
.col-ins-link > .ic { color: var(--accent-icon); }
.col-ins-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.col-ins-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-ins-sub { color: var(--faint); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.col-ins-x { width: 32px; height: 32px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--faint); cursor: pointer; }
.col-ins-x:hover { background: var(--raised); color: var(--text); }
.col-links { width: min(340px, calc(100vw - 16px)); }
.col-links-list { max-height: min(220px, 40vh); overflow-y: auto; overscroll-behavior: contain; }
.col-found .ic { color: var(--faint); }
.col-pick .board-opt.col-linked .nl { color: var(--accent-text); }
.col-tick { color: var(--accent-text); }
@media (max-width: 767px) {
  .col-row { min-height: 44px; }
  .col-tw { width: 28px; height: 40px; margin: -10px -4px -10px -6px; }
  .col-ins-x { width: 44px; height: 44px; }
  .col-ins-link { min-height: 48px; }
}
