/* Aisle — design tokens
   Basil-green tiles you tap in the store, mustard aisle numbers that mirror the store's walking order.
   Atkinson Hyperlegible Next: designed for legibility, which is the job when glancing at a phone with a full basket. */

:root {
  --bg: #e9eee8;
  --surface: #f8faf7;
  --ink: #16261e;
  --ink-2: #4e6158;
  --line: #c9d5cc;
  --tile: #23604a;
  --tile-press: #1b4d3b;
  --tile-ink: #f4faf6;
  --tile-done: #dbe3dd;
  --tile-done-ink: #4e6158;
  --accent: #e9b12a;
  --accent-ink: #2a2004;
  --danger: #b4443c;
  --focus: #2f6fd6;
  --scrim: rgb(14 22 18 / 0.45);
  --toast-link: #e9b12a;

  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-s: 13px;
  --fs-m: 15px;
  --fs-l: 17px;
  --fs-xl: 21px;
  --fs-xxl: 28px;
  --r-tile: 14px;
  --r-ctl: 10px;
  --r-sheet: 22px;
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1612;
    --surface: #17211c;
    --ink: #e4ece7;
    --ink-2: #9db0a6;
    --line: #2a3832;
    --tile: #2c7558;
    --tile-press: #24644a;
    --tile-ink: #f2faf5;
    --tile-done: #1d2823;
    --tile-done-ink: #9db0a6;
    --accent: #e9b12a;
    --accent-ink: #231a02;
    --danger: #e0756c;
    --focus: #7fb0ff;
    --scrim: rgb(0 0 0 / 0.6);
    --toast-link: #1b4d3b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1612;
  --surface: #17211c;
  --ink: #e4ece7;
  --ink-2: #9db0a6;
  --line: #2a3832;
  --tile: #2c7558;
  --tile-press: #24644a;
  --tile-ink: #f2faf5;
  --tile-done: #1d2823;
  --tile-done-ink: #9db0a6;
  --accent: #e9b12a;
  --accent-ink: #231a02;
  --danger: #e0756c;
  --focus: #7fb0ff;
  --scrim: rgb(0 0 0 / 0.6);
  --toast-link: #1b4d3b;
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}
html.locked {
  overflow: hidden;
}
body {
  font: 400 var(--fs-m) / 1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.ic {
  flex: none;
}
.muted {
  color: var(--ink-2);
}
.hint {
  color: var(--ink-2);
  font-size: var(--fs-s);
  margin: 12px 0;
}
.hint.center {
  text-align: center;
  margin: 28px 24px 8px;
}

/* ------------------------------------------------------------------ frame */
.app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
.sticky,
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
}
.sticky .top {
  position: static;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 8px;
  min-height: 56px;
}
.top-right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.page-title {
  font-size: var(--fs-xl);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
}
.page {
  padding: 4px var(--gutter) 24px;
}

.view-switch {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
  padding: 6px 4px;
  margin-left: -4px;
  min-width: 0;
  font-size: var(--fs-xl);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.vs-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c, var(--ink-2));
  flex: none;
  display: inline-block;
}
.dot.sm {
  width: 8px;
  height: 8px;
  vertical-align: 1px;
  margin: 0 4px 0 2px;
}
.dot-all {
  background: conic-gradient(#c98a12 0 33%, #2e7d5b 0 66%, #3b6ea8 0);
}
.store-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  max-width: 36vw;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: var(--fs-s);
  font-weight: 600;
}
.store-chip span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.store-chip .ic {
  width: 18px;
  height: 18px;
}

.sync {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  min-width: 28px;
  justify-content: center;
  border: 0;
  background: none;
  font-size: var(--fs-s);
  color: var(--ink-2);
  padding: 0 4px;
}
.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tile);
}
.sync[data-state="busy"] .sync-dot {
  background: var(--ink-2);
  animation: pulse 1s ease-in-out infinite alternate;
}
.sync[data-state="warn"] .sync-dot {
  background: var(--accent);
}
.sync[data-state="bad"] .sync-dot {
  background: var(--danger);
}
.sync[data-state="ok"] .sync-dot {
  opacity: 0.55;
}
@keyframes pulse {
  to {
    opacity: 0.25;
  }
}

/* ------------------------------------------------------------------ add bar */
.addbar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 var(--gutter) 10px;
  padding: 0 6px 0 12px;
  min-height: 50px;
  border-radius: 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
}
.addbar:focus-within {
  border-color: var(--tile);
}
.add-ico {
  color: var(--tile);
  display: flex;
}
.addbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  padding: 12px 6px;
  font-size: var(--fs-l);
  outline: none;
}
.addbar input::placeholder {
  color: var(--ink-2);
}
.target {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 38%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--bg);
  font-size: var(--fs-s);
  font-weight: 600;
}
.target-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-2);
  flex: none;
}

/* ------------------------------------------------------------------ board */
.board {
  padding: 0 var(--gutter) 16px;
}
.sec {
  margin: 14px 0 18px;
}
.aisle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: var(--fs-l);
  font-weight: 700;
  line-height: 1.2;
}
.aisle-no {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--fs-m);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -3px 0 var(--lc, transparent);
  flex: none;
}
.aisle-name {
  flex: 1;
  min-width: 0;
}
.aisle-count {
  font-size: var(--fs-s);
  font-weight: 600;
  color: var(--ink-2);
}
.sec-plain {
  font-size: var(--fs-m);
  font-weight: 700;
  margin: 4px 0 10px;
  color: var(--ink-2);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 100px;
  padding: 10px 6px 12px;
  border: 0;
  border-radius: var(--r-tile);
  background: var(--tile);
  color: var(--tile-ink);
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  transition: transform 0.12s ease, background-color 0.2s ease;
}
.tile:active {
  transform: scale(0.96);
  background: var(--tile-press);
}
.t-ico {
  font-size: 30px;
  line-height: 1.1;
  height: 36px;
  display: grid;
  place-items: center;
}
.t-letter {
  width: 36px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.16);
  font-size: var(--fs-l);
  font-weight: 800;
}
.t-name {
  font-size: var(--fs-m);
  font-weight: 700;
  line-height: 1.15;
  max-width: 100%;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.t-name.long {
  font-size: 13.5px;
}
.t-spec {
  font-size: 12.5px;
  line-height: 1.2;
  opacity: 0.88;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.t-lists {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 5px;
  display: flex;
  justify-content: center;
  gap: 3px;
}
.t-lists i {
  height: 3px;
  width: 14px;
  border-radius: 2px;
  background: var(--c);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.35);
}
.t-rec {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
}
.t-rec .ic {
  width: 14px;
  height: 14px;
}
.tile.done {
  background: var(--tile-done);
  color: var(--tile-done-ink);
}
.tile.done .t-ico {
  filter: saturate(0.35);
  opacity: 0.8;
}
.tile.done:active {
  background: var(--line);
}
.tile.flash {
  animation: flash 1.1s ease-out;
}
@keyframes flash {
  0% {
    box-shadow: 0 0 0 0 var(--accent);
    transform: scale(1.06);
  }
  40% {
    box-shadow: 0 0 0 5px var(--accent);
    transform: scale(1);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}
.tile-sug {
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.tile-sug.on {
  border-style: dashed;
  color: var(--ink-2);
}
.tile-sug:active {
  background: var(--tile-done);
}
.tile-new {
  background: var(--accent);
  color: var(--accent-ink);
}
.tile-new:active {
  background: var(--accent);
  filter: brightness(0.95);
}
.tile-sug .t-letter,
.tile-new .t-letter {
  background: rgb(0 0 0 / 0.07);
}

.recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 26px 0 10px;
}
.disclose {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  padding: 6px 0;
  font-size: var(--fs-l);
  font-weight: 700;
  color: var(--ink-2);
}
.disclose .ic {
  transition: transform 0.2s ease;
  transform: rotate(-90deg);
}
.disclose[aria-expanded="true"] .ic {
  transform: none;
}
.link {
  border: 0;
  background: none;
  padding: 8px 4px;
  color: var(--tile);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

.recipes {
  margin: 6px 0 4px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 10px;
}
.recipes-title {
  font-size: var(--fs-s);
  font-weight: 700;
  color: var(--ink-2);
  flex: none;
}
.recipes-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
.recipe-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 3px 14px 3px 3px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: var(--fs-s);
  font-weight: 600;
  white-space: nowrap;
}
.recipe-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.rc-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--tile-done);
  display: grid;
  place-items: center;
}
.rc-img.rc-missing {
  visibility: hidden;
  width: 8px;
}
.recipe-filter {
  margin: 8px var(--gutter) 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  font-size: var(--fs-s);
  color: var(--ink-2);
}
.board > .recipes {
  padding: 0;
}
.board > .recipe-filter {
  margin-left: 0;
  margin-right: 0;
}

.empty {
  text-align: center;
  padding: 48px 20px 24px;
  color: var(--ink-2);
}
.empty-title {
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 6px;
}
.empty p {
  margin: 0 auto 16px;
  max-width: 34ch;
}

/* ------------------------------------------------------------------ rows */
.rows {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 14px;
  background: var(--surface);
}
.row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border: 0;
  background: none;
  text-align: left;
}
.row-main .t-ico {
  font-size: 26px;
  width: 36px;
  flex: none;
}
.row-main .t-letter {
  background: var(--tile-done);
  height: 36px;
}
.row-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.row-title {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-sub {
  font-size: var(--fs-s);
  color: var(--ink-2);
}
.row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 6px;
}
.row-list {
  font-size: var(--fs-s);
  color: var(--ink-2);
  white-space: nowrap;
}
.row-main .row-title {
  white-space: normal;
}
.count {
  font-size: var(--fs-s);
  font-weight: 700;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.swatch {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--c);
  flex: none;
  border: 0;
  padding: 0;
}
.swatch.big {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}
.swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink);
}
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 6px 2px;
}
.pill {
  flex: none;
  font-size: 12.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--tile-done);
  color: var(--ink-2);
  white-space: nowrap;
}
.pill[data-tone="due"] {
  background: var(--accent);
  color: var(--accent-ink);
}
.pill[data-tone="on"] {
  background: var(--tile);
  color: var(--tile-ink);
}
.pill[data-tone="paused"] {
  background: none;
  border: 1px dashed var(--line);
}

/* ------------------------------------------------------------------ buttons, chips, fields */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--surface);
  font-weight: 700;
}
.btn.small {
  min-height: 36px;
  padding: 0 12px;
  font-size: var(--fs-s);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.ghost {
  background: none;
  border-color: transparent;
}
.btn.danger {
  color: var(--danger);
}
.btn.danger-fill {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn.wide {
  width: 100%;
}
.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0 12px;
}
.chips.wrap {
  flex-wrap: wrap;
  overflow: visible;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 38px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: var(--fs-s);
  font-weight: 600;
  white-space: nowrap;
}
.chip[aria-pressed="true"],
.chip[aria-checked="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  border-radius: 12px;
  background: var(--tile-done);
}
.seg button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: none;
  font-weight: 600;
  font-size: var(--fs-s);
}
.seg button[aria-checked="true"] {
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 14px;
  border: 0;
  padding: 0;
  min-width: 0;
}
.field > span:first-child,
.field > legend {
  font-size: var(--fs-s);
  font-weight: 700;
  color: var(--ink-2);
  padding: 0;
  margin-bottom: 6px;
}
.field input,
.field select,
.field-row input,
.field-row select,
.entry-row select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--surface);
}
.field input:focus,
.field select:focus {
  border-color: var(--tile);
  outline: none;
}
.field small {
  color: var(--ink-2);
  font-size: var(--fs-s);
}
.field.inline {
  margin: 0;
  flex: 1;
}
.field-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.field-row > * {
  flex: 1;
  min-width: 0;
}
.field-row .btn {
  flex: none;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 600;
}
.check input {
  width: 22px;
  height: 22px;
  accent-color: var(--tile);
}
.form-error {
  color: var(--danger);
  font-weight: 600;
  margin: 0 0 12px;
}
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin: 0 0 14px;
  font-size: var(--fs-s);
}
.facts dt {
  color: var(--ink-2);
}
.facts dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.facts .bad {
  color: var(--danger);
}
.group {
  margin: 8px 0 30px;
}
.group-title {
  font-size: var(--fs-l);
  font-weight: 800;
  margin: 0 0 6px;
}

/* ------------------------------------------------------------------ store layout editor */
.store-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.store-name {
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 800;
}
.store-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sort-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sort-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 4px 0 12px;
  border-radius: 12px;
  background: var(--surface);
  position: relative;
}
.sort-row.dragging {
  z-index: 2;
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.18);
  transition: none;
}
.sort-name {
  flex: 1;
  font-weight: 700;
}
.grip {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: var(--ink-2);
  touch-action: none;
  cursor: grab;
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

/* ------------------------------------------------------------------ bottom nav, toasts */
.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  justify-content: center;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1;
  max-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0 9px;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}
.tab[aria-current="page"] {
  color: var(--ink);
}
.tab[aria-current="page"] .ic {
  color: var(--tile);
}
.toasts {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(70px + env(safe-area-inset-bottom));
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 var(--gutter);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 560px;
  width: fit-content;
  min-height: 46px;
  padding: 6px 8px 6px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  font-size: var(--fs-s);
  animation: rise 0.18s ease-out;
}
.toast[data-kind="error"] {
  background: var(--danger);
  color: #fff;
}
.toast .link {
  color: var(--toast-link);
}
.toast[data-kind="error"] .link {
  color: #fff;
}
@keyframes rise {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

/* ------------------------------------------------------------------ sheets */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: var(--scrim);
  animation: fade 0.18s ease-out;
}
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
  max-width: 640px;
  margin: 0 auto;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  animation: slide 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-grab {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  margin: 8px auto 0;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px 4px var(--gutter);
}
.sheet-head h2 {
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 800;
  line-height: 1.25;
}
.sheet-body {
  overflow-y: auto;
  padding: 6px var(--gutter) 18px;
  overscroll-behavior: contain;
}
.sheet .field input,
.sheet .field select,
.sheet .entry-row select {
  background: var(--bg);
}
.sheet-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}
.sheet-actions .btn {
  flex: 1;
}
.sheet-actions .btn.ghost {
  flex: 0 1 auto;
}
@keyframes slide {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.choices {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 6px 12px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: none;
  text-align: left;
}
.choice[aria-checked="true"] {
  border-color: var(--tile);
  background: var(--bg);
}
.item-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.item-hero .t-ico {
  font-size: 40px;
  height: 48px;
  width: 48px;
}
.item-hero .t-letter {
  background: var(--tile);
  color: var(--tile-ink);
}
.item-hero p {
  margin: 0;
}
.entry {
  padding: 12px 0 2px;
  border-top: 1px solid var(--line);
}
.entry-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 10px;
}
.entry-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.stepper {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--bg);
}
.stepper .icon-btn {
  border-radius: 8px;
  color: var(--ink);
  height: 44px;
  width: 44px;
}
.stepper .qty {
  width: 56px;
  text-align: center;
  border: 0;
  background: none;
  font-weight: 700;
  font-size: var(--fs-l);
  min-height: 44px;
}
.sub-title {
  font-size: var(--fs-m);
  font-weight: 800;
  margin: 14px 0 8px;
}

/* ------------------------------------------------------------------ login */
.login {
  max-width: 420px;
  margin: 0 auto;
  padding: calc(48px + env(safe-area-inset-top)) 24px 40px;
}
.login-mark {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}
.aisle-no.big {
  min-width: 40px;
  height: 40px;
  font-size: var(--fs-xl);
  border-radius: 9px;
}
.login-mark .aisle-no:nth-child(2) {
  background: var(--tile);
  color: var(--tile-ink);
}
.login-mark .aisle-no:nth-child(3) {
  background: var(--ink);
  color: var(--bg);
}
.login-title {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 10px;
}
.login-lede {
  font-size: var(--fs-l);
  color: var(--ink-2);
  margin: 0 0 28px;
  max-width: 30ch;
}
.login-form .link {
  display: block;
  margin: 12px auto 0;
}
.login-demo {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
}
.login-demo p {
  margin: 0 0 12px;
}
.notice-inline {
  padding: 10px 12px;
  border-radius: var(--r-ctl);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

@media (min-width: 560px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  }
  .tile {
    min-height: 112px;
  }
}

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