/* Wipye v122 chat camera (wipye-chat-camera.js). Full-screen, edge to edge, WhatsApp-style.
   The host modal becomes a plain black full-screen layer; everything else lives in #wipyeCamera. */
#chatModal[data-layout="wcam"],.wrc-modal[data-layout="wcam"]{position:fixed!important;inset:0!important;z-index:600!important;display:block!important;width:auto!important;height:auto!important;max-width:none!important;max-height:none!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:#000!important;box-shadow:none!important;transform:none!important;animation:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;overflow:hidden!important;overscroll-behavior:none;color-scheme:dark}
#chatModal[data-layout="wcam"][hidden]{display:none!important}
#chatModal[data-layout="wcam"] .wc-dialog,#chatModal[data-layout="wcam"] #chatModalBody,.wrc-modal[data-layout="wcam"] .wrc-modal-body{display:contents!important}
#chatModal[data-layout="wcam"] .wc-dialog>header,#chatModal[data-layout="wcam"] .wc-dialog-status{display:none!important}

#wipyeCamera{--wcam-safe-t:env(safe-area-inset-top,0px);--wcam-safe-b:env(safe-area-inset-bottom,0px);position:fixed;inset:0;z-index:1;overflow:hidden;background:#000;color:#fff;font:15px/1.35 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none;touch-action:none}
#wipyeCamera *,#wipyeCamera *::before,#wipyeCamera *::after{box-sizing:border-box}
#wipyeCamera [hidden]{display:none!important}
#wipyeCamera .wcam-cam,#wipyeCamera .wcam-review{position:absolute;inset:0}
#wipyeCamera[data-state="review"] .wcam-cam,#wipyeCamera:not([data-state="review"]) .wcam-review{display:none}

/* Buttons: reset everything the host pages give to <button>. */
#wipyeCamera button,#wipyeCamera .wcam-btn{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:none;width:auto;min-width:0;min-height:0;height:auto;margin:0;padding:0;border:0;border-radius:999px;background:none;box-shadow:none;color:#fff;font:inherit;line-height:1;text-decoration:none;cursor:pointer;touch-action:manipulation;-webkit-touch-callout:none}
#wipyeCamera button:disabled{opacity:.45;cursor:default}
#wipyeCamera button:focus-visible,#wipyeCamera a:focus-visible,#wipyeCamera input:focus-visible{outline:2px solid #fff;outline-offset:3px}
#wipyeCamera .wcam-btn{width:44px;height:44px}
#wipyeCamera .wcam-btn svg{width:26px;height:26px}

/* Live view. */
/* The stage takes the camera's own shape (--wcam-ar = videoWidth/videoHeight, 9:16 on a portrait
   phone): full width, top-aligned, black below for the controls, like WhatsApp. No crop on phones;
   only when the screen is shorter than the video (landscape windows) does cover trim the edges. */
#wipyeCamera .wcam-stage{position:absolute;left:0;right:0;top:0;width:100%;aspect-ratio:var(--wcam-ar,9/16);max-height:100%;overflow:hidden;background:#000;touch-action:none}
#wipyeCamera[data-shape="landscape"] .wcam-stage{top:50%;transform:translateY(-50%)}
#wipyeCamera .wcam-live{display:block;width:100%;height:100%;object-fit:cover;pointer-events:none}
#wipyeCamera[data-mirror="true"] .wcam-live{transform:scaleX(-1)}
#wipyeCamera .wcam-spinner{position:absolute;left:50%;top:45%;width:34px;height:34px;margin:-17px 0 0 -17px;border:3px solid #ffffff40;border-top-color:#fff;border-radius:50%;animation:wcam-spin .8s linear infinite}
#wipyeCamera .wcam-shot{position:absolute;inset:0;background:#fff;opacity:0;pointer-events:none}
#wipyeCamera .wcam-shot.is-on{animation:wcam-shot .28s ease-out}
@keyframes wcam-spin{to{transform:rotate(360deg)}}
@keyframes wcam-shot{0%{opacity:.85}100%{opacity:0}}

#wipyeCamera .wcam-top{position:absolute;inset:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:calc(var(--wcam-safe-t) + 10px) 12px 24px;background:linear-gradient(#00000059,#0000)}
#wipyeCamera .wcam-top .wcam-flash{margin-left:auto}
#wipyeCamera .wcam-timer{position:absolute;left:50%;top:calc(var(--wcam-safe-t) + 16px);transform:translateX(-50%);padding:5px 12px;border-radius:999px;background:#e5243b;color:#fff;font:600 15px/1.2 system-ui,sans-serif;font-variant-numeric:tabular-nums;letter-spacing:.02em}

#wipyeCamera .wcam-bottom{position:absolute;inset:auto 0 0;display:flex;flex-direction:column;align-items:center;gap:12px;padding:40px 16px calc(var(--wcam-safe-b) + 14px);background:linear-gradient(#0000,#00000080 55%,#000000b3)}
#wipyeCamera .wcam-row{display:flex;align-items:center;justify-content:space-between;width:100%;max-width:360px;padding:0 6px}
#wipyeCamera .wcam-gallery,#wipyeCamera .wcam-flip{width:48px;height:48px;background:#0000004d}
#wipyeCamera .wcam-gallery.has-thumb{border-radius:10px;border:2px solid #fff;overflow:hidden;background:#222}
#wipyeCamera .wcam-gallery.has-thumb svg{display:none}
#wipyeCamera .wcam-gallery img{width:100%;height:100%;object-fit:cover}

#wipyeCamera .wcam-shutter{position:relative;width:80px;height:80px;border-radius:50%;touch-action:none;user-select:none;-webkit-user-select:none}
#wipyeCamera .wcam-shutter:disabled{opacity:1}
#wipyeCamera .wcam-ring{position:absolute;inset:0;width:100%;height:100%;transform:rotate(-90deg);overflow:visible}
#wipyeCamera .wcam-ring circle{fill:none;stroke-width:5}
#wipyeCamera .wcam-ring-track{stroke:#fff}
#wipyeCamera .wcam-ring-progress{stroke:#e5243b;stroke-linecap:round;opacity:0}
#wipyeCamera .wcam-disc{position:absolute;left:50%;top:50%;width:64px;height:64px;margin:-32px 0 0 -32px;border-radius:50%;background:#fff;transition:transform .18s ease,background-color .18s ease;pointer-events:none}
#wipyeCamera:not([data-state="recording"]) .wcam-shutter:active .wcam-disc{transform:scale(.92)}
#wipyeCamera[data-state="starting"] .wcam-disc,#wipyeCamera[data-state="paused"] .wcam-disc{background:#ffffffd9}
#wipyeCamera[data-mode="video"] .wcam-disc{background:#e5243b;transform:scale(.88)}
#wipyeCamera[data-state="recording"] .wcam-shutter{transform:scale(1.18);transition:transform .18s ease}
#wipyeCamera[data-state="recording"] .wcam-ring-track{stroke:#ffffffb3}
#wipyeCamera[data-state="recording"] .wcam-ring-progress{opacity:1}
#wipyeCamera[data-state="recording"] .wcam-shutter .wcam-disc{background:#e5243b;transform:scale(.36)}
#wipyeCamera[data-state="recording"][data-mode="video"] .wcam-shutter .wcam-disc{border-radius:22%;transform:scale(.42)}
#wipyeCamera[data-state="recording"] .wcam-gallery,#wipyeCamera[data-state="recording"] .wcam-flip,#wipyeCamera[data-state="recording"] .wcam-modes{visibility:hidden}

#wipyeCamera .wcam-modes{display:flex;gap:6px}
#wipyeCamera .wcam-mode{min-width:64px;padding:7px 14px;border-radius:999px;color:#fffc;font-weight:600;font-size:14px;line-height:1.2}
#wipyeCamera .wcam-mode[aria-pressed="true"]{background:#ffffff38;color:#fff}
#wipyeCamera .wcam-mode:disabled{opacity:1}
#wipyeCamera .wcam-hint{margin:0;color:#ffffffd9;font-size:12px;text-align:center;text-shadow:0 1px 2px #0008}
#wipyeCamera .wcam-note{margin:0;max-width:min(92vw,340px);padding:8px 14px;border-radius:12px;background:#000000b3;color:#fff;font-size:13px;text-align:center}

/* Permission denied / no camera. */
#wipyeCamera .wcam-problem{position:absolute;left:50%;top:50%;transform:translate(-50%,-55%);display:flex;flex-direction:column;align-items:center;gap:10px;width:min(100% - 48px,340px);text-align:center}
#wipyeCamera[data-state="error"] .wcam-bottom .wcam-row,#wipyeCamera[data-state="error"] .wcam-modes{display:none}
#wipyeCamera[data-state="error"] .wcam-bottom{background:none}
#wipyeCamera .wcam-problem-icon{display:flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:50%;background:#ffffff1f}
#wipyeCamera .wcam-problem-icon svg{width:30px;height:30px}
#wipyeCamera .wcam-problem h3{margin:6px 0 0;font-size:19px;font-weight:650;color:#fff}
#wipyeCamera .wcam-problem p{margin:0 0 8px;color:#ffffffc7;font-size:14px;line-height:1.5}
#wipyeCamera .wcam-primary,#wipyeCamera .wcam-secondary{width:100%;min-height:46px;padding:12px 16px;border-radius:999px;font-weight:600;font-size:15px}
#wipyeCamera .wcam-primary{background:#fff;color:#0b141a}
#wipyeCamera .wcam-secondary{background:#ffffff1f;color:#fff}

/* Review after capture. */
#wipyeCamera .wcam-review-stage{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#000}
#wipyeCamera .wcam-media{display:block;max-width:100%;max-height:100%;width:100%;height:100%;object-fit:contain;-webkit-user-drag:none}
#wipyeCamera .wcam-review-top{position:absolute;inset:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:calc(var(--wcam-safe-t) + 10px) 12px 26px;background:linear-gradient(#00000080,#0000)}
#wipyeCamera .wcam-tools{display:flex;gap:6px}
#wipyeCamera .wcam-tools .wcam-btn,#wipyeCamera .wcam-discard{background:#0000004d}
#wipyeCamera .wcam-tools .wcam-btn svg{width:22px;height:22px}
#wipyeCamera .wcam-hd{font:700 12px/1 system-ui,sans-serif;letter-spacing:.02em}
#wipyeCamera .wcam-hd[aria-pressed="true"]{background:#fff!important;color:#0b141a}
#wipyeCamera .wcam-info{position:absolute;left:16px;top:calc(var(--wcam-safe-t) + 68px);padding:4px 10px;border-radius:999px;background:#00000080;font-size:12px;font-variant-numeric:tabular-nums}
#wipyeCamera .wcam-play{position:absolute;left:50%;top:50%;width:68px;height:68px;margin:-34px 0 0 -34px;background:#00000080}
#wipyeCamera .wcam-play svg{width:30px;height:30px;fill:#fff;margin-left:4px}
#wipyeCamera .wcam-video-progress{position:absolute;left:16px;right:16px;top:calc(var(--wcam-safe-t) + 58px);height:3px;border-radius:2px;background:#ffffff40;overflow:hidden}
#wipyeCamera .wcam-video-progress span,#wipyeCamera .wcam-upload span{display:block;height:100%;width:100%;background:#fff;transform-origin:left;transform:scaleX(0)}
#wipyeCamera .wcam-footer{position:absolute;inset:auto 0 0;display:flex;flex-direction:column;gap:8px;padding:28px 10px calc(var(--wcam-safe-b) + 10px);background:linear-gradient(#0000,#000000a6 40%)}
#wipyeCamera .wcam-caption-row{display:flex;align-items:center;gap:6px;padding:4px 6px 4px 16px;border-radius:24px;background:#1f2c34}
#wipyeCamera .wcam-caption{flex:1;min-width:0;width:auto;height:40px;min-height:0;margin:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;color:#fff;font:16px/1.3 system-ui,sans-serif;outline:none;user-select:text;-webkit-user-select:text}
#wipyeCamera .wcam-caption:focus,#wipyeCamera .wcam-caption:focus-visible{outline:none}
#wipyeCamera .wcam-caption-row:focus-within{box-shadow:0 0 0 1.5px #ffffff59}
#wipyeCamera .wcam-caption::placeholder{color:#ffffffa6}
#wipyeCamera .wcam-once{width:34px;height:34px;border:1.5px solid #ffffffb3;font:700 13px/1 system-ui,sans-serif}
#wipyeCamera .wcam-once[aria-pressed="true"]{background:#fff;color:#0b141a;border-color:#fff}
#wipyeCamera .wcam-send-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 2px 0 6px}
#wipyeCamera .wcam-recipient{min-width:0;max-width:65%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:6px 12px;border-radius:999px;background:#ffffff26;font-size:14px;font-weight:600}
#wipyeCamera .wcam-send{width:54px;height:54px;margin-left:auto;background:#1f6fff;box-shadow:0 2px 10px #0006}
#wipyeCamera .wcam-send svg{width:24px;height:24px;margin-left:3px}
#wipyeCamera .wcam-send.is-sending svg{animation:wcam-pulse 1s ease-in-out infinite}
#wipyeCamera .wcam-send:disabled{opacity:.75}
#wipyeCamera .wcam-status{margin:0 6px;color:#fff;font-size:13px;text-shadow:0 1px 2px #000}
#wipyeCamera .wcam-upload{height:3px;margin:0 6px;border-radius:2px;background:#ffffff33;overflow:hidden}
@keyframes wcam-pulse{50%{opacity:.4}}
@media(prefers-reduced-motion:reduce){#wipyeCamera *{animation-duration:.01ms!important;transition:none!important}}
@media(max-height:520px) and (orientation:landscape){#wipyeCamera .wcam-bottom{inset:0 0 0 auto;width:150px;justify-content:center;padding:12px calc(env(safe-area-inset-right,0px) + 10px) 12px 10px;background:linear-gradient(90deg,#0000,#0009)}#wipyeCamera .wcam-row{flex-direction:column;gap:14px;width:auto}#wipyeCamera .wcam-hint{display:none}}
@media(min-width:900px){#wipyeCamera .wcam-footer{padding-inline:max(10px,calc(50% - 320px))}}

.wcam-recents{display:flex;gap:8px;overflow-x:auto;max-width:100%;padding:4px 12px;scrollbar-width:none}.wcam-recent{flex:0 0 52px;width:52px;height:52px;overflow:hidden;border-radius:8px;padding:0}.wcam-recent img,.wcam-recent video{width:100%;height:100%;object-fit:cover}.wcam-footer>.w78-video-controls{position:relative;inset:auto;background:#0009;margin-bottom:8px}.wcam[data-state="recording"] .wcam-recents{display:none}

/* v126: hardware zoom level (pinch on preview, slide on the held shutter). */
#wipyeCamera .wcam-zoom{position:absolute;left:50%;bottom:16px;transform:translateX(-50%);min-width:48px;padding:5px 11px;border-radius:999px;background:#0009;color:#fff;font:600 14px/1.2 system-ui,sans-serif;font-variant-numeric:tabular-nums;text-align:center;pointer-events:none}
#wipyeCamera .wcam-zoom[hidden]{display:none}

/* Owner-opened local report; text selection requires an explicit user action. */
#wipyeCamera .wcam-diagnostic{font:600 22px/1 system-ui,sans-serif}
#wipyeCamera .wcam-top .wcam-diagnostic{margin-left:8px;margin-right:auto}
#wipyeCamera .wcam-diagnostics{position:absolute;z-index:3;top:calc(var(--wcam-safe-t) + 60px);left:12px;right:12px;max-height:calc(100% - 150px);overflow:auto;background:#17212b;padding:14px;border:1px solid #ffffff50;border-radius:12px;touch-action:pan-y;user-select:text;-webkit-user-select:text}
#wipyeCamera .wcam-diagnostics h3{margin:0 0 8px;font-size:16px}
#wipyeCamera .wcam-diagnostics p{font-size:13px}
#wipyeCamera .wcam-diagnostics textarea{display:block;width:100%;min-height:90px;max-height:32vh;color:#fff;background:#000;border:1px solid #ffffff60;font:12px/1.4 monospace;user-select:text;-webkit-user-select:text;touch-action:pan-y}
#wipyeCamera .wcam-diagnostics button{margin:8px 8px 0 0;padding:10px;border:1px solid #ffffff60;border-radius:8px;font-size:13px}

/* v126: Ride chat camera must sit above the driver navigation panel (z-index 2500) and the full ride chat,
   like every other Ride chat dialog (.wrc-modal z-index 6000). At 600 it opened invisibly behind them. */
.wrc-modal[data-layout="wcam"]{z-index:6000!important}
