:root {
  color-scheme: light;
  --paper: #f4f1ea;
  --surface: #fffdf8;
  --ink: #22251f;
  --muted: #777a70;
  --line: #d9d8cf;
  --accent: #246b52;
  --accent-dark: #164e3b;
  --buy: #b4533a;
  --shadow: 0 16px 50px rgba(41, 45, 34, .08);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.shell { width: min(100% - 32px, 960px); margin: 0 auto; padding: 42px 0 72px; }
.topbar, .section-heading, .dialog-heading, .dialog-actions, .top-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 4.6rem; line-height: .95; letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 1.35rem; letter-spacing: -.02em; }
.top-actions { flex-wrap: wrap; justify-content: flex-end; }
.status { color: var(--muted); font-size: .78rem; }
.status::before { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #d39b33; content: ""; vertical-align: 1px; }
.status[data-state="connected"]::before { background: var(--accent); }
.status[data-state="offline"]::before { background: var(--buy); }
.primary-button, .quiet-button, .icon-button { border: 1px solid transparent; border-radius: 4px; min-height: 42px; padding: 0 15px; font-weight: 750; transition: .18s ease; }
.primary-button { background: var(--accent); color: white; }
.primary-button:hover { background: var(--accent-dark); }
.primary-button:disabled, .quiet-button:disabled { cursor: wait; opacity: .6; }
.quiet-button { border-color: var(--line); background: transparent; color: var(--ink); }
.quiet-button:hover, .icon-button:hover { background: #e9e7df; }
.icon-button { width: 42px; padding: 0; border-color: var(--line); background: transparent; color: var(--ink); font-size: .72rem; font-weight: 850; letter-spacing: .04em; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 46px 0 52px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.summary div { padding: 20px 8px; text-align: center; }
.summary span { display: block; color: var(--accent-dark); font-size: 2.1rem; font-weight: 800; letter-spacing: -.04em; }
.summary small { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.list-section { padding: 0 0 38px; }
.shopping-section { border-top: 1px solid var(--line); padding-top: 38px; }
.section-heading { align-items: end; margin-bottom: 16px; }
.section-note { max-width: 310px; color: var(--muted); font-size: .83rem; text-align: right; }
.item-list { display: grid; gap: 8px; }
.item-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; padding: 8px 12px 8px 17px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); box-shadow: var(--shadow); }
.item-check { display: flex; flex: 1 1 auto; align-items: center; min-width: 0; gap: 13px; cursor: pointer; }
.item-check input { position: absolute; opacity: 0; pointer-events: none; }
.checkmark { display: grid; flex: 0 0 auto; width: 22px; height: 22px; place-items: center; border: 1.5px solid #9da197; border-radius: 3px; background: transparent; }
.item-check input:checked + .checkmark { border-color: var(--accent); background: var(--accent); }
.item-check input:checked + .checkmark::after { width: 9px; height: 5px; border-bottom: 2px solid white; border-left: 2px solid white; content: ""; transform: rotate(-45deg) translate(1px, -1px); }
.item-content { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.item-name { overflow: hidden; text-overflow: ellipsis; font-size: 1rem; }
.item-row.buy-row .item-name { color: var(--buy); font-weight: 700; }
.item-meta { overflow: hidden; color: var(--muted); font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.delete-button { width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted); font-size: 1.35rem; }
.delete-button:hover { color: var(--buy); }
.edit-button { min-height: 34px; padding: 0 10px; color: var(--accent-dark); font-size: .78rem; }
.edit-item-name { margin: -10px 0 5px; color: var(--muted); font-size: .9rem; }
.empty { padding: 27px 12px; border: 1px dashed #bbbcb2; color: var(--muted); text-align: center; }
.dialog { width: min(calc(100% - 32px), 420px); padding: 25px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); box-shadow: 0 25px 80px rgba(0,0,0,.2); }
.dialog::backdrop { background: rgba(25, 28, 22, .38); }
.dialog-heading { align-items: start; margin-bottom: 24px; }
.dialog form { display: grid; gap: 10px; }
.dialog label { font-size: .82rem; font-weight: 750; }
.optional { color: var(--muted); font-weight: 500; }
.dialog input { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid #afb1a8; border-radius: 3px; background: white; color: var(--ink); outline: none; }
.dialog input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(36,107,82,.14); }
.form-error { min-height: 18px; margin: 0; color: var(--buy); font-size: .82rem; }
.dialog-actions { justify-content: flex-end; margin-top: 8px; }
.qr-dialog { text-align: center; }
.qr-dialog .dialog-heading { text-align: left; }
.qr-code { display: grid; min-height: 320px; place-items: center; margin: 4px auto 13px; }
.qr-code svg { display: block; width: min(100%, 320px); height: auto; }
.qr-url { overflow-wrap: anywhere; margin-bottom: 16px; color: var(--muted); font-size: .75rem; }
.app-footer { display: flex; justify-content: flex-end; padding-top: 8px; }
.more-button { width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted); font-size: 1rem; letter-spacing: .16em; opacity: .65; }
.more-button:hover, .more-button:focus-visible { color: var(--ink); opacity: 1; }
.settings-dialog { max-width: 360px; }
.install-button { width: 100%; }
.settings-note { min-height: 38px; margin: 12px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
@media (max-width: 600px) { .shell { width: min(100% - 24px, 960px); padding-top: 27px; } .topbar { align-items: flex-start; flex-direction: column; } .top-actions { width: 100%; justify-content: flex-start; } .section-heading { align-items: flex-start; flex-direction: column; gap: 7px; } .section-note { max-width: none; text-align: left; } h1 { font-size: 3rem; } .edit-button { padding: 0 8px; } }
