/* ── 50-snapmaker.css — Snapmaker live block + filament edit bottom-sheet ── */
  /* ═══════════════════════════════════════════════════════════════════
     Snapmaker Live — read-only block in the printer side card
     ═══════════════════════════════════════════════════════════════════ */
  /* Live data host (header + temps + filaments) — direct child of the
     panel body, so we restore the padding the wrapper section used to
     give it. Border-bottom delimits it from the Raw data section below. */
  .snap-live-host {
    padding: 0 18px 14px;
    border-bottom: 1px solid var(--border);
  }
  .snap-section { padding: 12px 18px 14px; } /* legacy — kept for safety */
  .snap-empty {
    display: flex; align-items: center; gap: 8px;
    padding: 12px;
    background: var(--surface-2);
    border: 1px dashed var(--border);
    border-radius: 10px;
    color: var(--muted);
    font-size: 12px;
  }
  .snap-empty .icon { background: var(--muted); }

  /* Header row — connection LED + status text + IP */
  .snap-head {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 0 10px;
  }
  .snap-led {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
  }
  .snap-led--connected {
    background: var(--success);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 18%, transparent);
    animation: snap-pulse 1.6s ease-in-out infinite;
  }
  .snap-led--connecting {
    background: var(--warning);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, .18);
    animation: snap-pulse 0.8s ease-in-out infinite;
  }
  .snap-led--offline { background: var(--neutral); }
  .snap-led--error   { background: var(--danger); }
  @keyframes snap-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .35; }
  }
  .snap-head-text {
    font-size: 12px; font-weight: 600;
    color: var(--text);
    letter-spacing: .2px;
  }
  .snap-head-ip {
    margin-left: auto;
    font-size: 11px;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  }

  /* ── Print job card — thumbnail on the left, info stack on the right
     (matches the mobile companion app's layout) ───────────────────── */
  .snap-job {
    /* Card frame removed — print-job sits flush in the live block.
       Zero margin: the next block (.snap-block) provides its own
       top margin so we don't double the gap. */
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    display: flex;
    gap: 12px;
    align-items: stretch;
  }
  .snap-job-thumb {
    flex: 0 0 96px;
    width: 96px; height: 96px;
    border-radius: 10px;
    background: var(--surface-2) center / contain no-repeat;
    border: 1px solid var(--border);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }
  .snap-job-info {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
    gap: 4px;
  }
  .snap-job-name {
    font-size: 13px; font-weight: 600;
    color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .snap-job-stats {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
  }
  .snap-job-pct {
    font-size: 28px; font-weight: 700; line-height: 1;
    color: var(--text);
    letter-spacing: -.02em;
  }
  .snap-job-time {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 14px; font-weight: 600;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  }
  .snap-job-time-icon {
    width: 14px; height: 14px;
    color: inherit;
  }
  .snap-job-bar {
    height: 4px;
    background: var(--surface-2);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 2px;
  }
  .snap-job-bar > span {
    display: block; height: 100%;
    background: var(--info);   /* colour by state: .job-fill--* in 40-printers.css */
    transition: width .25s linear, background-color .3s;
  }
  .snap-job-foot {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 2px;
  }
  .snap-job-state {
    display: inline-flex; align-items: center;
    font-size: 13px; font-weight: 600;
    padding: 4px 14px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--info) 12%, transparent);
    color: var(--primary-text);
    border: 1px solid color-mix(in srgb, var(--info) 24%, transparent);
  }
  /* Printing — spinner ring before label text */
  .snap-job-state--printing::before {
    content: "";
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    border-top-color: transparent;
    animation: snap-state-spin .7s linear infinite;
    margin-right: 6px;
    flex-shrink: 0;
  }
  @keyframes snap-state-spin { to { transform: rotate(360deg); } }

  /* Neutral / idle states — nothing running */
  .snap-job-state--standby,
  .snap-job-state--cancelled,
  .snap-job-state--idle,
  .snap-job-state--ready {
    background: var(--surface-2);
    color: var(--muted);
    border-color: var(--border);
  }
  /* Idle card variant — slightly washed out so the user sees "nothing
     to do here" without any active job. */
  .snap-job--standby .snap-job-pct,
  .snap-job--cancelled .snap-job-pct { color: var(--muted); }
  .snap-job--standby .snap-job-thumb,
  .snap-job--cancelled .snap-job-thumb { opacity: .5; }
  .snap-job-name--idle { color: var(--muted); font-style: italic; font-weight: 500; }
  .snap-job-state--paused {
    background: rgba(245,158,11,.15);
    color: var(--warning-hover);
    border-color: rgba(245,158,11,.3);
  }
  .snap-job-state--complete,
  .snap-job-state--finished {
    background: color-mix(in srgb, var(--success) 15%, transparent);
    color: #15803d;
    border-color: color-mix(in srgb, var(--success) 30%, transparent);
  }
  .snap-job-state--error,
  .snap-job-state--failed {
    background: color-mix(in srgb, var(--danger) 12%, transparent);
    color: var(--danger-hover);
    border-color: color-mix(in srgb, var(--danger) 30%, transparent);
  }
  .snap-job-state--heating,
  .snap-job-state--preparing {
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: #c2410c;
    border-color: color-mix(in srgb, var(--primary) 30%, transparent);
  }
  /* Preparing/heating — same spinner as printing */
  .snap-job-state--preparing::before {
    content: "";
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    border-top-color: transparent;
    animation: snap-state-spin .7s linear infinite;
    margin-right: 6px;
    flex-shrink: 0;
  }
  .snap-job-layers {
    font-size: 14px; font-weight: 700;
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  }
  /* Debug state codes badge — s:N · d:N · f:N (Creality) */
  .snap-job-codes {
    font-size: 10px; font-weight: 500;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.02em;
    opacity: .75;
  }

  /* Section block — used for both Temperature and Filament titled groups */
  .snap-block { margin-top: 8px; }
  .snap-block-title {
    font-size: 14px; font-weight: 700;
    color: var(--text);
    margin: 0 0 8px;
    letter-spacing: -.01em;
  }
  /* Header row with title + action buttons */
  .snap-block-hdr {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
  }
  .snap-block-hdr .snap-block-title { margin: 0; }
  .snap-fil-actions { display: flex; gap: 4px; }
  .snap-fil-act-btn {
    padding: 3px 9px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--surface-2); color: var(--text); font-size: 12px;
    font-weight: 500; cursor: pointer; transition: background .12s, border-color .12s;
  }
  .snap-fil-act-btn:hover { background: var(--surface-3); border-color: var(--primary); color: var(--primary-text); }
  .snap-fil-act-btn--cancel { color: var(--muted); }
  .snap-fil-act-btn--cancel:hover { color: var(--text); border-color: var(--border); }

  /* Selection mode — extruder squares become clickable checkboxes */
  .snap-fil--selectable { cursor: pointer; position: relative; }
  .snap-fil--selectable:hover .snap-fil-square { filter: brightness(1.08); transform: translateY(-2px); }
  .snap-fil-sel-check {
    position: absolute; top: 3px; right: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid var(--border); background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    transition: border-color .12s, background .12s;
  }
  .snap-fil-sel-check--on {
    border-color: var(--primary); background: var(--primary);
  }
  .snap-fil-sel-check--on .icon { color: var(--on-accent); }
  .snap-fil--checked .snap-fil-square { box-shadow: 0 0 0 3px var(--primary); }
  /* Disabled slots (invalid for current mode) */
  .snap-fil--disabled { cursor: not-allowed; pointer-events: none; }
  .snap-fil--disabled .snap-fil-square { opacity: .35; }
  .snap-fil-sel-reason {
    display: inline-block; margin-top: 3px;
    font-size: 10px; font-weight: 600; line-height: 1;
    padding: 2px 5px; border-radius: 4px;
    background: color-mix(in srgb, var(--muted) 12%, transparent);
    color: var(--muted);
  }
  .snap-fil-sel-reason--loaded {
    background: color-mix(in srgb, var(--success) 15%, transparent);
    color: var(--success-hover-text);
  }
  .snap-fil-sel-empty { font-size: 12px; color: var(--muted); padding: 8px 4px; margin: 0; }
  /* Confirm footer */
  .snap-fil-sel-footer { margin-top: 10px; display: flex; justify-content: flex-end; }
  .snap-fil-confirm-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 16px; border-radius: 8px; border: none;
    background: var(--primary); color: var(--on-accent); font-size: 13px; font-weight: 600;
    cursor: pointer; transition: opacity .12s;
  }
  .snap-fil-confirm-btn:disabled { opacity: .4; cursor: default; }
  .snap-fil-confirm-btn:not(:disabled):hover { opacity: .88; }
  .snap-fil-sel-count {
    min-width: 18px; height: 18px; border-radius: 9px;
    background: var(--ink-25); font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; padding: 0 4px;
  }

  /* ── Temperature row — compact pills "26/0°C" with small icon ───── */
  .snap-temps {
    display: flex; flex-wrap: wrap;
    gap: 6px;
    background: var(--surface-2);
    border-radius: 12px;
    padding: 8px;
  }
  .snap-temp {
    flex: 1 1 0;
    min-width: 64px;
    display: flex; flex-direction: column; align-items: center;
    gap: 2px;
    padding: 6px 4px;
    color: var(--muted);
    transition: color .15s;
  }
  .snap-temp-icon {
    width: 18px; height: 18px;
    color: inherit;
  }
  .snap-temp-val {
    font-size: 12px; font-weight: 700;
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: -.02em;
  }
  .snap-temp--heating { color: var(--danger-text); }
  .snap-temp--heating .snap-temp-val { color: var(--danger-hover); }

  /* Dual-nozzle (H2 series) — active-head highlight (left/right conveyed by
     position; no R/L label needed). */
  .snap-temp--active { box-shadow: inset 0 0 0 1.5px var(--primary); }

  /* Editable pills */
  .snap-temp--editable {
    cursor: pointer;
    border-radius: 8px;
    transition: color .15s, background .15s;
  }
  .snap-temp--editable:hover { background: color-mix(in srgb, var(--info) 8%, transparent); }
  .snap-temp--editing        { background: color-mix(in srgb, var(--info) 12%, transparent); }

  .snap-temp-label {
    font-size: 9px; font-weight: 700; letter-spacing: .04em;
    color: var(--muted);
    line-height: 1;
    text-transform: uppercase;
  }

  /* Inline number input shown when editing a target temp */
  /* Doubled class (0,2,0) to outrank the global `input[type="number"]` rule (0,1,1), which forces
     40px tall + width:100% and blew the pill up to the whole row when its target was edited. */
  .snap-temp-set-input.snap-temp-set-input {
    width: 44px; height: auto; min-width: 0;
    background: var(--surface);
    border: 1.5px solid var(--primary);
    border-radius: 4px;
    font-size: 11px; font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    text-align: center;
    color: var(--text);
    outline: none;
    padding: 2px 3px;
  }
  .snap-temp-set-input::-webkit-inner-spin-button,
  .snap-temp-set-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

  /* ── Filament grid — flex row so all squares share the available
     width evenly. With 4 active extruders we get 4 squares on one
     row; with fewer the squares grow to take the slack. ───────────── */
  .snap-fil-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
  }
  .snap-fil {
    flex: 1 1 0;
    min-width: 0;
    display: flex; flex-direction: column; align-items: center;
    gap: 6px;
  }
  .snap-fil-tag {
    font-size: 12px; font-weight: 700;
    color: var(--muted);
    letter-spacing: .4px;
  }
  .snap-fil-square {
    width: 80%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: var(--surface-2);
    display: flex; align-items: center; justify-content: center;
    padding: 4px;
    overflow: hidden;
    transition: transform .12s, box-shadow .12s;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--info) 35%, transparent) inset;
    margin: 0 auto;  /* keep the smaller square centered inside its flex card */
  }
  .snap-fil-square:hover { transform: translateY(-1px); }
  .snap-fil-square--empty {
    color: var(--muted);
    background-image: linear-gradient(135deg, var(--surface-2) 25%, transparent 25%, transparent 50%,
                                              var(--surface-2) 50%, var(--surface-2) 75%, transparent 75%);
    background-size: 8px 8px;
    box-shadow: none;
  }
  /* "Filled" — slot has filament loaded. Show ONLY the colour fill;
     no outer border (transparent) and no baseline blue inset glow.
     Reads as a clean colour rectangle rather than colour-on-colour
     edges that drew attention to the seam between fill and border. */
  .snap-fil-square--filled {
    border-color: transparent;
    box-shadow: none;
  }
  /* "Configured but empty" — the slot has a colour + material assigned
     in the printer's matlStation but no filament is loaded. We mark
     the identity with a thick coloured ring drawn ENTIRELY INSIDE the
     square's existing footprint via `box-shadow: inset` so the empty
     and filled tiles share the exact same outer dimensions (no 1-2px
     visual jitter when a slot toggles between states). The border
     itself is kept transparent — without zeroing it the element box
     would grow by 4px in CSS's default content-box layout. */
  .snap-fil-square--configured {
    background: transparent;
    color: var(--muted);
    border-color: transparent;
    /* Inline style supplies the coloured `inset` shadow per slot; the
       baseline shadow is cleared here so the colour-specific one isn't
       fighting the default blue inset glow. */
    box-shadow: none;
  }
  .snap-fil-square--configured .snap-fil-main {
    text-shadow: none;
    opacity: 0.65;
    font-weight: 600;
  }
  .snap-fil-main {
    font-size: 11px; font-weight: 700;
    text-align: center;
    line-height: 1.1;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
    text-shadow: 0 1px 2px rgba(0,0,0,.15);
  }
  .snap-fil-square--empty .snap-fil-main { text-shadow: none; }

  /* Stacked layout under each colour square: icon → vendor → material */
  .snap-fil-meta {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0 2px;
    text-align: center;
  }
  .snap-fil-status {
    background: var(--muted);
    flex-shrink: 0;
  }
  .snap-fil-status--locked { background: var(--primary); }
  .snap-fil-vendor {
    width: 100%;
    font-size: 12px; font-weight: 600;
    color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    line-height: 1.2;
  }
  /* Slot identifier label: "Ext." / "1A" / "1B" … */
  .snap-fil-label {
    width: 100%;
    font-size: 10px; font-weight: 700; letter-spacing: .04em;
    color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    line-height: 1.2; text-transform: uppercase;
  }
  .snap-fil-sub {
    width: 100%;
    font-size: 11px; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    line-height: 1.2;
  }
  /* Per-tool nozzle temperature on tool-changer slots (FlashForge Creator 5 Pro) */
  .snap-fil-temp {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 3px;
    font-size: 11px; font-weight: 600; color: var(--text);
    line-height: 1;
  }
  .snap-fil-temp .snap-temp-icon { width: 12px; height: 12px; }
  /* Loaded / No-filament badge shown below sub-type in normal card view */
  .snap-fil-loaded {
    display: inline-block; margin-top: 3px;
    font-size: 10px; font-weight: 600; line-height: 1;
    padding: 2px 5px; border-radius: 4px;
  }
  .snap-fil-loaded--yes { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success-hover-text); }
  .snap-fil-loaded--no  { background: color-mix(in srgb, var(--muted) 12%, transparent); color: var(--muted); }

  /* Creality filament layout:
     row 1 = EXT + CFS-module-1 slots side by side,
     row N = CFS-module-N slots (for N ≥ 2).
     All slots identical size, filling the row width equally. */
  .cre-fil-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .cre-fil-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
  }
  .cre-fil-row .snap-fil {
    flex: 1 1 0;
    min-width: 0;
    /* cap à 1/5 de la ligne (4 gaps × 8px) — évite que Ext. seul prenne toute la largeur */
    max-width: calc((100% - 32px) / 5);
  }
  .cre-fil-row .snap-fil-square {
    aspect-ratio: 1 / 1;
  }
  /* Invisible placeholder that holds the EXT column width so
     extra CFS rows (2A–2D…) align under 1A–1D, not under EXT. */
  .cre-fil-spacer {
    visibility: hidden;
    pointer-events: none;
  }

  /* Camera embed — full-width above the temp / filament blocks */
  .snap-camera {
    margin-top: 8px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
  }
  /* Full-width camera banner container — shared by all printer brands.
     Establishes a 16:9 box with a floor so the camera never collapses
     to a thin strip on narrow panels (min 280 px → 158 px w/ 16:9). */
  .pp-cam-full {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 200px;
    margin: 0;
    padding: 0;
    background: #000;
    line-height: 0;
    overflow: hidden;
  }

  /* ── Camera loading overlay — shared across all printer brands ──────────
     Add .pp-cam-loading to any .pp-cam-full element to show three animated
     dots while the stream is connecting. Remove the class (and the overlay
     child element) once the first frame / iframe load event fires. */
  .pp-cam-loading { background: #080808; }

  .pp-cam-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
  }
  .pp-cam-loading-dots {
    display: flex;
    gap: 7px;
    align-items: center;
  }
  .pp-cam-loading-dots span {
    display: block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--ink-40);
    animation: ppCamDot 1.2s ease-in-out infinite;
  }
  .pp-cam-loading-dots span:nth-child(2) { animation-delay: .2s; }
  .pp-cam-loading-dots span:nth-child(3) { animation-delay: .4s; }
  @keyframes ppCamDot {
    0%, 80%, 100% { opacity: .25; transform: scale(.8); }
    40%           { opacity: 1;   transform: scale(1);   }
  }

  /* On the camera wall the player page is a picture, like every other brand's:
     a click on it must reach the card and open the printer's side card. An
     iframe takes its pointer events for itself and never hands them to the page
     around it, so the card never heard the click. The player's own controls stay
     usable in the side card. */
  .cam-wall-card .snap-camera-frame { pointer-events: none; }
  /* Snapmaker — WebRTC iframe (Crowsnest player, port 80 /webcam/webrtc).
     Crowsnest is responsive: its page fills the iframe viewport naturally.
     Positioned absolute so it covers the full .pp-cam-full box. */
  .snap-camera-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #000;
    border-radius: 0;
  }

  /* Snapmaker on stock firmware — refreshed 1080p stills in an <img> sharing
     the iframe's box (.snap-camera-frame); cover so the 16:9 frame fills it. */
  .snap-camera-still { object-fit: cover; }

  /* FlashForge — raw MJPEG stream served as <img>.
     object-fit:cover fills the 16:9 box and crops the stream edges if
     the camera aspect ratio differs. Self-contained: no dependency on
     .snap-camera-frame. */
  .ffg-camera-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #000;
    border-radius: 0;
    object-fit: cover;
  }

  /* ── FlashForge camera fallback ────────────────────────────────────
     Shown when the MJPEG <img> errors out — typically because the
     printer's mjpg-streamer is already serving its 1 allowed client
     to another viewer. We display the static printer photo so the
     hero area doesn't go blank, with an overlay carrying the error
     message + a Retry button that bumps the camSession to issue a
     fresh GET. */
  .ffg-cam-fallback {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
  }
  .ffg-cam-fallback-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
    /* Slightly desaturated so the live overlay reads as the focal point,
       not the dim photo behind it. */
    filter: grayscale(35%) brightness(0.55);
  }
  .ffg-cam-fallback-img--placeholder {
    background: linear-gradient(135deg, #1c2233, var(--code-bg));
  }
  .ffg-cam-fallback-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    text-align: center;
    /* Slight scrim so the message is legible regardless of the photo's
       average luminance — pure transparent would clash on light shots. */
    background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.55) 100%);
  }
  .ffg-cam-fallback-icon {
    color: #ffb45b;
    background: var(--icon-bg, currentColor);
  }
  .ffg-cam-fallback-msg {
    color: var(--on-dark);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    max-width: 320px;
    text-shadow: 0 1px 2px rgba(0,0,0,.4);
  }
  .ffg-cam-fallback-retry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--ink-30);
    background: var(--ink-08);
    color: var(--on-accent);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .12s;
  }
  .ffg-cam-fallback-retry:hover {
    background: var(--ink-15);
    border-color: var(--ink-60);
  }
  .ffg-cam-fallback-retry:active { transform: translateY(1px); }
  .ffg-cam-fallback-retry .icon { background: currentColor; }

  /* ── Snapmaker WS request log ───────────────────────────────────── */
  /* Inherit the standard .pp-section padding (12px 20px 14px) so the
     visual matches the Raw data section exactly. */
  .snap-log-count {
    display: inline-block;
    margin-left: 4px;
    background: var(--surface-2);
    color: var(--muted);
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 10px; font-weight: 700;
  }
  .snap-log {
    /* No max-height: the log takes whatever vertical space it needs,
       sized by its content. Scrolling is handled by the panel-body
       above (`.detail-panel .panel-body { overflow-y: auto }`), so
       there's no nested scrollbar fighting with the user's wheel. */
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  }
  .snap-log-empty {
    padding: 12px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    background: var(--surface-2);
    border: 1px dashed var(--border);
    border-radius: 8px;
  }
  /* Toolbar above the log list — Pause + Clear */
  .snap-log-toolbar {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
  }
  .snap-log-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 28px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 12px; font-weight: 500;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
  }
  .snap-log-btn:hover { background: var(--surface-2); border-color: var(--primary); }
  .snap-log-btn .icon { background: currentColor; }
  .snap-log-btn--pause.is-paused {
    background: color-mix(in srgb, var(--info) 12%, transparent);
    border-color: var(--primary);
    color: var(--primary-text);
  }
  /* Custom JSON paste zone — collapsible <details>, opens to a
     monospace textarea + Send button so the user can fire
     hand-crafted JSON-RPC frames at the printer for testing. */
  .snap-log-paste { margin-bottom: 8px; }
  .snap-log-paste > summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
    font-size: 11px; font-weight: 600;
    color: var(--muted);
    padding: 6px 4px;
    border-radius: 6px;
    transition: color .12s;
  }
  .snap-log-paste > summary::-webkit-details-marker { display: none; }
  .snap-log-paste > summary::before { content: "+ "; color: var(--primary-text); font-weight: 700; }
  .snap-log-paste[open] > summary::before { content: "− "; }
  .snap-log-paste > summary:hover { color: var(--text); }
  .snap-log-paste-input {
    display: block;
    width: 100%;
    min-height: 96px;
    margin: 4px 0 6px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px; line-height: 1.45;
    resize: vertical;
    outline: none;
    transition: border-color .12s, box-shadow .12s;
  }
  .snap-log-paste-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 15%, transparent);
    background: var(--surface);
  }
  .snap-log-paste-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
  }
  .snap-log-paste-error {
    font-size: 11px;
    color: var(--danger-hover);
    background: color-mix(in srgb, var(--danger) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
    border-radius: 6px;
    padding: 3px 8px;
    flex: 1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .snap-log-paste-send {
    margin-left: auto;
  }
  .snap-log-paste-send.snap-log-paste-send--ok {
    background: var(--primary) !important;
    color: var(--on-accent) !important;
    border-color: var(--primary) !important;
  }
  .snap-log-paste-send--ok .icon { background: var(--on-accent) !important; }

  .snap-log-paused-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    background: rgba(245, 158, 11, .18);
    color: var(--warning-hover);
    border-radius: 999px;
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .4px;
  }

  /* Each row is now a head (clickable) + a hidden detail block. */
  .snap-log-row {
    display: flex; flex-direction: column;
    border-radius: 6px;
    color: var(--text);
    transition: background .12s;
    overflow: hidden;
  }
  .snap-log-row + .snap-log-row { margin-top: 1px; }
  .snap-log-row-head {
    display: grid;
    grid-template-columns: 16px 64px 1fr 16px;
    gap: 6px;
    align-items: center;
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: inherit;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    text-align: left;
    cursor: pointer;
    width: 100%;
    transition: background .12s;
  }
  .snap-log-row-head:hover { background: var(--surface); }
  .snap-log-row--expanded { background: var(--surface); }
  .snap-log-dir {
    font-weight: 700;
    text-align: center;
    line-height: 1;
  }
  .snap-log-row--out .snap-log-dir { color: var(--primary-text); }
  .snap-log-row--in  .snap-log-dir { color: #15803d; }
  .snap-log-ts {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: -.02em;
  }
  .snap-log-summary {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--text);
  }
  .snap-log-row-chev {
    background: var(--muted);
    transition: transform .15s;
  }
  .snap-log-row--expanded .snap-log-row-chev { transform: rotate(90deg); background: var(--primary); }

  /* Expanded detail panel under each row */
  .snap-log-detail {
    position: relative;
    padding: 6px 8px 8px 28px;
    background: var(--surface);
    border-top: 1px dashed var(--border);
  }
  .snap-log-detail[hidden] { display: none; }
  .snap-log-detail-copy {
    position: absolute; top: 6px; right: 8px;
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px;
    padding: 0 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--muted);
    font-family: inherit;
    font-size: 11px; font-weight: 500;
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
  }
  .snap-log-detail-copy:hover { color: var(--text); border-color: var(--primary); }
  .snap-log-detail-copy .icon { background: currentColor; }
  .snap-log-detail-copy--ok {
    background: var(--primary);
    color: var(--on-accent) !important;
    border-color: var(--primary);
  }
  .snap-log-detail-copy--ok .icon { background: var(--on-accent); }
  /* ═══════════════════════════════════════════════════════════════════
     Snapmaker filament edit — modal pushed to /printer.gcode.script
     ═══════════════════════════════════════════════════════════════════ */
  /* Click anywhere on an editable filament card → opens the bottom-sheet
     editor. The whole card is the hit target; the colour square just
     gets a slight lift on hover as a discoverability cue. */
  .snap-fil--editable { cursor: pointer; }
  .snap-fil--editable .snap-fil-square { transition: transform .12s, filter .12s; }
  .snap-fil--editable:hover .snap-fil-square { transform: translateY(-2px); filter: brightness(1.05); }
  /* Slots vides : lift autorisé mais brightness désactivé — le hachage et le contour restent intacts */
  .snap-fil--editable:hover .snap-fil-square--empty { filter: none; }
  /* Active toolhead (Snapmaker only — multi-head system) — green border */
  #snapLive .snap-fil--active { outline: 2px solid var(--success); outline-offset: 2px; border-radius: 10px; }

  /* Bottom-sheet — anchors to the right side of the screen behind the
     printer side card (same width + right alignment). Slides up from the
     bottom on `open`. The backdrop is constrained to the side-card
     footprint so it doesn't dim the rest of the app. */
  .sfe-backdrop {
    position: fixed;
    top: 8px; right: 0; bottom: 8px;
    width: min(440px, 92vw);
    background: rgba(0, 0, 0, .35);
    backdrop-filter: blur(2px);
    border-top-left-radius: 14px;
    border-bottom-left-radius: 14px;
    opacity: 0;
    pointer-events: none;
    /* Hidden when closed, not only transparent — see `.modal-overlay` (60-modals.css). */
    visibility: hidden;
    transition: opacity .2s, visibility 0s linear .2s;
    /* Must sit ABOVE the printer side-card ladder (101-106 in 70-detail-misc.css)
       — the edit sheet shares the right-edge area, so at 102 it was hidden behind
       the printer panel (105). Modal sheet = top layer when open. */
    z-index: 110;
  }
  .sfe-backdrop.open { opacity: 1; pointer-events: auto; visibility: visible; transition-delay: 0s; }

  .sfe-sheet {
    position: fixed;
    right: 0; bottom: 8px;
    width: min(440px, 92vw);
    max-height: 86vh;
    background: var(--surface);
    border: 1px solid var(--border);
    border-right: none;
    border-bottom-left-radius: 14px;
    border-top-left-radius: 18px;
    box-shadow: none;
    z-index: 111;   /* above the printer panel ladder (max 106) — see .sfe-backdrop */
    transform: translateY(calc(100% + 8px));
    transition: transform .28s cubic-bezier(.4, 0, .2, 1), box-shadow .28s;
    display: flex; flex-direction: column;
    overflow: hidden;
  }
  .sfe-sheet.open { transform: translateY(0); box-shadow: -8px -4px 32px rgba(0,0,0,.18); }

  /* Sub-picker sheets (Filament + Colour) — both stack ON TOP of the
     summary sheet (higher z-index). They open taller than the summary
     so their content has room to breathe; the summary stays in place
     underneath, the user keeps their context. */
  .sfe-sheet--color,
  .sfe-sheet--filament {
    z-index: 112;   /* one above .sfe-sheet so sub-pickers stack on the summary */
    min-height: 60vh;
    max-height: 92vh;
    border-top-left-radius: 22px;
    border-bottom-left-radius: 14px;
  }
  /* Drag-grip pill at the top of the sheet — purely decorative, signals
     "this slides". */
  .sfe-grip {
    width: 36px; height: 4px;
    background: var(--border);
    border-radius: 999px;
    margin: 8px auto 0;
    flex-shrink: 0;
  }
  /* Each "screen" stacks inside the sheet — only one is shown at a time
     (the others are toggled `hidden`). */
  .sfe-screen {
    display: flex; flex-direction: column;
    flex: 1; min-height: 0;
  }
  .sfe-screen[hidden] { display: none; }
  .sfe-screen-head {
    display: grid;
    grid-template-columns: 32px 1fr 32px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .sfe-screen-head .sfe-title {
    font-size: 16px; font-weight: 700;
    text-align: center;
  }
  .sfe-screen-head .modal-close { grid-column: 3; }
  /* Variant for the summary header — title aligned left, no back button.
     `auto` (not a fixed 32px) so a multi-button right group — e.g. the file
     sheets' refresh + close pair — sizes to its content instead of overflowing
     the track and clipping the last button off the sheet's right edge. */
  .sfe-screen-head--right { grid-template-columns: 1fr auto; }
  .sfe-screen-head--right .sfe-screen-head-text { grid-column: 1; min-width: 0; }
  .sfe-screen-head--right .sfe-title { text-align: left; }
  .sfe-screen-head--right .modal-close { grid-column: 2; }
  /* Variant sans bouton X — titre seul, pleine largeur */
  .sfe-screen-head--no-close { grid-template-columns: 1fr; }
  .sfe-screen-head--no-close .sfe-title { text-align: left; }
  .sfe-screen-head-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .sfe-screen-head-text .sfe-sub {
    font-size: 12px; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .sfe-back {
    width: 32px; height: 32px;
    border: none; background: var(--surface-2);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted);
    cursor: pointer;
    transition: background .12s, color .12s;
  }
  .sfe-back:hover { background: var(--border); color: var(--text); }
  .sfe-back .icon { background: currentColor; }

  /* Summary lines — Filaments / Color / Subtype rows. Tappable rows
     mirror the iOS-style settings list look. */
  .sfe-line {
    display: flex; align-items: center; gap: 12px;
    width: 100%;
    padding: 16px 4px;
    border: none; background: transparent;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background .1s;
  }
  .sfe-line:hover { background: var(--surface-2); }
  .sfe-line-lbl {
    font-weight: 600;
    flex-shrink: 0;
  }
  .sfe-line-val {
    flex: 1;
    text-align: right;
    color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    min-width: 0;
  }
  .sfe-line-color-dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--neutral);
    box-shadow: 0 0 0 1px rgba(0,0,0,.1) inset;
    margin-left: auto;
    flex-shrink: 0;
  }
  .sfe-line-chev {
    background: var(--muted);
    flex-shrink: 0;
  }
  .sfe-line--input {
    cursor: text;
    padding: 12px 4px;
  }
  .sfe-line--input:hover { background: transparent; }
  .sfe-line--input .sfe-line-lbl {
    display: flex; align-items: center; gap: 4px;
    flex-shrink: 0;
  }
  .sfe-line-input {
    flex: 1;
    margin-left: auto;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    text-align: right;
    outline: none;
    max-width: 60%;
    transition: border-color .12s, box-shadow .12s;
  }
  .sfe-line-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 15%, transparent);
  }
  /* <select> variant — same look as the text input but with a chevron
     dropdown indicator on the right (native select arrows look mismatched
     across platforms). */
  select.sfe-line-input--select {
    appearance: none;
    -webkit-appearance: none;
    text-align: left;
    text-align-last: right;
    padding-right: 28px;
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
  }
  /* Picker bodies use minimal padding so the columns hug the sheet
     edges — matches the mobile layout's edge-to-edge look. */
  .sfe-body--picker { padding: 8px 12px 16px; flex: 1; min-height: 0; display: flex; flex-direction: column; }

  /* Apply button — full-width primary, light fill matching the mobile */
  .sfe-apply {
    width: 100%;
    background: rgba(85, 49, 191, .08) !important;
    color: #553BBF !important;
    border-color: transparent !important;
    font-weight: 700;
    height: 44px !important;
    font-size: 15px;
  }
  .sfe-apply:hover {
    background: rgba(85, 49, 191, .14) !important;
    color: #553BBF !important;
  }

  /* ── Read-only mode (RFID-locked filament) ──────────────────────────
     The sheet opens with the EXACT same layout, order and presentation
     as the editable mode — chevrons, subtype select and Apply button
     all stay visible. The mutating affordances are simply disabled:
     the rows don't react to hover/click, the <select> is `disabled`,
     and the Apply button is `disabled`. The user reads the same
     information but can't change anything. */
  .sfe-sheet--readonly .sfe-line { cursor: default; }
  .sfe-sheet--readonly .sfe-line:hover { background: transparent; }
  /* Soften the chevrons in read-only — they stay in place to keep the
     layout identical, but a slightly muted colour signals "not
     interactive" without screaming about it. */
  .sfe-sheet--readonly .sfe-line-chev { opacity: .35; }
  /* The native disabled state on <select> + the Apply button already
     greys them out and blocks input — nothing extra needed in CSS. */

  /* Colour grid — 5 columns × 5 rows = 25 cells (24 presets + 1 custom).
     Each cell is a fixed 48 px circle centered in its grid track, so
     they stay perfectly round whatever the sheet width. */
  .sfe-color-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px 12px;
    padding: 8px 4px;
    justify-items: center;
  }
  .sfe-color-cell {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background-clip: padding-box;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 0 0 1px rgba(0,0,0,.08) inset;
    transition: transform .1s, box-shadow .1s;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .sfe-color-cell:hover { transform: scale(1.08); }
  .sfe-color-cell.is-selected {
    box-shadow: 0 0 0 3px var(--primary);
  }
  .sfe-color-cell--custom {
    position: relative;
    overflow: hidden;
  }
  .sfe-color-cell--custom .icon {
    background: var(--surface);
    width: 16px; height: 16px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
    pointer-events: none;
    position: relative;
    z-index: 0;
  }
  /* Transparent native colour input overlaid on the custom slot so the
     OS picker anchors to this exact spot when clicked. We can't style
     the OS picker dialog itself, but at least it pops open right next
     to the slot instead of in the top-left corner of the window. */
  .sfe-color-cell-native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    cursor: pointer;
    /* Transparent visually, but still receives pointer events. */
    opacity: 0;
    z-index: 1;
  }
  /* Strip default browser swatch borders so the click target is clean. */
  .sfe-color-cell-native::-webkit-color-swatch-wrapper { padding: 0; }
  .sfe-color-cell-native::-webkit-color-swatch { border: none; }
  .sfe-header {
    padding: 18px 22px 14px;
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
  }
  .sfe-title { font-size: 16px; font-weight: 600; color: var(--text); }
  .sfe-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

  .sfe-body {
    padding: 16px 22px;
    display: flex; flex-direction: column; gap: 14px;
    overflow-y: auto;
  }
  /* File explorer sheet body — tighter padding, scroll, full list */
  .sfe-body--files {
    padding: 8px 12px 16px;
    gap: 0;
    flex: 1; min-height: 0;
  }
  .sfe-body--files .cre-files { display: flex; flex-direction: column; }

  /* File sheet height — taller than filament sheet to show the list */
  .sfe-sheet--files { max-height: 75vh; }

  /* Hold-to-confirm on delete buttons inside the file sheet */
  .cre-file-btn--del {
    position: relative; overflow: hidden;
  }
  .cre-file-btn--del .hold-progress {
    position: absolute; left: 0; top: 0;
    width: 0; height: 100%;
    background: color-mix(in srgb, var(--danger) 30%, transparent);
    pointer-events: none;
  }
  .cre-file-btn--del .icon { position: relative; z-index: 1; }
  .cre-file-btn--del.is-holding { background: color-mix(in srgb, var(--danger) 15%, transparent); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
  .cre-file-btn--del.is-confirming { background: var(--danger); border-color: var(--danger); }
  .cre-file-btn--del.is-confirming .icon { background-color: var(--on-accent); }
  .sfe-field {
    display: flex; flex-direction: column; gap: 6px;
  }
  .sfe-field-label {
    font-size: 12px; font-weight: 500; color: var(--muted);
  }

  .sfe-color-row {
    display: flex; align-items: center; gap: 12px;
  }
  .sfe-color-input {
    width: 64px; height: 64px;
    padding: 0;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    appearance: none; -webkit-appearance: none;
  }
  .sfe-color-input::-webkit-color-swatch-wrapper { padding: 0; border-radius: 10px; }
  .sfe-color-input::-webkit-color-swatch { border: none; border-radius: 10px; }
  .sfe-color-input:hover { border-color: var(--primary); }

  .sfe-color-presets {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
  }
  .sfe-color-chip {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,.12);
    cursor: pointer;
    transition: transform .1s, box-shadow .1s;
    padding: 0;
  }
  .sfe-color-chip:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
  }

  .sfe-input {
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color .12s, box-shadow .12s;
  }
  .sfe-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 15%, transparent);
  }
  .sfe-input--custom {
    margin-top: 6px;
    height: 32px;
    font-size: 12px;
  }
  .sfe-field-opt {
    font-size: 10px; font-weight: 500;
    color: var(--muted);
    margin-left: 4px;
    background: var(--surface-2);
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase; letter-spacing: .4px;
  }

  /* Hide the back-arrow in the stacked picker sub-sheets so the header
     matches the mobile layout (centered title + X on the right only).
     The X is now the single close affordance — it dismisses just the
     picker, not the summary underneath. */
  .sfe-sheet--filament .sfe-back,
  .sfe-sheet--color .sfe-back { display: none; }
  /* Reduce the title row to two columns when there's no back button. */
  .sfe-sheet--filament .sfe-screen-head,
  .sfe-sheet--color .sfe-screen-head {
    grid-template-columns: 1fr 32px;
    padding: 14px 18px;
  }
  .sfe-sheet--filament .sfe-screen-head .sfe-title,
  .sfe-sheet--color .sfe-screen-head .sfe-title {
    grid-column: 1;
    text-align: center;
    font-size: 17px;
    font-weight: 700;
  }
  .sfe-sheet--filament .sfe-screen-head .modal-close,
  .sfe-sheet--color .sfe-screen-head .modal-close { grid-column: 2; }

  /* Edit filament sheets — sans séparateurs horizontaux */
  #elgFilEditSheet .sfe-screen-head,
  #bblFilEditSheet .sfe-screen-head { border-bottom: none; }
  #elgFilEditSheet .sfe-line,
  #bblFilEditSheet .sfe-line        { border-bottom: none; }
  #elgFilEditSheet .sfe-footer,
  #bblFilEditSheet .sfe-footer      { border-top: none; }


  /* Two-column filament picker — iso to the mobile companion:
     vendors on the left (40%), materials on the right (60%), thin
     vertical divider, generous tap-targets, no brand dots. */
  .sfe-fil-picker {
    display: flex;
    flex: 1;
    min-height: 320px;
    background: var(--surface);
  }
  .sfe-fil-vendors,
  .sfe-fil-materials {
    overflow-y: auto;
    padding: 8px 6px;
    display: flex; flex-direction: column;
    gap: 4px;
  }
  .sfe-fil-vendors { flex: 4; }
  /* Column wrapper: search bar on top, scrollable list below */
  .sfe-fil-mat-col {
    flex: 6;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .sfe-fil-mat-col .sfe-fil-materials {
    flex: 1;
    min-height: 0;
  }
  /* Search bar */
  .sfe-fil-mat-search {
    position: relative;
    padding: 6px 8px 4px;
    flex-shrink: 0;
  }
  .sfe-fil-mat-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--muted);
    pointer-events: none;
  }
  .sfe-fil-mat-search-input {
    width: 100%;
    padding: 5px 8px 5px 28px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 12px;
    outline: none;
    box-sizing: border-box;
  }
  .sfe-fil-mat-search-input:focus { border-color: var(--primary); }
  /* Empty state when no match */
  .sfe-fil-empty {
    padding: 12px 8px;
    font-size: 12px;
    color: var(--muted);
    text-align: center;
  }
  .sfe-fil-divider {
    width: 1px;
    background: var(--border);
    flex-shrink: 0;
  }
  /* Rows match the iOS bottom-sheet feel: roomy padding, light grey
     for unselected, bold dark for selected vendor, light blue pill +
     primary colour + green check for selected material. */
  .sfe-fil-row {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 44px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    border-radius: 12px;
    transition: background .12s, color .12s;
    white-space: nowrap;
    overflow: hidden;
    width: 100%;
  }
  .sfe-fil-row:hover { background: var(--surface-2); color: var(--text); }
  /* Vendor (left column) selected — soft grey pill, bold dark text. */
  .sfe-fil-vendors .sfe-fil-row.is-selected {
    background: var(--surface-2);
    color: var(--text);
    font-weight: 700;
  }
  /* Material (right column) selected — light blue pill + primary text. */
  .sfe-fil-materials .sfe-fil-row {
    color: var(--text);
    font-weight: 700;
  }
  .sfe-fil-materials .sfe-fil-row.is-selected {
    background: color-mix(in srgb, var(--info) 10%, transparent);
    color: var(--primary-text);
  }
  .sfe-fil-row-text {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .sfe-fil-row-temp {
    font-size: 10px;
    color: var(--muted);
    margin-left: 4px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .sfe-fil-row-check {
    color: var(--success-hover-text);
    font-weight: 800;
    font-size: 18px;
    margin-left: 6px;
    flex-shrink: 0;
    line-height: 1;
  }
  /* No brand colour dots — the mobile app doesn't show them. We keep
     the modifier class in the markup for backwards-compat but make
     it visually equivalent to the regular row. */
  .sfe-fil-row--brand { padding-left: 16px; position: static; }
  .sfe-fil-row--brand::before { content: none; }

  /* "Use a custom brand / material" disclosure — collapsed by default,
     mirrors the mobile pattern of putting the picker primary and
     freeform secondary. */
  .sfe-fil-custom { margin-top: 6px; }
  .sfe-fil-custom > summary {
    cursor: pointer;
    font-size: 11px; font-weight: 500;
    color: var(--muted);
    padding: 6px 0;
    list-style: none;
    user-select: none;
  }
  .sfe-fil-custom > summary::before { content: "+ "; color: var(--primary-text); }
  .sfe-fil-custom[open] > summary::before { content: "− "; }
  .sfe-fil-custom > summary:hover { color: var(--text); }
  .sfe-fil-custom .sfe-input--custom { display: block; width: 100%; }
  .sfe-fil-custom .sfe-input--custom + .sfe-input--custom { margin-top: 6px; }

  .sfe-error {
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
    color: var(--danger-hover);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px; line-height: 1.4;
  }

  .sfe-footer {
    padding: 12px 18px 18px;
    border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 10px;
  }
  .sfe-footer .adf-btn--primary { flex: 1; }

  .snap-log-detail-pre {
    margin: 0;
    padding: 6px 0 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px; line-height: 1.45;
    color: var(--text);
    white-space: pre-wrap; word-break: break-all;
    max-height: 280px;
    overflow-y: auto;
  }

  /* ── Creality — action bar (LED toggle + print controls) ───────────── */
  .cre-actions {
    display: flex; align-items: center; gap: 8px;
    margin-top: 10px;
  }
  .cre-action-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12px; font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: background .15s, border-color .15s, color .15s;
  }
  .cre-action-btn:hover  { background: var(--surface-3); }
  .cre-action-btn .icon  { background-color: var(--muted); flex-shrink: 0; }

  /* Icon-only variant — files, LED, disable motors, pause, stop are all square
     icon-only buttons */
  .cre-action-btn--files,
  .cre-action-btn--motors,
  .cre-action-btn--led,
  .cre-action-btn--pause,
  .cre-action-btn--stop {
    width: 32px; height: 32px;
    padding: 0;
    justify-content: center;
  }

  /* Files — opens the file explorer sheet */
  .cre-action-btn--files { margin-left: auto; }
  .cre-action-btn--files .icon { background-color: var(--muted); }
  .cre-action-btn--files:hover .icon { background-color: var(--text); }
  .cre-action-btn--led-on {
    background: color-mix(in srgb, var(--warning) 12%, transparent);
    border-color: color-mix(in srgb, var(--warning) 45%, transparent);
    color: #92400e;
  }
  .cre-action-btn--led-on .icon { background-color: var(--warning); }

  /* Pause / Resume */
  .cre-action-btn--pause {
    position: relative; overflow: hidden;
    background: color-mix(in srgb, var(--info) 8%, transparent);
    border-color: color-mix(in srgb, var(--info) 28%, transparent);
    color: var(--primary-text);
  }
  .cre-action-btn--pause .icon { background-color: var(--primary); position: relative; z-index: 1; }
  .cre-action-btn--pause:hover { background: color-mix(in srgb, var(--info) 16%, transparent); }
  .cre-action-btn--pause.is-holding { background: color-mix(in srgb, var(--info) 18%, transparent); }
  .cre-action-btn--pause.is-confirming { background: var(--primary); }
  .cre-action-btn--pause.is-confirming .icon { background-color: var(--on-accent); }

  /* Cancel print */
  .cre-action-btn--stop {
    position: relative; overflow: hidden;
    background: color-mix(in srgb, var(--danger) 8%, transparent);
    border-color: color-mix(in srgb, var(--danger) 28%, transparent);
    color: var(--danger-hover);
  }
  .cre-action-btn--stop .icon { background-color: var(--danger); position: relative; z-index: 1; }
  .cre-action-btn--stop:hover { background: color-mix(in srgb, var(--danger) 16%, transparent); }
  .cre-action-btn--stop.is-holding { background: color-mix(in srgb, var(--danger) 18%, transparent); }
  .cre-action-btn--stop.is-confirming { background: var(--danger); }
  .cre-action-btn--stop.is-confirming .icon { background-color: var(--on-accent); }

  /* Hold-to-confirm progress fill (shared) */
  .cre-action-btn--pause .hold-progress,
  .cre-action-btn--stop  .hold-progress {
    position: absolute; left: 0; top: 0;
    width: 0; height: 100%;
    pointer-events: none;
  }
  .cre-action-btn--pause .hold-progress { background: color-mix(in srgb, var(--info) 25%, transparent); }
  .cre-action-btn--stop  .hold-progress { background: color-mix(in srgb, var(--danger) 25%, transparent); }

  /* ── Creality — file explorer ───────────────────────────────────────── */
  .cre-files-head {
    display: flex; align-items: center;
    margin-bottom: 6px;
  }
  .cre-files-head .snap-block-title { margin-bottom: 0; flex: 1; }

  .cre-file-refresh {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    cursor: pointer;
    transition: background .15s;
  }
  .cre-file-refresh .icon { background-color: var(--muted); }
  .cre-file-refresh:hover { background: var(--surface-3); }
  .cre-file-refresh--loading .icon {
    animation: cre-spin .7s linear infinite;
  }
  @keyframes cre-spin {
    to { transform: rotate(360deg); }
  }

  .cre-files { display: flex; flex-direction: column; gap: 2px; }

  .cre-files-empty {
    font-size: 12px; color: var(--muted);
    padding: 8px 0;
    text-align: center;
    font-style: italic;
  }
  .cre-files-empty--err { color: var(--danger-text); font-style: normal; }

  .cre-file-row {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background .12s;
  }
  .cre-file-row:hover { background: var(--surface-2); }
  .cre-file-row--active {
    background: color-mix(in srgb, var(--info) 7%, transparent);
    border-color: color-mix(in srgb, var(--info) 20%, transparent);
  }

  /* Thumbnail — 52×52 square, rounded, shows background-image set inline */
  .cre-file-thumb {
    flex-shrink: 0;
    width: 52px; height: 52px;
    border-radius: 8px;
    background-color: var(--surface-2);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid var(--border);
  }

  .cre-file-info {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 3px;
  }
  .cre-file-name {
    font-size: 12px; font-weight: 600;
    color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .cre-file-row--active .cre-file-name { color: var(--primary-text); }
  .cre-file-meta {
    font-size: 10px; color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  }

  /* Pills row — duration, swatches, weight, material, temps */
  .cre-file-pills {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  }
  .cre-file-pill {
    font-size: 10px; line-height: 1;
    padding: 2px 5px;
    border-radius: 4px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    white-space: nowrap;
  }
  .cre-file-pill--dim { color: var(--muted); }

  /* Color swatches */
  .cre-file-swatch {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.18);
    flex-shrink: 0;
  }

  .cre-file-btns { display: flex; gap: 4px; flex-shrink: 0; }

  .cre-file-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    cursor: pointer;
    transition: background .13s, border-color .13s;
  }
  .cre-file-btn .icon { flex-shrink: 0; }

  .cre-file-btn--print .icon  { background-color: var(--success); }
  .cre-file-btn--print:hover  { background: color-mix(in srgb, var(--success) 15%, transparent); border-color: color-mix(in srgb, var(--success) 40%, transparent); }

  .cre-file-btn--del .icon { background-color: var(--muted); }
  .cre-file-btn--del:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
  .cre-file-btn--del:hover .icon { background-color: var(--danger); }

  .cre-file-btn--armed {
    background: color-mix(in srgb, var(--danger) 18%, transparent);
    border-color: var(--danger);
    animation: cre-arm-pulse .55s ease-in-out infinite;
  }
  .cre-file-btn--armed .icon { background-color: var(--danger); }

  /* ── Bambu Lab ────────────────────────────────────────────────────────────
     All bbl-* rules have been moved to
     renderer/printers/bambulab/bambulab.css (loaded separately). */

  /* Active AMS/filament slot ring — shared by Creality, Elegoo, FlashForge
     and Bambu Lab (all use .snap-fil--active via their cards.js). */
  .snap-fil--active .snap-fil-square { box-shadow: 0 0 0 2px var(--success); }

  /* AMS block meta (humidity / temp) next to section title — Bambu only,
     also defined in bambulab.css; kept here so the rule loads even if the
     per-brand file is ever skipped during development. */
  .snap-block-meta {
    font-size: .72em;
    font-weight: 400;
    color: var(--muted);
    margin-left: 6px;
  }

/* Info column: let it fill remaining space instead of overflowing */
.snap-block .elg-jog-info-col {
  flex: 1;
  min-width: 0;
}

/* Snapmaker control card — position display, same style as .elg-ctrl-pos */
.snap-ctrl-pos {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.snap-ctrl-pos b { color: var(--text); font-weight: 700; margin-left: 2px; }

/* ── Setup wizard (carousel) ─────────────────────────────────────────────── */
.snap-wizard {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0 8px;
}

/* Dots */
.snap-wizard-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.snap-wizard-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: width 0.2s, border-radius 0.2s, background 0.2s;
}
.snap-wizard-dot--active {
  width: 20px;
  border-radius: 3px;
  background: var(--info);
}

/* Track + slides */
.snap-wizard-track {
  overflow: hidden;
  min-height: 180px;
}
.snap-wizard-slide {
  display: none;
}
.snap-wizard-slide--active {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: snap-wiz-in 0.22s ease;
}
.snap-wizard-track[data-dir="bwd"] .snap-wizard-slide--active {
  animation-name: snap-wiz-in-bwd;
}
@keyframes snap-wiz-in {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes snap-wiz-in-bwd {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Slide header: step number + title */
.snap-wizard-slide-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Nav row (top) */
.snap-wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.snap-wizard-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.snap-wizard-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.snap-wizard-btn--next {
  background: var(--info);
  color: var(--on-accent);
  border-color: transparent;
}
.snap-wizard-btn--next:not(:disabled):hover { opacity: .85; }

/* ── Step 1 installed-version status line (paxx machines) ────────────────── */
.snap-paxx-status {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.snap-paxx-status--upd {
  color: var(--info-text);
  font-weight: 600;
}

/* ── Step 3 cfg status ───────────────────────────────────────────────────── */
.snap-cfg-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.snap-cfg-ok       { font-size: 12px; font-weight: 600; color: var(--success-text); }
.snap-cfg-err      { font-size: 12px; color: var(--danger-text); }
.snap-cfg-warn     { font-size: 12px; color: var(--warning-text); }
.snap-cfg-checking { font-size: 12px; color: var(--muted); font-style: italic; }

/* ── Active extruder highlight ───────────────────────────────────────────── */
.snap-temp--active {
  border-color: var(--primary) !important;
  background: color-mix(in srgb, var(--info) 8%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--info) 15%, transparent);
}

/* ── Job name row (name + files button side by side) ─────────────────────── */
.snap-job-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.snap-job-name-row .snap-job-name {
  flex: 1;
  min-width: 0;
}

/* ── File sheet ──────────────────────────────────────────────────────────── */
.snap-file-sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
  border-radius: inherit;
}
.snap-file-sheet-backdrop.open { opacity: 1; pointer-events: auto; }

.snap-file-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 85%;
  background: var(--surface);
  border-top-left-radius: 18px; border-top-right-radius: 18px;
  box-shadow: 0 -4px 32px rgba(0,0,0,.18);
  z-index: 201;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.snap-file-sheet.open { transform: translateY(0); }

.snap-file-sheet-handle {
  width: 40px; height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 10px auto 0;
  flex-shrink: 0;
}
.snap-file-sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px 10px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.snap-file-sheet-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  flex: 1;
}
.snap-file-sheet-refresh {
  font-size: 16px; color: var(--muted);
  margin-right: 4px;
}
.snap-file-sheet-body {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 8px 0 24px;
}

/* File rows */
.snap-files { display: flex; flex-direction: column; }
.snap-files-empty {
  padding: 32px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.snap-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.snap-file-row:hover { background: var(--surface-2); }
.snap-file-row--active { background: color-mix(in srgb, var(--info) 6%, transparent); }
.snap-file-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.snap-file-name {
  font-size: 12px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.snap-file-meta {
  font-size: 11px; color: var(--muted);
}
.snap-file-btn--print {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .12s;
}
.snap-file-btn--print:hover { background: color-mix(in srgb, var(--info) 12%, transparent); border-color: var(--primary); }
.snap-file-btn--print .icon { background-color: var(--primary); }
.snap-file-btn--print:disabled { opacity: .4; cursor: default; }


/* Fluidd logo icon — panel-action header button (Snapmaker only) */
.icon-fluidd {
  height: 16px;
  aspect-ratio: 446.6 / 512; /* viewBox="32.7 0 446.6 512" */
  -webkit-mask-image: url('../../assets/svg/logos/logo_fluidd.svg');
  mask-image: url('../../assets/svg/logos/logo_fluidd.svg');
}

/* ── FlashForge — light toggle + on-board files (PROTOCOL §13.6 / §13.8) ── */
.ffg-light-btn.is-on {
  background: var(--primary);
  border-color: var(--primary);
}
.ffg-light-btn.is-on .icon { background-color: var(--on-accent); }

.ffg-files-block .ffg-files-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.ffg-files-refresh {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; padding: 0; flex-shrink: 0;
}
.ffg-files-refresh:hover { background: var(--surface); }
.ffg-files-load {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); cursor: pointer; font: inherit;
}
.ffg-files-load:hover { background: var(--surface); }
.ffg-files-empty { color: var(--muted); font-size: 13px; padding: 6px 2px; }
.ffg-files-list { display: flex; flex-direction: column; gap: 8px; }
.ffg-file-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2);
}
.ffg-file-thumb {
  width: 40px; height: 40px; border-radius: 7px; flex-shrink: 0;
  background: var(--surface) center/cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.ffg-file-name {
  flex: 1; min-width: 0; font-size: 13px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ffg-file-print {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  border: none; background: var(--primary); cursor: pointer; padding: 0;
}
.ffg-file-print .icon { background-color: var(--on-accent); }
.ffg-file-print:hover { filter: brightness(1.06); }

/* ── FlashForge — fans / door / error status (PROTOCOL §7) ── */
.ffg-status-block { padding-bottom: 10px; }
.ffg-status-row { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }

/* Fan columns — Elegoo-style: [icon LABEL] on top, [− value +] below.
   No fan-control command on FlashForge → the −/+ are disabled (grey). */
.ffg-fan-row { display: flex; gap: 8px; margin-top: 8px; }
.ffg-fan-col {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: var(--surface-2); border-radius: 8px; padding: 6px 4px;
}
.ffg-fan-col-head { display: flex; align-items: center; gap: 5px; }
.ffg-fan-col-head .icon { background-color: var(--muted); }
.ffg-fan-col-head .icon.ffg-fan-on { background-color: var(--primary); }
.ffg-fan-col-label {
  font-size: 10px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
.ffg-fan-col-controls { display: flex; align-items: center; gap: 6px; }
.ffg-fan-pct { font-size: 12px; font-weight: 600; color: var(--text); min-width: 34px; text-align: center; }
.ffg-fan-step-btn {
  width: 22px; height: 22px; border-radius: 5px; border: none; padding: 0;
  background: var(--surface); color: var(--muted); font-size: 15px; line-height: 1;
}
.ffg-fan-step-btn:disabled { opacity: .4; cursor: not-allowed; }

.ffg-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
}
.ffg-chip .icon { background-color: currentColor; }
.ffg-chip--on { color: var(--primary-text); border-color: var(--primary); }
.ffg-door-chip.is-open {
  color: var(--warning-hover); border-color: var(--warning); background: rgba(245,158,11,.12);
}
.ffg-error-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; margin-bottom: 10px; border-radius: 10px;
  background: color-mix(in srgb, var(--danger) 12%, transparent); border: 1px solid var(--danger); color: var(--danger-hover);
  font-size: 13px; font-weight: 600;
}
.ffg-error-banner .icon { background-color: var(--danger); flex-shrink: 0; }

/* ── FlashForge — printer-info modal ── */
.ffg-info-card { width: min(420px, 92vw); }
.ffg-info-body { padding: 4px 18px 18px; max-height: 70vh; overflow-y: auto; }
.ffg-info-section { margin-top: 14px; }
/* Creator 5 / 5 Pro "Cloud + LAN" firmware block (flashforge/creator5-fw.js). */
.ffg-fw-status {
  font-size: 13px; line-height: 1.45; color: var(--text);
  padding: 8px 10px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.ffg-fw-status--current { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); }
.ffg-fw-status--update  {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}
.ffg-fw-actions { display: flex; gap: 8px; margin-top: 10px; }
.ffg-fw-actions .ffg-fw-btn { flex: 1 1 0; min-width: 0; justify-content: center; }
.ffg-fw-note { margin-top: 8px; font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.ffg-info-section-title {
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.ffg-info-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px solid var(--border);
}
.ffg-info-row:last-child { border-bottom: none; }
.ffg-info-lbl { color: var(--muted); font-size: 13px; flex-shrink: 0; }
.ffg-info-val {
  color: var(--text); font-size: 13px; font-weight: 600; text-align: right;
  word-break: break-all;
}
