/* The QR & Barcode Scanner's own surface on its pages (/tools/qr-scanner/ and its try page; site-src/v5/pages/products.mjs).
   The scanner is on hold: its controls, behaviour and words are unchanged; this is styling only.
   Its notes in the new look (the owner, 5 November 2026: tools/SPEC.md open question 8). Verdict colours are for Link
   Check's verdicts only, and lime is never near a verdict, so the result card's notes are drawn in Ink: the words and the
   icon shapes carry the meaning (a shield for "ok", a warning sign for a caution or a danger), and a danger is the one with
   a 2px Ink edge and bold words. Loaded after demos.css (generated: never edited by hand),
   in the same @scope as demos.css (its rules are scoped to .skin, and a scoped rule wins over an unscoped one). */
@scope (.skin) {
  .act-warn { background: var(--well); }
  .act-warn svg, .act-warn[data-level="danger"] svg, .act-note svg, .lookup-note svg { color: var(--ink); }
  .act-warn[data-level="danger"] { background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink); font-weight: 700; }
  .lookup-error { color: var(--ink); font-weight: 700; }
  /* "Things to know" in the details (card.js: .alert .safe, with .warn or .danger): the old site.css rules, which the
     generated demos.css doesn't carry, in Ink the same way */
  .safe { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; background: var(--well); font-size: 14px; line-height: 1.4; }
  .safe svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--ink); margin-top: 1px; }
  .safe strong { display: block; font-size: 15px; }
  .safe.danger { background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink); }
  /* Reduced motion: the sample codes come back at once, the codes inside them too. Site v2's own reduced-motion rule
     (components.css) gives every element a 0.01 ms transition, so a code's inherited visibility was still "hidden" in the
     instant a card closed, and the code couldn't take the focus back (demos.css covers .samples, not what's in it). */
  @media (prefers-reduced-motion: reduce) { .samples * { transition: none !important; } }
}

/* Below 960px the card has no padding of its own (the layout before), so its content would sit on an edge: the card itself stays edgeless there. */
@media (max-width: 959px) {
  @scope (.skin) { .panel.app-panel { box-shadow: none; } }
}

/* The scanner panel on a computer (tools/SPEC.md §3, qr-scanner-1440.png): the card is the page's own width, the camera
   fills the left half with its two buttons side by side under it, and the right half is the result area, as tall as the
   camera, with "Open it on your phone" at its foot. Below 960px nothing here applies: the phone layout is the one before.
   Why it wasn't there: demos.css's .panel rule uses an old token that .skin doesn't define (--panel-inset), so the card
   had no padding; the old scanner.css puts the result in a fixed 440px column; and components.css gave every .panel-in the Tools menu's 720px (now .tools-panel only). */
@media (min-width: 960px) {
  @scope (.skin) {
    .panel.app-panel { padding: var(--s-6); border-radius: var(--r-surface); }
    .panel.app-panel > .panel-in { gap: var(--s-4); }
    .app { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
    .scan-ui .controls .btn:is(#btn-start, #btn-stop, #btn-file) { flex: 1 1 calc(50% - 5px); }
    /* the result area is as tall as the camera (its 4:3 box: three eighths of the width of the two columns), never taller
       than the room the camera has on a short screen (scanner.css caps it the same way) */
    .scan-ui .results-col { min-height: min(calc((100cqw - 40px) * .375), max(180px, calc(100svh - 220px))); }
    .scan-ui .empty-result { flex: 1 1 auto; align-items: center; }
  }
}
/* (design v5: the page's explainers, "What happens when you scan", "What it reads" and "Where product info comes from", are drawn by
   assets/css/v5/products.css) */
