:root{font-family:Inter,system-ui,-apple-system,Arial,sans-serif;color:#572333;background:#fff9ec;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input{font:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}.app{max-width:560px;margin:0 auto;min-height:100dvh;background:#fff9ec}.head{background:#571d2b;color:#fff5e2;padding:22px 20px 26px}.top{display:flex;justify-content:space-between;align-items:center;margin-bottom:25px}.brand{font-size:22px;font-weight:800;color:#f3c64b}.iconbtn{border:0;background:transparent;color:#f3c64b;font-size:26px;padding:3px 8px}.titleline{display:flex;gap:14px;align-items:center}.titleline h1{margin:0;font-size:26px;letter-spacing:-.6px}.titleline p{margin:5px 0 0;font-size:12px;color:#e9c9c6}.back{border:0;background:none;color:#fff5e2;font-size:27px}.body{padding:18px}.home{display:grid;gap:16px;padding:20px 0}.tile{min-height:185px;border:0;border-radius:20px;text-align:left;padding:23px;display:flex;flex-direction:column;justify-content:space-between}.tile .sym{font-size:39px}.tile .arrow{float:right;font-size:28px}.tile h2{font-size:31px;margin:0 0 4px}.tile p{font-size:13px;margin:0}.saleTile{background:#732739;color:#fff8ea}.saleTile .sym,.saleTile .arrow{color:#f3c64b}.invTile{background:#f1c64d;color:#602131}.card{background:#fffefa;border:1px solid #e9dacb;border-radius:15px;padding:16px;margin-bottom:12px}.navcard{width:100%;display:flex;align-items:center;gap:13px;text-align:left}.navcard .symbol{display:grid;place-items:center;width:48px;height:48px;background:#fce7ae;border-radius:12px;font-size:25px}.navcard .desc{flex:1}.navcard strong{display:block;font-size:15px}.muted{color:#896d65;font-size:12px}.navcard .muted{margin-top:4px}.button{border:0;background:#732739;color:#fff9ec;padding:14px 16px;border-radius:11px;font-size:14px;font-weight:650;width:100%;margin-top:9px}.button.yellow{background:#f1c64d;color:#602131}.button.outline{background:transparent;border:1px solid #b99c99;color:#672637}.field{width:100%;border:1px solid #ddc9c1;border-radius:11px;padding:13px;background:white;color:#45212b;font-size:16px;margin:6px 0 12px}.field:focus{outline:2px solid #efc34b}label{font-size:13px;font-weight:600}.scanbox{background:#fbeac0;text-align:center;padding:26px;border-radius:16px;margin-bottom:14px}.scanbox .symbol{font-size:52px}.scanbox h2{font-size:19px;margin:6px 0}.scanbox p{font-size:12px;color:#805a49}.twocol{display:grid;grid-template-columns:1fr 1fr;gap:10px}.row{display:flex;justify-content:space-between;align-items:center;gap:10px}.listrow{padding:13px 0;border-bottom:1px solid #eedfd3}.listrow:last-child{border-bottom:0}.countinput{width:105px;text-align:center;font-size:27px;font-weight:700}.smallbtn{border:0;background:#f8e7b5;border-radius:10px;padding:11px 14px;font-size:20px;color:#602131}.notice{background:#fbe7b2;border-radius:12px;padding:12px;margin-bottom:14px;font-size:13px}.badge{font-size:11px;border-radius:20px;background:#fbeac0;padding:5px 9px}.photo{width:64px;height:64px;object-fit:cover;border-radius:10px;background:#f4e5d1}.photolarge{width:100%;max-height:190px;object-fit:contain;border-radius:12px;background:#f7e8d6;margin:10px 0}.camera{display:block;width:100%;height:clamp(130px,36vw,170px);object-fit:cover;background:#1f1a1b;border-radius:12px}.camwrap{position:relative}.aim{position:absolute;left:12%;right:12%;top:36%;height:26%;border:2px solid #f3c64b;border-radius:9px;pointer-events:none}.stat{background:#fbeac0;border-radius:12px;padding:15px}.stat b{display:block;font-size:23px;margin-top:8px}.loading{padding:40px;text-align:center}.fine{font-size:11px;color:#866f67;margin-top:12px}h3{margin:6px 0 15px}button:focus-visible{outline:3px solid #e7b82f;outline-offset:3px}@media(min-width:600px){.app{box-shadow:0 0 0 1px #e6d6c6}}

.camwrap{width:100%;max-width:100%;overflow:hidden;border-radius:12px;aspect-ratio:2.5/1;background:#1f1a1b}.camwrap .camera{height:100%;max-height:170px}.aim{left:15%;right:15%;top:28%;height:44%}@media(max-width:400px){.camwrap{aspect-ratio:2.65/1}.camwrap .camera{max-height:145px}.body{padding:14px}}

/* V3: tamaño explícito del elemento video, no solo de una clase ausente. */
#camera-holder {width:100%;max-width:100%;min-width:0}
#camera-holder .card {max-width:100%;overflow:hidden}
#camera-holder .camwrap {position:relative;width:100%;height:160px;max-height:160px;aspect-ratio:auto;overflow:hidden;border-radius:12px;background:#21191d}
#camera-holder video#camera-video {display:block;width:100%;max-width:100%;height:160px;max-height:160px;object-fit:cover;object-position:center;border-radius:12px}
#camera-holder .aim {position:absolute;top:34%;left:12%;right:12%;height:32%;border:2px solid #f3c64b;border-radius:8px;pointer-events:none}
@media(max-width:430px){#camera-holder .camwrap,#camera-holder video#camera-video{height:140px;max-height:140px}}

/* V4: recuadro de lectura amplio, contenido dentro del visor y del teléfono. */
#camera-holder .camwrap{width:100%;height:245px;max-height:245px;aspect-ratio:auto;overflow:hidden;position:relative}
#camera-holder video#camera-video{display:block;width:100%;height:245px;max-height:245px;object-fit:cover}
#camera-holder .aim{position:absolute;box-sizing:border-box;left:5%;right:5%;top:17%;height:66%;border:3px solid #f3c64b;border-radius:12px;pointer-events:none}
@media(max-width:430px){#camera-holder .camwrap,#camera-holder video#camera-video{height:215px;max-height:215px}}

/* V5: paleta crema, ámbar, mandarina y coral de referencia. */
:root{color:#65372C;background:#FFF4E5}
body{background:#FFF4E5}
.app{background:#FFF4E5}
.head{background:#FFB52F;color:#542B24}
.brand,.iconbtn,.back{color:#562D28}
.titleline p{color:#704532}
.saleTile{background:#FF7F32;color:#542B24}
.saleTile .sym,.saleTile .arrow{color:#642D25}
.invTile{background:#FFB52F;color:#542B24}
.tile{box-shadow:0 4px 16px #C75D2720}
.card{background:#FFF9F1;border-color:#F1D8C3;color:#63382E}
.navcard .symbol{background:#FFE3B0;color:#663B2E}
.muted,.fine{color:#806456}
.button{background:#F6473F;color:#FFFFFF}
.button.yellow{background:#FFB52F;color:#542B24}
.button.outline{border-color:#E6AF85;color:#743E30}
.field{border-color:#E6C5AB;background:#FFFDFC;color:#5B3429}
.field:focus{outline-color:#FFB52F}
.scanbox,.stat{background:#FFE5B7;color:#65372C}
.scanbox p{color:#825942}
.smallbtn,.badge,.notice{background:#FFE2AC;color:#63372C}
.photo,.photolarge{background:#FFE5C5}
.aim,#camera-holder .aim{border-color:#FFB52F}
#camera-holder .camwrap{background:#3B2D2A}
#camera-holder .aim{box-shadow:0 0 0 1px #FFB52F55}
button:focus-visible{outline-color:#F6473F}
@media(min-width:600px){.app{box-shadow:0 0 0 1px #EED5C0}}

/* V7: vista de cámara móvil sin desbordamiento */
html,body,#app,.app,.body{max-width:100%;overflow-x:hidden}
#camera-holder,#camera-holder .card{box-sizing:border-box;width:100%;max-width:100%;min-width:0}
#camera-holder .camwrap{position:relative;box-sizing:border-box;width:100%;max-width:100%;height:230px;max-height:230px;aspect-ratio:auto;overflow:hidden;border-radius:14px;background:#302722}
#camera-holder video#camera-video{display:block;box-sizing:border-box;width:100%;max-width:100%;height:100%;max-height:100%;object-fit:cover;object-position:center}
#camera-holder .aim{position:absolute;box-sizing:border-box;left:5%;right:5%;top:17%;height:66%;border:3px solid #FFB52F;border-radius:12px;pointer-events:none}
@media(max-width:430px){#camera-holder .camwrap{height:210px;max-height:210px}#camera-holder video#camera-video{height:100%;max-height:100%}}

/* V8: paleta apagada: beige, mostaza, terracota, rojo arcilla y marrón. */
:root{color:#633C35;background:#F5EBDD}
html,body,.app{background:#F5EBDD;color:#633C35}
.head{background:#F5EBDD;color:#633C35;border-bottom:1px solid #DDC9B4}
.brand,.iconbtn,.back{color:#633C35}
.titleline p{color:#806456}
.saleTile{background:#B85445;color:#FFF3E5}
.saleTile .sym,.saleTile .arrow{color:#FFF3E5}
.invTile{background:#E8C47A;color:#633C35}
.invTile .sym,.invTile .arrow{color:#633C35}
.tile{box-shadow:0 5px 14px #633C3517}
.card{background:#FFF9F1;border-color:#DDC9B4;color:#633C35}
.navcard .symbol{background:#F2DDB7;color:#633C35}
.muted,.fine{color:#806456}
.button{background:#B85445;color:#FFF9F1}
.button.yellow{background:#E8C47A;color:#633C35}
.button.outline{background:#FFF9F1;border-color:#C8A78D;color:#633C35}
.field{background:#FFFDFC;border-color:#D8BDA8;color:#633C35}
.field:focus{outline-color:#D78B59}
.scanbox,.stat{background:#F1DFBC;color:#633C35}
.scanbox p{color:#806456}
.smallbtn,.badge,.notice{background:#F2DDB7;color:#633C35}
.photo,.photolarge{background:#F1DFBC}
#camera-holder .camwrap{background:#302824}
#camera-holder .aim,.aim{border-color:#E8C47A;box-shadow:0 0 0 1px #E8C47A55}
button:focus-visible{outline-color:#B85445}
@media(min-width:600px){.app{box-shadow:0 0 0 1px #DDC9B4}}

/* Acceso discreto a personas con deudas: sin barra inferior. */
.app{position:relative}
.debt-fab{position:absolute;right:17px;bottom:18px;width:54px;height:54px;border-radius:50%;border:1px solid #A9493C;background:#B85445;color:#FFF3E5;display:flex;align-items:center;justify-content:center;box-shadow:0 5px 14px #633C3540;cursor:pointer;z-index:5}
.debt-fab:focus-visible{outline:3px solid #E8C47A;outline-offset:3px}
.debt-total{display:flex;flex-direction:column;gap:4px;background:#E8C47A;color:#633C35;border-radius:14px;padding:17px;margin-bottom:16px}
.debt-total strong{font-size:28px;line-height:1.15}.debt-total small{font-size:12px}
.debt-row{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:12px 0;border-bottom:1px solid #E4D0BC}.debt-row:last-child{border-bottom:0}
.debt-info,.debt-actions{display:flex;flex-direction:column;gap:5px;min-width:0}.debt-info span,.debt-info small{font-size:12px;color:#806456;overflow-wrap:anywhere}.debt-actions{align-items:flex-end;text-align:right}.debt-actions strong{white-space:nowrap}.debt-actions strong.paid{text-decoration:line-through;color:#887A6B}.debt-actions .smallbtn{font-size:11px;white-space:nowrap}
@media(max-width:370px){.debt-row{flex-wrap:wrap}.debt-actions{width:100%;flex-direction:row;justify-content:space-between;align-items:center}}

/* V10: inicio directo y compacto */
.app:has(.home) .head{padding-bottom:12px}
.app:has(.home) .body{padding-top:18px}
.app:has(.home) .home{margin-top:0}
.backup-card{margin-bottom:16px}
.backup-card .field{margin:10px 0}

/* V11: escaneo rápido, venta con fiado y facturas */
select,textarea{font:inherit}
textarea.field{resize:vertical;min-height:84px}
.codeline{display:flex;gap:8px;align-items:center;margin-top:10px}
.codeline .field{margin:0;flex:1}
.codeline .smallbtn{flex:0 0 auto;height:48px}
.flash{border-radius:12px;padding:11px 12px;margin:10px 0;font-size:13px;background:#F2DDB7;color:#633C35}
.flash.ok{background:#DDE8C9;color:#3F5130}
.flash.warn{background:#F3D2C7;color:#7A2F25}
.quick{border:2px solid #E8C47A;margin-top:12px}
.quick .photo{flex:0 0 auto}
.qtyline{justify-content:center;margin:6px 0 4px}
.rowqty{width:84px;margin:0;text-align:center;font-weight:700}
.up{color:#4E6B35;font-weight:700}.down{color:#B85445;font-weight:700}
.incart{background:#F7EBD2;margin:0 -16px;padding-left:16px;padding-right:16px}
.qty{min-width:22px;text-align:center}
.cartcard{margin-top:12px}
.cartline{padding:6px 0;font-size:14px}.cartline span{min-width:0;overflow-wrap:anywhere}
.totalrow{margin:8px 0 4px}.totalrow h2{margin:6px 0}
.fiado{margin-top:10px}
.check{display:flex;gap:12px;align-items:flex-start;font-weight:400;cursor:pointer}
.check input{width:22px;height:22px;margin:2px 0 0;accent-color:#B85445;flex:0 0 auto}
.check span{display:flex;flex-direction:column;gap:3px}.check small{font-size:12px;color:#806456}
.fiado .check+label{display:block;margin-top:14px}
.photopick{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;text-align:center;min-height:150px;border:2px dashed #D8BDA8;border-radius:14px;background:#F1DFBC;padding:16px;margin-bottom:14px;cursor:pointer}
.photopick .symbol{font-size:34px}
.photopick img{max-width:100%;max-height:240px;border-radius:10px;object-fit:contain}
.photopick.loading{opacity:.55}
.month{padding:0;overflow:hidden}
.month summary{list-style:none;display:flex;justify-content:space-between;align-items:center;gap:10px;padding:15px 16px;cursor:pointer}
.month summary::-webkit-details-marker{display:none}
.month summary span{display:flex;flex-direction:column;gap:3px}.month summary small{font-size:12px;color:#806456}
.month summary strong{font-size:17px;white-space:nowrap}
.month summary::after{content:'▾';font-size:14px;transition:transform .15s}
.month[open] summary::after{transform:rotate(180deg)}
.invrow{display:flex;gap:12px;align-items:center;width:100%;border:0;border-top:1px solid #E4D0BC;background:transparent;padding:12px 16px;text-align:left;color:inherit}
.invrow .photo{flex:0 0 auto;width:52px;height:52px}
.nophoto{display:grid;place-items:center}
.invinfo{display:flex;flex-direction:column;gap:3px;flex:1;min-width:0}
.invrow strong{white-space:nowrap}
.ell{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.invfull{overflow:auto;max-height:70vh;border-radius:12px;background:#F1DFBC}
.invfull img{display:block;width:100%;height:auto;cursor:zoom-in}
.invfull img.zoomed{width:250%;max-width:none;cursor:zoom-out}
.invfull p{margin:10px 12px}
.invdetail{white-space:pre-wrap;font-size:14px}
.button.danger{color:#B85445;border-color:#B85445}
