/* Linked chips (rfid_protocol/linked/index.js, docs/LINKED-CHIPS.md): the
   new-chip side card (#chipChoicePanel) and the detail panel's section. */
/* One card: the rail of square choices (212 px) + the pane (400 px) that holds
   the chosen view. z 101: above Add product's click-outside overlay (z 100). */
#chipChoicePanel { width: 664px; max-width: 98vw; z-index: 101; display: flex; flex-direction: row; }
.lc-rail { flex: 0 0 212px; min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); }
/* clip, not hidden: a hidden overflow is a scroll box, and focusing the incoming
   view's search field scrolled it into place at once, killing the slide. */
.lc-pane { flex: 1; min-width: 0; position: relative; overflow: clip; }
/* Decorative column between the rail and the pane: TigerTag first, then the
   makers whose MIFARE 1K spool chips link to a spool, then the other printers
   and hosts Studio talks to (Klipper with its Fluidd / Mainsail front ends). Monochrome masks (theme colour), TigerTag at full
   strength. */
.lc-brands { flex: 0 0 52px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 22px;
  padding: 14px 0 16px; border-right: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
/* "Works with" on top: says what the logos are for — the app works with these
   printers and with their spools' own tags. */
.lc-brands-cap { max-width: 100%; box-sizing: border-box; margin-bottom: -10px; padding: 0 4px; font-size: 10px; font-weight: 600; line-height: 1.2; text-align: center; color: var(--muted); }
/* Longer words in some languages: a smaller size so each word stays whole in the 52 px column. */
:lang(es) .lc-brands-cap, :lang(it) .lc-brands-cap, :lang(pt) .lc-brands-cap, :lang(ru) .lc-brands-cap { font-size: 9px; }
:lang(fr) .lc-brands-cap { padding: 0 2px; font-size: 8px; }
.lc-brand { position: relative; width: 28px; aspect-ratio: 1; flex: none; cursor: default; transition: filter .3s; }
/* The logo itself: a mask filled with the theme colour, and the brand's own
   colour (--brand) when lit (.is-lit, linked/index.js: hovered and held LIT_MS
   after, or by the idle garland — the same effect). The glow sits on the wrapper: a filter on
   the masked element would be cut away by its own mask. */
/* Growing = a negative inset on the masked <i>, never a transform: a scaled
   mask is rasterised at its rest size and blurs; a bigger box is re-drawn sharp.
   The wrapper keeps its size, so the column does not shift. */
.lc-brand > i { position: absolute; inset: 0; opacity: .38; background-color: var(--text);
  /* A sheen sweeps left to right through the logo now and then, one logo after
     the other down the column (--i). */
  background-image: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, .95) 50%, transparent 60%);
  background-size: 250% 100%; background-repeat: no-repeat; background-position: 220% 0;
  transition: opacity .3s, background-color .3s, inset .35s cubic-bezier(.3, 1.6, .5, 1);
  -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat;
  animation: lc-brand-sheen 7s ease-in-out infinite; animation-delay: calc(var(--i, 0) * .14s); }
@keyframes lc-brand-sheen { 0%, 70% { background-position: 220% 0; } 82%, 100% { background-position: -120% 0; } }
.lc-brand.is-lit > i { inset: -11%; }
.lc-brand.is-lit { filter: drop-shadow(0 0 4px var(--brand, var(--primary))) drop-shadow(0 0 10px color-mix(in srgb, var(--brand, var(--primary)) 55%, transparent)); }
.lc-brand.is-lit > i { opacity: 1; background-color: var(--brand, var(--primary));
  background-image: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, .7) 50%, transparent 60%);
  animation: lc-brand-shine .8s ease-out; }
@keyframes lc-brand-shine { from { background-position: 220% 0; } to { background-position: -120% 0; } }
/* The mouse anywhere in the column (.is-awake, set by linked/index.js): the tiger on top grows, slowly, and shrinks
   back as slowly when it leaves — the mouse often just sweeps across, so no pop.
   It keeps its own colour: no brand colour, no glow, on the column or on itself. */
.lc-brand.lc-brand[data-brand="tigertag"] > i { transition: opacity .3s, inset .7s cubic-bezier(.4, 0, .2, 1); animation: none; }
.lc-brands.is-awake .lc-brand[data-brand="tigertag"] > i { inset: -10%; }
.lc-brands .lc-brand[data-brand="tigertag"].is-lit { filter: none; }
.lc-brands .lc-brand[data-brand="tigertag"].is-lit > i { inset: -15%; }
.lc-brand[data-brand="tigertag"].is-lit > i { background-color: var(--text); background-image: none; animation: none; }
@media (prefers-reduced-motion: reduce) {
  .lc-brand > i, .lc-brand.is-lit > i { animation: none; background-image: none; }
  .lc-brand > i, .lc-brand.lc-brand[data-brand="tigertag"] > i { transition: opacity .3s, background-color .3s; }
}
.lc-brand[data-brand="tigertag"]  { --logo: url('../../../assets/svg/logos/tigersystem-icon-framed-white.svg'); width: 36px; }   /* the app icon's tiger */
.lc-brand[data-brand="tigertag"] > i { opacity: .9; }
.lc-brand[data-brand="bambulab"]  { --logo: url('../../../assets/svg/icons/logo_bambulab.svg'); }
.lc-brand[data-brand="creality"]  { --logo: url('../../../assets/svg/icons/logo_creality.svg'); }
.lc-brand[data-brand="anycubic"]  { --logo: url('../../../assets/svg/icons/logo_anycubic.svg'); }
.lc-brand[data-brand="snapmaker"] { --logo: url('../../../assets/svg/icons/logo_snapmaker.svg'); }
.lc-brand[data-brand="elegoo"]    { --logo: url('../../../assets/svg/icons/logo_elegoo.svg'); }
.lc-brand[data-brand="qidi"]      { --logo: url('../../../assets/svg/icons/logo_qidi.svg'); width: 34px; }
.lc-brand[data-brand="prusa"]      { --logo: url('../../../assets/svg/icons/logo_prusa.svg'); }
.lc-brand[data-brand="flashforge"] { --logo: url('../../../assets/svg/icons/logo_flashforge.svg'); }
.lc-brand[data-brand="klipper"]    { --logo: url('../../printers/klipper/img/logo.svg'); }
.lc-brand[data-brand="octoprint"]  { --logo: url('../../printers/octoprint/img/logo.svg'); }
.lc-brand[data-brand="fluidd"]     { --logo: url('../../../assets/svg/logos/logo_fluidd.svg'); }
.lc-brand[data-brand="mainsail"]   { --logo: url('../../../assets/svg/icons/logo_mainsail.svg'); }
/* A short window: the column scrolls out of sight rather than squeezing the logos. */
.lc-brands { overflow-x: visible; overflow-y: clip; }
.lc-brand { flex: none; }
/* Each logo lights up in its brand's colour on hover. */
.lc-brand[data-brand="bambulab"] { --brand: #00ae42; }
.lc-brand[data-brand="creality"] { --brand: #2ee65c; }
.lc-brand[data-brand="anycubic"] { --brand: #00a9e0; }
.lc-brand[data-brand="snapmaker"] { --brand: var(--text); }
.lc-brand[data-brand="elegoo"] { --brand: #3b6cff; }
.lc-brand[data-brand="qidi"] { --brand: #4b5cff; }
.lc-brand[data-brand="prusa"] { --brand: #fa6831; }
.lc-brand[data-brand="flashforge"] { --brand: var(--text); }
.lc-brand[data-brand="klipper"] { --brand: #e5484d; }
.lc-brand[data-brand="octoprint"] { --brand: #13c100; }
.lc-brand[data-brand="fluidd"] { --brand: #2196f3; }
.lc-brand[data-brand="mainsail"] { --brand: #e3242b; }
/* TigerTag stays on top; the makers sit centred in the height left below it. */
.lc-brand[data-brand="tigertag"] + .lc-brand { margin-top: auto; }
.lc-brand:last-child { margin-bottom: auto; }
/* A borrowed card fills the pane: no fixed position, slide, shadow or corners
   of its own (id selectors — each card sets these by id). */
#chipChoicePane > #chipLinkPanel,
#chipChoicePane > #catalogPickPanel,
#chipChoicePane > #addProductPanel,
#chipChoicePane > #chipEraserPanel,
#chipChoicePane > #chipRestorePanel,
#chipChoicePane > #qrScanPanel,
#chipChoicePane > #tagAddPanel {
  position: absolute; inset: 0; right: 0; top: 0; bottom: 0;
  width: 100%; max-width: none; height: 100%;
  transform: none; transition: none; box-shadow: none; border-radius: 0; z-index: 2;
}
#chipChoicePane > .detail-panel:not(.open):not(.lc-leaving) { display: none; }
/* View switch: the incoming card slides in over the outgoing one. */
#chipChoicePane > #chipLinkPanel.lc-leaving,
#chipChoicePane > #catalogPickPanel.lc-leaving,
#chipChoicePane > #addProductPanel.lc-leaving,
#chipChoicePane > #chipEraserPanel.lc-leaving,
#chipChoicePane > #chipRestorePanel.lc-leaving,
#chipChoicePane > #qrScanPanel.lc-leaving,
#chipChoicePane > #tagAddPanel.lc-leaving { z-index: 1; pointer-events: none; }
#chipChoicePane > .detail-panel.lc-enter { animation: lc-slide .26s cubic-bezier(.4,0,.2,1) both; box-shadow: -8px 0 24px rgba(0,0,0,.35); }
#chipChoicePane > .detail-panel.lc-pre { visibility: hidden; }
@keyframes lc-slide { from { transform: translateX(100%); } to { transform: none; } }
/* The card's own ✕ goes: the rail's ✕ closes the whole card. */
#chipChoicePane .panel-close, #chipChoicePane #addProductClose { display: none; }
#chipLinkPanel { width: 400px; max-width: 95vw; z-index: 97; display: flex; flex-direction: column; }
#chipChoicePanel .pba-header { gap: 10px; align-items: flex-start; padding-left: 18px; padding-right: 14px; }
#chipChoicePanel .pba-title { font-size: 15px; line-height: 1.3; }
#chipChoicePanel .pba-header-text { flex: 1; min-width: 0; text-align: left; }
.lc-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8px 18px 18px; overflow: auto; scrollbar-width: none; }
/* The choices fill the rail's height: square (176 px, the rail's inner width)
   when there is room, squashed together on a short window so they all stay in
   view; below 64 px each, the rail scrolls. A squashed tile shrinks its icon and
   label (container queries on the tile's own height). */
.lc-choices { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.lc-choice.lc-choice { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; width: 100%; flex: 0 1 176px; height: auto; min-height: 64px; container-type: size; padding: 8px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-align: center; cursor: pointer; transition: border-color .15s, transform .15s, background .15s; }
.lc-choice.lc-choice:hover { border-color: var(--primary); transform: translateY(-2px); }
.lc-choice.lc-choice:active { transform: scale(.98); }
/* "Link" with no chip on the TigerPOD: greyed; a click says why in the red bubble. */
.lc-choice.lc-choice.is-off { opacity: .45; border-color: var(--border); transform: none; background: var(--surface-2); }
.lc-choice.lc-choice.is-off .tool-info { opacity: 1; }
.lc-choice.lc-choice.is-active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--surface-2)); }
.lc-choice b { font-size: 13.5px; line-height: 1.3; }
.lc-choice .tool-info { position: absolute; top: 8px; right: 8px; }
/* Restore TigerTag+: the app icon's framed tiger as its picture, the one atop the
   "Works with" column (a mask in the theme colour, like the other icons). */
.lc-choice-logo { width: 34px; aspect-ratio: 1; background-color: var(--primary);
  -webkit-mask: url('../../../assets/svg/logos/tigersystem-icon-framed-white.svg') center / contain no-repeat;
          mask: url('../../../assets/svg/logos/tigersystem-icon-framed-white.svg') center / contain no-repeat; }
.lc-in { animation: lc-in .22s ease both; }
@keyframes lc-in { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.lc-choice-ic { display: grid; place-items: center; width: 40px; height: 40px; }
.lc-choice-ic .icon { background: var(--primary); }
@container (max-height: 132px) {
  .lc-choice-ic { width: 30px; height: 30px; }
  .lc-choice-logo { width: 26px; }
  .lc-choice-ic .icon { width: 24px; height: 24px; }
  .lc-choice b { font-size: 12.5px; }
}
@container (max-height: 96px) {
  .lc-choice-ic { width: 22px; height: 22px; margin-bottom: -6px; }
  .lc-choice-logo { width: 20px; }
  .lc-choice-ic .icon { width: 18px; height: 18px; }
  .lc-choice b { font-size: 12px; line-height: 1.2; }
}

/* Same track as the inventory grid (.inv-grid) — its own spool cards. */
.lc-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: min-content; align-content: start; gap: 8px; overflow: auto; padding: 2px; scrollbar-width: none; }
.lc-grid::-webkit-scrollbar { display: none; }
.lc-spool.is-loading { opacity: .5; pointer-events: none; }
.lc-grid-empty { grid-column: 1 / -1; margin: 12px 0; font-size: 13px; color: var(--muted); text-align: center; }
.lc-filters { display: flex; gap: 8px; margin-bottom: 8px; }
.lc-filters .lc-qbox { flex: 1; }
/* Search pill — the brand dropdown's look (40 px, round, surface-2), the
   magnifier on the right, swapped for the clear ✕ while there is text. */
.lc-qbox { position: relative; display: block; min-width: 0; }
/* Id-scoped too: the side cards' own input rules are id-scoped and otherwise
   draw a box inside the pill. */
.lc-qbox input, .lc-qbox input:focus, #catalogPickPanel .lc-qbox input, #catalogPickPanel .lc-qbox input:focus, #chipLinkPanel .lc-qbox input, #chipLinkPanel .lc-qbox input:focus { width: 100%; height: 40px; margin: 0; padding: 0 38px 0 16px; box-sizing: border-box; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); box-shadow: none; outline: none; color: var(--text); font: inherit; font-size: 13px; }
#catalogPickPanel .lc-qbox input:focus, #chipLinkPanel .lc-qbox input:focus, .lc-qbox input:focus { border-color: var(--primary); }
.lc-qbox > .icon-search { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: var(--muted); pointer-events: none; }
.lc-qbox .inv-search-clear { right: 10px; }
.lc-qbox:has(.inv-search-clear:not([hidden])) > .icon-search { display: none; }
.lc-filters .csel { flex: 0 0 auto; max-width: 45%; }

.lc-section { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.lc-section-h { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.lc-section-h .icon { background: var(--muted); }
.lc-linked { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 10px; border-radius: 10px; background: var(--surface-2); }
.lc-linked-uids { display: flex; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.lc-linked code { font: 700 12px ui-monospace, monospace; color: var(--text); }
.lc-unlink.lc-unlink { position: relative; overflow: hidden; height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; }
.lc-unlink.lc-unlink:hover { border-color: var(--danger); }
.lc-spool.is-selected { outline: 2px solid var(--primary); outline-offset: -1px; }
/* The same 52 px box as the burn banner's TigerTag logo (.rfid-material-icon):
   a Link and a Burn banner swap in place at the same height. */
.lc-offer-ic { display: grid; place-items: center; height: 52px; aspect-ratio: 1 / 1; flex-shrink: 0; }
.lc-offer-ic .icon { background: var(--primary); }
.lc-offer-banner.lc-offer-banner { position: relative; overflow: hidden; width: 100%; height: auto; min-height: 58px; padding: 8px 14px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; text-align: left; font: inherit; cursor: pointer; }
.lc-offer-banner > :not(.hold-progress) { position: relative; z-index: 1; }
/* A link is a gain, not a warning: success green, not the alert amber of the
   other chip banners, and a green fill instead of the red delete fill. Every
   link banner (the grid's offer, the product card's and the spool card's
   "Link the proprietary third-party Tag") shares it, by class. */
.lc-offer-banner.lc-offer-banner { background: color-mix(in srgb, var(--success) 12%, transparent); }
.lc-offer-banner.lc-offer-banner .chip-update-text { color: var(--success-text); font-weight: 600; }
.lc-offer-banner.lc-offer-banner .lc-offer-ic .icon { background: var(--success); }
/* Same "burning" feel as the burn banner (70-detail-misc.css, cloud-burn-*): a
   glint sweeps across, the link icon glows, the held fill's leading edge burns
   bright — and while held only the fill stays lit. */
.lc-offer-banner.lc-offer-banner .hold-progress {
  background: linear-gradient(90deg, color-mix(in srgb, var(--success) 18%, transparent), color-mix(in srgb, var(--success) 50%, transparent));
  opacity: 1;
  box-shadow: 6px 0 14px color-mix(in srgb, var(--success) 70%, transparent);
}
.lc-offer-banner.lc-offer-banner::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, color-mix(in srgb, var(--success) 22%, transparent) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: cloud-burn-sweep 2.6s ease-in-out infinite;
}
.lc-offer-banner.lc-offer-banner .lc-offer-ic .icon { animation: cloud-burn-glow 2s ease-in-out infinite; }
.lc-offer-banner.lc-offer-banner:hover .lc-offer-ic .icon { animation-duration: .9s; }
.lc-offer-banner.lc-offer-banner:is(.is-holding, .is-confirming)::after { animation: none; opacity: 0; }
.lc-offer-banner.lc-offer-banner:is(.is-holding, .is-confirming) .lc-offer-ic .icon { animation: none; filter: none; }
@media (prefers-reduced-motion: reduce) {
  .lc-offer-banner.lc-offer-banner::after, .lc-offer-banner.lc-offer-banner .lc-offer-ic .icon { animation: none; }
}
.lc-offer-banner.lc-offer-banner .tool-info { margin-left: auto; }

/* Add with TigerTag (#tagAddPanel, inventory.js openTagAddPanel): the reader
   plates of the NFC tools (eraser.css .cer-chips), the status line under them. */
#tagAddPanel { display: flex; flex-direction: column; }
#tagAddPanel .tag-add-status { min-height: 1.4em; }
#tagAddPanel .tag-add-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; padding: 0; overflow-y: auto; min-height: 0; }   /* the catalogue's .cpk-list, without its side padding */
#tagAddPanel .tag-add-list:empty { display: none; }
#tagAddPanel .tag-add-item { width: 100%; font: inherit; animation: tag-add-in .3s cubic-bezier(.2, .8, .2, 1); }
#tagAddPanel .tag-add-item .cpk-row-txt { flex: 1; }
/* The spool's TigerTag / TigerTag+ badge (tierBadgeHTML) leads the brand line. */
#tagAddPanel .tag-add-item .tag-add-tier { margin-right: 6px; vertical-align: middle; }
/* Already in the inventory when presented: a quiet pill on the right. */
#tagAddPanel .tag-add-pill { flex: none; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
  color: var(--game-ok-text); background: color-mix(in srgb, var(--game-ok-text) 14%, transparent); border: 1px solid color-mix(in srgb, var(--game-ok-text) 35%, transparent); }
@keyframes tag-add-in { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { #tagAddPanel .tag-add-item { animation: none; } }
/* While a chip is read and looked up: a shimmering mini card (the league's
   skeleton, .sqb-skel / sqb-shimmer in 10-settings.css). */
#tagAddPanel .tag-add-skel { min-height: 66px; }
#tagAddPanel .tag-add-skel .tag-add-skel-thumb { align-self: stretch; width: 66px; border-radius: 0; }
#tagAddPanel .tag-add-skel .sqb-skel-b i:first-child { width: 55%; }
