/* 1.7.1: interface reorganizada e fiel ao conceito aprovado; sem alterar dados ou negócio. */
/* Minha Lista 1.7: redesign de apresentação, sem dependência de fontes ou imagens externas. */
:root{
 --green:#087750; --dark:#182f28; --muted:#6d8277; --bg:#f2f8f4;
 --line:#dbe9df; --shadow:0 16px 45px rgba(12,70,49,.07);
 --mint:#e8f8ed;--soft:#f8fcf9;
}
html{scroll-behavior:smooth;scroll-padding-top:18px}
body{background:radial-gradient(ellipse 620px 520px at 50% -175px,#d8f7e3 0%,rgba(233,250,239,.85) 52%,transparent 100%),#f3f8f5;color:var(--dark);letter-spacing:-.012em}
.layout{max-width:590px;padding:0 18px calc(220px + env(safe-area-inset-bottom))}
.hero{align-items:center;padding:26px 5px 19px;gap:10px}
.hero .eyebrow{font-size:10px;color:#1b8760;letter-spacing:.16em;font-weight:850;text-transform:uppercase}
.hero h1{font-size:32px;letter-spacing:-1.35px;line-height:1.1;margin:5px 0 6px;font-weight:830}
.hero .subtitle{font-size:13px;color:#73877b}
.cart{font-size:28px;width:61px;height:61px;display:grid;place-items:center;border-radius:21px;background:linear-gradient(145deg,#e7faee,#d8f0e3);box-shadow:inset 0 1px white;border:1px solid #e4f4e9}
.place-bar{margin:3px 0 14px}
.place-button{position:relative;min-height:78px;width:100%;padding:14px 42px 14px 57px;text-align:left;border:1px solid rgba(215,232,220,.9);border-radius:21px;box-shadow:0 6px 23px #1a53300a;background:linear-gradient(130deg,#fff,#f8fdf9);color:#1f4d3a;font-weight:780;font-size:14px;line-height:1.3;overflow-wrap:anywhere}
.place-button:before{content:'⌖';position:absolute;left:12px;top:50%;transform:translateY(-50%);width:36px;height:42px;border-radius:13px;display:grid;place-items:center;color:white;background:linear-gradient(140deg,#24af74,#086e4e);font-size:25px;box-shadow:0 6px 11px #08765333}
.place-button:after{content:'›';position:absolute;right:17px;top:50%;transform:translateY(-50%);font-size:25px;color:#267957}
.composer{border-radius:24px;box-shadow:0 12px 40px #0e5c310a;border:1px solid #e4ece6;padding:10px;background:#fff}
.add-row{align-items:center;gap:7px}
.add-row input{border:0!important;border-radius:15px;background:#f5faf6;min-height:57px;padding:13px 14px;color:var(--dark);font-size:15px;min-width:0}
.add-row input::placeholder{color:#85978d}
.square{min-width:49px;width:49px;height:54px;border-radius:16px;font-size:23px}
.square.add{background:linear-gradient(155deg,#16a36e,#047450);box-shadow:0 5px 12px #1a98653b}
.square.mic{border-radius:17px;color:#fff;background:linear-gradient(145deg,#159b69,#06734e);box-shadow:0 6px 14px #16895744}
.mic.active{background:#ca3939}
.hint{padding:0 3px 3px;font-size:11px;margin-top:7px;min-height:18px}
.quick-suggestions{display:flex;gap:7px;align-items:center;padding:12px 1px 14px;overflow:auto;scrollbar-width:none;white-space:nowrap}
.quick-suggestions::-webkit-scrollbar{display:none}
.suggestions-caption{font-size:10px;font-weight:750;color:#6b8a78;margin-right:2px;flex-shrink:0}
.quick-chip{background:#fff;color:#2b6249;border:1px solid #e0ede4;box-shadow:0 2px 6px #194f3010;border-radius:999px;font-size:11px;font-weight:740;padding:10px 12px;min-height:38px;white-space:nowrap}
.quick-chip:active{transform:scale(.97)}
.overview-card{background:linear-gradient(110deg,#036449,#08835b 58%,#b5ebc8 145%);border:1px solid rgba(255,255,255,.32);box-shadow:0 12px 24px #086e4633;border-radius:23px;color:#fff;padding:19px 20px 16px;margin:0 0 21px;overflow:hidden}
.overview-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.overview-label{display:flex;align-items:center;gap:11px;min-width:0}
.overview-icon{display:grid;place-items:center;flex-shrink:0;width:47px;height:47px;border-radius:14px;font-size:24px;background:rgba(255,255,255,.17);box-shadow:inset 0 1px rgba(255,255,255,.18)}
.overview-label small,.overview-plan small{display:block;font-size:11px;color:#d5efe0;font-weight:550;white-space:nowrap;margin-bottom:2px}
.overview-label strong{display:block;font-size:26px;font-weight:850;letter-spacing:-.8px;font-variant-numeric:tabular-nums}
.overview-plan{border-left:1px solid #ffffff48;padding-left:16px;min-width:108px}
.overview-plan strong{display:block;font-size:17px;font-variant-numeric:tabular-nums;white-space:nowrap}
.overview-track{height:7px;border-radius:99px;background:#ffffff50;margin-top:17px;overflow:hidden}
.overview-track span{display:block;background:#fff;max-width:100%;height:100%;border-radius:99px;transition:width .2s ease}
.overview-footer{font-size:11px;display:flex;align-items:center;justify-content:space-between;gap:12px;color:#e5f9ee;margin-top:9px;font-weight:650}
.info{margin:19px 4px 11px}
.info h2{font-size:20px;letter-spacing:-.6px;font-weight:810}
.count{background:#ddf4e6;color:#0f7d55;font-size:11px;padding:6px 11px}
.panel{border:1px solid #e5ece7;border-radius:22px;background:#fff;box-shadow:0 10px 32px #124d2610;overflow:hidden}
.item{position:relative;display:flex;align-items:flex-start;gap:9px;min-height:103px;padding:15px 10px;border-bottom:1px solid #edf3ef}
.item:last-child{border-bottom:0}
.check{width:24px;height:24px;min-width:24px;margin-top:14px;accent-color:#0d875b}
.product-art{display:flex;align-items:center;justify-content:center;min-width:45px;width:45px;height:48px;margin-top:2px;border-radius:14px;background:linear-gradient(135deg,#f1f8ec,#eaf3e1);font-size:27px;filter:saturate(.95)}
.product-art.meat{background:#fff0e9}.product-art.dairy{background:#eaf3fd}.product-art.fruit{background:#f3f9e6}.product-art.clean{background:#e9f5fa}.product-art.drink{background:#f0f1ff}
.item-content{min-width:0;flex:1;gap:3px;padding-top:0}
.item-main{padding:1px 0;min-height:27px;max-width:100%;margin-right:0}
.item-main strong{font-size:14px;line-height:1.25;font-weight:800;letter-spacing:-.25px;overflow-wrap:anywhere}
.item-chips{display:flex;gap:6px;margin-top:7px;flex-wrap:wrap}
.qty-chip,.price-chip{min-height:34px;border-radius:10px;padding:7px 9px;font-size:11px;font-weight:750;line-height:1.3}
.qty-chip{background:#edf8f1;border:1px solid #b5d9c0;color:#126544}
.price-chip.price-known{background:#eff5fd;border:1px solid #d1e2f6;color:#245273}
.price-chip.price-missing{background:#fff6df;border:1px solid #f0d7a9;color:#80530d}
.price-hint{color:#7a8a80;font-size:10px;padding:1px 0;line-height:1.35}
.trash{border:0;background:#f8fbf9;color:#90a9a1;min-width:31px;width:31px;height:32px;font-size:17px;padding:3px;border-radius:10px;margin-top:5px}
.done .item-main strong{text-decoration:line-through;color:#82998a}
.section-head{margin-top:21px}
.section-head h2{font-size:16px;font-weight:790;color:#2b4c3a}
.linkbtn{color:#44745b;font-size:12px;padding:12px 9px}
.history-actions{margin:21px 0 2px}
.history-actions button{border-radius:15px;min-height:52px;font-size:13px}
.history-actions .finish{background:linear-gradient(145deg,#069165,#026c4b);box-shadow:0 5px 14px #056d4626}
.history-actions .history{background:#edf8f1;border-color:#d8eee0;color:#176b4c}
.share{background:#e3f4eb;color:#0d7751;border-radius:14px;padding:14px 16px}
.tools{margin:17px 2px;gap:4px}
.tools>div{display:flex;gap:2px;flex-wrap:wrap}
.bottom{padding:15px 15px 25px;max-width:475px;margin:10px auto 0;color:#8aa396;font-size:11px}
/* Cart bar kept fixed above nav for continuous budgeting */
.total-card{bottom:calc(72px + env(safe-area-inset-bottom));padding:10px 18px 11px;width:min(590px,calc(100% - 20px));border-radius:18px 18px 4px 4px;background:linear-gradient(135deg,#075f45,#05845a);box-shadow:0 4px 18px #05462a45}
.total-eyebrow{font-size:11px;letter-spacing:.02em}
.total-value{font-size:25px!important;letter-spacing:-.7px;margin:0}
.total-card .total-row{font-size:11px;margin-top:0}
.total-card .total-row b{font-size:13px}
.total-card .total-warning{font-size:10px;line-height:1.25;margin-top:2px}
/* Tab-bar inspired by the concept, all buttons perform real app actions. */
.app-nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:min(590px,100%);height:calc(72px + env(safe-area-inset-bottom));padding:5px 11px calc(5px + env(safe-area-inset-bottom));z-index:19;display:grid;grid-template-columns:repeat(4,1fr);gap:5px;background:rgba(255,255,255,.97);backdrop-filter:blur(12px);border:1px solid #e9f0eb;border-radius:17px 17px 0 0;box-shadow:0 -7px 24px #0b51351b}
.nav-item{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:1px;border:0;border-radius:13px;background:transparent;color:#70877d;padding:4px 2px;min-width:0}
.nav-item span{font-size:24px;font-weight:800;line-height:1.1}
.nav-item small{font-size:10px;font-weight:700;line-height:1.3}
.nav-item.active{color:#0c8055;background:#e7f6ec}
.nav-item:active{background:#e8f7ed}
.toast{bottom:calc(185px + env(safe-area-inset-bottom));max-width:min(520px,calc(100vw - 28px));font-size:13px}
/* Unified modal styling, especially history and markets */
dialog{border-radius:25px;box-shadow:0 30px 90px #09211755;padding:22px;background:#fff;max-height:calc(100dvh - 35px);overflow-y:auto;color:#20392b}
dialog::backdrop{background:rgba(10,36,27,.66);backdrop-filter:blur(2px)}
dialog h3{font-weight:840;font-size:23px;letter-spacing:-.8px}
dialog p{color:#72867a;font-size:13px}
dialog label{color:#3c624e}
dialog input,dialog select{background:#f9fcfa;border:1px solid #dbe8df;border-radius:13px}
dialog button{border-radius:13px}dialog button.primary{background:#047c57}dialog button.secondary{background:#edf3ef;color:#2b4d39}
#history-dialog{width:min(530px,calc(100vw - 24px))}
#history-dialog .history-summary{border-radius:20px;background:linear-gradient(133deg,#056d4e,#0b8d61);color:#fff;padding:17px 19px;margin:17px 0 20px}
#history-dialog .history-summary strong{font-size:34px;letter-spacing:-1px;color:#fff}
#history-dialog .history-summary .dialog-note{color:#d5f3df}
#history-list{display:grid;gap:9px}
.history-entry{border:1px solid #e7efe9;border-radius:16px;background:#fafdfb;padding:14px 16px;transition:background .12s}
.history-entry:active{background:#ebf7ef}.history-entry b{font-size:14px;color:#21432e}.history-entry small{color:#829187}
.market-option{background:#fbfdfb;border:1px solid #e3ede6;border-radius:15px;padding:14px 15px}
.market-option:active{background:#eaf7ee}
#store-dialog{width:min(525px,calc(100vw - 24px))}
#market-list{display:grid;gap:9px}
.market-controls button{min-height:54px;border-radius:15px}
#history-edit-dialog{width:min(520px,calc(100vw - 24px))}
#history-edit-dialog .history-edit-item{border-radius:16px;background:#f8fcfa}
#purchase-dialog .history-summary{border-radius:16px;padding:14px}
@media(max-width:390px){
 .layout{padding-inline:12px;padding-bottom:calc(210px + env(safe-area-inset-bottom))}
 .hero{padding-top:19px}
 .hero h1{font-size:28px}
 .cart{width:49px;height:49px;border-radius:17px;font-size:24px}
 .place-button{min-height:71px}
 .add-row input{padding:10px 9px;font-size:14px}
 .square{min-width:43px;width:43px;height:50px}
 .overview-card{padding:15px}
 .overview-label{gap:7px}.overview-icon{width:40px;height:40px}
 .overview-label strong{font-size:22px}.overview-plan{min-width:90px;padding-left:9px}.overview-plan strong{font-size:15px}
 .suggestions-caption{display:none}
 .item{padding:11px 8px;gap:5px}.check{min-width:22px;width:22px}
 .product-art{width:38px;min-width:38px;height:42px;font-size:23px}
 .item-main strong{font-size:13px}
 .qty-chip,.price-chip{font-size:10px;padding:6px 7px}
 .trash{min-width:26px;width:26px}
 .total-card{bottom:calc(68px + env(safe-area-inset-bottom));padding:9px 15px;width:calc(100% - 12px)}
 .app-nav{height:calc(69px + env(safe-area-inset-bottom))}
}
@media(min-width:700px){body{padding:22px 0}.layout{background:#f5faf6;min-height:95vh;border:1px solid #e2f0e7;border-radius:29px 29px 0 0;padding-top:0;box-shadow:0 30px 100px #13472b16}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

/* Mobile density tuning: keep shopping items visible without hiding the budget. */
@media(max-width:600px){
 .hero{padding-top:15px;padding-bottom:12px}.hero h1{font-size:29px}.hero .subtitle{font-size:12px}
 .place-bar{margin-bottom:10px}.place-button{min-height:67px;padding-top:10px;padding-bottom:10px}
 .composer{padding:8px}.add-row input{min-height:48px}.square{height:48px}
 .hint{margin-top:5px;margin-bottom:1px}
 .quick-suggestions{padding-top:8px;padding-bottom:9px}.quick-chip{padding-top:8px;padding-bottom:8px;min-height:33px}
 .overview-card{padding:14px 17px 13px;margin-bottom:15px}
 .overview-icon{width:41px;height:41px}
 .overview-label strong{font-size:23px}.overview-track{margin-top:11px;height:6px}.overview-footer{margin-top:6px}
 .info{margin-top:13px;margin-bottom:10px}.info h2{font-size:18px}
 .total-card{padding-top:8px;padding-bottom:8px}
}

:root{--green:#087b55;--dark:#172c23;--muted:#7c8f85;--bg:#f4faf6;--line:#e6eee8}
body{background:linear-gradient(160deg,#e1f7e8 0,#f4faf6 340px,#f7faf8 900px);color:var(--dark)}
.layout{max-width:540px;padding:0 15px calc(128px + env(safe-area-inset-bottom))}
.hero{padding:17px 7px 15px}
.hero .eyebrow{font-size:10px;letter-spacing:.15em}
.hero h1{font-size:28px;letter-spacing:-1.05px;margin:4px 0 4px}
.hero .subtitle{font-size:12px}
.cart{width:48px;height:48px;background:linear-gradient(145deg,#ecf9f0,#d9eddf);border-radius:15px}
.cart img{height:25px;width:25px}
.place-bar{margin:0 0 12px}
.place-button{min-height:65px;border-radius:18px;padding:11px 38px 11px 57px;box-shadow:0 7px 24px #15583709;font-size:13px;background:#fff}
.place-button:before{width:36px;height:36px;left:12px;border-radius:12px;font-size:22px}
.place-button:after{right:13px}
.composer{border-radius:19px;padding:7px;border:1px solid #e5eee8;box-shadow:0 6px 22px #13593d09}
.add-row{gap:6px}
.add-row input{min-height:50px;background:#fff;border:0!important;font-size:14px;padding:12px;letter-spacing:0}
.square{width:44px;min-width:44px;height:48px;border-radius:13px}
.square.add{font-size:23px}
.square.mic{font-size:0!important;position:relative;background:linear-gradient(140deg,#16875e,#086b4d)}
.square.mic:before{content:'';background:url('./icons/mic.svg') center/contain no-repeat;width:25px;height:25px;position:absolute;inset:0;margin:auto}
.square.mic.active{background:#c53d3d}
.hint{font-size:10px;margin-top:0;padding:4px 8px 3px;line-height:1.25}
.quick-suggestions{padding:11px 0 12px;gap:6px}
.quick-chip{font-size:12px;padding:7px 11px;min-height:35px;box-shadow:none;border-color:#e8f0e9}
.suggestions-caption{display:none}
/* Painel verde principal, sempre com total real e indicação de valores faltantes. */
.overview-card{background:linear-gradient(111deg,#086044 0%,#0b865b 66%,#30ad70 100%);border-radius:20px;padding:15px 16px;margin:0 0 18px;box-shadow:0 13px 28px #0c775127}
.overview-icon{width:42px;height:42px;font-size:21px;border-radius:13px}
.overview-label{gap:9px}
.overview-label small,.overview-plan small{font-size:11px}
.overview-label strong{font-size:25px;letter-spacing:-.9px}
.overview-plan{min-width:94px;padding-left:12px}
.overview-plan strong{font-size:17px}
.overview-track{height:5px;margin-top:13px}
.overview-footer{font-size:10px;margin-top:7px}
.overview-warning{font-size:10px;font-weight:600;color:#fff2bd;line-height:1.2;padding-top:5px}
.overview-warning:empty{display:none}
.info{margin:16px 2px 10px}.info h2{font-size:17px}.count{font-size:11px}
.panel{border-radius:19px;overflow:hidden;border-color:#e4ede7;box-shadow:0 7px 25px #174d310a}
/* 4-col rows styled like the selected app reference, tap quantity and price to edit. */
.item{display:grid;grid-template-columns:25px 47px minmax(0,1fr) minmax(75px,92px);column-gap:8px;align-items:center;min-height:80px;padding:9px 11px;border-bottom:1px solid #edf2ef}
.check{min-width:21px;width:21px;height:21px;margin:0;align-self:center}
.product-art{min-width:45px;width:45px;height:48px;border-radius:12px;margin:0;display:grid;place-items:center;background:#f6f8f5}
.product-art .product-image{width:43px;height:43px;object-fit:contain;display:block}
.item-content{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;min-width:0;gap:3px;padding:0}
.item-main{min-height:unset;max-width:100%;padding:0;margin:0;display:block}
.item-main strong{font-size:13px;font-weight:800;line-height:1.25;letter-spacing:-.12px}
.item-unit{color:#788a7e;font-size:10px;line-height:1.28;max-width:100%;overflow-wrap:anywhere}
.qty-chip.qty-inline{min-height:unset;margin:3px 0 0!important;padding:0;border:0!important;background:none!important;box-shadow:none!important;color:#277554;font-size:10px;font-weight:760;line-height:1.3;text-align:left}
.qty-chip.qty-inline:before{content:'✎';margin-right:3px}
.item-money{display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:3px;min-width:0}
.price-chip.price-inline{border:0;min-height:unset;background:transparent;padding:0;box-shadow:none;border-radius:0;text-align:right;font-size:13px;font-weight:850;color:#1d3328;white-space:nowrap}
.price-chip.price-inline.price-missing{background:transparent;color:#a27629;font-size:11px}
.item-money .price-hint{font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;padding:0;text-align:right;line-height:1.1;color:#829388}
.item-money .trash{min-width:28px;width:29px;height:27px;padding:5px;margin:3px 0 0;border:0;border-radius:8px;background:transparent;font-size:0;display:grid;place-items:center}
.item-money .trash:before{content:'';background:url('./icons/trash.svg') center/contain no-repeat;width:18px;height:18px}
.item-money .trash:focus-visible,.item-money .trash:hover{background:#fff0ee}
.item-note{color:#738a7b;font-size:10px}
.done .item-main strong{text-decoration:line-through;color:#82958b}
.section-head{margin-top:16px}
.history-actions{margin-top:16px}
.history-actions button{min-height:44px;font-size:12px;border-radius:13px}
.share{border-radius:13px;font-size:12px}
.tools{margin:12px 0}
.tools .linkbtn{font-size:12px;padding:11px 7px}
.bottom{font-size:10px;margin-top:16px;margin-bottom:8px}
/* Uma única apresentação de totais por vez: painel no topo; barra curta só depois da rolagem. */
.total-card{display:none;position:fixed;bottom:calc(64px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(520px,calc(100% - 18px));z-index:18;border-radius:15px;margin:0;padding:8px 13px;background:linear-gradient(110deg,#066d4a,#0b8457);box-shadow:0 5px 18px #0a553b35;align-items:center;gap:9px;min-height:46px}
body.summary-out-of-view .total-card{display:flex}
.total-card .total-eyebrow{display:block;font-size:10px;opacity:.88;white-space:nowrap}
.total-card .total-value{font-size:19px!important;letter-spacing:-.5px;white-space:nowrap;line-height:1.1;margin:0}
.total-card .total-divider{display:none}
.total-card .total-row{margin:0 0 0 auto;display:flex;flex-direction:column;align-items:flex-end;gap:0;font-size:9px;line-height:1.3;color:#e7fff3}
.total-card .total-row b{font-size:13px}
.total-card .total-warning{display:none}
.app-nav{height:calc(64px + env(safe-area-inset-bottom));padding:4px 10px calc(5px + env(safe-area-inset-bottom));width:min(540px,100%);border-radius:17px 17px 0 0}
.nav-item span{font-size:23px}.nav-item small{font-size:10px}
.toast{bottom:calc(122px + env(safe-area-inset-bottom))}
@media(max-width:390px){
 .layout{padding:0 9px calc(130px + env(safe-area-inset-bottom))}
 .item{grid-template-columns:20px 40px minmax(0,1fr) minmax(71px,85px);gap:5px;padding:9px 7px}
 .product-art{width:39px;min-width:39px;height:43px}.product-art .product-image{width:39px;height:39px}
 .item-main strong{font-size:12px}.price-chip.price-inline{font-size:12px}
 .hero{padding-top:14px}.hero h1{font-size:27px}
 .place-button{min-height:61px}.overview-card{padding:12px}
 .overview-label strong{font-size:22px}.overview-plan strong{font-size:15px}
}
@media(min-width:700px){.layout{max-width:540px;border-radius:28px;padding-inline:16px;min-height:96vh}}

/* Ícones coesos e acessíveis na navegação e no resumo. */
.overview-icon img{width:24px;height:24px;display:block}
.place-button:before{content:'';background:#0d8b5c url('./icons/pin-white.svg') center/23px no-repeat}
.nav-item svg{width:22px;height:22px;display:block;flex-shrink:0}
