:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --panel: #fffdf8;
  --ink: #17231d;
  --muted: #657068;
  --line: #ddd6c8;
  --green: #23614b;
  --green-2: #d9eadf;
  --gold: #d9a72f;
  --red: #d65f3b;
  --blue: #2f6f9f;
  --shadow: 0 12px 26px rgba(30, 38, 33, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 0; }
body { overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button { border: 0; border-radius: 8px; background: var(--green); color: white; min-height: 44px; padding: 0 14px; font-weight: 700; cursor: pointer; }
button.secondary { background: #e9e3d6; color: var(--ink); }
button.icon { inline-size: 42px; padding: 0; display: inline-grid; place-items: center; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(35, 97, 75, .28); outline-offset: 2px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: white; border-radius: 8px; min-height: 42px; padding: 9px 10px; color: var(--ink); }
label { display: grid; gap: 6px; color: var(--muted); font-size: .9rem; font-weight: 700; }
.login-shell { min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 36px; align-items: center; max-width: 1040px; margin: 0 auto; padding: 24px; }
.login-shell h1 { font-size: 3rem; line-height: 1; max-width: 620px; margin: 8px 0 14px; }
.eyebrow { font-weight: 900; color: var(--green); margin: 0; }
.muted { color: var(--muted); }
.error { color: #9d2c18; min-height: 20px; }
.app-shell { min-height: 100svh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.side { background: #fff8ea; border-right: 1px solid var(--line); padding: 18px 14px; position: sticky; top: 0; height: 100svh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.1rem; margin: 4px 4px 22px; }
.brand img { width: 34px; height: 34px; }
.nav { display: grid; gap: 5px; }
.nav button { background: transparent; color: var(--ink); text-align: left; display: flex; gap: 9px; align-items: center; font-weight: 750; }
.nav button.active { background: var(--green-2); color: #113f2e; }
.content { padding: 22px; max-width: 1180px; width: 100%; margin: 0 auto; }
.topbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 18px; }
.topbar h1 { font-size: 1.8rem; margin: 0; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.panel.compact { display: grid; gap: 12px; }
.stat { display: grid; gap: 6px; }
.stat strong { font-size: 1.7rem; }
.tag { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; background: #eee7d8; color: #382f22; font-weight: 800; font-size: .78rem; width: fit-content; }
.tag.good, .tag.EXCELLENT, .tag.GOOD { background: #d9eadf; color: #164631; }
.tag.warn, .tag.HIGH, .tag.OVERPRICED { background: #f8dfd5; color: #833018; }
.tag.fair, .tag.FAIR { background: #eef0e8; color: #38423b; }
.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; border-bottom: 1px solid #eee7d9; padding: 10px 0; min-width: 0; }
.row:last-child { border-bottom: 0; }
.row main { min-width: 0; }
.row h3 { margin: 0 0 4px; font-size: 1rem; overflow-wrap: anywhere; }
.row p { margin: 0; color: var(--muted); font-size: .9rem; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.formline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.list-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.list-item input[type="checkbox"] { width: 22px; height: 22px; min-height: 22px; }
.checked h3 { text-decoration: line-through; color: var(--muted); }
.price-table { display: grid; gap: 8px; }
.price-row { display: grid; grid-template-columns: 1.4fr .8fr .8fr; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.item-price { border: 1px solid var(--line); border-radius: 8px; background: white; padding: 10px; display: grid; gap: 8px; }
.item-price .row { padding: 0 0 8px; }
.item-price-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 12px; border-radius: 8px; background: #fff8ea; border: 1px solid #eadfca; }
.item-price-hero strong { font-size: 1.55rem; }
.item-price-hero p, .item-price-hero small { grid-column: 1 / -1; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.item-price-hero small { color: var(--muted); }
.price-options { display: grid; gap: 6px; }
.price-option { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(86px, auto); gap: 8px; align-items: center; padding: 8px; border-radius: 8px; background: #f7f4ee; }
.price-option.best { background: var(--green-2); }
.price-option small { color: var(--muted); text-align: right; }
.section-title { margin: 20px 0 8px; font-size: 1.05rem; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.tabs button { background: #e9e3d6; color: var(--ink); white-space: nowrap; }
.tabs button.active { background: var(--green); color: white; }
.store-chip { display: inline-flex; width: fit-content; align-items: center; gap: 6px; color: #164631; background: #d9eadf; border: 1px solid #bdd9c7; border-radius: 999px; padding: 4px 9px; font-size: .78rem; font-weight: 900; }
.deal-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 230px); gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.deal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.deal-card { min-height: 220px; display: grid; align-content: start; gap: 10px; background: white; border: 1px solid var(--line); border-radius: 8px; padding: 12px; box-shadow: var(--shadow); }
.deal-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.deal-price { font-size: 2rem; line-height: 1; color: var(--green); }
.deal-card h3 { margin: 0; font-size: 1rem; line-height: 1.2; overflow-wrap: anywhere; }
.deal-card p { margin: 0; color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.deal-card footer { align-self: end; display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .78rem; border-top: 1px solid #eee7d9; padding-top: 8px; }
.deal-filters span { opacity: .75; font-size: .82em; }
.receipt-grid { display: grid; grid-template-columns: 1fr 90px 90px; gap: 8px; }
@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; align-content: center; }
  .login-shell h1 { font-size: 2.1rem; }
  .app-shell { display: block; padding-bottom: 74px; }
  .side { position: fixed; inset: auto 0 0 0; height: 66px; z-index: 10; display: flex; align-items: center; overflow-x: auto; border-right: 0; border-top: 1px solid var(--line); padding: 8px; }
  .brand { display: none; }
  .nav { display: flex; gap: 4px; }
  .nav button { min-width: 64px; min-height: 48px; flex-direction: column; justify-content: center; text-align: center; font-size: .75rem; padding: 4px 8px; }
  .content { padding: 14px; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .formline, .price-row, .receipt-grid, .price-option, .item-price-hero { grid-template-columns: 1fr; }
  .price-option small { text-align: left; }
  .deal-strip { grid-auto-columns: minmax(172px, 78vw); }
  .row { align-items: flex-start; flex-direction: column; }
}
