:root {
  color-scheme: light;
  --paper: #f7f6f0;
  --card: #fffefa;
  --ink: #263c31;
  --muted: #647265;
  --green: #285c45;
  --green-hover: #1e4936;
  --soft-green: #e9eee5;
  --line: #dce1d5;
  --accent: #ba8350;
  --warning: #7c501a;
  --warning-bg: #fff3dc;
  --danger: #9b3833;
  --radius: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, input, select, textarea { font: inherit; }
button, a, summary, input, select, textarea { touch-action: manipulation; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: var(--green); text-underline-offset: 3px; }
button, a, input, select, textarea, summary { outline-offset: 4px; }
:focus-visible { outline: 3px solid #658d38; }
button, a { -webkit-user-select: none; user-select: none; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.16; }
h2 { margin-bottom: 12px; font-size: 1.4rem; font-weight: 690; letter-spacing: -.035em; }
h3 { font-size: 1.12rem; letter-spacing: -.02em; }
p { margin-bottom: 14px; }
small, .small { font-size: .84rem; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.danger-text { color: var(--danger) !important; }
.eyebrow { color: var(--green); font-size: .68rem; font-weight: 760; letter-spacing: .16em; line-height: 1.5; text-transform: uppercase; margin-bottom: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; transform: translateY(-150%); padding: 12px 20px; border-radius: 8px; color: white; background: var(--green); }
.skip-link:focus { transform: none; }

.button { min-height: 46px; padding: 11px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 11px; font-size: .91rem; line-height: 1.35; font-weight: 650; text-align: center; text-decoration: none; transition: background-color .15s, border-color .15s; }
.primary { background: var(--green); color: white; border-color: var(--green); }
.secondary { background: transparent; color: var(--green); border-color: #becabd; }
.full-width { width: 100%; }
.compact { font-size: .79rem; padding-inline: 13px; }
.text-button { display: inline-flex; align-items: center; justify-content: flex-start; gap: 7px; min-height: 44px; padding: 8px 0; border: 0; background: transparent; color: var(--green); font-size: .87rem; line-height: 1.4; font-weight: 650; text-align: left; }
.icon-button { display: inline-flex; justify-content: center; align-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--ink); font-size: 1.5rem; text-decoration: none; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.brand-mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 19px; background: var(--green); color: var(--paper); font-size: 2.1rem; font-weight: 450; box-shadow: inset 0 0 0 1px #ffffff12; }
.small-mark { width: 36px; height: 36px; border-radius: 11px; font-size: 1.3rem; }

label { display: block; margin: 16px 0 7px; font-size: .8rem; font-weight: 680; }
input:not([type="checkbox"]), textarea, select { display: block; width: 100%; min-width: 0; min-height: 47px; padding: 12px 13px; border: 1px solid #cdd5c7; border-radius: 10px; background: var(--card); color: var(--ink); font-size: 1rem; line-height: 1.35; box-shadow: 0 1px 1px #233d2d03; }
input::placeholder, textarea::placeholder { color: #687663; opacity: 1; }
textarea { resize: vertical; }
select { padding-right: 6px; font-size: .91rem; }
input:focus, select:focus, textarea:focus { border-color: #64826a; }
input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--green); flex-shrink: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row > div { min-width: 0; }
.optional { color: var(--muted); font-size: .69rem; font-weight: 400; }
.checkbox-label { display: flex; align-items: center; gap: 9px; min-height: 44px; margin: 4px 0 0; font-weight: 500; line-height: 1.35; }
.form-error { margin: 14px 0; color: var(--danger); font-size: .88rem; }

.initial-screen { display: flex; min-height: 80vh; padding: 40px 24px; flex-direction: column; align-items: center; justify-content: center; gap: 24px; text-align: center; }
.initial-screen p { max-width: 38ch; color: var(--muted); }
.login-panel { width: min(100%, 1120px); min-height: 100svh; margin: auto; padding: 70px 45px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 80px; align-items: center; }
.login-intro .brand-mark { margin-bottom: 34px; }
.login-intro h1 { margin: 0 0 22px; font: 700 clamp(3.6rem, 8vw, 5.6rem)/1 Georgia, "Times New Roman", serif; letter-spacing: -.07em; }
.login-description { font-size: 1.25rem; line-height: 1.7; color: #536557; }
.login-note { display: flex; gap: 12px; align-items: center; margin-top: 38px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .83rem; }
.login-note > span { font-size: 1.6rem; color: var(--accent); }
.login-card { padding: 38px; border: 1px solid var(--line); border-radius: 24px; background: var(--card); box-shadow: 0 16px 60px #2a43290a; }
.login-card h2 { font-size: 1.7rem; }
.login-card > p { color: var(--muted); font-size: .9rem; }
.login-card .button { margin-top: 22px; }
.login-card > .small { margin: 16px 0 0; text-align: center; font-size: .77rem; }
.login-card .form-error { color: var(--danger); }
.password-field { display: flex; align-items: center; border: 1px solid #cdd5c7; border-radius: 10px; background: var(--card); }
.password-field input:not([type="checkbox"]) { border: 0; background: transparent; box-shadow: none; }
.password-field:focus-within { outline: 3px solid #658d38; outline-offset: 4px; }
.password-field input:focus-visible { outline: none; }
.password-field .text-button { font-size: .78rem; padding-inline: 10px; flex-shrink: 0; }

.app-shell { width: min(100%, 1180px); margin: auto; padding: 0 38px; }
.site-header { min-height: 100px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; color: var(--ink); text-decoration: none; font: 700 1.65rem Georgia, "Times New Roman", serif; letter-spacing: -.055em; }
.header-actions { display: flex; gap: 18px; align-items: center; }
.sync-status { display: inline-flex; justify-content: center; align-items: center; gap: 8px; max-width: 270px; min-height: 44px; border: 0; background: transparent; color: var(--muted); font-size: .76rem; line-height: 1.4; text-align: right; }
.status-dot { display: block; width: 7px; height: 7px; border-radius: 50%; background: #538561; flex-shrink: 0; }
.status-dot.pending, .status-dot.offline, .status-dot.warning { background: #aa7931; }
.status-dot.error, .status-dot.conflict { background: var(--danger); }
.status-dot.syncing { background: #617b95; }
.more-menu { position: relative; }
.more-menu > summary { list-style: none; letter-spacing: 2px; font-size: 1rem; background: #eeeee5; }
.more-menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 40; width: 236px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: 0 10px 35px #1a382326; }
.menu-panel button { display: block; width: 100%; min-height: 46px; padding: 12px; border: 0; border-radius: 8px; background: none; font-size: .85rem; text-align: left; }
.menu-panel button + button { margin-top: 2px; }
.page-intro { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding: 44px 0 30px; }
.page-intro h1 { margin: 0 0 14px; font: 700 clamp(2.3rem, 4vw, 3.3rem)/1.08 Georgia, "Times New Roman", serif; letter-spacing: -.05em; }
.page-intro .muted { margin-bottom: 0; font-size: .93rem; }
.week-label { display: flex; gap: 9px; align-items: center; padding-bottom: 4px; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.week-icon { font-size: 1.3rem; color: #788b72; }
.tab-nav { display: flex; gap: 5px; padding: 5px; border: 1px solid #e3e5db; border-radius: 14px; background: #eaece3; margin-bottom: 34px; }
.tab { display: inline-flex; justify-content: center; align-items: center; gap: 9px; flex: 1; min-height: 48px; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px; color: #5e6d5c; background: transparent; font-size: .87rem; font-weight: 600; line-height: 1.25; }
.tab > span[aria-hidden] { font-size: 1.1rem; }
.tab.active { background: var(--card); border-color: #d8ded1; color: var(--green); box-shadow: 0 2px 5px #203c2c07; }
.tab-count { display: inline-flex; min-width: 23px; height: 23px; padding: 0 5px; justify-content: center; align-items: center; border-radius: 6px; background: var(--soft-green); color: var(--green); font-size: .72rem; }
.tab-panel { padding-bottom: 35px; min-width: 0; }
.banner, .conflict-banner { margin: -12px 0 24px; border: 1px solid #dfc394; border-radius: 12px; padding: 15px 18px; color: var(--warning); background: var(--warning-bg); font-size: .87rem; overflow-wrap: anywhere; }
.banner.error { color: var(--danger); border-color: #dcb0a6; background: #fff0eb; }
.conflict-banner { display: flex; gap: 18px; justify-content: space-between; align-items: center; }
.conflict-banner p { margin: 4px 0 0; font-size: .82rem; }
.conflict-banner .button { flex-shrink: 0; }

.list-layout { display: grid; grid-template-columns: 305px minmax(0, 1fr); gap: 36px; align-items: start; }
.add-card { position: sticky; top: 24px; border: 1px solid #dce3d4; border-radius: var(--radius); padding: 25px 22px 20px; background: #eff2e9; }
.add-card h2 { margin-bottom: 23px; font-size: 1.55rem; }
.add-card .eyebrow { font-size: .63rem; }
.add-card #add-name { font-size: 1.02rem; }
.add-card .field-row { grid-template-columns: 1fr 1fr; gap: 10px; }
.add-card .field-row input { font-size: .86rem; }
.add-card .field-row select { font-size: .83rem; padding-left: 9px; }
.add-card label { font-size: .75rem; }
.extra-note { margin: 12px 0; }
.extra-note summary { min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; color: #536953; font-size: .78rem; }
.extra-note summary::before { content: "+"; font-size: 1.15rem; }
.extra-note[open] summary::before { content: "−"; }
.extra-note summary::-webkit-details-marker { display: none; }
.extra-note textarea { margin-bottom: 14px; font-size: .91rem; }
.add-card #add-submit { margin-top: 2px; }
.offline-tip { display: flex; gap: 12px; align-items: center; margin-top: 24px; padding-top: 18px; border-top: 1px solid #d9e0d0; color: #67775f; }
.offline-tip > span { font-size: 1.6rem; color: var(--accent); }
.offline-tip p { margin: 0; font-size: .75rem; line-height: 1.6; }
.duplicate-hint { margin-top: 12px; padding: 12px; border-radius: 10px; background: #fff6df; border: 1px solid #e6d6ad; }
.duplicate-hint p { margin: 0; color: #795825; font-size: .8rem; }
.duplicate-hint .text-button { min-height: 40px; font-size: .76rem; }
.duplicate-hint .checkbox-label { font-size: .74rem; }
.shopping-area { min-width: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.section-heading h2 { margin-bottom: 7px; }
.section-heading p { margin-bottom: 0; }
.section-heading > div { min-width: 0; }
.section-heading > .button { flex-shrink: 0; }
.shopping-area > .section-heading { min-height: 62px; margin-bottom: 20px; }
.shopping-area > .section-heading h2 { font-size: 1.3rem; }
.shopping-list { display: grid; gap: 18px; }
.category-group { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.category-heading { display: flex; align-items: center; gap: 9px; padding: 10px 17px; min-height: 43px; background: #f0f2e9; border-bottom: 1px solid #e1e5d9; }
.category-icon { font-size: 1rem; line-height: 1; }
.category-title { margin: 0; flex: 1; color: #57704e; font-size: .71rem; font-weight: 740; letter-spacing: .07em; text-transform: uppercase; }
.category-count { color: #65715f; font-size: .7rem; font-weight: 650; }
.category-items { display: grid; }
.item-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 40px; align-items: center; gap: 11px; min-height: 80px; padding: 10px 12px; }
.item-row + .item-row { border-top: 1px solid #e9ece3; }
.item-check { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1.5px solid #c1ceba; border-radius: 50%; background: transparent; color: var(--green); font-size: 1.25rem; line-height: 1; }
.item-content { display: block; width: 100%; min-width: 0; min-height: 47px; padding: 3px 0; border: 0; background: transparent; text-align: left; overflow-wrap: anywhere; }
.item-title { display: block; font-size: 1rem; font-weight: 650; color: var(--ink); line-height: 1.4; }
.item-meta { display: block; margin-top: 3px; color: var(--green); font-size: .79rem; font-weight: 570; line-height: 1.4; }
.item-note { display: block; margin: 4px 0 0; font-size: .76rem; line-height: 1.45; color: var(--muted); white-space: pre-wrap; }
.item-edit { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: -4px; padding: 0; background: transparent; border: 0; border-radius: 9px; color: #7e8c77; font-size: 1.1rem; }
.item-row.is-pending .item-title::after { content: " ·"; color: #aa7931; font-weight: 800; }
.item-row.is-checked .item-check, .item-check[aria-pressed="true"] { border-color: var(--green); background: var(--green); color: white; }
.item-row.is-checked .item-title { color: #5e6c59; text-decoration: line-through; text-decoration-thickness: 1px; }
.item-row.is-checked .item-meta, .item-row.is-checked .item-note { color: #64715e; }
.checked-section { margin-top: 22px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #f0f2e9; }
.checked-section > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 53px; padding: 13px 18px; cursor: pointer; font-size: .84rem; font-weight: 600; list-style: none; }
.checked-section > summary::-webkit-details-marker { display: none; }
.checked-section > summary::after { content: "⌄"; font-size: 1rem; }
.checked-section[open] > summary::after { content: "⌃"; }
.checked-section > summary .small { margin-left: auto; font-size: .73rem; font-weight: 400; }
.checked-section[open] > summary { border-bottom: 1px solid var(--line); }
.all-checked { margin-top: 20px; text-align: center; color: var(--green); font-size: .88rem; }
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 48px 25px; border: 1px dashed #cbd5c4; border-radius: var(--radius); text-align: center; }
.empty-symbol { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 22px; border-radius: 50%; background: var(--soft-green); color: var(--green); font-size: 1.8rem; }
.empty-state h3 { margin-bottom: 12px; }
.empty-state p { max-width: 39ch; color: var(--muted); font-size: .9rem; line-height: 1.65; }
.empty-state .text-button { justify-content: center; }

.favorites-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.favorite-card { min-width: 0; display: flex; flex-direction: column; padding: 21px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.favorite-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.favorite-top .icon-button { width: 44px; height: 44px; margin: -10px -10px -2px 0; color: var(--muted); }
.favorite-category { font-size: .69rem; font-weight: 700; letter-spacing: .04em; color: #617353; }
.favorite-title { margin: 13px 0 7px; font-size: 1.1rem; font-weight: 700; overflow-wrap: anywhere; }
.favorite-note { color: var(--muted); font-size: .82rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.favorite-card > p { margin-bottom: 8px; }
.favorite-add { margin-top: auto; min-height: 44px; padding: 9px 12px; border: 1px solid #cad5c2; border-radius: 10px; color: var(--green); background: var(--soft-green); text-align: center; font-size: .83rem; font-weight: 650; }
.favorite-card .favorite-add { margin-top: 18px; }
.prospect-heading { margin-bottom: 18px; }
.prospect-note { padding: 14px 18px; border-radius: 10px; background: var(--soft-green); color: #5d7055; font-size: .82rem; }
.prospect-frame-wrap { min-height: 66vh; margin: 20px 0 16px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.prospect-frame-wrap:empty { display: none; }
.prospect-frame-wrap iframe { display: block; width: 100%; height: 75vh; height: 75dvh; min-height: 460px; border: 0; background: white; }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 24px 0 30px; border-top: 1px solid var(--line); color: #65715f; font-size: .7rem; }

.dialog { width: min(100% - 32px, 500px); max-height: min(88vh, 850px); max-height: min(88dvh, 850px); padding: 27px; overflow: auto; overscroll-behavior: contain; border: 1px solid #d6decd; border-radius: 20px; background: var(--card); color: var(--ink); box-shadow: 0 26px 100px #1b332538; }
.dialog::backdrop { background: #20382c73; }
.wide-dialog { width: min(100% - 32px, 650px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.dialog-heading h2 { margin: 8px 0 0; font-size: 1.45rem; }
.dialog-heading > .icon-button { flex-shrink: 0; margin: -3px -8px 0 0; color: #788470; }
.dialog-heading .eyebrow { margin-bottom: 4px; }
.dialog-heading p:not(.eyebrow) { margin: 8px 0 0; }
.dialog > p { color: var(--muted); line-height: 1.65; font-size: .9rem; white-space: pre-line; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.dialog-actions.stacked { flex-direction: column; }
.dialog-actions.stacked .button { width: 100%; }
.editor-secondary { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; }
.editor-secondary .text-button { font-size: .8rem; }
.conflict-details { display: grid; gap: 12px; padding: 16px; border: 1px solid #e3d4b6; border-radius: 12px; background: #fbf5e8; font-size: .88rem; overflow-wrap: anywhere; }
.conflict-details p { margin: 0; white-space: pre-wrap; }
.conflict-details strong { display: block; margin-bottom: 4px; }
.archive-card { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.archive-card > summary, .archive-heading { min-height: 60px; padding: 14px 17px; background: #f0f3e9; cursor: pointer; font-weight: 650; font-size: .87rem; }
.archive-card > summary .archive-heading { padding: 0; min-height: auto; }
.archive-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.archive-heading p, .archive-heading h3 { margin: 0; }
.archive-heading .small, .archive-heading span + span { color: var(--muted); font-size: .74rem; font-weight: 400; }
.archive-items { padding: 4px 16px 8px; }
.history-item, .trash-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 70px; padding: 12px 0; }
.history-item + .history-item, .trash-item + .trash-item { border-top: 1px solid var(--line); }
.history-item-info { min-width: 0; font-size: .87rem; overflow-wrap: anywhere; }
.history-item-info strong { display: block; }
.history-item-info p { margin: 4px 0 0; font-size: .75rem; color: var(--muted); }
.history-item .button, .trash-item .button { flex-shrink: 0; padding-inline: 12px; font-size: .77rem; }
.history-item .text-button, .trash-item .text-button { flex-shrink: 0; font-size: .8rem; }
.archive-card > .text-button, .archive-card > .button { margin: 0 16px 14px; }
.trash-item > div { min-width: 0; overflow-wrap: anywhere; }
.trash-item p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.trash-item strong { font-size: .9rem; }
.toast { position: fixed; z-index: 100; bottom: max(22px, env(safe-area-inset-bottom)); left: 50%; width: max-content; max-width: calc(100% - 28px); display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 20px; border-radius: 14px; background: #263e30; color: #fffef6; box-shadow: 0 7px 25px #1834232e; transform: translateX(-50%); }
.toast > span { font-size: .87rem; overflow-wrap: anywhere; }
.toast button { min-height: 44px; padding: 6px 9px; flex-shrink: 0; border: 0; border-radius: 7px; color: #f1e0bf; background: transparent; font-size: .83rem; font-weight: 650; }
.toast #toast-close { width: 36px; padding: 0; font-size: 1.45rem; font-weight: 400; color: #bdccbc; }

@media (hover: hover) {
  .primary:not(:disabled):hover { background: var(--green-hover); border-color: var(--green-hover); }
  .secondary:not(:disabled):hover, .favorite-add:not(:disabled):hover { background: #e3ebdc; }
  .text-button:not(:disabled):hover { text-decoration: underline; text-underline-offset: 4px; }
  .icon-button:hover, .item-edit:hover, .menu-panel button:hover { background: #e8ecdf; }
  .tab:not(.active):hover { background: #f1f3eb; }
  .item-check:not(:disabled):hover { border-color: var(--green); background: #eaf0e4; }
  .is-checked .item-check:not(:disabled):hover { color: var(--green); }
  .item-content:hover .item-title { color: var(--green); }
  .toast button:hover { background: #ffffff12; }
}

@media (max-width: 1000px) {
  .app-shell { padding-inline: 27px; }
  .list-layout { grid-template-columns: 280px minmax(0, 1fr); gap: 25px; }
  .add-card { padding-inline: 19px; }
  .shopping-area > .section-heading { align-items: flex-start; }
  .shopping-area > .section-heading > .button { max-width: 130px; }
  .login-panel { gap: 45px; padding-inline: 35px; }
  .login-card { padding: 30px; }
  .favorites-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app-shell { padding-inline: 20px; }
  .site-header { min-height: 79px; }
  .brand { font-size: 1.5rem; gap: 10px; }
  .header-actions { gap: 8px; }
  .sync-status { max-width: 170px; font-size: .69rem; gap: 6px; }
  .page-intro { padding: 29px 0 25px; gap: 12px; }
  .page-intro h1 { font-size: 2.45rem; margin-bottom: 10px; }
  .page-intro .eyebrow { font-size: .62rem; margin-bottom: 8px; }
  .page-intro .muted { font-size: .84rem; }
  .week-label { font-size: .73rem; }
  .week-icon { display: none; }
  .tab-nav { position: sticky; top: 8px; z-index: 20; margin-bottom: 24px; box-shadow: 0 4px 0 4px var(--paper); }
  .tab { gap: 6px; padding: 11px 8px; min-height: 48px; font-size: .76rem; }
  .tab-count { min-width: 20px; height: 20px; padding-inline: 3px; font-size: .66rem; }
  .list-layout { display: flex; flex-direction: column; gap: 28px; }
  .add-card { position: static; width: 100%; padding: 20px; }
  .add-card > .eyebrow { display: none; }
  .add-card h2 { margin-bottom: 10px; font-size: 1.25rem; }
  .add-card #add-form > label { margin-top: 10px; }
  .add-card .field-row { grid-template-columns: 1fr 1fr; gap: 14px; }
  select, .extra-note textarea, .add-card .field-row input, .add-card .field-row select { font-size: 1rem; }
  .add-card label { font-size: .78rem; }
  .add-card .extra-note { margin-block: 3px 8px; }
  .offline-tip { display: none; }
  .shopping-area { width: 100%; }
  .shopping-area > .section-heading { align-items: center; min-height: 50px; }
  .shopping-area > .section-heading > .button { max-width: none; }
  .shopping-list { gap: 14px; }
  .section-heading { gap: 14px; }
  .section-heading h2 { font-size: 1.3rem; }
  .section-heading p { font-size: .83rem; }
  #panel-favorites > .section-heading, .prospect-heading { align-items: flex-start; flex-direction: column; }
  .favorites-grid { gap: 12px; }
  .favorite-card { padding: 17px; }
  .prospect-frame-wrap { margin-top: 16px; }
  .prospect-frame-wrap iframe { min-height: 400px; height: 72dvh; }
  .login-panel { max-width: 490px; grid-template-columns: 1fr; min-height: auto; gap: 30px; padding: 40px 24px 45px; }
  .login-intro .brand-mark { width: 50px; height: 50px; margin-bottom: 24px; border-radius: 15px; font-size: 1.7rem; }
  .login-intro h1 { font-size: 4.1rem; margin-bottom: 15px; }
  .login-description { font-size: 1.05rem; margin-bottom: 0; line-height: 1.6; }
  .login-note { display: none; }
  .login-card { padding: 26px; border-radius: 18px; }
  .login-card h2 { font-size: 1.4rem; }
  .conflict-banner { align-items: flex-start; flex-direction: column; gap: 10px; }
}

@media (max-width: 440px) {
  .app-shell { padding-inline: 15px; }
  .site-header { min-height: 72px; gap: 9px; }
  .brand { font-size: 1.4rem; gap: 8px; }
  .small-mark { width: 32px; height: 32px; border-radius: 10px; font-size: 1.2rem; }
  .header-actions { gap: 2px; }
  .sync-status { max-width: 128px; font-size: .64rem; }
  .more-menu > summary { width: 42px; height: 44px; }
  .page-intro { padding-top: 25px; }
  .page-intro h1 { font-size: 2.15rem; }
  .page-intro .muted { font-size: .79rem; }
  .week-label { display: none; }
  .tab-nav { padding: 4px; gap: 2px; border-radius: 12px; }
  .tab { gap: 5px; padding: 10px 5px; font-size: .7rem; line-height: 1.4; }
  .tab > span[aria-hidden] { display: none; }
  .tab-count { min-width: 18px; height: 18px; }
  .add-card { padding: 17px; border-radius: 15px; }
  .add-card .field-row { gap: 10px; }
  .optional { font-size: .63rem; }
  .shopping-area > .section-heading h2 { font-size: 1.15rem; }
  .shopping-area > .section-heading > .button { max-width: 127px; font-size: .72rem; padding-inline: 9px; }
  .shopping-area > .section-heading p { font-size: .74rem; }
  .category-heading { padding-inline: 13px; }
  .item-row { gap: 9px; padding: 10px 10px; grid-template-columns: 44px minmax(0, 1fr) 32px; }
  .item-title { font-size: .98rem; }
  .item-edit { margin-left: -9px; }
  .item-meta, .item-note { font-size: .75rem; }
  .favorites-grid { grid-template-columns: 1fr; }
  .favorite-card { padding: 20px; }
  .favorite-title { margin-top: 8px; }
  .favorite-card .favorite-add { margin-top: 12px; }
  .button-row { width: 100%; gap: 8px; }
  .button-row .button { flex: 1; padding-inline: 10px; font-size: .8rem; }
  .empty-state { padding: 32px 20px; }
  .site-footer { font-size: .65rem; padding-block: 20px 26px; gap: 6px 15px; }
  .dialog { width: calc(100% - 18px); max-height: calc(100dvh - 26px); padding: 20px; border-radius: 17px; }
  .dialog-heading h2 { font-size: 1.32rem; }
  .dialog-actions { gap: 8px; }
  .dialog-actions > .button { flex: 1; padding-inline: 12px; }
  .dialog .field-row { gap: 10px; }
  .dialog .editor-secondary { flex-direction: column; gap: 0; }
  .archive-items { padding-inline: 12px; }
  .history-item, .trash-item { gap: 10px; }
  .toast { gap: 8px; padding: 8px 8px 8px 14px; bottom: max(14px, env(safe-area-inset-bottom)); }
  .toast > span { font-size: .79rem; }
  .toast button { font-size: .76rem; padding-inline: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .button, .tab, .icon-button, .item-check, .favorite-add, .brand-mark, .tab-count, .status-dot { border: 1px solid ButtonText; }
  .tab.active, .primary, .is-checked .item-check { outline: 2px solid Highlight; }
  .status-dot { background: CanvasText; }
  .item-row.is-checked .item-title { text-decoration: line-through; }
  .toast { border: 1px solid CanvasText; }
  .dialog::backdrop { background: #0009; }
}
