*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;font-family:'Segoe UI',system-ui,-apple-system,Roboto,sans-serif;background:#fbf4ea;color:#3b2a1a}
button,input,select{font-family:inherit}
[hidden]{display:none!important}
.hero{position:relative;background:radial-gradient(ellipse at top,#c62828,#6b1212 80%);color:#fff7ed;text-align:center;padding:44px 20px 80px;overflow:hidden}
.hero canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.hero>*{position:relative}
.hero h1{font-family:Georgia,'Times New Roman',serif;font-size:54px;margin:4px 0 6px;text-shadow:0 3px 0 #450a0a;line-height:1.1}
.hero p{margin:0 auto;opacity:.88;font-size:16px;max-width:560px}
.holly{font-size:30px}
.ownerbar{display:flex;gap:8px;justify-content:center;align-items:center;flex-wrap:wrap;margin:-24px 0 18px;font-size:13px}
.ownerbar span{background:#facc15;color:#422006;font-weight:800;padding:4px 10px;border-radius:999px}
.ownerbar button{background:#0003;color:#fff7ed;border:1px solid #fff5;border-radius:999px;padding:4px 12px;cursor:pointer;font-size:13px}
.bar{max-width:1180px;margin:-36px auto 0;position:sticky;top:10px;z-index:5;padding:0 24px}
.add{display:flex;gap:8px;background:#fff;padding:7px;border-radius:999px;box-shadow:0 12px 30px #0003;border:2px solid #fff}
.add:focus-within{border-color:#166534}
.add input{flex:1;min-width:0;border:0;background:none;font-size:16px;padding:10px 16px;outline:none;color:#3b2a1a}
.add button{border:0;background:#166534;color:#fff;font-weight:700;padding:12px 24px;border-radius:999px;font-size:15px;cursor:pointer;white-space:nowrap}
.add button:disabled{opacity:.6}
.toast{max-width:1180px;margin:14px auto 0;padding:0 24px;font-size:14px;color:#166534;min-height:20px;text-align:center}
main{display:grid;grid-template-columns:250px 1fr;gap:28px;max-width:1180px;margin:0 auto;padding:18px 24px 40px}
aside{position:sticky;top:96px;align-self:start}
aside h4{font-size:11px;letter-spacing:1.5px;color:#a8876a;margin:0 0 10px}
.c{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 14px;border-radius:12px;cursor:pointer;font-size:14px;margin-bottom:4px;border:0;background:none;width:100%;text-align:left;color:inherit}
.c:hover{background:#f3e4cf}.c.on{background:#7f1d1d;color:#fff7ed;font-weight:700}
.c em{font-style:normal;font-size:12px;background:#0001;padding:1px 8px;border-radius:999px}.c.on em{background:#fff3}
.sortwrap{margin-top:22px}
select{width:100%;padding:10px;border-radius:12px;border:1px solid #e5d3b8;background:#fff;color:#3b2a1a;font-size:14px}
.sum{margin-top:22px;background:#fff;border-radius:14px;padding:14px;font-size:13px;color:#7c6650;border:1px solid #f0e2cc}
.sum b{display:block;font-family:Georgia,serif;font-size:24px;color:#7f1d1d}
.row{background:#fff;border-radius:18px;display:grid;grid-template-columns:76px 1fr 320px;gap:20px;padding:18px;margin-bottom:14px;align-items:start;box-shadow:0 6px 18px #7f1d1d12;border-left:6px solid var(--c);position:relative}
.row.fresh{animation:hl 2.5s}@keyframes hl{0%{background:#fef9c3;transform:scale(1.015)}}
.th{width:76px;height:76px;border-radius:16px;display:grid;place-items:center;font-size:36px;background:color-mix(in srgb,var(--c) 14%,#fff);overflow:hidden}
.th img{width:100%;height:100%;object-fit:contain;background:#fff}
.chip{display:inline-block;font-size:11px;font-weight:800;color:var(--c);text-transform:uppercase;letter-spacing:1px}
.row h3{margin:4px 0 6px;font-family:Georgia,serif;font-size:20px;line-height:1.25;overflow-wrap:anywhere}
.st{color:#d97706;letter-spacing:1px}.want{display:inline-block;font-size:11px;font-weight:800;background:#fee2e2;color:#991b1b;padding:2px 8px;border-radius:6px;margin-left:6px;vertical-align:1px}
.note{font-size:14px;color:#7c6650;font-style:italic;margin-top:6px;overflow-wrap:anywhere}
.own{margin-top:10px;display:flex;gap:6px}
.own button{font-size:12px;border:1px solid #e5d3b8;background:#fff;border-radius:8px;padding:5px 10px;cursor:pointer;color:#5b3d22}
.own button:hover{background:#f3e4cf}
.shops{display:flex;flex-direction:column;gap:6px}
.shop{display:grid;grid-template-columns:1fr auto auto;gap:10px;align-items:center;text-decoration:none;color:#3b2a1a;background:#fbf1e2;padding:8px 8px 8px 12px;border-radius:10px;font-size:14px;min-height:44px}
.shop:hover{background:#f6e2c6}.v{color:#15803d;font-size:11px;margin-left:4px}
.shop i{font-style:normal;font-weight:700;white-space:nowrap}.shop i.na{font-weight:400;font-size:12px;color:#a8876a}
.shop u{text-decoration:none;background:#3b2a1a;color:#fff;font-size:12px;font-weight:700;padding:5px 11px;border-radius:7px}
.shop.best{background:#dcfce7}.shop.best i{color:#166534}.shop.best u{background:#166534}
.bl{font-size:10px;font-weight:800;color:#166534;letter-spacing:.5px}
.empty{background:#fff;border-radius:18px;padding:40px 20px;text-align:center;color:#7c6650;font-size:16px}
footer{text-align:center;color:#a8876a;font-size:12px;padding:10px 20px 40px}
/* edit sheet */
.modal{position:fixed;inset:0;background:#000a;display:grid;place-items:center;z-index:20;padding:16px}
.sheet{background:#fffaf3;width:min(620px,100%);max-height:92vh;overflow:auto;border-radius:20px;padding:22px;border-top:8px solid #7f1d1d}
.sheet h2{margin:0 0 12px;font-family:Georgia,serif}.sheet h3{margin:16px 0 8px;font-size:14px;color:#7c6650}
.sheet label{display:block;font-size:13px;font-weight:600;color:#5b3d22;margin-bottom:10px}
.sheet label small{font-weight:400;color:#a8876a}
.sheet input{display:block;width:100%;margin-top:4px;padding:10px 12px;border:1px solid #e5d3b8;border-radius:10px;font-size:16px;background:#fff;color:#3b2a1a}
.sheet select{margin-top:4px;font-size:16px}
.two{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.srow{display:grid;grid-template-columns:110px 1fr 80px 36px;gap:6px;margin-bottom:6px}
.srow input{margin:0;font-size:14px;padding:8px}
.srow button{border:0;background:#fee2e2;color:#991b1b;border-radius:8px;cursor:pointer;font-size:16px}
.row2{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px}
.actions{display:flex;gap:8px;margin-top:18px;align-items:center}.actions span{flex:1}
.sheet button.primary,.sheet button.ghost,.sheet button.danger{padding:10px 18px;border-radius:10px;font-weight:700;cursor:pointer;font-size:14px}
.primary{background:#166534;color:#fff;border:0}.ghost{background:#fff;border:1px solid #e5d3b8;color:#5b3d22}.danger{background:#fff;border:1px solid #fca5a5;color:#991b1b}
/* tablet + phone */
@media(max-width:900px){
  .hero{padding:30px 16px 64px}.hero h1{font-size:38px}.hero p{font-size:14.5px}
  .bar{padding:0 12px;margin-top:-30px}
  .toast{padding:0 16px}
  main{grid-template-columns:1fr;gap:12px;padding:12px 12px 30px}
  aside{position:static;display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center}
  aside h4,.sum{display:none}
  .cats{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch;padding-bottom:2px;grid-column:1/-1}
  .cats::-webkit-scrollbar{display:none}
  .c{width:auto;white-space:nowrap;margin:0;padding:8px 12px;background:#fff;border:1px solid #f0e2cc;font-size:13px}
  .sortwrap{margin:0;grid-column:1/-1}.sortwrap select{padding:8px 10px}
  .row{grid-template-columns:60px 1fr;gap:12px;padding:14px;border-radius:16px}
  .th{width:60px;height:60px;font-size:30px;border-radius:14px}
  .row h3{font-size:17px}
  .shops{grid-column:1/-1}
}
@media(max-width:420px){
  .hero h1{font-size:32px}
  .add button{padding:12px 16px}
  .two{grid-template-columns:1fr}
  .srow{grid-template-columns:1fr 70px 36px}.srow input.sn{grid-column:1/-1}
  .sheet{padding:18px}
}

/* family view: no add bar, so close the gap under the banner */
body:not(.owner) .hero{padding-bottom:48px}
body:not(.owner) main{padding-top:24px}
@media(max-width:900px){body:not(.owner) .hero{padding-bottom:36px}body:not(.owner) .toast{display:none}}
@media(max-width:420px){.srow{padding-bottom:10px;margin-bottom:10px;border-bottom:1px dashed #e5d3b8}}