:root {
  --ink: #20302c;
  --muted: #697571;
  --paper: #f7f6f1;
  --surface: #ffffff;
  --mint: #cfe8d8;
  --mint-dark: #2f6651;
  --coral: #e58268;
  --line: #dce3dc;
}

* { box-sizing: border-box; }
/* Author rules like .task-card's `display: flex` otherwise beat the
   browser's default [hidden] rule, so hidden elements stayed visible. */
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Georgia, "Times New Roman", serif; }
button, a { font: inherit; }
.page-shell { width: min(100% - 32px, 680px); margin: 0 auto; padding: 20px 0 48px; }
.topbar { align-items: center; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin-bottom: 64px; }
.top-links { align-items: center; display: flex; flex-wrap: wrap; gap: 16px; }
.help-button { align-items: center; background: var(--mint); border: 1px solid var(--mint-dark); border-radius: 50%; color: var(--ink); cursor: pointer; display: inline-flex; font-family: Arial, sans-serif; font-size: .95rem; font-weight: bold; height: 32px; justify-content: center; padding: 0; width: 32px; }
.help-button:hover, .help-button:focus-visible { background: #b9ddc6; }
.language-switcher { align-items: center; display: flex; gap: 6px; }
.language-switcher select { border: 1px solid var(--line); border-radius: 4px; font-family: Arial, sans-serif; font-size: .78rem; min-height: 32px; padding: 2px 4px; }
.visually-hidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
.brand { color: var(--ink); font-size: 1.2rem; font-weight: bold; text-decoration: none; }
.text-link { color: var(--mint-dark); font-family: Arial, sans-serif; font-size: .85rem; font-weight: bold; text-decoration: none; }
.logout-form { display: inline; margin: 0; }
.logout-button { background: none; border: 0; cursor: pointer; padding: 0; }
.auth-form { margin-top: 30px; }
.auth-form .member-name + .member-name { margin-top: 14px; }
.auth-error { background: #f4d9b1; border-radius: 6px; color: #70431b; font-family: Arial, sans-serif; font-size: .9rem; margin: 0 0 16px; padding: 12px; }
.auth-secondary { color: var(--muted); font-family: Arial, sans-serif; font-size: .85rem; text-align: center; }
.intro, .scan-panel, .success-panel, .qr-page { animation: rise .35s ease-out both; }
.eyebrow { color: var(--mint-dark); font-family: Arial, sans-serif; font-size: .72rem; font-weight: bold; letter-spacing: .12em; margin: 0 0 12px; text-transform: uppercase; }
h1 { font-size: clamp(2.2rem, 10vw, 4rem); line-height: .98; margin: 0; letter-spacing: 0; }
h2 { font-size: 1.35rem; margin: 4px 0 8px; }
.prompt { font-size: 1.3rem; margin: 48px 0 18px; }
.choice-list { display: grid; gap: 14px; }
.choice-button, .button { align-items: center; border: 0; border-radius: 6px; display: inline-flex; justify-content: center; min-height: 64px; padding: 16px 22px; text-align: center; text-decoration: none; }
.choice-button { background: var(--mint); color: var(--ink); font-size: 1.35rem; font-weight: bold; transition: transform .15s ease, background .15s ease; }
.choice-submit { cursor: pointer; border: 0; width: 100%; }
.choice-button:hover, .choice-button:focus-visible { background: #b9ddc6; transform: translateY(-2px); }
.task-list { display: grid; gap: 12px; margin-top: 28px; }
.shopping-summary { align-items: center; border-bottom: 1px solid var(--line); color: inherit; display: flex; gap: 12px; justify-content: space-between; margin-top: 28px; min-height: 56px; padding: 16px 8px; text-decoration: none; }
.shopping-summary:hover, .shopping-summary:focus-visible { background: var(--mint); border-radius: 6px; }
.shopping-summary .eyebrow { margin-bottom: 5px; }
.shopping-summary-action { align-items: center; display: flex; flex-shrink: 0; gap: 10px; }
.shopping-badge { align-items: center; background: var(--coral); border-radius: 999px; color: white; display: flex; flex-shrink: 0; font-family: Arial, sans-serif; font-size: .85rem; font-weight: bold; height: 28px; justify-content: center; min-width: 28px; padding: 0 6px; }
.storage-choice-list { display: grid; gap: 10px; margin-bottom: 18px; }
.storage-choice { align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; display: flex; gap: 14px; min-height: 60px; padding: 14px 16px; }
.storage-choice input { height: 22px; width: 22px; }
.storage-choice span { font-size: 1.15rem; }
.result-list { margin: 12px 0 24px; }
.result-list p { margin: 6px 0; }
.result-heading { margin-top: 28px; }
.full-button { margin-top: 10px; width: 100%; }
.duty-strip { align-items: center; background: var(--mint); border-radius: 6px; display: flex; justify-content: space-between; margin-top: 28px; padding: 18px; }
.duty-strip .eyebrow { margin-bottom: 6px; }
.duty-strip h2 { margin: 0 0 4px; }
.duty-next { font-family: Arial, sans-serif; font-size: .82rem; font-weight: bold; }
.rotation-summary-block { align-items: flex-start; gap: 16px; }
.rotation-groups { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.rotation-group { min-width: 0; }
.rotation-group strong { display: block; font-size: .95rem; }
.rotation-group .task-type { color: var(--mint-dark); }
.task-card { align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--coral); border-radius: 6px; display: flex; gap: 16px; justify-content: space-between; padding: 18px; }
.task-location, .task-type, .success-copy, .empty-state p { color: var(--muted); font-family: Arial, sans-serif; font-size: .9rem; margin: 0; }
.task-location { font-weight: bold; }
.task-type { font-size: .8rem; }
.button { cursor: pointer; font-family: Arial, sans-serif; font-size: .9rem; font-weight: bold; }
.button-primary { background: var(--ink); color: white; width: 100%; }
.button-secondary { background: var(--mint); color: var(--ink); min-height: 48px; }
.empty-state, .success-panel, .qr-page { padding: 48px 0; text-align: center; }
.empty-state h2, .error-state h1 { margin: 16px 0 8px; }
.checkmark, .status-icon { align-items: center; background: var(--mint); border-radius: 50%; color: var(--mint-dark); display: flex; font-family: Arial, sans-serif; font-size: 2rem; font-weight: bold; height: 72px; justify-content: center; margin: 0 auto; width: 72px; }
.status-icon-muted { background: #f4d9b1; color: #956022; }
.success-panel h1 { font-size: 2.3rem; margin-top: 22px; }
.success-copy { font-size: 1.05rem; margin: 12px 0 32px; }
.qr-page { background: var(--surface); border: 1px solid var(--line); padding: 36px 20px; }
.qr-label + .qr-label { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 32px; }
.qr-label h1 { font-size: 2.1rem; }
.qr-image { display: block; height: min(72vw, 320px); margin: 30px auto 20px; width: min(72vw, 320px); }
.qr-caption { font-size: 1.25rem; margin: 0 auto 16px; max-width: 320px; }
.qr-open-link { display: inline-block; font-size: .9rem; min-height: 44px; padding: 10px 0; }
.qr-print-controls { border-bottom: 1px solid var(--line); margin: 16px 0 4px; padding-bottom: 18px; }
.qr-print-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.qr-print-actions .button { min-height: 44px; }
.qr-print-selected { max-width: 220px; }
.qr-print-message { color: #a14f3b; margin-top: 8px; }
.qr-select-control { align-items: center; color: var(--muted); cursor: pointer; display: inline-flex; font-family: Arial, sans-serif; font-size: .85rem; gap: 8px; justify-content: center; margin-bottom: 10px; min-height: 44px; }
.qr-select-control input { height: 20px; width: 20px; }
.family-duty { align-items: flex-end; }
.family-form { margin-top: 30px; }
.family-form > h2 { margin-bottom: 14px; }
.member-row { background: var(--surface); border-bottom: 1px solid var(--line); display: grid; gap: 10px; padding: 14px 8px; }
.member-name, .rotation-order { color: var(--muted); display: block; font-family: Arial, sans-serif; font-size: .72rem; }
.member-name input { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 1rem; margin-top: 5px; width: 100%; }
.rotation-toggle { align-items: center; display: flex; gap: 8px; font-family: Arial, sans-serif; font-size: .82rem; }
.rotation-toggle input { height: 18px; width: 18px; }
.rotation-order { align-items: center; display: flex; gap: 8px; }
.rotation-order input { margin-top: 0; max-width: 72px; }
.rotation-order.is-disabled { opacity: .5; }
.remove-button { background: none; border: 0; color: #a14f3b; cursor: pointer; font-family: Arial, sans-serif; font-size: .78rem; justify-self: start; padding: 4px 0; }
.member-row small { color: var(--muted); display: block; font-family: Arial, sans-serif; font-size: .72rem; margin-top: 3px; }
.member-row input[type="number"], .date-field input { border: 1px solid var(--line); border-radius: 4px; font-family: Arial, sans-serif; min-height: 38px; padding: 6px; width: 100%; }
.member-row input[type="checkbox"] { height: 20px; width: 20px; }
.date-field { color: var(--muted); display: block; font-family: Arial, sans-serif; font-size: .8rem; margin: 22px 0; }
.date-field input { display: block; margin-top: 7px; }
.add-member-form { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 24px; }
.add-member-form h2 { margin-bottom: 14px; }
.add-member-form .member-name input { border: 1px solid var(--line); border-radius: 4px; min-height: 42px; padding: 8px; }
.add-member-form .button { margin-top: 12px; }
.print-button { margin-top: 18px; max-width: 260px; }
.item-card-body { align-items: center; display: flex; gap: 14px; min-width: 0; }
.item-thumb { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; flex-shrink: 0; height: 48px; object-fit: cover; width: 48px; }
.item-thumb-preview { display: block; height: 96px; margin: 8px 0; width: 96px; }
.place-assignment-list { display: grid; gap: 12px; margin-bottom: 18px; }
.place-assignment-row { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; }
.place-assignment-name { display: block; font-family: Arial, sans-serif; font-size: .9rem; font-weight: bold; margin-bottom: 8px; }
.place-assignment-row select { border: 1px solid var(--line); border-radius: 4px; font-family: Arial, sans-serif; min-height: 44px; padding: 6px; width: 100%; }
.member-name select { border: 1px solid var(--line); border-radius: 4px; display: block; font-family: Arial, sans-serif; margin-top: 5px; min-height: 42px; padding: 8px; width: 100%; }
.item-thumb-button { background: none; border: 0; cursor: pointer; display: block; flex-shrink: 0; padding: 0; }
.item-category-chip { color: var(--mint-dark); font-family: Arial, sans-serif; font-size: .72rem; font-weight: bold; margin: 0 0 4px; text-transform: uppercase; }
.items-filter-bar { display: grid; gap: 12px; margin: 24px 0 20px; }
.item-search-input { border: 1px solid var(--line); border-radius: 6px; font-family: Arial, sans-serif; font-size: 1rem; min-height: 46px; padding: 10px 14px; width: 100%; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; color: var(--ink); cursor: pointer; flex-shrink: 0; font-family: Arial, sans-serif; font-size: .78rem; font-weight: bold; min-height: 36px; padding: 6px 14px; white-space: nowrap; }
.chip.is-active { background: var(--mint-dark); border-color: var(--mint-dark); color: white; }
.items-place-filter { margin: 0; }
.items-place-filter select { border: 1px solid var(--line); border-radius: 6px; font-family: Arial, sans-serif; min-height: 44px; padding: 8px; width: 100%; }
.items-filter-status { align-items: center; display: flex; font-family: Arial, sans-serif; font-size: .8rem; gap: 12px; justify-content: space-between; }
.items-filter-status #items-result-count { color: var(--muted); }
.empty-state-inline { color: var(--muted); font-family: Arial, sans-serif; font-size: .9rem; padding: 24px 0; text-align: center; }
.barcode-scanner { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; margin: 24px 0; padding: 16px; text-align: center; }
.barcode-video { background: #111; border-radius: 6px; display: block; margin: 0 auto 12px; max-height: 360px; max-width: 100%; width: 100%; }
.product-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 28px 18px; }
.product-image { border: 1px solid var(--line); border-radius: 6px; display: block; margin: 16px auto; max-height: 220px; max-width: min(80vw, 260px); object-fit: contain; }
.product-match { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px; }
.product-setup-primary { background: var(--paper); border-radius: 6px; margin-top: 18px; padding: 14px; text-align: left; }
.product-secondary-link { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 16px; text-align: left; }
.lightbox { align-items: center; background: rgba(32, 48, 44, .82); display: flex; inset: 0; justify-content: center; padding: 24px; position: fixed; z-index: 100; }
.lightbox[hidden] { display: none; }
.lightbox-backdrop { inset: 0; position: absolute; }
.lightbox-content { background: var(--surface); border-radius: 8px; max-height: 90vh; max-width: min(92vw, 520px); overflow: auto; padding: 20px; position: relative; text-align: center; }
.lightbox-image { border-radius: 6px; display: block; margin: 0 auto; max-height: 70vh; max-width: 100%; object-fit: contain; }
.lightbox-caption { color: var(--ink); font-family: Arial, sans-serif; font-size: .95rem; font-weight: bold; margin: 14px 0 0; }
.lightbox-close { background: var(--mint); border: 0; border-radius: 50%; cursor: pointer; font-size: 1.3rem; height: 36px; line-height: 1; position: absolute; right: 10px; top: 10px; width: 36px; }
body.lightbox-open { overflow: hidden; }
.help-modal { align-items: center; background: rgba(32, 48, 44, .72); display: flex; inset: 0; justify-content: center; padding: 16px; position: fixed; z-index: 110; }
.help-modal-backdrop { inset: 0; position: absolute; }
.help-modal-content { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; max-height: min(88vh, 680px); max-width: 560px; overflow-y: auto; padding: 28px 24px 24px; position: relative; width: 100%; }
.help-modal-content h2 { font-size: 1.7rem; margin: 0 28px 12px 0; }
.help-modal-content h3 { font-size: 1.05rem; margin: 22px 0 6px; }
.help-modal-content p { color: var(--muted); font-family: Arial, sans-serif; font-size: .9rem; line-height: 1.5; margin: 0 0 10px; }
.help-modal-content .eyebrow { margin-bottom: 10px; }
.help-intro { margin-bottom: 12px !important; }
.help-steps { color: var(--muted); font-family: Arial, sans-serif; font-size: .9rem; line-height: 1.5; margin: 0; padding-left: 22px; }
.help-admin-section { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 2px; }
.help-admin-list { color: var(--muted); font-family: Arial, sans-serif; font-size: .84rem; line-height: 1.45; margin: 12px 0 0; }
.help-admin-list dt { color: var(--ink); font-weight: bold; margin-top: 8px; }
.help-admin-list dd { margin: 2px 0 0; }
.help-modal-close { align-items: center; background: var(--mint); border: 0; border-radius: 50%; cursor: pointer; display: flex; font-size: 1.3rem; height: 36px; justify-content: center; line-height: 1; position: absolute; right: 10px; top: 10px; width: 36px; }
body.help-modal-open { overflow: hidden; }
.intro-slogan { color: var(--ink) !important; font-family: Georgia, "Times New Roman", serif !important; font-size: 1.55rem !important; font-weight: bold; margin: 18px 0 !important; text-align: center; }
.context-help-wrap { position: relative; }
.context-help-trigger { align-items: center; background: var(--mint); border: 1px solid var(--line); border-radius: 50%; color: var(--mint-dark); cursor: pointer; display: inline-flex; font-family: Arial, sans-serif; font-size: .72rem; font-weight: bold; height: 24px; justify-content: center; margin-left: 5px; padding: 0; vertical-align: middle; width: 24px; }
.context-help-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(32, 48, 44, .12); color: var(--muted); font-family: Arial, sans-serif; font-size: .8rem; line-height: 1.45; margin-top: 8px; padding: 10px 12px; }
.context-help-panel p { margin: 0 0 6px; }
.context-help-panel p:last-child { margin-bottom: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media print { .topbar, .print-button, .screen-only { display: none; } .qr-label.is-print-excluded { display: none; } .page-shell { width: 100%; padding: 0; } .qr-page { border: 0; } }
@media (max-width: 520px) { .topbar { gap: 10px; margin-bottom: 40px; } .top-links { gap: 10px; justify-content: flex-end; } .help-modal { align-items: flex-end; padding: 8px; } .help-modal-content { max-height: 86vh; padding: 24px 18px 18px; } }