/* Symlinks and shortcuts (owner: links, js/features/links.js + brokenlinks.js): Explorer's arrow badge on a link's
   picture, greyed broken and outside links, the inspector's link section, the "Linked folder" header chip and the
   Broken links list. Tokens from style.css only. */

/* ---------- tiles: the badge sits bottom-left on the picture, like Explorer's shortcut arrow ---------- */
.lk-item .mosaic, .lk-item .sqimg, .lk-item .lthumb { position: relative; }
.lk-badge { position: absolute; left: 7px; bottom: 7px; z-index: 1; display: grid; place-items: center; width: 20px; height: 20px;
  border-radius: 6px; background: var(--text); color: var(--accent-strong); box-shadow: 0 1px 4px rgba(0, 0, 0, .45); pointer-events: none; }
.lk-badge .ic { width: 13px; height: 13px; stroke-width: 2; }
.lk-badge.off { background: var(--raised-2); color: var(--danger); box-shadow: 0 0 0 1px var(--line-3); }
.mosaic > .lk-badge { left: 8px; bottom: 8px; }
.lthumb > .lk-badge { left: 1px; bottom: 1px; width: 15px; height: 15px; border-radius: 4px; }
.lthumb > .lk-badge .ic { width: 10px; height: 10px; }
/* the folder icon before a linked folder's name gets the arrow too */
.lk-item .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' stroke-linecap='round'%3E%3Cpath d='M1.75 4.25c0-.55.45-1 1-1h3.1l1.4 1.5h5.99c.55 0 1 .45 1 1v6.5c0 .55-.45 1-1 1H2.75c-.55 0-1-.45-1-1z'/%3E%3Cpath d='M6 11.5v-1.2a2 2 0 0 1 2-2h2.5M9.2 6.9l1.4 1.4-1.4 1.4'/%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' stroke-linecap='round'%3E%3Cpath d='M1.75 4.25c0-.55.45-1 1-1h3.1l1.4 1.5h5.99c.55 0 1 .45 1 1v6.5c0 .55-.45 1-1 1H2.75c-.55 0-1-.45-1-1z'/%3E%3Cpath d='M6 11.5v-1.2a2 2 0 0 1 2-2h2.5M9.2 6.9l1.4 1.4-1.4 1.4'/%3E%3C/svg%3E") center / contain no-repeat; }
/* broken and outside links: greyed, still selectable (the inspector says what is missing) */
.lk-off [data-part="pic"] > img, .lk-off [data-part="pic"] > .tcard, .lk-off .mosaic > img, .lk-off .mosaic > .folder-ic { filter: grayscale(1); opacity: .42; }
.lk-off .mosaic.n0, .lk-off > .sqimg { background: var(--panel-2); }
.lk-off .fname, .lk-off .cn, .lk-off .tcn, .lk-off .lname, .lk-off .sqcap { color: var(--faint); }
.lk-off .fmeta, .lk-off .cd, .lk-off .fsize { color: var(--dim); }
@media (hover: hover) {
  .fcard.lk-off:hover, .tile.lk-off:hover { translate: none; }
}
/* hidden items (shown with the "Hidden items" setting): faded, like Explorer */
.lk-hid [data-part="pic"], .lk-hid .mosaic, .lk-hid .lthumb { opacity: .5; }
.lk-hid .fname, .lk-hid .cn, .lk-hid .tcn, .lk-hid .lname, .lk-hid .sqcap { opacity: .6; }

/* ---------- header chip: "Linked folder · original in MULTI" + Go to original ---------- */
.lk-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; max-width: 100%; padding: 0 3px 0 9px; border: 1px solid var(--line-2);
  border-radius: 999px; color: var(--muted); font-size: 11.5px; white-space: nowrap; min-width: 0; }
.lk-chip > .ic { color: var(--accent-icon); flex: none; }
.lk-chip-t { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lk-chip-go { flex: none; height: 20px; padding: 0 9px; border: 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text);
  font-size: 11.5px; font-weight: 500; cursor: pointer; }
.lk-chip-go:hover { background: var(--accent-strong); color: var(--accent-ink); }

/* ---------- inspector ---------- */
.lk-sec { display: flex; flex-direction: column; gap: 10px; }
.lk-head { display: flex; align-items: center; gap: 6px; color: var(--faint); margin-top: 2px; }
.lk-head .ic { color: var(--accent-icon); }
.lk-head.off .ic { color: var(--danger); }
.lk-head.off .ins-label { color: var(--danger); }
.lk-head ~ .lk-head { margin-top: 8px; }
.lk-line { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lk-k { color: var(--faint); font-size: 11.5px; }
.lk-path { color: var(--text-2); font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; text-decoration: none; }
a.lk-path:hover { color: var(--accent-text); }
.lk-raw { color: var(--text-2); font: 11.5px/1.5 var(--mono); overflow-wrap: anywhere; user-select: text; }
.lk-note { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.lk-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; }
.lk-btns .ins-btn { height: 36px; font-size: 12.5px; }
.lk-btns .ins-btn.primary { height: 36px; grid-column: 1 / -1; }
.lk-also { display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; }
.lk-arow { display: grid; grid-template-columns: 16px minmax(0, 1fr); column-gap: 8px; align-items: center; min-height: 34px; padding: 5px 8px;
  border-radius: 8px; color: var(--text-2); text-decoration: none; }
.lk-arow:hover, .lk-arow:focus-visible { background: var(--raised); color: var(--text); outline: none; }
.lk-arow > .ic { grid-row: span 2; color: var(--faint); }
.lk-aname { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-apath { grid-column: 2; color: var(--faint); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-apath:empty { display: none; }
.lk-more { align-self: flex-start; margin: 2px 8px 0; padding: 4px 0; border: 0; background: none; color: var(--accent-text); font-size: 12px; cursor: pointer; }
.lk-more:hover { text-decoration: underline; }
.ins-row.lk-bad .v { color: var(--danger); }
.lk-fragile { margin-left: auto; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-3); color: var(--warn); font-size: 10.5px;
  font-weight: 600; letter-spacing: .02em; cursor: help; }
a.lk-now { color: var(--accent-text); }

/* ---------- the Broken links list ---------- */
.kb-dialog.lk-bl { width: min(900px, 100%); display: flex; flex-direction: column; gap: 4px; }
.lk-bl-intro { margin: 0 0 6px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.lk-bl-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.lk-bl-tabs:empty { display: none; }
.lk-bl-filter { flex: 1 1 200px; min-width: 0; height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel);
  color: var(--text); outline: none; }
.lk-bl-filter:focus { border-color: var(--accent); }
.lk-bl-copy { min-height: 36px; }
.lk-bl-list { display: flex; flex-direction: column; gap: 10px; }
.lk-bl-group { border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--panel-2); }
.lk-bl-ghead { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; background: var(--panel); color: var(--text-2); }
.lk-bl-ghead > .ic { color: var(--faint); }
.lk-bl-gtext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lk-bl-gname { font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.lk-bl-gpath { color: var(--faint); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-bl-gn { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.lk-bl-open { flex: none; height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  font-size: 12px; cursor: pointer; }
.lk-bl-open:hover { background: var(--raised); color: var(--text); }
.lk-bl-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; column-gap: 10px; row-gap: 2px; align-items: center; width: 100%;
  padding: 8px 12px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text-2); text-align: left; cursor: pointer; }
.lk-bl-row:hover, .lk-bl-row:focus-visible { background: var(--raised); color: var(--text); outline: none; }
.lk-bl-item { border-top: 1px solid var(--line); }
.lk-bl-item > .lk-bl-row { border-top: 0; }
.lk-bl-item.hit { background: var(--accent-sel); }
.lk-bl-in { grid-column: 2 / -1; color: var(--faint); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-bl-now { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 0 12px 9px 38px; border: 0; background: none; text-align: left;
  cursor: pointer; color: var(--accent-text); font-size: 11.5px; min-width: 0; }
.lk-bl-now:hover .lk-bl-nowp, .lk-bl-now:focus-visible .lk-bl-nowp { text-decoration: underline; }
.lk-bl-now:focus-visible { outline: none; }
.lk-bl-nowk { flex: none; color: var(--faint); }
.lk-bl-nowp { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-bl-gpath.wrap { white-space: normal; }
.lk-bl-row > .ic { color: var(--danger); }
.lk-bl-name { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-bl-kind { color: var(--faint); font-size: 11.5px; }
.lk-bl-target { grid-column: 2 / -1; color: var(--muted); font: 11px/1.45 var(--mono); overflow-wrap: anywhere; }
.lk-bl-empty { padding: 16px 4px; color: var(--muted); }

/* ---------- touch screens and phones ---------- */
@media (pointer: coarse) {
  .lk-chip { height: 32px; }
  .lk-chip-go { height: 26px; }
  .lk-arow { min-height: 44px; }
  .lk-btns .ins-btn, .lk-btns .ins-btn.primary { height: 44px; }
  .lk-bl-row { min-height: 44px; }
  .lk-bl-now { min-height: 44px; align-items: center; padding-bottom: 2px; }
  .lk-bl-open { height: 44px; }
  .lk-bl-filter, .lk-bl-copy { height: 44px; min-height: 44px; }
  .seg.seg-text.lk-bl-tabs button { height: 38px; position: relative; }
  .seg.seg-text.lk-bl-tabs button::before { content: ""; position: absolute; inset: -3px 0; }
  .lk-bl .kb-head .ibtn { position: relative; }
  .lk-bl .kb-head .ibtn::before { content: ""; position: absolute; inset: -6px; }
}
@media (max-width: 767px) {
  .kb-scrim.lk-bl-scrim { padding: 8px; align-items: end; }
  .kb-dialog.lk-bl { max-height: 92vh; padding: 14px 14px 18px; border-radius: 16px 16px 12px 12px; }
  .lk-bl-row { grid-template-columns: 16px minmax(0, 1fr); }
  .lk-bl-kind { display: none; }
  .lk-bl-target { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .lk-bl-open { height: 44px; min-width: 44px; }
}
