* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #000; color: #fff; font: 16px/1.4 system-ui, sans-serif; overflow: hidden; }
#app { position: fixed; top: 0; right: 0; bottom: 0; left: 0; }
#cam { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; background: #111; }
#top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: linear-gradient(#000a, #0000); }
#chips { display: flex; flex-direction: column; align-items: flex-start; max-width: 75%; }
.chip { background: #000a; border-radius: 99px; padding: 4px 10px; font-size: 13px; }
.chip.ok { background: #0a7d33cc; } .chip.bad { background: #c0271dcc; }
#settingsBtn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: #000a; color: #fff; font-size: 26px; }
#live { position: absolute; left: 0; right: 0; bottom: calc(150px + env(safe-area-inset-bottom)); padding: 8px 12px; font-size: 13px; line-height: 1.35; background: #0009; white-space: pre-wrap; }
#live b { font-weight: 700; }
#msg { position: absolute; left: 16px; right: 16px; top: 30%; background: #000d; border-radius: 14px; padding: 16px; text-align: center; }
#msg button { margin-top: 10px; padding: 12px 18px; border-radius: 10px; border: 0; background: #0a7d33; color: #fff; font-size: 16px; }
#bottom { position: absolute; left: 0; right: 0; bottom: 0; height: calc(140px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: flex; align-items: center; justify-content: space-around; background: #000c; }
#shutter { width: 84px; height: 84px; border-radius: 50%; border: 5px solid #fff; background: transparent; padding: 0; } #shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transform: scale(.82); transition: transform .08s; } #shutter:active span { transform: scale(.7); }
#thumb { width: 62px; height: 62px; border-radius: 12px; border: 2px solid #fff6; background: #222 center/cover; }
#side { display: flex; flex-direction: column; } #side button { width: 52px; height: 52px; border-radius: 50%; border: 0; background: #fff2; color: #fff; font-size: 24px; } #side button.on { background: #f5c518; color: #000; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: #111; z-index: 20; overflow: auto; padding: 0 0 40px; } .panel[hidden] { display: none; }
.panelhead { position: sticky; top: 0; background: #111; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; border-bottom: 1px solid #333; } .panelhead button { background: #0a7d33; color: #fff; border: 0; border-radius: 10px; padding: 10px 16px; font-size: 16px; }
.sec { padding: 14px 16px; border-bottom: 1px solid #2a2a2a; } .sec h3 { margin: 0 0 8px; font-size: 14px; color: #9ab; text-transform: uppercase; letter-spacing: .04em; }
.sec label { display: block; font-size: 13px; color: #9ab; margin: 10px 0 4px; }
.sec input[type=text], .sec select { width: 100%; font-size: 18px; padding: 12px; border-radius: 10px; border: 1px solid #444; background: #1c1c1c; color: #fff; }
.row { display: flex; align-items: center; } .row > input[type=text] { flex: 1; }
.sw { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #242424; } .sw input { width: 24px; height: 24px; }
.btn { display: block; width: 100%; padding: 14px; margin: 8px 0; border: 0; border-radius: 12px; background: #333; color: #fff; font-size: 17px; } .btn.go { background: #0a7d33; } .btn.warn { background: #7d1b14; }
.x { background: #422; border: 0; color: #fff; border-radius: 10px; width: 42px; height: 42px; font-size: 20px; }
.small { font-size: 13px; color: #9ab; } #logoPrev { max-height: 70px; max-width: 100%; background: #444; border-radius: 8px; padding: 6px; }
#grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; } #grid img { width: 100%; height: calc((100vw - 16px) / 3); object-fit: cover; background: #222; }
#viewImg { width: 100%; display: block; } #viewBtns { padding: 12px 16px; } #viewTitle { font-size: 13px; color: #9ab; }
#toast { position: fixed; left: 16px; right: 16px; bottom: calc(160px + env(safe-area-inset-bottom)); background: #000d; padding: 12px 14px; border-radius: 12px; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 30; text-align: center; }
#live { max-height: 38vh; overflow-y: auto; }
html.native, html.native body, html.native #app { background: transparent; } html.native #cam { display: none; }
/* Spacing without flex 'gap' and no 'inset'/'aspect-ratio', so older tablets (Chrome/WebView 81) lay it out too. */
/* Photo / Video switch and recording */
#modes { position: absolute; left: 0; right: 0; bottom: calc(146px + env(safe-area-inset-bottom)); text-align: center; z-index: 5; }
#modes button { margin: 0 6px; padding: 8px 20px; border: 0; border-radius: 99px; background: #000a; color: #fff; font-size: 17px; font-weight: 600; }
#modes button.on { background: #f5c518; color: #000; }
html.video #live { bottom: calc(196px + env(safe-area-inset-bottom)); max-height: 20vh; font-size: 11px; line-height: 1.25; padding: 4px 10px; }   /* filming: at most a fifth of the screen */
html.video #shutter span { background: #e0261b; }
#shutter.rec span { transform: scale(.5); border-radius: 12%; }
html.rec #modes, html.rec #thumb, html.rec #side { visibility: hidden; }
#recChip { position: absolute; top: calc(70px + env(safe-area-inset-top)); left: 0; right: 0; margin: 0 auto; width: 130px; text-align: center; background: #c0271dee; border-radius: 99px; padding: 6px 0; font-size: 20px; font-weight: 700; z-index: 5; }
#recChip[hidden] { display: none; }
#live .hl { background: #16a34a; padding: 0 4px; border-radius: 3px; }
.chip.res { background: #16a34aee; font-weight: 700; font-size: 15px; }
#updBar { position: fixed; left: 12px; right: 12px; top: calc(64px + env(safe-area-inset-top)); z-index: 25; padding: 16px; border: 0; border-radius: 14px; background: #16a34a; color: #fff; font-size: 19px; font-weight: 700; box-shadow: 0 4px 16px #0008; }
#updBar[hidden] { display: none; }
#topBtns { display: flex; } #topBtns > * + * { margin-left: 10px; }
#waBtn { position: relative; width: 46px; height: 46px; border-radius: 50%; border: 0; background: #25d366; padding: 0; display: flex; align-items: center; justify-content: center; opacity: .55; } #waBtn.has { opacity: 1; box-shadow: 0 0 0 3px #fff6; }
#waN { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; border-radius: 11px; background: #e0261b; color: #fff; font-size: 13px; font-weight: 700; line-height: 22px; text-align: center; padding: 0 5px; } #waN[hidden] { display: none; }
#chips > * + * { margin-top: 6px; } #side > * + * { margin-top: 10px; } .row > * + * { margin-left: 10px; }
html.video #thumb.vid { background-image: none !important; background-color: #c0271d; } html.video #thumb.vid::after { content: "\25B6"; font-size: 30px; color: #fff; }
