:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #000000;
  --muted: #3d5a6c;

  --blue-700: #1565c0;
  --blue-600: #1e88c4;
  --blue-500: #42a5f5;
  --teal-500: #18a89a;
  --green-700: #1a9b5c;
  --green-600: #22c07a;
  --green-500: #4cd995;

  --accent: #18a89a;
  --accent-blue: #1e88c4;
  --accent-green: #1a9b5c;
  --accent-gradient: linear-gradient(135deg, #1565c0 0%, #1e88c4 38%, #18a89a 68%, #1a9b5c 100%);
  --accent-soft: #e8f6f3;
  --accent-soft-blue: #e3f2fd;
  --accent-soft-green: #e8f8f0;

  --danger: #c0392b;
  --flag: #e6a817;
  --star: #f0b429;
  --border: #c5dce8;
  --border-green: #b8e0cc;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-h: 56px;
  --footer-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
}

/* Shop header */
.shop-header,
.edit-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--header-h);
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.shop-header::after,
.edit-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--accent-gradient);
}

/* Cozi-style solid header (blue-green) */
.cozi-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: var(--header-h);
  padding: 8px 8px 8px 4px;
  background: linear-gradient(135deg, #1e88c4 0%, #18a89a 100%);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.cozi-header-title {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cozi-header-actions {
  display: flex;
  align-items: center;
}

.cozi-header-spacer {
  width: 44px;
  flex-shrink: 0;
}

.icon-btn-light {
  color: #fff !important;
}

.icon-btn {
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  border-radius: 8px;
  color: var(--accent-blue);
}

.list-title-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0 8px;
  color: var(--text);
}

.list-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.list-chevron {
  color: var(--accent-green);
  font-size: 0.75rem;
}

.status-bar {
  padding: 6px 12px;
}

.status-pill {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--accent-soft-blue);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
}

.status-pill.offline {
  color: var(--green-700);
  border-color: var(--border-green);
  background: var(--accent-soft-green);
}

.shop-main,
.edit-main {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
}

.shop-footer {
  position: sticky;
  bottom: 0;
  padding: 12px;
  padding-bottom: calc(12px + var(--safe-bottom));
  background: linear-gradient(transparent, var(--bg) 20%);
  border-top: 1px solid var(--border);
}

.category-block {
  margin-bottom: 12px;
}

.category-block:nth-child(odd) .category-header {
  background: var(--accent-soft-blue);
  border: 1px solid var(--border);
}

.category-block:nth-child(even) .category-header {
  background: var(--accent-soft-green);
  border: 1px solid var(--border-green);
}

.category-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: var(--accent-soft-blue);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(21, 101, 192, 0.06);
  color: var(--text);
}

.category-block:nth-child(odd) .cat-meta {
  color: var(--blue-600);
}

.category-block:nth-child(even) .cat-meta {
  color: var(--green-700);
}

.cat-meta {
  font-weight: 500;
  font-size: 0.9rem;
}

.category-items {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-items.collapsed {
  display: none;
}

.item-swipe-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  background: var(--surface);
}

.item-swipe-actions {
  position: absolute;
  inset: 0;
  display: flex;
  pointer-events: none;
  z-index: 0;
}

.item-swipe-wrap.swipe-open .item-swipe-actions,
.item-swipe-wrap.swipe-delete-active .item-swipe-actions,
.item-swipe-wrap.swipe-edit-active .item-swipe-actions {
  pointer-events: auto;
}

.item-swipe-action {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0;
  font-weight: 700;
  font-size: 0.9rem;
}

.item-swipe-delete {
  justify-content: flex-start;
  background: #e53935;
  color: #fff;
}

.item-swipe-edit {
  justify-content: flex-end;
  background: #1e88c4;
  color: #fff;
}

.swipe-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 100%;
  min-height: 52px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.swipe-action-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.swipe-action-trash {
  display: inline-block;
  width: 22px;
  height: 22px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 3h6l1 2h4v2H4V5h4l1-2zm1 6h2v9h-2V9zm4 0h2v9h-2V9zM7 9h2v9H7V9zm-1 11h12a2 2 0 0 0 2-2V9H5v9a2 2 0 0 0 2 2z'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 3h6l1 2h4v2H4V5h4l1-2zm1 6h2v9h-2V9zm4 0h2v9h-2V9zM7 9h2v9H7V9zm-1 11h12a2 2 0 0 0 2-2V9H5v9a2 2 0 0 0 2 2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.swipe-action-pencil {
  display: inline-block;
  width: 22px;
  height: 22px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.item-swipe-slide {
  position: relative;
  z-index: 1;
  touch-action: pan-y;
  will-change: transform;
  background: var(--surface);
}

.item-swipe-slide.is-swiping {
  transition: none;
}

.item-row,
.cozi-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 0;
  border: none;
  border-bottom: 1px solid #e0e6ea;
  user-select: none;
}

.item-row.crossed .item-name,
.cozi-row.crossed .item-name {
  text-decoration: line-through;
  color: #9aa3a8;
  opacity: 1;
}

.item-check {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid #9aa3a8;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: transparent;
}

.checkbox.checked {
  background: var(--teal-500);
  border-color: var(--teal-500);
}

.item-main {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.item-name {
  font-size: 1.05rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #333;
}

.badge {
  font-size: 0.85rem;
  flex-shrink: 0;
}

.badge-star {
  color: var(--star);
}

.badge-flag {
  color: var(--flag);
}

.item-qty {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--accent-soft-blue);
  color: var(--blue-700);
  font-weight: 600;
  cursor: pointer;
}

.category-block:nth-child(even) .item-qty {
  background: var(--accent-soft-green);
  border-color: var(--border-green);
  color: var(--green-700);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
}

/* Buttons */
.btn {
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.btn-block {
  width: 100%;
  display: block;
  margin-top: 8px;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(21, 101, 192, 0.22);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-text {
  border: none;
  background: none;
  color: var(--accent-blue);
  font-weight: 600;
  min-height: 44px;
  cursor: pointer;
}

.btn-danger-text {
  color: var(--danger);
}

.finish-panel {
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--border-green);
}

.estimated-total {
  font-size: 1.1rem;
  margin: 0 0 4px;
  color: var(--text);
}

.estimate-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Edit screen */
.edit-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  flex: 1;
  text-align: center;
}

.edit-section {
  margin-bottom: 24px;
}

.field-label,
.section-heading {
  display: block;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}

.cat-subheading {
  font-size: 0.95rem;
  color: var(--accent-green);
  margin: 12px 0 6px;
}

.text-input,
.qty-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
}

.text-input:focus,
.qty-input:focus {
  outline: 2px solid var(--teal-500);
  outline-offset: 1px;
  border-color: var(--teal-500);
}

.add-row {
  display: grid;
  grid-template-columns: 1fr 64px auto;
  gap: 8px;
  align-items: center;
}

.list-admin-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
}

.suggestion-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.suggestion-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.suggestion-row.on-list .suggestion-add {
  opacity: 0.72;
  background: var(--accent-soft-blue, #e8f4f8);
  cursor: default;
}

.suggestion-row.on-list .sug-meta {
  font-style: italic;
}

.star-toggle {
  min-width: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--accent-soft-blue);
  font-size: 1.2rem;
  cursor: pointer;
}

.star-toggle.on {
  color: var(--star);
  border-color: var(--star);
  background: #fff9e6;
}

.suggestion-add {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.sug-name {
  font-weight: 600;
}

.sug-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.edit-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.edit-item-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.edit-item-main:disabled {
  cursor: default;
  opacity: 0.7;
}

.edit-item-label {
  font-weight: 500;
}

.item-photo-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--accent-soft);
}

.suggestion-edit {
  min-width: 52px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--accent-soft-green);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-green);
  cursor: pointer;
}

.item-edit-modal .item-edit-sub {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.item-edit-photo-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.item-edit-photo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.item-edit-photo-actions .file-label {
  margin: 0;
  text-align: center;
}

.item-edit-photo-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: var(--accent-soft-blue);
  overflow: hidden;
}

.item-edit-photo {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
}

.item-edit-photo-placeholder {
  color: var(--muted);
  font-size: 0.95rem;
}

.preview-photo {
  width: 100%;
  max-width: 280px;
  max-height: 220px;
  object-fit: contain;
  border-radius: 12px;
  margin: 0 auto 12px;
  display: block;
  border: 1px solid var(--border);
  background: var(--accent-soft-blue);
}

.muted {
  color: var(--muted);
}

.file-label {
  text-align: center;
  cursor: pointer;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
}

.modal-overlay.hidden {
  display: none;
}

.modal-sheet {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: 16px 16px 12px 12px;
  padding: 20px;
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid var(--border);
}

.modal-sheet::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 16px 16px 0 0;
  background: var(--accent-gradient);
}

.preview-modal {
  text-align: center;
}

.preview-icon {
  color: var(--teal-500);
  margin-bottom: 8px;
}

.preview-title {
  margin: 0 0 16px;
  font-size: 1.35rem;
  color: var(--text);
}

.preview-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  text-align: left;
  margin: 0 0 12px;
}

.preview-meta dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.preview-meta dd {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.preview-hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.confirm-text {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

.confirm-sub {
  color: var(--muted);
  margin: 0 0 16px;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-form-actions {
  margin-top: 16px;
}

.text-input-modal .text-input {
  margin-bottom: 4px;
}

.list-picker-modal .btn-primary.btn-block {
  margin-top: 8px;
}

.modal-heading {
  margin: 0 0 14px;
  font-size: 1.1rem;
  color: var(--text);
}

.category-pick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
  max-height: 50vh;
  overflow-y: auto;
}

.category-pick {
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--accent-soft-blue);
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.category-pick:nth-child(even) {
  background: var(--accent-soft-green);
  border-color: var(--border-green);
}

.category-pick.active {
  border-color: var(--teal-500);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--teal-500);
}

.qty-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 20px 0;
}

.qty-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--accent-soft-blue);
  color: var(--blue-700);
  font-size: 1.5rem;
  cursor: pointer;
}

.qty-value {
  font-size: 1.75rem;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
  color: var(--text);
}

.list-pick-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.list-pick {
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--accent-soft-blue);
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}

.list-pick:nth-child(even) {
  background: var(--accent-soft-green);
  border-color: var(--border-green);
}

.list-pick.active {
  border-color: var(--teal-500);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--teal-500);
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: calc(80px + var(--safe-bottom));
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(135deg, #1565c0, #1a9b5c);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.95rem;
  z-index: 200;
  transition: opacity 0.2s, transform 0.2s;
}

.app-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Undo snackbar (Cozi-style) */
.undo-snackbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(56px + var(--safe-bottom));
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: #424242;
  color: #fff;
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  max-width: 480px;
  margin: 0 auto;
}

.undo-snackbar.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.undo-msg {
  font-size: 0.95rem;
}

.undo-btn {
  border: none;
  background: transparent;
  color: #4dd0c8;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  min-height: 44px;
  padding: 0 8px;
}

/* Overflow menu */
.overflow-menu {
  position: fixed;
  z-index: 300;
  min-width: 180px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  padding: 6px 0;
  border: 1px solid var(--border);
}

.overflow-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 12px 18px;
  font-size: 0.95rem;
  color: #222;
  cursor: pointer;
}

.overflow-item:hover,
.overflow-item:focus {
  background: var(--accent-soft);
}

/* Lists hub — compact cards */
.lists-hub-main {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #eef2f4;
}

.list-card-compact {
  display: flex;
  align-items: stretch;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  min-height: 64px;
  max-height: 88px;
  overflow: hidden;
}

.list-card-compact.active {
  box-shadow: 0 0 0 2px var(--teal-500);
}

.list-card-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px 10px 14px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  min-width: 0;
}

.list-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.list-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.list-card-name {
  font-weight: 700;
  color: var(--blue-600);
  font-size: 1rem;
}

.list-card-count {
  font-size: 0.8rem;
  color: #8a9499;
  font-weight: 500;
}

.list-card-preview {
  font-size: 0.82rem;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reorder-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  background: var(--accent-soft);
  color: var(--muted);
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.reorder-done {
  color: var(--teal-500) !important;
  font-weight: 700;
  min-height: 36px;
}

.lists-hub-main.reorder-mode .list-card-compact,
.lists-hub-main.reorder-ready .list-card-compact {
  cursor: grab;
  user-select: none;
}

.lists-hub-main.is-reordering {
  position: relative;
  touch-action: none;
}

.list-card-compact.is-selected {
  box-shadow: 0 0 0 2px var(--teal-500), 0 8px 20px rgba(0, 0, 0, 0.16);
}

.list-card-compact.is-dragging {
  opacity: 0.95;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  cursor: grabbing;
  pointer-events: none;
  margin: 0;
}

.list-card-placeholder {
  border-radius: 8px;
  margin-bottom: 10px;
  border: 2px dashed var(--teal-500);
  background: rgba(24, 168, 154, 0.1);
}

.more-count {
  color: #888;
  font-style: italic;
}

.list-card-menu {
  flex-shrink: 0;
  color: #666 !important;
}

/* Cozi list body */
.cozi-list-main {
  padding: 0 !important;
  background: #fff;
}

.add-item-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border: none;
  border-bottom: 1px solid #e0e6ea;
  background: #fff;
  color: var(--teal-500);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}

.cozi-item-list {
  display: flex;
  flex-direction: column;
}

.cozi-category-group {
  margin: 0;
  padding: 0;
}

.cozi-category-label {
  margin: 0;
  padding: 10px 16px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: left;
  color: var(--teal-500);
  background: #fff;
  border: none;
  border-bottom: none;
  box-shadow: none;
}

.cozi-category-items {
  display: flex;
  flex-direction: column;
}

.cozi-category-items .item-row,
.cozi-category-items .cozi-row {
  border-bottom: none;
}

.cozi-footer {
  background: #fff;
  border-top: 1px solid #e0e6ea;
}

/* Inline add / recommendations */
.add-item-panel {
  padding: 8px 0 12px;
  background: #fff;
  border-bottom: 1px solid #e0e6ea;
}

.add-item-row-active {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.add-checkbox-spacer {
  width: 22px;
  height: 22px;
  border: 2px solid #ccc;
  border-radius: 3px;
  flex-shrink: 0;
}

.inline-add-input {
  border: none !important;
  border-bottom: 2px solid var(--teal-500) !important;
  border-radius: 0 !important;
  min-height: 44px;
}

.add-item-tools {
  padding: 4px 12px;
}

.icon-tool {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  color: #666;
  min-width: 40px;
  min-height: 40px;
  cursor: pointer;
}

.recommend-block {
  padding: 8px 12px 0;
}

.recommend-label {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.recommend-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recommend-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--accent-soft-blue);
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.recommend-row.on-list {
  opacity: 0.65;
  cursor: default;
}

/* Product detail / edit extras */
.product-detail-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.preview-placeholder {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 12px;
  margin-bottom: 12px;
}

.star-row-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--accent-soft-blue);
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.star-row-btn.on {
  border-color: var(--star);
  background: #fff9e6;
}

.star-glyph {
  font-size: 1.35rem;
  color: var(--star);
}

.add-category-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

.add-category-hint {
  margin: 6px 0 0;
  font-size: 0.8rem;
}

.list-name-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.starred-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #e0e6ea;
}

.starred-name {
  flex: 1;
  text-align: left;
  border: none;
  background: transparent;
  min-height: 44px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
}

.settings-hint {
  margin: -4px 0 10px;
  font-size: 0.85rem;
}

.lock-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--accent-gradient);
}

.lock-card {
  width: min(100%, 360px);
  background: #fff;
  border-radius: 16px;
  padding: 28px 22px 22px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  text-align: center;
}

.lock-card h1 {
  margin: 0 0 6px;
  font-size: 1.6rem;
  color: var(--text);
}

.lock-sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.lock-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lock-form input {
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 1rem;
}

.lock-form .btn-primary {
  min-height: 48px;
  border: none;
  border-radius: 10px;
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}

.lock-form .btn-primary:disabled,
.lock-form input:disabled {
  opacity: 0.7;
  cursor: wait;
}

.lock-msg {
  min-height: 1.2em;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 0.9rem;
}

.modal-overlay.center-sheet {
  align-items: center;
}

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