/* ── Bambu Lab printer sidecard styles ───────────────────────────────────
   Loaded after 50-snapmaker.css so Bambu-specific rules can safely
   reference the shared .pp-cam-full / .snap-* containers defined there.
   Nothing in this file is used outside the Bambu Lab brand context.

   NOTE: No @media wrapper — the printer side-panel is always dark
   regardless of system colour scheme, so all rules apply unconditionally.
   ──────────────────────────────────────────────────────────────────────── */

/* ── Camera — JPEG TCP (A1 / A1 Mini / P1P / P1S) ─────────────────────────
   Raw JPEG frames streamed by the main process via IPC (port 6000 TLS).
   Frames are injected into <img id="bblCamImg"> as data: URLs.
   The image fills the .pp-cam-full 16:9 container absolutely. */
.bbl-camera-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
  display: block;
  background: #000;
  object-fit: cover;
}

/* ── Camera — RTSP info card (kept for reference, not currently used) ───── */
.bbl-cam-rtsp {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d0d0d;
}

.bbl-rtsp-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 24px;
  background: var(--ink-06);
  border: 1px solid var(--ink-12);
  border-radius: 14px;
  text-align: center;
  max-width: 280px;
}

.bbl-rtsp-card-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ink-08);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 2px;
}
.bbl-rtsp-card-icon .icon { background-color: var(--ink-70); }

.bbl-rtsp-label {
  font-size: .82em; font-weight: 700;
  color: var(--ink-85);
  letter-spacing: .2px;
  margin: 0;
}

.bbl-rtsp-hint {
  font-size: .72em;
  color: var(--ink-40);
  margin: 0;
  line-height: 1.5;
}

.bbl-rtsp-url-row {
  width: 100%;
  margin-top: 4px;
}

.bbl-rtsp-url {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-size: .68em;
  color: var(--ink-60);
  background: var(--ink-04);
  border: 1px solid var(--ink-10);
  border-radius: 6px;
  padding: 4px 8px;
  word-break: break-all;
  font-family: monospace;
}

.bbl-rtsp-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.bbl-rtsp-actions .snap-log-btn { font-size: .78em; flex: 1; justify-content: center; }

/* ── Camera loading state ─────────────────────────────────────────────────
   Uses the shared .pp-cam-loading / .pp-cam-loading-overlay /
   .pp-cam-loading-dots classes defined in 50-snapmaker.css.
   Only Bambu-specific tweak: hide the broken-image icon on the <img>
   until the first IPC frame arrives. */
.pp-cam-loading .bbl-camera-img {
  opacity: 0;
}

/* Invisible placeholder for absent AMS slots (e.g. AMS HT has 1 slot).
   Keeps all rows at 5 flex children so columns stay aligned. */
.bbl-fil-spacer {
  visibility: hidden;
  pointer-events: none;
}

/* ── AMS filament slots ───────────────────────────────────────────────────
   The AMS grid reuses .snap-fil / .snap-fil-square / .snap-fil-grid from
   50-snapmaker.css. The active-slot ring (.snap-fil--active) is shared
   across brands and lives in 50-snapmaker.css.

   AMS block meta label (humidity / temp reading next to section title). */
.snap-block-meta {
  font-size: .72em;
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
}

/* ── Bambu filament slot — editable cursor ───────────────────────────────── */
.snap-fil--editable {
  cursor: pointer;
}

/* ── Filament edit sheet — summary row ──────────────────────────────────── */
.sfe-fil-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.sfe-color-summary-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-15);
  flex-shrink: 0;
}
.sfe-fil-summary-val {
  font-size: .9em;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Section trigger buttons (Color / Filament rows) ────────────────────── */
.sfe-section-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-size: .88em;
}
.sfe-section-trigger:hover {
  background: var(--surface-2);
}
.sfe-section-trigger-label {
  flex: 1;
  font-weight: 500;
}
.sfe-section-trigger-val {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--ink-15);
  flex-shrink: 0;
}
.sfe-section-trigger .icon {
  background-color: var(--muted);
  flex-shrink: 0;
}

/* ── Solo filament picker (no vendor column) ─────────────────────────────── */
.sfe-fil-picker--solo {
  display: flex;
  flex: 1;
  min-height: 320px;
  background: var(--surface);
}

/* ── Cloud connection = read-only ────────────────────────────────────────
   Only the light answers over the account broker, so the control card keeps
   the light and the fan READINGS and drops every command control. What is
   left has to stand on its own: the light column no longer sits opposite a
   jog pad, so it aligns left instead of being pushed to the right edge, and
   the fan icon is a plain marker (no hover, no pointer) rather than a button
   that looks pressable and does nothing. */
.acu-ctrl .acu-jog-extra--alone { margin-left: 0; align-items: flex-start; }
.elg-fan-icon-btn--static { cursor: default; }
.elg-fan-icon-btn--static:hover { background: var(--surface-2); }
.elg-fan-icon-btn--static:hover .icon { background-color: var(--muted); }
.elg-fan-icon-btn--static.elg-fan-icon-btn--on:hover { background: color-mix(in srgb, var(--success) 10%, transparent); }
.elg-fan-icon-btn--static.elg-fan-icon-btn--on:hover .icon { background-color: var(--success); }

/* Cloud ⇄ LAN switch in the settings form (mode-switch.js): a two-option pill
   whose knob slides under the active side. */
.bbl-mode-switch { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bbl-mode-switch .pba-tuto-pill { margin: 0; }
.bbl-mode-switch > .bbl-mode-pill:only-child { margin-left: auto; }
.bbl-mode-pill {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; isolation: isolate;
  min-width: 132px; padding: 3px; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border);
}
.bbl-mode-knob {
  position: absolute; z-index: -1; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  border-radius: 999px; background: var(--primary);
  transition: transform .22s cubic-bezier(.4, 0, .2, 1);
}
.bbl-mode-pill[aria-checked="true"] .bbl-mode-knob { transform: translateX(100%); }
.bbl-mode-opt { padding: 5px 12px; font-size: 12px; font-weight: 700; text-align: center; color: var(--muted); transition: color .2s; }
.bbl-mode-pill[aria-checked="false"] [data-bbl-side="cloud"],
.bbl-mode-pill[aria-checked="true"]  [data-bbl-side="lan"] { color: var(--on-accent); }
