/* Demo Home — Groceries overlay. C2 premium language. Entry is via the Vitals Ring only. */

.side-foot-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.side-foot-actions .btn { width: 100%; margin: 0; }

#groceriesOverlay .atv-sheet {
  width: min(820px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
}
.gr-head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.gr-head-actions .btn, .gr-head-actions .icon-btn { min-height: 44px; }

.gr-rules {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(224,180,74,0.10);
  border: 1px solid rgba(224,180,74,0.32);
  color: var(--text);
  font-size: 13px; font-weight: 650; line-height: 1.45;
}
.gr-rules strong {
  display: block; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: #e0b44a; margin-bottom: 4px; font-weight: 800;
}

.gr-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 0 12px; flex-wrap: wrap;
}
.gr-count { color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: 0.04em; }
.gr-toolbar .btn { min-height: 40px; }

.gr-add, .gr-scan {
  display: none;
  margin: 0 0 16px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(11,16,24,0.65);
  border: 1px solid var(--line);
}
.gr-add.open, .gr-scan.open { display: block; }
.gr-add h4, .gr-scan h4 {
  margin: 0 0 10px;
  font-family: "Oswald", sans-serif;
  font-size: 16px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.gr-scan-hint { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; font-weight: 650; line-height: 1.45; }
.gr-scan-region {
  display: none;
  min-height: 160px;
  margin: 0 0 10px;
  border-radius: 14px;
  overflow: hidden;
  background: #0a1016;
  border: 1px solid var(--line);
}
.gr-scan-region.live, .gr-scan-region:not(:empty) { display: block; }
.gr-scan-region video, .gr-scan-region img, .gr-scan-region canvas { width: 100%; height: auto; display: block; }
.gr-scan-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.gr-photo-btn { position: relative; overflow: hidden; cursor: pointer; margin: 0; }
.gr-photo-btn input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
  width: 100%; height: 100%; font-size: 0;
}

.gr-add-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
}
@media (max-width: 640px) {
  .gr-add-grid { grid-template-columns: 1fr; }
}
.gr-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gr-field label {
  font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.gr-field input, .gr-field select {
  appearance: none; background: #1c2733; color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  height: 44px; padding: 0 12px; font: inherit; font-weight: 650;
  width: 100%;
}
.gr-field input:focus, .gr-field select:focus {
  outline: none; border-color: var(--sky);
  box-shadow: 0 0 0 2px rgba(114,217,248,0.2);
}
.gr-upc-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.gr-upc-row input { flex: 1 1 140px; min-width: 0; }
.gr-upc-row .btn { flex: 0 0 auto; min-height: 44px; }
.gr-add-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px; flex-wrap: wrap;
}
.gr-add-msg { color: var(--muted); font-size: 12px; font-weight: 650; min-height: 1.2em; }
.gr-add-msg.ok { color: var(--lime); }
.gr-add-msg.err { color: #ff8a96; }

.gr-cat { margin: 0 0 16px; }
.gr-cat h4 {
  margin: 0 0 8px; padding: 0 4px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}

.gr-item {
  display: grid;
  grid-template-columns: 44px minmax(0,1fr) auto;
  gap: 8px; align-items: center;
  background: rgba(11,16,24,0.55);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px 10px;
  margin: 0 0 8px;
}
.gr-item.checked { opacity: 0.55; }
.gr-item.checked .gr-name { text-decoration: line-through; color: var(--muted); }
.gr-item.flagged { border-color: rgba(224,180,74,0.45); box-shadow: inset 0 0 0 1px rgba(224,180,74,0.12); }
.gr-item.exact { border-color: rgba(198,245,129,0.28); }

.gr-check {
  appearance: none; width: 28px; height: 28px; margin: 0 auto;
  border-radius: 9px; border: 1.5px solid var(--line-strong);
  background: #1c2733; cursor: pointer; position: relative;
}
.gr-check[aria-checked="true"] {
  background: var(--lime); border-color: var(--lime);
}
.gr-check[aria-checked="true"]::after {
  content: ""; position: absolute; left: 8px; top: 4px;
  width: 8px; height: 14px;
  border: solid #0a1810; border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.gr-meta { min-width: 0; }
.gr-name { font-size: 15px; font-weight: 750; line-height: 1.25; }
.gr-sub { color: var(--muted); font-size: 11.5px; font-weight: 650; margin-top: 2px; line-height: 1.35; }
.gr-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.gr-badge {
  font-size: 9px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(114,217,248,0.12); color: var(--sky);
}
.gr-badge.low { background: rgba(224,180,74,0.18); color: #e0b44a; }
.gr-badge.later { background: rgba(153,168,184,0.16); color: var(--muted); }
.gr-badge.exact { background: rgba(198,245,129,0.18); color: #c6f581; }
.gr-badge.staple { background: rgba(114,217,248,0.16); color: var(--sky); }

.gr-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.gr-step {
  display: flex; align-items: center; gap: 0;
  background: #1c2733; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden;
}
.gr-step button {
  appearance: none; border: 0; background: transparent; color: var(--text);
  width: 36px; height: 40px; font-size: 18px; font-weight: 800; cursor: pointer;
}
.gr-step button:active { background: rgba(114,217,248,0.16); }
.gr-step .gr-qty {
  min-width: 28px; text-align: center;
  font-family: "Oswald", sans-serif; font-size: 18px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.gr-flag, .gr-del {
  appearance: none; border: 1px solid var(--line); background: #1c2733; color: var(--muted);
  border-radius: 12px; height: 40px; min-width: 40px; padding: 0 8px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer;
}
.gr-flag.on { background: rgba(224,180,74,0.2); color: #e0b44a; border-color: rgba(224,180,74,0.45); }
.gr-flag.on.staple { background: rgba(114,217,248,0.18); color: var(--sky); border-color: rgba(114,217,248,0.4); }
.gr-del:hover, .gr-del:focus { color: #ff8a96; border-color: rgba(255,61,79,0.4); }

.gr-empty { color: var(--muted); font-size: 13px; font-weight: 650; padding: 12px 4px; }

@media (max-width: 640px) {
  .gr-item { grid-template-columns: 36px minmax(0,1fr); }
  .gr-controls { grid-column: 1 / -1; justify-content: flex-end; }
}


/* Wants list (2026-11-16) — tab on the Groceries sheet. */
.want-add-grid { grid-template-columns: 1.4fr 0.8fr 1.2fr 1fr; }
@media (max-width: 720px) {
  .want-add-grid { grid-template-columns: 1fr 1fr; }
}
.want-notes { grid-column: 1 / -1; }
.gr-field textarea {
  appearance: none; background: #1c2733; color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  min-height: 72px; padding: 10px 12px; font: inherit; font-weight: 650;
  width: 100%; resize: vertical;
}
.gr-field textarea:focus {
  outline: none; border-color: var(--sky);
  box-shadow: 0 0 0 2px rgba(114,217,248,0.2);
}
.want-list { display: flex; flex-direction: column; gap: 0; }
.want-card {
  display: grid;
  grid-template-columns: 148px minmax(0,1fr);
  gap: 16px;
  align-items: stretch;
  padding: 14px;
}
.want-card.status-bought,
.want-card.status-dropped { opacity: 0.66; }
.want-img {
  width: 148px; height: 148px; object-fit: cover; border-radius: 14px;
  background: #0a1016; border: 1px solid rgba(114,217,248,0.14);
}
.want-img-ph {
  display: grid; place-items: center;
  color: var(--sky, #72d9f8); font-size: 28px;
}
.want-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.want-name {
  margin: 0;
  font-family: "Oswald", sans-serif;
  font-size: 20px; font-weight: 700; letter-spacing: 0.02em; line-height: 1.2;
}
.want-price {
  font-family: "Oswald", sans-serif;
  font-size: 26px; font-weight: 700; color: #72d9f8; white-space: nowrap;
}
.want-sub { color: var(--muted); font-size: 12.5px; font-weight: 650; margin-top: 4px; }
.want-why { margin-top: 8px; font-size: 13px; font-weight: 650; line-height: 1.45; color: var(--text); }
.want-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.want-actions .btn,
.want-actions .gr-del { min-height: 40px; }
a.want-link {
  appearance: none; display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box; text-decoration: none; cursor: pointer;
  border: 1px solid var(--line-strong, rgba(114,217,248,0.28));
  background: transparent; color: var(--sky, #72d9f8);
  font-family: "Montserrat", sans-serif;
  font-size: 14px; font-weight: 750; letter-spacing: 0.06em;
  padding: 0 16px; min-height: 40px; border-radius: 16px;
}
a.want-link:hover { color: var(--sky, #72d9f8); text-decoration: none; }
.gr-badge.want-st-want { background: rgba(114,217,248,0.16); color: var(--sky, #72d9f8); }
.gr-badge.want-st-bought { background: rgba(198,245,129,0.18); color: #c6f581; }
.gr-badge.want-st-dropped { background: rgba(153,168,184,0.16); color: var(--muted); }
@media (max-width: 640px) {
  .want-card { grid-template-columns: 1fr; }
  .want-img, .want-img-ph { width: 100%; height: 200px; }
}
