:root {
  color-scheme: light;
  --bg: #fff8ef;
  --surface: #ffffff;
  --ink: #1f1f1f;
  --muted: #5b5550;
  --line: #e7e2da;
  --green: #e30613;
  --green-dark: #b80016;
  --blue: #b80016;
  --gold: #f9b233;
  --red: #b80016;
  --shadow: 0 12px 28px rgba(23, 32, 27, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  min-width: 0; /* prevent flex/grid children from escaping their container */
}

img,
video,
svg {
  max-width: 100%;
  height: auto;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 44px;
  min-width: auto; /* override * { min-width: 0 } — buttons keep their natural minimum */
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.suggestion-row:focus-visible,
.add-choice-card:focus-visible {
  outline: 3px solid rgba(42, 95, 143, 0.38);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  width: min(100%, 480px);
  max-width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow-x: hidden;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.brand-lockup {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.brand-lockup img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
}

.brand-lockup .brand-mark {
  width: clamp(54px, 17vw, 76px);
  height: auto;
  max-height: 44px;
  border-radius: 0;
  object-fit: contain;
  flex-shrink: 0;
}

.eyebrow,
.step-label {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.22rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.55rem;
  line-height: 1.16;
}

.copy {
  color: var(--muted);
  line-height: 1.45;
}

.reward-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0 16px;
}

.reward-preview span {
  min-width: 0;
  min-height: 86px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--green-dark);
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1.12;
  text-align: center;
}

.reward-preview img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
  margin: 12px 0 14px;
}

.feature-tile,
.store-card,
.recipe-card {
  min-height: 82px;
  display: grid;
  gap: 4px;
  align-content: center;
  justify-items: center;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--green-dark);
  text-align: center;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(23, 32, 27, 0.06);
}

.feature-tile img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.store-card-grid {
  display: grid;
  gap: 10px;
}

.store-card {
  justify-items: start;
  text-align: left;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
}

.store-card img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  grid-row: span 3;
}

.store-card.selected {
  border-color: var(--green);
  background: #fff1e8;
}

.store-card-title,
.recipe-card-main strong {
  display: block;
  color: var(--green-dark);
  font-weight: 900;
}

.store-card-meta,
.store-card-status,
.recipe-card-main small,
.ingredient-row small,
.trophy-card small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.3;
}

.recipe-category-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.recipe-category-pill {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 900;
}

.recipe-category-pill.selected {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

.screen-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  margin-bottom: 8px;
}

.screen-heading h2 {
  margin-bottom: 0;
}

.compact-button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.recipe-layout,
.recipe-list,
.recipe-detail-card,
.ingredient-list,
.trophy-grid {
  display: grid;
  gap: 10px;
}

.recipe-card {
  grid-template-columns: 42px minmax(0, 1fr);
  justify-items: start;
  min-height: 72px;
  text-align: left;
}

.recipe-card.selected {
  border-color: var(--green);
  background: #fff1e8;
}

.recipe-card-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f5e8;
  color: var(--green);
  font-weight: 900;
}

.recipe-controls {
  display: grid;
  grid-template-columns: 74px repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.recipe-controls label {
  grid-column: 1;
  font-size: 0.74rem;
  font-weight: 900;
  color: var(--blue);
  text-transform: uppercase;
}

.recipe-controls input {
  grid-column: 1;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

.recipe-controls button {
  min-height: 42px;
  font-size: 0.78rem;
}

.recipe-back-button {
  margin-bottom: 10px;
}

.recipe-empty-card {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

#recipeStep.recipe-card-open .recipe-category-row,
#recipeStep.recipe-card-open .recipe-list {
  display: none;
}

.recipe-detail-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.recipe-detail-hero {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.recipe-detail-hero img {
  width: 82px;
  height: 82px;
  object-fit: contain;
}

.recipe-badge {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e8f0f7;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
}

.recipe-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.recipe-meta-grid span {
  padding: 8px 6px;
  border-radius: 8px;
  background: #f3f8f4;
  color: var(--green-dark);
  font-size: 0.74rem;
  font-weight: 900;
  text-align: center;
}

.ingredient-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.ingredient-row input {
  margin-top: 3px;
}

.recipe-route-preview {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.trophy-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.trophy-card img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.trophy-card p {
  margin: 3px 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.trophy-card.locked {
  filter: grayscale(0.6);
  opacity: 0.68;
}

.toolbar {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  max-width: 148px;
}

.icon-button {
  width: 44px;
  padding: 0;
  border: 1px solid var(--line);
  background: #f8faf8;
  color: var(--ink);
  font-weight: 800;
}

.icon-button.danger,
.item-icon-button.danger {
  color: var(--red);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

main {
  overflow-x: hidden;
  overflow-y: auto;
}

.screen {
  display: none;
  padding: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

.screen.active {
  display: block;
}

.store-status-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.store-status-strip span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--green-dark);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.store-status-strip img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.home-primary-actions {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  margin-bottom: 16px;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  line-height: 1.12;
}

.action-button img {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.item-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.add-choice-grid,
.suggestion-list,
.hunt-target-list {
  display: grid;
  gap: 10px;
}

.add-choice-card,
.suggestion-row {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 4px 10px rgba(23, 32, 27, 0.06);
}

.add-choice-card img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  grid-row: span 2;
}

.add-choice-card span,
.suggestion-row strong {
  color: var(--green-dark);
  font-weight: 900;
}

.add-choice-card small,
.suggestion-row small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.3;
}

.freestyle-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.freestyle-panel[hidden],
.hunt-builder-panel[hidden] {
  display: none;
}

.freestyle-panel > label,
.hunt-target-field span {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.item-suggestions {
  min-height: 42px;
}

.suggestion-row {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 58px;
  background: #ffffff;
}

.suggestion-row em {
  justify-self: end;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e4f1ea;
  color: var(--green-dark);
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 900;
}

.hunt-target-field {
  display: grid;
  gap: 8px;
}

.hunt-target-field select {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hunt-selection-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hunt-selection-summary span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef3ef;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.item-composer input {
  min-width: 0;
  min-height: 52px;
  padding: 0 12px;
  border: 0;
  color: var(--ink);
}

.icon-submit {
  width: 48px;
  min-height: 52px;
  border-radius: 0;
  background: var(--blue);
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 900;
}

.list-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.list-header h2 {
  margin-bottom: 0;
}

.list-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 44px 44px;
  gap: 8px;
}

.list-tools select {
  min-width: 0;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.shopping-list-body {
  min-height: 176px;
}

.empty-list {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

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

.empty-actions .secondary-button {
  margin-top: 0;
}

.shopping-items {
  display: grid;
  gap: 8px;
}

.shopping-item {
  display: grid;
  grid-template-columns: 30px 52px minmax(0, 1fr) 48px 44px;
  align-items: center;
  gap: 8px;
  min-height: 66px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.item-select-wrap {
  display: grid;
  place-items: center;
}

.item-select-wrap input {
  width: 22px;
  height: 22px;
  accent-color: var(--green);
}

.shopping-item:last-child {
  border-bottom: 0;
}

.shopping-item.checked .item-name {
  color: var(--muted);
  text-decoration: line-through;
}

.item-check,
.item-icon-button {
  width: 100%;
  min-height: 44px;
  padding: 0 4px;
  border: 1px solid var(--line);
  background: #f8faf8;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.05;
}

.item-check {
  background: #e4f1ea;
  color: var(--green-dark);
}

.item-main {
  min-width: 0;
}

.item-name {
  margin-bottom: 6px;
  font-weight: 900;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.item-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.item-chip {
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef3ef;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.item-chip.ready {
  background: #e4f1ea;
  color: var(--green-dark);
}

.item-chip.source,
.item-chip.brand {
  background: #e8f0f7;
  color: var(--blue);
}

.item-chip.pending {
  background: #fff8e6;
  color: var(--gold);
}

.action-footer {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.action-footer .secondary-button {
  margin-top: 0;
}

.store-map {
  position: relative;
  height: 172px;
  margin: 0 -2px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 48%, rgba(42, 95, 143, 0.08) 48% 52%, transparent 52%),
    linear-gradient(#eef3ef 1px, transparent 1px),
    linear-gradient(90deg, #eef3ef 1px, transparent 1px),
    #fbfcfa;
  background-size: 100% 100%, 28px 28px, 28px 28px, auto;
}

.map-mascot {
  position: absolute;
  right: 8px;
  bottom: 4px;
  width: 72px;
  height: 72px;
  object-fit: contain;
  pointer-events: none;
}

.store-map svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.store-map path {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-node {
  position: absolute;
  z-index: 1;
  left: var(--x);
  top: var(--y);
  width: 18px;
  height: 18px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--blue);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(23, 32, 27, 0.22);
}

.map-node.entrance {
  background: var(--green);
}

.map-node.clue {
  background: var(--gold);
}

.primary-button,
.secondary-button {
  width: 100%;
  padding: 0 16px;
  font-weight: 800;
}

.primary-button {
  background: var(--green);
  color: #ffffff;
}

.secondary-button {
  margin-top: 10px;
  border: 1px solid var(--line);
  background: #f8faf8;
  color: var(--ink);
}

.secondary-button.danger-button {
  border-color: rgba(166, 63, 63, 0.35);
  background: #fff7f6;
  color: var(--red);
}

.field-row {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field-row label {
  color: var(--muted);
  font-weight: 700;
}

.field-row input,
.field-row select {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.role-grid,
.scan-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 14px 0;
}

.scan-actions .secondary-button {
  margin-top: 0;
}

.role {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: #f8faf8;
  color: var(--ink);
  font-weight: 800;
}

.role img {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.role span {
  min-width: 0;
  line-height: 1.15;
}

.role.selected {
  border-color: var(--green);
  background: #fff1e8;
}

.camera-panel,
.objective-panel,
.result-panel,
.route-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfa;
}

.panel-icon {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.panel-mascot {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.camera-feed {
  display: none;
  width: 100%;
  height: 220px;
  border-radius: 8px;
  object-fit: cover;
  background: #000;
}

.camera-frame {
  position: relative;
  height: 150px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(18, 72, 52, 0.16) 0 2px, transparent 2px 100%),
    linear-gradient(rgba(18, 72, 52, 0.16) 0 2px, transparent 2px 100%),
    #eef3ef;
  background-size: 24px 24px;
}

.camera-frame span {
  position: absolute;
  inset: 44px 36px;
  border: 3px solid var(--green);
  border-radius: 8px;
}

.scan-guide-mascot {
  position: absolute;
  right: 18px;
  bottom: 48px;
  width: 58px;
  height: 58px;
  object-fit: contain;
  pointer-events: none;
}

.camera-panel p {
  margin: 12px 0 0;
  color: var(--muted);
}

/* ── Camera overlay — floats above any screen ───────────── */
#cameraOverlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.88);
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 16px;
  gap: 12px;
}

#cameraOverlay.active {
  display: flex;
}

#cameraOverlay .camera-feed {
  display: block;
  width: 100%;
  height: 60vw;
  max-height: 340px;
  border-radius: 10px;
}

#cameraOverlay .camera-frame {
  width: 100%;
  height: 60vw;
  max-height: 340px;
  border-radius: 10px;
}

#cameraOverlay .scan-guide-mascot {
  bottom: 80px;
}

#cameraOverlay p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.88rem;
  text-align: center;
  margin: 0;
}

#cameraOverlayCancel {
  align-self: center;
  padding: 10px 32px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  min-height: 44px;
}

.objective-title {
  margin-bottom: 6px;
  font-weight: 900;
}

.objective-meta,
.route-step,
.result-detail {
  color: var(--muted);
  line-height: 1.4;
}

.objective-hero,
.result-hero,
.route-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.objective-hero > div,
.result-hero > div {
  min-width: 0;
}

.objective-asset {
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  object-fit: contain;
}

.objective-asset.icon {
  width: 54px;
  height: 54px;
}

.quest-progress-chip {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.quest-progress-chip img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.result-hero img {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.reward-earned {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff8e6;
  color: var(--green-dark);
  font-weight: 900;
}

.reward-earned img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.reward-earned.mission {
  background: #efe8fb;
}

.progress-track {
  height: 12px;
  margin: 14px 0;
  border-radius: 999px;
  background: #e9ece8;
  overflow: hidden;
}

#progressFill {
  width: 0;
  height: 100%;
  background: var(--gold);
  transition: width 180ms ease;
}

.route-panel {
  margin-top: 14px;
}

.route-summary {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.route-summary img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.route-summary .objective-title {
  margin: 0;
}

.route-step {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.route-step:last-child {
  border-bottom: 0;
}

.route-index {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #e4f1ea;
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 900;
}

.map-status-panel,
.map-log-panel,
.map-visual-panel {
  min-height: 96px;
}

.custom-map-panel {
  display: grid;
  gap: 12px;
}

.custom-map-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.custom-map-header .objective-title,
.custom-map-header .objective-meta {
  margin-bottom: 0;
}

.custom-map-tools {
  grid-template-columns: minmax(0, 1fr) 44px 44px 44px;
}

.custom-map-points {
  display: grid;
  gap: 8px;
}

.custom-map-point {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.custom-map-point:first-child {
  border-top: 0;
}

.custom-map-point-main {
  min-width: 0;
}

.custom-map-point-title {
  margin-bottom: 4px;
  font-weight: 900;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.custom-map-point-meta {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.custom-map-action {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.custom-map-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 8px;
  align-items: center;
}

.custom-map-action select {
  min-width: 0;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.custom-map-action .secondary-button {
  margin-top: 0;
}

.custom-map-location {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.map-status-panel {
  padding-right: 84px;
}

/* ── Product result card ─────────────────────────────────── */

.product-card {
  display: grid;
  gap: 6px;
  padding: 12px 0 10px;
}

.product-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.product-card-image {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.product-card-text {
  min-width: 0;
}

.product-card-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.product-card-meta {
  margin: 3px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}

.product-location-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green-dark);
}

.product-location-chip.unmapped {
  color: var(--muted);
  border-style: dashed;
}

/* ── Product action row ──────────────────────────────────── */

.product-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.scan-choice-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.scan-choice-button {
  margin-top: 0;
  min-height: 48px;
  padding-inline: 10px;
  line-height: 1.12;
}

.product-actions .secondary-button {
  margin-top: 0;
  font-size: 0.78rem;
  padding: 0 8px;
}

/* ── Variant discovery panels ────────────────────────────── */

.variant-panels {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.variant-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--green-dark);
  user-select: none;
}

.variant-panel summary::-webkit-details-marker { display: none; }

.variant-panel summary::after {
  content: "›";
  font-size: 1.1rem;
  transition: transform 0.15s;
}

.variant-panel[open] summary::after {
  transform: rotate(90deg);
}

.variant-list {
  display: grid;
  gap: 6px;
  padding-top: 8px;
}

.variant-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 0.82rem;
  line-height: 1.3;
}

.variant-chip-name {
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: anywhere;
  min-width: 0;
}

.variant-chip-qty {
  flex: 0 0 auto;
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.variant-chip-add {
  flex: 0 0 auto;
  padding: 4px 10px;
  border: 1px solid var(--green);
  border-radius: 999px;
  background: none;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.variant-loading {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 6px 0;
}

.variant-empty {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

.map-visual-panel {
  overflow: hidden;
}

.map-svg {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(#eef3ef 1px, transparent 1px),
    linear-gradient(90deg, #eef3ef 1px, transparent 1px),
    #ffffff;
  background-size: 20px 20px;
  touch-action: pan-x pan-y pinch-zoom;
}

.store-map-svg,
.route-mini-map {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.store-map-svg rect {
  fill: #f9f6ea;
  stroke: #eadfc9;
  stroke-width: 0.8;
}

.store-map-edges line {
  stroke: #dfd6c5;
  stroke-width: 0.35;
}

.store-map-node {
  stroke: #ffffff;
  stroke-width: 0.5;
}

.store-map-node.grocery {
  fill: #2f8bd8;
}

.store-map-node.produce {
  fill: #39a95d;
}

.store-map-node.dairy {
  fill: #8b5ce2;
}

.store-map-node.bakery {
  fill: #d7922b;
}

.store-map-node.restricted {
  fill: #b74949;
}

.store-map-route,
.route-mini-map polyline {
  fill: none;
  stroke: var(--route-line, #e30613);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 0;
  filter: drop-shadow(0 1px 1px rgba(23, 32, 27, 0.22));
}

.store-map-target circle {
  fill: #ffffff;
  stroke: var(--green);
  stroke-width: 1.4;
}

.store-map-target text {
  fill: var(--green-dark);
  font-size: 3px;
  font-weight: 900;
  text-anchor: middle;
  pointer-events: none;
}

.store-map-highlight circle {
  fill: #f8d75b;
  stroke: var(--ink);
  stroke-width: 1.2;
  filter: drop-shadow(0 1px 2px rgba(23, 32, 27, 0.28));
}

.store-map-highlight.scan circle {
  fill: #70b7ff;
}

.customer-route-map {
  display: grid;
  gap: 6px;
}

.route-map-frame {
  position: relative;
}

.route-map-layer-toggle {
  position: absolute;
  top: 14px;
  right: 12px;
  z-index: 3;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(31, 31, 31, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--brand-primary, var(--red));
  box-shadow: 0 6px 18px rgba(31, 31, 31, 0.16);
  font-size: 0.76rem;
  font-weight: 900;
}

.route-map-layer-toggle:focus-visible {
  outline: 3px solid rgba(249, 178, 51, 0.72);
  outline-offset: 2px;
}

.route-mini-map {
  background:
    linear-gradient(#eef3ef 1px, transparent 1px),
    linear-gradient(90deg, #eef3ef 1px, transparent 1px),
    #ffffff;
  background-size: 20px 20px;
}

.route-mini-map circle {
  fill: var(--green);
  stroke: #ffffff;
  stroke-width: 2;
}

.map-svg line {
  stroke: #9aa59f;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.map-point {
  cursor: pointer;
  stroke: #ffffff;
  stroke-width: 2.5;
  filter: drop-shadow(0 1px 2px rgba(23, 32, 27, 0.24));
}

.map-point.low {
  fill: #8d9690;
}

.map-point.medium {
  fill: var(--gold);
}

.map-point.high {
  fill: var(--green);
}

.map-point.selected {
  stroke: var(--ink);
  stroke-width: 3;
}

.custom-map-progress-svg {
  background:
    linear-gradient(90deg, rgba(0, 107, 63, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(0, 107, 63, 0.08) 1px, transparent 1px),
    #fffdf8;
  background-size: 18px 18px;
}

.custom-map-progress-line {
  fill: none;
  stroke: var(--brand-primary, var(--red));
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.custom-map-progress-point circle {
  fill: #ffffff;
  stroke: var(--brand-secondary, var(--green));
  stroke-width: 1.6;
  filter: drop-shadow(0 2px 4px rgba(23, 32, 27, 0.22));
}

.custom-map-progress-point text {
  fill: var(--brand-secondary, var(--green-dark));
  font-size: 3px;
  font-weight: 900;
  text-anchor: middle;
  pointer-events: none;
}

.map-inspector {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.regroup-list {
  margin-top: 10px;
}

.map-log-entry {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.map-log-entry:last-child {
  border-bottom: 0;
}

.map-log-entry strong {
  color: var(--green-dark);
}

.map-log-entry small {
  color: var(--muted);
  line-height: 1.35;
}

.mapping-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.mapping-suggestions span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef7ec;
  color: var(--green-dark);
  font-size: 0.72rem;
  font-weight: 800;
}

.route-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.parent-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.parent-bar button {
  min-height: 58px;
  display: grid;
  grid-template-rows: auto auto;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: 4px 2px;
  border: 1px solid var(--line);
  background: #f8faf8;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.1;
}

.parent-bar button img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.parent-bar button span {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 132px;
  width: min(420px, calc(100% - 32px));
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.large-text {
  font-size: 1.15rem;
}

body.high-contrast {
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #050505;
  --muted: #222222;
  --line: #111111;
  --green: #006b3f;
  --green-dark: #003822;
  --blue: #003f8c;
  --gold: #8a5400;
  --red: #8e1f1f;
  --shadow: none;
}

@media (min-width: 430px) {
  .role-grid,
  .scan-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .role-grid .role:last-child {
    grid-column: 1 / -1;
  }
}

/* ── Login screen ────────────────────────────────────────── */

.login-hero {
  text-align: center;
  padding: 24px 0 16px;
}

.login-logo {
  width: 120px;
  height: auto;
  margin-bottom: 16px;
}

.login-hero h2 {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.login-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.login-label {
  font-weight: 700;
  font-size: 0.88rem;
}

.login-input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s;
}

.login-input:focus {
  outline: none;
  border-color: var(--green);
}

.login-message {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--green-dark);
  font-weight: 700;
  min-height: 1.4em;
}

.login-message.error {
  color: var(--red);
}

.login-dev-notice {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1.5px dashed var(--gold);
  border-radius: 8px;
  background: #fdf8ef;
}

.login-dev-label {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.login-dev-anchor {
  font-size: 0.85rem;
  color: var(--green-dark);
  font-weight: 700;
  word-break: break-all;
}

.login-privacy {
  margin-top: 20px;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

/* Previous-activity strip — shown below store status when signed in */
.history-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  padding: 10px 16px;
  background: var(--cream, #f6f4ef);
  border-bottom: 1px solid rgba(33, 111, 80, 0.12);
  font-size: 0.82rem;
  color: var(--green-dark, #17201b);
}

.history-strip-greeting {
  font-weight: 700;
  color: var(--green, #e30613);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.history-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.history-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  color: var(--ink, #17201b);
  opacity: 0.75;
}

.history-stat strong {
  color: var(--green-dark, #17201b);
  opacity: 1;
}

/* Header user chip — shown when signed in */
.user-chip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 1 0 100%;
  min-height: 28px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--green-dark);
  cursor: pointer;
  border: none;
  background: none;
  padding: 4px 0;
}

.user-chip-email {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── ShelfQuest kawaii UI refresh ───────────────────────── */

:root {
  --green-primary: #e30613;
  --green-dark: #b80016;
  --blue-primary: #e30613;
  --yellow-reward: #f9b233;
  --orange-accent: #e30613;
  --coral-warning: #b80016;
  --purple-quest: #b80016;
  --pink-badge: #e30613;
  --background: #fff8ef;
  --warm-background: #fff8ef;
  --card: #ffffff;
  --cream-card: #fff1e8;
  --text-primary: #1f1f1f;
  --text-secondary: #5b5550;
  --success: #006b3f;
  --border-soft: #e7e2da;
  --sticker-line: rgba(255, 255, 255, 0.92);
  --bg: var(--warm-background);
  --surface: #fffdfa;
  --ink: var(--text-primary);
  --muted: var(--text-secondary);
  --line: rgba(229, 231, 235, 0.9);
  --green: var(--green-primary);
  --gold: var(--yellow-reward);
  --blue: var(--blue-primary);
  --red: var(--coral-warning);
  --shadow: 0 18px 36px rgba(36, 48, 68, 0.14);
  --soft-shadow: 0 10px 24px rgba(36, 48, 68, 0.12);
  --sticker-shadow: 0 6px 0 rgba(36, 48, 68, 0.06), 0 16px 30px rgba(36, 48, 68, 0.14);
  font-family: "Nunito", "Arial Rounded MT Bold", "Segoe UI", system-ui, sans-serif;
}

body {
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 194, 71, 0.22) 0 26px, transparent 27px),
    radial-gradient(circle at 88% 14%, rgba(244, 114, 182, 0.16) 0 30px, transparent 31px),
    linear-gradient(180deg, #fff8ef 0%, #ffffff 62%, #fff1e8 100%);
  color: var(--text-primary);
}

button {
  border-radius: 999px;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

button:active {
  transform: translateY(1px) scale(0.98);
}

.app-shell {
  background:
    linear-gradient(180deg, rgba(255, 248, 231, 0.95), rgba(248, 250, 252, 0.96)),
    var(--warm-background);
  box-shadow: 0 20px 56px rgba(36, 48, 68, 0.22);
}

.topbar {
  position: relative;
  z-index: 5;
  padding: 14px 14px 16px;
  border: 0;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  background:
    url("/prototype/assets/decorations/sparkle-small.png") right 22px top 16px / 22px 22px no-repeat,
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 231, 0.96) 48%, rgba(232, 247, 255, 0.96));
  box-shadow: var(--soft-shadow);
}

.brand-lockup {
  gap: 10px;
}

.brand-lockup .brand-mark {
  width: clamp(72px, 21vw, 92px);
  max-height: 58px;
  filter: drop-shadow(0 5px 8px rgba(36, 48, 68, 0.12));
}

.brand-lockup h1 {
  color: var(--text-primary);
  font-size: 1.35rem;
  font-weight: 950;
}

.header-microcopy {
  margin: 3px 0 0;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.25;
}

.eyebrow,
.step-label {
  color: var(--purple-quest);
  font-size: 0.72rem;
  font-weight: 950;
}

.toolbar {
  max-width: 168px;
}

.icon-button,
.user-chip {
  border: 2px solid var(--sticker-line);
  background: #ffffff;
  box-shadow: 0 5px 12px rgba(36, 48, 68, 0.1);
}

main {
  background:
    url("/prototype/assets/decorations/sparkle-medium.png") left 12px top 42px / 18px 18px no-repeat,
    transparent;
  padding-bottom: 104px;
}

.screen {
  padding: 16px 16px 18px;
}

h2 {
  color: var(--text-primary);
  font-weight: 950;
}

.copy,
.objective-meta,
.route-step,
.result-detail,
.store-card-meta,
.store-card-status,
.recipe-card-main small,
.ingredient-row small,
.trophy-card small {
  color: var(--text-secondary);
}

.shelf-card,
.feature-tile,
.store-card,
.recipe-card,
.recipe-detail-card,
.trophy-card,
.trophy-feature-card,
.camera-panel,
.objective-panel,
.result-panel,
.route-panel,
.empty-list,
.product-card,
.variant-chip,
.recipe-empty-card {
  border: 3px solid var(--sticker-line);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.68)),
    var(--card);
  box-shadow: var(--sticker-shadow);
}

.store-status-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.store-status-strip span {
  min-height: 40px;
  border: 2px solid var(--sticker-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--green-dark);
  box-shadow: 0 6px 14px rgba(36, 48, 68, 0.09);
}

.store-status-strip img {
  width: 21px;
  height: 21px;
}

.history-strip {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 16px rgba(36, 48, 68, 0.08);
}

.store-welcome-card,
.quest-teaser-card {
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px;
  overflow: hidden;
}

.store-welcome-card {
  background:
    url("/prototype/assets/decorations/star-gold.png") right 12px top 12px / 24px 24px no-repeat,
    linear-gradient(135deg, #ffffff 0%, #fff8e7 54%, #eafbe9 100%);
}

.brand-studio-modules {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.brand-studio-modules[hidden] {
  display: none;
}

.brand-studio-module-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 74px;
  padding: 10px;
  border: 1px solid var(--brand-border, var(--line));
  border-radius: 8px;
  background: var(--brand-surface, #ffffff);
  box-shadow: 0 4px 10px rgba(23, 32, 27, 0.06);
}

.brand-studio-module-card img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.brand-studio-module-card strong {
  display: block;
  color: var(--brand-primary-pressed, var(--green-dark));
  overflow-wrap: break-word;
}

.brand-studio-module-card small {
  display: block;
  margin-top: 3px;
  color: var(--brand-text-secondary, var(--muted));
  line-height: 1.3;
}

.quest-teaser-card {
  background:
    url("/prototype/assets/decorations/sparkle-small.png") right 16px top 16px / 22px 22px no-repeat,
    linear-gradient(135deg, #fff7d6 0%, #fff 48%, #fff1e8 100%);
}

.store-welcome-card > img,
.quest-teaser-card > img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 7px 10px rgba(36, 48, 68, 0.14));
}

.store-welcome-card h2,
.quest-teaser-card h2 {
  margin-bottom: 5px;
  font-size: 1.18rem;
}

.store-welcome-card p,
.quest-teaser-card p,
.safety-shield-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.38;
}

.store-badge,
.reward-badge,
.aisle-badge,
.you-are-here-badge,
.next-stop-badge {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--yellow-reward);
  color: #6b3f00;
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 5px 10px rgba(36, 48, 68, 0.11);
}

.primary-button,
.secondary-button,
.success-button,
.warning-soft-button,
.blue-family-button,
.yellow-reward-button {
  min-height: 50px;
  border: 2px solid var(--sticker-line);
  box-shadow: 0 8px 16px rgba(36, 48, 68, 0.14);
  font-weight: 950;
}

.primary-button,
.primary-quest-button,
.success-button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 48%),
    linear-gradient(180deg, var(--green-primary), var(--green-dark));
  color: #ffffff;
}

.secondary-button {
  background:
    linear-gradient(180deg, #ffffff, #f5fbff);
  color: var(--text-primary);
}

.blue-family-button {
  background: linear-gradient(180deg, #58bdff, var(--blue-primary));
  color: #ffffff;
}

.yellow-reward-button {
  background: linear-gradient(180deg, #ffe08a, var(--yellow-reward));
  color: #6b3f00;
}

.warning-soft-button,
.secondary-button.danger-button {
  border-color: rgba(255, 90, 82, 0.35);
  background: #fff0ef;
  color: var(--coral-warning);
}

.home-primary-actions {
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
}

.item-composer {
  border: 3px solid var(--sticker-line);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: var(--soft-shadow);
}

.item-composer input {
  border-radius: 24px 0 0 24px;
  font-weight: 800;
}

.icon-submit {
  border-radius: 18px;
  margin: 5px;
  min-height: 42px;
  width: 42px;
  background: linear-gradient(180deg, #58bdff, var(--blue-primary));
  box-shadow: 0 6px 12px rgba(30, 154, 240, 0.24);
}

.feature-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.feature-tile {
  min-height: 84px;
  padding: 8px 4px;
  background: linear-gradient(180deg, #ffffff, #fff8e7);
  color: var(--green-dark);
  font-size: 0.72rem;
}

.feature-tile img {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 5px 8px rgba(36, 48, 68, 0.12));
}

.shopping-list-card {
  padding: 14px;
  background:
    url("/prototype/assets/decorations/sparkle-small.png") right 14px top 18px / 20px 20px no-repeat,
    linear-gradient(180deg, #ffffff, #fffdf8);
}

.list-tools {
  grid-template-columns: minmax(0, 1fr) 42px 42px 42px;
}

.list-tools select,
.field-row input,
.field-row select,
.recipe-controls input,
.custom-map-action select {
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  color: var(--text-primary);
  font-weight: 850;
}

.shopping-items {
  gap: 10px;
}

.shopping-item {
  grid-template-columns: 30px 46px 52px minmax(0, 1fr) 44px 38px;
  gap: 8px;
  min-height: 72px;
  padding: 9px 8px;
  border: 2px solid rgba(229, 231, 235, 0.75);
  border-radius: 20px;
  background: #fff8e7;
  box-shadow: 0 7px 14px rgba(36, 48, 68, 0.08);
}

.shopping-item-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border: 2px solid #ffffff;
  border-radius: 16px;
  background: #ffffff;
  padding: 4px;
  box-shadow: 0 5px 10px rgba(36, 48, 68, 0.1);
}

.shopping-item.checked {
  background: #eefbea;
}

.item-check,
.item-icon-button {
  border: 2px solid #ffffff;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 5px 10px rgba(36, 48, 68, 0.08);
}

.item-check {
  background: linear-gradient(180deg, #dff9d8, #bdf4c5);
  color: var(--green-dark);
}

.item-icon-button {
  font-size: 0.68rem;
}

.item-name {
  color: var(--text-primary);
  font-size: 0.97rem;
}

.item-chip {
  background: #ffffff;
  color: var(--text-secondary);
  box-shadow: inset 0 0 0 1px rgba(229, 231, 235, 0.8);
}

.item-chip.ready {
  background: #dcfce7;
  color: var(--green-dark);
}

.item-chip.source,
.item-chip.brand {
  background: #dbeafe;
  color: #1d4ed8;
}

.item-chip.pending {
  background: #fff3c4;
  color: #9a5b00;
}

.action-footer {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-footer .secondary-button:last-child {
  grid-column: 1 / -1;
}

.safety-shield-card,
.guardian-note-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 14px 0;
  padding: 12px;
  background: linear-gradient(135deg, #eaf7ff, #effff0);
}

.safety-shield-card img,
.guardian-note-card img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.safety-shield-card strong,
.guardian-note-card span {
  color: var(--green-dark);
  font-weight: 950;
}

.camera-panel {
  min-height: 314px;
  padding: 18px 14px 14px;
  background:
    radial-gradient(circle at 50% 44%, rgba(227, 6, 19, 0.12), transparent 46%),
    linear-gradient(180deg, #ffffff, #fff1e8);
  overflow: hidden;
}

.scan-instruction-pill {
  position: relative;
  z-index: 2;
  width: fit-content;
  margin: 0 auto 12px;
  padding: 8px 14px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #ffffff;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 950;
  box-shadow: var(--soft-shadow);
}

.camera-frame {
  height: 210px;
  border: 3px solid #ffffff;
  border-radius: 28px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.12)),
    repeating-linear-gradient(90deg, rgba(227, 6, 19, 0.1) 0 2px, transparent 2px 28px),
    repeating-linear-gradient(0deg, rgba(227, 6, 19, 0.1) 0 2px, transparent 2px 28px),
    #fff1e8;
  box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.16);
}

.camera-frame::before {
  content: "";
  position: absolute;
  inset: 30px;
  border-radius: 24px;
  background:
    linear-gradient(var(--scanner-frame, var(--green-primary)), var(--scanner-frame, var(--green-primary))) left top / 54px 5px no-repeat,
    linear-gradient(var(--scanner-frame, var(--green-primary)), var(--scanner-frame, var(--green-primary))) left top / 5px 54px no-repeat,
    linear-gradient(var(--scanner-frame, var(--green-primary)), var(--scanner-frame, var(--green-primary))) right top / 54px 5px no-repeat,
    linear-gradient(var(--scanner-frame, var(--green-primary)), var(--scanner-frame, var(--green-primary))) right top / 5px 54px no-repeat,
    linear-gradient(var(--scanner-frame, var(--green-primary)), var(--scanner-frame, var(--green-primary))) left bottom / 54px 5px no-repeat,
    linear-gradient(var(--scanner-frame, var(--green-primary)), var(--scanner-frame, var(--green-primary))) left bottom / 5px 54px no-repeat,
    linear-gradient(var(--scanner-frame, var(--green-primary)), var(--scanner-frame, var(--green-primary))) right bottom / 54px 5px no-repeat,
    linear-gradient(var(--scanner-frame, var(--green-primary)), var(--scanner-frame, var(--green-primary))) right bottom / 5px 54px no-repeat;
  filter: drop-shadow(0 0 10px rgba(227, 6, 19, 0.28));
}

.camera-frame span {
  inset: 56px 52px;
  border: 0;
  border-radius: 999px;
  background: rgba(227, 6, 19, 0.1);
  animation: scanPulse 1.8s ease-in-out infinite;
}

.camera-panel .panel-icon {
  width: 46px;
  height: 46px;
}

.scan-guide-mascot {
  right: 12px;
  bottom: 48px;
  width: 68px;
  height: 68px;
  animation: mascotWiggle 3.8s ease-in-out infinite;
}

.camera-panel p {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  color: var(--green-dark);
  font-weight: 850;
  text-align: center;
}

.scan-safety-card {
  margin-top: 14px;
}

.objective-panel {
  background:
    url("/prototype/assets/decorations/star-gold.png") right 12px top 12px / 26px 26px no-repeat,
    linear-gradient(135deg, #fff8ef, #ffffff 55%, #fff1e8);
}

.objective-hero {
  align-items: center;
}

.quest-clue-hero {
  justify-content: space-between;
}

.objective-title {
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 950;
}

.objective-asset {
  width: 86px;
  height: 86px;
  filter: drop-shadow(0 8px 12px rgba(36, 48, 68, 0.14));
}

.quest-progress-chip {
  border: 2px solid #ffffff;
  background: #ffffff;
  box-shadow: 0 6px 12px rgba(36, 48, 68, 0.1);
}

.reward-earned {
  border: 2px solid #ffffff;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff4c7, #ffe8a3);
  box-shadow: 0 8px 16px rgba(255, 194, 71, 0.24);
}

.progress-track {
  height: 16px;
  border: 2px solid #ffffff;
  background: #e5e7eb;
  box-shadow: inset 0 2px 4px rgba(36, 48, 68, 0.08);
}

#progressFill {
  background: linear-gradient(90deg, var(--yellow-reward), var(--orange-accent));
}

.result-panel {
  background: linear-gradient(180deg, #ffffff, #f7fff4);
}

.result-hero img {
  width: 76px;
  height: 76px;
  filter: drop-shadow(0 8px 12px rgba(36, 48, 68, 0.13));
}

.product-card {
  padding: 12px;
  background: #ffffff;
}

.product-location-chip {
  border: 2px solid #ffffff;
  background: #dcfce7;
  color: var(--green-dark);
  box-shadow: 0 5px 10px rgba(36, 48, 68, 0.08);
}

.recipe-category-row {
  gap: 10px;
}

.recipe-category-pill {
  border: 2px solid #ffffff;
  background: #ffffff;
  color: var(--purple-quest);
  box-shadow: 0 5px 10px rgba(36, 48, 68, 0.08);
}

.recipe-category-pill.selected {
  background: linear-gradient(180deg, #e30613, var(--purple-quest));
  border-color: #ffffff;
  color: #ffffff;
}

.recipe-card {
  grid-template-columns: 64px minmax(0, 1fr);
  min-height: 88px;
  padding: 12px;
  background: linear-gradient(135deg, #ffffff, #fff8e7);
}

.recipe-card.selected {
  border-color: #ffffff;
  background: linear-gradient(135deg, #fff1e8, #ffffff);
  outline: 3px solid rgba(227, 6, 19, 0.22);
}

.recipe-card-image {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 7px 10px rgba(36, 48, 68, 0.12));
}

.recipe-detail-card {
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #fff8e7);
}

.recipe-badge,
.dietary-badge {
  border: 2px solid #ffffff;
  background: #dbeafe;
  color: #1d4ed8;
  box-shadow: 0 5px 10px rgba(36, 48, 68, 0.08);
}

.recipe-meta-grid span {
  border: 2px solid #ffffff;
  border-radius: 16px;
  background: #eefbea;
}

.recipe-mastery-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 2px solid #ffffff;
  border-radius: 18px;
  background: #fff4c7;
  box-shadow: 0 6px 12px rgba(36, 48, 68, 0.08);
}

.recipe-mastery-card img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.recipe-mastery-card strong,
.recipe-mastery-card span {
  display: block;
}

.recipe-mastery-card span {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.ingredient-row {
  border-top: 2px dashed rgba(229, 231, 235, 0.9);
}

.trophy-grid {
  gap: 14px;
}

.trophy-feature-card {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  background:
    url("/prototype/assets/decorations/sparkle-medium.png") right 14px top 14px / 24px 24px no-repeat,
    linear-gradient(135deg, #fff4c7, #ffffff 52%, #fff1e8);
}

.trophy-feature-card img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 9px 14px rgba(36, 48, 68, 0.16));
}

.trophy-feature-card strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--text-primary);
  font-size: 1.04rem;
  font-weight: 950;
}

.trophy-feature-card p {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.35;
}

.trophy-section {
  display: grid;
  gap: 10px;
}

.trophy-section h3 {
  margin: 2px 0 0;
  color: var(--purple-quest);
  font-size: 0.92rem;
  font-weight: 950;
}

.trophy-tile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.trophy-card {
  grid-template-columns: 60px minmax(0, 1fr);
  padding: 10px;
  background: linear-gradient(180deg, #ffffff, #fffdf8);
}

.trophy-tile {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

.trophy-card img {
  width: 68px;
  height: 68px;
  filter: drop-shadow(0 7px 10px rgba(36, 48, 68, 0.12));
}

.trophy-tile img {
  width: 76px;
  height: 76px;
}

.trophy-card strong {
  color: var(--text-primary);
  font-weight: 950;
}

.trophy-card.locked,
.trophy-feature-card.locked {
  filter: grayscale(0.75);
  opacity: 0.78;
}

.trophy-progress {
  height: 10px;
  margin-top: 8px;
  overflow: hidden;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #e5e7eb;
}

.trophy-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--yellow-reward), var(--pink-badge));
}

.sticker-collection-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: linear-gradient(135deg, #ffffff, #eaf7ff);
}

.sticker-collection-card strong {
  color: var(--text-primary);
  font-weight: 950;
}

.sticker-collection-row {
  display: flex;
  align-items: center;
}

.sticker-collection-row img,
.sticker-collection-row span {
  width: 44px;
  height: 44px;
  margin-left: -8px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #ffffff;
  object-fit: contain;
  box-shadow: 0 6px 12px rgba(36, 48, 68, 0.12);
}

.sticker-collection-row img:first-child {
  margin-left: 0;
}

.sticker-collection-row span {
  display: grid;
  place-items: center;
  background: var(--purple-quest);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 950;
}

.route-panel {
  background: linear-gradient(180deg, #ffffff, #fff8e7);
}

.store-map-svg,
.route-mini-map,
.map-svg {
  border: 3px solid #ffffff;
  border-radius: 24px;
  background:
    radial-gradient(circle at 10% 15%, rgba(255, 194, 71, 0.22), transparent 12%),
    linear-gradient(#fff2cb 1px, transparent 1px),
    linear-gradient(90deg, #fff2cb 1px, transparent 1px),
    #fff8e7;
  background-size: auto, 24px 24px, 24px 24px, auto;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.54);
}

.store-map-svg rect {
  fill: #fff8e7;
  stroke: #ffffff;
  stroke-width: 1.2;
}

.store-map-edges line,
.map-svg line {
  stroke: rgba(107, 114, 128, 0.38);
  stroke-width: 0.45;
}

.store-map-route,
.route-mini-map polyline {
  stroke: var(--purple-quest);
  stroke-width: 3.4;
  stroke-dasharray: 2.8 2.8;
  animation: routeReveal 1.2s linear infinite;
}

.store-map-target circle {
  fill: var(--yellow-reward);
  stroke: #ffffff;
  stroke-width: 1.4;
}

.store-map-target text {
  fill: #6b3f00;
}

.store-map-highlight circle {
  fill: var(--pink-badge);
  stroke: #ffffff;
  stroke-width: 1.4;
}

.route-index {
  background: var(--yellow-reward);
  color: #6b3f00;
  border: 2px solid #ffffff;
  box-shadow: 0 5px 10px rgba(36, 48, 68, 0.1);
}

.route-step {
  border-bottom: 2px dashed rgba(229, 231, 235, 0.9);
}

.custom-map-panel {
  background: linear-gradient(180deg, #ffffff, #eaf7ff);
}

.map-log-entry {
  border-bottom: 2px dashed rgba(229, 231, 235, 0.9);
}

.mapping-suggestions span {
  border: 2px solid #ffffff;
  background: #dcfce7;
}

.parent-bar.shelfquest-bottom-nav {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 12px;
  width: min(456px, calc(100% - 24px));
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 8px;
  border: 3px solid rgba(255, 255, 255, 0.95);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 32px rgba(36, 48, 68, 0.18);
  transform: translateX(-50%);
}

.parent-bar.shelfquest-bottom-nav button {
  position: relative;
  min-height: 58px;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.66rem;
  font-weight: 950;
  box-shadow: none;
}

.parent-bar.shelfquest-bottom-nav button img {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 4px 6px rgba(36, 48, 68, 0.12));
}

.parent-bar.shelfquest-bottom-nav button.active,
.parent-bar.shelfquest-bottom-nav button.centered {
  background: #fff8e7;
  color: var(--green-dark);
  box-shadow: inset 0 0 0 2px rgba(227, 6, 19, 0.15), 0 8px 16px rgba(36, 48, 68, 0.08);
}

.parent-bar.shelfquest-bottom-nav .floating-scan-button {
  min-height: 68px;
  margin-top: -22px;
  border: 4px solid #ffffff;
  border-radius: 26px;
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
}

.parent-bar.shelfquest-bottom-nav .floating-scan-button.active,
.parent-bar.shelfquest-bottom-nav .floating-scan-button.centered {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 44%),
    linear-gradient(180deg, var(--green-primary), var(--green-dark));
  color: #ffffff;
  box-shadow: 0 14px 24px rgba(227, 6, 19, 0.26);
  outline: 3px solid rgba(255, 194, 71, 0.55);
}

.parent-bar.shelfquest-bottom-nav .floating-scan-button img {
  width: 32px;
  height: 32px;
}

body.login-active .parent-bar.shelfquest-bottom-nav {
  display: none;
}

.toast {
  border: 3px solid #ffffff;
  border-radius: 18px;
  background: var(--text-primary);
  box-shadow: 0 14px 26px rgba(36, 48, 68, 0.25);
}

#cameraOverlay {
  background:
    radial-gradient(circle at 50% 42%, rgba(227, 6, 19, 0.24), transparent 32%),
    rgba(18, 24, 38, 0.92);
}

#cameraOverlay .camera-feed,
#cameraOverlay .camera-frame {
  border: 4px solid #ffffff;
  border-radius: 28px;
}

#cameraOverlayCancel {
  border: 3px solid #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

/* ── New World retail skin ───────────────────────────────── */

:root,
:root[data-theme="new-world"] {
  --brand-primary: #e30613;
  --brand-primary-pressed: #b80016;
  --brand-secondary: #006b3f;
  --brand-secondary-soft: #e6f4ec;
  --brand-background: #fff8ef;
  --brand-surface: #ffffff;
  --brand-surface-alt: #fff1e8;
  --brand-text-primary: #1f1f1f;
  --brand-text-secondary: #5b5550;
  --brand-border: #e7e2da;
  --brand-warning: #f9b233;
  --brand-success: #006b3f;
  --brand-danger: #b80016;
  --brand-focus: rgba(227, 6, 19, 0.34);
  --brand-primary-soft: #fff1e8;
  --brand-primary-mist: #ffe3de;
  --fresh-accent: var(--brand-secondary);
  --fresh-soft: var(--brand-secondary-soft);
  --route-line: var(--brand-primary);
  --scanner-frame: var(--brand-primary);
  --reward-gold: var(--brand-warning);
  --bg: var(--brand-background);
  --surface: var(--brand-surface);
  --ink: var(--brand-text-primary);
  --muted: var(--brand-text-secondary);
  --line: var(--brand-border);
  --green-primary: var(--brand-primary);
  --green-dark: var(--brand-primary-pressed);
  --green: var(--brand-primary);
  --blue-primary: var(--brand-primary);
  --blue: var(--brand-primary-pressed);
  --yellow-reward: var(--brand-warning);
  --orange-accent: var(--brand-primary);
  --coral-warning: var(--brand-danger);
  --purple-quest: var(--brand-primary-pressed);
  --pink-badge: var(--brand-primary);
  --background: var(--brand-background);
  --warm-background: var(--brand-background);
  --card: var(--brand-surface);
  --cream-card: var(--brand-surface-alt);
  --text-primary: var(--brand-text-primary);
  --text-secondary: var(--brand-text-secondary);
  --success: var(--brand-success);
  --border-soft: var(--brand-border);
  --sticker-line: rgba(231, 226, 218, 0.96);
  --shadow: 0 18px 36px rgba(31, 31, 31, 0.13);
  --soft-shadow: 0 10px 24px rgba(31, 31, 31, 0.1);
  --sticker-shadow: 0 1px 0 rgba(255, 255, 255, 0.92), 0 12px 26px rgba(31, 31, 31, 0.1);
  font-family: "Nunito", "Arial Rounded MT Bold", "Segoe UI", system-ui, sans-serif;
}

body {
  background:
    radial-gradient(circle at 16% 8%, rgba(249, 178, 51, 0.18) 0 24px, transparent 25px),
    radial-gradient(circle at 92% 10%, rgba(227, 6, 19, 0.1) 0 34px, transparent 35px),
    linear-gradient(180deg, var(--brand-background) 0%, #fffdf9 56%, var(--brand-surface-alt) 100%);
  color: var(--brand-text-primary);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.suggestion-row:focus-visible,
.add-choice-card:focus-visible {
  outline-color: var(--brand-focus);
}

.app-shell {
  background:
    linear-gradient(180deg, rgba(255, 248, 239, 0.96), rgba(255, 255, 255, 0.98)),
    var(--brand-background);
  box-shadow: 0 20px 56px rgba(31, 31, 31, 0.17);
}

.topbar {
  background:
    linear-gradient(90deg, var(--brand-primary) 0 5px, transparent 5px),
    radial-gradient(circle at right 20px top 18px, rgba(0, 107, 63, 0.13) 0 12px, transparent 13px),
    linear-gradient(135deg, var(--brand-surface) 0%, var(--brand-background) 58%, var(--brand-surface-alt) 100%);
  border-bottom: 1px solid var(--brand-border);
}

.brand-lockup .brand-mark {
  filter: drop-shadow(0 5px 8px rgba(31, 31, 31, 0.1));
}

.brand-lockup h1,
h2,
.objective-title,
.item-name,
.store-card-title,
.recipe-card-main strong,
.trophy-card strong,
.trophy-feature-card strong,
.sticker-collection-card strong {
  color: var(--brand-text-primary);
}

.header-microcopy,
.store-status-strip span:nth-child(4),
.product-location-chip,
.map-log-entry strong {
  color: var(--fresh-accent);
}

.eyebrow,
.step-label,
.recipe-controls label,
.freestyle-panel > label,
.hunt-target-field span,
.trophy-section h3,
.variant-panel summary {
  color: var(--brand-primary-pressed);
}

.copy,
.objective-meta,
.route-step,
.result-detail,
.store-card-meta,
.store-card-status,
.recipe-card-main small,
.ingredient-row small,
.trophy-card small,
.product-card-meta,
.custom-map-point-meta {
  color: var(--brand-text-secondary);
}

.shelf-card,
.feature-tile,
.store-card,
.recipe-card,
.recipe-detail-card,
.trophy-card,
.trophy-feature-card,
.camera-panel,
.objective-panel,
.result-panel,
.route-panel,
.empty-list,
.product-card,
.variant-chip,
.recipe-empty-card,
.add-choice-card,
.suggestion-row {
  border-color: var(--brand-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 239, 0.72)),
    var(--brand-surface);
  box-shadow: var(--sticker-shadow);
}

.store-welcome-card {
  background:
    url("/prototype/assets/decorations/star-gold.png") right 12px top 12px / 24px 24px no-repeat,
    linear-gradient(135deg, #ffffff 0%, var(--brand-background) 56%, var(--fresh-soft) 100%);
}

.quest-teaser-card,
.objective-panel,
.route-panel,
.shopping-list-card,
.recipe-detail-card,
.trophy-card,
.recipe-card {
  background:
    url("/prototype/assets/decorations/sparkle-small.png") right 16px top 16px / 20px 20px no-repeat,
    linear-gradient(135deg, #ffffff 0%, var(--brand-background) 58%, var(--brand-surface-alt) 100%);
}

.store-status-strip span,
.history-strip,
.icon-button,
.user-chip {
  border-color: var(--brand-border);
  background: rgba(255, 255, 255, 0.94);
  color: var(--brand-text-primary);
}

.history-strip {
  border-bottom-color: rgba(184, 0, 22, 0.16);
}

.history-strip-greeting,
.history-stat strong {
  color: var(--brand-primary-pressed);
}

.store-badge,
.reward-badge,
.aisle-badge,
.you-are-here-badge,
.next-stop-badge,
.recipe-badge,
.dietary-badge {
  border-color: #ffffff;
  background: var(--brand-primary-mist);
  color: var(--brand-primary-pressed);
}

.primary-button,
.primary-quest-button,
.success-button,
.icon-submit,
.variant-chip-add,
.floating-scan-button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 48%),
    linear-gradient(180deg, var(--brand-primary), var(--brand-primary-pressed));
  color: #ffffff;
}

.primary-button:active,
.primary-quest-button:active,
.floating-scan-button:active {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 48%),
    var(--brand-primary-pressed);
}

.secondary-button {
  border-color: rgba(184, 0, 22, 0.32);
  background: linear-gradient(180deg, #ffffff, var(--brand-background));
  color: var(--brand-primary-pressed);
}

.secondary-button.danger-button,
.warning-soft-button,
.icon-button.danger,
.item-icon-button.danger {
  border-color: rgba(184, 0, 22, 0.38);
  background: var(--brand-primary-soft);
  color: var(--brand-danger);
}

.feature-tile,
.add-choice-card span,
.suggestion-row strong {
  color: var(--brand-primary-pressed);
}

.store-card.selected,
.recipe-card.selected,
.role.selected,
.shopping-item.selected {
  border-color: rgba(227, 6, 19, 0.58);
  background:
    linear-gradient(135deg, var(--brand-primary-soft), #ffffff 58%, var(--brand-background));
  outline: 3px solid rgba(227, 6, 19, 0.16);
}

.shopping-item {
  border-color: var(--brand-border);
  background: var(--brand-background);
}

.shopping-item.checked {
  background: var(--fresh-soft);
}

.item-select-wrap input,
.ingredient-row input {
  accent-color: var(--brand-primary);
}

.item-check {
  background: linear-gradient(180deg, #ffffff, var(--fresh-soft));
  color: var(--fresh-accent);
}

.item-chip.ready,
.product-location-chip,
.mapping-suggestions span,
.map-point.high {
  background: var(--fresh-soft);
  color: var(--fresh-accent);
}

.item-chip.source,
.item-chip.brand,
.suggestion-row em,
.recipe-meta-grid span {
  background: var(--brand-primary-soft);
  color: var(--brand-primary-pressed);
}

.item-chip.pending,
.reward-earned,
.recipe-mastery-card {
  background: #fff6df;
  color: #6b3f00;
}

.camera-panel {
  background:
    radial-gradient(circle at 50% 44%, rgba(227, 6, 19, 0.12), transparent 46%),
    linear-gradient(180deg, #ffffff, var(--brand-surface-alt));
}

.scan-instruction-pill,
.camera-panel p {
  color: var(--brand-primary-pressed);
}

.camera-frame {
  background:
    linear-gradient(rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.16)),
    repeating-linear-gradient(90deg, rgba(227, 6, 19, 0.12) 0 2px, transparent 2px 28px),
    repeating-linear-gradient(0deg, rgba(227, 6, 19, 0.12) 0 2px, transparent 2px 28px),
    var(--brand-primary-soft);
}

.camera-frame::before {
  background:
    linear-gradient(var(--scanner-frame), var(--scanner-frame)) left top / 54px 5px no-repeat,
    linear-gradient(var(--scanner-frame), var(--scanner-frame)) left top / 5px 54px no-repeat,
    linear-gradient(var(--scanner-frame), var(--scanner-frame)) right top / 54px 5px no-repeat,
    linear-gradient(var(--scanner-frame), var(--scanner-frame)) right top / 5px 54px no-repeat,
    linear-gradient(var(--scanner-frame), var(--scanner-frame)) left bottom / 54px 5px no-repeat,
    linear-gradient(var(--scanner-frame), var(--scanner-frame)) left bottom / 5px 54px no-repeat,
    linear-gradient(var(--scanner-frame), var(--scanner-frame)) right bottom / 54px 5px no-repeat,
    linear-gradient(var(--scanner-frame), var(--scanner-frame)) right bottom / 5px 54px no-repeat;
  filter: drop-shadow(0 0 10px rgba(227, 6, 19, 0.28));
}

.camera-frame span {
  background: rgba(227, 6, 19, 0.1);
}

#cameraOverlay {
  background:
    radial-gradient(circle at 50% 42%, rgba(227, 6, 19, 0.24), transparent 32%),
    rgba(31, 31, 31, 0.92);
}

.progress-track {
  background: #eadfd8;
}

#progressFill,
.trophy-progress span {
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-pressed));
}

.reward-earned.mission {
  background: var(--brand-primary-soft);
  color: var(--brand-primary-pressed);
}

.result-panel {
  background: linear-gradient(180deg, #ffffff, var(--brand-background));
}

.result-panel.is-success {
  background:
    radial-gradient(circle at right 18px top 18px, rgba(0, 107, 63, 0.12) 0 20px, transparent 21px),
    linear-gradient(180deg, #ffffff, var(--brand-background));
}

.result-panel.is-failure {
  background:
    linear-gradient(180deg, #ffffff, var(--brand-surface-alt));
}

.result-state-chip {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--brand-primary-soft);
  color: var(--brand-primary-pressed);
  font-size: 0.76rem;
  font-weight: 950;
}

.result-state-chip.success {
  background: var(--fresh-soft);
  color: var(--fresh-accent);
}

.recipe-category-pill {
  color: var(--brand-primary-pressed);
}

.recipe-category-pill.selected {
  background: linear-gradient(180deg, var(--brand-primary), var(--brand-primary-pressed));
  color: #ffffff;
}

.recipe-card.selected {
  background: linear-gradient(135deg, var(--brand-primary-soft), #ffffff);
  outline-color: rgba(227, 6, 19, 0.22);
}

.trophy-feature-card {
  background:
    url("/prototype/assets/decorations/sparkle-medium.png") right 14px top 14px / 24px 24px no-repeat,
    linear-gradient(135deg, #fff6df, #ffffff 52%, var(--brand-primary-soft));
}

.sticker-collection-card,
.custom-map-panel,
.safety-shield-card,
.guardian-note-card {
  background: linear-gradient(135deg, #ffffff, var(--brand-background) 58%, var(--fresh-soft));
}

.safety-shield-card strong,
.guardian-note-card span {
  color: var(--brand-primary-pressed);
}

.store-map-svg,
.route-mini-map,
.map-svg {
  border-color: #ffffff;
  background:
    radial-gradient(circle at 10% 15%, rgba(249, 178, 51, 0.18), transparent 12%),
    linear-gradient(#fde7de 1px, transparent 1px),
    linear-gradient(90deg, #fde7de 1px, transparent 1px),
    var(--brand-background);
}

.store-map-svg rect {
  fill: var(--brand-background);
  stroke: #ffffff;
}

.store-map-edges line,
.map-svg line {
  stroke: rgba(91, 85, 80, 0.36);
}

.store-map-route,
.route-mini-map polyline,
.store-map path {
  stroke: var(--route-line);
}

.store-map-target circle,
.route-index {
  background: var(--brand-primary);
  fill: var(--brand-primary);
  color: #ffffff;
  stroke: #ffffff;
}

.store-map-target text {
  fill: #ffffff;
}

.store-map-target.upcoming circle {
  fill: #ffffff;
  stroke: var(--brand-primary);
}

.store-map-target.upcoming text {
  fill: var(--brand-primary-pressed);
}

.store-map-target.completed circle {
  fill: #ffffff;
  stroke: var(--fresh-accent);
}

.store-map-target.completed text {
  fill: var(--fresh-accent);
}

.store-map-highlight circle,
.store-map-highlight.product circle {
  fill: var(--brand-warning);
  stroke: #ffffff;
}

.store-map-highlight.scan circle {
  fill: #ffffff;
  stroke: var(--fresh-accent);
}

.store-map-highlight.scan text {
  fill: var(--fresh-accent);
}

.store-map-highlight text {
  font-size: 3px;
  font-weight: 950;
  text-anchor: middle;
  pointer-events: none;
}

.store-map-node.grocery,
.map-node {
  fill: #7c6f67;
  background: #7c6f67;
}

.store-map-node.produce,
.map-node.entrance,
.map-point.high {
  fill: var(--fresh-accent);
  background: var(--fresh-accent);
}

.store-map-node.dairy {
  fill: #8b6f62;
}

.store-map-node.bakery,
.map-node.clue,
.map-point.medium {
  fill: var(--brand-warning);
  background: var(--brand-warning);
}

.store-map-node.restricted,
.map-point.selected {
  fill: var(--brand-danger);
}

.route-mini-map circle {
  fill: var(--brand-primary);
}

.parent-bar.shelfquest-bottom-nav {
  border-color: rgba(255, 255, 255, 0.96);
  background: rgba(255, 248, 239, 0.96);
}

.parent-bar.shelfquest-bottom-nav button {
  color: var(--brand-text-primary);
}

.parent-bar.shelfquest-bottom-nav button.active,
.parent-bar.shelfquest-bottom-nav button.centered {
  background: var(--brand-primary-soft);
  color: var(--brand-primary-pressed);
  box-shadow: inset 0 0 0 2px rgba(227, 6, 19, 0.15), 0 8px 16px rgba(31, 31, 31, 0.08);
}

.parent-bar.shelfquest-bottom-nav .floating-scan-button {
  background: transparent;
  box-shadow: none;
}

.parent-bar.shelfquest-bottom-nav .floating-scan-button.active,
.parent-bar.shelfquest-bottom-nav .floating-scan-button.centered {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 44%),
    linear-gradient(180deg, var(--brand-primary), var(--brand-primary-pressed));
  color: #ffffff;
  box-shadow: 0 14px 24px rgba(227, 6, 19, 0.26);
  outline-color: rgba(249, 178, 51, 0.72);
}

body.high-contrast {
  --brand-primary: #b80016;
  --brand-primary-pressed: #8f0011;
  --brand-secondary: #005a35;
  --brand-secondary-soft: #ffffff;
  --brand-background: #ffffff;
  --brand-surface: #ffffff;
  --brand-surface-alt: #ffffff;
  --brand-text-primary: #050505;
  --brand-text-secondary: #222222;
  --brand-border: #111111;
  --brand-warning: #8a5400;
  --brand-success: #005a35;
  --brand-danger: #8f0011;
  --shadow: none;
}

@keyframes scanPulse {
  0%,
  100% {
    transform: scale(0.78);
    opacity: 0.45;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.12;
  }
}

@keyframes mascotWiggle {
  0%,
  100% {
    transform: rotate(-2deg) translateY(0);
  }
  50% {
    transform: rotate(3deg) translateY(-3px);
  }
}

@keyframes routeReveal {
  to {
    stroke-dashoffset: -18;
  }
}

.install-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 0 0 14px;
  padding: 12px;
}

.install-card[hidden] {
  display: none;
}

.install-card > img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.install-card-copy {
  min-width: 0;
}

.install-card-copy strong {
  display: block;
  margin-bottom: 4px;
  color: var(--brand-text-primary);
  font-weight: 950;
  line-height: 1.18;
}

.install-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, 0.58fr);
  gap: 8px;
  margin-top: 10px;
}

.install-actions .secondary-button,
.install-actions .primary-button {
  margin-top: 0;
  min-height: 46px;
  padding-inline: 10px;
  line-height: 1.12;
}

.shopping-item {
  grid-template-columns: 30px 46px minmax(0, 1fr);
  grid-template-areas:
    "select icon main"
    "select icon actions";
  align-items: center;
  gap: 8px 10px;
}

.item-select-wrap {
  grid-area: select;
}

.shopping-item-icon {
  grid-area: icon;
}

.item-main {
  grid-area: main;
  min-width: 0;
}

.item-name,
.product-card-name,
.product-card-meta,
.result-detail,
.objective-meta,
.route-step {
  overflow-wrap: break-word;
  word-break: normal;
}

.item-actions {
  grid-area: actions;
  display: grid;
  grid-template-columns: minmax(74px, 1fr) 54px 44px;
  gap: 8px;
  min-width: 0;
}

.item-actions .item-check,
.item-actions .item-icon-button {
  min-width: 0;
  margin: 0;
}

.scan-choice-actions {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.scan-choice-button,
.action-button span,
.parent-bar.shelfquest-bottom-nav button span,
.brand-lockup h1 {
  overflow-wrap: normal;
  word-break: normal;
}

.store-map-visual {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #fff8e7;
}

.store-map-visual.has-art {
  aspect-ratio: 1536 / 1024;
  border: 3px solid #ffffff;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.54), var(--soft-shadow);
}

.store-map-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-map-visual.has-art .store-map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.store-map-visual.has-art .store-map-svg rect,
.store-map-visual.has-art .store-map-edges {
  display: none;
}

.store-map-visual.has-art .store-map-route {
  stroke: var(--brand-primary);
  stroke-width: 2.35;
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.95));
}

.store-map-visual.has-art .store-map-node {
  opacity: 0;
}

.store-map-visual.has-art .store-map-target circle,
.store-map-visual.has-art .store-map-highlight circle {
  stroke-width: 1.8;
  filter: drop-shadow(0 1px 2px rgba(31, 31, 31, 0.28));
}

.store-map-visual.has-art .store-map-highlight.scan circle {
  fill: #ffffff;
  stroke: var(--brand-secondary);
}

@media (min-width: 430px) {
  .shopping-item {
    grid-template-columns: 30px 46px minmax(0, 1fr) minmax(164px, auto);
    grid-template-areas: "select icon main actions";
  }

  .item-actions {
    grid-template-columns: 58px 54px 44px;
  }
}

@media (max-width: 390px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .toolbar {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
  }

  .user-chip {
    flex: 1 1 auto;
    max-width: calc(100% - 104px);
  }

  .user-chip-email {
    max-width: 100%;
  }

  .screen {
    padding-inline: 12px;
  }

  .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-primary-actions {
    grid-template-columns: 1fr;
  }

  .install-card {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .install-card > img {
    width: 48px;
    height: 48px;
  }

  .install-actions,
  .scan-choice-actions {
    grid-template-columns: 1fr;
  }

  .shopping-item {
    grid-template-columns: 26px 40px minmax(0, 1fr);
    padding-inline: 7px;
  }

  .shopping-item-icon {
    width: 38px;
    height: 38px;
  }

  .item-actions {
    grid-template-columns: minmax(72px, 1fr) 52px 42px;
    gap: 6px;
  }

  .store-welcome-card,
  .quest-teaser-card,
  .trophy-feature-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .trophy-tile-grid {
    grid-template-columns: 1fr;
  }
}

body:not(.login-active):not([data-active-screen="presence"]) .topbar {
  display: none;
}

body:not(.login-active):not([data-active-screen="presence"]) main {
  padding-top: 10px;
}

.store-status-strip button {
  appearance: none;
  border: 1px solid rgba(227, 6, 19, 0.18);
  background: #fff;
  border-radius: 999px;
  color: var(--brand-text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 10px;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 3px 0 rgba(184, 0, 22, 0.08);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.store-status-strip button:active,
.feature-tile:active,
.add-choice-card:active,
.quest-template-card:active,
.catalogue-result:active,
.scan-choice-button:active,
.parent-bar.shelfquest-bottom-nav button:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 1px 0 rgba(184, 0, 22, 0.12);
}

.list-action-row,
.catalogue-actions,
.expanded-map-actions,
.expanded-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.list-action-row {
  margin: 12px 0;
}

.info-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.info-card > img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.plain-steps {
  margin: 12px 0;
  padding-left: 20px;
  color: var(--brand-text-secondary);
  line-height: 1.45;
}

.plain-steps li + li {
  margin-top: 8px;
}

.guardian-ethos-grid,
.quest-template-list {
  display: grid;
  gap: 12px;
}

.quest-settings-card {
  margin-top: 14px;
}

.quest-settings-card summary {
  cursor: pointer;
  font-weight: 900;
}

.quest-template-card {
  width: 100%;
  border: 1px solid rgba(227, 6, 19, 0.16);
  background: linear-gradient(180deg, #fff, #fff8ef);
  border-radius: 12px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  text-align: left;
  color: var(--brand-text-primary);
  box-shadow: 0 5px 0 rgba(184, 0, 22, 0.08);
}

.quest-template-card img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.quest-template-card strong,
.catalogue-result strong {
  display: block;
  overflow-wrap: break-word;
}

.quest-template-card small,
.catalogue-result small {
  color: var(--brand-text-secondary);
  display: block;
  line-height: 1.35;
  margin-top: 3px;
}

.quest-template-card em {
  background: var(--brand-secondary-soft);
  border-radius: 999px;
  color: var(--brand-secondary);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 900;
  padding: 5px 8px;
  white-space: nowrap;
}

.catalogue-search {
  background: #fff;
  border: 1px solid rgba(227, 6, 19, 0.16);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 4px 0 rgba(184, 0, 22, 0.08);
}

.catalogue-search label {
  display: block;
  font-size: 0.78rem;
  font-weight: 900;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.catalogue-layout {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.catalogue-results {
  display: grid;
  gap: 8px;
}

.catalogue-result {
  border: 1px solid rgba(0, 107, 63, 0.16);
  background: #fff;
  border-radius: 10px;
  padding: 11px;
  text-align: left;
  color: var(--brand-text-primary);
}

.catalogue-result.selected {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.12);
}

.product-detail-card h2 {
  margin: 4px 0 8px;
  overflow-wrap: break-word;
}

.expanded-map-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.expanded-map-viewport {
  background: #fff;
  border: 2px solid rgba(227, 6, 19, 0.16);
  border-radius: 12px;
  height: min(68vh, 680px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 10px;
  touch-action: pan-x pan-y;
}

.expanded-map-canvas {
  min-width: 760px;
  transform-origin: top left;
  transition: transform 0.16s ease;
}

.expanded-map-canvas .store-map-visual {
  min-height: 520px;
}

.store-map-visual.floor-layer {
  background:
    linear-gradient(90deg, rgba(0, 107, 63, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(0, 107, 63, 0.08) 1px, transparent 1px),
    #fffdf8;
  background-size: 24px 24px;
}

.store-map-highlight.current circle {
  fill: #0072ce;
  stroke: #fff;
  stroke-width: 1.4;
}

.store-map-highlight.current text {
  fill: #fff;
  font-size: 2.4px;
  font-weight: 900;
  text-anchor: middle;
}

.freestyle-panel {
  scroll-margin-top: 18px;
}

.parent-bar.shelfquest-bottom-nav {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 12px max(8px, env(safe-area-inset-bottom));
  scroll-padding-inline: 42%;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.parent-bar.shelfquest-bottom-nav button {
  flex: 0 0 76px;
  min-width: 76px;
  scroll-snap-align: center;
}

.parent-bar.shelfquest-bottom-nav .floating-scan-button {
  flex-basis: 88px;
  min-width: 88px;
}

@media (min-width: 760px) {
  .catalogue-layout {
    grid-template-columns: minmax(250px, 0.9fr) minmax(320px, 1.1fr);
    align-items: start;
  }

  .guardian-ethos-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .quest-template-card {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .quest-template-card em {
    grid-column: 2;
    justify-self: start;
  }

  .expanded-map-header {
    display: grid;
  }

  .expanded-map-viewport {
    height: 64vh;
  }

  .expanded-map-canvas {
    min-width: 640px;
  }
}

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