/* ── 70-detail-misc.css — icons, stats, table/grid, detail panel, debug, twin-link, toolbox, TD edit, TD1S, display-name ── */

  /* ── icon system — CSS mask, inherits currentColor ── */
  .icon {
    display: inline-block; flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
    vertical-align: middle;
  }
  .icon-9  { width:  9px; height:  9px; }
  .icon-10 { width: 10px; height: 10px; }
  .icon-11 { width: 11px; height: 11px; }
  .icon-12 { width: 12px; height: 12px; }
  .icon-13 { width: 13px; height: 13px; }
  .icon-14 { width: 14px; height: 14px; }
  .icon-16 { width: 16px; height: 16px; }
  .icon-18 { width: 18px; height: 18px; }
  .icon-32 { width: 32px; height: 32px; }
  .icon-20 { width: 20px; height: 20px; }
  .icon-24 { width: 24px; height: 24px; }
  .icon-22 { width: 22px; height: 22px; }
  .icon-edit      { -webkit-mask-image: url('../../assets/svg/icons/icon_edit.svg');         mask-image: url('../../assets/svg/icons/icon_edit.svg'); }
  .icon-check     { -webkit-mask-image: url('../../assets/svg/icons/icon_check.svg');        mask-image: url('../../assets/svg/icons/icon_check.svg'); }
  .icon-check-bold { -webkit-mask-image: url('../../assets/svg/icons/icon_check_bold.svg'); mask-image: url('../../assets/svg/icons/icon_check_bold.svg'); }
  .icon-search    { -webkit-mask-image: url('../../assets/svg/icons/icon_search.svg');       mask-image: url('../../assets/svg/icons/icon_search.svg'); }
  .icon-trash     { -webkit-mask-image: url('../../assets/svg/icons/icon_trash.svg');        mask-image: url('../../assets/svg/icons/icon_trash.svg'); }
  .icon-flag      { -webkit-mask-image: url('../../assets/svg/icons/icon_flag.svg');         mask-image: url('../../assets/svg/icons/icon_flag.svg'); }
  .icon-broom     { -webkit-mask-image: url('../../assets/svg/icons/icon_broom.svg');        mask-image: url('../../assets/svg/icons/icon_broom.svg'); }
  .icon-recycle   { -webkit-mask-image: url('../../assets/svg/icons/icon_recycle.svg');      mask-image: url('../../assets/svg/icons/icon_recycle.svg'); }
  .icon-lock      { -webkit-mask-image: url('../../assets/svg/icons/icon_lock.svg');         mask-image: url('../../assets/svg/icons/icon_lock.svg'); }
  .icon-key       { -webkit-mask-image: url('../../assets/svg/icons/icon_key.svg');          mask-image: url('../../assets/svg/icons/icon_key.svg'); }
  .icon-sparkle   { -webkit-mask-image: url('../../assets/svg/icons/icon_sparkle.svg');      mask-image: url('../../assets/svg/icons/icon_sparkle.svg'); }
  .icon-robot     { -webkit-mask-image: url('../../assets/svg/icons/icon_robot.svg');        mask-image: url('../../assets/svg/icons/icon_robot.svg'); }
  .icon-kebab     { -webkit-mask-image: url('../../assets/svg/icons/icon_kebab.svg');        mask-image: url('../../assets/svg/icons/icon_kebab.svg'); }
  .icon-move      { -webkit-mask-image: url('../../assets/svg/icons/icon_move.svg');         mask-image: url('../../assets/svg/icons/icon_move.svg'); }
  .icon-close     { -webkit-mask-image: url('../../assets/svg/icons/icon_close.svg');        mask-image: url('../../assets/svg/icons/icon_close.svg'); }
  .icon-copy      { -webkit-mask-image: url('../../assets/svg/icons/icon_copy.svg');         mask-image: url('../../assets/svg/icons/icon_copy.svg'); }
  .icon-eye-off   { -webkit-mask-image: url('../../assets/svg/icons/icon_eye_off.svg');      mask-image: url('../../assets/svg/icons/icon_eye_off.svg'); }
  .icon-eye-on    { -webkit-mask-image: url('../../assets/svg/icons/icon_eye_on.svg');       mask-image: url('../../assets/svg/icons/icon_eye_on.svg'); }
  .icon-pdf       { -webkit-mask-image: url('../../assets/svg/icons/icon_pdf.svg');          mask-image: url('../../assets/svg/icons/icon_pdf.svg'); }
  .icon-play      { -webkit-mask-image: url('../../assets/svg/icons/icon_play.svg');         mask-image: url('../../assets/svg/icons/icon_play.svg'); }
  .icon-pause     { -webkit-mask-image: url('../../assets/svg/icons/icon_pause.svg');        mask-image: url('../../assets/svg/icons/icon_pause.svg'); }
  .icon-chevron-l { -webkit-mask-image: url('../../assets/svg/icons/icon_chevron_left.svg'); mask-image: url('../../assets/svg/icons/icon_chevron_left.svg'); }
  .icon-chevron-r { -webkit-mask-image: url('../../assets/svg/icons/icon_chevron_right.svg'); mask-image: url('../../assets/svg/icons/icon_chevron_right.svg'); }
  .icon-chevrons-r { -webkit-mask-image: url('../../assets/svg/icons/icon_chevrons_right.svg'); mask-image: url('../../assets/svg/icons/icon_chevrons_right.svg'); }
  .icon-plus      { -webkit-mask-image: url('../../assets/svg/icons/icon_plus.svg');         mask-image: url('../../assets/svg/icons/icon_plus.svg'); }
  .icon-plus-circle { -webkit-mask-image: url('../../assets/svg/icons/icon_plus_circle.svg'); mask-image: url('../../assets/svg/icons/icon_plus_circle.svg'); }
  .icon-trophy    { -webkit-mask-image: url('../../assets/svg/icons/icon_trophy.svg');       mask-image: url('../../assets/svg/icons/icon_trophy.svg'); }
  .icon-star      { -webkit-mask-image: url('../../assets/svg/icons/icon_star.svg');         mask-image: url('../../assets/svg/icons/icon_star.svg'); }
  .icon-star-fill { -webkit-mask-image: url('../../assets/svg/icons/icon_star_filled.svg');  mask-image: url('../../assets/svg/icons/icon_star_filled.svg'); }
  .icon-heart      { -webkit-mask-image: url('../../assets/svg/icons/icon_heart.svg');        mask-image: url('../../assets/svg/icons/icon_heart.svg'); }
  .icon-heart-fill { -webkit-mask-image: url('../../assets/svg/icons/icon_heart_filled.svg'); mask-image: url('../../assets/svg/icons/icon_heart_filled.svg'); }
  .icon-flame     { -webkit-mask-image: url('../../assets/svg/icons/icon_flame.svg');        mask-image: url('../../assets/svg/icons/icon_flame.svg'); }
  .icon-snow      { -webkit-mask-image: url('../../assets/svg/icons/icon_snow.svg');         mask-image: url('../../assets/svg/icons/icon_snow.svg'); }
  .icon-local-fire{ -webkit-mask-image: url('../../assets/svg/icons/icon_local_fire.svg');   mask-image: url('../../assets/svg/icons/icon_local_fire.svg'); }
  .icon-droplets  { -webkit-mask-image: url('../../assets/svg/icons/icon_droplets.svg');     mask-image: url('../../assets/svg/icons/icon_droplets.svg'); }
  .icon-water     { -webkit-mask-image: url('../../assets/svg/icons/icon_water.svg');        mask-image: url('../../assets/svg/icons/icon_water.svg'); }
  .icon-link      { -webkit-mask-image: url('../../assets/svg/icons/icon_link.svg');         mask-image: url('../../assets/svg/icons/icon_link.svg'); }
  .icon-unlink    { -webkit-mask-image: url('../../assets/svg/icons/icon_unlink.svg');       mask-image: url('../../assets/svg/icons/icon_unlink.svg'); }
  .icon-user      { -webkit-mask-image: url('../../assets/svg/icons/icon_user.svg');         mask-image: url('../../assets/svg/icons/icon_user.svg'); }
  .icon-bell      { -webkit-mask-image: url('../../assets/svg/icons/icon_bell.svg');         mask-image: url('../../assets/svg/icons/icon_bell.svg'); }
  .icon-download  { -webkit-mask-image: url('../../assets/svg/icons/icon_download.svg');     mask-image: url('../../assets/svg/icons/icon_download.svg'); }
  .icon-refresh   { -webkit-mask-image: url('../../assets/svg/icons/icon_refresh.svg');      mask-image: url('../../assets/svg/icons/icon_refresh.svg'); }
  .icon-settings  { -webkit-mask-image: url('../../assets/svg/icons/icon_settings.svg');     mask-image: url('../../assets/svg/icons/icon_settings.svg'); }
  .icon-swap      { -webkit-mask-image: url('../../assets/svg/icons/icon_swap.svg');         mask-image: url('../../assets/svg/icons/icon_swap.svg'); }
  .icon-wrench    { -webkit-mask-image: url('../../assets/svg/icons/icon_wrench.svg');       mask-image: url('../../assets/svg/icons/icon_wrench.svg'); }
  .icon-cloud     { -webkit-mask-image: url('../../assets/svg/icons/icon_cloud.svg');        mask-image: url('../../assets/svg/icons/icon_cloud.svg'); }
  .icon-backup    { -webkit-mask-image: url('../../assets/svg/icons/icon_backup.svg');       mask-image: url('../../assets/svg/icons/icon_backup.svg'); }
  .icon-cloud-3d  { -webkit-mask-image: url('../../assets/svg/icons/icon_cloud_3d.svg');     mask-image: url('../../assets/svg/icons/icon_cloud_3d.svg'); }
  .icon-signout   { -webkit-mask-image: url('../../assets/svg/icons/icon_signout.svg');      mask-image: url('../../assets/svg/icons/icon_signout.svg'); }
  .icon-info      { -webkit-mask-image: url('../../assets/svg/icons/icon_info.svg');         mask-image: url('../../assets/svg/icons/icon_info.svg'); }
  .icon-book      { -webkit-mask-image: url('../../assets/svg/icons/icon_book.svg');         mask-image: url('../../assets/svg/icons/icon_book.svg'); }
  .icon-list      { -webkit-mask-image: url('../../assets/svg/icons/icon_list.svg');         mask-image: url('../../assets/svg/icons/icon_list.svg'); }
  .icon-palette   { -webkit-mask-image: url('../../assets/svg/icons/icon_palette.svg');      mask-image: url('../../assets/svg/icons/icon_palette.svg'); }
  .icon-pipette   { -webkit-mask-image: url('../../assets/svg/icons/icon_pipette.svg');      mask-image: url('../../assets/svg/icons/icon_pipette.svg'); }
  .icon-apple     { -webkit-mask-image: url('../../assets/svg/icons/icon_apple.svg');        mask-image: url('../../assets/svg/icons/icon_apple.svg'); }
  .icon-android   { -webkit-mask-image: url('../../assets/svg/icons/icon_android.svg');      mask-image: url('../../assets/svg/icons/icon_android.svg'); }
  .icon-package   { -webkit-mask-image: url('../../assets/svg/icons/icon_package.svg');      mask-image: url('../../assets/svg/icons/icon_package.svg'); }
  .icon-rack-grid { -webkit-mask-image: url('../../assets/svg/icons/icon_rack_grid.svg');    mask-image: url('../../assets/svg/icons/icon_rack_grid.svg'); }
  .icon-pin       { -webkit-mask-image: url('../../assets/svg/icons/icon_pin.svg');          mask-image: url('../../assets/svg/icons/icon_pin.svg'); }
  .icon-shopify   { -webkit-mask-image: url('../../assets/svg/icons/icon_shopify.svg');      mask-image: url('../../assets/svg/icons/icon_shopify.svg'); }
  .icon-camera        { -webkit-mask-image: url('../../assets/svg/icons/icon_camera.svg'); mask-image: url('../../assets/svg/icons/icon_camera.svg'); }
  .icon-arrow-up-right{ -webkit-mask-image: url('../../assets/svg/icons/icon_arrow_up_right.svg'); mask-image: url('../../assets/svg/icons/icon_arrow_up_right.svg'); }
  .icon-square        { -webkit-mask-image: url('../../assets/svg/icons/icon_square.svg'); mask-image: url('../../assets/svg/icons/icon_square.svg'); }
  .icon-highlighter   { -webkit-mask-image: url('../../assets/svg/icons/icon_highlighter.svg'); mask-image: url('../../assets/svg/icons/icon_highlighter.svg'); }
  .icon-undo          { -webkit-mask-image: url('../../assets/svg/icons/icon_undo.svg'); mask-image: url('../../assets/svg/icons/icon_undo.svg'); }
  .icon-eraser        { -webkit-mask-image: url('../../assets/svg/icons/icon_eraser.svg'); mask-image: url('../../assets/svg/icons/icon_eraser.svg'); }
  .icon-line          { -webkit-mask-image: url('../../assets/svg/icons/icon_line.svg'); mask-image: url('../../assets/svg/icons/icon_line.svg'); }
  .icon-circle        { -webkit-mask-image: url('../../assets/svg/icons/icon_circle.svg'); mask-image: url('../../assets/svg/icons/icon_circle.svg'); }
  .icon-type          { -webkit-mask-image: url('../../assets/svg/icons/icon_type.svg'); mask-image: url('../../assets/svg/icons/icon_type.svg'); }
  .icon-step-number   { -webkit-mask-image: url('../../assets/svg/icons/icon_step_number.svg'); mask-image: url('../../assets/svg/icons/icon_step_number.svg'); }
  .icon-blur          { -webkit-mask-image: url('../../assets/svg/icons/icon_blur.svg'); mask-image: url('../../assets/svg/icons/icon_blur.svg'); }
  .icon-redo          { -webkit-mask-image: url('../../assets/svg/icons/icon_redo.svg'); mask-image: url('../../assets/svg/icons/icon_redo.svg'); }
  .icon-suggestion    { -webkit-mask-image: url('../../assets/svg/icons/icon_suggestion.svg'); mask-image: url('../../assets/svg/icons/icon_suggestion.svg'); }
  .icon-chat          { -webkit-mask-image: url('../../assets/svg/icons/icon_chat.svg'); mask-image: url('../../assets/svg/icons/icon_chat.svg'); }
  .icon-send          { -webkit-mask-image: url('../../assets/svg/icons/icon_send.svg'); mask-image: url('../../assets/svg/icons/icon_send.svg'); }
  .icon-bars          { -webkit-mask-image: url('../../assets/svg/icons/icon_bars.svg'); mask-image: url('../../assets/svg/icons/icon_bars.svg'); }
  .icon-question      { -webkit-mask-image: url('../../assets/svg/icons/icon_question.svg'); mask-image: url('../../assets/svg/icons/icon_question.svg'); }
  .icon-emoji         { -webkit-mask-image: url('../../assets/svg/icons/icon_emoji.svg'); mask-image: url('../../assets/svg/icons/icon_emoji.svg'); }
  .icon-image     { -webkit-mask-image: url('../../assets/svg/icons/icon_image.svg');        mask-image: url('../../assets/svg/icons/icon_image.svg'); }
  .icon-printer   { -webkit-mask-image: url('../../assets/svg/icons/icon_printer.svg');      mask-image: url('../../assets/svg/icons/icon_printer.svg'); }
  .icon-qr        { -webkit-mask-image: url('../../assets/svg/icons/icon_qr.svg');           mask-image: url('../../assets/svg/icons/icon_qr.svg'); }
  /* Extra illustration icons (What's New + general use). */
  .icon-mail      { -webkit-mask-image: url('../../assets/svg/icons/icon_mail.svg');         mask-image: url('../../assets/svg/icons/icon_mail.svg'); }
  .icon-tag       { -webkit-mask-image: url('../../assets/svg/icons/icon_tag.svg');          mask-image: url('../../assets/svg/icons/icon_tag.svg'); }
  .icon-list-check { -webkit-mask-image: url('../../assets/svg/icons/icon_list_check.svg');  mask-image: url('../../assets/svg/icons/icon_list_check.svg'); }
  /* Two carts, two very different actions — never mix them up:
     .icon-cart      → BUY: opens the shop's web link (external purchase).
     .icon-cart-plus → ADD: puts the product in YOUR "To order" list (the `liked` flag). */
  .icon-cart      { -webkit-mask-image: url('../../assets/svg/icons/icon_cart.svg');         mask-image: url('../../assets/svg/icons/icon_cart.svg'); }
  .icon-cart-plus { -webkit-mask-image: url('../../assets/svg/icons/icon_cart_plus.svg');    mask-image: url('../../assets/svg/icons/icon_cart_plus.svg'); }
  .icon-coins     { -webkit-mask-image: url('../../assets/svg/icons/icon_coins.svg');        mask-image: url('../../assets/svg/icons/icon_coins.svg'); }
  .icon-bug       { -webkit-mask-image: url('../../assets/svg/icons/icon_bug.svg');          mask-image: url('../../assets/svg/icons/icon_bug.svg'); }
  .icon-filter    { -webkit-mask-image: url('../../assets/svg/icons/icon_filter.svg');       mask-image: url('../../assets/svg/icons/icon_filter.svg'); }
  .icon-json      { -webkit-mask-image: url('../../assets/svg/icons/icon_json.svg');         mask-image: url('../../assets/svg/icons/icon_json.svg'); }
  .icon-software-download { -webkit-mask-image: url('../../assets/svg/icons/icon_software_download.svg'); mask-image: url('../../assets/svg/icons/icon_software_download.svg'); }
  .icon-community { -webkit-mask-image: url('../../assets/svg/icons/icon_community.svg'); mask-image: url('../../assets/svg/icons/icon_community.svg'); }
  .icon-coffee   { -webkit-mask-image: url('../../assets/svg/icons/icon_coffee.svg'); mask-image: url('../../assets/svg/icons/icon_coffee.svg'); }
  .icon-gift      { -webkit-mask-image: url('../../assets/svg/icons/icon_gift.svg');         mask-image: url('../../assets/svg/icons/icon_gift.svg'); }
  .icon-volume    { -webkit-mask-image: url('../../assets/svg/icons/icon_volume.svg');       mask-image: url('../../assets/svg/icons/icon_volume.svg'); }
  .icon-card      { -webkit-mask-image: url('../../assets/svg/icons/icon_card.svg');         mask-image: url('../../assets/svg/icons/icon_card.svg'); }
  .icon-mobile-app { -webkit-mask-image: url('../../assets/svg/icons/icon_mobile_app.svg');  mask-image: url('../../assets/svg/icons/icon_mobile_app.svg'); }
  .icon-briefcase  { -webkit-mask-image: url('../../assets/svg/icons/icon_briefcase.svg');   mask-image: url('../../assets/svg/icons/icon_briefcase.svg'); }
  .icon-monitor    { -webkit-mask-image: url('../../assets/svg/icons/icon_monitor.svg');     mask-image: url('../../assets/svg/icons/icon_monitor.svg'); }
  .icon-smartphone { -webkit-mask-image: url('../../assets/svg/icons/icon_smartphone.svg');  mask-image: url('../../assets/svg/icons/icon_smartphone.svg'); }
  .icon-grid      { -webkit-mask-image: url('../../assets/svg/icons/icon_grid.svg');         mask-image: url('../../assets/svg/icons/icon_grid.svg'); }
  .icon-grip      { -webkit-mask-image: url('../../assets/svg/icons/icon_grip.svg');         mask-image: url('../../assets/svg/icons/icon_grip.svg'); }
  /* "Support the project" button — opens the chooser (Buy Me a Coffee, Ko-fi or
     PayPal, see _openCoffee), so it carries no single platform's wordmark: the
     coffee cup + a localised label on the coffee-yellow pill. Shared by the
     What's New footer and Settings → About. */
  .support-btn {
    display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 13px 0 9px;
    border: none; border-radius: 9px; background: #FFDD00; color: #0d0c22;
    font-family: inherit; font-size: 12.5px; font-weight: 700; line-height: 1; cursor: pointer; transition: transform .12s, filter .12s;
  }
  .support-btn:hover { transform: translateY(-1px); filter: brightness(1.04); }
  .support-btn img { width: 18px; height: 18px; flex-shrink: 0; }
  .icon-shield-check { -webkit-mask-image: url('../../assets/svg/icons/icon_shield_check.svg'); mask-image: url('../../assets/svg/icons/icon_shield_check.svg'); }
  .icon-github    { -webkit-mask-image: url('../../assets/svg/icons/icon_github.svg');       mask-image: url('../../assets/svg/icons/icon_github.svg'); }
  .icon-discord   { -webkit-mask-image: url('../../assets/svg/icons/icon_discord.svg');      mask-image: url('../../assets/svg/icons/icon_discord.svg'); }
  .icon-plug      { -webkit-mask-image: url('../../assets/svg/icons/icon_plug.svg');         mask-image: url('../../assets/svg/icons/icon_plug.svg'); }
  .icon-nfc       { -webkit-mask-image: url('../../assets/svg/icons/icon_rfid.svg');         mask-image: url('../../assets/svg/icons/icon_rfid.svg');  aspect-ratio: 48 / 32; }
  .icon-battery   { -webkit-mask-image: url('../../assets/svg/icons/icon_battery.svg');      mask-image: url('../../assets/svg/icons/icon_battery.svg'); }
  .icon-bolt      { -webkit-mask-image: url('../../assets/svg/icons/icon_bolt.svg');         mask-image: url('../../assets/svg/icons/icon_bolt.svg'); }
  .icon-alert     { -webkit-mask-image: url('../../assets/svg/icons/icon_alert.svg');       mask-image: url('../../assets/svg/icons/icon_alert.svg'); }
  .icon-arrow-r   { -webkit-mask-image: url('../../assets/svg/icons/icon_arrow_right.svg');  mask-image: url('../../assets/svg/icons/icon_arrow_right.svg'); }
  .icon-scale     { -webkit-mask-image: url('../../assets/svg/icons/icon_scale.svg');        mask-image: url('../../assets/svg/icons/icon_scale.svg'); }
  .icon-bulb      { -webkit-mask-image: url('../../assets/svg/icons/icon_bulb.svg');         mask-image: url('../../assets/svg/icons/icon_bulb.svg'); }
  .icon-home      { -webkit-mask-image: url('../../assets/svg/icons/icon_home.svg');         mask-image: url('../../assets/svg/icons/icon_home.svg'); aspect-ratio: 1/1; }
  .icon-humidity  { -webkit-mask-image: url('../../assets/svg/icons/icon_humidity.svg');     mask-image: url('../../assets/svg/icons/icon_humidity.svg'); aspect-ratio: 1/1; }
  .icon-step      { -webkit-mask-image: url('../../assets/svg/icons/icon_step.svg');         mask-image: url('../../assets/svg/icons/icon_step.svg');  aspect-ratio: 1/1; }
  .icon-speed     { -webkit-mask-image: url('../../assets/svg/icons/icon_speed.svg');        mask-image: url('../../assets/svg/icons/icon_speed.svg'); aspect-ratio: 1/1; }
  .icon-nozzle    { -webkit-mask-image: url('../../assets/svg/icons/icon_nozzle.svg');       mask-image: url('../../assets/svg/icons/icon_nozzle.svg'); aspect-ratio: 1/1; }
  .icon-chamber   { -webkit-mask-image: url('../../assets/svg/icons/icon_chamber.svg');      mask-image: url('../../assets/svg/icons/icon_chamber.svg'); aspect-ratio: 1/1; }
  .icon-bed       { -webkit-mask-image: url('../../assets/svg/icons/icon_bed.svg');          mask-image: url('../../assets/svg/icons/icon_bed.svg'); aspect-ratio: 1/1; }
  .icon-disable-motor { -webkit-mask-image: url('../../assets/svg/icons/icon_disable_motor.svg'); mask-image: url('../../assets/svg/icons/icon_disable_motor.svg'); aspect-ratio: 1/1; }
  .icon-stop      { -webkit-mask-image: url('../../assets/svg/icons/icon_stop.svg');         mask-image: url('../../assets/svg/icons/icon_stop.svg'); }
  .icon-folder    { -webkit-mask-image: url('../../assets/svg/icons/icon_folder.svg');       mask-image: url('../../assets/svg/icons/icon_folder.svg'); }
  .icon-clock     { -webkit-mask-image: url('../../assets/svg/icons/icon_clock.svg');        mask-image: url('../../assets/svg/icons/icon_clock.svg'); }
  .icon-percent   { -webkit-mask-image: url('../../assets/svg/icons/icon_percent.svg');      mask-image: url('../../assets/svg/icons/icon_percent.svg'); }
  .icon-compass   { -webkit-mask-image: url('../../assets/svg/icons/icon_compass.svg');     mask-image: url('../../assets/svg/icons/icon_compass.svg'); }
  .icon-wifi      { -webkit-mask-image: url('../../assets/svg/icons/icon_wifi.svg');         mask-image: url('../../assets/svg/icons/icon_wifi.svg'); }

  button {
    height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font-size: 14px; cursor: pointer; font-weight: 500;
    transition: background .15s, border-color .15s, transform .05s;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: inherit;
  }
  /* Hover feedback via a slight DARKEN (filter), NOT a background swap. A global
     `background: var(--surface-2)` here used to clobber the fill of EVERY
     custom-coloured button (orange CTAs, etc.) on hover — their white text then
     sat on a light background = invisible, so each one had to redeclare its
     :hover background or it broke. brightness(.95) darkens whatever the button's
     OWN background is (white surface, transparent, or a solid accent) without
     ever overriding it: visible on light AND dark AND coloured buttons, and
     coloured buttons stay readable for free — no per-button :hover needed.
     `.ghost` / `.primary` opt out because they define their own :hover below. */
  button:hover { filter: brightness(.95); }
  button.ghost:hover,
  button.primary:hover { filter: none; }
  /* Press feedback via brightness, NOT transform: a global `translateY(1px)`
     used to OVERRIDE the centering transform of positioned buttons (password
     eye toggles, etc.) and make them jump down on click. brightness never
     conflicts with a button's own transform, so no per-button :active hacks. */
  button:active { filter: brightness(.92); }
  button:disabled { opacity: .55; cursor: not-allowed; }
  button.primary { background: var(--primary); border-color: var(--primary); color: var(--on-accent); }
  button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
  button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
  button.ghost:hover { background: var(--surface-2); color: var(--text); }
  button.sm { height: 32px; font-size: 12px; padding: 0 10px; }
  button .spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .8s linear infinite; display: none; }
  button.loading .spinner { display: inline-block; }
  /* When loading, the label AND any leading icon are hidden so the spinner sits
     alone centered — never an icon and a spinner at once. The button keeps its
     width via min-width — no layout shift, no jitter. */
  button.loading .label { display: none; }
  button.loading .icon  { display: none; }
  #btnSbReload.loading svg { animation: spin .8s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }

  .badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--muted); }
  .badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
  .badge.ok { background: var(--success-soft); color: var(--success-text); }
  .badge.bad { background: var(--danger-soft); color: var(--danger-text); }
  .badge.info { background: var(--primary-soft); color: var(--primary-text); }

  .alert { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; border: 1px solid var(--border); margin-top: 10px; }
  /* Border and text are derived from the same token as the fill, so the whole
     alert re-tints as one when the theme lifts the hue. Hand-picked pale
     borders (#f1d989 &co) only worked against a white page. */
  .alert.warn { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 35%, transparent); color: var(--warning-text); }
  .alert.bad { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger-text); }
  .alert.ok { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 35%, transparent); color: var(--success-text); }
  .alert.muted { background: var(--surface-2); color: var(--muted); }

  /* ── stats ── */
  .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 10px; }
  .stat { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
  .stat .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
  .stat .value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }

  /* ── table ── */
  .table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: var(--view-gap); scrollbar-width: none; }
  .table-wrap::-webkit-scrollbar { width: 0; height: 0; }
  /* ── sign-in placeholder ── */
  /* First launch / signed out: a welcome page of its own — top bar (name +
     language), copy and actions on the left, the ecosystem hero on the right,
     a quiet footer. The sidebar and the app header are hidden meanwhile. */
  .signin-placeholder {
    flex: 1; min-height: 0; display: flex; flex-direction: column;
    padding: 18px 40px 16px; overflow: auto; scrollbar-width: thin;
  }
  .signin-ph-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .signin-ph-brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
  .signin-ph-two { color: var(--primary-text); font-weight: 800; }
  .signin-ph-lang {
    position: relative; display: flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 10px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--surface); color: var(--muted);
    transition: color .15s, border-color .15s;
  }
  .signin-ph-lang:hover, .signin-ph-lang:focus-within { color: var(--text); border-color: var(--muted); }
  .signin-ph-lang .icon { background-color: currentColor; }
  .signin-ph-lang .icon-chevron-r { transform: rotate(90deg); pointer-events: none; }
  .signin-ph-lang select {
    appearance: none; border: 0; background: transparent; color: inherit;
    font: 600 12.5px/1 inherit; padding: 0 2px; cursor: pointer; outline: none;
  }
  .signin-ph-body {
    flex: 1; display: flex; align-items: center; justify-content: center;
    gap: clamp(24px, 5vw, 72px); padding: 24px 0;
  }
  .signin-ph-copy { flex: 0 0 min(430px, 50%); display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
  .signin-ph-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--primary-text); background: color-mix(in srgb, var(--primary) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  }
  .signin-ph-badge .icon { background-color: currentColor; }
  .signin-ph-title {
    margin: 0; font-size: clamp(26px, 3.2vw, 36px); line-height: 1.12;
    font-weight: 800; color: var(--text); letter-spacing: -.025em;
  }
  .signin-ph-sub { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.55; }
  /* Benefits — a bold claim, then the plain fact behind it. */
  .signin-ph-feats { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
  .signin-ph-feats li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
  .signin-ph-feats b { color: var(--text); font-weight: 600; }
  .signin-ph-feats .icon { background-color: var(--primary); flex: none; margin-top: 1px; }
  .signin-ph-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
  .signin-ph-btn {
    height: 46px; padding: 0 28px; border-radius: 12px;
    font-size: 15px; font-weight: 600;
    box-shadow: 0 6px 20px color-mix(in srgb, var(--primary) 28%, transparent);
    transition: transform .12s, box-shadow .12s;
  }
  .signin-ph-btn:hover  { transform: translateY(-1px); box-shadow: 0 9px 26px color-mix(in srgb, var(--primary) 34%, transparent); }
  .signin-ph-btn:active { transform: translateY(0); box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 28%, transparent); }
  .signin-ph-btn2 {
    height: 46px; padding: 0 20px; border-radius: 12px;
    font-size: 14px; font-weight: 600; color: var(--text);
    background: var(--surface); border: 1px solid var(--border);
    transition: border-color .12s, transform .12s;
  }
  .signin-ph-btn2:hover { border-color: var(--muted); transform: translateY(-1px); }
  .signin-ph-btn2:active { transform: translateY(0); }
  .signin-ph-note { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
  .signin-ph-note .icon { background-color: var(--primary); }
  /* Ecosystem hero — a stage with the 1120×580 proportions of hero-ecosystem.webp
     (same true relative scale: one px/cm), capped by width and height so the
     actions never leave a short window; the first thing to shrink. Each device
     is its own layer and floats on its own rhythm; its floor shadow stays put
     and tightens as it rises. */
  .signin-ph-visual { flex: 0 1 780px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 18px; }
  /* The ecosystem scene itself (.hero-scene, .sph-*): css/72-hero-scene.css, shared with the splash. */
  .signin-ph-hero { max-width: calc(58vh * 1120 / 580); }
  /* "Works with" + the printer brands — the chip chooser's logos (.lc-brand in
     linked.css): theme-coloured at rest, lit in their own colour one after the
     other like a garland (_signinGarland), or under the mouse. */
  .signin-ph-brands { display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .signin-ph-brand-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px clamp(8px, 1.2vw, 22px); }
  .signin-ph-brand-row .lc-brand { width: clamp(26px, 2.6vw, 40px); }
  .signin-ph-foot { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 12px; color: var(--muted); }
  .signin-ph-link {
    display: flex; align-items: center; gap: 6px;
    height: 28px; padding: 0 10px; border-radius: 8px;
    font-size: 12px; color: var(--muted);
    border: 1px solid transparent; background: transparent;
    transition: color .15s, border-color .15s;
  }
  .signin-ph-link .icon { background-color: currentColor; }
  .signin-ph-link:hover { color: var(--text); border-color: var(--border); background: var(--surface); }
  /* Entrance: copy first, the hero 80 ms after — under half a second, and the
     buttons work from the first frame. */
  @keyframes signinRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  body.signed-out .signin-ph-copy > * { animation: signinRise .22s ease-out both; }
  body.signed-out .signin-ph-copy > :nth-child(2) { animation-delay: .03s; }
  body.signed-out .signin-ph-copy > :nth-child(3) { animation-delay: .06s; }
  body.signed-out .signin-ph-copy > :nth-child(n+4) { animation-delay: .09s; }
  body.signed-out .signin-ph-hero { animation: signinRise .3s ease-out .08s both; }
  @media (prefers-reduced-motion: reduce) {
    body.signed-out .signin-ph-copy > *, body.signed-out .signin-ph-hero { animation: none; }
  }
  /* Short window (down to the 900×600 minimum): tighter rhythm, so the copy,
     the actions and the footer all fit without scrolling. */
  @media (max-height: 720px) {
    .signin-ph-body { padding: 12px 0; }
    .signin-ph-copy { gap: 10px; }
    .signin-ph-title { font-size: 26px; }
    .signin-ph-sub { font-size: 14px; }
    .signin-ph-feats { gap: 7px; }
    .signin-ph-actions { margin-top: 4px; }
  }
  /* Very short window (the 900×600 minimum): each benefit keeps its bold claim only. */
  @media (max-height: 660px) {
    .signin-ph-feats li > span > span { display: none; }
  }
  /* Narrow window (below the app's own minimum, e.g. a split screen): the
     hero goes under the copy, smaller. */
  @media (max-width: 760px) {
    .signin-ph-body { flex-direction: column-reverse; gap: 18px; }
    .signin-ph-copy { flex: none; }
    .signin-ph-visual { flex: none; width: min(420px, 80%); }
    .signin-ph-hero { max-width: calc(28vh * 1120 / 580); }
  }
  /* Signed out: no app header (TigerCoins, devices, stats, the last account's
     colour glow), no inventory view bar, and no sidebar while no account is
     remembered on this machine — the welcome page stands alone. */
  body.signed-out header.top, body.signed-out #card-inv, body.signed-out.no-accounts #sidebar { display: none; }

  #card-inv { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  /* No frame around the main view: the content sits straight on the app
     background (the generic .card look stays for every other card). */
  #card-inv.card { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
  .inv-loading {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 42px; padding: 90px 0; color: var(--muted); font-size: 14px; font-weight: 500;
  }
  /* Comet-trail loader ("load6") — adapted from Luke Haas' css-loaders (MIT):
     https://github.com/lukehaas/css-loaders. Five box-shadow dots form a fading tail
     that orbits, from a single element (no markup change) so it drops into every
     .inv-loading-spin slot; brand-orange (the original's white would be invisible on
     our light background). The cam-wall keeps its own small border spinner. */
  .inv-loading-spin {
    color: var(--primary-text);   /* the box-shadow dots inherit currentColor */
    font-size: 52px; width: 1em; height: 1em;
    border: none; border-radius: 50%; background: transparent;
    -webkit-mask: none; mask: none;
    text-indent: -9999em; overflow: hidden; position: relative;
    transform: translateZ(0);
    animation: load6 1.7s infinite ease, round 1.7s infinite ease;
  }
  /* Explicit 0%→100% rotate (NOT the `to`-only `spin`): the box-shadow tail forms
     while the element actually orbits — the "wind up and sling" motion. */
  @keyframes round { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
  @keyframes load6 {
    0%      { box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em; }
    5%, 95% { box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em; }
    10%, 59% { box-shadow: 0 -0.83em 0 -0.4em, -0.087em -0.825em 0 -0.42em, -0.173em -0.812em 0 -0.44em, -0.256em -0.789em 0 -0.46em, -0.297em -0.775em 0 -0.477em; }
    20%     { box-shadow: 0 -0.83em 0 -0.4em, -0.338em -0.758em 0 -0.42em, -0.555em -0.617em 0 -0.44em, -0.671em -0.488em 0 -0.46em, -0.749em -0.34em 0 -0.477em; }
    38%     { box-shadow: 0 -0.83em 0 -0.4em, -0.377em -0.74em 0 -0.42em, -0.645em -0.522em 0 -0.44em, -0.775em -0.297em 0 -0.46em, -0.82em -0.09em 0 -0.477em; }
    100%    { box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em; }
  }
  /* Playful phrase carousel under the loader: one line at a time slides in from the
     right and out to the left; both edges fade through a gradient mask so each phrase
     seems to emerge from / dissolve into the gradient. */
  .ld-phrases {
    position: relative; width: 280px; height: 1.5em; overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20%, #000 80%, transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 20%, #000 80%, transparent 100%);
  }
  .ld-phrases span {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    white-space: nowrap; opacity: 0;
    animation: ld-phrase 12s ease-in-out infinite;
  }
  .ld-phrases span:nth-child(1) { animation-delay: 0s; }
  .ld-phrases span:nth-child(2) { animation-delay: 3s; }
  .ld-phrases span:nth-child(3) { animation-delay: 6s; }
  .ld-phrases span:nth-child(4) { animation-delay: 9s; }
  @keyframes ld-phrase {
    0%   { opacity: 0; transform: translateX(60px); }
    7%   { opacity: 1; transform: translateX(0); }
    22%  { opacity: 1; transform: translateX(0); }
    29%  { opacity: 0; transform: translateX(-60px); }
    100% { opacity: 0; transform: translateX(-60px); }
  }
  /* Printers-view variant — same spinner, but extra vertical breathing
     room so it sits visually centred in the printer-grid host (which
     normally starts at the top of the panel, not the page centre). */
  .printers-loading {
    min-height: 240px;
  }
  /* ── First steps (signed in, no spool yet) ─────────────────────────────────
     "Where do we start?" — three ways to a first win (a spool, the TigerPOD, a
     printer), each a card opening the flow that does it; the TigerPOD card
     follows the reader live. The phone app as one quiet line under them. */
  .inv-start {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 32px 24px; text-align: center; min-height: min(560px, 62vh);
  }
  .inv-start-kicker { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-text); }
  .inv-start-h1 { margin: 0; font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; letter-spacing: -.02em; color: var(--text); }
  .inv-start-sub { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
  .inv-start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; width: min(860px, 100%); }
  .inv-start-card {
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left;
    padding: 18px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
    color: var(--text); cursor: pointer; font: inherit; height: auto;   /* not the 40 px of a plain button */
    transition: border-color .15s, transform .15s, box-shadow .15s;
    animation: invStartRise .24s ease-out both;
  }
  .inv-start-card { position: relative; }
  /* The card's picture, top right beside the icon tile (spool, TigerPOD, a
     printer cross-fading from one model to the next). */
  .inv-start-art {
    position: absolute; top: 10px; right: 14px; width: 80px; height: 56px; pointer-events: none;
  }
  .inv-start-art img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
    opacity: 0; transition: opacity .3s ease, transform .3s ease; transform: scale(.94);
    filter: drop-shadow(0 6px 10px rgba(0,0,0,.35));
  }
  .inv-start-art img.is-on { opacity: 1; transform: none; }
  .inv-start-card:hover .inv-start-art img.is-on { transform: translateY(-2px) scale(1.04); }
  @media (prefers-reduced-motion: reduce) { .inv-start-art img { transition: none; } }
  .inv-start-card:nth-child(2) { animation-delay: .04s; }
  .inv-start-card:nth-child(3) { animation-delay: .08s; }
  .inv-start-card:hover { border-color: var(--primary); transform: translateY(-2px);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 14%, transparent); }
  .inv-start-card:active { transform: translateY(0); }
  .inv-start-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
  .inv-start-tile {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
    background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary-text);
  }
  .inv-start-tile .icon { background-color: currentColor; }
  .inv-start-title { font-size: 15px; font-weight: 700; }
  .inv-start-text { font-size: 13px; line-height: 1.45; color: var(--muted); }
  .inv-start-go { margin-top: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--primary-text); }
  .inv-start-go .icon { background-color: currentColor; transition: transform .15s; }
  .inv-start-card:hover .inv-start-go .icon { transform: translateX(2px); }
  /* TigerPOD card, reader plugged in: the status turns green and says so. */
  .inv-start-status { display: none; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--success-text); }
  .inv-start-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor;
    box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent); }
  .inv-start-card .when-ready { display: none; }
  .inv-start-card.is-ready .when-ready { display: inline; }
  .inv-start-card.is-ready .when-idle { display: none; }
  .inv-start-card.is-ready { border-color: color-mix(in srgb, var(--success) 55%, var(--border)); cursor: default; }
  .inv-start-card.is-ready:hover { transform: none; box-shadow: none; border-color: color-mix(in srgb, var(--success) 55%, var(--border)); }
  .inv-start-card.is-ready .inv-start-tile { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success-text); }
  .inv-start-card.is-ready .inv-start-status { display: inline-flex; }
  .inv-start-card.is-ready .inv-start-go { display: none; }
  .inv-start-phone { margin-top: 12px; display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
  .inv-start-phone .inv-start-app { height: auto; padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; }
  .inv-start-phone .inv-start-app:hover { color: var(--primary-text); }
  .inv-start-phone .icon { background-color: currentColor; }
  /* "Next up" strip — above the spool list until the three first steps are done. */
  .first-steps {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    margin-top: var(--view-gap); padding: 8px 10px 8px 14px; border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
    background: color-mix(in srgb, var(--primary) 7%, var(--surface));
    animation: invStartRise .24s ease-out both;
  }
  .first-steps-title { font-size: 12.5px; font-weight: 700; color: var(--text); margin-right: 4px; }
  .first-steps-count { font-weight: 600; color: var(--muted); }
  .first-steps .first-steps-step {
    height: 28px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px;
    border-radius: 999px; font-size: 12px; font-weight: 600;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    transition: border-color .15s, color .15s;
  }
  .first-steps .first-steps-step:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-text); }
  .first-steps .first-steps-step .icon { background-color: currentColor; }
  .first-steps .first-steps-step.is-done { color: var(--success-text); border-color: transparent; background: transparent; cursor: default; opacity: 1; }
  .first-steps-item { display: inline-flex; align-items: center; gap: 2px; }
  .first-steps .first-steps-skip {
    height: 28px; padding: 0 8px; border: 0; background: transparent;
    font-size: 11.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px;
  }
  .first-steps .first-steps-skip:hover { color: var(--text); }
  .first-steps .first-steps-close {
    margin-left: auto; width: 26px; height: 26px; padding: 0; display: grid; place-items: center;
    border-radius: 50%; border: 0; background: transparent; color: var(--muted);
  }
  .first-steps .first-steps-close:hover { color: var(--text); background: var(--surface-2); }
  .first-steps .first-steps-close .icon { background-color: currentColor; }
  @keyframes invStartRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  @media (prefers-reduced-motion: reduce) { .inv-start-card { animation: none; } }
  #invTableWrap { flex: 1; min-height: 0; }
  #invGrid { flex: 1; min-height: 0; overflow-y: auto; margin-top: var(--view-gap); scrollbar-width: none; }
  #invGrid::-webkit-scrollbar { width: 0; height: 0; }   /* hide the scrollbar (still scrolls) */
  table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
  th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
  /* z-index must sit ABOVE the absolutely-positioned thumbnail badges
     (twin/TD/chip = z 2, group count = z 3) so they scroll behind the sticky
     header instead of floating over it. */
  thead th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .03em; text-transform: uppercase; position: sticky; top: 0; z-index: 20; }
  th.sortable { cursor: pointer; user-select: none; }
  th.sortable:hover { color: var(--text); }
  /* Sort indicator — a charte chevron (mask icon), rotated up/down. */
  th.sortable::after {
    content: ""; display: inline-block; vertical-align: middle;
    width: 11px; height: 11px; margin-left: 5px;
    background-color: currentColor; opacity: .3;
    -webkit-mask-image: url('../../assets/svg/icons/icon_chevron_right.svg');
    mask-image: url('../../assets/svg/icons/icon_chevron_right.svg');
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
    transform: rotate(90deg);   /* points down by default */
    transition: transform .15s, opacity .15s, background-color .15s;
  }
  th.sort-asc::after  { opacity: 1; background-color: var(--primary); transform: rotate(-90deg); }
  th.sort-desc::after { opacity: 1; background-color: var(--primary); transform: rotate(90deg); }
  tbody tr { cursor: pointer; transition: background .1s; }
  tbody tr:hover { background: var(--surface-2); }
  tbody tr.selected { background: var(--primary-soft); }
  tbody tr.deleted { opacity: .45; }
  tbody tr:last-child td { border-bottom: none; }
  td.id-cell { font-family: var(--mono); font-size: 11px; color: var(--muted); max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
  /* Round colour swatch. The colour/gradient sits on an absolute child clipped
     by this round parent (overflow:hidden) — reliably clips a conic-gradient to
     the circle (a gradient set directly on the element bleeds to its square box
     on Chromium, which broke bicolor/tricolor swatches). */
  .color-circle { position: relative; display: inline-block; overflow: hidden; border-radius: 50%; flex-shrink: 0; vertical-align: middle; margin-right: 5px; border: 1.5px solid; }
  .color-circle-fill { position: absolute; inset: 0; }

  /* ── Multi-select / bulk delete ──────────────────────────────────────── */
  .inv-select-btn {
    display: none; align-items: center; gap: 6px;   /* shown only on button-select views (see body.sel-btn-view) */
    height: 36px; padding: 0 12px; flex-shrink: 0;   /* iso with .inv-add-btn (overrides the global button 40px) */
    border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
    transition: background .15s, border-color .15s, color .15s;
  }
  body.sel-btn-view .inv-select-btn { display: inline-flex; }   /* materials grid + printer grid/table */
  .inv-select-btn:hover  { border-color: var(--primary); }
  .inv-select-btn.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text); }
  .inv-select-btn .icon  { background: currentColor; }
  .inv-select-btn.hidden { display: none !important; }   /* friend view */

  /* Checkbox affordance — hidden until select mode; the checked look is driven
     by .row-selected / .group-all-selected on the row / card. */
  .sel-check {
    display: none;
    position: absolute; top: 6px; left: 6px; z-index: 4;
    width: 18px; height: 18px; border-radius: 5px;
    background: var(--surface); border: 1.5px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
  }
  body.bulk-select-mode .thumb-cell,
  body.bulk-select-mode .card-img-wrap,
  body.bulk-select-mode .printer-card,
  body.bulk-select-mode .gp-member-left { position: relative; }
  body.bulk-select-mode .sel-check { display: block; }
  .row-selected .sel-check, .group-all-selected .sel-check {
    background: var(--primary); border-color: var(--primary);
  }
  .row-selected .sel-check::after, .group-all-selected .sel-check::after {
    content: ""; position: absolute; left: 5px; top: 1px;
    width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
  }
  body.bulk-select-mode #invBody tr, body.bulk-select-mode .spool-card { cursor: pointer; }
  #invBody tr.row-selected, #invBody tr.group-all-selected { background: var(--primary-soft); }
  .spool-card.row-selected, .spool-card.group-all-selected { outline: 2px solid var(--primary); outline-offset: -2px; }
  #groupPanelBody .gp-member.row-selected { background: var(--primary-soft); }

  /* Printer selection (button-triggered, printer grid + table). */
  body.bulk-select-mode .printer-card, body.bulk-select-mode .pt-row { cursor: pointer; }
  .printer-card.row-selected { outline: 2px solid var(--primary); outline-offset: -2px; }
  .pt-row.row-selected { background: var(--primary-soft); }
  /* Printer TABLE: the checkbox column is ALWAYS visible (like the materials
     table) — it reuses the shared `.sel-cell` / `.sel-check` rules. */

  /* Always-visible checkbox column in the TABLE (Shopify-style, left of the
     thumbnail). Grid / group-panel checkboxes stay overlay + bulk-gated. */
  .sel-th, .sel-cell { width: 40px; padding-left: 14px !important; padding-right: 0 !important; box-sizing: border-box; }
  .sel-cell { vertical-align: middle; cursor: pointer; }
  .sel-cell .sel-check {
    display: inline-block; position: relative; top: auto; left: auto;
    vertical-align: middle; box-shadow: none;
  }
  .sel-cell:hover .sel-check { border-color: var(--primary); }

  /* Header master checkbox — select/deselect all visible (filtered) rows.
     Always shown in the header cell (like the always-on row checkboxes), with a
     checkmark when all are selected and a dash when only some are. */
  .sel-th { cursor: pointer; }
  .sel-th .sel-check--all {
    display: inline-block; position: relative; top: auto; left: auto;
    vertical-align: middle; box-shadow: none; cursor: pointer;
  }
  .sel-th:hover .sel-check--all { border-color: var(--primary); }
  .sel-check--all.is-all, .sel-check--all.is-some {
    background: var(--primary); border-color: var(--primary);
  }
  .sel-check--all.is-all::after {
    content: ""; position: absolute; left: 5px; top: 1px;
    width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
  }
  .sel-check--all.is-some::after {
    content: ""; position: absolute; left: 3px; top: 7px;
    width: 10px; height: 2px; background: var(--surface); border-radius: 1px;
  }

  .bulk-bar {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200;
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px 8px 16px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.28);
  }
  /* Spoken warning when the selection reaches past the filter. Amber, not red: it
     is a caution about scope, not an error — the delete button beside it is the red
     one. Sits before the destructive button so it is read first. */
  .bulk-hidden {
    display: inline-flex; align-items: center;
    font-size: 11px; font-weight: 600; line-height: 1.2;
    color: var(--warning-hover); background: var(--warning-soft); border: 1px solid var(--warning);
    border-radius: 8px; padding: 4px 8px; max-width: 260px;
  }
  .bulk-hidden.hidden { display: none; }
  .bulk-bar.hidden { display: none; }
  .bulk-btn {
    position: relative; overflow: hidden;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px; border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
    transition: border-color .15s, background .15s;
  }
  .bulk-btn:hover { border-color: var(--primary); }
  .bulk-btn .icon { background: currentColor; }
  .bulk-btn > *:not(.hold-progress) { position: relative; z-index: 1; }
  /* Delete — ONE look for the one irreversible action, wherever it is offered:
     the selection bar's Delete and the spool toolbox's Delete share these rules
     rather than each carrying a copy, so they cannot drift apart. The toolbox
     row needs the doubled class (0,2,0) to outrank `.toolbox-row--danger` and
     `.toolbox-row:hover`, which sit further down this file. */
  .bulk-btn--danger,
  .toolbox-row.toolbox-row--delete { background: var(--danger); border-color: var(--danger); color: var(--on-accent); }
  .bulk-btn--danger:hover,
  .toolbox-row.toolbox-row--delete:hover { background: var(--danger); filter: brightness(1.06); border-color: var(--danger); }
  .bulk-btn--danger .icon,
  .toolbox-row.toolbox-row--delete .toolbox-row-icon { background: var(--on-accent); }
  /* The button is already red, so the default red `.hold-progress` fill would be
     invisible (red-on-red). Use an opaque dark sweep so the hold-to-confirm
     progress is clearly visible as the user holds. */
  .bulk-btn--danger .hold-progress,
  .toolbox-row.toolbox-row--delete .hold-progress { background: rgba(0,0,0,.34); opacity: 1; }
  /* Toolbox-only: the bar's button is already 600, and a toolbox row carries a
     trailing ⓘ that has to read on red too. */
  .toolbox-row.toolbox-row--delete { font-weight: 600; }
  .toolbox-row.toolbox-row--delete .tool-info .icon { background: var(--on-accent); opacity: .8; }
  /* Square icon button — stretch to the Delete button's height, then aspect-ratio
     forces equal width so it's a perfect square (not a short rectangle). */
  .bulk-btn--icon { padding: 0; align-self: stretch; aspect-ratio: 1; justify-content: center; }
  .bulk-btn--primary { background: var(--primary); border-color: var(--primary); color: var(--on-accent); }
  .bulk-btn--primary:hover { filter: brightness(1.06); border-color: var(--primary); }
  .bulk-btn--primary .icon { background: var(--on-accent); }
  /* Bulk "Price": shown only in the Products context; while entering a price the
     normal buttons hide and the inline editor takes over the bar. */
  #bulkPrice { display: none; }
  .bulk-bar.is-products #bulkPrice,
  .bulk-bar.is-materials #bulkPrice { display: inline-flex; }
  .bulk-price-entry { display: none; align-items: center; gap: 8px; }
  .bulk-bar.is-pricing #bulkFavorite,
  .bulk-bar.is-pricing #bulkLike,
  .bulk-bar.is-pricing #bulkTags,
  .bulk-bar.is-pricing #bulkPrice,
  .bulk-bar.is-pricing #bulkDelete,
  .bulk-bar.is-pricing #bulkExit { display: none; }
  .bulk-bar.is-pricing .bulk-price-entry { display: inline-flex; }
  /* Bulk ★ Favorite / ❤ Love: materials selection only (own inventory + friend view). */
  /* Icon-only ★/❤ toggles — inherit the .flag-toggle look (square, gold/red
     background tint when the whole selection carries the flag). The icons keep
     their brand colour in BOTH states (gold star / red heart) — outline when off,
     filled when on — so the final colour is always legible. */
  /* ★/❤ = normal .bulk-btn (icon + text, same height as the others). Icon keeps
     its brand colour in both states; active (whole selection flagged) tints the
     button so you can tell it's "on". */
  #bulkFavorite, #bulkLike { display: none; }
  .bulk-bar.is-materials #bulkFavorite,
  .bulk-bar.is-materials #bulkLike { display: inline-flex; }
  #bulkFavorite .icon { background-color: var(--favorite); }   /* ★ gold, on & off */
  #bulkLike .icon     { background-color: var(--buy); }   /* 🛒 cart green, on & off */
  #bulkFavorite.active { background: color-mix(in srgb, var(--favorite) 16%, transparent); border-color: var(--favorite); }
  #bulkLike.active     { background: color-mix(in srgb, var(--buy) 14%, transparent); border-color: var(--buy); }
  /* Catalogue selection: ★ / 🛒 / list only — the catalogue is not ours to tag or delete. */
  .bulk-bar.is-catalog #bulkFavorite,
  .bulk-bar.is-catalog #bulkLike { display: inline-flex; }
  .bulk-bar.is-catalog #bulkTags,
  .bulk-bar.is-catalog #bulkDelete { display: none; }
  #bulkList { display: none; }
  .bulk-bar.is-materials #bulkList,
  .bulk-bar.is-products #bulkList,
  .bulk-bar.is-catalog #bulkList { display: inline-flex; }
  .bulk-bar.is-pricing #bulkList { display: none; }
  .bulk-sel-count { display: none; font-size: 13px; font-weight: 700; color: var(--text); padding: 0 4px; font-variant-numeric: tabular-nums; }
  .bulk-bar.is-catalog .bulk-sel-count { display: inline-flex; }
  /* Friend view: keep ONLY the ★/❤ import actions — no write-to-friend actions. */
  .bulk-bar.is-friendview #bulkTags,
  .bulk-bar.is-friendview #bulkPrice,
  .bulk-bar.is-friendview #bulkDelete { display: none; }
  .bulk-price-input {
    width: 92px; height: 34px; padding: 0 10px; border-radius: 10px; text-align: right;
    background: var(--surface-2); border: 1px solid var(--border); box-shadow: inset 0 1px 2px rgba(0,0,0,.04);
    font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; font-family: inherit;
  }
  .bulk-price-input:focus { outline: none; border-color: var(--primary); background: var(--primary-soft); }
  .bulk-price-mode { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .03em; min-width: 44px; }

  .bar { width: 64px; height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; margin-left: 6px; }
  .bar > span { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
  /* In the inventory table, the fill bar drops UNDER the weight value so it can
     span the full column width instead of a cramped 64px beside the number. */
  #invBody .bar { display: block; width: 100%; margin-left: 0; margin-top: 4px; }
  .thumb { width: 50px; height: 50px; border-radius: 0; object-fit: cover; background: var(--surface-2); flex-shrink: 0; display: block; }
  .thumb-placeholder { width: 48px; height: 48px; border-radius: 8px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; }
  .thumb-placeholder img { width: 30px; height: 30px; opacity: .6; }
  .thumb-wrap { position: relative; display: inline-flex; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
  /* Every spool thumb (inventory / favorites lists, grouped spools…): the spool
     colour frames the photo, photo corners rounded INSIDE the frame. thumbHTML
     sets --spool-bg on the wrap; the photo gets a transparent border (border-box,
     so the thumb keeps its size) and a radius — a replaced element's content is
     clipped to its padding edge (outer radius minus border), so the photo
     itself comes out rounded. The photo has no fill of its own here: while it
     loads, the thumb is the spool colour, not a grey square inside the frame. */
  .thumb-wrap:has(> img.thumb) { background: var(--spool-bg, var(--surface-2)); }
  .thumb-wrap > img.thumb {
    box-sizing: border-box; border: 4px solid transparent; border-radius: 10px; background: transparent;
  }
  .thumb-color { display: inline-flex; align-items: flex-start; justify-content: flex-end; }
  .thumb-color img { width: 42%; margin: 8%; }
  /* Twin + backup as round badges stacked top-left of a thumbnail/illustration
     (grid cards and the table thumbnails via the --sm variant). */
  .card-badges-tl {
    position: absolute; top: 6px; left: 6px; z-index: 2;
    display: flex; flex-direction: column; align-items: flex-start; gap: 5px; pointer-events: none;
  }
  .card-tl-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%; color: var(--on-accent);
    border: 1.5px solid rgba(255,255,255,.85); box-shadow: 0 1px 4px rgba(0,0,0,.25);
  }
  .card-tl-badge .icon { background-color: var(--on-accent); }
  .card-tl-badge--twin   { background: linear-gradient(135deg,var(--info),var(--info)); }
  .card-tl-badge--backup { background: linear-gradient(135deg,var(--success-hover),var(--success)); }
  /* Refill (a coil that goes into a reusable MasterSpool) — green. */
  .card-tl-badge--refill, .panel-img-refill-badge { background: linear-gradient(135deg,var(--success-hover),var(--success)); }
  /* "Refill" pill — recycle icon + the word; a plain round icon on the small thumbnails. */
  .card-tl-badge.card-tl-badge--refill { width: auto; min-width: 22px; padding: 0 7px 0 5px; gap: 3px; border-radius: 999px; }
  .card-badges-tl--sm .card-tl-badge--refill { width: 15px; min-width: 0; padding: 0; border-radius: 50%; }
  .panel-img-icon-badge.panel-img-refill-badge { width: auto; padding: 0 8px 0 6px; gap: 4px; border-radius: 999px; }
  .refill-txt { font-size: 10.5px; font-weight: 800; letter-spacing: .02em; line-height: 1; color: var(--on-accent); }
  /* Compact variant for the tiny table thumbnails. */
  .card-badges-tl--sm { top: 3px; left: 3px; gap: 3px; }
  .card-badges-tl--sm .card-tl-badge { width: 15px; height: 15px; border-width: 1px; }

  td.thumb-cell { padding: 4px 6px; width: 58px; }
  /* Block-level in its cell: an inline thumb sits on the text baseline, and a photo
     and a colour placeholder have different baselines — the rows came out at
     different heights. As a block both are exactly the thumb's size. */
  td.thumb-cell > .thumb-wrap, td.thumb-cell > .group-thumb-badge { display: flex; width: fit-content; }

  /* ── identical-spool grouping (Table) ───────────────────────────────────── */
  /* Group header row — the "folder". Raised background + bold; clicking it
     toggles its members. No chevron / no member indent on purpose: any extra
     leading-cell width would grow the first column and shift the whole table
     (especially when a group expands). Hierarchy is shown via background tint
     + the count badge instead. */
  /* Group header sits on the default (white) background like any other row —
     only bolder — so the hover highlight (surface-2) is actually visible. */
  tbody tr.group-header { background: transparent; font-weight: 600; }
  tbody tr.group-header:hover { background: var(--surface-2); }
  .group-name { margin-right: 8px; }
  /* Spool count shown as an alert-style notification badge pinned to the
     top-right corner of the representative product image (first column). */
  .group-thumb-badge { position: relative; display: inline-flex; flex-shrink: 0; }
  .group-count-badge {
    position: absolute; top: -6px; right: -6px; z-index: 3;
    min-width: 17px; height: 17px; padding: 0 4px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary); color: var(--on-accent);
    font-size: 10px; font-weight: 700; line-height: 1;
    border-radius: 9px; border: 2px solid var(--surface);
    box-shadow: 0 1px 3px rgba(0,0,0,.35); pointer-events: none;
  }
  /* Member row — distinguished by a subtle inset background tint + a left
     accent bar (box-shadow, so it never changes the column width). */
  tbody tr.group-child { background: color-mix(in srgb, var(--surface-2) 35%, transparent); }
  tbody tr.group-child:hover { background: var(--surface-2); }
  tbody tr.group-child > td:first-child { box-shadow: inset 3px 0 0 var(--border); }

  /* Selected spool row — orange left accent bar (placed after the group-child
     rule so a selected member's accent overrides the neutral one). Works for
     standalone rows and group members alike. */
  tbody tr.selected > td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
  /* A selected group MEMBER must keep the same orange tint as a standalone
     selected row — its own .group-child background rule is declared earlier and
     would otherwise win on equal specificity. Higher specificity + later = wins
     for both the resting and hover states. */
  tbody tr.group-child.selected,
  tbody tr.group-child.selected:hover { background: var(--primary-soft); }

  /* ── tag type badges ── */
  /* The two chip tiers read as a ladder: TigerTag steel, TigerTag+ gold. Kept in
     the house recipe — a two-stop 90deg gradient with white text, exactly like
     .tag-twin — rather than a faux-metal gradient: the rest of the UI is flat, so
     a simulated material was the one thing on screen pretending to be an object.
     TigerTag+ moved OFF orange on purpose: orange is the app's ACTION colour
     (buttons, accents), so a tier badge wearing it competed with every call to
     action. Gold says "premium tier" without borrowing the action signal. */
  /* Premium tier — the exact colours of the wishlist buy button (.lv-buy): the
     same amber border, the same top-lit vertical gradient and the same dark
     brown type. One golden-yellow across the app for "this is the good one".
     The two lower tiers stay on the flat .lv-vis tint recipe. */
  .tag-plus {
    background: linear-gradient(180deg, #ffd569, #ffc02e);
    border-color: var(--warning);
    color: #3a2c00;
    transition: filter .12s;
  }
  .tag-plus:hover { filter: brightness(1.04); }
  /* Green round badge (white shield) after the TigerTag+ badge — same look as
     the detail-panel .panel-img-backup-badge, sized down for the row. */
  .tag-backup {
    display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
    width: 18px; height: 18px; margin-left: 4px; border-radius: 50%;
    background: linear-gradient(135deg,var(--success-hover),var(--success));
    border: 1.5px solid var(--ink-85);
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    color: #fff;
  }
  .tag-backup .icon { background-color: var(--on-accent); }
  /* Same construction as TigerTag+ (and the wishlist buy button it borrows from):
     amber becomes silver, so the two real chips read as one pair — a gold rung and
     a silver rung, both with the top-lit sheen. TigerData stays flat on purpose:
     it is not a chip, so it gets no relief. */
  .tag-diy {
    background: linear-gradient(180deg, #eef2f7, #d5dce6);
    border-color: #b9c2ce;
    color: #333b47;
    transition: filter .12s;
  }
  .tag-diy:hover { filter: brightness(1.03); }
  /* Chipless entry. The two chip tiers are FILLED metals because they are objects
     you can hold; this one has no object at all, so it is drawn as an OUTLINE —
     absence of material, which no hue could say on its own. It also stops the tier
     from competing for a colour slot: in this app orange means action, green
     success, red danger and sky-blue twin-pairing, so a saturated hue here (it was
     purple, picked only to "differ from orange") carried no meaning. Same logic as
     Tiger Hub, whose tier ladder draws this rung as a dashed card. */
  /* White metal — the same top-lit construction as the gold and silver rungs, one
     step lighter. The three now form a continuous ladder (white → silver → gold).
     Its border is a touch stronger than the other two: on a white card the capsule
     would otherwise have no edge to sit on. */
  .tag-cloud {
    background: linear-gradient(180deg, #ffffff, #eceff4);
    color: #4a5462;
    transition: filter .12s;
  }
  .tag-cloud:hover { filter: brightness(.985); }
  /* TigerData+ — chipless like TigerData, so it KEEPS the white-metal capsule and
     its no-relief flatness; it simply carries a real catalogue product, like a
     TigerTag+ does. The gold rung's amber is borrowed as an ACCENT only (border +
     type), never as a fill: a filled gold capsule would read as a TigerTag+, which
     this is not — no chip, no UID. So the ladder still reads white → silver → gold,
     and this rung says "chipless, yet identified". Always applied alongside
     .tag-cloud, which supplies the geometry and the fill. */
  .tag-cloud-plus {
    color: var(--warning-hover);
  }

  /* One shared capsule for the three tiers — identical geometry, only the fill and
     the hairline border change, so they read as one family. A real 1px border is
     safe here: `box-sizing: border-box` is global (00-base.css) and the height is
     fixed, so the border costs no outer size. */
  .tag-cloud, .tag-diy, .tag-plus {
    display: inline-flex; align-items: center; justify-content: center;
    height: 18px; padding: 0 8px;
    border-radius: 999px; border: 1px solid transparent;
    font-size: 10px; font-weight: 650; line-height: 1;
    letter-spacing: .01em; white-space: nowrap;
    vertical-align: middle; user-select: none;
  }
  /* Per-tier hairline, declared AFTER the shared capsule on purpose: that rule's
     `border` SHORTHAND resets the colour to transparent, so a border-color set in
     the tier rules above it never survived. Both edges had silently been invisible
     — the white capsule lost the stronger edge it needs to sit on a white card
     (since v2.13.0), and TigerData+ its amber accent, which is the only thing
     saying "chipless, yet identified". */
  .tag-cloud      { border-color: #cbd3dd; }
  .tag-cloud-plus { border-color: var(--warning); }
  .tag-twin { background: linear-gradient(90deg,var(--info),var(--info)); color:var(--on-accent); font-size:10px; padding:2px 7px; border-radius:999px; font-weight:700; letter-spacing:.03em; display:inline-flex; align-items:center; gap:3px; margin-left:4px; }

  /* ── view toggle ── */
  /* Main inventory search — input + magnifier icon aligned right (matches the
     pattern used by .rp-side-search inside the rack-view sidebar). */
  /* The pill is the BOX, not the input: it holds the filter chips (#fbBar,
     renderer/filter-bar.js) and then the text, like Shopify admin's search. Always
     ONE line: chips that do not fit scroll sideways in their strip. */
  .inv-search {
    position: relative;
    flex: 1;
    min-width: 200px;        /* readable even when many filters are open */
    display: flex; flex-wrap: nowrap; align-items: center; gap: 4px;
    height: 40px; box-sizing: border-box;
    padding: 4px 92px 4px 42px;
    border-radius: 20px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    cursor: text;
    transition: background-color .15s, border-color .15s;
  }
  .inv-search:focus-within { background: var(--surface); border-color: var(--primary); }
  /* Match the stat tile styling so the toolbar reads as one cohesive row.
     Same background, border, height and radius as .rv-stat / .rv-stat-add. */
  /* Rounded like a search pill, with room on the left for the inline "+" and on
     the right for the clear button and the magnifier. */
  /* The text takes what the chips leave. Direct child only: the chip editors'
     own search fields open inside this box too. */
  .inv-search > input {
    flex: 1 1 160px;
    min-width: 120px;
    height: 30px;
    padding: 0 4px;
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    font-size: 13px;
    box-sizing: border-box;
  }
  /* The inline add button. Sits INSIDE the pill, vertically centred, and keeps
     its own round hit area so it never reads as part of the text field. */
  .inv-search-add {
    position: absolute; left: 5px; top: 50%; transform: translateY(-50%);
    width: 30px; height: 30px; border-radius: 50%; z-index: 2;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0; border: 0; cursor: pointer;
    /* Filled in the accent rather than a grey glyph on nothing: it is the way in
       to adding a spool, sitting inside a search field that reads as somewhere to
       type — so it has to look like a button rather than an ornament. */
    background: var(--primary);
    transition: background .15s;
  }
  .inv-search-add .icon { background: var(--on-accent); transition: background .15s; }
  .inv-search-add:hover { background: var(--primary-hover); }
  .inv-search-add:hover .icon { background: var(--on-accent); }
  .inv-search-add:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

  /* The pill draws the field and its focus ring; the text has none of its own
     (the app's global input look would draw a second box inside the pill). */
  .inv-search #searchInv,
  .inv-search #searchInv:focus { outline: none; border: 0; background: transparent; box-shadow: none; }
  /* No magnifier at the right end (founder, 2026-11-22): the pill reads as a search
     field without it. Right to left: QR, Filter, colour (Search and inventory
     views), then the clear button while there is text — its own slot, so nothing
     shifts as you type. */
  /* The camera scan button, at the right end (renderer/qr-scan.js). */
  .inv-search-scan {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 26px; height: 26px; padding: 0; border: none; border-radius: 50%;
    background: transparent; display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background .12s;
  }
  .inv-search-scan .icon { background: var(--muted); transition: background .12s; }
  .inv-search-scan:hover { background: var(--border); }
  .inv-search-scan:hover .icon { background: var(--text); }
  .inv-search-scan:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
  /* The colour search button (renderer/color-search.js), left of the Filter one —
     Search and inventory views (body.color-search), where the field makes room for
     it. Accent while a colour filters. */
  .inv-search-filter { right: 34px; }
  .inv-search-color { right: 62px; display: none; }
  body.color-search .inv-search-color { display: inline-flex; }
  body.color-search .inv-search { padding-right: 120px; }
  body.is-friend-view.color-search .inv-search-color { display: none; }   /* a friend's stock: not searched by colour */
  .inv-search-filter[hidden] { display: none; }
  .inv-search-color.is-on .icon, .inv-search-color.is-on:hover .icon { background: var(--primary); }
  /* The QR side card (#qrScanPanel): the search bar's scan button opens it at the
     right edge; the add chooser shows it in its pane (linked.css). The live picture
     sits under the scanner overlay. */
  #qrScanPanel { width: 420px; max-width: 95vw; z-index: 101; display: flex; flex-direction: column; }
  .qr-scan-win .qrs-view { position: relative; margin: 14px auto 0; width: min(420px, 100%); aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: #000; }
  .qr-scan-win .qrs-video { width: 100%; height: 100%; object-fit: cover; display: block; transform: scaleX(-1); }
  /* The scanner overlay (renderer/qr-scan.js): a square target, the rest dimmed; four
     glowing corner brackets, a dot grid and a laser sweeping top to bottom. On a read
     (.is-found) the brackets snap in and turn green, and the laser stops. */
  .qr-scan-win { --qrs-on: var(--primary); --qrs-ok: var(--game-ok-text); --qrs-bad: var(--danger); }
  .qr-scan-win .qrs-target { position: absolute; left: 50%; top: 50%; width: 50%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .38); pointer-events: none; overflow: hidden; transition: width .35s cubic-bezier(.2, .8, .2, 1); }
  .qr-scan-win .qrs-grid { position: absolute; inset: 0; background: radial-gradient(color-mix(in srgb, var(--qrs-on) 55%, transparent) 1px, transparent 1.4px) 0 0 / 14px 14px; opacity: .35; }
  .qr-scan-win .qrs-laser { position: absolute; left: 4%; right: 4%; top: 0; height: 2px; border-radius: 2px; background: var(--qrs-on);
    box-shadow: 0 0 10px 1px var(--qrs-on), 0 -26px 30px -6px color-mix(in srgb, var(--qrs-on) 35%, transparent); animation: qrs-sweep 2.2s cubic-bezier(.45, 0, .55, 1) infinite alternate; }
  @keyframes qrs-sweep { from { top: 6%; } to { top: 94%; } }
  .qr-scan-win .qrs-c { position: absolute; width: 22%; aspect-ratio: 1; border: 3px solid var(--qrs-on); filter: drop-shadow(0 0 6px var(--qrs-on)); transition: border-color .2s, filter .2s; }
  .qr-scan-win .qrs-c--tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
  .qr-scan-win .qrs-c--tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
  .qr-scan-win .qrs-c--bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
  .qr-scan-win .qrs-c--br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
  .qr-scan-win .qrs-view.is-found .qrs-target { width: 40%; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .5), inset 0 0 40px color-mix(in srgb, var(--qrs-ok) 45%, transparent); }
  .qr-scan-win .qrs-view.is-found .qrs-c { border-color: var(--qrs-ok); filter: drop-shadow(0 0 8px var(--qrs-ok)); }
  .qr-scan-win .qrs-view.is-found .qrs-laser, .qr-scan-win .qrs-view.is-found .qrs-grid { opacity: 0; animation: none; transition: opacity .15s; }
  /* The status pill, over the picture's top right corner: "Scanning…" with a pulsing
     dot, then "Found!" in green (or red for a code that is not ours). */
  .qr-scan-win .qrs-status { position: absolute; top: 10px; right: 10px; display: flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .18); background: rgba(10, 14, 22, .62); backdrop-filter: blur(6px); font-size: 12px; font-weight: 600; color: #fff; transition: border-color .2s, color .2s; }
  .qr-scan-win .qrs-dot { width: 8px; aspect-ratio: 1; border-radius: 50%; background: var(--qrs-on); box-shadow: 0 0 8px var(--qrs-on); animation: qrs-pulse 1.1s ease-in-out infinite; }
  @keyframes qrs-pulse { 50% { opacity: .35; transform: scale(.75); } }
  .qr-scan-win .qrs-status.is-found { border-color: color-mix(in srgb, var(--qrs-ok) 50%, transparent); color: var(--qrs-ok); }
  .qr-scan-win .qrs-status.is-found .qrs-dot { background: var(--qrs-ok); box-shadow: 0 0 8px var(--qrs-ok); animation: none; }
  /* A QR code that is not ours: red for a second (renderer/qr-scan.js WRONG_MS). */
  .qr-scan-win .qrs-view.is-wrong .qrs-c { border-color: var(--qrs-bad); filter: drop-shadow(0 0 8px var(--qrs-bad)); }
  .qr-scan-win .qrs-view.is-wrong .qrs-laser { background: var(--qrs-bad); box-shadow: 0 0 10px 1px var(--qrs-bad); }
  .qr-scan-win .qrs-view.is-wrong .qrs-grid { opacity: 0; }
  .qr-scan-win .qrs-status.is-wrong { border-color: color-mix(in srgb, var(--qrs-bad) 50%, transparent); color: var(--qrs-bad); }
  .qr-scan-win .qrs-status.is-wrong .qrs-dot { background: var(--qrs-bad); box-shadow: 0 0 8px var(--qrs-bad); animation: none; }
  .qr-scan-win .qrs-msg.is-wrong { color: var(--qrs-bad); }
  @media (prefers-reduced-motion: reduce) { .qr-scan-win .qrs-laser { animation: none; top: 50%; } .qr-scan-win .qrs-dot { animation: none; } }
  .qrs-side { padding: 4px 18px 18px; }
  .qrs-title { display: flex; align-items: center; gap: 9px; }
  .qrs-title .icon { width: 22px; aspect-ratio: 1; flex: none; background: var(--text); }
  .qr-scan-win.qrs-side .qrs-view { width: 100%; margin-top: 0; }
  .qr-scan-win .qrs-msg { min-height: 1.4em; margin: 10px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }
  .inv-search-clear {
    position: absolute;
    /* Left of the buttons (QR, Filter, and the colour one where it shows). The
       storage sidebar's search reuses it with its own offset (30-racks.css). */
    right: 64px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--border);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .12s, color .12s, transform .1s;
  }
  .inv-search-clear:hover {
    background: var(--muted);
    color: var(--surface);
  }
  .inv-search-clear:active { transform: translateY(-50%) scale(.92); }
  .inv-search-clear[hidden] { display: none; }
  body.color-search:not(.is-friend-view) .inv-search > .inv-search-clear { right: 92px; }
  .inv-search:has(.inv-search-filter[hidden]) > .inv-search-clear { right: 36px; }
  .inv-search-clear .icon { position: static; transform: none; background: currentColor; }

  /* Row dedicated to the view selector — sits directly below the search
     bar and filter dropdowns so the toggle keeps its full size (incl.
     the Storage/Printers labels) regardless of how wide the filters
     above end up. The Add-product button is right-aligned on the same
     row via `space-between`. Slight top margin separates the two rows. */
  .inv-view-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;   /* labels stack above the toggles → align the action buttons with the toggle row, not the label */
    margin: 0 0 10px;   /* sits above the search bar now → gap goes BELOW it */
    gap: 10px;
  }
  /* Cam view: the search bar + "Scan"/"Add device" buttons don't apply to the
     camera wall — hide them; the "Detach" button takes the actions slot. */
  #card-inv.is-cam-view .inv-search-row { display: none; }
  .inv-actions-group {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* Primary action button matching the brand accent. Compact height to
     align with the .view-toggle buttons (~36px tall combined with their
     padding) so the row reads as a single horizontal band. */
  .inv-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: filter .15s, transform .1s;
    flex-shrink: 0;
  }
  /* `.inv-add-btn`'s explicit `display` overrides the UA `[hidden]{display:none}`
     (author beats UA), so the `hidden` attribute alone wouldn't hide the button
     (e.g. the cam-wall "Detach" button in a friend view). Re-assert it here. */
  .inv-add-btn[hidden] { display: none; }
  /* Explicitly re-assert the primary background on :hover — without
     this the global `button:hover { background: var(--surface-2) }`
     rule (specificity 0,1,1) wins for the `background` property
     since `.inv-add-btn:hover` (0,2,0) below only declares `filter`,
     leaving background unspecified and inherited from the global —
     which made the button go white-on-white on hover. */
  .inv-add-btn:hover {
    background: var(--primary);
    filter: brightness(1.07);
  }
  .inv-add-btn:active { transform: translateY(1px); }
  /* The icon takes the button's OWN text colour. It used to be painted with
     --surface, which only ever looked right by coincidence: back when --surface
     was always white, a white glyph happened to suit the filled orange button.
     It broke the moment the button had a different label colour (the outlined
     .ttag variants) and would break again in dark, where --surface is near
     black. currentColor makes the glyph and its label move together, whatever
     the variant and whatever the theme. */
  .inv-add-btn .icon  { background: currentColor; }
  /* Disabled (only the .ttag Export uses it — inert until materials are
     selected): greyed, no hover lift, not clickable. */
  .inv-add-btn:disabled { opacity: .4; cursor: not-allowed; }
  .inv-add-btn:disabled:hover { filter: none; }
  .inv-add-btn:disabled:active { transform: none; }

  /* ── RFID scan notification — fixed card bottom-right ── */
  .rfid-scan-notif {
    position: fixed;
    bottom: 28px;
    right: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,.32);
    z-index: 9000;
    min-width: 230px;
    max-width: 290px;
    transform: translateY(130%);
    opacity: 0;
    transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .25s;
    overflow: hidden;
    pointer-events: none;
  }
  .rfid-scan-notif.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .rsn-swatch {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    flex-shrink: 0;
    background: var(--neutral);
    border: 1px solid var(--ink-10);
  }
  .rsn-info { flex: 1; min-width: 0; }
  .rsn-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .rsn-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .rsn-close {
    width: 22px;
    height: 22px;
    border: none;
    background: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background .15s, color .15s;
  }
  .rsn-close:hover { background: var(--surface-2); color: var(--text); }
  .rsn-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: var(--primary);
    border-radius: 0 0 14px 14px;
    transform-origin: left;
  }
  .rsn-bar.animate {
    animation: rsn-shrink 3s linear forwards;
  }
  @keyframes rsn-shrink {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
  }


  /* ── Filter bar (renderer/filter-bar.js) — the "Filter" button, then one chip
     per condition, right of the search field. The button is the filter pill
     (.inv-brand-filter), each chip the colour chip (.cv-color-chip), every menu
     and editor the app's dropdown (.csel-pop / .csel-opt / .csel-search): only
     what those do not already have is here. */
  /* The chips' strip, before the text: it never takes the line from the text
     (which keeps at least 120 px) and scrolls sideways, without a scrollbar,
     when the chips are longer than the room left. The editors open in the field
     (renderer/filter-bar.js), not in this strip, which would clip them. */
  .fb-bar { display: flex; align-items: center; gap: 4px; flex: 0 1 auto; min-width: 0;
    overflow-x: auto; scrollbar-width: none; }
  .fb-bar::-webkit-scrollbar { display: none; }
  .fb-bar[hidden], .fb-bar:empty { display: none; }
  .fb-slot { flex-shrink: 0; cursor: default; }
  .fb-chip.cv-color-chip { height: 30px; max-width: 300px; }
  .fb-chip .cv-color-chip-main { min-width: 0; }
  .fb-chip .cv-color-chip-main { padding-left: 11px; }
  .fb-chip .cv-color-chip-swatch { width: 18px; }
  .fb-chip:has(.cv-color-chip-swatch) .cv-color-chip-main { padding-left: 5px; }
  .fb-chip .cv-color-chip-text { overflow: hidden; text-overflow: ellipsis; }
  .fb-chip .cv-color-chip-x { width: 28px; }
  /* The field list opens under the whole pill, at its width. */
  .inv-search > .csel-pop.fb-pop { left: 0; right: auto; min-width: 260px; cursor: default; }
  /* The search bar's lists belong to the page, not above the side cards: a
     side card (z-index 101+) opened over the bar must cover them. The shared
     `.csel-pop` stands at 600 for dropdowns inside cards and windows. */
  .inv-search .csel-pop { z-index: 100; }
  /* A chip being created: dashed until it holds a value. */
  .fb-chip.is-pending { border-style: dashed; background: transparent; }
  .csel-pop.fb-pop { min-width: 230px; max-width: 300px; }
  .fb-pop .csel-pop-list { max-height: 300px; }
  /* is / is not — a two-way switch above the values. */
  .fb-head { display: flex; flex-direction: column; gap: 6px; }
  .fb-op { display: flex; padding: 2px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); }
  .fb-op-btn { flex: 1; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--muted);
    font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: background .12s, color .12s; }
  .fb-op-btn:hover { color: var(--text); }
  .fb-op-btn.is-on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
  /* A value: tick box, optional swatch, name, count. */
  .fb-opt.csel-opt { display: flex; align-items: center; gap: 9px; }
  .fb-opt.csel-opt.is-sel { color: var(--text); font-weight: 400; }
  .fb-check { position: relative; flex: 0 0 16px; height: 16px; border-radius: 5px; box-sizing: border-box;
    border: 1.5px solid var(--border-strong); background: var(--surface); transition: background .12s, border-color .12s; }
  .fb-opt.is-sel .fb-check { background: var(--primary); border-color: var(--primary); }
  .fb-opt.is-sel .fb-check::after { content: ""; position: absolute; left: 4.5px; top: 1px; width: 4px; height: 8px;
    border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
  .fb-opt .cv-color-chip-swatch { width: 16px; }
  .fb-opt-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .fb-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
  .fb-empty { padding: 10px 12px; color: var(--muted); font-size: 12.5px; }
  /* A number range (at least / at most). */
  .fb-range { display: flex; align-items: flex-end; gap: 8px; padding: 6px; }
  .fb-range-field { display: flex; flex-direction: column; gap: 4px; flex: 1; color: var(--muted); font-size: 11.5px; }
  .fb-range-field .csel-search { width: 90px; }
  .fb-range-sep, .fb-range-unit { padding-bottom: 7px; color: var(--muted); font-size: 12.5px; }

  /* Grid-only sort control: the column select (reuses .inv-brand-filter) + a
     square asc/desc toggle, matching the filter pills. */
  .inv-grid-sort { display: flex; gap: 4px; flex-shrink: 0; }
  .inv-grid-sort[hidden] { display: none; }
  .inv-sort-dir {
    flex-shrink: 0; width: 40px; height: 40px; box-sizing: border-box;
    background-color: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
    color: var(--text); font-size: 16px; line-height: 1; cursor: pointer;
    transition: border-color .15s, background-color .15s, color .15s;
  }
  .inv-sort-dir:hover { background-color: var(--surface); border-color: var(--primary); color: var(--primary-text); }
  /* Brand / material / type quick-filters — dropdowns right of the search bar.
     Same height + background + border as the stat tiles so the whole toolbar
     row reads as one cohesive set of pills. */
  .inv-brand-filter {
    flex-shrink: 0;
    height: 40px;
    padding: 0 30px 0 16px;
    background-color: var(--surface-2);
    border: 1px solid var(--border);
    /* Pill, like the field they sit beside — the row reads as one family of
       controls rather than a rounded search bar followed by square boxes. */
    border-radius: 999px;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4l2.5 2.5L7.5 4'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color .15s, background-color .15s;
    max-width: 180px;
    box-sizing: border-box;
  }
  .inv-brand-filter:hover {
    background-color: var(--surface);
    border-color: var(--primary);
  }
  /* The catalogue's brands button (#cvBrandsBtn): the sort select's pill, no chevron. */
  .cv-brands-btn {
    flex-shrink: 0; height: 40px; padding: 0 16px; display: inline-flex; align-items: center; gap: 8px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
    color: var(--text); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap;
    transition: border-color .15s, background-color .15s;
  }
  .cv-brands-btn .icon { background: var(--muted); }
  .cv-brands-btn:hover { background: var(--surface); border-color: var(--primary); }
  .cv-brands-btn.is-on { border-color: var(--primary); }
  .inv-brand-filter:focus { outline: none; border-color: var(--primary); }
  /* Visual hint when a brand filter is active */
  .inv-brand-filter:not([data-empty="true"]):valid:not(:focus) {
    /* CSS cannot easily detect "selected non-empty value" — JS toggles a class instead */
  }
  .inv-brand-filter.is-active {
    border-color: var(--primary);
    background-color: var(--primary-soft);
    color: var(--primary-text);
    font-weight: 600;
  }
  /* ── Custom select dropdown (replaces the OS-native one) — see _enhanceSelect.
     The <select> is kept (value/state) but visually hidden; a .csel-btn mirrors it
     and .csel-pop is an app-styled option list. */
  .csel { position: relative; display: inline-flex; }
  .csel > select {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: 0;
    opacity: 0; pointer-events: none; clip: rect(0 0 0 0);
  }
  .csel-btn { text-align: left; }
  .csel-btn .csel-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .csel-pop {
    position: absolute; top: calc(100% + 6px); left: 0; min-width: 100%; max-width: 260px;
    z-index: 600; background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: 0 14px 36px rgba(0,0,0,.22);
    padding: 5px; overflow: hidden;
    animation: cselPop .12s ease;
  }
  /* Flipped when left-aligning would overflow the card (set in _enhanceSelect from
     a live measurement). Without it the rightmost filter's list is clipped away by
     #card-inv's `overflow: hidden`. */
  .csel-pop--right { left: auto; right: 0; }
  /* Same idea on the vertical axis. An absolutely-positioned popup cannot
     escape a scrolling ancestor, so near the bottom of a scroll box (the
     profile side card's body, a settings panel) the list opens DOWN into a
     clip and half of it is simply cut away. Flipped above the button it stays
     inside that box. Set from a live measurement in _enhanceSelect. */
  .csel-pop--up { top: auto; bottom: calc(100% + 6px); }
  /* The list scrolls, not the popup: the scroll-fade is a mask and a mask clips
     to the border box, so masking the popup itself would erase its drop shadow.
     Keeping the shadow on the outer box and the scroll (plus the mask) on this
     inner one gives the cue without losing the elevation. */
  .csel-pop-list {
    max-height: 340px; overflow-y: auto; overscroll-behavior: contain;
    /* This list KEEPS its scrollbar, unlike the rest of the app. A fade only
       reads as "there is more" when an item is visibly cut in half — land the
       cut between two rows and it says nothing at all. The scrollbar is the one
       cue that is unconditional, and it also answers "where am I" and "how much
       is left", which a fade never can. Slim and on-theme so it stays quiet. */
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent;
  }
  .csel-pop-list::-webkit-scrollbar { width: 10px; }
  .csel-pop-list::-webkit-scrollbar-track { background: transparent; }
  .csel-pop-list::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--muted) 42%, transparent);
    border-radius: 5px;
    border: 3px solid transparent;   /* inset the thumb without a wrapper */
    background-clip: content-box;
  }
  .csel-pop-list:hover::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--muted) 68%, transparent);
    background-clip: content-box;
  }
  @keyframes cselPop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
  .csel-opt {
    display: block; width: 100%; text-align: left; white-space: nowrap;
    padding: 8px 12px; border: none; background: none; border-radius: 8px;
    cursor: pointer; font-family: inherit; font-size: 13px; color: var(--text);
    transition: background .1s;
  }
  .csel-opt:hover { background: var(--surface-2); }
  .csel-opt.is-sel { color: var(--primary-text); font-weight: 600; }
  /* Where the arrow keys have landed. Distinct from `.is-sel`, which is what is
     actually chosen — you can be looking at one row while another is still the
     current value. */
  .csel-opt.is-cursor { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--primary); }
  .csel-opt[hidden] { display: none; }
  /* The filter field, pinned above the list so it stays put while the options
     scroll under it. */
  .csel-pop-head { padding: 6px 6px 4px; }
  .csel-search {
    width: 100%; height: 30px; box-sizing: border-box;
    padding: 0 10px; border-radius: 8px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
    font-family: inherit; font-size: 12.5px;
  }
  .csel-search:focus { outline: none; border-color: var(--primary); background: var(--surface); }
  .csel-search::-webkit-search-cancel-button { -webkit-appearance: none; }
  /* Mirror the select's own `.hidden` onto the whole custom control. */
  .csel:has(> select.hidden) { display: none; }
  /* ── Products view (order recommendation + liked/favorite) ── */
  .inv-products-view { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; overflow-y: auto; margin-top: var(--view-gap); scrollbar-width: none; }
  .inv-products-view::-webkit-scrollbar { width: 0; height: 0; }
  /* Keep children at their natural height so tall content overflows (and the
     view scrolls) instead of being squeezed to fit — a flex column shrinks its
     items by default, which silently clipped the "To order" list. */
  .inv-products-view > * { flex-shrink: 0; }
  /* Lines (order tab) */
  .pv-line {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--border); cursor: pointer;
    transition: border-color .15s, background .15s;
  }
  .pv-line:hover { border-color: var(--primary); }
  /* Order tab = one card with divider rows (Shopify draft-order look). */
  /* Order list on the left, Payment card on the right (sticky, follows scroll). */
  .pv-order-layout { display: flex; align-items: flex-start; gap: 12px; }
  .pv-order-layout .pv-order-list { flex: 1; min-width: 0; }
  /* Drop the Payment card down so its top lines up with the FIRST source card, not
     with the "Panier" section title above it (title = 18px pill + 8px margin). */
  .pv-order-side { flex-shrink: 0; width: 300px; position: sticky; top: 0; margin-top: 26px; }
  @media (max-width: 900px) { .pv-order-layout { flex-direction: column; } .pv-order-side { width: 100%; position: static; margin-top: 0; } }
  .pv-order-list { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
  .pv-order-line {
    border: none; border-bottom: 1px solid var(--border); border-radius: 0;
    background: transparent; padding: 8px 16px; align-items: center;
  }
  /* Compact the order rows: smaller thumb + tight sub-line rhythm so a line with
     a SKU under the title doesn't leave dead space below the text. */
  .pv-order-line .pv-thumb { width: 64px; height: 64px; border-radius: 10px; }
  .pv-order-line .pv-line-title { line-height: 1.25; }
  .pv-order-line .pv-line-sku { margin-top: 1px; }
  .pv-order-line .pv-qty { margin-top: 2px; }
  .pv-order-line:last-child { border-bottom: none; }
  .pv-order-line:hover { border-color: transparent; background: var(--surface-2); }
  .pv-order-line:last-child:hover { border-bottom-color: transparent; }
  .pv-thumb { width: 48px; height: 48px; border-radius: 9px; flex-shrink: 0; object-fit: cover; border: 1px solid var(--border); }
  .pv-thumb--swatch { display: block; background: var(--spool-bg, var(--surface-2)); }
  /* Product photos (cart, favorites / order lists, wishlists): framed in the
     product's colour like the grid cards. A transparent border shows the
     `--spool-bg` background painted under it (gradients included — a border
     colour could only be flat); the photo covers the inside. */
  img.pv-thumb {
    box-sizing: border-box; border: 4px solid transparent;
    background: var(--spool-bg, var(--surface-2)) border-box;
  }
  .pv-line-main { flex: 1; min-width: 0; }
  /* Whole identity on one line (Brand · Series · Colour name). */
  .pv-line-title { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* SKU on its own line directly under the title (click-to-copy). */
  .pv-line-sku { margin-top: 2px; display: flex; }
  .pv-qty { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
  /* Click-to-copy SKU — no permanent button chrome: the value itself is the
     click target. Now sits inline under the name (on the stock sub-line), so it
     no longer steals a fixed 190px column from the identity on narrow windows.
     A faint copy glyph fades in on hover; a "Copied!" pill floats up on click. */
  .pv-sku {
    position: relative; max-width: 220px; height: auto; display: inline-flex; align-items: center; gap: 5px;
    padding: 1px 5px; margin: 0; border: none; background: none; border-radius: 7px;
    cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums;
    transition: color .15s, background .15s;
  }
  .pv-sku-txt { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pv-sku-hint { flex-shrink: 0; opacity: 0; background-color: currentColor; transition: opacity .15s; }
  .pv-sku:hover { color: var(--text); background: var(--surface-2); }
  .pv-sku:hover .pv-sku-hint { opacity: .65; }
  .pv-sku.is-copied { color: var(--success-text); }
  .pv-sku.is-copied .pv-sku-hint { opacity: 0; }
  /* Floating "Copied!" pill — rises and fades once over the SKU. */
  .copy-flash {
    position: absolute; left: 0; bottom: calc(100% + 2px); pointer-events: none;
    padding: 2px 7px; border-radius: 7px; white-space: nowrap;
    font-size: 11px; font-weight: 700; color: var(--on-accent); background: var(--success);
    box-shadow: 0 4px 12px rgba(0,0,0,.18); opacity: 0;
  }
  .copy-flash.run { animation: copyFlash 1s cubic-bezier(.4,0,.2,1) forwards; }
  @keyframes copyFlash {
    0%   { opacity: 0; transform: translateY(4px) scale(.92); }
    18%  { opacity: 1; transform: translateY(0) scale(1); }
    72%  { opacity: 1; transform: translateY(-2px); }
    100% { opacity: 0; transform: translateY(-9px); }
  }
  /* Shopify-style order columns: unit price · qty · line total. */
  .pv-unit-col { flex-shrink: 0; width: 90px; text-align: right; font-size: 13px; color: var(--primary-text); font-weight: 600; font-variant-numeric: tabular-nums; }
  .pv-qty-col { flex-shrink: 0; width: 92px; display: flex; justify-content: center; }
  .pv-total-col { flex-shrink: 0; width: 90px; text-align: right; font-size: 14px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
  /* Payment summary (Subtotal / Tax / Total), like a Shopify order footer. */
  .pv-summary {
    margin-top: 4px; padding: 14px 16px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--border);
  }
  .pv-sum-title { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 10px; }
  .pv-sum-row {
    display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 10px;
    font-size: 13px; color: var(--text); padding: 5px 0;
  }
  .pv-sum-sub { color: var(--muted); font-size: 12px; }
  .pv-sum-val { text-align: right; font-variant-numeric: tabular-nums; }
  .pv-sum-tag { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .03em; }
  .pv-sum-total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); font-weight: 800; font-size: 16px; }
  .pv-line-actions { display: flex; gap: 6px; flex-shrink: 0; }
  .pv-info, .pv-buy {
    width: 34px; height: 34px; padding: 0; border-radius: 9px; cursor: pointer; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid var(--border);
  }
  /* Info (ⓘ) — light action button, same box as the cart so the row lines up
     (without this it fell back to the global 40px-tall <button> default). */
  .pv-info { background: var(--surface-2); }
  .pv-info .icon { background-color: var(--muted); }
  .pv-info:hover { background: var(--border); }
  .pv-info:hover .icon { background-color: var(--text); }
  /* Buy button — green icon-only square (the shop's domain lives in the group
     header now), or a muted square when the product has no buy link (`--off`). */
  .pv-buy { background: var(--buy); border-color: var(--buy); transition: filter .12s; }
  .pv-buy:hover { filter: brightness(1.05); }
  .pv-buy .icon { background-color: var(--on-accent); }
  .pv-buy--off { background: var(--surface-2); border-color: var(--border); }
  .pv-buy--off .icon { background-color: var(--muted); }
  /* Trailing ✕ (hold-to-remove from the To-order list) — same 34px box as ⓘ/buy. */
  .pv-line-act {
    position: relative; overflow: hidden;
    width: 34px; height: 34px; padding: 0; border-radius: 9px; cursor: pointer; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); background: var(--surface-2);
    transition: background .12s, border-color .12s;
  }
  .pv-line-act .icon { background-color: var(--muted); position: relative; z-index: 1; }
  .pv-line-act--del:hover { border-color: var(--danger); }
  .pv-line-act--del:hover .icon { background-color: var(--danger); }
  .pv-line-act--del .hold-progress { background: var(--danger); opacity: .3; }
  .pv-flag { vertical-align: middle; }
  .pv-flag--liked { background-color: var(--buy); }
  .pv-flag--fav { background-color: var(--favorite); }
  .pv-empty { padding: 48px 20px; text-align: center; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
  .pv-empty .icon { background-color: var(--border); }
  .pv-empty--inline { padding: 28px 20px; border: 1px dashed var(--border); border-radius: 12px; }

  /* Reorder cart split in two zones: active cart + "saved for later" shelf. */
  .pv-order-main { flex: 1; min-width: 0; }
  .pv-order-main > * + * { margin-top: 22px; }
  .pv-section-title {
    display: flex; align-items: center; gap: 8px; margin: 0 2px 8px;
    font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: var(--muted);
  }
  .pv-section-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--surface-2); color: var(--text); font-size: 11px; font-weight: 700;
    letter-spacing: 0;
  }
  /* Cart group header — one band per purchase source (buy-link host) inside the
     active cart list. Sticky so the source stays visible while scrolling its items. */
  /* Cart is a STACK of per-source cards (not one continuous list): the zone wrapper
     goes transparent, each source is its own bordered card. */
  .pv-cart-cards { border: none; border-radius: 0; overflow: visible; background: transparent;
    display: flex; flex-direction: column; gap: 12px; }
  /* No `overflow:hidden`: it makes the drag-image (grab preview) render with SQUARE
     corners. Instead round the card border + clip the top/bottom inner sections, so
     the card looks rounded normally AND the grabbed card keeps rounded corners. */
  .pv-cart-card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
  .pv-cart-card > .pv-cart-group { border-top-left-radius: 12px; border-top-right-radius: 12px; }
  .pv-cart-card > :last-child { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }
  /* Keep a hovered line's bottom divider visible (the generic order-line hover turns
     it transparent) — otherwise hovering the LAST line hides its separator from the
     subtotal footer / card bottom. */
  .pv-cart-card .pv-order-line:hover { border-bottom-color: var(--border); }
  .pv-cart-group {
    display: flex; align-items: center; gap: 7px;
    padding: 7px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border);
    font-size: 11.5px; font-weight: 700; letter-spacing: .02em; color: var(--muted);
  }
  .pv-cart-group .icon { background-color: var(--muted); flex-shrink: 0; }
  .pv-cart-group-lbl { color: var(--text); }
  /* Subtotal footer for the source, at the BOTTOM of the card. */
  .pv-cart-card-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px;
    padding: 8px 12px; background: var(--surface-2); font-size: 12px; }
  .pv-cart-foot-lbl { color: var(--muted); font-weight: 600; }
  .pv-cart-foot-val { color: var(--text); font-weight: 700; }
  .pv-cart-foot-tag { color: var(--muted); font-weight: 500; font-size: 10.5px; }
  /* Grip to drag-reorder the whole source card (on the header). */
  .pv-cart-grip { flex-shrink: 0; display: inline-flex; align-items: center; margin-left: -3px;
    cursor: grab; opacity: .4; transition: opacity .12s; }
  .pv-cart-card:hover .pv-cart-grip { opacity: .8; }
  .pv-cart-grip:active { cursor: grabbing; }
  .pv-cart-grip .icon { background-color: var(--muted); }
  .pv-cart-card--dragging { opacity: 0; }
  /* Personal per-source note (amber sticky-note strip under the header). */
  .pv-cart-note { display: flex; align-items: flex-start; gap: 7px; width: 100%; text-align: left;
    height: auto; min-height: 0; padding: 8px 12px; border: none; border-radius: 0; border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--favorite-deep) 9%, var(--surface)); cursor: pointer; font-family: inherit;
    font-size: 12.5px; line-height: 1.4; color: var(--text); }
  .pv-cart-note .icon { background-color: var(--favorite-deep); flex-shrink: 0; margin-top: 1px; }
  .pv-cart-note-txt { white-space: pre-wrap; word-break: break-word; }
  .pv-cart-note:hover { background: color-mix(in srgb, var(--favorite-deep) 14%, var(--surface)); }
  .pv-cart-note--add { background: var(--surface-2); color: var(--muted); font-weight: 500; align-items: center; }
  .pv-cart-note--add .icon { background-color: var(--muted); margin-top: 0; }
  .pv-cart-note--add:hover { background: var(--surface-2); color: var(--primary-text); }
  .pv-cart-note--add:hover .icon { background-color: var(--primary); }
  .pv-cart-note--editing { display: block; padding: 8px 12px; background: var(--surface); cursor: default; }
  .pv-cart-note-input { width: 100%; box-sizing: border-box; resize: vertical; min-height: 44px;
    border: 1px solid var(--primary); border-radius: 6px; padding: 6px 8px;
    font-family: inherit; font-size: 12.5px; line-height: 1.4; background: var(--surface); color: var(--text); outline: none; }
  .pv-cart-group-n {
    display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px;
    padding: 0 4px; border-radius: 8px; background: var(--surface); color: var(--muted);
    font-size: 10.5px; font-weight: 700;
  }
  /* The "saved for later" shelf is shown at full opacity (no dimming/haze). */
  /* Amazon-style text actions under the item (non-destructive): "Save for later"
     in the cart, "Move to cart" on the shelf. A tiny dot separates them from the
     stock ratio. No icon — the wording is the clarity. */
  .pv-qty-dot { color: var(--border); }
  .pv-move-link {
    background: none; border: none; padding: 0; cursor: pointer;
    font-size: 12px; font-weight: 600; color: var(--muted);
    transition: color .12s;
  }
  .pv-move-link:hover { color: var(--text); text-decoration: underline; }
  /* "Move to cart" is the primary action on the shelf → accent-coloured. */
  .pv-move-link--cart { color: var(--primary-text); }
  .pv-move-link--cart:hover { color: var(--primary-text); filter: brightness(1.1); }
  /* "Stop tracking" is a press-and-hold button (1 s): a red fill sweeps left→right
     while held; the label sits above it. */
  .pv-move-link--stop { position: relative; overflow: hidden; padding: 2px 7px; border-radius: 5px; }
  .pv-move-link--stop > :not(.hold-progress) { position: relative; z-index: 1; }
  .pv-move-link--stop .hold-progress { opacity: 1; background: color-mix(in srgb, var(--danger) 28%, transparent); }
  .pv-move-link--stop:hover { color: var(--danger-text); }

  /* ── Reorder drag-and-drop ──────────────────────────────────────────────── */
  /* Grip handle: fades in on row hover, grabs to drag. Only it starts a drag, so
     the qty input / buttons stay fully usable. */
  .pv-grip {
    flex-shrink: 0; width: 22px; align-self: stretch; margin-left: -4px;
    display: flex; align-items: center; justify-content: center;
    cursor: grab; opacity: 0; transition: opacity .12s;
  }
  .pv-order-line:hover .pv-grip { opacity: .45; }
  .pv-grip:hover { opacity: 1; }
  .pv-grip:active { cursor: grabbing; }
  .pv-grip .icon { background-color: var(--muted); }
  /* Drag-to-reorder — lines slide (translateY) to open the drop gap; the dragged
     line is hidden (the OS drag image follows the cursor). Slide transition set
     inline in JS. */
  .pv-order-line--dragging { opacity: 0; }
  .pv-reordering .pv-order-line { will-change: transform; }
  .pv-order-list--empty { min-height: 88px; }
  body.is-dragging-order { cursor: grabbing; }

  /* ── Favorites grid — reuses the inventory .spool-card (weight bar forced
       to 100 %); only kills the extra top margin inside the scroll host. ── */
  .pv-fav-grid { margin-top: 0; }

  /* ── Favorites table ── */
  /* Same recipe as the inventory `.table-wrap`: the bordered, rounded box IS the
     scroller. That is what keeps the corners rounded while scrolling (the box
     clips its own content), pins the sticky <thead> INSIDE it, and lets the
     scroll-fade sit on the very element that overflows — flush under the header
     and only as wide as the table, never across the whole view. */
  .pv-table-wrap {
    flex: 1; min-height: 0; overflow: auto;
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
    scrollbar-width: none;
  }
  .pv-table-wrap::-webkit-scrollbar { width: 0; height: 0; }
  .pv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .pv-table thead th { text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
  .pv-trow { cursor: pointer; border-bottom: 1px solid var(--border); transition: background .12s; }
  .pv-trow:last-child { border-bottom: none; }
  .pv-trow:hover { background: var(--surface-2); }
  .pv-table td { padding: 10px 12px; vertical-align: middle; }
  /* Illustration + colour swatch match the inventory table exactly (thumb 50px in
     a tight cell, 28px swatch centred in its own column, colour name to its right). */
  .pv-table td.thumb-cell { padding: 4px 6px; width: 58px; }
  .pv-td-brand { font-weight: 700; color: var(--text); white-space: nowrap; }
  .pv-td-name { color: var(--muted); white-space: nowrap; }
  .pv-td-colorname { color: var(--text); white-space: nowrap; }
  .pv-td-stock { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .pv-td-stock--low { color: var(--favorite-text); font-weight: 700; }   /* below the minimum */
  /* Fixed width so the column never shifts between the value and the inline
     editor (both fit within it). */
  .pv-th-min, .pv-td-min { width: 96px; }
  .pv-td-min { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
  /* Min. qty: a bare pencil SVG (no button box) in FRONT of the value; clicking it
     swaps the cell for a compact inline input + ✓. */
  .pv-min-view { display: inline-flex; align-items: center; gap: 6px; }
  .pv-min-edit { background-color: var(--muted); cursor: pointer; opacity: .65; flex-shrink: 0; transition: opacity .12s, background-color .12s; }
  .pv-min-view:hover .pv-min-edit, .pv-min-edit:hover { background-color: var(--primary); opacity: 1; }
  .pv-min-editwrap { display: inline-flex; align-items: center; gap: 4px; }
  .pv-min-input { width: 42px; height: 28px; padding: 0 4px; border-radius: 6px; text-align: center;
    background: var(--surface); border: 1px solid var(--primary); box-shadow: inset 0 1px 2px rgba(0,0,0,.04);
    font-size: 13px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums;
    -moz-appearance: textfield; }
  .pv-min-input::-webkit-outer-spin-button, .pv-min-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  .pv-min-input:focus { outline: none; background: var(--primary-soft); }
  .pv-min-ok { width: 26px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary); border: 1px solid var(--primary); cursor: pointer; flex-shrink: 0; }
  .pv-min-ok .icon { background-color: var(--on-accent); }
  /* To order: read-only recommendation = max(0, Min qty − Stock). */
  .pv-td-toorder { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .pv-td-toorder--need { color: var(--primary-text); font-weight: 800; }
  .pv-td-price { color: var(--primary-text); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
  /* "Add a price" link (empty price) → opens the card straight into price edit. */
  .pv-addprice { background: none; border: none; padding: 0; cursor: pointer; font-family: inherit;
    font-size: 12px; font-weight: 600; color: var(--muted); transition: color .12s; }
  .pv-addprice:hover { color: var(--primary-text); }
  /* "Add price" in the inventory Table Price column — same subtle look as the reorder one. */
  .tbl-addprice { background: none; border: none; padding: 0; cursor: pointer; font-family: inherit;
    font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; text-decoration-style: dotted; }
  .tbl-addprice:hover { color: var(--primary-text); text-decoration-style: solid; }
  /* Cart count badge on the "To order" view button — red bubble, top-right. */
  #btnViewOrder { position: relative; overflow: visible; }
  #btnViewLists { position: relative; overflow: visible; }
  /* Lists count pill — same shape as the cart badge, brand-orange (not alert-red). */
  .view-lists-badge { background: var(--primary); }
  .view-order-badge {
    position: absolute; top: -6px; right: -6px; box-sizing: border-box;
    min-width: 16px; height: 16px; padding: 0 4px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #ed4245; color: var(--on-accent); font-size: 10px; font-weight: 700; line-height: 1;
    border-radius: 8px; pointer-events: none;
  }
  .view-order-badge[hidden] { display: none; }
  .pv-td-act { width: 52px; text-align: right; }
  .pv-trow.row-selected { background: var(--primary-soft); }
  body.bulk-select-mode .pv-trow { cursor: pointer; }

  .view-toggle { display: flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: var(--radius-sm); }
  /* Icon-only buttons — center the picto and keep them compact/square-ish. */
  .view-toggle button { height: 30px; min-width: 34px; padding: 0 9px; font-size: 13px; border: none; background: transparent; color: var(--muted); border-radius: 8px; transition: color .18s ease; display: inline-flex; align-items: center; justify-content: center; }
  .view-toggle button .icon { background-color: currentColor; }   /* follow muted → active text colour */
  /* Since the buttons are icon-only, a custom bubble names the view on hover —
     appears at once, disappears instantly on leave.
     Reads the already-localised aria-label; no native title tooltip. */
  .view-toggle-groups .view-toggle button::after {
    content: attr(aria-label);
    position: absolute; top: calc(100% + 7px); left: 50%; transform: translateX(-50%);
    padding: 5px 10px; background: var(--dark-surface); color: var(--on-dark);
    border: 1px solid var(--ink-10); border-radius: 7px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
    opacity: 0; pointer-events: none; z-index: 60;
    box-shadow: 0 4px 12px rgba(0,0,0,.3); transition: opacity .12s;
  }
  /* Shown at once. Each button is its own stacking context (z-index 1, above
     the sliding indicator), so the bubble's z-index alone could not beat the
     search field's orange + (z 2) right under it: the hovered button itself
     climbs above. */
  .view-toggle-groups .view-toggle button:hover { z-index: 70; transition: color .18s ease, z-index 0s; }
  /* …and stays up until the bubble's fade-out (.12s) is over — dropping back at
     once let the fading bubble slip under the orange +. */
  .view-toggle-groups .view-toggle button { transition: color .18s ease, z-index 0s linear .14s; }
  .view-toggle-groups .view-toggle button:hover::after { opacity: 1; transition-delay: 0s; }
  .view-toggle button.active { background: var(--surface-raised); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

  /* Sliding selection bubble — only in the main view selector (Inventory /
     Favorites / Printers). One `.view-toggle-ind` per segment, positioned by JS
     (_positionViewIndicators) to the active button's offset/width; the button's
     own solid background is dropped so the bubble is the single moving highlight. */
  .view-toggle-groups .view-toggle { position: relative; }
  .view-toggle-groups .view-toggle button { position: relative; z-index: 1; }
  .view-toggle-groups .view-toggle button.active { background: transparent; box-shadow: none; }
  .view-toggle-ind {
    position: absolute; top: 3px; bottom: 3px; left: 0; width: 0;
    /* --surface-raised, NOT --surface. The elevation ladder inverts between
       themes: in light, --surface (white) is the lightest step and reads as
       "raised" over the --surface-2 track; in dark it is DARKER than that
       track, so the bubble sank into its own background and the slide became
       invisible. --surface-raised means "above the surface" in both. */
    background: var(--surface-raised); border-radius: 8px;
    /* Elevation does not read the same on both grounds. On light, the soft black
       drop shadow does the work and the face is white against a grey track. On
       dark, that shadow is invisible — black on near-black — and the raised face
       sits only five shades above the track, so the bubble all but disappeared
       and you could not tell which view was active. A hairline fixes it in both
       without a theme-specific rule: `--border-strong` is a dark line on light
       and a light one on dark, which is exactly how each ground shows a lifted
       edge. */
    box-shadow: 0 1px 3px rgba(0,0,0,.08), inset 0 0 0 1px var(--border-strong);
    transform: translateX(0); opacity: 0;
    pointer-events: none; z-index: 0;
    transition: transform .28s cubic-bezier(.4,0,.2,1),
                width     .28s cubic-bezier(.4,0,.2,1),
                opacity   .18s ease;
  }
  .view-toggle-ind.vti-instant { transition: none; }

  /* Two-group view-toggle layout — each group is labelled by what it manages
     (Materials vs Printers) so the otherwise-identical Grid/Table toggles read
     as two distinct sections. */
  .view-toggle-groups { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
  /* Label sits ABOVE its toggle, left-aligned — stacking is narrower than a
     side-by-side label+toggle, which matters as the action row runs out of width. */
  .vtg-group { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; }
  /* `hidden` must win over the display rules above (a friend's view hides the
     Tiger Quests group and the Tiger Squad Items / History buttons). */
  .vtg-group.vtg-group[hidden], .vtg-group button[hidden][hidden] { display: none; }
  .vtg-label {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 600; color: var(--muted);
    white-space: nowrap; user-select: none;
    padding-left: 2px;
  }
  .vtg-label .icon { background: var(--muted); }
  .vtg-sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 2px; flex-shrink: 0; }
  .vtg-printers .icon { vertical-align: middle; }

  /* ── grid view ── */
  /* No top margin: this is a LAYOUT class, reused inside other views — the
     Favorites grid and the catalogue's grid body both wear it inside a
     container that already keeps the gap, which is why those two sat twice
     as far from the colour bars as the inventory grid did. The distance
     belongs to the view container, once. */
  .inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: min-content; align-content: start; gap: 8px; }
  .spool-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    overflow: hidden; cursor: pointer; transition: box-shadow .15s, transform .1s, border-color .15s;
    /* Off-screen cards are not rendered: a grid holds hundreds of them, and
       painting them all fed the compositor's tile budget. The card already clips
       its content (overflow: hidden), so the paint containment this brings changes
       nothing visible; the 240px height keeps the scrollbar right until a card has
       been rendered once, then its real height is remembered. */
    content-visibility: auto; contain-intrinsic-block-size: auto 240px;
  }
  .spool-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-1px); }
  .spool-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
  .spool-card.deleted { opacity: .45; }

  /* ── Grid group card (identical-spool group) ────────────────────────────── */
  /* A group looks like a normal card; only the ×N count badge marks it (the
     stacked-paper box-shadows were dropped to keep the grid clean). `position`
     is kept so the absolute count badge anchors to the card. */
  .spool-card.group-card { position: relative; }
  .group-card-count {
    position: absolute; top: 6px; right: 6px; z-index: 4;
    /* A perfect circle for one digit, a pill from two: border-box so the
       ring is inside the 22 px, and a min-width equal to the height means a
       single digit never makes it wider than tall (it was 23×20 — an oval). */
    box-sizing: border-box; min-width: 22px; height: 22px; padding: 0 5px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary); color: var(--on-accent);
    /* Proportional figures: tabular ones pad a narrow "1" with blank space and
       pushed the ink ~1 px off centre; a badge shows one number, not a column. */
    font-size: 11px; font-weight: 700; line-height: 1;
    border-radius: 11px; border: 2px solid var(--surface);
    box-shadow: 0 1px 4px rgba(0,0,0,.3); pointer-events: none;
  }
  /* The number sits in its own box, trimmed to the figures' height (cap-height
     to baseline): a font keeps more room above its figures than below, so a
     centred LINE left the digit 0.6 px low. `text-box` only acts on a block
     container — the flex badge itself is not one, its child is — so the flex
     then centres exactly the ink. Font-independent (macOS / Windows alike). */
  .group-card-count-n { display: block; text-box: trim-both cap alphabetic; }
  /* Group panel — a small grid of the member spool cards. Sits BEHIND the
     detail card (z 100 < 101) so the filament detail pushes it left. Doubled
     selector to outrank the later `.detail-panel { z-index: 101 }` base rule. */
  .group-panel { width: 380px; }
  .detail-panel.group-panel { z-index: 100; }
  #groupCloseTab { z-index: 100; } /* group tab — at its left edge, behind the detail card */
  /* No title bar — the dashboard is the header; the ✕ floats over the top-right. */
  .gp-panel-close { position: absolute; top: 12px; right: 12px; z-index: 3; }
  /* Vertical list of horizontal list-cards (image left, info right). */
  .group-panel .panel-body {
    display: flex; flex-direction: column; gap: 10px;
    padding: 16px; overflow-y: auto;
    scrollbar-width: none;            /* Firefox */
  }
  .group-panel .panel-body::-webkit-scrollbar { width: 0; height: 0; display: none; } /* Chromium */
  /* Micro-dashboard header — NOT a card (no box / not clickable): a circular
     gauge for remaining filament + group totals, with a separator below it. */
  .gp-dash {
    display: flex; align-items: center; gap: 16px;
    padding: 4px 0 6px 0; margin-bottom: 8px;
  }
  /* Speedometer gauge (SVG <path> arcs, gap at the bottom) + spool count below. */
  .gp-dash-gaugecol { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .gp-dash-gauge { position: relative; width: 78px; height: 78px; flex-shrink: 0; }
  .gp-gauge { width: 100%; height: 100%; display: block; }
  .gp-gauge-track { fill: none; stroke: var(--surface-2); stroke-width: 3.6; stroke-linecap: round; }
  .gp-gauge-arc { fill: none; stroke-width: 3.6; stroke-linecap: round; transition: stroke .2s ease; }
  .gp-gauge-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 1px; }
  .gp-gauge-center strong { font-size: 20px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
  .gp-gauge-center span { font-size: 10px; color: var(--muted); }
  .gp-dash-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .gp-dash-brand { font-size: 15px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 40px; }
  .gp-dash-mat { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .gp-dash-weight { line-height: 1.15; margin-top: 1px; }
  .gp-dash-weight strong { font-size: 21px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
  .gp-dash-total { color: var(--muted); font-size: 12px; }
  .gp-dash-count { color: var(--muted); font-size: 11.5px; font-weight: 600; text-align: center; margin-top: -16px; }

  /* Reorder button at the top of the deck (above the first member). */
  .gp-reorder-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; height: 38px; flex-shrink: 0;
    border-radius: 10px; cursor: pointer;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text); font-size: 13px; font-weight: 600;
    transition: background .15s, border-color .15s;
  }
  .gp-reorder-btn:hover { background: var(--border); }
  .gp-reorder-btn .icon { background-color: var(--muted); }
  /* Below-min-stock alert pill above the deck's action buttons. */
  .gp-stock-alert { flex-shrink: 0; font-size: 14px; }
  .gp-stock-alert span:last-child { font-weight: 700; }
  /* Two action buttons side by side (Product info + Reorder) above the deck. */
  .gp-actions { display: flex; gap: 8px; flex-shrink: 0; }
  .gp-actions .gp-reorder-btn { flex: 1; width: auto; }
  .gp-actions--list { margin-top: 8px; }   /* "Add to a list" sits on its own row below Info / Reorder */
  /* Icon-only action row: the 3 toggles grouped on the right (justify-content).
     When the owner-only Product-info button is present, its margin-right:auto
     pushes it to the left and keeps the 3 toggles on the right; in friend-view
     (no Product-info) the toggles simply stay right-aligned. */
  .gp-actions--flags { align-items: center; justify-content: flex-end; }
  .gp-actions--flags .gp-flag-info { margin-right: auto; }
  /* Read-only note — quick glance, not editable (edit lives in the Product-info card). */
  .gp-note { flex-shrink: 0; margin-top: 10px; padding: 10px 12px; border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--border); }
  .gp-note-label { font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 3px; }
  .gp-note-txt { font-size: 13px; line-height: 1.45; color: var(--text); white-space: pre-wrap; word-break: break-word; }
  /* Reorder (buy-link) variant — Shopify green. */
  .gp-reorder-btn--buy { background: var(--buy); border-color: var(--buy); color: var(--on-accent); }
  .gp-reorder-btn--buy:hover { background: var(--buy); filter: brightness(1.06); }
  .gp-reorder-btn--buy .icon { background-color: var(--on-accent); }
  /* No buy link → greyed (still clickable → opens the product card to add one). */
  .gp-reorder-btn--buy.gp-reorder-btn--disabled {
    background: var(--surface-2); border-color: var(--border); color: var(--muted);
  }
  .gp-reorder-btn--buy.gp-reorder-btn--disabled:hover { background: var(--border); filter: none; }
  .gp-reorder-btn--buy.gp-reorder-btn--disabled .icon { background-color: var(--muted); }
  /* Toolbox "Reorder" row — Shopify-green glyph only when a link is set (a
     greyed row keeps the default muted icon). */
  #btnToolReorderBuy:not(.toolbox-row--greyed) .toolbox-row-icon { background-color: var(--buy); }

  .spool-card.gp-member {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 11px; overflow: visible;
  }
  /* Already linked to its own maker chips while others wait on the TigerPOD. */
  .spool-card.gp-member--linked { opacity: .45; filter: grayscale(.6); }
  /* Left column: image + tier badge underneath it. Image ~30% larger (65px)
     than the default 50px thumb (the global `.thumb` rule forces 50 on the img,
     so override it here; the colour-square fallback gets 65 inline from size). */
  .gp-member-left { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; }
  .gp-member-thumb .thumb-wrap { border-radius: 8px; }
  /* Grouped-spools thumbs are larger: a slightly thicker frame (the generic
     thumb frame is defined with .thumb-wrap). */
  .gp-member-thumb .thumb-wrap > img.thumb { border-width: 5px; }
  .gp-member .thumb { width: 65px; height: 65px; }
  .gp-member-info {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px;
  }
  .gp-member-name {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .gp-member-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Weight in grams on its own line, then the quantity bar full-width below it. */
  .gp-member-weight { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); margin-top: 1px; }
  .gp-member-info .bar { width: 100%; margin-left: 0; margin-top: 1px; }
  .spool-card .card-img-wrap { position: relative; overflow: hidden; }
  .spool-card .card-img {
    width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--surface-2);
  }
  .spool-card .card-img-placeholder {
    width: 100%; aspect-ratio: 1; background: var(--surface-2);
    display: flex; align-items: center; justify-content: center;
  }
  .spool-card .card-img-placeholder img { width: 65%; opacity: .55; }
  .spool-card .card-img-color-placeholder {
    width: 100%; aspect-ratio: 1; position: relative;
    display: flex; align-items: flex-start; justify-content: flex-end; overflow: hidden;
  }
  .spool-card .card-img-color-placeholder > img:first-child { width: 28%; margin: 8%; }
  /* Product photo overlay — sits on top of the colour square; hidden on error */
  /* Inset, not full-bleed: the colour square behind shows round the photo as a
     frame in the spool's own colour. Sized explicitly — an <img> is a replaced
     element and would not stretch from `inset` alone. */
  .spool-card .card-img--overlay {
    position: absolute; top: 7%; left: 7%; width: 86%; height: 86%;
    object-fit: cover; display: block; border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
    opacity: 0;   /* no fade: a grid rebuild re-loads from cache and would blink every card */
  }
  /* Hidden until its bytes are in (the lazy loader adds .img-loaded on load):
     otherwise the empty inset box — radius + shadow — showed as a ghost square
     over the colour placeholder while the photo was on its way. */
  .spool-card .card-img--overlay.img-loaded { opacity: 1; }
  /* Photos held back (body.photos-held): while the colour-filter window is
     dragged, and for 1 s after the last wheel notch on it or the last scroll
     of a results list — the items show only their colour. Faded out, not
     `display: none`, so the images keep loading and are simply there when released. */
  body.photos-held .spool-card .card-img--overlay,
  body.photos-held .thumb-wrap > img.thumb,
  body.photos-held .inv-catalog-view .cv-thumb-img { opacity: 0; transition: opacity .35s ease; }
  /* …and they fade back in when released (body.photos-fade-in, set for the
     length of the fade only). The fade lives on these two states and nowhere
     else: a fade on every load would blink each card at every grid rebuild. */
  body.photos-fade-in .spool-card .card-img--overlay,
  body.photos-fade-in .thumb-wrap > img.thumb,
  body.photos-fade-in .inv-catalog-view .cv-thumb-img { transition: opacity .8s ease; }
  /* The TigerTag logo on the colour square is the photo's understudy: it fades
     out as the illustration fades in, and back when the photos are held — same
     timing, crossfading instead of showing through the half-transparent photo.
     Instant on a normal load, like the photo itself. */
  .spool-card .card-img-color-placeholder:has(> .card-img--overlay.img-loaded) > img:first-child,
  .inv-catalog-view :has(> .cv-thumb-img.img-loaded) > .cv-thumb-logo,
  .cpk-list :has(> .cv-thumb-img.img-loaded) > .cv-thumb-logo { opacity: 0; }
  body.photos-held .spool-card .card-img-color-placeholder:has(> .card-img--overlay.img-loaded) > img:first-child,
  body.photos-held .inv-catalog-view :has(> .cv-thumb-img.img-loaded) > .cv-thumb-logo { opacity: 1; transition: opacity .35s ease; }
  body.photos-fade-in .spool-card .card-img-color-placeholder > img:first-child,
  body.photos-fade-in .inv-catalog-view .cv-thumb-logo { transition: opacity .8s ease; }
  /* A product thumb carries its colour ON the <img> (frame = its background),
     so hiding the element would blank the whole tile. Push only the photo out
     of the box instead: the tile stays a full colour swatch, like the grid. */
  body.photos-held img.pv-thumb { object-position: -10000px 0; }
  /* A line between the colour picture and the text, the card's own border colour (founder). */
  .spool-card .card-body { padding: 10px 10px 8px; border-top: 1px solid var(--border); }
  .spool-card .card-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Hovered card with a name too long to fit: it scrolls to its end and back
     (wired in inventory.js — --mq-dist / --mq-dur are measured per card). */
  .spool-card .card-name.is-marquee, .sqd-card-body > h3.is-marquee, .nc-tile b.is-marquee, .tc-give-name.is-marquee { text-overflow: clip; }
  /* Starts moving the instant the card is hovered — no lead-in pause: out
     (0-40 %), rest at the end (40-55 %), back (55-95 %), a short rest at the
     start (95-100 %) before the next loop. */
  .card-name-mq {
    display: inline-block;
    animation: cardNameMarquee var(--mq-dur, 4s) ease-in-out infinite;
  }
  @keyframes cardNameMarquee {
    0%        { transform: translateX(0); }
    40%, 55%  { transform: translateX(var(--mq-dist, 0)); }
    95%, 100% { transform: translateX(0); }
  }
  @media (prefers-reduced-motion: reduce) { .card-name-mq { animation: none; } }
  .spool-card .card-sub { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Products grid 2nd sub-line (Series / Aspect) — slightly stronger than the brand·material line. */
  .spool-card .card-sub--extra { margin-top: 1px; color: var(--text); font-weight: 600; }
  .spool-card .card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
  .spool-card .card-weight { font-size: 12px; font-variant-numeric: tabular-nums; }
  /* Products grid: price replaces the weight slot (no weight notion for a product). */
  .spool-card .card-price { font-size: 12px; font-weight: 700; color: var(--primary-text); font-variant-numeric: tabular-nums; }
  .spool-card .card-price--none { font-weight: 500; color: var(--muted); }
  /* clickable plain-text "Add price" (no button chrome) — hint via cursor + hover */
  .spool-card .card-price--none[data-addprice] { cursor: pointer; transition: color .12s; }
  .spool-card .card-price--none[data-addprice]:hover { color: var(--primary-text); }
  .spool-card .card-bar { height: 3px; background: var(--surface-2); border-radius: 2px; overflow: hidden; margin-top: 6px; }
  .spool-card .card-bar > span { display: block; height: 100%; background: var(--primary); border-radius: 2px; }

  .empty { padding: 28px; text-align: center; color: var(--muted); font-size: 14px; }

  /* ── detail panel ── */
  .panel-overlay {
    position: fixed; inset: 0; background: var(--scrim); z-index: 100;
    opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .panel-overlay.open { opacity: 1; pointer-events: all; }
  .detail-panel {
    /* Floating-card look — same pattern as the unranked-spools panel:
       8px margin top/bottom, rounded on the left, border on 3 sides
       (no right border since the panel hugs the right edge). */
    position: fixed; top: 8px; right: 0; bottom: 8px; width: 300px; max-width: 95vw;
    background: var(--surface);
    border: 1px solid var(--border); border-right: none;
    border-top-left-radius: 14px; border-bottom-left-radius: 14px;
    box-shadow: none;
    z-index: 101; transform: translateX(100%); transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s, right .25s cubic-bezier(.4,0,.2,1);
    /* clip, not hidden: a hidden box can still be scrolled by script, focus or
       scroll anchoring, and an off-screen bottom sheet inside it (the Snapmaker
       file sheet) leaves room to do so — the header then slid half out of view. */
    display: flex; flex-direction: column; overflow: hidden; overflow: clip;
  }
  .detail-panel.open { transform: translateX(0); box-shadow: -8px 0 32px rgba(0,0,0,.12); }
  /* ── 3-layer side-panel stacking (back → front) ──────────────────────────
     material/spool card (101) < printer settings (103) < printer panel (105).
     They open side-by-side (each pushed left of the next), so the panels never
     overlap — but each panel's `»` close tab sits at its OWN left edge, which
     is the seam with the panel to its LEFT, so the tab DOES overlap that
     neighbour. A tab must therefore paint ABOVE the panel to its left (be
     visible) yet BELOW the panel to its right (tuck behind it while sliding
     closed). That needs a free z-index slot between each pair → the interleaved
     ladder: panels 101/103/105, tabs 102/104/106 (set below). */
  /* Slide-swap ghost: a static clone of the outgoing card, one slot BEHIND the
     real panel (101), removed once the new card slides over it. Inert. */
  .detail-ghost { z-index: 100 !important; pointer-events: none; }
  .detail-panel.printer-panel { z-index: 105; }   /* printer = front card */
  #printerAddPanel            { z-index: 103; }    /* printer settings = middle */
  /* plain .detail-panel (material/spool) keeps z-index 101 = back card */
  /* Settings + Debug stack: Settings (anchor, right edge) paints above the Debug
     panel (101) tucked to its left, so the seam stays clean. */
  #settingsPanel { z-index: 103; }
  /* Firebase Explorer stack (right → left = front → back): Settings (103) >
     Explorer (102) > Raw (101). Each inner card tucks BEHIND the one to its
     right so the seam + rounded left edge stay clean. */
  #fseExplorerPanel { z-index: 102; }
  #fseRawPanel      { z-index: 101; }
  /* Container picker: tucks to the LEFT of the spool detail (which keeps the
     right edge), so it sits BEHIND it (100, like the group panel). */
  #containerPanel { z-index: 100; width: 250px; }
  #containerCloseTab { z-index: 100; }
  /* Close tab — a small handle protruding from the printer panel's left edge
     (»  = "push it back to the right"). JS pins `right` to the panel width. */
  .pp-close-tab {
    position: fixed; z-index: 103; right: 0; top: 50%;
    transform: translateY(-50%);
    width: 30px; height: 88px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border: none; border-radius: 14px 0 0 14px;
    background: var(--primary); color: var(--on-accent);
    box-shadow: -6px 0 22px color-mix(in srgb, var(--primary) 45%, transparent);
    cursor: pointer; font-size: 19px; font-weight: 800; line-height: 1;
    transition: right .25s cubic-bezier(.4,0,.2,1), background .15s, width .15s, height .2s cubic-bezier(.34,1.45,.6,1);
  }
  .pp-close-tab[hidden] { display: none; }
  /* Long-press on a close tab → vertical fill, then "close all panels". */
  .pp-close-tab { overflow: hidden; }
  .cttab-fill {
    position: absolute; left: 0; right: 0; bottom: 0; height: 0%;
    background: var(--ink-30); pointer-events: none; z-index: 0;
  }
  .cttab-glyph { position: relative; z-index: 1; }
  /* `right` animates the push when panels open/close (smooth follow). During a
     live resize we kill it so panels + tabs track the dragged edge instantly. */
  body.panel-resizing .detail-panel,
  body.panel-resizing .pp-close-tab { transition: none; }
  /* While dragging a panel's width, the cursor often skims the close tab at the
     panel's edge — disable its pointer so it can't hover-grow or be clicked. */
  body.panel-resizing .pp-close-tab { pointer-events: none; }
  /* Hover: the tab stretches taller (with a slight overshoot) for clear feedback. */
  .pp-close-tab:hover { background: var(--primary-hover); width: 36px; height: 128px; }
  /* Tab z-index ladder — see the 3-layer note above. Each tab sits above the
     panel it overlaps (the one to its left) and below the panel to its right. */
  #detailCloseTab     { z-index: 102; } /* material tab — behind settings + printer */
  #matSourceCloseTab  { z-index: 97; }  /* add-material picker — leftmost card, so bottom of the ladder */
  #printerAddCloseTab { z-index: 104; } /* settings tab — over material, behind printer */
  #printerCloseTab    { z-index: 106; } /* printer tab — over settings (front-most) */
  /* Settings + Debug stack: Debug tab tucks BEHIND the Settings panel (102 <
     settings 103) so it slides in from the edge behind Settings, not over it;
     the Settings tab stays on top (104). */
  #debugCloseTab      { z-index: 102; }
  #settingsCloseTab   { z-index: 104; }
  /* Firebase Explorer stack tabs: each sits just above the panel it overlaps
     (the inner card to its left) and below the card to its right. Explorer tab
     (102) over Raw panel (101) + behind Settings (103); Raw tab (101) is
     backmost so it never floats over the Explorer/Settings cards. */
  #fseCloseTab        { z-index: 102; }
  #fseRawCloseTab     { z-index: 101; }
  /* Notifications open ALONE (openNotifs closes every other side card first), so
     its tab never overlaps another card — keep it BELOW them all (< group's 100)
     so that while it slides out (280ms), a side card opening in its place covers
     it instead of the tab floating on top. */
  #notifCloseTab      { z-index: 99; }
  /* resize handle — left edge of both panels */
  .panel-resize {
    position: absolute; top: 0; left: 0; bottom: 0; width: 6px;
    cursor: col-resize; z-index: 10;
    display: flex; align-items: center; justify-content: center;
  }
  .panel-resize::after {
    content: ""; display: block;
    width: 3px; height: 32px; border-radius: 2px;
    background: var(--border);
    transition: background .15s, width .15s;
  }
  .panel-resize:hover::after,
  .panel-resize.dragging::after { background: var(--primary); width: 4px; }
  /* disable slide transition while user is actively dragging */
  .detail-panel.resizing { transition: none; }
  .panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
  }
  .panel-header .panel-title {
    font-size: 15px; font-weight: 600;
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 8px;
    overflow: hidden;
  }
  /* Printer name itself can ellipsis; pills should never shrink. */
  .panel-header .panel-title #printerPanelTitle {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 0 1 auto;
    min-width: 0;
  }
  .pp-title-pills {
    display: inline-flex; align-items: center; gap: 6px;
    flex-shrink: 0;
  }
  .pp-title-pills:empty { display: none; }
  /* Title used by the printer detail panel: a status dot + the printer name +
     brand/model pills, all on one row. */
  .pp-title-col {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
  }
  .pp-title-row {
    display: flex; align-items: center; gap: 8px;
    width: 100%; min-width: 0;
    overflow: hidden;
  }
  /* Online status dot before the title — green + glow (pulsing) when online,
     flat grey when offline. Mirrors the grid card's name dot. */
  .pp-title-dot {
    width: 10.5px; height: 10.5px;
    border-radius: 50%;
    background: var(--neutral);          /* offline — fixed grey */
    flex-shrink: 0;
  }
  /* A cloud machine's status dot IS a cloud — same colour code, same heartbeat,
     different shape. It says how the printer is reached AND whether it answers,
     in one mark instead of two.

     THE GLYPH IS DRAWN BY THE PSEUDO-ELEMENT, not by the element itself, and
     that is the whole trick: masking is applied AFTER filtering, so a glow put
     on a masked element — `box-shadow` or `drop-shadow` alike — is clipped away
     with everything outside the silhouette and never shows. Leaving the element
     unmasked lets it carry the halo, exactly the one the round dot uses, while
     the cloud is painted on top. The icon is the FILLED cloud: masking an
     outline would paint only the outline, giving a hollow ring. */
  .pp-title-dot.is-cloud {
    position: relative;
    /* One dimension forced, the other derived — the project rule for anything
       masked, so the glyph can never be squashed. Square, because the halo
       behind it is a circle. */
    height: 13px; width: auto; aspect-ratio: 1;
    border-radius: 50%;
    background: transparent;
    /* No `box-shadow: none` here on purpose: the halo is the shared online
       rule's, so a cloud breathes exactly like a round dot and an offline one
       stays bare, with nothing to keep in step by hand. */
  }
  .pp-title-dot.is-cloud::before {
    content: ""; position: absolute; inset: 0;
    background: var(--neutral);
    -webkit-mask-image: url('../../assets/svg/icons/icon_cloud_filled.svg');
            mask-image: url('../../assets/svg/icons/icon_cloud_filled.svg');
    -webkit-mask-size: contain;  mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center;  mask-position: center;
  }
  .pp-title-dot.is-cloud.is-online {
    background: transparent;     /* beats the round rule's green fill */
    animation: printer-name-dot-pulse 1.8s ease-in-out 3;   /* then steady: a forever pulse kept the window re-compositing (#66) */
  }
  .pp-title-dot.is-cloud.is-online::before { background: var(--success); }

  .pp-title-dot.is-online {
    background: var(--success);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 18%, transparent);
    animation: printer-name-dot-pulse 1.8s ease-in-out 3;   /* then steady: a forever pulse kept the window re-compositing (#66) */
  }
  .pp-title-status {
    display: flex; align-items: center;
    /* Smaller font + muted look — secondary information beneath the name. */
    font-size: 11px; font-weight: 500;
  }
  .pp-title-status:empty { display: none; }
  /* Smaller variant for the pills when they sit in the header */
  .pp-brand-pill--sm {
    font-size: 10px;
    padding: 2px 9px;
  }
  .pp-model-pill--sm {
    font-size: 10px;
    padding: 1px 8px;
  }
  .panel-close { width: 32px; height: 32px; border: none; background: var(--surface-2); border-radius: 8px; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
  .panel-close:hover { background: var(--border); color: var(--text); }
  /* Action button in the panel header (e.g. ⚙ gear next to ✕). Same
     visual weight as panel-close but accent-able on hover. */
  .panel-action {
    width: 32px; height: 32px;
    margin-right: 6px;
    border: none;
    background: var(--surface-2);
    border-radius: 8px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted);
    flex-shrink: 0;
    transition: background .12s, color .12s, transform .05s;
  }
  .panel-action:hover { background: var(--border); color: var(--primary-text); }
  .panel-action:active { transform: scale(.95); }
  .panel-action .icon { background: currentColor; }
  .panel-body { flex: 1; overflow-y: auto; padding: 0 0 24px; }
  /* Material card: hide the scrollbar (content still scrolls). */
  #panelBody { scrollbar-width: none; }
  #panelBody::-webkit-scrollbar { width: 0; height: 0; }
  .panel-img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--surface-2); }
  /* Product card: the photo is inset so the spool colour painted on the wrap
     shows round it as a frame — same look as the grid cards. PADDING on the
     wrap, not a margin on the photo: the photo's top margin collapsed through
     the wrap, pushing the whole frame down and leaving the photo flush with its
     top edge. Padding in % is taken from the width, so the frame stays square. */
  #productCardPanel .panel-img-wrap:has(> .panel-img),
  #chipRestorePanel .panel-img-wrap:has(> .panel-img),
  #detailPanel .panel-img-wrap:has(> .panel-img) { padding: 7%; }
  #productCardPanel .panel-img-wrap > .panel-img,
  #chipRestorePanel .panel-img-wrap > .panel-img,
  #detailPanel .panel-img-wrap > .panel-img {
    border-radius: 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
    /* No backdrop of its own, like the grid card's overlay: a transparent
       product photo sits on the spool colour, not on a dark square. */
    background: none;
    opacity: 0; transition: opacity .25s ease;
  }
  #productCardPanel .panel-img-wrap > .panel-img.img-loaded,
  #chipRestorePanel .panel-img-wrap > .panel-img.img-loaded,
  #detailPanel .panel-img-wrap > .panel-img.img-loaded { opacity: 1; }
  .panel-img-placeholder { width: 100%; aspect-ratio: 1; background: linear-gradient(135deg,var(--surface-2),#2a1a0e); display: flex; align-items: center; justify-content: center; }
  .panel-img-placeholder img { width: 40%; opacity: .5; }
  .panel-img-color-placeholder { width: 100%; aspect-ratio: 1; display: flex; align-items: flex-start; justify-content: flex-end; overflow: hidden; }
  .panel-img-logo { width: 22%; margin: 4%; }
  .panel-section { padding: 10px 16px; }
  .panel-section + .panel-section { border-top: 1px solid var(--border); }
  .panel-identity { padding-bottom: 6px; }
  .pi-row1 { font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.4; }
  .pi-row2 { font-size: 13px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
  /* Name line — sits below Brand · Material, slightly more prominent. */
  .pi-row2--name { font-size: 14px; font-weight: 600; color: var(--text); margin-top: 3px; }
  /* Secondary message line — sits under a catalogue name (TigerTag+), so
     it's rendered lighter to read as an extra editable label, not a 2nd title. */
  .pi-name-msgline--secondary { margin-top: 1px; }
  .pi-name-msgline--secondary .pi-name-edit { font-size: 13px; font-weight: 500; color: var(--muted); }
  /* Inline-editable spool name (= `message` chip slot). Spans the full
     panel width: name text left (truncates), pencil pinned to the right. */
  .pi-name-edit {
    display: flex; width: 100%; align-items: center; gap: 8px;
    justify-content: space-between;
    margin: 0; padding: 2px 2px 2px 0;
    background: transparent; border: 0; border-radius: 6px;
    font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text);
    cursor: text; text-align: left;
    transition: background .12s ease;
  }
  .pi-name-edit:hover { background: color-mix(in srgb, var(--info) 10%, transparent); }
  .pi-name-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pi-name-edit .pi-name-pencil { background: var(--muted); flex-shrink: 0; opacity: .45; transition: opacity .12s ease; }
  .pi-name-edit:hover .pi-name-pencil { opacity: .9; }
  .pi-name-placeholder { color: var(--muted); font-style: italic; font-weight: 500; }
  .pi-name-editwrap { display: flex; flex-direction: column; gap: 3px; width: 100%; }
  .pi-name-input {
    width: 100%;
    font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text);
    padding: 2px 6px; border-radius: 6px;
    background: var(--surface-2); border: 1px solid color-mix(in srgb, var(--info) 50%, transparent);
    outline: none;
  }
  /* Byte-usage bar — no number, just a fill that tracks the 28-byte
     budget. Blue while there's room, amber near the limit, red when full. */
  .pi-name-bar {
    height: 3px; border-radius: 2px; overflow: hidden;
    background: var(--border);
  }
  .pi-name-bar-fill {
    display: block; height: 100%; width: 0%;
    background: color-mix(in srgb, var(--info) 85%, transparent);
    transition: width .1s linear, background .12s ease;
  }
  .pi-name-bar.is-high .pi-name-bar-fill { background: var(--warning); }
  .pi-name-bar.is-full .pi-name-bar-fill { background: var(--danger); }
  .panel-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; font-weight: 600; }

  /* Prominent price + buy-link block (above Details) */
  /* Price on the left, shop button filling the rest of the row. The label is never
     cut: when the button does not fit beside the price it drops to its own row,
     full width, instead of sitting right-aligned under it (that looked misaligned). */
  .det-buy .det-buy-body { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
  .det-buy-price { font-size: 16px; font-weight: 800; color: var(--text); display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; white-space: nowrap; }
  .det-buy-price .icon { background: var(--muted); flex-shrink: 0; }
  .det-buy-link {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 10px;
    border-radius: 10px; border: 1px solid var(--primary); background: var(--primary); color: var(--on-accent);
    font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: filter .15s; flex: 1 1 auto;
  }
  .det-buy-link:hover { filter: brightness(1.06); }
  .det-buy-link .icon { background-color: var(--on-accent); }

  /* Collapsible "Details" section in the spool detail panel */
  .panel-details .panel-details-head {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%;
    background: none; border: none; padding: 0;
    cursor: pointer; font: inherit; color: inherit;
    margin-bottom: 0;
    text-align: left;
  }
  .panel-details .panel-details-head .panel-label {
    margin-bottom: 0;
    transition: color .15s;
  }
  .panel-details .panel-details-head:hover .panel-label { color: var(--text); }
  .panel-details-chevron {
    font-size: 18px; line-height: 1;
    color: var(--muted);
    transition: transform .2s;
    margin-right: 2px;
  }
  .panel-details.open .panel-details-chevron { transform: rotate(90deg); }
  /* Smooth open/close — animate max-height + opacity rather than display
     so the content fades and slides in instead of popping. */
  .panel-details .panel-details-body {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    overflow: hidden;
    transition:
      max-height .28s cubic-bezier(.4, 0, .2, 1),
      opacity   .22s ease .04s,
      margin-top .28s cubic-bezier(.4, 0, .2, 1);
  }
  .panel-details.open .panel-details-body {
    max-height: 600px;        /* generous cap — covers all info rows + badges */
    opacity: 1;
    margin-top: 10px;
  }

  /* ── Chip pending banner (detail panel) ── */
  /* The detail card's banner slot (swapped alone when the TigerPOD's chips
     change — _refreshChipBanners); it adds no box of its own. */
  .dp-chip-banner { display: contents; }
  .chip-update-banner {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; background: var(--warning-soft);
    border-bottom: 1px solid var(--border); cursor: pointer;
  }

  .chip-update-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--warning); color: var(--on-accent); flex-shrink: 0;
  }
  .chip-update-icon .icon { color: var(--on-accent); }
  .rfid-material-icon {
    height: 52px; aspect-ratio: 1 / 1;
    border-radius: 8px; flex-shrink: 0; object-fit: cover;
  }
  .chip-update-text { font-size: 12px; color: var(--warning-text); flex: 1; }
  /* ── Cloud encode banner (replaces chip-update banner for Cloud spools) ── */
  .cloud-encode-banner { background: color-mix(in srgb, var(--violet) 7%, transparent); cursor: pointer; }
  .cloud-encode-icon   { background: var(--violet) !important; animation: cloud-nfc-pulse 2s ease-in-out infinite; }
  @keyframes cloud-nfc-pulse {
    0%, 100% { box-shadow: 0 0 0 0   color-mix(in srgb, var(--violet) 50%, transparent); }
    50%       { box-shadow: 0 0 0 6px color-mix(in srgb, var(--violet) 0%, transparent); }
  }
  /* Burning a chipless material is a gain, like linking a third-party Tag
     (rfid_protocol/linked): the same success green — banner and text. */
  .cloud-encode-banner.cloud-encode-banner { --burn: var(--success); background: color-mix(in srgb, var(--burn) 12%, transparent); }
  /* "Please update NFC": the same held banner in the warning orange — urgent,
     not a gain. Every colour below follows --burn. */
  .chip-update-banner--hold.chip-update-banner--hold { --burn: var(--warning); }
  /* "Upgrade to TigerTag+": the same banner in the TigerTag+ violet. */
  .chip-update-banner--plus.chip-update-banner--plus { --burn: var(--violet); }
  /* Erasing a chip (rfid_protocol/eraser): the same banner in red. */
  .chip-update-banner--danger.chip-update-banner--danger { --burn: var(--danger); }
  /* A logo in place of the RFID-material picture, white (the text colour: dark in
     the light theme) — the banner's own colour only glows around it. */
  .chip-banner-logo.chip-banner-logo { width: 46px; height: 36px; aspect-ratio: auto; border-radius: 0; background-color: var(--text); -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
  .chip-banner-logo--nfc.chip-banner-logo--nfc { --logo: url('../../assets/svg/icons/icon_rfid.svg'); }
  /* The values a spool link proposes (weight, else the note): what the banner saves. */
  .chip-banner-logo--scale.chip-banner-logo--scale { --logo: url('../../assets/svg/icons/icon_scale.svg'); }
  .chip-banner-logo--edit.chip-banner-logo--edit { --logo: url('../../assets/svg/icons/icon_edit.svg'); }
  /* "Add from the catalogue" under "Add with TigerTag(+)": the TigerSystem logo of the add chooser's tiles. */
  .chip-banner-logo--studio.chip-banner-logo--studio { --logo: url('../../assets/svg/logos/tigersystem-icon-framed-white.svg'); }
  /* "Add from QR code" under it: the spool is created, then opened on its QR label. */
  .chip-banner-logo--qr.chip-banner-logo--qr { --logo: url('../../assets/svg/icons/icon_qr.svg'); }
  .cloud-encode-banner .cloud-encode-text.cloud-encode-text { color: var(--burn); font-weight: 600; }
  /* Reader present: the banner itself is the (held) button, square like the
     panel's other bands, with a green fill. */
  .cloud-encode-banner--hold.cloud-encode-banner--hold { 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; }
  .cloud-encode-banner--hold > :not(.hold-progress) { position: relative; z-index: 1; }
  .cloud-encode-banner--hold .tool-info { margin-left: auto; }
  /* "Burning" feel: a glint sweeps across the band, the TigerTag logo glows, and
     while held the fill's leading edge burns bright. */
  .cloud-encode-banner--hold .hold-progress {
    background: linear-gradient(90deg, color-mix(in srgb, var(--burn) 18%, transparent), color-mix(in srgb, var(--burn) 50%, transparent));
    opacity: 1;
    box-shadow: 6px 0 14px color-mix(in srgb, var(--burn) 70%, transparent);
  }
  /* The chip is being rewritten on the TigerPOD (_autoUpdateChip): the fill runs by
     itself, as if the banner were held, slowing as it nears the end — the write is
     a second or two, its end is not known in advance. */
  .cloud-encode-banner--hold.is-busy { cursor: progress; }
  .cloud-encode-banner--hold.is-busy .hold-progress { animation: chip-busy-fill 2.4s cubic-bezier(.15, .7, .3, 1) forwards; }
  @keyframes chip-busy-fill { from { width: 0%; } to { width: 94%; } }
  .cloud-encode-banner--hold::after {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: linear-gradient(105deg, transparent 35%, color-mix(in srgb, var(--burn) 22%, transparent) 50%, transparent 65%);
    transform: translateX(-100%);
    animation: cloud-burn-sweep 2.6s ease-in-out infinite;
  }
  .cloud-encode-banner--hold .rfid-material-icon { animation: cloud-burn-glow 2s ease-in-out infinite; }
  .cloud-encode-banner--hold:hover .rfid-material-icon { animation-duration: .9s; }
  @keyframes cloud-burn-sweep { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
  @keyframes cloud-burn-glow {
    0%, 100% { filter: drop-shadow(0 0 0 transparent); }
    50%      { filter: drop-shadow(0 0 7px color-mix(in srgb, var(--burn) 85%, transparent)); }
  }
  /* While held (and confirming), only the burning fill glows: the sweep and the
     logo pulse stand down. */
  .cloud-encode-banner--hold:is(.is-holding, .is-confirming)::after { animation: none; opacity: 0; }
  .cloud-encode-banner--hold:is(.is-holding, .is-confirming) .rfid-material-icon { animation: none; filter: none; }
  /* Click-only banner (opens a card): it shines like the others until its card
     is open (.is-active) — then only the held banner of that card glows. */
  .cloud-encode-banner--click.is-active::after { display: none; }
  .cloud-encode-banner--click.is-active .rfid-material-icon.rfid-material-icon { animation: none; }
  .cloud-encode-banner--click .chip-banner-chev { background: var(--burn); flex-shrink: 0; transition: transform .15s; }
  .cloud-encode-banner--click .tool-info { margin-left: auto; }
  .cloud-encode-banner--click:hover .chip-banner-chev { transform: translateX(3px); }
  @media (prefers-reduced-motion: reduce) {
    .cloud-encode-banner--hold::after, .cloud-encode-banner--hold .rfid-material-icon { animation: none; }
  }

  /* ── Chip pending badge (table + grid) ── */
  .chip-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--warning); color: var(--on-accent);
    margin-left: 4px; vertical-align: middle; flex-shrink: 0;
  }
  .chip-badge .icon { color: var(--on-accent); }
  .card-chip-badge {
    position: absolute; top: 6px; right: 6px; margin: 0;
    width: 20px; height: 20px;
    border: 1.5px solid var(--ink-85);
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
  }
  .thumb-chip-badge {
    position: absolute; top: 2px; right: 2px; margin: 0;
    width: 14px; height: 14px;
    border: 1.5px solid var(--ink-85);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
  }
  .panel-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 5px; gap: 12px; }
  /* The label keeps its natural width; the value takes ALL the rest. A fixed
     `max-width` on the value used to cap it at 60% of the row, so a SKU wrapped
     onto two lines with half the row still empty next to a short label. */
  .panel-row .pk { color: var(--muted); flex: 0 0 auto; }
  /* Pictogram before the label in the spool card's Details rows. */
  .panel-details-body .panel-row .pk { display: inline-flex; align-items: center; gap: 10px; }
  .panel-details-body .panel-row .pk .icon { background: var(--muted); flex-shrink: 0; }
  /* `flex:1 1 auto` + `min-width:0` let it use the free space AND shrink;
     `overflow-wrap: anywhere` breaks a value that has no spaces at all (a SKU,
     a barcode), which otherwise ran off the right edge of the card. */
  .panel-row .pv { font-weight: 500; text-align: right; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
  /* Badge-valued row (e.g. "Type de tag" → tier badge + backup shield) — align
     the pill to the right, vertically centred with the key. */
  .panel-row .pv-badge { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; }
  .panel-row .pv a { color: var(--primary-text); text-decoration: none; }
  .panel-row .pv a:hover { text-decoration: underline; }
  /* Value cell that is itself a link (e.g. Product ID → tigertag.io). */
  .panel-row a.pv-link { color: var(--primary-text); text-decoration: none; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .panel-row a.pv-link:hover { text-decoration: underline; }
  .color-dots { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
  .color-dot { width: 24px; height: 24px; border-radius: 6px; border: 1px solid rgba(0,0,0,.1); }
  .temp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
  .temp-chip { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; }
  .temp-chip .tc-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
  .temp-chip .tc-value { font-size: 15px; font-weight: 600; margin-top: 2px; }
  .aspect-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
  .aspect-chip { padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
  /* Product card: aspects, refill/recycled/filled and the weight share one chip
     row under the name (no separate Aspect / Weight sections). */
  .pc-ident-chips { margin-top: 10px; }
  .aspect-chip--weight { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
  .aspect-chip--weight .icon { background-color: var(--muted); }
  /* Colour row (detail panel): label, one colorBg() swatch, and on a TigerData
     a pencil — the whole row opens the colour & TD editor. */
  .colour-row {
    width: 100%; display: flex; align-items: center; justify-content: flex-start; gap: 12px;
    padding: 0; border: none; background: none; color: inherit; font: inherit; text-align: left;
  }
  .colour-row .colour-row-label { margin: 0; }
  .colour-row-swatch {
    width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent);
  }
  /* A product's RAL / Pantone codes (_colorCodesChips): an aspect chip; RAL with a
     small swatch (approximate sRGB) and its name in the muted colour, Pantone as text. */
  .color-code-chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
  .color-code-dot { width: 10px; aspect-ratio: 1; border-radius: 50%; flex-shrink: 0;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 22%, transparent); }
  .color-code-name { color: var(--muted); font-weight: 500; }
  .colour-row { flex-wrap: wrap; row-gap: 6px; }
  .colour-row-edit { background: var(--muted); transition: background .15s; }
  .colour-row--edit { cursor: pointer; }
  .colour-row--edit:hover .colour-row-edit { background: var(--text); }

  /* ── Tags / Balises (detail panel) ── */
  .panel-tags .tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  /* Chips now sit BELOW the input (Shopify-style) → space above, not below. */
  .panel-tags .tag-chips:not(:empty) { margin-top: 8px; }
  /* Section header: label + edit pencil */
  .panel-tags .tags-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
  .panel-tags .tags-head .panel-label { margin: 0; }
  .tags-edit-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; padding: 0; border: none; border-radius: 7px;
    background: transparent; color: var(--muted); cursor: pointer;
    transition: background .12s, color .12s;
  }
  .tags-edit-btn:hover { background: var(--surface-2); color: var(--text); }
  .tags-edit-btn .icon { background: currentColor; }
  /* Input + custom autocomplete dropdown */
  .tags-input-wrap { position: relative; }
  .tags-dd {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
    max-height: 260px; overflow-y: auto; padding: 4px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,.18);
  }
  .tags-dd-create, .tags-dd-opt {
    display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; height: auto;
    padding: 7px 8px; border: none; border-radius: 7px;
    background: transparent; color: var(--text); font-size: 13px; font-weight: 500; text-align: left; cursor: pointer;
  }
  .tags-dd-create:hover, .tags-dd-opt:hover { background: var(--surface-2); }
  .tags-dd-create { color: var(--primary-text); font-weight: 600; }
  .tags-dd-create .icon { background: var(--primary); }
  .tags-dd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tags-dd-check {
    flex-shrink: 0; width: 16px; height: 16px; border-radius: 4px; position: relative;
    border: 1.5px solid var(--border); background: var(--surface);
  }
  .tags-dd-opt.is-checked .tags-dd-check { background: var(--primary); border-color: var(--primary); }
  .tags-dd-opt.is-checked .tags-dd-check::after {
    content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
  }

  /* ── "Add tags" modal (Shopify-style) ── */
  .tags-modal { width: min(460px, 92vw); max-height: 82vh; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
  /* Grey header bar (clipped to the card's rounded top corners via overflow:hidden). */
  .tags-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
  .tags-modal-title { font-size: 15px; font-weight: 700; color: var(--text); }
  .tags-modal-close { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border: none; background: transparent; border-radius: 7px; cursor: pointer; color: var(--muted); }
  .tags-modal-close:hover { background: var(--surface-2); color: var(--text); }
  .tags-modal-close .icon { background: currentColor; }
  /* Compact search field (fixed height, white, single offset focus ring). */
  .tags-modal-search {
    display: flex; align-items: center; gap: 8px; margin: 12px 18px 6px;
    height: 38px; padding: 0 12px; box-sizing: border-box;
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  }
  /* ONE clean focus indicator: an outline offset 2px outside, like Shopify —
     not a border-colour change + a native ring. */
  .tags-modal-search:focus-within { border-color: var(--primary); outline: 2px solid var(--primary); outline-offset: 2px; }
  .tags-modal-search .icon { background: var(--muted); flex-shrink: 0; }
  .tags-modal-search input { flex: 1; min-width: 0; height: 100%; border: none; background: transparent; outline: none; box-shadow: none; font-size: 14px; color: var(--text); }
  /* Clear-search button — a ✕ in a round grey chip, like Shopify. */
  .tags-modal-clear {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; padding: 0; flex-shrink: 0; border: none; border-radius: 50%;
    background: var(--muted); cursor: pointer; transition: background .12s;
  }
  .tags-modal-clear:hover { background: var(--text); }
  .tags-modal-clear .icon { background: var(--on-accent); }
  .tags-modal-body { flex: 1; overflow-y: auto; padding: 0 12px 8px; }
  .tags-modal-sec { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 6px 4px; }
  .tags-modal-create, .tags-modal-opt {
    display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; height: auto;
    padding: 9px 8px; border: none; border-radius: 8px; background: transparent;
    color: var(--text); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
  }
  .tags-modal-create:hover, .tags-modal-opt:hover { background: var(--surface-2); }
  .tags-modal-create { color: var(--primary-text); font-weight: 600; }
  .tags-modal-create .icon { background: var(--primary); }
  .tags-modal-check {
    flex-shrink: 0; width: 18px; height: 18px; border-radius: 4px; position: relative;
    border: 1.5px solid var(--border); background: var(--surface);
  }
  .tags-modal-check.is-checked { background: var(--primary); border-color: var(--primary); }
  .tags-modal-check.is-checked::after {
    content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 9px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
  }
  .tags-modal-optlabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tags-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); }
  .tag-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 14px;
    background: var(--surface-2); border: 1px solid var(--border);
    font-size: 12px; color: var(--text); line-height: 1.5;
  }
  .tag-chip:has(.tag-chip-x) { padding-right: 5px; }
  .tag-chip-x {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; padding: 0; border: none; border-radius: 50%;
    background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; line-height: 1;
    transition: background .12s, color .12s;
  }
  .tag-chip-x:hover { background: var(--danger); color: var(--on-accent); }
  .tag-input {
    width: 100%; box-sizing: border-box; padding: 7px 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    font-size: 13px; color: var(--text); outline: none;
  }
  .tag-input:focus { border-color: var(--primary); }
  /* aspect / info chips row (the colour circle is gone — the photo frame shows it) */
  .color-aspect-row { display: flex; align-items: flex-start; gap: 12px; margin-top: 6px; }
  .aspect-col { flex: 1; }
  .aspect-col .aspect-chips { margin-top: 0; }
  .links-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
  .link-btn {
    height: 30px; padding: 0 10px; font-size: 12px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer; text-decoration: none;
    color: var(--text); display: inline-flex; align-items: center; gap: 6px;
    font-family: inherit; font-weight: 500; transition: background .13s, border-color .13s, color .13s;
  }
  .link-btn:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text); }
  .link-btn svg { flex-shrink: 0; opacity: .7; }
  .link-btn:hover svg { opacity: 1; }
  .weight-mode-hint { font-size: 11px; color: var(--muted); margin: 6px 0 8px; line-height: 1.5; }
  .weight-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 4px; }
  .weight-form input { flex: 1; }
  .weight-manual-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
  .weight-manual-row input { width: 110px; flex: none; }
  .weight-bar-wrap { margin-top: 10px; }
  .weight-bar-wrap .wb-labels { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
  .weight-bar-wrap .wb-val { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
  .weight-bar-wrap .wb-val span { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 2px; }
  .weight-bar-wrap .wb-cap { font-size: 12px; color: var(--muted); }
  /* Remaining length of a filament spool, estimated from the weight (filamentLengthM). */
  .weight-bar-wrap .wb-len { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .weight-bar-wrap .wb-track {
    position: relative; height: 10px;
    background: var(--surface-2); border-radius: 5px; overflow: visible;
  }
  .weight-bar-wrap .wb-val-group {
    display: flex; align-items: center; gap: 6px;
  }
  /* Always visible: a pencil that only shows on hover was never found. */
  .wb-edit-open {
    background: none; border: none; padding: 4px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; flex-shrink: 0;
  }
  .wb-edit-open .icon { background: var(--muted); transition: background .15s; }
  .wb-edit-open:hover .icon { background: var(--primary); }
  .weight-bar-wrap.is-editing .wb-edit-open .icon { background: var(--primary); }
  /* Edit mode swaps contents in place at the same height, so nothing below the
     section moves: the input row takes the value row (both 34 px), the Net /
     On scale switch and its hint take the slider + 0 g / max line (31 px). */
  .weight-bar-wrap .wb-labels { min-height: 34px; }
  .weight-bar-wrap .wb-minmax {
    display: flex; justify-content: space-between; margin-top: 5px;
    font-size: 11px; line-height: 16px; color: var(--muted);
  }
  .wb-edit-bottom { display: none; height: 31px; align-items: center; gap: 10px; min-width: 0; }
  .weight-bar-wrap.is-editing .wb-track,
  .weight-bar-wrap.is-editing .wb-minmax { display: none; }
  .weight-bar-wrap.is-editing .wb-edit-bottom { display: flex; }
  .weight-bar-wrap.is-editing .wb-cap { white-space: nowrap; }
  /* Weight section label — flex row so the saved-confirmation check sits to
     the right of the "Poids" / "Weight" label instead of inside the value row.
     Override the default margin-bottom: 8px just enough to keep the original
     vertical rhythm regardless of the check's animation transform. */
  .panel-label--weight {
    display: flex; align-items: center; gap: 8px;
  }
  /* Saved-confirmation check — pops in green next to the section title after
     a successful weight write, holds briefly, fades out. Replaces the verbose
     "✓ N g available (G g − C g container)" toast. */
  .wb-saved-check {
    display: inline-block; width: 18px; height: 18px; flex-shrink: 0;
    background-color: var(--success);
    -webkit-mask-image: url('../../assets/svg/icons/icon_check.svg');
            mask-image: url('../../assets/svg/icons/icon_check.svg');
    -webkit-mask-size: 80%;  mask-size: 80%;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center;  mask-position: center;
    opacity: 0; transform: scale(0);
    pointer-events: none;
  }
  .wb-saved-check.show {
    animation: wb-check-pop 1.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  @keyframes wb-check-pop {
    /* Phase 1 — pop in (~0-280 ms): scale 0 → 1.3 with opacity 0 → 1 */
    0%   { opacity: 0; transform: scale(0); }
    20%  { opacity: 1; transform: scale(1.3); }
    /* Phase 2 — settle (~280-490 ms): bounce back to 1 */
    35%  { transform: scale(1); }
    /* Phase 3 — gradual fade (~700-1400 ms): opacity 1 → 0 over the full
       second half, slight scale-down to feel like it's "retiring" rather
       than vanishing. Wider window than the previous 25 % so the fade
       reads as smooth instead of a hard cut. */
    50%  { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.85); }
  }
  /* Manual entry: input + unit + ✓ ✕ in the value row. */
  .wb-inline-edit { display: flex; align-items: center; }
  .wb-inline-row { display: flex; align-items: center; gap: 6px; }
  /* The unit sits inside the field, right-aligned. */
  .wb-inline-field { position: relative; display: inline-flex; }
  .wb-inline-unit {
    position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
    font-size: 12px; color: var(--muted); pointer-events: none;
  }
  .weight-bar-wrap #sliderDisplay { cursor: text; }
  .wb-inline-edit input {
    width: 96px; height: 34px; box-sizing: border-box; padding: 0 22px 0 9px; font-size: 20px; font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: var(--surface-2); border: 1.5px solid var(--primary);
    border-radius: 6px; color: var(--text); outline: none;
    -moz-appearance: textfield;
  }
  .wb-inline-edit input::-webkit-outer-spin-button,
  .wb-inline-edit input::-webkit-inner-spin-button { -webkit-appearance: none; }
  .wb-inline-ok, .wb-inline-cancel {
    width: 34px; height: 34px; padding: 0; border-radius: 8px; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0; font-size: 13px;
    transition: background .15s, color .15s;
  }
  .wb-inline-ok     { background: var(--primary-soft); }
  .wb-inline-ok .icon { background: var(--primary); }
  .wb-inline-ok:hover { background: var(--primary); }
  .wb-inline-ok:hover .icon { background: var(--on-accent); }
  .wb-inline-cancel { background: var(--surface-2); }
  .wb-inline-cancel .icon { background: var(--muted); }
  .wb-inline-cancel:hover { background: var(--border); }
  .wb-inline-cancel:hover .icon { background: var(--text); }
  /* Net/Balance segmented toggle inside the inline editor. */
  /* Net / On scale: where "0 g" sits at rest. Quiet selected state (soft
     accent) so the ✓ stays the one strong action of the row above. */
  .wb-mode-toggle {
    position: relative; display: inline-flex; gap: 2px;
    background: var(--surface-2); border-radius: 7px; padding: 2px;
    flex-shrink: 0;
  }
  /* Sliding highlight under the active segment (placed by _wbMoveThumb). */
  .wb-mode-thumb {
    position: absolute; top: 2px; left: 2px; height: 22px; width: 0;
    border-radius: 5px; background: var(--primary-soft);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 45%, transparent);
    transition: transform .22s cubic-bezier(.4, 0, .2, 1), width .22s cubic-bezier(.4, 0, .2, 1);
    pointer-events: none;
  }
  .wb-mode-thumb.no-anim { transition: none; }
  @media (prefers-reduced-motion: reduce) { .wb-mode-thumb { transition: none; } }
  .wb-mode-btn {
    position: relative; z-index: 1; height: 22px; padding: 0 10px; border: none; background: transparent;
    color: var(--muted); font-size: 10.5px; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase;
    border-radius: 5px; cursor: pointer;
    transition: color .2s;
  }
  .wb-mode-btn:hover { color: var(--text); }
  .wb-mode-btn.active { color: var(--primary-text); }
  /* The calculation, where the max ("1000 g") sits at rest; the result reads first. */
  .wb-mode-hint {
    flex: 1; min-width: 0; text-align: right;
    font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .wb-mode-hint strong { color: var(--text); font-weight: 700; }
  .weight-bar-wrap .wb-fill {
    height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-hi));
    border-radius: 5px; pointer-events: none; transition: width .08s;
  }
  .weight-bar-wrap input[type="range"] {
    position: absolute; inset: 0; width: 100%; height: 100%;
    -webkit-appearance: none; appearance: none;
    background: transparent; cursor: pointer;
    margin: 0; padding: 0; border: none; outline: none;
  }
  .weight-bar-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
    background: var(--surface); border: 3px solid var(--primary);
    box-shadow: 0 1px 6px color-mix(in srgb, var(--primary) 50%, transparent); cursor: grab;
  }
  .weight-bar-wrap input[type="range"]:active::-webkit-slider-thumb { cursor: grabbing; }
  .weight-bar-wrap input[type="range"]::-moz-range-thumb {
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--surface); border: 3px solid var(--primary);
    box-shadow: 0 1px 6px color-mix(in srgb, var(--primary) 50%, transparent); cursor: grab;
  }

  /* ── debug ── */
  details.debug summary { cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; user-select: none; display: flex; align-items: center; gap: 8px; }
  details.debug summary::-webkit-details-marker { display: none; }
  details.debug summary::before { content: "▸"; font-size: 10px; transition: transform .15s; }
  details.debug[open] summary::before { transform: rotate(90deg); }
  .debug-meta { margin: 10px 0 6px; font-size: 12px; color: var(--muted); font-family: var(--mono); word-break: break-all; }
  pre.json { margin: 0; padding: 12px; background: var(--code-bg); color: #e7ebf3; border-radius: var(--radius-sm); font-family: var(--mono); font-size: 12.5px; line-height: 1.5; overflow: auto; max-height: 360px; }
  pre.json .k { color: #ffb45b; } pre.json .s { color: #b8e1a8; } pre.json .n { color: #7fb6ff; } pre.json .b { color: #ff8aa3; }
  .raw-tabs { display: flex; gap: 4px; margin: 10px 0 6px; }
  .raw-tab { height: 26px; padding: 0 10px; font-size: 11px; font-family: var(--mono); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
  .raw-tab.active { background: var(--primary); border-color: var(--primary); color: var(--on-accent); }
  .raw-tab:hover:not(.active) { background: var(--border); color: var(--text); }

  /* ── password field with inline eye ── */
  .pass-wrap { position: relative; }
  .pass-input { -webkit-text-security: disc; padding-right: 38px !important; }
  .pass-input--wide { padding-right: 68px !important; }
  .pass-input.revealed { -webkit-text-security: none; }
  .pass-eye {
    position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; padding: 0;
    border: none; background: transparent;
    color: var(--muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: color .15s;
  }
  /* when copy button is also present, shift eye left */
  .pass-eye--shift { right: 35px; }
  /* fix: prevent active-state press from shifting the button */
  .pass-eye:active, .pass-copy:active { transform: translateY(-50%) !important; }
  .pass-eye:hover { color: var(--text) !important; background: transparent !important; }
  /* copy button — same base style as eye */
  .pass-copy {
    position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; padding: 0;
    border: none; background: transparent;
    color: var(--muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: color .15s;
  }
  .pass-copy:hover { color: var(--text) !important; background: transparent !important; }
  .pass-copy.copied { color: var(--success-text) !important; }
  /* dark-context eye (sidebar / add-modal when inheriting dark styles) */
  .eac-eye.pass-eye, .eac-eye.pass-copy { color: var(--muted); }
  .eac-eye.pass-eye:hover, .eac-eye.pass-copy:hover { color: var(--text) !important; }

  /* ── lang select ── */
  .lang-select {
    width: 100%; height: 40px; padding: 0 32px 0 12px;
    border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7287' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center;
    color: var(--text); font-size: 14px; font-family: inherit; cursor: pointer;
    appearance: none; -webkit-appearance: none;
    transition: border-color .15s;
  }
  .lang-select:focus { outline: none; border-color: var(--primary); }

  /* ── update banner ── */
  .update-banner {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: var(--surface-2); color: var(--on-dark); border-radius: var(--radius);
    padding: 12px 18px; display: flex; align-items: center; gap: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,.35); z-index: 200;
    font-size: 13px; white-space: nowrap;
    animation: slideUp .25s cubic-bezier(.4,0,.2,1);
  }
  .update-banner .ub-icon { font-size: 22px; align-self: center; line-height: 1; }
  .update-banner .ub-body { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
  .update-banner .ub-text { color: var(--ink-70); line-height: 1.25; }
  .update-banner .ub-text strong { color: var(--text); }
  .update-banner .ub-sub { color: var(--ink-60); font-size: 12px; }
  .update-banner .ub-sub.hidden,
  .update-banner .ub-progress.hidden { display: none; }
  .update-banner .ub-progress {
    height: 5px; border-radius: 3px; overflow: hidden;
    background: var(--ink-15);
  }
  .update-banner .ub-progress-fill {
    display: block; height: 100%; width: 0%; border-radius: 3px;
    background: var(--primary); transition: width .3s ease;
  }
  /* Pre-progress phase (status 'available', no percent yet): looping sweep. */
  .update-banner .ub-progress--indeterminate .ub-progress-fill {
    width: 35%; transition: none;
    animation: ubIndeterminate 1.1s ease-in-out infinite;
  }
  @keyframes ubIndeterminate {
    0%   { margin-left: -35%; }
    100% { margin-left: 100%; }
  }
  @keyframes slideUp { from { opacity:0; transform: translateX(-50%) translateY(12px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }

  #debugPanel .panel-body { overflow: hidden; }
  #debugBody { flex: 1; min-height: 0; max-height: none !important; }
  #fsExplPre  { flex: 1; min-height: 0; max-height: none !important; }
  /* debug tabs */
  .dbg-tabs {
    display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0;
  }
  .dbg-tab {
    flex: 1; padding: 9px 0; font-size: 12px; font-weight: 600;
    background: none; border: none; border-bottom: 2px solid transparent;
    color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s;
    margin-bottom: -1px;
  }
  .dbg-tab.active { color: var(--primary-text); border-bottom-color: var(--primary); }
  .dbg-tab:hover:not(.active) { color: var(--text); }
  .dbg-pane { min-height: 0; }

  .dbg-select {
    padding: 6px 8px; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 8px; font-size: 12px; color: var(--text); outline: none; cursor: pointer;
  }
  .dbg-select:focus { border-color: var(--primary); }
  /* Which database is being browsed — a segmented pair above the chips. Two
     services, not two views of one, so the switch reads as a place you go. */
  .fse-src { display: flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--surface-2); align-self: flex-start; flex-shrink: 0; }
  .fse-src-btn {
    border: 0; background: transparent; color: var(--muted);
    font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 7px; cursor: pointer;
    transition: background .12s, color .12s;
  }
  .fse-src-btn:hover { color: var(--text); }
  .fse-src-btn.is-on { background: var(--surface); color: var(--text); }

  .fse-chips { display: flex; flex-wrap: wrap; gap: 5px; flex-shrink: 0; }
  .fse-chip {
    padding: 3px 9px; font-size: 11px; font-weight: 600;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 20px; color: var(--muted); cursor: pointer;
    transition: border-color .12s, color .12s;
  }
  .fse-chip:hover { border-color: var(--primary); color: var(--primary-text); }

  /* ── Firebase Explorer — dedicated side card, optimised for browsing ── */
  /* Dark dev-tool theme — force BOTH cards dark regardless of the app theme by
     redefining the surface/text vars locally, so every child component (header,
     chips, fields, inputs, close button…) inherits the dark palette for free. */
  #fseExplorerPanel, #fseRawPanel {
    --surface:   #12161d;
    --surface-2: #1b212c;
    --border:    var(--ink-08);
    --text:      #e7ebf3;
    --muted:     #8b95a7;
    color: var(--text);
  }
  /* Gate the shadow on `.open` (like every other side panel). These two panels
     are always in the DOM and sit off-screen right (translateX(100%)) when closed;
     an unconditional shadow leaked a dark band onto the window's right edge. */
  #fseExplorerPanel.open, #fseRawPanel.open { box-shadow: -12px 0 44px rgba(0,0,0,.4); }
  #fseExplorerPanel .panel-header, #fseRawPanel .panel-header { background: #0e1219; }
  #fseExplorerPanel .panel-close,  #fseRawPanel .panel-close  { color: var(--muted); }
  #fseExplorerPanel .panel-close:hover, #fseRawPanel .panel-close:hover { color: var(--text); }
  /* dark, slim scrollbars inside both cards */
  #fseExplorerPanel ::-webkit-scrollbar, #fseRawPanel ::-webkit-scrollbar { width: 10px; height: 10px; }
  #fseExplorerPanel ::-webkit-scrollbar-track, #fseRawPanel ::-webkit-scrollbar-track { background: transparent; }
  #fseExplorerPanel ::-webkit-scrollbar-thumb, #fseRawPanel ::-webkit-scrollbar-thumb {
    background: var(--ink-12); border-radius: 6px; border: 2px solid transparent; background-clip: content-box;
  }
  #fseExplorerPanel ::-webkit-scrollbar-thumb:hover, #fseRawPanel ::-webkit-scrollbar-thumb:hover {
    background: var(--ink-20); background-clip: content-box;
  }
  /* header action group (copy + close on the Raw card) */
  .fse-head-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
  /* accent the card titles */
  .fse-title-icon { background-color: var(--primary); }
  .fse-title-braces { font-family: var(--mono); font-size: 13px; font-weight: 800; color: var(--primary-text); letter-spacing: -1px; }

  #fseExplorerPanel { width: 400px; }  /* roomier default than the 300px base (still user-resizable) */
  .fse-wrap { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; flex: 1; min-height: 0; overflow: hidden; }

  /* toolbar: breadcrumb (scrolls) + icon actions */
  .fse-toolbar { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
  .fse-iconbtn {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 26px; height: 26px; padding: 0; border-radius: 7px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); cursor: pointer;
    transition: color .12s, border-color .12s;
  }
  .fse-iconbtn:hover { color: var(--primary-text); border-color: var(--primary); }
  .fse-iconbtn.is-on { color: var(--primary-text); border-color: var(--primary); }
  .fse-iconbtn--text { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: -.5px; }
  .fse-iconbtn.is-spinning .icon { animation: fse-spin .7s linear infinite; }

  /* Raw JSON — third side card */
  #fseRawPanel { width: 360px; }
  .fse-raw-wrap { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; flex: 1; min-height: 0; overflow: hidden; }
  .fse-raw-meta { flex-shrink: 0; font-family: var(--mono); font-size: 11px; color: var(--muted); word-break: break-all; }
  .fse-raw-meta:empty { display: none; }
  /* doubled selector (pre.json = 0,1,1) so `max-height:none` actually wins and
     the pre fills the panel height instead of capping at the base 360px. */
  pre.json.fse-raw-pre { flex: 1; min-height: 0; max-height: none; margin: 0; overflow: auto; }

  /* manual path bar */
  .fse-bar { display: flex; align-items: center; gap: 6px; flex-shrink: 0; position: relative; }
  .fse-bar-icon { position: absolute; left: 9px; background-color: var(--muted); pointer-events: none; }
  .fse-input {
    flex: 1; padding: 6px 9px 6px 28px; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--text); outline: none;
  }
  .fse-input:focus { border-color: var(--primary); }

  /* breadcrumb — each segment navigates to its prefix path */
  .fse-crumbs { flex: 1; min-width: 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 1px; overflow-x: auto; scrollbar-width: none; font-family: var(--mono); font-size: 11px; }
  .fse-crumbs::-webkit-scrollbar { display: none; }
  .fse-crumb {
    flex-shrink: 0; padding: 2px 6px; background: none; border: none; border-radius: 6px;
    color: var(--muted); cursor: pointer; font-family: inherit; font-size: inherit; white-space: nowrap;
    transition: background .12s, color .12s;
  }
  .fse-crumb:hover { background: var(--surface-2); color: var(--primary-text); }
  .fse-crumb--last { color: var(--text); font-weight: 600; }
  .fse-crumb-sep { flex-shrink: 0; color: var(--muted); opacity: .5; }

  /* meta bar: type badge + count + filter / raw toggle */
  .fse-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; min-height: 22px; font-size: 11px; color: var(--muted); }
  .fse-meta:empty { display: none; }
  .fse-badge { padding: 2px 7px; border-radius: 5px; font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
  .fse-badge--doc { background: color-mix(in srgb, #7fb6ff 22%, transparent); color: #7fb6ff; }
  .fse-badge--col { background: color-mix(in srgb, var(--primary) 22%, transparent); color: var(--primary-text); }
  .fse-spacer { flex: 1; }
  .fse-filter {
    width: 120px; padding: 3px 8px; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 6px; font-size: 11px; color: var(--text); outline: none;
  }
  .fse-filter:focus { border-color: var(--primary); }
  .fse-rawtoggle {
    padding: 3px 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
    color: var(--muted); font-family: var(--mono); font-size: 10.5px; cursor: pointer; transition: color .12s, border-color .12s;
  }
  .fse-rawtoggle:hover, .fse-rawtoggle.is-on { color: var(--primary-text); border-color: var(--primary); }

  /* result area — fills the panel and scrolls */
  .fse-result { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 5px; }
  .fse-result pre.json { max-height: none; }

  /* states */
  .fse-empty { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-family: var(--mono); padding: 14px 4px; }
  .fse-empty--error { color: #ff8aa3; }
  .fse-spin { width: 13px; height: 13px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: fse-spin .7s linear infinite; flex-shrink: 0; }
  @keyframes fse-spin { to { transform: rotate(360deg); } }

  /* field table (document view) */
  .fse-fields { display: flex; flex-direction: column; }
  .fse-field { display: grid; grid-template-columns: minmax(84px, 36%) 1fr; gap: 12px; padding: 7px 6px; border-radius: 6px; border-bottom: 1px solid var(--ink-04); transition: background .1s; }
  .fse-field:last-child { border-bottom: none; }
  .fse-field:hover { background: var(--ink-04); }
  .fse-field-k { font-family: var(--mono); font-size: 11px; color: var(--muted); word-break: break-word; }
  .fse-field-v { font-size: 11.5px; color: var(--text); min-width: 0; word-break: break-word; }
  .fse-v--null { color: var(--muted); font-style: italic; }
  .fse-v--num { font-family: var(--mono); color: #7fb6ff; }
  .fse-v--str { font-family: var(--mono); color: #b8e1a8; }
  .fse-v--long { cursor: help; }
  .fse-v--ts { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); color: #ffb45b; }
  .fse-v--bool { padding: 1px 7px; border-radius: 4px; font-family: var(--mono); font-size: 10.5px; font-weight: 700; }
  .fse-v--true  { background: color-mix(in srgb, #b8e1a8 22%, transparent); color: #b8e1a8; }
  .fse-v--false { background: color-mix(in srgb, #ff8aa3 18%, transparent); color: #ff8aa3; }
  pre.json.fse-v--json { margin: 2px 0 0; padding: 8px; font-size: 11px; }

  /* collection rows — collapsible, clickable doc id, live preview */
  .fse-doc { border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--surface); flex-shrink: 0; }
  .fse-doc-head { display: flex; align-items: center; gap: 6px; padding: 5px 8px; }
  .fse-doc-toggle {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 18px; height: 18px; padding: 0; background: none; border: none; color: var(--muted); cursor: pointer;
  }
  .fse-doc-toggle .icon { transition: transform .15s; }
  .fse-doc.is-open .fse-doc-toggle .icon { transform: rotate(90deg); }
  .fse-doc-toggle:hover { color: var(--primary-text); }
  .fse-doc-id {
    flex-shrink: 0; max-width: 55%; padding: 0; background: none; border: none;
    color: var(--text); font-family: var(--mono); font-size: 11.5px; font-weight: 600; cursor: pointer;
    text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .12s;
  }
  .fse-doc-id:hover { color: var(--primary-text); text-decoration: underline; }
  .fse-doc-preview { flex: 1; min-width: 0; font-family: var(--mono); font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* virtual brand folders (printers view): folder icon instead of a chevron */
  .fse-doc-folder { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex-shrink: 0; color: var(--primary-text); }
  .fse-doc--empty { opacity: .45; }
  .fse-doc--empty .fse-doc-folder { color: var(--muted); }
  .fse-doc-body { padding: 2px 10px 8px; border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }

  .hidden { display: none !important; }
  .gap-1 { gap: 8px; }
  .footer-note { margin-top: 24px; text-align: center; color: var(--muted); font-size: 12px; }

  /* ── panel image overlay badges ── */
  .panel-img-wrap { position: relative; }

  /* ── custom image URL bar ──
     Lives in the BL corner of panel-img-wrap (absolute).
     CLOSED: pill shows only the trigger icon (auto-width).
     OPEN (.open class): expands right-to-left to full width;
       input is visible, confirm button appears on the right edge.
     The trigger IS the left anchor of the pill — looks like it's
     "inside" the field, aligned to the left. */
  .custom-img-bar {
    position: absolute; z-index: 5;
    bottom: 10px; left: 10px;
    display: flex; align-items: center;
    height: 32px;
    background: rgba(0,0,0,.60); backdrop-filter: blur(8px);
    border: 1px solid var(--ink-20);
    border-radius: 999px;
    overflow: hidden;
    /* closed: shrinks to trigger width only */
    max-width: 32px;
    transition: max-width .2s ease, right .2s ease;
  }
  .custom-img-bar.open {
    /* expand to fill available width */
    max-width: calc(100% - 20px); /* 10px each side */
    right: 10px;
  }
  /* trigger — edit icon, left side of the pill */
  .custom-img-trigger {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; flex-shrink: 0;
    background: transparent; border: 0;
    cursor: pointer;
  }
  .custom-img-trigger .icon { background: var(--ink-70); transition: background .12s; }
  .custom-img-trigger:hover .icon { background: var(--on-accent); }
  /* input — transparent, fills remaining space; no border at all */
  .custom-img-input {
    flex: 1; min-width: 0; height: 100%;
    padding: 0 4px 0 0;
    background: transparent; border: 0; outline: 0;
    box-shadow: none; -webkit-box-shadow: none;
    -webkit-appearance: none; appearance: none;
    color: var(--text); font-size: 12px; font-family: inherit;
    caret-color: var(--primary);
    /* hidden when bar is closed */
    opacity: 0; pointer-events: none; width: 0;
    transition: opacity .15s .05s;
  }
  .custom-img-input:focus {
    outline: 0; box-shadow: none; -webkit-box-shadow: none;
  }
  .custom-img-bar.open .custom-img-input {
    opacity: 1; pointer-events: auto; width: auto;
  }
  .custom-img-input::placeholder { color: var(--ink-40); }
  /* confirm button — circle floating inside the pill on the right,
     with margin so it never touches the pill border */
  .custom-img-ok {
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    width: 24px; height: 24px; margin-right: 4px;
    border-radius: 50%;
    background: var(--primary); border: 0;
    cursor: pointer;
    /* hidden when bar is closed */
    opacity: 0; pointer-events: none; max-width: 0; margin-right: 0;
    transition: opacity .15s .05s, background .12s, max-width .15s, margin-right .15s;
  }
  .custom-img-bar.open .custom-img-ok {
    opacity: 1; pointer-events: auto; max-width: 24px; margin-right: 4px;
  }
  .custom-img-ok:hover { background: #1d4ed8; }
  .custom-img-ok .icon { background: var(--on-accent); }
  .panel-img-badge { position: absolute; z-index: 2; top: 10px; pointer-events: none; }
  .panel-img-badge--tl { left: 10px; }
  .panel-img-badge--tr { right: 10px; }
  .panel-img-badge--bl { left: 10px; top: auto; bottom: 10px; }
  /* The top-left stack of a panel illustration: tier, then Refill, twin, backup —
     the corners every illustration shares (see `buildPanelHTML`). */
  .panel-img-badge-group { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 0; background: none !important; }
  .panel-img-badge-item { position: static; pointer-events: auto; }
  .panel-img-icon-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%;
    border: 1.5px solid var(--ink-85);
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
    padding: 0; margin: 0; font-size: 0; letter-spacing: 0;
  }
  .panel-img-icon-badge .icon { color: var(--on-accent); }
  .panel-img-backup-badge { background: linear-gradient(135deg,var(--success-hover),var(--success)); }
  .panel-td-badge {
    background: var(--scrim); color: var(--ink-85);
    font-size: 11px; font-weight: 700; padding: 3px 9px;
    border-radius: 99px; letter-spacing: .03em;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  }
  /* TD badge — sits on a PHOTO, whose colours the theme knows nothing about,
     so its colours are fixed rather than themed: a dark frosted pill with white
     text and a hairline ring reads on black, white and busy photos alike. (The
     themed ink went dark-on-dark in light mode and vanished.) */
  .card-td-badge {
    position: absolute; bottom: 6px; left: 6px; z-index: 2;
    background: rgba(0, 0, 0, .52); color: #fff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .22);
    text-shadow: 0 1px 1px rgba(0, 0, 0, .35);
    font-size: 10px; font-weight: 700; padding: 2px 8px;
    border-radius: 99px; letter-spacing: .03em; pointer-events: none;
    backdrop-filter: blur(6px) saturate(1.2); -webkit-backdrop-filter: blur(6px) saturate(1.2);
  }
  .thumb-td-badge {
    position: absolute; bottom: 2px; left: 2px; z-index: 2;
    background: rgba(0, 0, 0, .55); color: #fff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .2);
    font-size: 7px; font-weight: 700; padding: 1px 4px;
    border-radius: 99px; letter-spacing: .02em; pointer-events: none;
    line-height: 1.4;
  }
  /* Product-status badges — bottom-right cluster on a spool illustration: ❤
     wishlist (red), ★ like (gold), 🛍 buy-link (Shopify green). The other corners,
     the same on every illustration: Refill/twin/backup top-left (under the tier
     badge on a panel), chip top-right, TD bottom-left. */
  .prod-badges {
    position: absolute; bottom: 6px; right: 6px; z-index: 2;
    display: flex; gap: 3px; pointer-events: none;
  }
  .prod-badges--sm { bottom: 2px; right: 2px; gap: 2px; }
  .prod-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,.85); box-shadow: 0 1px 4px rgba(0,0,0,.25);
  }
  .prod-badges--sm .prod-badge { width: 14px; height: 14px; border-width: 1.5px; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
  .prod-badge .icon { background-color: var(--on-accent); }
  .prod-badge--wish { background: var(--buy); } /* cart green */
  .prod-badge--like { background: var(--favorite); } /* like gold */
  /* On the (large) spool-detail illustration, the badges show 2× bigger. */
  .panel-img-wrap .prod-badges { bottom: 10px; right: 10px; gap: 6px; }
  .panel-img-wrap .prod-badge {
    width: 40px; height: 40px; border-width: 2px; box-shadow: 0 2px 7px rgba(0,0,0,.3);
  }
  .panel-img-wrap .prod-badge .icon { width: 22px; height: 22px; }

  /* ── inline video player ── */
  .panel-video-section { border-bottom: 1px solid var(--border); }
  /* inline player — a file plays at once; YouTube / Drive swap their poster for an iframe */
  .panel-video-player { width: 100%; aspect-ratio: 16/9; background: #000; display: block; }
  .panel-video-player video,
  .panel-video-player iframe { width: 100%; height: 100%; border: none; display: block; }
  /* YouTube / Google Drive poster → click loads the player in place */
  .panel-yt-thumb {
    position: relative; display: block; width: 100%; aspect-ratio: 16/9;
    height: auto !important; border: none; padding: 0; cursor: pointer; overflow: hidden;
    background: #000;
  }
  .panel-yt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .pvt-play {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(220,0,0,.9);
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, transform .15s;
  }
  .panel-yt-thumb:hover .pvt-play { background: rgba(220,0,0,1); transform: translate(-50%,-50%) scale(1.08); }

  /* ── container section — flat layout (no border box) ── */
  /* Moved inside .cc-meta — same column as .cc-type / .cc-cw-row, aligned
     beside the container image. margin-bottom removed; .cc-meta is a flex
     column with gap: 2 px which handles vertical rhythm. */
  .cc-head {
    font-size: 13px; font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .cc-body {
    display: flex; align-items: center; gap: 10px;
  }
  .cc-body img {
    width: 64px; height: 64px; object-fit: contain;
    border-radius: 8px; flex-shrink: 0;
    background: var(--surface-2); padding: 4px;
  }
  .cc-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .cc-type { font-size: 12px; color: var(--muted); }
  .cc-cw-row { display: flex; align-items: center; gap: 4px; }
  .cc-cw     { font-size: 12px; font-weight: 600; color: var(--text); }
  .cc-cw-btn {
    flex-shrink: 0; width: 18px; height: 18px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border: none; border-radius: 4px;
    background: transparent; color: var(--muted); cursor: pointer;
    transition: color .15s, background .15s;
  }
  /* Always visible (grey), brighten on hover — a control that only appears on
     hover can't be found. */
  .cc-cw-btn:hover { color: var(--text); background: var(--surface-2); }
  .cc-cw-edit-row {
    display: none; align-items: center; gap: 4px; margin-top: 2px;
  }
  .cc-cw-input {
    width: 58px; font-size: 12px; font-weight: 600;
    padding: 2px 6px; border-radius: 6px;
    border: 1.5px solid var(--border); background: var(--surface-2); color: var(--text);
    outline: none;
  }
  .cc-cw-input:focus { border-color: var(--primary); }
  .cc-cw-ok, .cc-cw-cancel {
    width: 22px; height: 22px; padding: 0; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border: none; border-radius: 5px; cursor: pointer; font-size: 12px;
    transition: background .15s, color .15s;
  }
  .cc-cw-ok     { background: var(--primary-soft); color: var(--primary-text); }
  .cc-cw-ok:hover { background: var(--primary); color: var(--on-accent); }
  .cc-cw-cancel { background: var(--surface-2); color: var(--muted); }
  .cc-cw-cancel:hover { background: var(--border); color: var(--text); }
  .cc-edit {
    flex-shrink: 0; width: 36px; height: 36px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border: none; border-radius: 8px;
    background: transparent; color: var(--muted); cursor: pointer;
    transition: color .15s, background .15s;
    pointer-events: auto;
  }
  .cc-edit:hover { color: var(--text); background: var(--surface-2); }
  /* No container yet: the one call to action of the card — accent outline and
     a pulsing dot; the ⓘ says why it matters (the scale weighs the empty spool too). */
  .cc-missing {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px; cursor: pointer; text-align: left;
    border: 1.5px solid var(--primary); background: var(--primary-soft); color: var(--primary-text);
    transition: background .15s, transform .15s;
  }
  .cc-missing:hover { background: color-mix(in srgb, var(--primary) 22%, transparent); }
  .cc-missing:active { transform: scale(.99); }
  .cc-missing .icon { background: var(--primary); flex-shrink: 0; }
  /* The chevron points at the picker while it is closed, back at the card once open. */
  .cc-missing .icon-chevron-l { transition: transform .2s ease; }
  .cc-missing.is-open .icon-chevron-l { transform: rotate(180deg); }
  .cc-missing-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; }
  .cc-missing-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
    background: var(--primary); animation: cc-missing-pulse 1.6s ease-out infinite;
  }
  @keyframes cc-missing-pulse {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 60%, transparent); }
    100% { box-shadow: 0 0 0 8px transparent; }
  }
  @media (prefers-reduced-motion: reduce) { .cc-missing-dot { animation: none; } }
  /* change-container ghost trigger in weight section */
  .cp-trigger {
    font-size: 11px; color: var(--muted); gap: 4px;
    background: none; border: 1px dashed var(--border); border-radius: 6px; padding: 3px 8px;
    cursor: pointer; transition: border-color .15s, color .15s;
  }
  .cp-trigger:hover { border-color: var(--primary); color: var(--primary-text); }
  /* ── twin-link picker modal ──────────────────────────────────────────
     Reuses the .cp-card frame from the container picker so the two
     pickers feel like the same family. The list inside is a stack of
     candidate cards instead of the container grid. */
  #twinLinkPickerOverlay .cp-card {
    width: min(440px, calc(100vw - 32px)); max-height: 70vh;
    display: flex; flex-direction: column; padding: 0; overflow: hidden;
  }
  .twin-link-picker-sub {
    padding: 10px 18px 6px;
    font-size: 12px; color: var(--muted);
    line-height: 1.4;
  }
  .twin-link-picker-list {
    padding: 6px 14px 14px;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 6px;
  }
  .twin-link-picker-empty {
    padding: 24px 18px;
    text-align: center;
    font-size: 13px; color: var(--muted);
  }
  .twin-link-card {
    display: flex; align-items: center; gap: 12px;
    width: 100%;
    padding: 10px 12px;
    background: var(--surface);
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background .12s ease, transform .06s ease;
  }
  .twin-link-card:hover { background: color-mix(in srgb, var(--info) 6%, transparent); }
  .twin-link-card:active { transform: scale(.995); }
  .twin-link-card.is-loading { opacity: .55; pointer-events: none; }
  .twin-link-card-swatch {
    width: 36px; height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--border);
  }
  .twin-link-card-main {
    display: flex; flex-direction: column;
    flex: 1; min-width: 0;
    gap: 1px;
  }
  .twin-link-card-title {
    font-size: 13px; font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .twin-link-card-sub {
    font-size: 11px; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .twin-link-card-uid {
    font-size: 10.5px; color: var(--muted);
    font-family: var(--mono);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .twin-link-card-chev {
    background: var(--border);
    flex-shrink: 0;
  }
  .twin-link-card:hover .twin-link-card-chev { background: var(--muted); }

  /* ── Toolbox section (spool detail panel) ────────────────────────────
     A single section that bundles every action available on a spool —
     TD1S measurements, twin-pair link, remove-from-rack, delete.
     Each child is a `.toolbox-row` rendered as either a clickable
     button or an inert info row (paired-twin state). The variant
     classes paint hover / hold-to-confirm with the right palette
     (default / info / danger-soft / danger).                        */
  .panel-section--toolbox {
    padding: 14px 18px 18px;
  }
  .toolbox-list {
    display: flex; flex-direction: column;
    gap: 6px;
    margin-top: 8px;
  }
  .toolbox-row {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    height: 40px;
    padding: 0 14px;
    background: var(--surface-2);
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px; font-weight: 500;
    color: var(--text);
    text-align: left;
    transition: background .12s ease, transform .06s ease;
    /* `.hold-progress` lives inside, absolutely positioned; we need
       the row itself as a positioning context. */
    position: relative;
    overflow: hidden;
  }
  .toolbox-row:hover { background: color-mix(in srgb, var(--info) 8%, transparent); }
  .toolbox-row:active { transform: scale(.997); }
  .toolbox-row-icon {
    background: var(--muted);
    flex-shrink: 0;
    transition: background .12s;
  }
  .toolbox-row-label {
    flex: 1; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    /* keep text above the .hold-progress fill */
    position: relative; z-index: 1;
  }
  .toolbox-row-chev {
    background: var(--border);
    flex-shrink: 0;
    /* keep above hold-progress fill too */
    position: relative; z-index: 1;
  }
  .toolbox-row:hover .toolbox-row-icon { background: var(--text); }
  .toolbox-row:hover .toolbox-row-chev { background: var(--muted); }

  /* Toolbox info ⓘ — sits where the chevron would, on every row type. It reveals
     a body-appended bubble (#toolInfoPop, positioned in JS) on hover, so the
     bubble escapes the row's overflow:hidden. Pressing it never fires the row
     (a delegated capture handler swallows the event) — see _wireToolInfoTips. */
  .tool-info {
    display: inline-flex; align-items: center; flex-shrink: 0;
    cursor: help; position: relative; z-index: 1; /* above the hold-progress fill */
  }
  .tool-info .icon { background: var(--muted); opacity: .6; transition: opacity .12s, background .12s; }
  .toolbox-row:hover .tool-info .icon,
  .toolbox-row-main:hover .tool-info .icon { opacity: .8; }
  .tool-info:hover .icon { opacity: 1 !important; background: var(--text); }
  /* Comic-style speech bubble — a rounded bubble with a little tail pointing at the
     hovered control (tail x is set in JS via --tail-x; flips up when placed below). */
  #toolInfoPop {
    position: fixed; z-index: 9999; left: 0; top: 0;
    width: max-content; max-width: 260px; white-space: normal; text-align: center;
    background: var(--dark-surface); color: var(--on-dark); border: 1px solid var(--ink-15);
    padding: 8px 12px; border-radius: 12px;
    font-size: 11.5px; font-weight: 600; line-height: 1.4; letter-spacing: 0;
    box-shadow: 0 10px 26px rgba(0,0,0,.42);
    opacity: 0; pointer-events: none; transition: opacity .12s;
  }
  #toolInfoPop::after {
    content: ""; position: absolute; left: var(--tail-x, 50%); transform: translateX(-50%);
    border: 7px solid transparent; pointer-events: none;
  }
  #toolInfoPop:not(.pop-below)::after { top: 100%; margin-top: -1px; border-top-color: var(--dark-surface); }
  #toolInfoPop.pop-below::after     { bottom: 100%; margin-bottom: -1px; border-bottom-color: var(--dark-surface); }
  /* An error ("nothing to give"…): the same bubble, in red. */
  #toolInfoPop.is-error { background: #e5484d; color: #fff; }
  #toolInfoPop.is-error:not(.pop-below)::after { border-top-color: #e5484d; }
  #toolInfoPop.is-error.pop-below::after { border-bottom-color: #e5484d; }
  /* Optional picture above the words (the TigerPOD a spool goes on…). */
  #toolInfoPop .tip-img { display: block; width: 76px; aspect-ratio: 1; object-fit: contain; margin: 2px auto 6px; }
  #toolInfoPop.is-measuring { opacity: 0; }        /* laid out for measuring, still hidden */
  #toolInfoPop.is-open { opacity: 1; animation: ttipPop .16s cubic-bezier(.34,1.45,.5,1); }
  @keyframes ttipPop { from { transform: scale(.82); } to { transform: scale(1); } }

  /* Variant: info — used for the "linked to its twin" inert row. */
  .toolbox-row--info {
    background: color-mix(in srgb, var(--info) 8%, transparent);
    cursor: default;
  }
  .toolbox-row--info:hover { background: color-mix(in srgb, var(--info) 12%, transparent); }
  .toolbox-row--info .toolbox-row-icon { background: var(--primary); }

  /* Variant: danger-soft — reversible destructive (remove from rack). */
  .toolbox-row--danger-soft:hover .toolbox-row-icon { background: var(--warning-hover); }
  .toolbox-row--danger-soft:hover { background: color-mix(in srgb, var(--warning) 12%, transparent); }

  /* Variant: danger — hard-destructive (delete). */
  .toolbox-row--danger {
    background: color-mix(in srgb, var(--danger) 8%, transparent);
    color: var(--danger-hover);
  }
  .toolbox-row--danger:hover {
    background: color-mix(in srgb, var(--danger) 14%, transparent);
  }
  .toolbox-row--danger .toolbox-row-icon { background: var(--danger-hover); }
  .toolbox-row--danger .toolbox-row-chev { background: var(--danger-hover); opacity: .6; }

  /* Inert rows don't change colour on hover (they're informational). */
  .toolbox-row--inert {
    cursor: default;
  }
  .toolbox-row--inert:active { transform: none; }

  /* Greyed-out look for a device-gated tool that isn't usable yet — desaturated
     + dimmed so it reads as unavailable, but STILL clickable. The click either
     opens the TigerPOD promo (reader-gated chip tools, +.toolbox-row--pod-lock)
     or the device's own connect modal (TD1S measure tools — unchanged). The
     grayscale neutralises the row's variant colour (danger red / primary orange
     → grey). Also used on the main button of a split row. */
  .toolbox-row--greyed {
    filter: grayscale(1);
    opacity: .5;
  }
  .toolbox-row--greyed:hover { opacity: .7; }

  /* Split rows: a flex wrapper containing a main <button> + a trailing
     <button>. The wrapper itself is not interactive — each child handles
     its own hover / hold state independently. */
  .toolbox-row--split {
    padding: 0;
    gap: 4px;
    background: transparent;
    cursor: default;
    overflow: visible;
  }
  .toolbox-row--split:hover { background: transparent; }
  .toolbox-row--split:active { transform: none; }
  /* Main clickable button inside a split row */
  .toolbox-row-main {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 10px;
    height: 40px; padding: 0 10px 0 14px;
    background: var(--surface-2); border: 0; border-radius: 10px;
    cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 500;
    color: var(--text); text-align: left;
    transition: background .12s ease; overflow: hidden; position: relative;
  }
  .toolbox-row-main .toolbox-row-icon { background: var(--muted); flex-shrink: 0; transition: background .12s; }
  .toolbox-row-main .toolbox-row-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; z-index: 1; }
  .toolbox-row-main .toolbox-row-chev { background: var(--border); flex-shrink: 0; position: relative; z-index: 1; transition: background .12s; }
  .toolbox-row-main:hover { background: color-mix(in srgb, var(--info) 8%, transparent); }
  .toolbox-row-main:hover .toolbox-row-icon { background: var(--text); }
  .toolbox-row-main:hover .toolbox-row-chev { background: var(--muted); }

  /* Trailing button (e.g. Clear TD, debug Unlink on the paired-twin row). Sits
     to the right of the label; uses its own hover styling. */
  .toolbox-row-trailing {
    width: 40px; height: 40px;
    flex-shrink: 0;
    padding: 0;
    position: relative;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2); border: 0; border-radius: 10px;
    cursor: pointer; overflow: hidden;
    transition: background .12s ease;
  }
  .toolbox-row-trailing .toolbox-row-icon { background: var(--muted); transition: background .12s; }
  .toolbox-row-trailing:hover { background: color-mix(in srgb, var(--warning) 14%, transparent); }
  .toolbox-row-trailing:hover .toolbox-row-icon { background: var(--warning-hover); }
  /* hold-to-confirm states on the trailing button */
  .toolbox-row-trailing.is-holding { background: color-mix(in srgb, var(--danger) 12%, transparent); }
  .toolbox-row-trailing.is-confirming { background: color-mix(in srgb, var(--danger) 35%, transparent) !important; }
  .toolbox-row-trailing.is-confirming .toolbox-row-icon { background: var(--surface); }

  /* Hold-to-confirm fill — same width-based progress as elsewhere. */
  .toolbox-row--hold .hold-progress {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0%;
    background: color-mix(in srgb, var(--danger) 25%, transparent);
    z-index: 0;
    pointer-events: none;
  }
  .toolbox-row--danger-soft .hold-progress {
    background: color-mix(in srgb, var(--warning) 30%, transparent);
  }
  .toolbox-row.is-holding {
    background: color-mix(in srgb, var(--danger) 12%, transparent);
  }
  .toolbox-row.is-confirming {
    background: color-mix(in srgb, var(--danger) 35%, transparent) !important;
    color: #fff;
  }
  :root:not([data-theme="dark"]) .toolbox-row.is-confirming { color: var(--text); }
  .toolbox-row.is-confirming .toolbox-row-icon,
  .toolbox-row.is-confirming .toolbox-row-chev { background: var(--surface); }

  /* ── Duplicate row — non-destructive hold + quantity stepper ──────────
     The generic hold fill is red (danger). Duplicate is constructive, so
     it gets a blue accent fill + blue hold states on the main button
     (setupHoldToConfirm toggles is-holding / is-confirming on the button
     element, here the .toolbox-row-main). */
  #btnToolDuplicate.toolbox-row-main.is-holding    { background: color-mix(in srgb, var(--info) 12%, transparent); }
  #btnToolDuplicate.toolbox-row-main.is-confirming { background: color-mix(in srgb, var(--info) 30%, transparent) !important; color: var(--on-accent); }
  #btnToolDuplicate.toolbox-row-main.is-confirming .toolbox-row-icon,
  #btnToolDuplicate.toolbox-row-main.is-confirming .toolbox-row-chev { background: var(--surface); }
  #btnToolDuplicate .hold-progress { background: color-mix(in srgb, var(--info) 28%, transparent); }

  /* Copy count — a dropdown, sits to the right of the main button (same
     height). Picking "10+" swaps it for a free field: 1-10 is one pick for the
     everyday case, and a box of 30 is one keystroke instead of thirty clicks.
     Both are capped at DUP_MAX (50), the ceiling the write enforces anyway.
     The input class is DOUBLED (0,2,0) to outrank the global
     `input[type="number"]` rule (0,1,1), which forces 40px tall + width:100%. */
  .dup-qty {
    flex-shrink: 0;
    display: flex; align-items: center;
    height: 40px; padding: 0 4px;
    background: var(--surface-2); border-radius: 10px;
  }
  .dup-qty-sel,
  .dup-qty-free.dup-qty-free {
    height: 32px; width: auto; padding: 0 6px;
    background: transparent; border: 0; border-radius: 8px;
    color: var(--text); font-family: inherit;
    font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
    text-align: center; cursor: pointer;
  }
  .dup-qty-sel { min-width: 52px; }
  .dup-qty-free.dup-qty-free { width: 54px; cursor: text; }
  .dup-qty-sel:hover { background: color-mix(in srgb, var(--info) 12%, transparent); }
  .dup-qty-sel:focus-visible,
  .dup-qty-free.dup-qty-free:focus { outline: none; background: var(--surface); }
  /* The spinner would eat half of a 54px field for a value that is typed. */
  .dup-qty-free::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

  /* ── container picker — side card (tucks right of the spool detail) ── */
  .cp-list { scrollbar-width: none; }
  .cp-list::-webkit-scrollbar { display: none; }
  .cp-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px 12px; border-bottom: 1px solid var(--border); flex-shrink: 0;
  }
  .cp-title { font-size: 14px; font-weight: 700; color: var(--text); }
  .cp-search-wrap {
    position: relative; padding: 10px 14px; flex-shrink: 0;
    border-bottom: 1px solid var(--border);
  }
  .cp-search-icon {
    position: absolute; left: 26px; top: 50%; transform: translateY(-50%);
    color: var(--muted); pointer-events: none;
  }
  .cp-search {
    width: 100%; padding: 7px 10px 7px 32px; box-sizing: border-box;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 8px; font-size: 13px; color: var(--text); outline: none;
  }
  .cp-search:focus { border-color: var(--primary); }
  .cp-kinds { display: flex; gap: 5px; padding: 8px 12px; flex-shrink: 0; border-bottom: 1px solid var(--border); }
  .cp-kind {
    flex: 1 1 auto; min-width: 0; height: 26px; padding: 0 7px; border-radius: 13px; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    border: 1px solid var(--border); background: none; color: var(--muted);
    font-size: 11px; font-weight: 600; transition: color .15s, border-color .15s, background .15s;
  }
  .cp-kind:hover { color: var(--text); border-color: var(--muted); }
  .cp-kind.is-on { color: var(--primary-text); border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }
  .cp-list {
    overflow-y: auto; padding: 8px; flex: 1;
  }
  .cp-group-label {
    padding: 6px 12px 2px; font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  }
  .cp-item {
    display: flex; align-items: center; gap: 12px;
    width: 100%; min-height: 80px; padding: 8px 12px; box-sizing: border-box;
    background: none; border: none; border-radius: 10px;
    cursor: pointer; text-align: left; transition: background .1s;
  }
  .cp-item:hover { background: var(--surface-2); }
  .cp-item.active { background: color-mix(in srgb, var(--primary) 10%, transparent); }
  .cp-item img {
    width: 64px; height: 64px; object-fit: contain; flex-shrink: 0;
    background: var(--surface); border-radius: 8px; padding: 4px; border: 1px solid var(--border);
  }
  .cp-item-info { flex: 1; min-width: 0; }
  .cp-item-name { font-size: 13px; font-weight: 600; color: var(--text); }
  .cp-item-meta { font-size: 11px; color: var(--muted); margin-top: 1px; }
  .cp-item-cw { font-size: 12px; font-weight: 700; color: var(--text); }

  /* ── Container weight correction ────────────────────────────────────────
     The catalogue weight is a manufacturer value; a user who weighs their own
     container can override it (users/{uid}/containerOverrides). The pencil sits
     to the LEFT of the value, and the whole row swaps for an inline editor. */
  .cp-cw-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
  .cp-cw-btn {
    flex: none; width: 20px; height: 20px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: none; border: none; border-radius: 6px;
    color: var(--muted); cursor: pointer;
    transition: background .12s, color .12s, opacity .12s;
  }
  .cp-cw-btn .icon { background-color: currentColor; }
  /* Always visible in grey, brightening on hover — same as the master-spool
     card's own edit buttons. */
  .cp-cw-btn:hover { background: var(--surface-2); color: var(--text); }
  .cp-cw-badge {
    font-size: 9.5px; font-weight: 700; letter-spacing: .04em;
    color: var(--primary-text); background: var(--primary-soft);
    padding: 1px 6px; border-radius: 999px;
  }
  .cp-check { color: var(--primary-text); font-size: 14px; flex-shrink: 0; }
  .cp-fav { flex-shrink: 0; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: none; cursor: pointer; padding: 0; }
  .cp-fav .icon { background: var(--muted); opacity: .45; transition: opacity .15s, background .15s; }
  .cp-item:hover .cp-fav .icon, .cp-fav:focus-visible .icon { opacity: 1; }
  .cp-fav:hover { background: var(--surface-3, var(--surface-2)); }
  .cp-fav.is-on .icon { background: #f5b301; opacity: 1; }
  .cp-empty { padding: 24px; text-align: center; font-size: 13px; color: var(--muted); }
  /* A newly added spool: the list is narrowed to its likely containers — the line
     says why, and "Show all" lifts the filter. */
  .cp-hint {
    display: flex; align-items: center; gap: 8px; justify-content: space-between;
    margin: 4px 12px 8px; padding: 9px 12px; border-radius: 10px;
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    font-size: 12.5px; line-height: 1.4; color: var(--text);
  }
  .cp-show-all {
    flex-shrink: 0; height: auto; padding: 4px 9px; border-radius: 7px; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    font-size: 11.5px; font-weight: 600;
  }
  .cp-show-all:hover { border-color: var(--primary); color: var(--primary-text); }

  /* ── Reorder / buy-link side card ─────────────────────────────────────────
     Tucks to the LEFT of the spool detail (shares the container picker's slot),
     so it sits BEHIND it (z 100). */
  /* Cascade order (see _syncPanels — right/front → left/back): detail (101) >
     container/group deck (100) > Product card (99) > reorder (98). Each card tucks
     BEHIND the one to its right, so its z-index must be strictly lower. */
  /* z 98 = behind the Product card (99), which is itself behind the group deck. */
  #reorderPanel { z-index: 98; width: 300px; }
  #reorderCloseTab { z-index: 98; }

  /* ── Product "business card" (light, read-only) — see openProductCard.
     Reuses .panel-img-wrap / .panel-identity / .pi-* from the materials card. */
  /* z 99 = BEHIND the group deck (100) — the Product card docks to the LEFT of the
     group, so it must tuck behind it at the seam — but ABOVE the reorder card (98)
     which docks further left still. */
  #productCardPanel { z-index: 99; width: 300px; }
  /* Catalogue card — the four ways to take a product, as a 2 × 2 grid of real
     buttons right under its identity; "+ Inventory" leads in the accent colour,
     cart / favourite turn into a ✓ state once done. */
  .pc-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .pc-cta-btn {
    height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 0 10px; border-radius: 10px; cursor: pointer; min-width: 0;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
    font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: border-color .15s, background .15s, color .15s, transform .1s;
  }
  .pc-cta-btn .icon { background: currentColor; flex-shrink: 0; }
  .pc-cta-btn:hover { border-color: var(--primary); }
  .pc-cta-btn:active { transform: scale(.98); }
  .pc-cta-btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
  .pc-cta-btn--primary:hover { filter: brightness(1.06); }
  .pc-cta-btn--primary.is-busy { opacity: .6; cursor: progress; }
  .pc-cta-btn.is-on { border-color: color-mix(in srgb, var(--success) 55%, var(--border)); color: var(--success-text);
                      background: color-mix(in srgb, var(--success) 10%, var(--surface-2)); }
  /* "Product sheet" — opens the full management card beside this one. */
  .pc-sheet-btn {
    display: flex; align-items: center; gap: 8px; width: calc(100% - 32px); margin: 2px 16px 0;
    height: 36px; padding: 0 12px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--border); background: none; color: var(--text);
    font-size: 12.5px; font-weight: 600; text-align: left;
  }
  .pc-sheet-btn .icon { background: var(--muted); flex-shrink: 0; }
  .pc-sheet-btn > span:nth-child(2) { flex: 1; }
  .pc-sheet-btn:hover { border-color: var(--primary); }
  .pc-sheet-btn:hover .icon { background: var(--primary); }
  .pc-sheet-btn[aria-pressed="true"] { border-color: var(--primary); color: var(--primary-text); }
  .pc-sheet-btn[aria-pressed="true"] .icon { background: var(--primary); }
  /* The scanned chip on the TigerPOD: "Add from the catalogue" (a banner, #pcCatAdd) is
     the second way in, so the CTA grid has three buttons — the wishlist spans the row. */
  #pcCatAdd.is-busy { opacity: .6; cursor: progress; }
  .pc-cta--no-inv > :first-child { grid-column: 1 / -1; }
  .pc-owned { display: flex; align-items: center; gap: 7px; margin: 10px 16px 0; font-size: 12.5px; color: var(--muted); }
  .pc-owned .icon { background: var(--muted); }
  .pc-cat-msg { margin: 6px 16px 0; font-size: 12.5px; }
  .pc-cat-msg:empty { display: none; }
  /* The catalogue's description of the product — plain text, its own line breaks. */
  .pc-description { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); white-space: pre-line; }
  #productCardCloseTab { z-index: 99; }
  .pc-panel .panel-body { padding: 0 0 16px; overflow-y: auto; scrollbar-width: none; }
  .pc-panel .panel-body::-webkit-scrollbar { width: 0; height: 0; display: none; }
  /* Reuses the materials-card sections (illustration, identity, colours & aspect,
     weight). Only the product-specific extras below get their own styles. */
  /* ★/❤ toggle MY favorite/love. Matches .pi-flags (declared later in this file, so
     its flex:1 would lose to a flex-shrink:0 here) — the row must be able to span the
     full width for the left-aligned Product-info button to separate from the group. */
  .pc-flags { display: flex; gap: 6px; flex: 1; justify-content: flex-end; }
  .pc-rows { padding: 4px 16px; display: flex; flex-direction: column; gap: 9px; }
  .pc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .pc-k { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
  .pc-v { color: var(--text); font-size: 13px; font-weight: 600; text-align: right; }
  /* Buy link — sits directly under the price inside the same .pc-rows section
     (flex column, gap handles the spacing). Styled like the reorder card's active
     shop button: Shopify green, white cart + host text. */
  .pc-buy {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 2px; height: 40px; border-radius: 10px; text-decoration: none;
    background: var(--buy); border: 1px solid var(--buy);
    color: #fff; font-size: 13px; font-weight: 600; transition: filter .15s;
  }
  .pc-buy:hover { filter: brightness(1.06); }
  .pc-buy .icon { background-color: var(--on-accent); }
  /* Provenance block — reuses the reorder card's .ro-from (avatar + label + name);
     the wrap just gives it the section's horizontal padding. */
  .pc-from-wrap { padding: 4px 16px 0; }
  .pc-note { margin: 12px 16px 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 12px; text-align: center; }
  /* The merged product card is TWO side cards wide (the old "Product info" +
     "Product card" pair). No title bar text and no separator: the hero right
     below already says what the card is about; only ❤/★/list and the ✕ remain. */
  #reorderPanel { width: 620px; }
  /* The header only holds the actions (+, list, ❤, ★, ✕): it floats over the
     top-right corner so the illustration can take the top-left corner, flush
     with the card's edges — the way the spool detail card shows its photo. */
  .ro-panel .panel-body { position: relative; }   /* anchors the header that scrolls with it */
  .ro-panel .panel-header {
    position: absolute; top: 0; left: 0; right: 0; z-index: 2; pointer-events: none;
    border-bottom: none; justify-content: flex-end; padding: 14px 16px 0;
  }
  .ro-panel .panel-header > * { pointer-events: auto; }
  /* The actions (+, list, to-order, ★) sit in a row in the top-right corner,
     just left of the ✕ — the identity starts below them. */
  .ro-panel .ro-header-flags { margin: 0 6px 0 0; }
  .ro-panel .panel-body {
    /* flex:1 + min-height:0 make the body fill the panel's flex column and
       scroll (the base .panel-body sets flex:1; overriding display:flex here
       dropped it, so the body was only as tall as its content — bottom
       unreachable). The 24px bottom padding clears the absolute debug pill,
       like the base rule. */
    flex: 1; min-height: 0;
    display: flex; flex-direction: column; gap: 14px;
    padding: 16px 16px 24px; overflow-y: auto;
    scrollbar-width: none;
  }
  /* Never compress the rows/fields when the panel is short — they keep their
     height and the body scrolls (otherwise the "+ Add material" row and the
     last fields squash to nothing). */
  .ro-panel .panel-body > * { flex-shrink: 0; }
  .ro-panel .panel-body::-webkit-scrollbar { width: 0; height: 0; display: none; }
  /* Hero: illustration left, identity + the "+ Material" action right. */
  .ro-hero { display: flex; gap: 16px; align-items: stretch; }
  /* Flush into the card's top-left corner: pulled over the body's 16 px padding,
     rounded like the card (14 px) on that corner and softly on the opposite one. */
  .ro-hero .panel-img-wrap {
    width: 236px; flex-shrink: 0; overflow: hidden;
    margin: -16px 0 0 -16px; border-radius: 14px 0 12px 0;
  }
  /* Colour frame the exact size of the grid cards' (152 px card → 130 px photo,
     10 px corners): a fixed 11 px, not the 7 % the narrow side cards use, which
     would grow with this larger photo. */
  .ro-hero .panel-img-wrap:has(> .panel-img) { padding: 20px; }
  .ro-hero .panel-img-wrap > .panel-img { border-radius: 10px; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
  .ro-hero .panel-img-color-placeholder { aspect-ratio: 1; }
  /* Top padding clears the floating action buttons above the identity. */
  .ro-hero-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-start; gap: 6px; padding: 34px 0 0; }   /* below the action row */
  /* The catalogue description, three lines at most in the hero. */
  .ro-hero-desc {
    margin: 2px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line;
  }
  /* Two figures: stock (dot coloured by state) and its estimated value. */
  .ro-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 6px; }
  .ro-kpi {
    display: flex; align-items: center; gap: 10px; min-width: 0;
    padding: 9px 11px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
  }
  .ro-kpi .icon { background: var(--muted); flex-shrink: 0; }
  .ro-kpi-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 20%, transparent); }
  .ro-kpi.is-empty .ro-kpi-dot, .ro-kpi.ro-stock--low .ro-kpi-dot { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 20%, transparent); }
  .ro-kpi-k { font-size: 11px; color: var(--muted); white-space: nowrap; }
  .ro-kpi-v { font-size: 13.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #roStock .ro-kpi-v { color: var(--success-text); }
  #roStock.is-empty .ro-kpi-v, #roStock.ro-stock--low .ro-kpi-v { color: var(--danger-text); }
  /* Buy link / price — two big plain buttons, no labels above them. */
  .ro-commerce .ro-shop-btn { justify-content: center; }
  .ro-commerce .ro-cur--mode { margin-left: 4px; }
  .ro-commerce .ro-price-cur { display: none; }   /* the value already carries its currency */
  /* The "≈ … HT · VAT n %" line only while the price is being typed — at rest the
     button already shows the price, the line was noise. */
  .ro-commerce .ro-derived { display: none; }
  .ro-commerce .ro-shop-editor:not([hidden]) + .ro-derived:not(:empty) { display: block; }
  .ro-det-k { white-space: nowrap; }
  /* Tabs */
  .ro-tabs { display: flex; border-bottom: 1px solid var(--border); margin: -4px -16px 0; padding: 0 16px; }
  .ro-tab {
    flex: 1; height: 40px; border: 0; background: none; cursor: pointer;
    font-size: 13px; font-weight: 600; color: var(--muted);
    border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s;
    border-radius: 0; padding: 0;
  }
  .ro-tab:hover { color: var(--text); }
  .ro-tab.is-active { color: var(--primary-text); border-bottom-color: var(--primary); }
  .ro-tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; vertical-align: 1px; }
  .ro-tabpanel { display: flex; flex-direction: column; gap: 12px; }
  .ro-tabpanel[hidden] { display: none; }
  /* Cards inside the Info tab */
  .ro-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
  .ro-card-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
  .ro-ptiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }   /* 2 rows of 3 */
  /* Icon + label share the title line; the value takes the full width below it. */
  .ro-ptile { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 6px; row-gap: 3px; padding: 9px 11px; border-radius: 10px; background: var(--surface-2); min-width: 0; }
  .ro-ptile > div { display: contents; }
  .ro-ptile .icon { background: var(--muted); flex-shrink: 0; width: 15px; height: 15px; }
  .ro-ptile-k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ro-ptile-v { grid-column: 1 / -1; }
  .ro-ptile-k { font-size: 11px; color: var(--muted); }
  .ro-ptile-v { font-size: 14px; font-weight: 700; color: var(--text); }
  .ro-cards2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .ro-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
  .ro-brand-link { display: inline-flex; align-items: center; gap: 5px; }
  .ro-brand-link .icon { background: currentColor; }
  .ro-det-row { display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 10px; padding: 6px 0; font-size: 12.5px; }
  .ro-det-row .icon { background: var(--muted); }
  .ro-det-k { color: var(--muted); }
  .ro-det-v { color: var(--text); font-weight: 600; text-align: right; display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; min-width: 0; }
  .ro-det-v.is-low { color: var(--danger-text); }
  /* Colour(s) as plain HEX text, one per line under "Colour" in the details card
     (the colour itself is already shown by the dot on the Colour row). */
  .ro-hex-list { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
  .ro-hex-val { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }
  .ro-det-v .pv-link { color: var(--primary-text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ro-det-v .pv-link:hover { text-decoration: underline; }
  .ro-color-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(255,255,255,.15); }
  /* The minimum: a light link-style value, pencil once set. */
  .ro-shop--inline { display: inline-flex; align-items: center; gap: 4px; }
  .ro-shop--inline .ro-shop-btn--link { height: auto; padding: 2px 6px; border: 0; background: none; font-size: 12.5px; font-weight: 600; color: var(--primary-text); }
  .ro-shop--inline .ro-shop-btn--link.ro-shop-btn--active { color: var(--text); }
  .ro-shop--inline .ro-shop-edit { width: 24px; height: 24px; }
  /* Note — one line that grows, counter on the right. */
  .ro-note-wrap { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
  .ro-note-wrap > .icon { background: var(--muted); flex-shrink: 0; }
  .ro-panel .ro-note-wrap .ro-note { flex: 1; border: 0; background: none; padding: 4px 0; min-height: 22px; resize: vertical; }
  .ro-note-count { font-size: 11px; color: var(--muted); align-self: flex-end; }
  /* Personal links — a dashed drop-zone look, like the mockup. */
  .ro-attach-zone { border: 1px dashed color-mix(in srgb, var(--muted) 45%, transparent); border-radius: 12px; padding: 12px 14px; }
  .ro-empty { padding: 18px 8px; text-align: center; font-size: 12.5px; color: var(--muted); }
  .ro-hero-txt .pi-row1 { font-size: 13px; }
  .ro-hero-txt .pi-row2--name { font-size: 20px; font-weight: 700; margin-top: 1px; }
  /* Sections borrowed from the read-only card keep their own padding — but inside
     this card the body already pads, so they sit flush like the .ro-field blocks. */
  .ro-panel .panel-body > .panel-section { padding: 0; border-top: none; }
  .ro-panel .panel-body > .pc-note { margin: 0; }
  /* Buy link + price: one commerce pair. */
  .ro-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .ro-pair > .ro-field { min-width: 0; }
  /* ❤ Liked / ★ Favorite toggles. In the Product-info card they sit in the panel
     HEADER (left of the ✕); the spool detail identity block uses .pi-flags. */
  .ro-header-flags { display: flex; gap: 6px; flex-shrink: 0; margin-right: 6px; }
  .ro-header-flags .flag-toggle { width: 30px; height: 30px; border-radius: 8px; }
  .flag-toggle {
    width: 34px; height: 34px; border-radius: 9px; cursor: pointer; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-2); border: 1px solid var(--border);
    transition: background .15s, border-color .15s;
  }
  .flag-toggle .icon { background-color: var(--muted); }
  /* "+ Material" is held: the fill runs under the icon. */
  .flag-toggle--addmat { position: relative; overflow: hidden; }
  .flag-toggle--addmat .icon { position: relative; z-index: 1; }
  .flag-toggle--addmat.is-holding .icon { background-color: var(--primary); }
  .flag-toggle:hover { background: var(--border); }
  .flag-toggle--wish.active { background: color-mix(in srgb, var(--buy) 15%, transparent); border-color: var(--buy); }
  .flag-toggle--wish.active .icon { background-color: var(--buy); }
  .flag-toggle--like.active { background: color-mix(in srgb, var(--favorite) 18%, transparent); border-color: var(--favorite); }
  .flag-toggle--like.active .icon { background-color: var(--favorite); }
  /* Detail-panel identity block: identity text (flags moved to their own row). */
  .panel-identity { display: flex; align-items: flex-start; gap: 10px; }
  .pi-ident-text { flex: 1; min-width: 0; }
  .pi-flags { display: flex; gap: 6px; flex: 1; justify-content: flex-end; }
  /* Product info pushed to the left edge, the three toggles stay grouped right —
     same split as the grouped-spools card's .gp-flag-info. With no info button
     (friend view) the row is unchanged: everything still sits right. */
  .pi-flags .pi-flag-info { margin-right: auto; }
  /* ❤/★/list actions on their own inline row between the illustration and name. */
  .pi-flags-row { display: flex; justify-content: flex-end; padding-top: 12px; padding-bottom: 8px; border-top: none; }
  .pi-flags-row + .panel-identity { border-top: none; padding-top: 0; }   /* group the actions row with the name */
  .flag-toggle--list:hover { background: color-mix(in srgb, var(--primary) 14%, transparent); border-color: var(--primary); }
  .flag-toggle--list:hover .icon { background-color: var(--primary); }
  /* "Product info page" — a navigation action (opens the catalogue page), same
     neutral→primary hover as the add-to-list button, not a toggle. */
  .flag-toggle--info:hover { background: color-mix(in srgb, var(--primary) 14%, transparent); border-color: var(--primary); }
  .flag-toggle--info:hover .icon { background-color: var(--primary); }
  /* Provenance block — shown when a favorite was imported from a friend's
     inventory. Prominent identity card (avatar + label + pseudo), styled like
     the sidebar account row. */
  .ro-from {
    display: flex; align-items: center; gap: 11px;
    margin: 2px 0 4px; padding: 9px 11px;
    border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--border);
  }
  .ro-from-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
  .ro-from-label {
    font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: var(--muted);
  }
  .ro-from-name {
    font-size: 14px; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  }
  .ro-from-av {
    position: relative; flex-shrink: 0;
    width: 38px; height: 38px; border-radius: 50%; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: var(--on-accent);
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
  }
  .ro-from-go {
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    opacity: .5; transition: opacity .15s, transform .15s;
  }
  .ro-from-go .icon { background: var(--muted); }
  .ro-from--link { cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; }
  .ro-from--link:hover {
    background: var(--surface); border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
  }
  .ro-from--link:hover .ro-from-go { opacity: 1; transform: translateX(2px); }
  .ro-from--link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
  .ro-from--gone { opacity: .75; }
  .ro-from-av--gone { background: var(--muted); }
  /* Current-stock pill; turns amber when below the min-stock target. */
  .ro-stock {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 11px; border-radius: 10px;
    background: var(--surface-2); color: var(--text);
    font-size: 13px; font-weight: 600;
  }
  .ro-stock { font-size: 14px; }
  .ro-stock #roStockTxt { font-weight: 700; }
  .ro-stock .icon { background-color: var(--muted); }
  .ro-stock--low {
    background: color-mix(in srgb, var(--warning) 16%, transparent);
    color: color-mix(in srgb, var(--warning) 80%, var(--text));
  }
  .ro-stock--low .icon { background-color: currentColor; }
  /* Stock section: the current-stock pill sits full width; the min-stock target
     is its own row below (label left, compact number right) — stacked, not
     cramped side by side. The pill turns amber when stock drops below the min. */
  /* Secondary label ("Minimum stock") under the current-stock pill, above its
     button+edit row (which reuses the price's .ro-shop / .ro-shop-btn styles). */
  .ro-sublabel { margin-top: 4px; }
  /* Field group. */
  .ro-field { display: flex; flex-direction: column; gap: 6px; }
  .ro-label {
    font-size: 10px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .07em;
    display: flex; align-items: center; gap: 6px;
  }
  .ro-cur {
    font-size: 10px; font-weight: 700; letter-spacing: .04em;
    color: var(--text); background: var(--surface-2);
    padding: 1px 6px; border-radius: 20px; text-transform: none;
  }
  /* The HT/TTC chip — signals which mode the field expects (set in the account). */
  .ro-cur--mode { color: var(--on-accent); background: var(--primary); }
  .ro-input {
    width: 100%; height: 38px; padding: 0 11px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 10px; color: var(--text); font-size: 13px;
    transition: border-color .15s, background .15s;
  }
  .ro-input:focus { outline: none; border-color: var(--primary); background: var(--primary-soft); }
  /* Note / comment textarea. */
  .ro-note {
    height: auto; min-height: 54px; padding: 9px 11px; resize: vertical;
    line-height: 1.4; font-family: inherit;
  }
  /* SKU / EAN rows — label + value (read-only, auto for TigerTag+) or input. */
  .ro-ref-row { display: flex; align-items: center; gap: 10px; min-height: 34px; }
  .ro-ref-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--muted); width: 58px; flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; }
  .ro-ref-label .icon { background: var(--muted); flex-shrink: 0; }
  .ro-ref-val { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; word-break: break-all; }
  .ro-ref-input {
    flex: 1; min-width: 0; height: 34px; padding: 0 10px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px;
    color: var(--text); font-size: 13px;
  }
  .ro-ref-input:focus { outline: none; border-color: var(--primary); background: var(--primary-soft); }
  /* Click-to-copy ref value (auto TigerTag+ AND editable display): the value IS the
     target, a faint copy glyph fades in on hover, "Copied!" floats up on click. */
  .ro-ref-copyval {
    position: relative; height: auto; margin-left: -6px; padding: 3px 6px; border: none; background: none;
    border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
    max-width: 100%; min-width: 0; color: var(--text); font: inherit; transition: background .15s, color .15s;
  }
  .ro-ref-copyval:hover { background: var(--surface-2); }
  .ro-ref-copyval.is-copied { color: var(--success-text); }
  .ro-ref-copyval .ro-ref-val { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal; }
  .ro-ref-val--empty { color: var(--muted); }
  .ro-ref-hint { flex-shrink: 0; opacity: 0; background-color: var(--muted); transition: opacity .15s; }
  .ro-ref-copyval:hover .ro-ref-hint { opacity: .6; }
  .ro-ref-copyval.is-copied .ro-ref-hint { opacity: 0; }
  .ro-ref-copyval .icon { background-color: currentColor; }
  /* Editable ref → the value display (click-to-copy) XOR the input, plus ONE toggle
     button that flips pencil ⇄ green ✓ (no separate validate). */
  .ro-ref-editwrap { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
  .ro-ref-display { flex: 1; min-width: 0; }
  .ro-ref-display[hidden] { display: none; }   /* beat the flex/default so `hidden` works */
  .ro-ref-editor { flex: 1; min-width: 0; }
  .ro-ref-editor[hidden] { display: none; }
  .ro-ref-editor .ro-ref-input { width: 100%; }
  /* Toggle: grey pencil in display mode, green ✓ while editing (icon swapped in JS). */
  .ro-ref-toggle {
    flex-shrink: 0; width: 30px; height: 30px; padding: 0; border-radius: 8px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
    transition: color .15s, background .15s, border-color .15s;
  }
  .ro-ref-toggle:hover { color: var(--text); background: var(--border); }
  .ro-ref-toggle--save { color: var(--on-accent); background: var(--success); border-color: var(--success); }
  .ro-ref-toggle--save:hover { color: var(--on-accent); background: var(--success); filter: brightness(1.06); }
  .ro-ref-toggle .icon { background-color: currentColor; }
  .ro-derived { font-size: 12px; color: var(--muted); min-height: 15px; font-variant-numeric: tabular-nums; }
  .ro-hint { font-size: 11px; color: var(--muted); line-height: 1.4; }
  /* Tags header — title left, edit-tags pencil pushed to the RIGHT (same as the
     materials side card's `.panel-tags .tags-head`, which is scoped away here). */
  .ro-panel .tags-head { display: flex; align-items: center; justify-content: space-between; }
  .ro-panel .tags-head .ro-label { margin: 0; }
  /* Buy link — the URL itself is never shown. A Shopify button (grey = no link,
     green = link set → opens the shop) + a pencil that reveals an inline editor. */
  .ro-shop { display: flex; gap: 8px; align-items: stretch; }
  /* Without this, `display:flex` beats the UA `[hidden]{display:none}`, so the
     display row stays visible and the editor opens BELOW it → the layout jumps.
     With it, the editor swaps in exactly where the button/price was (same size). */
  .ro-shop[hidden] { display: none; }
  .ro-shop-btn {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 38px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface-2);
    color: var(--muted); font-size: 13px; font-weight: 600;
    transition: background .15s, color .15s, border-color .15s, filter .15s;
  }
  .ro-shop-btn .icon { background-color: currentColor; }
  /* The price button shows the ACCOUNT'S currency symbol (€/$/£/¥…) in place of
     an icon — inherits the button's colour, like a masked icon would. */
  .ro-price-cur { font-size: 14px; font-weight: 800; line-height: 1; color: currentColor; display: inline-flex; align-items: center; }
  .ro-shop-btn--active { background: #5e8e3e; border-color: #5e8e3e; color: var(--on-accent); } /* Shopify green */
  .ro-shop-btn--active .icon { background-color: var(--on-accent); }
  .ro-shop-btn--active:hover { filter: brightness(1.06); }
  .ro-shop-edit {
    flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
    transition: color .15s, background .15s;
  }
  .ro-shop-edit:hover { color: var(--text); background: var(--border); }
  .ro-shop-edit .icon { background-color: currentColor; }
  .ro-shop-edit[hidden] { display: none; }
  .ro-shop-editor { display: flex; gap: 8px; align-items: stretch; }
  .ro-shop-editor[hidden] { display: none; }
  .ro-shop-editor .ro-input { flex: 1; min-width: 0; }

  /* ── Product attachments — "Documents & links" (tier-capped) ── */
  .ro-attach-count { font-size: 11px; color: var(--muted); font-weight: 600; margin-left: 4px; }
  .ro-attach-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
  .ro-attach-list:empty { margin: 0; }
  /* Each link reuses the buy-link button + edit-pencil layout (.ro-shop /
     .ro-shop-btn / .ro-shop-edit) for identical style + size. */
  .ro-attach-open { min-width: 0; }
  .ro-attach-open span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ro-attach-locked {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 38px; padding: 0 12px; border: 1px dashed var(--border); border-radius: 10px;
    color: var(--muted); font-size: 12px;
  }
  .ro-attach-locked .icon { background: var(--muted); flex-shrink: 0; }
  .ro-shop-ok {
    flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    border: none; background: var(--primary); color: var(--on-accent);
  }
  .ro-shop-ok .icon { background-color: var(--on-accent); }
  .ro-shop-ok:hover { filter: brightness(1.05); }
  /* Primary save. */
  .ro-save {
    width: 100%; height: 40px; border-radius: 10px; margin-top: 2px;
    background: var(--primary); color: var(--on-accent); border: none; cursor: pointer;
    font-size: 14px; font-weight: 600;
  }
  .ro-save:hover { filter: brightness(1.05); }
  .ro-save-result { min-height: 16px; }
  .ro-save-result .alert { font-size: 12px; }
  /* Hold-to-confirm remove (dark sweep so the fill contrasts the light button). */
  .ro-remove {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    width: 100%; height: 36px; border-radius: 10px; cursor: pointer;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--danger-text); font-size: 12.5px; font-weight: 600;
  }
  .ro-remove .icon { background-color: var(--danger); }
  .ro-remove .hold-progress { background: color-mix(in srgb, var(--danger) 26%, transparent); opacity: 1; }
  .ro-remove[hidden] { display: none; } /* beats .ro-remove{display:flex} */

  /* ── Editable TD chip (detail panel print section) ── */
  .temp-chip--editable {
    cursor: pointer; position: relative;
    transition: background .15s, border-color .15s;
  }
  .temp-chip--editable:hover { background: var(--surface-hover); border-color: var(--primary); }
  .temp-chip--editable .tc-add { color: var(--primary-text); font-size: 11px; }
  .temp-chip--editable::after {
    content: "✎";
    position: absolute; top: 4px; right: 5px;
    font-size: 9px; color: var(--muted); opacity: 0;
    transition: opacity .15s;
  }
  .temp-chip--editable:hover::after { opacity: 1; }

  /* ── TD Edit + Color Edit styles moved to renderer/IoT/td1s/td1s.css ── */
  /* ── TD1S styles moved to renderer/IoT/td1s/td1s.css ── */

  /* ── First-connection onboarding modal — 2 steps ─────────────────────────
     Fixed-size card; the .dns-track slides horizontally between the language
     step and the profile step (no modal resize, no fade). */
  #displayNameSetupOverlay .dns-card {
    width: min(520px, calc(100vw - 32px));
    max-height: min(780px, calc(100vh - 40px));
    border-radius: 22px;
    padding: 0; overflow: hidden;
    display: flex; flex-direction: column;
  }
  /* step counter + mini progress indicator — floats in the card's top-right
     corner (no header bar: the white speaks for itself) */
  #displayNameSetupOverlay .dns-card { position: relative; }
  .dns-hero-step {
    position: absolute; top: 20px; right: 26px; z-index: 2;
    display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  }
  .dns-mini-prog { display: flex; align-items: center; gap: 5px; }
  .dns-mini-line { width: 22px; height: 2px; border-radius: 1px; background: var(--border); }
  .dns-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); transition: background .2s; }
  .dns-dot.active { background: var(--primary); }
  /* steps viewport + sliding track */
  .dns-steps { overflow: hidden; }
  .dns-track { display: flex; transition: transform .25s cubic-bezier(.3, .7, .4, 1); }
  .dns-step {
    flex: 0 0 100%; min-width: 0; box-sizing: border-box;
    padding: 58px 30px 20px;   /* top clears the floating step indicator */
    display: flex; flex-direction: column; gap: 7px; text-align: left;
  }
  /* step 2 only — wide side gutters so the avatar/buttons/field/CTA breathe
     well away from the card edges */
  #dnsStep2 { padding-left: 68px; padding-right: 68px; }
  .dns-eyebrow    { font-size: 10.5px; font-weight: 800; color: var(--primary-text); text-transform: uppercase; letter-spacing: .09em; }
  .dns-step-title { font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -.02em; line-height: 1.2; margin: 0 auto; max-width: 380px; text-align: center; }
  .dns-step-sub   { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin: 2px auto 4px; max-width: 340px; text-align: center; }
  /* step-1 hero — the product mockup (MacBook + TigerTag phone), full width */
  /* Hero illustration. The ecosystem artwork is taller (ratio ~1.41) than the
     old mockup (~1.82), so cap the height and `contain` it — the card keeps its
     size instead of growing ~70 px and risking an overflow on short screens. */
  .dns-step-art { max-width: calc(270px * 1120 / 580); margin: 4px auto 6px; }
  .dns-label {
    font-size: 10.5px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .07em;
    margin: 6px 0 1px;
  }
  /* label row: field name on the left, the requirement note on the right */
  .dns-label-row { display: flex; justify-content: space-between; align-items: baseline; }
  .dns-label-min { text-transform: none; letter-spacing: normal; font-weight: 600; opacity: .75; }
  /* question-form label ("What should we call you?") — a shouty uppercase
     question reads wrong, render it as a normal sentence */
  .dns-label--q { text-transform: none; letter-spacing: normal; font-size: 12.5px; }
  .dns-helper { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin: 2px 0 0; }
  /* language dropdown — the app's csel enhancer as a real form field. The whole
     language block (label + select + helper) is a centred 60%-wide column. */
  #dnsStep1 .dns-label, #dnsStep1 .dns-helper { width: 60%; margin-left: auto; margin-right: auto; }
  .dns-step .csel { display: block; width: 60%; margin: 0 auto; }
  .dns-step .csel-btn {
    width: 100%; max-width: none; height: 46px; box-sizing: border-box;
    justify-content: space-between; padding: 0 36px 0 16px;   /* right room for the chevron */
    font-size: 14.5px; font-weight: 600;
    border: 1.5px solid var(--border); border-radius: 11px;
    /* background-COLOR only — the `background` shorthand would wipe the
       base .inv-brand-filter chevron (a background-image) */
    background-color: var(--surface-2);
    background-position: right 14px center;
    transition: border-color .12s, background-color .12s;
  }
  .dns-step .csel-btn:hover, .dns-step .csel--open .csel-btn { border-color: var(--primary); background-color: var(--surface); }
  .dns-step .csel-btn.is-active { color: var(--text); }   /* form field, not a filter — no "active" orange */
  /* the sliding viewport clips overflow below — open the option list UPWARD
     (plenty of room over the illustration) so it never hits the card bottom */
  .dns-step .csel-pop { width: 100%; max-width: none; max-height: 260px; top: auto; bottom: calc(100% + 6px); }
  /* avatar preview + actions (step 2) — the preview is NEVER an empty ring:
     gradient + live initials, a user-icon placeholder, or the photo. The whole
     group is centred and takes the spare height (step 1's art sets the card
     height), so the avatar is the visual star of the step. */
  /* avatar left, action buttons stretch to the right edge — so this row spans
     the SAME width as the name field below (consistent left/right margins) */
  .dns-avatar-row { display: flex; align-items: center; gap: 24px; margin: auto 0; padding: 10px 0; }
  /* thick white ring + soft drop shadow (mockup look) — the coloured/photo fill
     is the .dns-avatar-paint inside */
  .dns-avatar {
    position: relative; width: 118px; height: 118px; border-radius: 50%; flex: 0 0 118px;
    background: var(--surface);
    box-shadow: 0 0 0 4px #fff, 0 14px 30px rgba(0, 0, 0, .20);
  }
  /* neutralise the subtle coloured ring paintAvatar sets inline on the paint el
     — here the white ring above is the only ring we want */
  #dnsAvatarPaint { box-shadow: none !important; }
  /* gradient depth: a glossy top-left highlight + a bottom shade over the flat
     inline gradient (skipped in photo mode so it never veils the picture) */
  .dns-avatar-paint:not([data-av-mode="photo"])::before {
    content: ""; position: absolute; inset: 0; border-radius: 50%; z-index: 1;
    background:
      radial-gradient(90% 80% at 30% 22%, var(--ink-40), var(--ink-04) 55%),
      radial-gradient(100% 90% at 75% 115%, rgba(0, 0, 0, .22), rgba(0, 0, 0, 0) 60%);
    pointer-events: none;
  }
  .dns-avatar-paint .av-initials { position: relative; z-index: 2; }
  .dns-av-in { animation: dnsAvIn .18s ease-out; }
  @keyframes dnsAvIn { from { transform: scale(.85); opacity: .4; } to { transform: scale(1); opacity: 1; } }
  .dns-avatar-paint {
    position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 46px;
  }
  .dns-avatar-ph { display: none; background-color: var(--ink-85); }
  .dns-avatar--empty .dns-avatar-ph { display: block; }
  .dns-avatar--empty .av-initials { display: none; }
  .dns-avatar-acts { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  /* real buttons, not floating text — bordered pills with a clear hover */
  /* grey fill (like the language field) + a clearly-contrasted border so the
     buttons read on the white card — a white fill + hairline border vanished */
  .dns-av-act {
    display: inline-flex; align-items: center; gap: 10px;
    height: 44px; padding: 0 18px; width: 100%; box-sizing: border-box;
    font-size: 13.5px; font-weight: 600; color: var(--text);
    border: 1.5px solid rgba(0, 0, 0, .14); border-radius: 12px; background: var(--surface-2);
    cursor: pointer;
    transition: background .12s, border-color .12s, transform .12s, box-shadow .12s;
  }
  .dns-av-act:hover { border-color: var(--primary); background: var(--surface); box-shadow: 0 3px 8px rgba(0, 0, 0, .08); }
  .dns-av-act .icon { background: var(--muted); transition: background .12s; }
  .dns-av-act:hover .icon { background: var(--primary); }
  .dns-av-act:active { transform: scale(.97); }
  /* input field — deliberate, quiet focus ring (no loud halo) */
  .dns-input {
    width: 100%; box-sizing: border-box;
    padding: 11px 14px; font-size: 15px; font-weight: 700;
    background: var(--surface-2); border: 1.5px solid var(--border);
    border-radius: 11px; color: var(--text); outline: none;
    letter-spacing: -.01em;
    transition: border-color .12s, background .12s, box-shadow .12s;
    box-shadow: none;
  }
  .dns-input:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
  /* green check inside the field once the name is valid */
  .dns-input-wrap { position: relative; }
  .dns-input-wrap .dns-input { padding-right: 40px; }
  .dns-input-ok {
    position: absolute; right: 14px; top: 50%;
    background-color: var(--success);
    transform: translateY(-50%) scale(.6); opacity: 0;
    transition: opacity .15s, transform .15s;
  }
  .dns-input-wrap.ok .dns-input-ok { opacity: 1; transform: translateY(-50%) scale(1); }
  .dns-result { min-height: 14px; font-size: 11px; color: var(--danger-text); margin-top: -4px; }
  /* actions — pinned to the bottom so both steps share the same height */
  .dns-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 12px; }
  /* step 1: a single centred CTA at ~60% width (matches the language field) */
  #dnsStep1 .dns-actions { justify-content: center; }
  #dnsStep1 .dns-btn-save { flex: 0 0 60%; }
  .dns-btn-save {
    flex: 1; height: 46px; font-size: 15px; font-weight: 700; border-radius: 12px;
    background-image: linear-gradient(180deg, var(--primary-hi), var(--primary-hover));
    box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 30%, transparent);
    transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
  }
  .dns-btn-save:hover { transform: translateY(-1px); box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 38%, transparent); filter: brightness(1.03); }
  .dns-btn-save:active { transform: translateY(0) scale(.985); box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 28%, transparent); }
  .dns-btn-back {
    display: inline-flex; align-items: center; gap: 8px;
    height: 46px; padding: 0 20px; border-radius: 12px;
    font-size: 14px; font-weight: 600;
    border: none; background: transparent; color: var(--text);
    cursor: pointer;
    transition: background .12s, color .12s;
  }
  .dns-btn-back:hover { background: var(--surface-2); }
  .dns-btn-back:hover .dns-back-arrow { transform: translateX(-2px); }
  .dns-back-arrow { font-weight: 700; transition: transform .14s ease; }
  @media (prefers-reduced-motion: reduce) {
    .dns-track { transition: none; }
    .dns-av-in { animation: none; }
    .dns-btn-save:hover, .dns-btn-save:active, .dns-av-act:active { transform: none; }
    .dns-btn-back:hover .dns-back-arrow { transform: none; }
  }

  /* ── Lists view (Amazon-style wishlists) ── */
  /* Fill the remaining height inside #card-inv so each column can scroll on its own. */
  .inv-lists-view { margin-top: var(--view-gap); flex: 1; min-height: 0; display: flex; flex-direction: column; }
  /* Amazon-style two columns: list sidebar (left) + selected list (right). */
  .lv-amz { display: flex; gap: 20px; align-items: stretch; flex: 1; min-height: 0; }
  .lv-side { flex: 0 0 220px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; }
  /* Scroll stays, scrollbars hidden (matches the products view's clean look). */
  .lv-side, .lv-rows, .lv-rail { scrollbar-width: none; }
  .lv-side::-webkit-scrollbar, .lv-rows::-webkit-scrollbar, .lv-rail::-webkit-scrollbar { width: 0; height: 0; }
  .lv-side-head { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 2px 10px 8px; }
  /* List row — indented under its visibility group header so the nesting reads
     (child sits right of the parent label); article count is a rounded pill, so it
     never looks like the plain number a group header used to carry. */
  .lv-side-item {
    display: flex; align-items: center; gap: 7px; width: 100%;
    padding: 7px 9px; border-radius: 9px; border: 1px solid transparent;
    background: transparent; color: var(--text); font-size: 13.5px; text-align: left; cursor: pointer;
    transition: background-color .12s, border-color .12s;
  }
  .lv-side-item:hover { background: var(--surface-2); }
  .lv-side-item.is-active { background: color-mix(in srgb, var(--primary) 12%, transparent); border-color: color-mix(in srgb, var(--primary) 40%, transparent); font-weight: 600; }
  /* Drag handle — the whole row is draggable, the grip is the affordance. */
  .lv-side-grip { flex-shrink: 0; display: inline-flex; align-items: center; cursor: grab; opacity: .4; }
  .lv-side-grip .icon { background-color: var(--muted); }
  .lv-side-item:hover .lv-side-grip { opacity: .85; }
  /* The grabbed row vanishes from its slot (only the cursor drag-image remains);
     the make-room shift slides the following rows up over its now-hidden spot. */
  .lv-side-item--dragging { opacity: 0; pointer-events: none; }
  .lv-side-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lv-side-n {
    flex-shrink: 0; min-width: 20px; text-align: center;
    padding: 1px 7px; border-radius: 999px; background: var(--surface-2);
    color: var(--muted); font-size: 10.5px; font-weight: 700; line-height: 1.5;
  }
  .lv-side-item.is-active .lv-side-n { background: color-mix(in srgb, var(--primary) 22%, transparent); color: var(--primary-text); }
  /* Visibility drop zone — holds a group's rows; always present (even empty) so a
     list can be dragged into any type. Empty = a dashed "drop here" hint. */
  .lv-side-zone { display: flex; flex-direction: column; gap: 2px; min-height: 6px; border-radius: 9px; transition: background-color .12s; }
  .lv-side-empty {
    padding: 8px 10px; margin: 1px 0; border: 1px dashed var(--border); border-radius: 8px;
    font-size: 11px; color: var(--muted); text-align: center; opacity: .8;
  }
  /* While dragging, make every group visibly droppable. */
  .lv-side-dragging .lv-side-zone { background: color-mix(in srgb, var(--primary) 5%, transparent); }
  .lv-side-dragging .lv-side-empty { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); color: var(--primary-text); opacity: 1; }
  /* Visibility group header (Private / Friends / Public) — a quiet section label,
     NOT a row: no count, no hover, generous top spacing so it clearly separates
     the buckets. The lists are bucketed by type, so rows drop their own glyph. */
  /* Group header = a gradient pill badge (same family as the Details type badge /
     .tag-plus / .tag-cloud), one colour per type, white icon + label. Left-aligned,
     shrinks to content. */
  .lv-side-group {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 4px;
    margin: 14px 0 5px 10px; padding: 3px 9px; border-radius: 999px; color: var(--on-accent);
    font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  }
  .lv-side-group:first-of-type { margin-top: 2px; }
  .lv-side-group .icon { background-color: var(--on-accent); flex-shrink: 0; }
  .lv-side-group-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lv-side-group--private { background: linear-gradient(90deg,var(--violet),var(--violet)); }
  .lv-side-group--friends { background: linear-gradient(90deg,var(--info),var(--info)); }
  .lv-side-group--public  { background: linear-gradient(90deg,var(--success),var(--success-hi)); }
  /* Visibility status badge — shown next to the list title (and each sidebar row),
     so the private / friends / public state is visible without opening edit. Owner
     can click it to jump into the edit modal. Colour-coded per state. */
  .lv-vis { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
    padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
    letter-spacing: .01em; border: 1px solid transparent; }
  .lv-vis[role="button"] { cursor: pointer; }
  .lv-vis .icon { width: 12px; height: 12px; }
  .lv-vis--private { color: var(--violet); background: color-mix(in srgb, var(--violet) 12%, transparent); border-color: color-mix(in srgb, var(--violet) 30%, transparent); }
  .lv-vis--private .icon { background-color: var(--violet); }
  .lv-vis--friends { color: var(--info-text); background: color-mix(in srgb, var(--info) 12%, transparent); }
  .lv-vis--friends .icon { background-color: var(--info); }
  .lv-vis--public { color: var(--success-text); background: color-mix(in srgb, var(--success) 14%, transparent); }
  .lv-vis--public .icon { background-color: var(--success); }
  /* Right rail — stacks the payment summary + the public share card. */
  .lv-rail { flex: 0 0 300px; overflow-y: auto; min-height: 0;
    display: flex; flex-direction: column; gap: 16px; min-width: 0; }
  .lv-rail .lv-public-card { flex: initial; width: 100%; position: static; top: auto; }
  .lv-summary { margin-top: 0; }
  /* Event + Message card (right rail, above Payment) — each with its own labelled
     row + icon, so the occasion and the note to friends are clearly readable. */
  .lv-info-card {
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
    padding: 12px 14px; display: flex; flex-direction: column; gap: 12px;
  }
  /* A field = a small coloured accent icon prefixing the label, value on the line below.
     No icon "boxes" (rounded squares read as heavy chrome here) — just the bare glyph. */
  .lv-info-row, .lv-info-stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .lv-info-lbl { display: inline-flex; align-items: center; gap: 6px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
  .lv-info-ic { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
  .lv-info-ic .icon { background-color: var(--muted); }
  .lv-info-ic--event .icon  { background-color: var(--favorite-deep); }
  .lv-info-ic--msg .icon    { background-color: var(--info); }
  .lv-info-ic--private .icon { background-color: var(--violet); }
  .lv-info-ic--friends .icon { background-color: var(--info); }
  .lv-info-ic--public .icon  { background-color: var(--success); }
  .lv-info-ic--count .icon   { background-color: var(--muted); }
  .lv-info-val { font-size: 13.5px; font-weight: 600; color: var(--text); word-break: break-word; }
  .lv-info-val--msg { font-weight: 500; line-height: 1.4; white-space: pre-wrap; }
  /* Type shown as a gradient pill badge (same family as .tag-plus / .tag-cloud),
     tinted per visibility, white icon + label. */
  .lv-type-badge { display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 999px; color: var(--on-accent);
    font-size: 11px; font-weight: 700; letter-spacing: .03em; }
  .lv-type-badge .icon { background-color: var(--on-accent); }
  .lv-type-badge--private { background: linear-gradient(90deg,var(--violet),var(--violet)); }
  .lv-type-badge--friends { background: linear-gradient(90deg,var(--info),var(--info)); }
  .lv-type-badge--public  { background: linear-gradient(90deg,var(--success),var(--success-hi)); }
  /* Card header — "Details" label + the Manage/Edit action (moved out of the view header). */
  .lv-info-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .lv-info-head-lbl { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .lv-info-edit { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 30px; height: 30px; min-height: 0; padding: 0;
    border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); cursor: pointer; }
  .lv-info-edit .icon { background-color: var(--muted); }
  .lv-info-edit:hover { border-color: var(--primary); }
  .lv-info-edit:hover .icon { background-color: var(--primary); }
  /* Type + item count as a compact two-up strip (short scalars, side by side). Each is
     a single inline line — icon + value (no separate uppercase label above). */
  .lv-info-stats { display: flex; gap: 10px; }
  .lv-info-stat { flex: 1; }
  .lv-info-stat--inline { flex-direction: row; align-items: center; gap: 7px; }
  /* Public share card — right rail (QR + "Copy link" button), shown when public. */
  .lv-public-card { flex: 0 0 240px; align-self: flex-start; position: sticky; top: 4px;
    display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
    padding: 18px 16px; border-radius: 14px;
    background: color-mix(in srgb, var(--success) 8%, var(--surface-2));
    border: 1px solid color-mix(in srgb, var(--success) 28%, transparent); }
  .lv-qr-wrap { align-self: center; line-height: 0; }
  .lv-public-qr { width: 160px; height: 160px; border-radius: 10px; background: var(--surface); padding: 6px; }
  /* Actions row: "Copy link" (grows) + a square Download-QR button on its right. */
  .lv-public-actions { display: flex; align-items: stretch; gap: 8px; width: 100%; }
  .lv-public-copy { display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    flex: 1 1 auto; min-width: 0; height: 36px; border-radius: 10px; cursor: pointer; font-family: inherit;
    font-size: 13px; font-weight: 700; color: var(--on-accent); background: var(--success); border: 1px solid var(--success);
    transition: filter .12s; }
  .lv-public-copy:hover { filter: brightness(1.06); }
  .lv-public-copy .icon { background-color: var(--on-accent); }
  .lv-public-copy.is-copied { background: var(--success-hover); border-color: var(--success-hover); }
  .lv-public-dl { flex: 0 0 auto; width: 40px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
    padding: 0; cursor: pointer; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
    color: var(--faint); transition: background .12s, border-color .12s, color .12s; }
  .lv-public-dl:hover { border-color: var(--primary); color: var(--primary-text); }
  .lv-public-dl .icon { background-color: currentColor; }
  .lv-public-dl.is-busy { opacity: .5; pointer-events: none; }
  .lv-public-dl.is-done { background: var(--success); border-color: var(--success); color: var(--on-accent); }
  .lv-public-hint { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
  /* QR customisation — colour swatches + a logo toggle (owner only). */
  .lv-qr-style { display: flex; flex-direction: column; align-items: center; gap: 6px; }
  .lv-qr-style-lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
  .lv-qr-swatches { display: inline-flex; align-items: center; gap: 7px; }
  .lv-qr-sw { width: 18px; height: 18px; padding: 0; border-radius: 50%; cursor: pointer;
    background: var(--sw); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border);
    transition: transform .12s, box-shadow .12s; }
  .lv-qr-sw:hover { transform: scale(1.12); }
  .lv-qr-sw.is-sel { box-shadow: 0 0 0 2px var(--primary); }
  .lv-qr-logo { width: 24px; height: 18px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer;
    transition: border-color .12s, background .12s; }
  .lv-qr-logo:hover { border-color: var(--primary); }
  .lv-qr-logo.is-on { background: var(--primary); border-color: var(--primary); }
  .lv-qr-logo-mark { width: 16px; aspect-ratio: 1000 / 567; background-color: var(--muted);
    -webkit-mask: url('../../assets/svg/logos/logo_tigertag_contouring_head.svg') center/contain no-repeat;
            mask: url('../../assets/svg/logos/logo_tigertag_contouring_head.svg') center/contain no-repeat; }
  .lv-qr-logo.is-on .lv-qr-logo-mark { background-color: var(--surface); }
  /* Social share buttons — brand-coloured circles with a white glyph. */
  .icon-facebook { -webkit-mask-image: url('../../assets/svg/logos/logo_facebook.svg'); mask-image: url('../../assets/svg/logos/logo_facebook.svg'); }
  .icon-x        { -webkit-mask-image: url('../../assets/svg/logos/logo_x.svg');        mask-image: url('../../assets/svg/logos/logo_x.svg'); }
  .icon-linkedin { -webkit-mask-image: url('../../assets/svg/logos/logo_linkedin.svg'); mask-image: url('../../assets/svg/logos/logo_linkedin.svg'); }
  .icon-whatsapp { -webkit-mask-image: url('../../assets/svg/logos/logo_whatsapp.svg'); mask-image: url('../../assets/svg/logos/logo_whatsapp.svg'); }
  .icon-instagram { -webkit-mask-image: url('../../assets/svg/logos/logo_instagram.svg'); mask-image: url('../../assets/svg/logos/logo_instagram.svg'); }
  .icon-youtube  { -webkit-mask-image: url('../../assets/svg/logos/logo_youtube.svg');  mask-image: url('../../assets/svg/logos/logo_youtube.svg'); }
  .icon-tiktok   { -webkit-mask-image: url('../../assets/svg/logos/logo_tiktok.svg');   mask-image: url('../../assets/svg/logos/logo_tiktok.svg'); }
  .icon-github   { -webkit-mask-image: url('../../assets/svg/logos/logo_github.svg');   mask-image: url('../../assets/svg/logos/logo_github.svg'); }
  .icon-discord  { -webkit-mask-image: url('../../assets/svg/logos/logo_discord.svg');  mask-image: url('../../assets/svg/logos/logo_discord.svg'); }
  .icon-twitch   { -webkit-mask-image: url('../../assets/svg/logos/logo_twitch.svg');   mask-image: url('../../assets/svg/logos/logo_twitch.svg'); }
  .icon-globe    { -webkit-mask-image: url('../../assets/svg/logos/logo_globe.svg');    mask-image: url('../../assets/svg/logos/logo_globe.svg'); }
  .lv-social-row { display: flex; gap: 8px; justify-content: center; }
  .lv-social { display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
    transition: filter .12s, transform .1s; }
  .lv-social:hover { filter: brightness(1.08); transform: translateY(-1px); }
  .lv-social:active { transform: translateY(0); }
  .lv-social .icon { width: 15px; height: 15px; background-color: var(--on-accent); }
  .lv-social--wa .icon { width: 17px; height: 17px; }
  .lv-social--fb { background: #1877f2; }
  .lv-social--x  { background: #000; }
  .lv-social--li { background: #0a66c2; }
  .lv-social--wa { background: #25d366; }
  .lv-social--mail { background: #5b6470; }
  .lv-social--mail .icon { width: 16px; height: 16px; }
  .lv-side-new {
    display: flex; align-items: center; gap: 8px; width: 100%; margin: 2px 0 8px;
    padding: 9px 10px; border-radius: 9px; border: 1px dashed var(--border);
    background: transparent; color: var(--primary-text); font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background-color .12s, border-color .12s;
  }
  .lv-side-new:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); border-color: color-mix(in srgb, var(--primary) 45%, transparent); }
  .lv-side-new .icon { background-color: var(--primary); }
  /* Main = items column (header + list, left) + the public share card (right rail,
     when public). Row layout so the card rises to the header level. */
  .lv-main { flex: 1; min-width: 0; display: flex; align-items: stretch; gap: 28px; min-height: 0; }
  .lv-main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
  .lv-rows { display: flex; flex-direction: column; margin-top: 4px; flex: 1; min-height: 0; overflow-y: auto; }
  /* List header — title (+ count) + owner actions, with a divider below. */
  .lv-head { flex-shrink: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
  .lv-head-main { min-width: 0; }
  .lv-title-row { display: flex; align-items: center; gap: 8px; }   /* edit button before the title */
  .lv-head-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
  /* Rows / grid layout toggle (segmented, like the main view selector). */
  .lv-layout { display: inline-flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: var(--radius-sm); }
  .lv-layout-btn {
    width: 30px; height: 28px; border-radius: 7px; border: none; background: transparent; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; color: var(--muted);
    transition: background-color .15s, color .15s;
  }
  .lv-layout-btn .icon { background-color: currentColor; }
  .lv-layout-btn.is-active { background: var(--surface-raised); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
  /* Grid mode — cards reuse .inv-grid / .spool-card, with a hover remove (✕). */
  /* Same reason as `.inv-grid`: it is nested in a view that already spaces itself. */
  .lv-grid { }
  .lv-card { position: relative; display: flex; flex-direction: column; }
  .lv-remove {
    position: absolute; top: 6px; right: 6px; z-index: 3; overflow: hidden;
    width: 22px; height: 22px; border-radius: 7px;
    display: inline-flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border: 1px solid var(--border); cursor: pointer;
    opacity: 0; transition: opacity .12s, border-color .15s, background-color .15s;
  }
  .lv-card:hover .lv-remove { opacity: 1; }
  .lv-remove .icon { background-color: var(--muted); }
  .lv-remove > :not(.hold-progress) { position: relative; z-index: 1; }
  .lv-remove:hover { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, var(--surface)); }
  .lv-remove:hover .icon { background-color: var(--danger); }
  .lv-title { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; color: var(--text); }
  .lv-title-input {
    font-size: 18px; font-weight: 700; color: var(--text);
    background: var(--surface); border: 1px solid var(--primary); border-radius: 8px;
    padding: 2px 8px; min-width: 180px; outline: none;
  }
  .lv-delq { font-size: 12px; color: var(--muted); align-self: center; }
  /* Item ROWS — thumbnail · title/colour/price · buy + remove actions. */
  .lv-row {
    display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--border);
    cursor: pointer; transition: background-color .12s;
  }
  .lv-row:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
  /* Drag-to-reorder — grip handle (rows) + drop cues (rows & grid cards). */
  .lv-grip { align-self: center; display: inline-flex; align-items: center; margin: 0 -4px 0 2px;
    cursor: grab; opacity: .35; transition: opacity .12s; }
  .lv-row:hover .lv-grip { opacity: .8; }
  .lv-grip .icon { background-color: var(--muted); }
  /* Drag-to-reorder — items slide (2D translate) to open the drop gap; the dragged
     item is hidden (the OS drag image follows the cursor). Slide transition set
     inline in JS so it works in the row list and the wrapping grid alike. */
  .lv-item--dragging { opacity: 0; }
  .lv-reordering .lv-row, .lv-reordering .lv-card { will-change: transform; }
  body.is-dragging-order .lv-row, body.is-dragging-order .lv-card { cursor: grabbing; }
  /* Buy / Add-a-link bar at the bottom of a grid card (full-width). */
  /* Stacked: quantity on top (natural width), buy/add-link button on its own row
     below at full width — the grid card is too narrow to fit both side by side. */
  .lv-card-buybar { padding: 0 10px 10px; margin-top: auto; display: flex; flex-direction: column; align-items: stretch; gap: 7px; }
  .lv-card-buybar > :first-child { align-self: flex-start; }
  .lv-card-buy { flex: 0 0 auto; width: 100%; min-width: 0; height: 30px; justify-content: center; padding: 0 10px; font-size: 12px; }
  /* Amazon-style quantity selector — a dropdown button (1–9 + "10+") that swaps to a
     free-entry number input on "10+". Shared by the wishlist + the "To order" cart. */
  .qsel { position: relative; display: inline-flex; flex-shrink: 0; }
  .qsel-btn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 11px;
    border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
    box-shadow: 0 1px 2px rgba(0,0,0,.06); cursor: pointer; color: var(--text);
    font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
    transition: border-color .12s, background .12s; }
  .qsel-btn:hover { border-color: var(--muted); }
  .qsel--open .qsel-btn { border-color: var(--primary); }
  .qsel-val { min-width: 12px; text-align: center; }
  .qsel-caret { width: 9px; aspect-ratio: 1; flex-shrink: 0; background-color: var(--muted);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><path fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4l2.5 2.5L7.5 4'/></svg>") center/contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><path fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4l2.5 2.5L7.5 4'/></svg>") center/contain no-repeat; }
  /* Body-appended (position:fixed, placed in JS) → overlays everything, never clips
     inside a card or makes it grow. Shows all 10 rows at once (no scroll). */
  #qselPop.qsel-pop { position: fixed; z-index: 9999; left: 0; top: 0; min-width: 60px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,.24); padding: 4px;
    opacity: 0; pointer-events: none; transition: opacity .1s; }
  #qselPop.qsel-pop.is-open { opacity: 1; pointer-events: auto; animation: cselPop .12s ease; }
  .qsel-opt { display: block; width: 100%; height: auto; min-height: 0; text-align: left; padding: 5px 12px; border: 0;
    background: none; border-radius: 5px; cursor: pointer; font-family: inherit; font-size: 13px;
    line-height: 1.2; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; transition: background .1s; }
  .qsel-opt:hover { background: var(--surface-2); }
  .qsel-opt.is-sel { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary-text); font-weight: 800; }
  .qsel-opt--more { margin-top: 3px; border-top: 1px solid var(--border); border-radius: 0 0 5px 5px; }
  /* Free-entry input — typed by hand, no up/down spinner arrows. Doubled selector
     (0,2,0) so it outranks the global `input[type="text"]` rule (0,1,1) that would
     otherwise stretch it full-width. */
  .qsel-input.qsel-input { box-sizing: border-box; width: 56px; min-width: 0; height: 32px; margin: 0; padding: 0 8px;
    text-align: center; -moz-appearance: textfield; appearance: textfield;
    border: 1px solid var(--primary); border-radius: 8px; background: var(--surface); box-shadow: none; outline: none;
    font-size: 13px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
  .qsel-input::-webkit-inner-spin-button, .qsel-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
  .lv-qty-ro { font-size: 13px; font-weight: 700; color: var(--muted); }
  .lv-row-thumb { flex: 0 0 84px; }
  .lv-row-thumb .pv-thumb { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; display: block; }
  /* Wishlist rows: the item's colour frames its photo (inner corners rounded by
     the radius minus the border). The colour swatch fallback stays plain. */
  .lv-row-thumb img.pv-thumb { border-width: 5px; border-radius: 12px; }
  .lv-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
  .lv-row-title { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.35; }
  .lv-row-meta { font-size: 12px; color: var(--muted); }
  .lv-row-price { font-size: 15px; font-weight: 700; color: var(--text); margin-top: 2px; }
  .lv-row-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
  /* Amazon-style yellow "Buy" pill (opens the product's buy link). */
  .lv-buy {
    display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px;
    border-radius: 999px; border: 1px solid var(--warning);
    background: linear-gradient(180deg, #ffd569, #ffc02e); color: #3a2c00;
    font-size: 12.5px; font-weight: 700; cursor: pointer; transition: filter .12s;
  }
  .lv-buy:hover { filter: brightness(1.04); }
  .lv-buy .icon { background-color: #3a2c00; }
  /* "Add price" (text link) + "Add a link" (ghost pill) for items missing them. */
  .lv-addprice {
    align-self: flex-start; margin-top: 2px; padding: 2px 0;
    background: none; border: none; cursor: pointer; font-family: inherit;
    color: var(--primary-text); font-size: 13px; font-weight: 600;
  }
  .lv-addprice:hover { text-decoration: underline; }
  .lv-addlink {
    display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px;
    border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit;
    transition: border-color .12s, background-color .12s;
  }
  .lv-addlink:hover { border-color: var(--primary); }
  .lv-addlink .icon { background-color: var(--muted); }
  /* Keep the cart icon fixed and ellipsize a long shop domain instead of letting it
     spill out of the (full-width) card button. */
  .lv-buy .icon, .lv-addlink .icon { flex-shrink: 0; }
  .lv-buy-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Debug: ⌥-click "copy view ref" helper (admin debug mode only). */
  #dbgRefHint {
    position: fixed; right: 14px; bottom: 14px; z-index: 9999;
    display: inline-flex; align-items: center; gap: 6px;
    height: 28px; padding: 0 11px; border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 14%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--border));
    color: var(--text); font-size: 11px; font-weight: 600; cursor: pointer; opacity: .82;
    font-family: inherit; transition: opacity .12s;
  }
  #dbgRefHint:hover { opacity: 1; }
  /* the id-level `display:inline-flex` above overrides the UA `[hidden]` rule,
     so `h.hidden = true` didn't hide the pill until a reload — this makes the
     hidden attribute win, so toggling Debug off removes it instantly. */
  #dbgRefHint[hidden] { display: none; }
  #dbgRefHint .icon { background-color: var(--primary); }
  /* the green "Copied!" flash (_flashCopied) pops up just above the pill — do NOT
     clip it (no overflow:hidden), and lift its stacking so it clears the pill. */
  #dbgRefHint .copy-flash { z-index: 1; }
  /* Per-card debug copy button — injected into each side-card panel; shown only when
     the panel is open. Copies THAT card's ref (a bottom-right pill would be covered). */
  .dbg-card-btn {
    position: absolute; bottom: 12px; left: 12px; z-index: 60;   /* bottom-LEFT — clear of the top-right ✕ AND the bottom-right general debug pill */
    display: none; align-items: center; gap: 6px;
    height: 26px; padding: 0 11px; border-radius: 999px;
    background: var(--primary); border: 1px solid var(--primary);
    color: #fff; font-size: 11px; font-weight: 700; font-family: inherit; letter-spacing: .01em;
    box-shadow: 0 3px 12px rgba(0,0,0,.25);
    cursor: pointer; opacity: .92; transition: opacity .12s, filter .12s;
  }
  .detail-panel.open > .dbg-card-btn,
  .modal-overlay.open > .modal-card.pba-card > .dbg-card-btn { display: inline-flex; }
  /* Add-printer cards: the per-brand ones are modal cards, which need a
     positioning context; and where a footer holds "Back" at bottom-left, the
     chip sits just above it instead of on top of it. */
  .modal-card.pba-card { position: relative; }
  .pba-card:has(> .pba-footer) > .dbg-card-btn,
  .pba-panel:has(> .pba-footer) > .dbg-card-btn { bottom: 80px; }
  .dbg-card-btn:hover { opacity: 1; filter: brightness(1.06); }
  .dbg-card-btn .icon { background-color: var(--on-accent); flex-shrink: 0; }
  .dbg-card-lbl { white-space: nowrap; }
  .lv-row-remove {
    position: relative; overflow: hidden;
    width: 32px; height: 32px; border-radius: 999px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-2); border: 1px solid var(--border); cursor: pointer;
    transition: border-color .12s, background-color .12s;
  }
  .lv-row-remove .icon { background-color: var(--muted); position: relative; z-index: 1; }
  .lv-row-remove:hover { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
  .lv-row-remove:hover .icon { background-color: var(--danger); }
  /* First-run empty state (no lists yet). */
  .lv-first { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 16px; text-align: center; }
  .lv-first .icon { background-color: var(--muted); }
  .lv-first-txt { font-size: 15px; font-weight: 600; color: var(--text); }
  .lv-first-sub { font-size: 13px; color: var(--muted); max-width: 340px; }
  .lv-new-btn { margin-top: 8px; height: 38px; padding: 0 18px; border-radius: 10px; }
  /* Product-card "Add to a list" button (secondary next to the buy button). */
  .pc-addlist {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; height: 40px; margin-top: 8px; border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background-color .15s, border-color .15s;
  }
  .pc-addlist:hover { border-color: var(--primary); }
  .pc-addlist .icon { background-color: var(--muted); }

  /* ── "Add to a list" popup (anchored to a card button) ── */
  .atl-pop {
    position: fixed; z-index: 9000; min-width: 232px; max-width: 300px;
    max-height: 60vh; overflow: auto; padding: 6px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 12px 34px rgba(0,0,0,.28);
  }
  .atl-head { padding: 6px 8px 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
  .atl-rows { display: flex; flex-direction: column; gap: 2px; }
  .atl-row {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 8px 8px; border-radius: 8px; border: none; background: transparent;
    color: var(--text); font-size: 13px; text-align: left; cursor: pointer;
  }
  .atl-row:hover { background: var(--surface-2); }
  .atl-check { width: 16px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
  .atl-check .icon { background-color: var(--primary); }
  .atl-row.is-in { font-weight: 600; }
  .atl-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .atl-n { color: var(--muted); font-size: 11px; font-weight: 700; }
  .atl-empty { padding: 10px 8px; font-size: 12px; color: var(--muted); }
  .atl-new {
    display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 4px;
    padding: 9px 8px; border-radius: 8px; border: none; cursor: pointer;
    background: transparent; color: var(--primary-text); font-size: 13px; font-weight: 600;
  }
  .atl-new:hover { background: color-mix(in srgb, var(--primary) 12%, transparent); }
  .atl-new .icon { background-color: var(--primary); }

/* ══ Search views — the official TigerTag+ catalogue as grid / table ═════════
   Reads the local catalogue cache, not the user's stock. Both layouts REUSE the
   app's own shells rather than restating them: the grid is `.inv-grid` +
   `.spool-card`, the table is `.table-wrap` + a real <table> with the shared
   `.sel-cell` selection column. */
/* The page itself never scrolls (`html, body { overflow: hidden }` in 00-base),
   so every view has to BE its own scroller — same recipe as .inv-products-view
   and .inv-printer-view. Without `flex:1; min-height:0; overflow-y:auto` the
   list is simply clipped and the wheel does nothing. */
.inv-catalog-view {
  margin-top: var(--view-gap);
  display: flex; flex-direction: column;
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;                /* Firefox */
}
.inv-catalog-view::-webkit-scrollbar { width: 0; height: 0; }   /* Chromium */
.cv-count {
  display: none;
  font-size: 12px; font-weight: 600; color: var(--muted);
  white-space: nowrap; padding-right: 4px;
}
body.catalog-filters .cv-count { display: inline-flex; align-items: center; }
/* Table — a REAL table in the app's `.table-wrap` shell (see _catViewTableHTML),
   with the always-on selection column, so it inherits the shared table CSS
   wholesale. The wrap keeps `.table-wrap`'s own `overflow: auto`, i.e. the
   bordered rounded box IS the scroller — same recipe as the inventory and
   Favorites tables. That is what keeps its corners rounded while scrolling (a
   header pinned to the OUTER view would escape the rounded box and square them
   off) and puts the scroll-fade on the element that actually overflows. */
/* `.cv-body` is the only thing between the view and the table, and it carried no
   rules at all — so `flex: 1; min-height: 0` on the wrap below resolved against a
   plain block, the wrap grew to its full content height, and the sticky <thead>
   ended up pinned inside a box taller than the screen: it scrolled away with the
   rows. Making the body a flex column that fills the view is what lets the
   bordered box actually BE the scroller, exactly like Favorites and Inventory.

   Scoped to `--table` ON PURPOSE: in grid mode `#catalogViewBody` IS the grid
   (it gets `cv-body--grid inv-grid`), so an unscoped `display: flex` here would
   outrank `.inv-grid`'s own `display: grid` and collapse the cards into a column.
   In grid mode the body stays untouched and the VIEW is what scrolls. */
.inv-catalog-view .cv-body--table {
  display: flex; flex-direction: column;
  flex: 1; min-height: 0;
}
.inv-catalog-view .cv-table-wrap { flex: 1; min-height: 0; margin-top: 0; }
.inv-catalog-view .cv-row { cursor: pointer; }
.inv-catalog-view .cv-sentinel td { height: 1px; padding: 0; border: 0; }

/* Grid — REUSES `.spool-card` for the card AND `.inv-grid` for the container
   (both applied in _catViewCardHTML / _catViewSearch), so a catalogue card is
   literally the same object at literally the same size as an owned-spool card:
   full-bleed square photo on top, padded body below, identical track and gap.
   Nothing about the sizing is restated here — that is the whole point. */
/* Colour dot sits inline before the name, like the inventory card's. */
.inv-catalog-view .card-name { display: flex; align-items: center; gap: 6px; }

/* Sentinel — invisible; its only job is to tell the observer to append more. */
.inv-catalog-view .cv-sentinel { height: 1px; grid-column: 1 / -1; }


/* Search views: the product card's "+ Material" is the one control that writes —
   dimmed while the catalogue product is being created. */
#roCreateCloud:disabled { opacity: .45; cursor: not-allowed; }
#roCreateCloud.is-busy { opacity: .6; pointer-events: none; }

/* Catalogue row thumbnail — colour underneath, photo on top. The colour is the
   element's own background so it paints before the image arrives (and remains
   if the image errors out and removes itself). */
.inv-catalog-view .cv-thumb,
.cpk-list .cv-thumb {
  position: relative; display: inline-block; flex: 0 0 auto;
  border-radius: 6px; overflow: hidden; vertical-align: middle;
}
/* Full opacity, like every other TigerTag watermark (table thumb, grid card,
   side-card illustration). This one was the odd one out at .55. */
.inv-catalog-view .cv-thumb-logo,
.cpk-list .cv-thumb-logo {
  position: absolute; top: 8%; right: 8%; width: 42%;
}
.inv-catalog-view .cv-thumb-img,
.cpk-list .cv-thumb-img {
  /* Inset 4 px: the thumb's own colour background frames the photo. */
  position: absolute; top: 4px; left: 4px; width: calc(100% - 8px); height: calc(100% - 8px);
  object-fit: cover; display: block; border-radius: 4px;
  opacity: 0;   /* no empty inset box before the bytes arrive (no fade — rebuilds re-load from cache) */
}
.inv-catalog-view .cv-thumb-img.img-loaded,
.cpk-list .cv-thumb-img.img-loaded { opacity: 1; }

/* Product card — the shopping button. Plain while the product has no buy link
   (it then opens the Reorder card to create one); Shopify green once it has one,
   reusing the exact colour of the Reorder card's own shop button so the two read
   as the same thing in two places. */
.flag-toggle--buy.is-buy { background: var(--buy); border-color: var(--buy); }
.flag-toggle--buy.is-buy .icon { background-color: var(--on-accent); }
.flag-toggle--buy.is-buy:hover { filter: brightness(1.06); }

/* Grouped-spools deck: when each spool arrived. Every member is the same
   filament, so the date is what tells a fresh one from an old one. */
.gp-member-added { font-size: 11px; color: var(--muted); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Catalogue search with no match → make it by hand */
.cv-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 56px 24px; max-width: 420px; margin: 0 auto; }
.cv-empty > .icon { width: 28px; height: 28px; background: var(--muted); opacity: .5; margin-bottom: 6px; }
.cv-empty-title { font-size: 15px; font-weight: 700; color: var(--text); }
.cv-empty-sub { font-size: 13px; color: var(--muted); line-height: 1.45; }
.cv-empty-cta { margin-top: 12px; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
.cv-empty-cta .icon { background: #fff; }
.cv-empty-cta:hover { filter: brightness(1.08); }

/* ── Colour search (#colorSearchPanel, renderer/color-search.js) ──────────────
   Its side card, the chip of the active colour in the catalogue filters, and the
   "ΔE 1.4" of each result, tinted by the site's bands. */
#colorSearchPanel { width: 400px; max-width: 95vw; z-index: 101; display: flex; flex-direction: column; }
.csr-root { gap: 14px; }
.csr-root.is-drag { outline: 2px dashed var(--primary); outline-offset: -8px; }
.csr-modes { display: flex; }
.csr-modes .eac-seg-btn { flex: 1; padding: 7px 6px; white-space: nowrap; }
.csr-pane { display: flex; flex-direction: column; gap: 10px; }
.csr-pane[hidden] { display: none; }
/* height: auto — the swatches are buttons, and the global `button { height: 40px }`
   would win over aspect-ratio and draw ovals. */
.csr-swatch { width: 24px; height: auto; aspect-ratio: 1; flex-shrink: 0; padding: 0; border-radius: 50%; border: 1px solid var(--border-strong); box-sizing: border-box; }
button.csr-swatch { cursor: pointer; transition: transform .12s, box-shadow .12s; }
button.csr-swatch:hover { transform: scale(1.1); }
button.csr-swatch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.csr-swatch.is-empty { background: repeating-conic-gradient(var(--surface-3) 0 25%, var(--surface) 0 50%) 50% / 10px 10px; }
/* The inline picker (color-pop.js mountColorArea): the popover's area and hue strip, full width. */
.csr-picker { display: flex; flex-direction: column; gap: 12px; }
.csr-picker .color-pop-sv { height: 170px; border-radius: 12px; }
.csr-hex-row { display: flex; align-items: center; gap: 10px; }
.csr-swatch--pick { width: 36px; }
/* The chosen colour fades to the next one, in step with the picker's glide. */
.csr-swatch--pick, .csr-swatch--big { transition: background-color .28s ease-out; }
@media (prefers-reduced-motion: reduce) { .csr-swatch--pick, .csr-swatch--big { transition: none; } }
.csr-hex-input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
/* 14 quick picks in two even rows of 7, spread across the card. */
.csr-presets { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px 8px; justify-items: center; }
.csr-preset { width: 30px; }
.csr-preset.is-on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }
.csr-ral-list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; }
/* ── The catalogue's brands (#catBrandsPanel) ─────────────────────────────────
   The colour card's frame; a list of makers, each a toggle row (the RAL rows'
   look) with its product count; the list fills the card's height. */
#catBrandsPanel { width: 380px; max-width: 95vw; z-index: 101; display: flex; flex-direction: column; }
.cbp-root { gap: 12px; }
.cbp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.cbp-bulk { display: inline-flex; gap: 4px; }
.cbp-link { border: 0; background: transparent; color: var(--primary); font: inherit; font-size: 12px; font-weight: 600; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.cbp-link:hover { background: var(--primary-soft); }
.cbp-list { flex: 1; min-height: 160px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.cbp-list::-webkit-scrollbar { width: 6px; }
.cbp-list::-webkit-scrollbar-track { background: transparent; }
.cbp-list::-webkit-scrollbar-thumb { background: var(--ink-15); border-radius: 3px; }
.cbp-row { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 6px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; transition: background .12s; }
.cbp-row:hover { background: var(--surface-hover); }
.cbp-row.is-on { background: var(--primary-soft); }
.cbp-check { width: 18px; aspect-ratio: 1; flex-shrink: 0; border-radius: 5px; border: 1.5px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; transition: background .12s, border-color .12s; }
.cbp-check .icon { width: 12px; height: 12px; background: var(--on-accent); opacity: 0; transition: opacity .12s; }
.cbp-row.is-on .cbp-check { background: var(--primary); border-color: var(--primary); }
.cbp-row.is-on .cbp-check .icon { opacity: 1; }
.cbp-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbp-n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.cbp-done { height: 40px; border: 0; border-radius: 10px; background: var(--primary); color: var(--on-accent); font: inherit; font-weight: 700; cursor: pointer; transition: background .15s; }
.cbp-done:hover { background: var(--primary-hover); }
.cbp-done:disabled { opacity: .45; cursor: default; }
/* RAL mode: the ΔE ceiling and the multicolour switch sit right under the chosen
   colour, and the code list below takes the rest of the card's height (it
   scrolls, not the card) — a 300 px list left half a tall screen empty. */
.csr-root[data-mode="ral"] .csr-pane[data-csr-pane="ral"] { order: 1; flex: 1; min-height: 220px; }
.csr-root[data-mode="ral"] .csr-ral-list { flex: 1; min-height: 0; max-height: none; }
/* The list's scrollbar: the sidebar stats' thin one (00-base.css .sb-stats-wrap), not the white OS track. */
.csr-ral-list::-webkit-scrollbar { width: 6px; }
.csr-ral-list::-webkit-scrollbar-track { background: transparent; }
.csr-ral-list::-webkit-scrollbar-thumb { background: var(--ink-15); border-radius: 3px; }
.csr-ral-row { display: flex; align-items: center; justify-content: flex-start; gap: 10px; height: auto; min-height: 36px; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.csr-ral-row:hover { background: var(--surface-hover); }
.csr-ral-row.is-on { background: var(--primary-soft); }
.csr-ral-code { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.csr-ral-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csr-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; aspect-ratio: 4 / 3;
  padding: 20px; border: 2px dashed var(--border-strong); border-radius: 12px; background: var(--surface-2); color: var(--text);
  font-size: 13px; font-weight: 600; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.csr-drop:hover { border-color: var(--primary); }
.csr-drop[hidden] { display: none; }
.csr-drop > .icon { width: 36px; height: 36px; background: var(--primary); }
.csr-photo { position: relative; line-height: 0; }
.csr-photo[hidden] { display: none; }
.csr-canvas { display: block; width: 100%; height: auto; border-radius: 10px; cursor: crosshair; touch-action: none; }
.csr-dot { position: absolute; width: 20px; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none;
  border: 2px solid var(--on-accent); box-shadow: 0 0 0 1px var(--border-strong), 0 2px 6px rgba(0, 0, 0, .35); }
.csr-dot[hidden] { display: none; }
.csr-photo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.csr-photo-actions[hidden] { display: none; }
.csr-photo-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: background .12s, border-color .12s; }
.csr-photo-btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.csr-photo-btn .icon { background: currentColor; }
.csr-current[hidden] { display: none; }
.csr-current { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.csr-swatch--big { width: 40px; }
.csr-current-text { min-width: 0; }
.csr-current-hex { font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.csr-current.is-empty .csr-current-hex { font-weight: 500; color: var(--muted); }
.csr-current-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csr-current-sub:empty { display: none; }
.csr-max-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.csr-max-title { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
/* The settings block: the chosen-colour card's look (.csr-current), ΔE + multicolour inside. */
.csr-settings { display: flex; flex-direction: column; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.csr-settings .csr-max { gap: 8px; }
.csr-title-info { margin-left: 2px; }
/* The photo drop zone's ⓘ, in its top right corner. */
.csr-drop { position: relative; }
.csr-drop-info { position: absolute; top: 10px; right: 10px; }
.csr-range { width: 100%; accent-color: var(--primary); }
.csr-band { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.csr-band[data-band="same"], .csr-band[data-band="veryClose"] { color: var(--success-text); }
.csr-band[data-band="close"] { color: var(--game-ok-text); }
.csr-band[data-band="near"] { color: var(--warning-text); }
.csr-band[data-band="far"] { color: var(--muted); }
/* A hit's ΔE: the TD badge (.card-td-badge / .thumb-td-badge) with a dot in its
   band's colour before the figure. */
.cv-de { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cv-de::before { content: ""; width: 6px; aspect-ratio: 1; border-radius: 50%; background: var(--muted); }
.thumb-td-badge.cv-de { gap: 2px; }
.thumb-td-badge.cv-de::before { width: 4px; }
.cv-de[data-band="same"]::before, .cv-de[data-band="veryClose"]::before { background: var(--success); }
.cv-de[data-band="close"]::before { background: var(--game-ok); }
.cv-de[data-band="near"]::before { background: var(--warning); }
.cv-de[data-band="declared"]::before { background: var(--primary); }
.cv-card .card-weight { white-space: nowrap; }
.csr-multi { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text); cursor: pointer; }
/* The active colour, first in the catalogue filters: a pill like the selects beside it. */
.cv-color-chip { display: inline-flex; align-items: center; height: 32px; border: 1px solid var(--primary); border-radius: 999px; background: var(--primary-soft); overflow: hidden; }
.cv-color-chip[hidden] { display: none; }
.cv-color-chip-main { display: inline-flex; align-items: center; gap: 7px; height: 100%; padding: 0 4px 0 6px; border: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; white-space: nowrap; }
.cv-color-chip-swatch { width: 20px; aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--border-strong); box-sizing: border-box; }
.cv-color-chip-x { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }
.cv-color-chip-x .icon { background: var(--muted); transition: background .12s; }
.cv-color-chip-x:hover .icon { background: var(--text); }
.cv-color-chip-main:focus-visible, .cv-color-chip-x:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 999px; }

/* Hover preview of a table thumbnail (issue #67): the photo at 220 px, framed in
   the spool colour like the thumbnail itself; scales in from its edge. */
.thumb-zoom {
  position: fixed; z-index: 9000; pointer-events: none;
  padding: 6px; border-radius: 16px; background: var(--spool-bg, var(--surface));
  box-shadow: 0 18px 40px -10px rgba(0, 0, 0, .55), 0 0 0 1px var(--ink-08);
  opacity: 0; transform: scale(.92); transition: opacity .14s ease, transform .16s cubic-bezier(.2, .8, .2, 1);
}
.thumb-zoom.is-on { opacity: 1; transform: none; }
.thumb-zoom img { display: block; width: 220px; height: 220px; object-fit: cover; border-radius: 11px; background: var(--surface); }
.thumb-zoom--whole img { object-fit: contain; padding: 10px; box-sizing: border-box; }
@media (prefers-reduced-motion: reduce) { .thumb-zoom { transition: none; } }

/* ── Touch screens (iPad, phones — Tiger Studio Web) ────────────────────────
   No mouse means no hover: the actions a card only shows under the pointer
   would stay invisible, so they are simply shown. Mouse-only helpers go away:
   the panel resize handles (dragged with a mouse) and the ⌥-click hint. */
@media (hover: none) {
  .fp-friend-actions,
  .rp-rack-kebab, .rp-rack-move,
  .wb-edit-open,
  .lv-remove,
  .ro-from-go,
  .pv-min-edit { opacity: 1; pointer-events: auto; transform: none; }
  .panel-resize, #dbgRefHint { display: none; }
  button, a, [role="button"], .spool-card, .cat-card { -webkit-tap-highlight-color: transparent; }
}
