/* The pureref badge, the import dialog. Owner: pureref. Tokens from style.css only.
   .pr-tile      a .pur file's tile (js/features/pureref.js decorates it): the board icon on its type card
   .pr-badge     "PureRef" (not imported) / "Canvas" (a button: opens the imported canvas), bottom left of the picture
   .pr-ins       the inspector's section for a .pur file
   .pr-file      the hidden file input of "Import PureRef board…" */

.pr-file { position: fixed; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- a .pur tile: the board icon instead of the generic file icon ---------- */
.pr-tile .tcard > .ic:not(.pr-mark), .pr-tile .lthumb:has(> .pr-mark) > .ic:not(.pr-mark) { display: none; }
.pr-tile .tcard > .pr-mark, .pr-tile .lthumb > .pr-mark { color: var(--muted); }
.pr-tile.sel .tcard > .pr-mark, .pr-tile.sel .lthumb > .pr-mark { color: var(--accent-icon); }

/* ---------- the badge ---------- */
[data-part="pic"]:has(> .pr-badge) { position: relative; }
.pr-badge { position: absolute; left: 8px; bottom: 8px; z-index: 2; height: 22px; display: inline-flex; align-items: center; gap: 5px; padding: 0 8px 0 7px;
  border: 1px solid var(--line-3); border-radius: 7px; background: color-mix(in srgb, var(--sunk) 82%, transparent);
  color: var(--muted); font: 600 11px/1 var(--font); letter-spacing: .01em; white-space: nowrap;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pr-badge .ic { flex: none; }
.pr-badge:not(.in-list) { max-width: calc(100% - 16px); }
.pr-badge span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
button.pr-badge { cursor: pointer; }
.pr-badge.on { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 45%, var(--line-3)); }
.pr-badge.on:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
button.pr-badge:not(.on):hover { background: var(--raised); color: var(--text); }
.pr-badge:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* list rows: inline, before the name */
.pr-badge.in-list { position: static; height: 18px; margin-right: 8px; padding: 0 6px; vertical-align: 1px; border-radius: 6px; gap: 4px; font-size: 10.5px; }
@media (hover: none), (pointer: coarse) {
  button.pr-badge::before { content: ""; position: absolute; inset: -11px; }   /* a 44 px target for a finger */
}

/* ---------- the inspector ---------- */
.pr-ins { display: flex; flex-direction: column; gap: 10px; }
.pr-ins-head { display: flex; align-items: center; gap: 10px; }
.pr-ins-head > .ic { flex: none; width: 30px; height: 30px; padding: 7px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line-2);
  color: var(--accent-icon); box-sizing: border-box; }
.pr-ins-t { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pr-ins-name { font-size: 13px; font-weight: 600; color: var(--text); }
.pr-ins-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-ins-hint { font-size: 12px; line-height: 1.45; color: var(--faint); }
.pr-ins .ins-btn[disabled] { opacity: .5; cursor: default; }
@media (max-width: 767px) {
  .pr-ins .ins-btn { height: 46px; }
}

/* "Import a PureRef board": what to pick and where it is, before the file chooser */
.lib-pop.pr-pop { width: min(380px, calc(100vw - 24px)); }
.pr-pop-text { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.pr-pop-path { margin-top: 6px; padding: 7px 10px; border-radius: 8px; background: var(--sunk); border: 1px solid var(--line); color: var(--text-2);
  font: 11.5px/1.4 var(--mono); overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.pr-pop .lib-pop-row { margin-top: 12px; }
