/* ── BOTÃO FIXO ── */
    #scan-fab {
      position: fixed;
      bottom: 2rem;
      left: 50%;
      transform: translateX(-50%);
      z-index: 900;
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 14px 28px;
      color: #fff;
	  background: #000;
      border: none;
      border-radius: 50px;
	  text-transform: uppercase;
      font-size: 15px;
      font-weight: 500;
      letter-spacing: 0.02em;
      cursor: pointer;
      box-shadow: 0 4px 24px rgba(26,24,20,0.22);
      transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
    }
    #scan-fab:hover {
      box-shadow: 0 6px 32px rgba(200,96,58,0.28);
      transform: translateX(-50%) translateY(-2px);
    }
    #scan-fab svg { flex-shrink: 0; }
 
    /* ── OVERLAY ── */
    #scan-overlay {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 1000;
      background: rgba(26,24,20,0.55);
      backdrop-filter: blur(4px);
      align-items: flex-end;
      justify-content: center;
      padding: 0;
    }
    #scan-overlay.open { display: flex; }
 
    /* ── DRAWER ── */
    #scan-drawer {
      background: var(--paper);
      width: 100%;
      max-width: 640px;
      max-height: 92vh;
      border-radius: 20px 20px 0 0;
      overflow-y: auto;
      padding: 0 0 2rem;
      transform: translateY(100%);
      transition: transform 0.35s cubic-bezier(.32,.72,0,1);
      position: relative;
    }
    #scan-overlay.open #scan-drawer { transform: translateY(0); }
 
    .drawer-handle {
      width: 40px; height: 4px;
      background: var(--border);
      border-radius: 2px;
      margin: 14px auto 0;
    }
 
    .drawer-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 1.25rem 1.5rem 1rem;
      border-bottom: 1px solid var(--border);
    }
    .drawer-header h2 {
      font-family: var(--font-display);
      font-weight: 500;
      font-size: 1.2rem;
    }
 
    /* ── STEPS ── */
    .step { display: none; }
    .step.active { display: block; }
 
    /* Step 1 — Câmara */
    #step-scan { padding: 1.25rem 1.5rem; }
 
    #viewport-wrap {
      position: relative;
      background: #111;
      border-radius: var(--radius);
      overflow: hidden;
      aspect-ratio: 16/9;
    }
    #viewport-wrap video,
    #viewport-wrap canvas {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
 
    .scan-overlay-ui {
      position: absolute; inset: 0;
      display: flex; align-items: center; justify-content: center;
      pointer-events: none;
    }
    .scan-frame {
      width: 60%; max-width: 280px;
      aspect-ratio: 3/1;
      border: 2px solid var(--accent);
      border-radius: 8px;
      position: relative;
    }
    .scan-frame::before {
      content: '';
      position: absolute; left: 0; right: 0;
      height: 2px;
      background: var(--accent);
      animation: scanline 2s ease-in-out infinite;
      opacity: 0.8;
    }
    @keyframes scanline { 0%,100% { top: 5%; } 50% { top: 90%; } }
 
    #cam-placeholder {
      position: absolute; inset: 0;
      display: flex; flex-direction: column;
      align-items: center; justify-content: center;
      gap: 10px; color: #666;
    }
    #cam-placeholder p { font-size: 13px; }
 
    #scan-status {
      margin-top: 10px;
      text-align: center;
      font-size: 13px;
      color: var(--muted);
      min-height: 20px;
    }
 
    .scan-actions {
      display: flex; gap: 10px; margin-top: 14px;
    }
 
    .isbn-manual {
      margin-top: 14px; padding-top: 14px;
      border-top: 1px solid var(--border);
      display: flex; gap: 8px;
    }
    .isbn-manual input {
      flex: 1; padding: 10px 12px;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      font-family: var(--font-body);
      font-size: 14px;
      background: var(--paper);
      color: var(--ink);
      outline: none;
      transition: border-color 0.15s;
    }
    .isbn-manual input:focus { border-color: var(--accent); }
    .isbn-manual input::placeholder { color: var(--muted); }
 
    /* Step 2 — Loading */
    #step-loading {
      padding: 3rem 1.5rem;
      text-align: center;
    }
    .spinner {
      width: 36px; height: 36px;
      border: 2px solid var(--border);
      border-top-color: var(--accent);
      border-radius: 50%;
      animation: spin 0.7s linear infinite;
      margin: 0 auto 1rem;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    #step-loading p { font-size: 14px; color: var(--muted); }
    #step-loading .isbn-shown {
      font-family: var(--font-display);
      font-size: 1.1rem;
      color: var(--ink);
      margin-bottom: 6px;
    }
 
    /* Step 3 — Formulário */
    #step-form { padding: 1.25rem 1.5rem; }
 
    .book-preview {
      display: flex; gap: 14px;
      padding: 14px;
      background: var(--warm);
      border-radius: var(--radius);
      margin-bottom: 1.5rem;
      align-items: flex-start;
    }
    .book-thumb {
      width: 56px; min-width: 56px; height: 80px;
      border-radius: 4px;
      background: var(--border);
      overflow: hidden;
      display: flex; align-items: center; justify-content: center;
    }
    .book-thumb img { width: 100%; height: 100%; object-fit: cover; }
    .book-preview-info { min-width: 0; }
    .book-preview-title {
      font-family: var(--font-display);
      font-size: 1rem; font-weight: 500;
      margin-bottom: 2px;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .book-preview-sub { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
    .source-badge {
      display: inline-block;
      padding: 2px 8px;
      border-radius: 20px;
      font-size: 11px; font-weight: 500;
    }
    .badge-db { background: #e8f4ee; color: var(--success); }
    .badge-api { background: var(--accent-pale); color: var(--accent); }