:root {
  --paper: #f7f4ef;
  --card: #fffdfb;
  --ink: #1c1915;
  --muted: #746e66;
  --line: #e6e0d6;
  --accent: #c4481a;
  --accent-dark: #9a3412;
  --soft: #fde8dc;
  --warn: #8a4b08;
  --warn-soft: #fff1d6;
  --bad: #9f2218;
  --bad-soft: #fde8e6;
  --sand: #efeae2;
  --shadow: 0 1px 2px rgba(40, 30, 20, 0.04), 0 10px 28px rgba(40, 30, 20, 0.05);
  --safe-top: env(safe-area-inset-top);
  --safe-bot: env(safe-area-inset-bottom);
  color: var(--ink);
  font-family: Outfit, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.4;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background: #e7e1d6;
  color: var(--ink);
  overscroll-behavior-y: contain;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

.desk-mark {
  display: none;
}

.app {
  width: min(480px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  position: relative;
}

main {
  padding-bottom: calc(108px + var(--safe-bot));
}

h1, h2, p { margin: 0; }
h1 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 560;
  font-size: 34px;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
h2 {
  font-size: 15px;
  font-weight: 650;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pad { padding: 18px 16px 0; }
.section { padding: 22px 16px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.section-head button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  padding: 0;
}

.hero { padding: calc(18px + var(--safe-top)) 16px 0; }
.hero h1 { margin-top: 4px; }

body.signed-out .tabs,
body.signed-out #dock { display: none; }
body.signed-out main { padding-bottom: 28px; }

.gate-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(24px + var(--safe-top)) 16px 32px;
  background:
    radial-gradient(circle at 12% 0%, #fde8dc 0, transparent 46%),
    var(--paper);
}
.gate {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(28, 25, 21, 0.06);
}
.gate h1 { margin: 8px 0 6px; font-size: 36px; }
.gate .hint { margin-bottom: 8px; }
.form-error {
  margin: 0;
  color: #9a3412;
  font-weight: 700;
  min-height: 0;
}
.form-error:empty { display: none; }
.notice {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--accent-dark);
  font-weight: 650;
  line-height: 1.4;
}
.portal-open {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.portal-open summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent-dark);
}
.portal-links { margin: 10px 0 0; }
.portal-links .linkish {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.demo-row {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.impluse-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: calc(12px + var(--safe-top)) 16px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--soft);
  color: var(--accent-dark);
  font-weight: 650;
}
.impluse-bar .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.danger {
  background: #9a3412;
  border-color: #9a3412;
  color: #fff;
}
.btn.danger:hover { background: #7c2d12; }
.panel-page { padding: 0 0 28px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 8px; margin: 16px; }
.table-wrap { overflow-x: auto; }
.list-table { width: 100%; border-collapse: collapse; }
.list-table th, .list-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.list-table th { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.list-table .num { text-align: right; }
.list-table .actions.tight { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.list-table .hint { margin: 4px 0 0; font-size: 12px; color: var(--muted); font-weight: 500; }
.badge.ok { background: #e7f6ec; color: #17663a; }
.facts { display: grid; gap: 10px; margin-top: 18px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--sand); }
.access-steps { margin: 8px 0 0; padding-left: 18px; color: var(--muted); line-height: 1.55; }
body.platform .side-brand small { color: var(--accent-dark); }

.home-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: calc(18px + var(--safe-top)) 16px 0;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand h1 { font-size: 28px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { display: block; border-radius: 25%; flex: 0 0 auto; }
.who { display: flex; align-items: center; gap: 10px; text-align: right; }
.who b { display: block; font-size: 14px; }
.who .btn { min-height: 36px; white-space: nowrap; }
.who span {
  display: inline-block;
  margin-top: 4px;
  background: var(--soft);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pulse {
  margin: 16px 16px 0;
  padding: 18px 18px 16px;
  border-radius: 22px;
  background: var(--ink);
  color: #f7f4ef;
  box-shadow: var(--shadow);
}
.pulse p { color: #d9d0c5; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.pulse b {
  display: block;
  margin-top: 4px;
  font-family: Fraunces, Georgia, serif;
  font-size: 36px;
  font-weight: 560;
  letter-spacing: -0.04em;
}
.pulse em { font-style: normal; color: #fff; font-weight: 600; }
.home-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 16px 0;
}
.home-metrics .pulse { grid-column: 1 / -1; margin: 0; }
.home-metrics .metric-wide { display: none; }
.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 16px 0;
}
.tile {
  min-height: 86px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
  padding: 14px;
}
.tile strong { display: block; font-size: 16px; }
.tile span { color: var(--muted); font-size: 12px; }
.tile.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.tile.accent span { color: #ffe8df; }
.tile:active { transform: scale(0.98); }

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px 16px 0;
}
.stat {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.stat b {
  display: block;
  font-size: 28px;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.stat span { color: var(--muted); font-size: 13px; }
.stat.wide {
  grid-column: 1 / -1;
  background: var(--ink);
  color: #f7f4ef;
  border-color: var(--ink);
}
.stat.wide span { color: #d9d0c5; }
.stat.wide em {
  font-style: normal;
  display: block;
  margin-top: 8px;
  color: #fff;
  font-weight: 600;
}

.actions {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
  padding: 12px 16px 0;
}

.btn {
  border: 0;
  border-radius: 14px;
  min-height: 48px;
  padding: 12px 14px;
  font-weight: 700;
  background: var(--card);
  border: 1px solid var(--line);
}
.btn:active { transform: scale(0.98); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:active { background: var(--accent-dark); }
.btn.small { min-height: 40px; padding: 8px 12px; border-radius: 12px; }
.btn.full { width: 100%; }
.btn.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--bad);
}
.btn:disabled { opacity: 0.45; }

.block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.low-row, .move-row, .sale-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  width: 100%;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  text-align: left;
}
.block > :first-child { border-top: 0; }
.low-main, .sale-row {
  flex: 1;
  min-width: 0;
}
.low-main {
  display: flex;
  flex-direction: column;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
  min-height: 44px;
  justify-content: center;
}
.low-main strong, .row-text strong, .move-row strong {
  font-weight: 650;
}
.move-row strong, .move-row em { display: block; }
.low-main em, .row-text em, .move-row em, .sale-row em {
  font-style: normal;
  color: var(--muted);
  font-size: 13px;
}
.sale-row {
  justify-content: space-between;
}
.sale-row span:last-child { font-weight: 700; white-space: nowrap; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 10px 12px;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--card);
  text-align: left;
}
.row:first-child { border-top: 0; }
.row:active { background: #f6f1ea; }
.row.dim { opacity: 0.55; }
.row-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.part-line { flex-direction: row; align-items: center; gap: 10px; }
.part-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #f7f4ef;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}
.part-mark svg { width: 36px; height: 36px; display: block; }
.part-mark text, .part-hero text { font-family: inherit; }
.made-icon {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
.made-icon strong { display: block; }
.made-icon em { display: block; font-style: normal; color: var(--muted); font-size: 13px; }
.part-hero {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  background: #f7f4ef;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  margin: 0 0 12px;
}
.part-hero svg { width: 72px; height: 72px; }
.row-text strong, .low-main strong { overflow-wrap: anywhere; }

.badge {
  flex: 0 0 auto;
  min-width: 52px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--sand);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.badge.svc { background: var(--sand); color: var(--ink); }
.badge.low { background: var(--warn-soft); color: var(--warn); }
.badge.out { background: var(--bad-soft); color: var(--bad); }

.bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: calc(16px + var(--safe-top)) 16px 0;
}
.bar-actions { display: flex; gap: 8px; }
.bar h1 { font-size: 32px; }
.bar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.bar-title h1 {
  font-size: 26px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-wrap { padding: 14px 16px 0; }
.search, .field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  min-height: 48px;
  padding: 12px 14px;
  outline: none;
}
.search:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: #e0a88f;
  box-shadow: 0 0 0 4px rgba(196, 72, 26, 0.12);
}
.field textarea { min-height: 88px; resize: vertical; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 0;
}
.chip {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  min-height: 36px;
  padding: 6px 12px;
  color: var(--muted);
  font-weight: 650;
}
.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.meta {
  color: var(--muted);
  font-size: 13px;
  padding: 10px 16px 8px;
}

.list {
  margin: 0 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
}

.empty {
  margin: 16px;
  padding: 28px 18px;
  background: var(--card);
  border: 1px dashed #d9cfc3;
  border-radius: 22px;
  text-align: left;
}
.empty h2 {
  font-family: Fraunces, Georgia, serif;
  font-size: 28px;
  font-weight: 560;
  letter-spacing: -0.03em;
  margin: 8px 0;
}
.empty p { color: var(--muted); margin-bottom: 16px; }
.empty .btn { margin-top: 8px; }
.mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent) url("../mark.svg") center / 48px no-repeat;
}

.form { padding: 8px 16px 0; display: grid; gap: 12px; }
.field { display: grid; gap: 6px; font-weight: 650; font-size: 14px; }
.hint { color: var(--muted); font-weight: 500; font-size: 13px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sku-row { display: flex; gap: 8px; }
.sku-row input { flex: 1; }

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.icon-btn svg, .tabs svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.detail { padding: 8px 16px 0; }
.qty-hero {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.qty-hero b {
  font-family: Fraunces, Georgia, serif;
  font-size: 56px;
  letter-spacing: -0.04em;
  line-height: 0.95;
  display: block;
}
.qty-hero b.low { color: var(--warn); }
.qty-hero b.out { color: var(--bad); }
.qty-hero span { color: var(--muted); }
.prices {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.prices div {
  background: var(--sand);
  border-radius: 14px;
  padding: 10px;
}
.prices b { display: block; font-size: 14px; }
.prices span { color: var(--muted); font-size: 12px; }
.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.notes {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  display: flex;
  gap: 4px;
  overflow-x: auto;
  background: rgba(255, 252, 248, 0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 8px 8px calc(8px + var(--safe-bot));
  z-index: 20;
}
.tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 650;
  border-radius: 12px;
  white-space: nowrap;
}
.tabs button.active { color: #fff; background: var(--accent); }
.tabs button.sell { color: var(--accent); }
.sell-bubble {
  width: 46px;
  height: 46px;
  margin-top: -22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(196, 72, 26, 0.32);
}
.tabs button.sell.active .sell-bubble { background: var(--accent-dark); }

body.has-cart main { padding-bottom: calc(176px + var(--safe-bot)); }
.cart-dock {
  position: fixed;
  left: 50%;
  bottom: calc(74px + var(--safe-bot));
  transform: translateX(-50%);
  width: min(480px, 100%);
  z-index: 21;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
  padding: 0 12px;
}
.cart-count {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}
.cart-count b { font-size: 18px; }
.cart-count span { color: var(--muted); font-size: 11px; font-weight: 650; }
.cart-dock .btn { min-height: 52px; }
.cart-line, .bill-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.cart-line:first-child, .bill-line:first-child { border-top: 0; }
.cart-line em, .bill-line em { font-style: normal; color: var(--muted); font-size: 13px; }
.mini-step { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; }
.mini-step button {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--sand);
  font-size: 22px;
}
.mini-step span { min-width: 32px; text-align: center; font-weight: 700; }
.pay-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 12px; }
.person { text-align: left; }
.person.active { border-color: var(--accent); background: var(--soft); }

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 21, 0.46);
  z-index: 30;
}
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  max-height: min(88dvh, 720px);
  overflow: auto;
  background: #fffdfb;
  border-radius: 24px 24px 0 0;
  z-index: 31;
  padding: 8px 16px calc(16px + var(--safe-bot));
}
.grab {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: #e4ddd3;
  margin: 4px auto 12px;
}
.sheet h2 {
  font-family: Fraunces, Georgia, serif;
  font-size: 28px;
  font-weight: 560;
  letter-spacing: -0.03em;
}
.sheet .sub { color: var(--muted); margin: 4px 0 14px; }
.stepper {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  gap: 8px;
  margin-bottom: 12px;
}
.stepper button {
  height: 64px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--sand);
  font-size: 28px;
  font-weight: 500;
}
.stepper input {
  height: 64px;
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  border-radius: 16px;
  border: 1px solid var(--line);
}
.total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 12px 0;
  font-size: 14px;
  color: var(--muted);
}
.total b {
  font-family: Fraunces, Georgia, serif;
  color: var(--ink);
  font-size: 32px;
  font-weight: 560;
}
.pick-list { margin: 8px 0 0; border-radius: 16px; }

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-bot));
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 60;
  width: max-content;
  max-width: calc(100% - 32px);
  text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.scan-layer {
  position: fixed;
  inset: 0;
  background: #111;
  z-index: 70;
  display: grid;
  place-items: center;
}
.scan-layer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scan-ui {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 16px calc(16px + var(--safe-bot));
  display: grid;
  gap: 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
}
.scan-ui p { color: #fff; text-align: center; }
.frame {
  position: absolute;
  width: min(280px, 74vw);
  height: 160px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.35);
}

:focus-visible {
  outline: 3px solid rgba(196, 72, 26, 0.45);
  outline-offset: 2px;
}

.cat-title {
  margin: 18px 16px 8px;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.sub-title {
  margin: 10px 16px 0;
  font-size: 15px;
  font-weight: 700;
}
.cat-block .block { margin: 8px 16px 0; }
.list.grouped {
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.side { display: contents; }
.side-brand { display: none; }

@media (min-width: 900px) {
  body { background: var(--paper); }
  .desk-mark { display: none; }
  .app {
    width: 100%;
    max-width: none;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    box-shadow: none;
  }
  .side {
    display: flex;
    flex-direction: column;
    grid-row: 1 / span 2;
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 22px 12px 16px;
    background: var(--paper);
    border-right: 1px solid var(--line);
    color: var(--ink);
  }
  .side-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 0 8px 8px;
    font-family: Fraunces, Georgia, serif;
    font-size: 18px;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--ink);
  }
  .side-brand img { border-radius: 25%; }
  .side-brand small {
    display: block;
    margin-top: 3px;
    font-family: Outfit, "Segoe UI", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .tabs {
    position: static;
    transform: none;
    width: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: visible;
    border: 0;
    background: transparent;
    backdrop-filter: none;
    padding: 18px 0 0;
    flex: 1;
  }
  .tabs button {
    justify-content: flex-start;
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--muted);
    border-radius: 10px;
  }
  .tabs button.active { background: var(--accent); color: #fff; }
  .side { border-left: 4px solid var(--accent); }
  .sell-bubble {
    width: 34px;
    height: 34px;
    margin: 0;
    box-shadow: none;
  }
  main {
    grid-column: 2;
    grid-row: 1;
    padding: 0 28px 48px 12px;
    max-width: none;
  }
  .home-head { align-items: center; padding-top: 22px; }
  .home-head .logo { display: none; }
  .home-metrics {
    grid-template-columns: 1.4fr repeat(3, minmax(140px, 1fr));
    align-items: stretch;
    padding-right: 16px;
  }
  .home-metrics .pulse { grid-column: auto; display: flex; flex-direction: column; justify-content: center; }
  .home-metrics .metric-wide { display: block; }
  .pulse-stock { display: none; }
  .home-metrics .stat { display: flex; flex-direction: column; justify-content: center; min-height: 118px; }
  body.has-cart main { padding-bottom: 120px; }
  .cart-dock {
    left: 264px;
    right: 24px;
    width: auto;
    max-width: 720px;
    transform: none;
    bottom: 16px;
  }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tile { min-height: 74px; }
  .home-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 20px;
    align-items: stretch;
    padding-right: 0;
  }
  .home-split .section { display: flex; flex-direction: column; }
  .home-split .block { flex: 1; }
  .sheet {
    top: 50%;
    bottom: auto;
    width: min(560px, calc(100vw - 288px));
    max-height: min(86dvh, 760px);
    border-radius: 24px;
    transform: translate(-50%, -50%);
    box-shadow: 0 24px 70px rgba(40, 30, 20, 0.18);
  }
  body.signed-out .side { display: none; }
  body.signed-out .app {
    display: block;
    width: min(480px, calc(100% - 48px));
    min-height: auto;
    margin: 40px auto;
    border-radius: 28px;
    box-shadow: 0 0 0 1px rgba(40, 30, 20, 0.06), 0 24px 70px rgba(40, 30, 20, 0.12);
    overflow: hidden;
  }
  body.signed-out .desk-mark {
    display: flex;
    align-items: center;
    gap: 14px;
    position: fixed;
    top: 36px;
    left: 40px;
    font-family: Fraunces, Georgia, serif;
    font-size: 28px;
    line-height: 1.05;
    max-width: 340px;
    letter-spacing: -0.04em;
    color: #3a3128;
  }
  body.signed-out .desk-mark img { border-radius: 25%; }
  body.signed-out .desk-mark span {
    display: block;
    margin-top: 4px;
    font-family: Outfit, "Segoe UI", sans-serif;
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #746e66;
  }
  body.signed-out .gate-wrap { min-height: auto; padding-top: 36px; padding-bottom: 36px; }
  body.signed-out .gate { min-height: auto; }
}

.check-row {
  display: grid;
  grid-template-columns: 1fr 88px auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--card);
}
.check-row:first-child { border-top: 0; }
.check-row strong { display: block; }
.check-row em { font-style: normal; color: var(--muted); font-size: 13px; }
.check-row input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
}
.check-delta { min-width: 52px; text-align: right; font-weight: 700; color: var(--ink); }
.thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  flex: 0 0 auto;
  background: var(--sand);
}
.item-photo {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 16px;
  margin: 0 0 12px;
  background: var(--sand);
}
.label-sheet { display: flex; flex-wrap: wrap; gap: 2mm; }
.shelf-label {
  width: 48mm;
  min-height: 28mm;
  border: 1px solid #222;
  padding: 2mm;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #111;
  background: #fff;
  break-inside: avoid;
}
.shelf-label strong { font-size: 13px; line-height: 1.2; }
.shelf-label b { font-size: 16px; }
.shelf-label span, .shelf-label em, .shelf-label small { font-size: 11px; color: #444; font-style: normal; }
.receipt { text-align: center; padding: 4px 0 12px; }
.receipt-shop {
  font-family: Fraunces, Georgia, serif;
  font-size: 28px;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}
.receipt p { margin: 0; color: var(--muted); }
.receipt-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  text-align: left;
  padding: 8px 0;
}
.receipt-line span:nth-child(2) { grid-column: 1; color: var(--muted); font-size: 13px; }
.receipt-line b { grid-row: 1 / span 2; align-self: center; }
.receipt-rule { border-top: 1px dashed var(--line); margin: 8px 0; }
.receipt-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--ink);
  margin: 8px 0;
}
.receipt-total b {
  font-family: Fraunces, Georgia, serif;
  font-size: 32px;
  font-weight: 560;
}
.receipt-thanks { margin-top: 8px; }
.diary {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 1fr);
  gap: 10px;
  padding: 0 16px 24px;
  overflow-x: auto;
}
.diary-col {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  min-height: 180px;
}
.diary-col h2 {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.diary-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  margin: 0 0 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  text-align: left;
}
.diary-card span, .diary-card em { color: var(--muted); font-style: normal; font-size: 13px; }
.check-item { padding: 8px 0; border-top: 1px solid var(--line); }
.check-item strong { display: block; margin-bottom: 6px; }
#print-root { display: none; }
#print-root .report-print {
  max-width: 720px;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}
#print-root .report-print .report-title {
  margin: 4px 0 6px;
  font-family: Fraunces, Georgia, serif;
  font-size: 22px;
  font-weight: 560;
  letter-spacing: -0.03em;
}
#print-root .report-print .report-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 0 0 10px;
  font-weight: 650;
}
#print-root .report-print .report-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
}
#print-root .report-print .report-table th,
#print-root .report-print .report-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #ddd;
  text-align: left;
  vertical-align: top;
}
#print-root .report-print .report-table th {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #555;
  border-bottom: 1px solid #111;
}
#print-root .report-print .report-table .num,
#print-root .report-print .report-table th:last-child,
#print-root .report-print .report-table td:last-child {
  text-align: right;
}
#print-root .report-print .report-line {
  margin: 0;
  white-space: pre-wrap;
  font-family: "Courier New", Courier, monospace;
}
@media print {
  body * { visibility: hidden; }
  #print-root, #print-root * { visibility: visible; }
  #print-root {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: white;
    color: black;
  }
  #print-root .receipt + .receipt { break-before: page; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
