:root {
  --bg: #f3f4f6; --card: #fff; --text: #111827; --muted: #6b7280;
  --accent: #c70205; --accent-text: #c70205; --accent-bg: #fdecec; --border: #e5e7eb; --head: #1f2937;
  --warn: #92400e; --warn-bg: #fef3c7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111827; --card: #1f2937; --text: #f9fafb; --muted: #9ca3af;
    --accent: #c70205; --accent-text: #ff6b6e; --accent-bg: #3b0a0b; --border: #374151; --head: #030712;
    --warn: #fcd34d; --warn-bg: #451a03;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); background: #fff; color: #111827; border-bottom: 1px solid #e5e7eb; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { height: 34px; width: auto; flex: none; }
h1 { margin: 0; font-size: .95rem; font-weight: 600; color: #4b5563; padding-left: 12px; border-left: 1px solid #e5e7eb; }
.lang { display: flex; flex: none; border: 1px solid #d1d5db; border-radius: 8px; overflow: hidden; }
.lang button { background: none; color: #4b5563; border: 0; padding: 6px 12px; font-weight: 600; cursor: pointer; }
.lang button.on { background: #c70205; color: #fff; }
@media (max-width: 400px) { .logo { height: 28px; } h1 { font-size: .8rem; padding-left: 8px; } }
main { max-width: 640px; margin: 0 auto; padding: 16px; }
.scan:hover { background: #a80104; }
.scan { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px;
  font-size: 1.1rem; font-weight: 600; color: #fff; background: var(--accent); border: 0; border-radius: 12px; cursor: pointer; }
.scan svg { width: 28px; height: 28px; }
#scanner { position: relative; margin-top: 12px; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 4/3; }
#scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame { position: absolute; left: 10%; right: 10%; top: 30%; bottom: 30%; border: 3px solid rgba(255,255,255,.85); border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.35); pointer-events: none; }
.stop { position: absolute; right: 10px; bottom: 10px; padding: 8px 14px; border: 0; border-radius: 8px; background: rgba(255,255,255,.9); font-weight: 600; cursor: pointer; }
#searchForm { margin-top: 12px; }
#q { width: 100%; padding: 14px; font-size: 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--text); }
#q:focus { outline: 2px solid var(--accent); border-color: transparent; }
.status { color: var(--muted); font-size: .9rem; margin: 12px 4px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.lib { font-weight: 600; margin-bottom: 2px; }
.gamme { color: var(--muted); font-size: .8rem; margin-bottom: 10px; }
dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; align-items: baseline; }
dt { color: var(--muted); font-size: .85rem; }
dd { margin: 0; font-family: ui-monospace, "SF Mono", Consolas, monospace; word-break: break-word; }
.new { background: var(--accent-bg); border-radius: 8px; padding: 8px 10px; margin-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.new .lbl { color: var(--muted); font-size: .75rem; display: block; }
.new .val { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 1.15rem; font-weight: 700; color: var(--accent-text); word-break: break-word; }
.new .old { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .85rem; }
.copy { flex: none; border: 1px solid var(--border); background: var(--card); color: var(--text); border-radius: 6px; padding: 4px 8px; font-size: .8rem; cursor: pointer; }
.none { color: var(--muted); font-style: italic; margin-top: 6px; }
.warn { margin-top: 8px; padding: 6px 10px; border-radius: 6px; background: var(--warn-bg); color: var(--warn); font-size: .85rem; }
mark { background: none; color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
