/* KB_CAMFAB: floating camera button. Sits at the bottom inline-end corner, stacked ABOVE the assistant bubble and the
   phone tab bar (camfab.js measures both and sets --cam-b), clear of the safe areas. 52px round, 56px tall when extended. */
.kb-cam{--cam-b:0px;position:fixed;z-index:58;right:calc(16px + env(safe-area-inset-right,0px));
  bottom:max(calc(var(--cam-b) + 12px),calc(16px + env(safe-area-inset-bottom,0px)));
  height:52px;min-width:52px;padding:0 14px;border:0;border-radius:26px;display:inline-flex;align-items:center;justify-content:center;gap:8px;
  background:#0f172a;color:#fff;font-weight:600;font-size:15px;line-height:1;font-family:inherit;cursor:pointer;
  box-shadow:0 10px 24px -8px rgba(15,23,42,.55),0 2px 6px rgba(15,23,42,.2);
  transition:bottom .2s ease,opacity .18s,transform .18s,padding .2s;-webkit-tap-highlight-color:transparent}
.kb-cam[hidden]{display:none}
.kb-cam svg{flex:none}
.kb-cam-l{max-width:0;overflow:hidden;white-space:nowrap;transition:max-width .25s ease}
.kb-cam.is-ext .kb-cam-l{max-width:16em}
.kb-cam:not(.is-ext){padding:0;width:52px}
.kb-cam:hover{transform:translateY(-2px)}
.kb-cam:focus-visible{outline:3px solid #a5b4fc;outline-offset:3px}
.kb-cam.is-off{opacity:0;visibility:hidden;pointer-events:none}
[dir=rtl] .kb-cam{right:auto;left:calc(16px + env(safe-area-inset-left,0px))}
@media (max-width:640px){.kb-cam{right:calc(10px + env(safe-area-inset-right,0px))}
  /* KB_TABFIX: never lower than tab bar + safe area + 12px, even before camfab.js has measured */
  body.has-kbt .kb-cam{bottom:max(calc(var(--cam-b) + 12px),calc(var(--kbt-h,64px) + env(safe-area-inset-bottom,0px) + 12px))}
  [dir=rtl] .kb-cam{right:auto;left:calc(10px + env(safe-area-inset-left,0px))}}
.kb-cam-in{position:fixed;left:0;top:0;width:1px;height:1px;opacity:0;pointer-events:none}
/* the app's own "Scan document to PDF" pill would sit on top of this button */
.kb-cam.is-defer{display:none!important}

.kb-cam-sheet{border:0;padding:16px 16px calc(16px + env(safe-area-inset-bottom,0px));border-radius:20px 20px 0 0;width:100%;max-width:480px;
  margin:auto auto 0;background:#fff;color:#0f172a;box-shadow:0 -10px 40px rgba(15,23,42,.25)}
.kb-cam-sheet::backdrop,.kb-cam-live::backdrop{background:rgba(15,23,42,.5)}
@media (min-width:641px){.kb-cam-sheet{margin:auto;border-radius:20px;padding-bottom:16px}}
.kb-cam-sh-hd{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.kb-cam-sh-hd h2{font-size:18px;margin:0}
.kb-cam-x{width:44px;height:44px;border:0;border-radius:50%;background:#f1f5f9;color:#0f172a;font-size:24px;line-height:1;cursor:pointer;flex:none}
.kb-cam-opts{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.kb-cam-opt{width:100%;display:flex;align-items:center;gap:12px;text-align:start;padding:12px;min-height:60px;border:1px solid #e2e8f0;border-radius:14px;background:#f8fafc;color:inherit;font:inherit;cursor:pointer}
.kb-cam-opt:hover,.kb-cam-opt:focus-visible{border-color:#6366f1;background:#eef2ff}
.kb-cam-opt b{display:block;font-size:16px}
.kb-cam-opt small{display:block;color:#475569;font-size:13px;margin-top:2px}
.kb-cam-ic{font-size:26px;width:40px;text-align:center;flex:none}

.kb-cam-live{border:0;padding:0;background:#000;width:min(96vw,760px);max-height:94vh;border-radius:16px;overflow:hidden}
.kb-cam-live video{display:block;width:100%;max-height:calc(94vh - 84px);background:#000;object-fit:contain}
.kb-cam-live-bar{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background:#000}
.kb-cam-sp{width:44px}
.kb-cam-shoot{width:60px;height:60px;border-radius:50%;border:4px solid #fff;background:#ef4444;cursor:pointer}
.kb-cam-shoot:focus-visible{outline:3px solid #a5b4fc;outline-offset:3px}
@media (prefers-reduced-motion:reduce){.kb-cam,.kb-cam-l{transition:none}}
@media print{.kb-cam{display:none!important}}
