:root {
  color-scheme: light;
  --ink: #172a26;
  --muted: #64736f;
  --paper: #f5f2e9;
  --card: #fffdf8;
  --line: #ded9cc;
  --green: #1f6b57;
  --green-dark: #174f42;
  --mint: #dcebe3;
  --gold: #d39a35;
  --danger: #a4433b;
  --shadow: 0 18px 50px rgba(30, 47, 42, .11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink); background: radial-gradient(circle at top right, #e7efe8 0, transparent 34rem), var(--paper); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.app-shell { width: min(100%, 760px); min-height: 100vh; min-height: 100dvh; margin: 0 auto; padding: env(safe-area-inset-top) 18px calc(32px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 84px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 15px 15px 18px 18px; color: #fff; background: var(--green); font: 800 20px Georgia, serif; transform: rotate(-2deg); box-shadow: 0 7px 20px rgba(31, 107, 87, .22); }
.brand strong, .brand small { display: block; }
.brand strong { font: 700 18px Georgia, serif; letter-spacing: -.01em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.account { width: 42px; height: 42px; border: 0; border-radius: 50%; color: #fff; background: var(--ink); cursor: pointer; font-weight: 800; }
main { padding-bottom: 24px; }
.center-card, .login-card { min-height: calc(100dvh - 150px); display: grid; place-content: center; text-align: center; }
.spinner { width: 34px; height: 34px; margin: auto; border: 3px solid var(--mint); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-card p { color: var(--muted); }
.login-card { justify-items: center; }
.house-mark { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 24px; border-radius: 26px; background: var(--mint); color: var(--green); font-size: 42px; line-height: 1; }
.eyebrow { margin: 0 0 7px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, p { text-wrap: pretty; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; }
.login-card h1 { margin: 0; font-size: clamp(34px, 10vw, 52px); line-height: .98; letter-spacing: -.04em; }
.lede { max-width: 380px; margin: 22px auto 26px; color: var(--muted); font-size: 17px; line-height: 1.55; }
.discord-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 24px; border-radius: 17px; color: #fff; background: #5865f2; text-decoration: none; font-weight: 800; box-shadow: 0 12px 28px rgba(88, 101, 242, .23); }
.privacy-note { max-width: 330px; margin: 15px auto 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.error-banner { width: min(100%, 430px); margin: 0 auto 18px; padding: 13px 15px; border: 1px solid #e8c2bc; border-radius: 14px; color: #7a2d28; background: #fff2ef; text-align: left; font-size: 14px; }
.shopping { padding-top: 18px; }
.list-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 8px 2px 26px; }
.list-heading h1 { margin: 0; font-size: clamp(36px, 9vw, 58px); line-height: 1; letter-spacing: -.045em; }
.count-pill { flex: none; margin-bottom: 5px; padding: 8px 12px; border-radius: 999px; background: var(--mint); color: var(--green-dark); font-size: 13px; font-weight: 800; }
.notice { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; padding: 14px 16px; border-radius: 16px; color: var(--green-dark); background: var(--mint); font-size: 14px; }
.notice > span { font-size: 22px; }
.notice div span { color: #48665d; }
.add-card { margin-bottom: 26px; padding: 17px; border: 1px solid rgba(222, 217, 204, .8); border-radius: 22px; background: var(--card); box-shadow: var(--shadow); }
.add-card > label { display: block; margin: 0 0 9px 2px; font-size: 13px; font-weight: 800; }
.add-row { display: grid; grid-template-columns: 1fr 48px; gap: 9px; }
input { min-width: 0; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; outline: none; color: var(--ink); background: #fff; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 107, 87, .13); }
.add-row button { border: 0; border-radius: 14px; color: #fff; background: var(--green); cursor: pointer; font-size: 29px; line-height: 1; }
.details-row { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: 9px; margin-top: 9px; }
.details-row input { min-height: 42px; font-size: 13px; }
.status-message { min-height: 18px; margin: -10px 4px 12px; color: var(--green); font-size: 13px; }
.shopping h2 { margin: 0 3px 10px; color: var(--muted); font: 800 12px/1.2 Inter, sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.item-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.item-row { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; min-height: 64px; padding: 8px 10px; border: 1px solid rgba(222, 217, 204, .9); border-radius: 18px; background: var(--card); box-shadow: 0 5px 16px rgba(30, 47, 42, .045); }
.check-button { display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid #b8c2bd; border-radius: 50%; color: transparent; background: transparent; cursor: pointer; font-weight: 900; }
.check-button.checked { border-color: var(--green); color: #fff; background: var(--green); }
.check-button:disabled { cursor: default; opacity: .7; }
.item-copy { min-width: 0; padding: 0 7px; }
.item-name { display: block; overflow-wrap: anywhere; font-size: 16px; font-weight: 760; }
.item-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.remove-button { width: 36px; height: 36px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; cursor: pointer; font-size: 22px; }
.remove-button:hover { color: var(--danger); background: #f9e9e6; }
.checked-section { margin-top: 26px; }
.section-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-bottom: 10px; padding: 0 3px; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.section-toggle[aria-expanded="false"] .chevron { transform: rotate(180deg); }
.checked-list .item-row { opacity: .68; box-shadow: none; }
.checked-list .item-name { text-decoration: line-through; }
.empty-state { padding: 42px 20px; border: 1px dashed #c9c6bc; border-radius: 22px; text-align: center; }
.empty-state > span { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 50%; color: var(--green); background: var(--mint); font-size: 23px; }
.empty-state h3 { margin: 0; font-size: 22px; }
.empty-state p { margin: 6px 0 0; color: var(--muted); }
.finish-button { position: sticky; bottom: calc(14px + env(safe-area-inset-bottom)); width: 100%; min-height: 56px; margin-top: 24px; border: 0; border-radius: 18px; color: #fff; background: var(--ink); cursor: pointer; font-weight: 850; box-shadow: 0 14px 34px rgba(23, 42, 38, .27); }
dialog { width: min(calc(100% - 28px), 430px); padding: 0; border: 0; border-radius: 24px; background: transparent; }
dialog::backdrop { background: rgba(14, 25, 22, .52); backdrop-filter: blur(3px); }
.dialog-card { position: relative; padding: 27px; border-radius: 24px; background: var(--card); box-shadow: var(--shadow); }
.dialog-card h2 { margin: 8px 0 8px; font-size: 29px; }
.dialog-card p { color: var(--muted); line-height: 1.5; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 9px; margin-top: 22px; }
.primary-button, .secondary-button { min-height: 48px; padding: 0 15px; border-radius: 14px; cursor: pointer; font-weight: 800; }
.primary-button { border: 0; color: #fff; background: var(--green); }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.finish-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 17px; color: var(--green); background: var(--mint); font-size: 25px; font-weight: 900; }
.dialog-close { position: absolute; top: 13px; right: 13px; width: 38px; height: 38px; border: 0; border-radius: 50%; color: var(--muted); background: #f2efe7; cursor: pointer; font-size: 24px; }
.account-card .secondary-button { width: 100%; margin-top: 16px; }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(31, 107, 87, .34); outline-offset: 3px; }

@media (max-width: 480px) {
  .app-shell { padding-left: 14px; padding-right: 14px; }
  .details-row { grid-template-columns: 1fr; }
  .item-row { grid-template-columns: 40px 1fr auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
