#drive-card { margin: 0 0 14px; }
#drive-card h3 { margin: 0 0 8px; font-size: 16px; }
#drive-card input { width: 100%; box-sizing: border-box; background: #0d1117; border: 1px solid var(--border); color: var(--fg); border-radius: 10px; padding: 12px; font-size: 16px; margin: 6px 0 10px; }
.btn-linklike { display: inline-block; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; color: var(--cyan, #00E5C0); text-decoration: none; }
.gfile { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.gfile button { flex-shrink: 0; }
.login-card { max-width: 420px; margin: 24px auto; }
.login-card select, .login-card input, .field input, .field select, .search {
  width: 100%; box-sizing: border-box; background: #0d1117; border: 1px solid var(--border);
  color: var(--fg); border-radius: 10px; padding: 12px; font-size: 16px; margin: 6px 0 10px;
}
.preview-wrap {
  position: relative; background: #000; border-radius: 12px; overflow: hidden; margin-bottom: 8px;
  width: 100%; height: 40vh; touch-action: none;
  -webkit-user-select: none; user-select: none;
  overscroll-behavior: contain;
}
#preview-inner {
  position: absolute; left: 0; top: 0;
  transform-origin: 0 0; will-change: transform;
  touch-action: none;
}
.zoom-bar { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; }
.zoom-bar button { min-width: 40px; }
#zoom-label { min-width: 56px; text-align: center; font-size: 13px; color: var(--muted); }
.view-badge {
  position: absolute; right: 8px; top: 8px; z-index: 3;
  font-size: 11px; padding: 4px 8px; border-radius: 999px;
  background: #0d1117cc; color: var(--cyan); border: 1px solid var(--cyan);
  pointer-events: none;
}
.view-badge[hidden] { display: none; }
#btn-swap[hidden] { display: none; }
.preview-wrap img {
  display: block; width: 100%; height: 100%;
  max-width: none; max-height: none;
  object-fit: fill; pointer-events: none;
  -webkit-user-drag: none; user-select: none;
}
.preview-wrap canvas {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  pointer-events: none; touch-action: none;
}
.preview-wrap canvas#crop[hidden] { display: none; }
.preview-wrap.is-pdf {
  height: 70vh;
  touch-action: auto;
  overflow: hidden;
}
.preview-wrap.is-pdf #preview-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform: none !important;
}
.preview-wrap iframe#preview-pdf {
  display: block; width: 100%; height: 100%;
  border: 0; background: #fff;
}
.preview-wrap iframe#preview-pdf[hidden] { display: none; }
.preview-wrap.is-pdf img, .preview-wrap.is-pdf canvas { display: none; }
#pdf-open-row { margin: 0 0 12px; }
#pdf-open-row[hidden] { display: none; }
.pdf-open-button {
  display: block; box-sizing: border-box; width: 100%;
  padding: 11px 14px; border: 1px solid var(--cyan); border-radius: 10px;
  background: var(--cyan); color: #07110f; font-weight: 700;
  text-align: center; text-decoration: none;
}
#zoom-bar[hidden] { display: none; }
#btn-save-photo[hidden] { display: none !important; }
#btn-enhance[hidden], #btn-detect[hidden] { display: none !important; }
#ocr-box { margin: 0 0 12px; }
#ocr-box[hidden] { display: none !important; }
.copy-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 12px; color: var(--muted); }
.copy-row button { font-size: 12px; padding: 4px 10px; }
.ocr-snip {
  display: block; width: 100%; box-sizing: border-box;
  white-space: pre-wrap; word-break: break-word;
  max-height: 12em; overflow: auto;
  font-size: 12px; line-height: 1.4; font-family: inherit;
  background: #0d1117; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px; margin: 0;
  color: var(--fg);
}
.inbox-item {
  display: flex; gap: 10px; align-items: center; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px; margin-bottom: 8px;
}
.inbox-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: #0d1117; }
.inbox-item strong { display: block; font-size: 14px; }
.inbox-item span { font-size: 12px; color: var(--muted); }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.badge.ok { color: #3fb950; border: 1px solid #3fb950; }
.badge.warn { color: #e3b341; border: 1px solid #d29922; }
.badge.bad { color: #f85149; border: 1px solid #f85149; }
.field { margin-bottom: 8px; }
.field label { display: block; font-size: 12px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip {
  font-size: 12px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: #21262d; color: var(--muted); cursor: pointer;
}
.chip.on { color: var(--cyan); border-color: var(--cyan); }
.tag-add { display: flex; gap: 8px; margin: 8px 0 14px; }
.tag-add input { flex: 1; margin: 0; }
.tag-add button { flex-shrink: 0; }
.busy { pointer-events: none; }
body.busy { padding-top: 42px; }
body.busy header, body.busy section { opacity: 0.72; }
#err { color: #f85149; font-size: 13px; min-height: 1.2em; }
#work-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  display: flex; align-items: center; gap: 10px;
  height: 26px; padding: 0 12px;
  background: #0b0d12f2; border-bottom: 1px solid var(--cyan);
  color: var(--cyan); font-size: 12px;
}
#work-banner[hidden] { display: none !important; }
.work-bar {
  flex: 1; height: 3px; border-radius: 99px; overflow: hidden;
  background: #1a2330;
}
.work-bar::after {
  content: ""; display: block; height: 100%; width: 32%;
  background: var(--cyan);
  animation: work-slide 1.15s ease-in-out infinite;
}
@keyframes work-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(380%); }
}
.err-box {
  background: #2a1117; border: 1px solid #f85149; border-radius: 10px;
  padding: 8px 10px; margin: 8px 0;
}
.err-box[hidden] { display: none !important; }
.err-box .err { margin: 0 0 6px; max-height: 4.8em; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.err-full {
  display: block; width: 100%; box-sizing: border-box;
  min-height: 5em; max-height: 10em; margin: 0 0 8px;
  font-size: 11px; font-family: ui-monospace, Consolas, monospace;
  background: #0d1117; color: var(--fg); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px; white-space: pre-wrap; word-break: break-word;
}
.err-box button { font-size: 12px; }
section[hidden] { display: none !important; }
button.back {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
  background: #21262d; color: var(--cyan); font-size: 18px; cursor: pointer;
}
button.back[hidden] { display: none !important; }
#del-modal {
  position: fixed; inset: 0; z-index: 50; background: #0b0d12f2;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
#del-modal[hidden] { display: none !important; }
.del-card {
  width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px;
}
.del-card h2 { margin: 0 0 8px; font-size: 18px; }

/* Bibliothèque */
.lib-filters {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 10px;
}
.lib-filters select {
  flex: 1 1 140px; min-width: 0; box-sizing: border-box;
  background: #0d1117; border: 1px solid var(--border); color: var(--fg);
  border-radius: 10px; padding: 10px; font-size: 14px;
}
#lib-tags { margin: 4px 0 10px; }
#lib-results .inbox-item strong { display: block; font-size: 14px; }
#lib-results .inbox-item span { font-size: 12px; color: var(--muted); display: block; }
#lib-count { margin: 4px 0 8px; }
#lib-more { width: 100%; margin-top: 8px; }
