:root {
  color-scheme: light;
  --green: #176b4d;
  --green-dark: #0e5138;
  --green-soft: #e8f3eb;
  --ink: #17211b;
  --muted: #5b6c62;
  --line: #d9e4dc;
  --surface: #ffffff;
  --background: #f5f8f5;
  --danger: #a32d2d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html.dark-mode { color-scheme: dark; }
html.dark-mode {
  --green: #65c995;
  --green-dark: #9be5bd;
  --green-soft: #183d2d;
  --ink: #e6eee8;
  --muted: #b3c3b8;
  --line: #345044;
  --surface: #17231c;
  --background: #0f1712;
  --danger: #ff9a90;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: radial-gradient(circle at top right, #e2f2e7 0, var(--background) 42rem); color: var(--ink); }
html.dark-mode body { background: radial-gradient(circle at top right, #183d2d 0, var(--background) 42rem); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; min-height: 100dvh; padding-bottom: max(28px, env(safe-area-inset-bottom)); }
.topbar { align-items: center; display: flex; justify-content: space-between; margin: 0 auto; max-width: 760px; padding: max(18px, env(safe-area-inset-top)) 20px 18px; }
.brand { align-items: center; color: var(--green-dark); display: inline-flex; font-size: 1.1rem; font-weight: 800; gap: 9px; text-decoration: none; }
.brand-mark { align-items: center; background: var(--green); border-radius: 12px; color: white; display: inline-flex; height: 30px; justify-content: center; width: 30px; }
.topbar-actions { align-items: center; display: flex; gap: 8px; }
main { margin: 0 auto; max-width: 760px; padding: 20px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 7vw, 3.2rem); letter-spacing: -.045em; line-height: 1.05; margin-bottom: 12px; }
h2 { font-size: 1.35rem; letter-spacing: -.02em; margin-bottom: 0; }
h3 { margin-bottom: 4px; }
.lead { color: var(--muted); font-size: 1.08rem; line-height: 1.55; margin-bottom: 28px; max-width: 34rem; }
.muted, .status { color: var(--muted); }
.eyebrow { color: var(--green); font-size: .74rem; font-weight: 800; letter-spacing: .12em; margin-bottom: 7px; text-transform: uppercase; }
.card { background: rgba(255, 255, 255, .94); border: 1px solid rgba(217, 228, 220, .95); border-radius: 24px; box-shadow: 0 10px 34px rgba(23, 107, 77, .08); margin-bottom: 16px; padding: 22px; }
.auth-card { margin: 10vh auto 0; max-width: 580px; padding: clamp(26px, 7vw, 52px); }
.welcome-row, .section-heading, .list-heading, .dialog-heading { align-items: center; display: flex; justify-content: space-between; gap: 16px; }
.section-heading-actions { align-items: center; display: flex; gap: 4px; }
.welcome-row { margin: 10px 0 22px; }
.avatar { align-items: center; background: var(--green-soft); border-radius: 50%; color: var(--green-dark); display: flex; font-weight: 800; height: 46px; justify-content: center; overflow: hidden; width: 46px; }
.avatar img { height: 100%; object-fit: cover; width: 100%; }
.button { border: 0; border-radius: 999px; font-weight: 750; min-height: 42px; padding: 10px 16px; transition: transform .15s ease, background .15s ease; }
.button:active { transform: scale(.98); }
.button-primary { background: var(--green); color: white; }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { background: var(--green-soft); color: var(--green-dark); }
.button-quiet { background: transparent; color: var(--green-dark); padding-left: 10px; padding-right: 10px; }
.button-danger-quiet { background: transparent; color: var(--danger); padding-left: 10px; padding-right: 10px; }
.button-danger { background: var(--danger); color: white; }
.button-wide { width: 100%; }
.button-small { min-height: 34px; padding: 7px 12px; }
.icon-button { align-items: center; background: transparent; border: 0; border-radius: 50%; color: var(--green-dark); display: inline-flex; font-size: 1.2rem; height: 38px; justify-content: center; padding: 0; width: 38px; }
.icon-button:hover { background: var(--green-soft); }
.profile-glyph { display: block; height: 24px; position: relative; width: 24px; }
.profile-glyph::before { background: currentColor; border-radius: 50%; content: ""; height: 8px; left: 8px; position: absolute; top: 2px; width: 8px; }
.profile-glyph::after { background: currentColor; border-radius: 11px 11px 5px 5px; bottom: 2px; content: ""; height: 10px; left: 4px; position: absolute; width: 16px; }
.field { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); min-height: 46px; padding: 10px 13px; width: 100%; }
.field:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 107, 77, .13); outline: none; }
.field-label { display: block; font-size: .88rem; font-weight: 700; margin: 15px 0 7px; }
.list-actions, .list-toolbar, .dialog-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.list-actions { justify-content: flex-end; margin-top: 8px; }
.list-toolbar { margin-top: 20px; }
.list-toolbar .button { flex: 1; }
.picking-footer { display: flex; justify-content: center; margin-top: 20px; }
.picking-footer .button { min-width: 180px; }
.notice { border-radius: 14px; line-height: 1.45; margin: 0 0 16px; padding: 12px 14px; }
.notice-error { background: #ffebe8; color: #85251f; }
.notice-info { background: var(--green-soft); color: var(--green-dark); }
.notice-collaboration { align-items: center; background: #fff5d9; color: #69521b; display: flex; gap: 10px; justify-content: space-between; }
.items-list { display: grid; gap: 9px; margin-top: 20px; }
.item-group-heading { color: var(--green-dark); font-size: .78rem; font-weight: 800; letter-spacing: .08em; margin: 8px 3px 0; text-transform: uppercase; }
.item-group-heading.picked-heading { color: var(--muted); margin-top: 16px; }
.item-row { align-items: center; background: #fbfdfb; border: 1px solid var(--line); border-radius: 17px; display: grid; gap: 10px; grid-template-columns: auto 1fr auto; padding: 11px 12px; }
.item-row-actionable { cursor: pointer; }
.item-row-actionable:hover { border-color: var(--green); }
.item-row-actionable:focus-visible { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 107, 77, .16); outline: none; }
html.dark-mode .item-row { background: #17231c; }
.item-row.picked { background: #eef4ef; }
html.dark-mode .item-row.picked { background: #22352a; }
.item-row.picked-by-other { background: #fff5d9; }
html.dark-mode .item-row.picked-by-other { background: #4a3710; }
.item-row.picked .item-name { color: var(--muted); text-decoration: line-through; }
.item-toggle { align-items: center; background: var(--green-soft); border: 0; border-radius: 50%; color: var(--green-dark); display: flex; font-size: 1rem; height: 38px; justify-content: center; width: 38px; }
.item-row.picked .item-toggle { background: var(--green); color: white; }
.item-name { font-weight: 700; overflow-wrap: anywhere; }
.item-meta { align-items: center; color: var(--muted); display: flex; flex-wrap: wrap; font-size: .84rem; gap: 8px; margin-top: 4px; }
.quantity-badge { align-items: center; background: var(--green); border-radius: 50%; color: white; display: inline-flex; font-size: .78rem; font-weight: 800; height: 28px; justify-content: center; width: 28px; }
.item-actions { align-items: center; display: flex; gap: 2px; }
.item-actions .icon-button { font-size: 1rem; height: 34px; width: 34px; }
.favorite { color: #d28d21; }
.favorite-indicator { color: #d28d21; font-size: 1rem; font-weight: 800; line-height: 34px; padding: 0 8px; }
.empty-state { color: var(--muted); padding: 34px 12px 12px; text-align: center; }
.empty-icon { align-items: center; background: var(--green-soft); border-radius: 50%; color: var(--green); display: flex; font-size: 1.7rem; height: 56px; justify-content: center; margin: 0 auto 12px; width: 56px; }
.picking-banner { align-items: center; background: #fff5d9; border-radius: 15px; color: #69521b; display: flex; flex-wrap: wrap; font-size: .9rem; gap: 10px; justify-content: space-between; margin-top: 14px; padding: 10px 12px; }
.dialog { background: transparent; border: 0; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); max-width: min(520px, calc(100% - 24px)); padding: 0; width: 100%; }
.dialog::backdrop { background: rgba(13, 36, 25, .38); backdrop-filter: blur(3px); }
.dialog-card { -webkit-overflow-scrolling: touch; background: white; border-radius: 24px; box-shadow: 0 18px 60px rgba(0, 0, 0, .22); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; padding: 22px; }
html.dark-mode .dialog-card { background: var(--surface); }
.capability-list { color: var(--muted); display: grid; gap: 8px; line-height: 1.45; padding-left: 22px; }
.notifications-list { margin-bottom: 0; margin-top: 16px; }
.dialog-actions { justify-content: flex-end; margin-top: 24px; }
.check-row { align-items: center; display: flex; gap: 8px; margin-top: 16px; }
.check-row input { accent-color: var(--green); height: 18px; width: 18px; }
.barcode-result { background: var(--green-soft); border-radius: 14px; color: var(--green-dark); line-height: 1.45; margin-top: 16px; padding: 12px; }
.barcode-video { background: #101512; border-radius: 16px; display: block; margin-top: 14px; max-height: 260px; object-fit: cover; width: 100%; }
.barcode-camera-actions { margin-top: 14px; }
.store-options { display: grid; gap: 9px; margin-top: 16px; }
.store-option { background: #fbfdfb; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); padding: 12px; text-align: left; width: 100%; }
.store-option:hover { border-color: var(--green); background: var(--green-soft); }
.store-option strong, .store-option span { display: block; }
.store-option span { color: var(--muted); font-size: .84rem; margin-top: 3px; }
.profile-details { background: var(--green-soft); border-radius: 14px; margin: 16px 0; padding: 13px; }
.profile-details strong, .profile-details span { display: block; }
.profile-details span { color: var(--muted); font-size: .9rem; margin-top: 4px; overflow-wrap: anywhere; }
.profile-list-heading { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.profile-list-row { font-size: .84rem; }
.profile-actions { justify-content: space-between; }
.input-with-action { align-items: center; display: flex; gap: 6px; }
.input-with-action .field { flex: 1; }
.input-action { flex: 0 0 42px; background: var(--green-soft); }
.voice-listening { background: #ffd9d5; color: var(--danger); }
.quick-suggestions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.quick-suggestion { background: var(--green-soft); border: 1px solid var(--line); border-radius: 999px; color: var(--green-dark); font-size: .84rem; padding: 7px 10px; }
.manage-lists { display: grid; gap: 8px; margin-top: 16px; }
.manage-list-row { align-items: center; background: var(--green-soft); border: 1px solid var(--line); border-radius: 14px; display: flex; gap: 9px; padding: 9px; }
.manage-list-open { background: transparent; border: 0; color: var(--ink); flex: 1; min-width: 0; padding: 7px; text-align: left; }
.manage-list-open strong, .manage-list-open span { display: block; overflow-wrap: anywhere; }
.manage-list-open span { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.manage-list-star { background: transparent; border: 0; color: #d28d21; font-size: 1.35rem; padding: 7px; }
.manage-list-actions { align-items: center; display: flex; flex: 0 0 auto; gap: 1px; }
.manage-list-actions .icon-button { font-size: 1rem; height: 34px; width: 34px; }
.manage-list-danger { color: var(--danger); }
@media (max-width: 480px) { .topbar { padding-left: 14px; padding-right: 14px; } main { padding: 12px; } .card { border-radius: 20px; padding: 17px; } .topbar-actions .button-quiet { display: none; } .picking-banner { align-items: flex-start; flex-direction: column; } .list-actions { justify-content: flex-start; } .list-actions .button { padding-left: 6px; padding-right: 6px; } }
