:root{color-scheme:dark;font-family:system-ui,-apple-system,'Segoe UI',sans-serif}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#101b14;color:#fff}
[hidden]{display:none!important}.ar-root{position:fixed;inset:0;overflow:hidden;background:radial-gradient(circle at center,#21352b,#101b14)}
.ar-root a-scene{display:block!important;position:absolute!important;inset:0!important;width:100%!important;height:100%!important}
/* AR.js injeta vídeo e canvas em camadas separadas; os overlays permanecem à frente. */
body>video{z-index:0!important}
.hud-header{position:fixed;top:0;left:0;right:0;z-index:100;display:flex;align-items:center;gap:12px;min-height:calc(68px + env(safe-area-inset-top));padding:calc(10px + env(safe-area-inset-top)) 15px 10px;background:linear-gradient(180deg,#09150fe8,#09150fa8 75%,#09150f00);pointer-events:none}
.hud-header>*{pointer-events:auto}.back{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:#173323;border:1px solid #50725a;color:#fff;text-decoration:none;font-size:26px}.brand{flex:1;min-width:0;display:grid;gap:1px}.brand strong{font-size:25px;letter-spacing:-1.5px;font-weight:800}.brand strong span{color:#e0b37c}.brand small{color:#d2ddca;font-size:9px;letter-spacing:1.8px}.help{font-size:11px;border:1px solid #688b6a;padding:10px 12px;border-radius:9px;color:#fff;text-decoration:none;background:#20352c;font-weight:700}
.status-panel{position:fixed;top:calc(78px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:100;background:#182a22e8;color:#f0f7ef;border:1px solid #8d9c8580;border-radius:999px;padding:10px 15px;display:flex;align-items:center;gap:10px;font-size:11px;box-shadow:0 8px 24px #0003;max-width:calc(100vw - 26px);width:max-content;white-space:normal;text-align:center}
.status-dot{width:9px;height:9px;background:#e7b36e;box-shadow:0 0 0 4px #e7b36e27;border-radius:50%;flex:none}.status-dot.active{background:#7de7a5;box-shadow:0 0 0 4px #7de7a529}.status-dot.warn{background:#ff9985;box-shadow:0 0 0 4px #ff998526}
.instructions{position:fixed;z-index:100;left:16px;right:16px;top:calc(128px + env(safe-area-inset-top));border:1px solid #607662;background:#102419d9;border-radius:17px;padding:16px 17px;max-width:440px;margin:auto;box-shadow:0 16px 35px #0004;backdrop-filter:blur(8px)}.instructions-title{font-weight:800;color:#f8ddaf;font-size:14px}.instructions p{font-size:12px;line-height:1.65;color:#d5dfd5;margin:8px 0 13px}.instructions-actions{display:flex;align-items:center;gap:9px;justify-content:space-between}.instructions-actions a,.instructions-actions button{border-radius:9px;padding:10px 11px;font-size:11px;font-weight:800;text-decoration:none;cursor:pointer}.instructions-actions a{color:#203023;background:#e8bd8b}.instructions-actions button{color:#fff;background:#274c34;border:1px solid #628268}
.control-sheet{position:fixed;z-index:100;bottom:0;left:0;right:0;background:linear-gradient(180deg,#15291efa,#102219fd);border-radius:20px 20px 0 0;border-top:1px solid #66806a;box-shadow:0 -14px 40px #0005;padding:15px 16px calc(15px + env(safe-area-inset-bottom));}
.product-bar{display:flex;align-items:center;gap:10px;padding-bottom:13px;border-bottom:1px solid #53655380}.product-icon{height:39px;width:39px;display:grid;place-items:center;border-radius:10px;background:#4c5f47;font-size:26px}.product-title{display:grid;gap:4px;min-width:0;flex:1}.product-title small{font-size:8px;letter-spacing:1px;color:#a4c1a8}.product-title strong{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.product-price{font-weight:800;color:#f1c89a;font-size:13px;white-space:nowrap}
.controls-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding-top:13px}.field{display:grid;gap:5px;min-width:0}.field span{color:#bccfbd;font-size:10px}.field select{appearance:none;width:100%;background:#243b2d;color:#f8f7f3;border:1px solid #67836b;border-radius:8px;padding:10px 25px 10px 9px;font-size:11px;outline:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath d='m1 1 6 6 6-6' stroke='%23dde7d6' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 9px center}.bottom-controls{display:flex;justify-content:space-between;align-items:center;gap:10px;padding-top:14px;font-size:10px;color:#bccfb9}.bottom-controls button{flex:none;border:1px solid #55765a;border-radius:8px;background:#294534;color:#f7f6f1;padding:8px 10px;font-size:11px}
.camera-error{position:fixed;z-index:200;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:30px;background:#14251ef5}.camera-error strong{font-size:21px}.camera-error p{line-height:1.7;color:#ccddca;font-size:13px}.camera-error a{margin-top:10px;background:#f1c18a;color:#1c3221;font-size:12px;font-weight:800;border-radius:10px;text-decoration:none;padding:12px 17px}
@media(min-width:700px){.control-sheet{width:480px;right:16px;left:auto;bottom:16px;border-radius:17px;border:1px solid #66806a;padding-bottom:15px}.status-panel{top:85px}.instructions{top:145px;left:auto;right:18px;margin:0}.hud-header{padding-right:22px}}

/* Diagnóstico detalhado do carregamento de bibliotecas (v5) */
.camera-error{overflow:auto;gap:10px}
.camera-error p{max-width:510px;margin:0}
.error-details{width:min(100%,520px);max-height:24vh;overflow:auto;white-space:pre-wrap;word-break:break-all;text-align:left;padding:12px;color:#d0e8d3;background:#08160f;border:1px solid #587963;border-radius:9px;font-size:10px}
.error-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin:3px 0}
.error-actions button{background:#284a35;color:#f3faf0;border:1px solid #6c9676;border-radius:9px;font:700 12px system-ui;padding:11px 13px}
