/* Native full-screen viewfinder, category capsules and overlay controls. */
:root{color-scheme:dark;background:#000;color:#fff}
html,body{width:100%;height:100%;overflow:hidden;background:#000}
.camera-app{position:relative;width:100%;height:100dvh;min-height:0;isolation:isolate;overflow:hidden;background:#000}
.camera-frame,.camera-frame.needs-setup{position:absolute;inset:0;width:100%;height:100%;min-height:0;aspect-ratio:auto;border:0;border-radius:0;background:#050505;overflow:hidden}
.camera-frame video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.preview-tint{position:absolute;inset:0;background:#00000014;pointer-events:none}
.focus-marker{position:absolute;width:68px;height:68px;border:1.5px solid #e7c574;border-radius:12px;transform:translate(-50%,-50%);box-shadow:0 0 0 1px #0005,0 2px 12px #0002;pointer-events:none;z-index:6;transition:border-color .18s}
.focus-marker[data-status=requested]{border-color:#afd0ff}
.focus-marker::before,.focus-marker::after{content:'';position:absolute;left:50%;top:50%;background:currentColor;color:#e7c574;transform:translate(-50%,-50%)}.focus-marker::before{width:12px;height:1px}.focus-marker::after{height:12px;width:1px}.focus-marker[data-status=requested]::before,.focus-marker[data-status=requested]::after{color:#afd0ff}
.focus-marker span{position:absolute;top:calc(100% + 8px);left:50%;transform:translateX(-50%);padding:5px 8px;background:#111c;border-radius:7px;color:#fff;white-space:nowrap;font-size:10px;line-height:1.3}
.mode-overlay{position:absolute;top:max(16px,env(safe-area-inset-top));left:max(16px,env(safe-area-inset-left));width:calc(100% - 210px);max-width:670px;z-index:12;display:flex;flex-direction:column;align-items:flex-start;gap:10px;pointer-events:none}
.mode-overlay>*{pointer-events:auto}
.brand-capsule{display:inline-flex;align-items:center;gap:7px;border:0;background:#0009;border-radius:999px;color:#fff;font-size:16px;font-weight:700;padding:5px 10px 5px 5px;min-height:40px}
.brand-capsule img{border-radius:8px}
.category-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;max-width:none;gap:2px;padding:5px;background:#0009;border:1px solid #ffffff29;border-radius:26px}
.category{display:flex;justify-content:center;align-items:center;text-align:center;min-height:44px;padding:8px 12px;border:0;background:transparent;color:#ffffffd9;border-radius:999px;font-size:12px;font-weight:700;line-height:1.2;white-space:normal;box-shadow:none}
.category.selected{background:white;color:black;box-shadow:none}.category.selected::after{display:none}.category:hover:not(:disabled){background:#ffffff22}.category.selected:hover{background:white}
.format-label{display:block;max-width:100%;font-size:12px}.format-label select{max-width:100%;min-height:38px;background:#0009;color:white;border:1px solid #ffffff40;border-radius:999px;padding:8px 28px 8px 12px;font-size:12px;font-weight:700}
.settings-overlay{position:absolute;right:max(16px,env(safe-area-inset-right));top:max(16px,env(safe-area-inset-top));z-index:12;display:flex;flex-direction:column;align-items:flex-end;gap:8px;max-width:174px}
.setting-button,.setting-pill{display:inline-flex;align-items:center;justify-content:center;gap:7px;color:white;background:#0009;border:1px solid #ffffff40;border-radius:999px;min-height:36px;padding:8px 12px;font-size:12px;font-weight:700;box-shadow:0 2px 5px #0005;line-height:1.2;max-width:100%;white-space:nowrap}
.setting-button:hover{background:#222b}.setting-pill{padding:0 8px 0 12px;min-height:36px;gap:4px}.setting-pill select{min-height:34px;min-width:0;max-width:145px;background:transparent;color:white;border:0;border-radius:999px;padding:5px 0;font-size:12px;font-weight:700;outline-offset:1px}select option{color:#182b49;background:#fff}
.camera-empty{position:absolute;inset:0;display:flex;justify-content:center;align-items:center;flex-direction:column;background:transparent;padding:340px 20px 150px;gap:12px;text-align:center;pointer-events:none}.camera-empty>*{pointer-events:auto}.camera-empty h1{font-size:24px;font-weight:600;letter-spacing:-.5px}.camera-empty p{font-size:13px;line-height:1.65;color:#aaa;max-width:340px}.camera-empty .text-button{color:#ccc;font-size:12px;min-height:30px}
.camera-top-tools{position:absolute;bottom:max(24px,env(safe-area-inset-bottom));left:max(16px,env(safe-area-inset-left));top:auto;right:auto;z-index:14;display:flex;gap:8px}
.round-button{display:flex;align-items:center;justify-content:center;width:44px;height:44px;min-width:44px;min-height:44px;border-radius:50%;border:1px solid #ffffff40;background:#0009;color:white;font-size:23px;padding:0;cursor:pointer}
.bottom-overlay{position:absolute;bottom:max(22px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(680px,calc(100% - 160px));display:flex;flex-direction:column;align-items:center;gap:12px;z-index:11;pointer-events:none}.bottom-overlay>*{pointer-events:auto}
.capture-actions{width:100%;display:grid;grid-template-columns:1fr 80px 1fr;align-items:center;justify-items:center;gap:18px;padding:0;background:transparent;border:0}.upload-button{min-width:44px;font-size:22px;width:44px;padding:0}.shutter{width:78px;height:78px;min-width:78px;background:transparent;border:5px solid #fff;border-radius:50%;padding:5px;box-shadow:0 2px 8px #0005;display:flex;align-items:center;justify-content:center;touch-action:manipulation}.shutter span{display:block;width:100%;height:100%;border-radius:50%;background:#fff;box-shadow:none}.shutter:active:not(:disabled){transform:scale(.94)}.shutter:disabled{opacity:.35}
.mode-hint{color:#fff;font-size:12px;line-height:1.45;text-align:center;background:#000a;padding:8px 14px;border:0;border-radius:18px;max-width:540px;display:none}
.capture-status{display:flex;gap:10px;justify-content:center;align-items:center;flex-wrap:wrap;color:#fff;font-size:13px;font-weight:600}.capture-status:has(#captureHint:empty):not(:has(button:not([hidden]))){display:none}#captureHint:not(:empty){padding:8px 14px;border-radius:999px;background:#000a}.capture-status .button{border-radius:999px;min-height:36px;font-size:12px}
.photo-queue{display:flex;justify-content:center;max-width:100%;overflow-x:auto;padding:4px;gap:8px;background:#000a;border:0;border-radius:12px;min-height:0}.photo-tile{flex:0 0 60px;width:60px;height:70px;border-radius:7px}.photo-tile>img{height:46px;width:60px;object-fit:cover}.photo-tools{background:#000b}.photo-tools button,.photo-number{color:#fff}
.result-card{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:8;width:max-content;max-width:min(720px,calc(100% - 48px));max-height:calc(100dvh - 430px);overflow:auto;padding:18px 26px;border:0;border-radius:18px;background:#000b;color:#fff;box-shadow:none;backdrop-filter:blur(12px)}.result-heading{display:none}.result-content{min-height:0}.answer-text{font-size:clamp(20px,3.5vw,36px);font-weight:600;line-height:1.45;margin:0;color:#fff;overflow-wrap:anywhere;white-space:pre-wrap}.answer-text.short{font-size:clamp(48px,10vw,100px);font-weight:600;line-height:1.1;margin:0;text-align:center;letter-spacing:-1px}.answer-row{color:#fff;border-bottom-color:#ffffff25;padding:10px 0;gap:16px}.row-label,.row-value{color:white}.answer-note{color:#bbb;background:#ffffff0a;font-size:10px;line-height:1.45;padding:8px;margin:10px 0 0}.result-footer{color:#aaa;border-color:#ffffff25;font-size:10px;margin-top:12px;padding-top:8px}.result-footer .text-button{color:#ccc;min-height:24px}.source-pages{color:#bbb}.page-chip{color:white;background:#fff2;border-color:#fff4}.form-error{color:#ffd9dd;background:#6a192766}.result-card .fine{color:#bbb}
.capture-progress{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);right:auto;bottom:auto;z-index:15;background:#1e1e1ed9;backdrop-filter:blur(18px);border-radius:26px;padding:20px;display:flex;flex-direction:column;align-items:center;gap:9px;color:white;font-size:12px;white-space:nowrap;box-shadow:0 5px 22px #0005}.capture-progress .spinner{width:32px;height:32px;border:3px solid #fff3;border-top-color:#fff;border-radius:50%;animation:spin .8s linear infinite}
.banner{padding:0;background:transparent;border:0;font-size:11px;color:#ddd;margin:0}.banner.demo{padding:8px;background:#0009}.banner .text-button{color:white}
.data-toolbar{padding:0;background:transparent;color:white;gap:8px;font-size:11px}.segmented{background:#0009;border-color:#fff3;border-radius:999px}.segmented button{color:white;border-radius:999px;font-size:11px}.segmented .selected{background:white;color:black}.data-toolbar .text-button{color:white;min-height:36px;padding:6px 12px;background:#0009;border-radius:999px}
.data-setup{inset:0;background:#000;z-index:9;padding:220px 20px 100px;gap:16px}.data-setup h2{font-size:25px}.data-setup p{color:#aaa}.data-setup label{font-size:13px}.data-setup select{color:white;background:#222;border:1px solid #666;padding:10px;border-radius:8px}.data-setup .light-text{color:#ccc}
.audio-panel{width:100%;max-height:220px;overflow:auto;background:#000b;backdrop-filter:blur(12px);border:1px solid #fff3;border-radius:14px;padding:12px}.audio-heading{color:#fff;margin-bottom:8px}.audio-actions .button{min-height:36px}.audio-panel textarea{min-height:60px;margin-top:8px;font-size:14px}.audio-panel audio{height:32px}
.crop-rect{z-index:4;border:2px solid #fff;box-shadow:0 0 0 3000px #0005}.crop-label{color:white;background:#000a}.crop-handle{touch-action:none;min-width:28px;min-height:28px}
.modal{color-scheme:light;background:#fff;color:#182b49}.modal .form-error{color:#a34a53;background:#fff1f3}.modal select{background:white;color:#182b49}.modal .fine{color:#78859b}.modal .button{color-scheme:light}.toast{z-index:50;bottom:max(115px,calc(env(safe-area-inset-bottom) + 95px));background:#252525f5;color:white}.toast.error{background:#7c3545}.skip:not(:focus){clip-path:inset(100%);width:1px;height:1px;padding:0;overflow:hidden}.skip:focus{z-index:100;color:#182b49}
@media(max-width:600px){.mode-overlay{left:12px;top:max(12px,env(safe-area-inset-top));width:calc(100% - 150px);gap:8px}.brand-capsule{font-size:14px}.category-grid{padding:4px;border-radius:22px;gap:1px}.category{font-size:10px;min-height:44px;padding:5px 3px}.settings-overlay{right:12px;top:max(12px,env(safe-area-inset-top));max-width:120px;gap:7px}.setting-button,.setting-pill{font-size:11px;min-height:34px;padding:7px 10px}.setting-pill{padding:0 6px 0 9px}.setting-pill select{font-size:10px;max-width:99px;min-height:32px}.settings-overlay .setting-pill>span[aria-hidden]{display:none}.format-label select{font-size:10px;padding-left:9px;min-height:34px}.bottom-overlay{width:calc(100% - 24px);bottom:max(20px,env(safe-area-inset-bottom));gap:8px}.capture-actions{grid-template-columns:1fr 74px 1fr;max-width:300px}.shutter{width:74px;height:74px;min-width:74px}.camera-top-tools{bottom:110px;left:12px}.camera-empty{padding:295px 24px 155px;justify-content:center;gap:9px}.camera-empty h1{font-size:20px}.camera-empty p{font-size:12px;max-width:265px}.result-card{top:53%;max-width:calc(100% - 30px);max-height:calc(100dvh - 425px);padding:16px 20px}.answer-text{font-size:21px}.answer-text.short{font-size:64px}.data-setup{padding-top:240px}.data-toolbar{gap:4px}.data-toolbar>span{display:none}.segmented button{padding:6px;font-size:10px}.photo-queue{max-width:calc(100% - 75px)}.audio-panel{max-height:205px}}
@media(orientation:landscape) and (max-height:600px){.camera-empty{padding:100px 200px 110px;gap:6px}.camera-empty h1{font-size:18px}.camera-empty p{display:none}.bottom-overlay{width:350px;bottom:14px}.result-card{top:47%;max-width:calc(100% - 460px);max-height:calc(100dvh - 170px)}.mode-overlay{max-width:330px}.category{min-height:36px}.settings-overlay{gap:4px}.setting-button,.setting-pill{min-height:30px;padding-top:5px;padding-bottom:5px}.setting-pill{padding-top:0;padding-bottom:0}.setting-pill select{min-height:28px}.data-setup{padding-top:140px}.capture-progress{top:45%}.audio-panel{position:fixed;right:-130px;bottom:95px;width:240px;max-height:170px}}
@media(prefers-reduced-motion:reduce){.capture-progress .spinner{animation:none}}

/* Phone controls stay compact; the iPad's two-row camera bar stays in place. */
.mobile-only,.mobile-setting-name{display:none}
.phone-settings-sheet{color-scheme:dark;color:#f7f8fc;background:#15171df5;border:1px solid #ffffff18;border-radius:28px 28px 0 0;box-shadow:0 -16px 80px #0007;backdrop-filter:blur(28px);-webkit-backdrop-filter:blur(28px);position:fixed;inset:auto 0 0;width:100%;max-width:600px;max-height:calc(100dvh - 24px);margin:0 auto;padding:10px 20px max(22px,env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain}
.phone-settings-sheet::backdrop{background:#0008;backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}
.sheet-grabber{height:4px;width:34px;border-radius:99px;background:#ffffff30;margin:0 auto 22px}
.phone-settings-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:24px}.phone-settings-heading h2{font-size:22px;font-weight:650;letter-spacing:-.5px}.phone-settings-heading p{font-size:12px;color:#a1a7b5;margin-top:6px;line-height:1.5}
.sheet-done{border:1px solid #8fbaff2e;background:#8fbaff15;color:#b3d1ff;border-radius:99px;padding:9px 16px;min-height:40px;font-size:13px;font-weight:600}
.phone-settings-footer{margin-top:14px;display:flex;flex-direction:column;gap:9px}.phone-settings-footer #historyButton{width:100%;border-radius:14px;min-height:50px;justify-content:flex-start;gap:12px;padding:12px 16px;background:#ffffff06;border:1px solid #ffffff0c;font-size:22px}.phone-settings-footer #historyButton::after{content:'Recent answers';font-size:14px;font-weight:500}.phone-settings-footer #referralButton{width:100%;max-width:none;min-height:50px;justify-content:flex-start;padding:12px 16px;border-radius:14px;background:#ffffff06;border:1px solid #ffffff0c;box-shadow:none;font-size:14px;font-weight:500}
@media(max-width:600px), (max-width:1023px) and (max-height:500px){
  .mobile-only{display:flex}
  .mode-overlay{left:max(18px,env(safe-area-inset-left));top:max(18px,env(safe-area-inset-top));width:calc(100% - 100px);max-width:330px;gap:16px}
  .brand-capsule{padding:0;background:transparent;min-height:36px;font-size:16px;gap:9px;letter-spacing:-.3px}.brand-capsule img{width:30px;height:30px;border-radius:9px}
  .category-grid,.mode-overlay>.format-label{display:none}
  .camera-app>.settings-overlay{display:none}
  .mobile-camera-picker{position:relative;flex-direction:column;gap:3px;width:min(240px,100%);border:1px solid #ffffff20;background:#14171ed9;border-radius:16px;padding:10px 44px 10px 15px;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);box-shadow:0 4px 20px #0002}
  .mobile-camera-picker>span{font-size:8px;line-height:1.2;letter-spacing:1.7px;font-weight:600;color:#9ca6b8;pointer-events:none}
  .mobile-camera-picker select{position:relative;appearance:none;-webkit-appearance:none;border:0;border-radius:0;color:#fff;background:none;font-size:16px;font-weight:600;letter-spacing:-.25px;padding:0;margin:0;width:calc(100% + 29px);min-height:25px;line-height:25px;outline-offset:4px}
  .mobile-camera-picker svg{position:absolute;width:19px;height:19px;right:15px;top:21px;fill:none;stroke:#aab5c9;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
  .mobile-settings-toggle{position:absolute;z-index:13;right:max(18px,env(safe-area-inset-right));top:max(18px,env(safe-area-inset-top));width:44px;height:44px;align-items:center;justify-content:center;background:#14171ed9;border:1px solid #ffffff20;border-radius:15px;box-shadow:0 4px 20px #0002;color:#fff;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
  .mobile-settings-toggle svg{width:22px;height:22px;fill:#15171d;stroke:currentColor;stroke-width:1.7;stroke-linecap:round}
  .mobile-wallet{position:absolute;z-index:14;left:max(18px,env(safe-area-inset-left));bottom:calc(max(20px,env(safe-area-inset-bottom)) + 15px);max-width:calc(50vw - 64px)}
  .mobile-wallet #creditsButton{min-height:42px;border-radius:15px;padding:10px 12px;background:#14171ed9;border-color:#ffffff20;font-size:12px;font-weight:600;gap:7px;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}.mobile-wallet #creditsButton>span[aria-hidden]{font-size:16px;color:#a7c9ff}
  .mobile-wallet #creditsButton{min-width:0;max-width:100%}.mobile-wallet #balanceLabel{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobile-wallet #creditsButton>span[aria-hidden]{flex-shrink:0}
  .bottom-overlay{width:calc(100% - 36px);bottom:max(20px,env(safe-area-inset-bottom))}
  .capture-actions{width:100%;max-width:none;grid-template-columns:minmax(0,1fr) 74px minmax(0,1fr);gap:12px}
  .capture-actions .shutter{grid-column:2;grid-row:1}.capture-actions .upload-button{grid-column:3;grid-row:1;justify-self:end;width:44px;min-width:44px;border-radius:15px;background:#14171ed9;border-color:#ffffff20;color:#d8dfed;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
  .camera-top-tools{left:max(18px,env(safe-area-inset-left));bottom:112px}
  .camera-empty{padding:150px 28px 150px;gap:12px}.camera-empty h1{font-size:24px;letter-spacing:-.7px;font-weight:600}.camera-empty p{display:block;color:#949ba9;max-width:270px;font-size:12px;line-height:1.75}.camera-empty .setting-button{font-size:13px;padding:10px 20px;border-radius:14px;border-color:#ffffff25;background:#ffffff0a}.camera-empty .text-button{font-size:11px;color:#7f8b9f}
  .result-card{top:49%;max-width:calc(100% - 36px);max-height:max(120px,calc(100dvh - 320px));border-radius:22px;background:#12151bd9;border:1px solid #ffffff0c;padding:20px 24px}
  .data-setup{padding:165px 24px 130px;gap:16px}.data-setup h2{font-size:24px}.data-setup p{font-size:12px}
  .data-toolbar{gap:6px}.data-toolbar .segmented{padding:3px}.data-toolbar .segmented button{padding:7px 10px;font-size:11px}.data-toolbar>.text-button{padding:6px 10px;font-size:11px}.data-toolbar>span{display:none}
  .phone-settings-sheet .settings-overlay{position:static;display:flex;flex-direction:column;align-items:stretch;max-width:none;gap:9px}
  .phone-settings-sheet .setting-pill{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:56px;border:1px solid #ffffff0c;border-radius:14px;padding:8px 14px;background:#ffffff06;box-shadow:none;font-size:13px;white-space:normal;order:1}
  .phone-settings-sheet .setting-pill>span{display:none}.phone-settings-sheet .setting-pill>.mobile-setting-name{display:inline;color:#bac0cc;font-size:13px;font-weight:400;min-width:90px}
  .phone-settings-sheet .setting-pill select{min-height:38px;max-width:65%;width:auto;min-width:0;border:0;padding:5px 0;background:none;color:#fff;font-size:15px;font-weight:500;text-align:right;border-radius:8px}
  .phone-settings-sheet .setting-button{width:100%;max-width:none;min-height:50px;justify-content:flex-start;padding:12px 16px;border-radius:14px;background:#ffffff06;border:1px solid #ffffff0c;box-shadow:none;font-size:14px;font-weight:500}
  .phone-settings-sheet #cropToggle,.phone-settings-sheet #focusToggle{order:0}.phone-settings-sheet #cropToggle[aria-pressed=true],.phone-settings-sheet #focusToggle[aria-pressed=true]{background:#609bff17;border-color:#609bff40;color:#b5d1ff}
  .audio-panel{width:100%;max-height:205px;position:static}.toast{bottom:max(115px,calc(env(safe-area-inset-bottom) + 95px))}
}
@media(max-width:1023px) and (max-height:500px){
  .mode-overlay{top:14px;left:max(18px,env(safe-area-inset-left));gap:10px;max-width:250px}.brand-capsule{font-size:14px;min-height:30px}.brand-capsule img{width:26px;height:26px}.mobile-camera-picker{padding-top:7px;padding-bottom:7px;max-width:225px}.mobile-camera-picker svg{top:17px}.mobile-settings-toggle{top:14px}.bottom-overlay{width:calc(100% - 36px);bottom:14px}.mobile-wallet{bottom:29px}.result-card{left:55%;top:46%;max-width:calc(100% - 370px);max-height:calc(100dvh - 150px);padding:12px 22px}.camera-empty{padding:100px 260px 110px 280px;gap:5px}.camera-empty h1{font-size:18px;white-space:nowrap}.camera-empty p{display:none}.camera-empty .setting-button{font-size:12px;min-height:32px;padding:6px 12px}.camera-top-tools{bottom:100px}.data-setup{padding:125px 280px 100px}.data-setup h2{font-size:18px}.data-setup p{display:none}.phone-settings-sheet{max-width:560px;max-height:calc(100dvh - 12px)}
}
