:root {
  --orange: #ea5330;
  --orange-deep: #cc4424;
  --pink: #f0bed4;
  --ink: #111111;
  --sub: #69615f;
  --muted: #a69d9a;
  --line: #efe7e5;
  --warm: #fff7f4;
  --pink-soft: #fdf1f6;
  --orange-soft: #fde6df;
  --paper: #ffffff;
  --shadow: 0 18px 44px rgba(17, 17, 17, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #e8e2de;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }

.stage {
  width: min(100vw, 920px);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.phone {
  width: 390px;
  height: 844px;
  border-radius: 38px;
  border: 10px solid #191919;
  background: var(--paper);
  overflow: hidden;
  position: relative;
  box-shadow: 0 28px 90px rgba(17, 17, 17, .24);
}

.screen {
  height: 100%;
  overflow-y: auto;
  padding: 18px 18px 100px;
  background: linear-gradient(180deg, var(--warm) 0 188px, var(--paper) 188px);
  scrollbar-width: none;
}

.screen::-webkit-scrollbar { display: none; }

.status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 22px;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.top-text {
  flex: 1;
  min-width: 0;
}

.backbar {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.back {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.back > span { display: block; transform: translateY(-1px); }

.route-label {
  color: var(--sub);
  font-size: 12px;
  font-weight: 850;
}

.store {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px 0 9px;
  border: 0;
  border-radius: 999px;
  background: var(--pink-soft);
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 11px;
  cursor: pointer;
  white-space: nowrap;
  max-width: 100%;
}

.store-icon { display: inline-grid; place-items: center; width: 14px; height: 14px; }
.store-icon svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.store-name { overflow: hidden; text-overflow: ellipsis; }

h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.18;
  font-weight: 950;
  letter-spacing: -0.005em;
  word-break: keep-all;
}

h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0;
}

.lead {
  margin: 12px 0 0;
  color: var(--sub);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 800;
}
.lead-soft { color: var(--sub); }

.icons {
  display: flex;
  gap: 8px;
  padding-top: 4px;
  flex-shrink: 0;
}

.round-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
}

.round-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dev-switcher {
  position: fixed;
  left: 18px;
  top: 18px;
  width: 218px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid rgba(17,17,17,.08);
  border-radius: 18px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 18px 50px rgba(17,17,17,.10);
  backdrop-filter: blur(18px);
  padding: 12px;
}
.dev-switcher h2 { margin: 4px 4px 10px; font-size: 13px; }
.dev-grid { display: grid; gap: 6px; }
.dev-grid button {
  border: 0; border-radius: 12px; background: var(--warm); color: var(--ink);
  font-size: 11px; font-weight: 800; text-align: left; padding: 8px 10px; cursor: pointer;
}
.dev-grid button.active { background: var(--orange); color: white; }

/* Hero block */
.hero {
  position: relative;
  min-height: 168px;
  margin-top: 18px;
  border-radius: 26px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
  color: white;
  padding: 22px;
}
.hero-tight { margin-top: 28px; }
.hero-mini { min-height: 116px; }

.hero-logo {
  position: absolute;
  width: 168px;
  height: 168px;
  object-fit: cover;
  right: -50px;
  bottom: -52px;
  opacity: .82;
  transform: rotate(-6deg);
  filter: drop-shadow(0 12px 30px rgba(0,0,0,.18));
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 950;
  color: #ffe4dc;
  letter-spacing: .04em;
}
.eyebrow-static { margin: 0; }

.hero-title {
  position: relative;
  z-index: 1;
  max-width: 240px;
  font-size: 25px;
  line-height: 1.2;
  font-weight: 950;
  word-break: keep-all;
}
.hero-title-sm { font-size: 19px; }

.hero-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

/* Buttons / pills */
.pill {
  border: 0;
  border-radius: 999px;
  height: 36px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: white;
  color: var(--orange);
  font-weight: 950;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}
.pill.full { width: 100%; height: 50px; font-size: 14px; }
.pill-dark { background: var(--ink); color: white; }
.pill-soft { background: var(--pink-soft); color: var(--orange); }
.pill-on { background: var(--orange); color: white; }
.pill-ghost { background: rgba(255,255,255,.18); color: white; border: 1px solid rgba(255,255,255,.32); }
.pill-cta { height: 50px; background: var(--orange); color: white; font-size: 14px; }
.pill-outline { background: white; color: var(--ink); border: 1px solid var(--line); }
.pill-square {
  width: 50px;
  height: 50px;
  padding: 0;
  border-radius: 18px;
  background: var(--ink);
  color: white;
}
.pill-square svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.quick-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }

/* Sections */
.section { margin-top: 24px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 2px;
  gap: 8px;
}

.link {
  border: 0; background: transparent; color: var(--orange);
  font-size: 12px; font-weight: 950; padding: 0; cursor: pointer;
}
.link-active { color: var(--orange-deep); }

/* Product cards */
.products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.product {
  min-height: 184px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 10px;
  background: white;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.product:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.art {
  height: 64px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--orange);
  margin-bottom: 10px;
}
.art .mark {
  font-size: 24px;
  font-weight: 950;
  line-height: 1;
}

.product h3 {
  margin: 0;
  min-height: 38px;
  font-size: 12px;
  line-height: 1.32;
  font-weight: 950;
  word-break: keep-all;
}
.product p {
  margin: 6px 0 0;
  min-height: 28px;
  color: var(--sub);
  font-size: 10px;
  line-height: 1.3;
  font-weight: 750;
}

.price-row {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-top: 8px;
}
.price-row.big { gap: 12px; padding-top: 6px; }

.price {
  color: var(--orange);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: -0.005em;
}
.price-row.big .price { font-size: 28px; }

.was {
  color: var(--muted);
  font-size: 11px;
  text-decoration: line-through;
  font-weight: 750;
}
.price-row.big .was { font-size: 14px; }

.discount-badge {
  background: var(--orange-soft);
  color: var(--orange);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 950;
}

/* Grid tiles */
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.grid3-tight { gap: 8px; }

.tile {
  min-height: 76px;
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: white;
  font-size: 12px;
  line-height: 1.22;
  font-weight: 950;
  cursor: pointer;
  word-break: keep-all;
}
.tile small {
  display: block;
  color: var(--sub);
  font-size: 10px;
  font-weight: 750;
  margin-top: 6px;
}
.tile.pink { background: var(--pink-soft); border-color: transparent; color: var(--orange); }
.tile.warm { background: var(--warm); border-color: transparent; }
.tile.hot { background: var(--orange); border-color: transparent; color: white; }
.tile.hot small { color: #ffe4dc; }

/* List items */
.list { display: grid; gap: 10px; }

.item {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  padding: 12px 14px;
  cursor: pointer;
}

.thumb {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--pink-soft);
  color: var(--orange);
}
.thumb .mark {
  font-weight: 950;
  font-size: 18px;
  line-height: 1;
}

.item-text { min-width: 0; }
.item-title {
  font-size: 14px;
  line-height: 1.28;
  font-weight: 950;
  word-break: keep-all;
}
.item-sub {
  margin-top: 6px;
  color: var(--sub);
  font-size: 11px;
  line-height: 1.3;
  font-weight: 700;
  word-break: keep-all;
}

.right {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 6px;
  min-width: 70px;
}

.tag {
  min-width: 64px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}

/* Search */
.search-input {
  width: 100%;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: white;
  color: var(--ink);
  padding: 0 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  outline: none;
}
.search-input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px var(--orange-soft);
}

/* Empty / states */
.empty-state {
  min-height: 138px;
  border: 1px solid var(--line);
  border-radius: 24px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  background: var(--warm);
  padding: 18px;
}
.empty-state strong { font-size: 16px; font-weight: 950; }
.empty-state span { color: var(--sub); font-size: 12px; font-weight: 750; }

/* Challenge card */
.challenge-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  border-radius: 22px;
  background: var(--pink-soft);
  padding: 18px 20px;
  cursor: pointer;
}
.challenge-card h3 { margin: 0 0 6px; font-size: 17px; font-weight: 950; }
.challenge-card p { margin: 0; color: var(--sub); font-size: 12px; font-weight: 750; }

/* Detail visual */
.detail-visual {
  position: relative;
  height: 220px;
  border-radius: 30px;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 70%, rgba(234,83,48,.42) 0 32px, transparent 33px),
    radial-gradient(circle at 70% 60%, rgba(240,190,212,.55) 0 88px, transparent 89px),
    var(--pink-soft);
  display: grid;
  place-items: center;
}
.detail-orb {
  position: absolute;
  inset: 0;
  opacity: .35;
  filter: blur(34px);
}
.detail-visual img {
  position: relative;
  z-index: 1;
  width: 142px;
  height: 142px;
  object-fit: cover;
  border-radius: 36px;
  box-shadow: 0 18px 40px rgba(234,83,48,.22);
}
.detail-mark {
  position: absolute;
  left: 22px;
  top: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: white;
  color: var(--orange);
  display: grid;
  place-items: center;
  font-weight: 950;
  font-size: 18px;
  box-shadow: 0 8px 18px rgba(17,17,17,.10);
}
.detail-mark span { line-height: 1; }
.detail-flag {
  position: absolute;
  right: 18px;
  top: 18px;
  background: var(--ink);
  color: white;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .04em;
  padding: 6px 12px;
  border-radius: 999px;
}

/* Chips */
.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.chip {
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--warm);
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
}

/* Stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.stat {
  min-height: 76px;
  border-radius: 18px;
  background: var(--warm);
  padding: 14px 12px;
}
.stat strong {
  display: block;
  color: var(--orange);
  font-size: 17px;
  font-weight: 950;
  line-height: 1.1;
}
.stat span {
  display: block;
  margin-top: 7px;
  color: var(--sub);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

/* Nutrition */
.nutrition {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.nut {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 8px;
  text-align: center;
}
.nut strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
  line-height: 1.1;
}
.nut span {
  display: block;
  margin-top: 4px;
  color: var(--sub);
  font-size: 10px;
  font-weight: 800;
}

/* Coupon */
.coupon-card {
  min-height: 144px;
  border-radius: 26px;
  padding: 22px;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
  color: white;
  position: relative;
  overflow: hidden;
}
.coupon-card::after {
  content: "";
  position: absolute;
  right: -36px;
  bottom: -44px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(240,190,212,.55);
}
.coupon-card h3 {
  margin: 0;
  max-width: 230px;
  font-size: 24px;
  line-height: 1.18;
  font-weight: 950;
}
.coupon-card p {
  margin: 12px 0 0;
  color: #ffe4dc;
  font-size: 12px;
  font-weight: 800;
}
.code {
  display: inline-flex;
  margin-top: 16px;
  height: 30px;
  align-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.20);
  padding: 0 14px;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .03em;
  position: relative;
  z-index: 1;
}

/* Map */
.map-card {
  height: 250px;
  border-radius: 26px;
  background:
    linear-gradient(90deg, rgba(234,83,48,.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(234,83,48,.08) 1px, transparent 1px),
    var(--orange-soft);
  background-size: 42px 42px;
  position: relative;
  overflow: hidden;
}
.pin {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 6px;
  transform: rotate(-45deg);
  background: var(--orange);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(234,83,48,.30);
}
.pin > span {
  transform: rotate(45deg);
  color: white;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
}

/* Timeline */
.timeline {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.day {
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 12px;
  font-weight: 950;
}
.day.on { background: var(--orange); color: white; }

/* FAB row */
.fab-row {
  position: sticky;
  bottom: -70px;
  display: grid;
  grid-template-columns: 1fr 50px;
  gap: 10px;
  margin-top: 22px;
}

/* Stamp / grade */
.stamp {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: white;
  color: var(--orange);
  border: 2px solid var(--orange);
  flex-shrink: 0;
}
.stamp > span {
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
  display: block;
}

.grade {
  min-height: 178px;
  border-radius: 28px;
  background: var(--ink);
  color: white;
  padding: 26px;
  position: relative;
  overflow: hidden;
}
.grade h2 { font-size: 30px; color: white; line-height: 1.15; }
.grade p { color: var(--muted); margin: 8px 0 0; font-size: 13px; font-weight: 800; }
.grade-symbol {
  position: absolute;
  right: 26px;
  top: 32px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--orange);
  display: grid;
  place-items: center;
}
.grade-symbol > span {
  font-size: 30px;
  font-weight: 950;
  color: white;
  line-height: 1;
}

.dots {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}
.dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--orange-soft);
}
.dot.on { background: var(--orange); }

/* Workout ring */
.center-row { display: grid; place-items: center; }
.ring {
  width: 218px;
  height: 218px;
  border-radius: 50%;
  background: conic-gradient(var(--orange) 220deg, var(--orange-soft) 220deg);
  display: grid;
  place-items: center;
}
.ring-inner {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: white;
  display: grid;
  place-items: center;
  text-align: center;
  box-shadow: 0 14px 28px rgba(234,83,48,.16);
}
.ring-num {
  color: var(--orange);
  font-size: 36px;
  font-weight: 950;
  line-height: 1;
  margin-bottom: 4px;
}

/* Filters */
.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.filter-row::-webkit-scrollbar { display: none; }

/* Onboarding / login */
.center-text { text-align: center; }
.center-h2 {
  font-size: 26px;
  line-height: 1.25;
  font-weight: 950;
}
.onboarding-visual {
  display: grid;
  place-items: center;
  text-align: center;
}
.onboarding-visual img {
  width: 196px;
  height: 196px;
  object-fit: cover;
  border-radius: 48px;
  box-shadow: 0 22px 44px rgba(234,83,48,.18);
}
.login-card {
  border-radius: 30px;
  background: var(--pink-soft);
  padding: 28px;
  text-align: center;
}
.login-card img {
  width: 230px;
  max-width: 100%;
  border-radius: 14px;
}
.login-stack { gap: 10px; }

/* Tabbar */
.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 76px;
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 12px 12px;
  backdrop-filter: blur(14px);
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
  padding: 0;
}

.tab .ico {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.tab svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.1;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

.tab.active { color: var(--orange); font-weight: 950; }
.tab.active .ico { background: var(--orange-soft); }
.tab-label { line-height: 1; }

@media (max-width: 520px) {
  .stage { padding: 0; }
  .dev-switcher { display: none; }
  .phone {
    width: 100vw;
    height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ----- Market strip (home) ----- */
.market-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.market-tile {
  border-radius: 16px;
  background: var(--warm);
  padding: 12px 10px;
  text-align: left;
  border: 1px solid var(--line);
}
.market-tile strong {
  display: block;
  color: var(--orange);
  font-size: 16px;
  font-weight: 950;
  line-height: 1.05;
}
.market-tile span {
  display: block;
  margin-top: 6px;
  color: var(--sub);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  word-break: keep-all;
}

/* ----- Value cards (onboarding / about) ----- */
.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.value-card {
  position: relative;
  min-height: 152px;
  border-radius: 18px;
  padding: 14px 12px 12px;
  background: white;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.value-card strong {
  font-size: 13px;
  font-weight: 950;
  line-height: 1.1;
  letter-spacing: -0.005em;
}
.value-card span {
  color: var(--sub);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.35;
  word-break: keep-all;
}
.value-mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: white;
  font-weight: 950;
  font-size: 13px;
}
.value-mark span { line-height: 1; }
.value-zero { background: var(--orange-soft); border-color: transparent; }
.value-zero strong { color: var(--orange); }
.value-zero .value-mark { background: var(--orange); }
.value-wellness { background: var(--pink-soft); border-color: transparent; }
.value-wellness strong { color: var(--orange); }
.value-wellness .value-mark { background: var(--pink); color: var(--ink); }
.value-pleasure { background: var(--ink); border-color: transparent; }
.value-pleasure strong { color: white; }
.value-pleasure span { color: rgba(255,255,255,.78); }
.value-pleasure .value-mark { background: var(--orange); color: white; }

/* ----- 4-in-1 pillars ----- */
.pillar-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.pillar {
  min-height: 110px;
  border-radius: 18px;
  padding: 14px 10px 12px;
  background: var(--orange);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  word-break: keep-all;
}
.pillar strong {
  font-size: 14px;
  font-weight: 950;
  line-height: 1.18;
}
.pillar span {
  color: rgba(255,255,255,.85);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
}
.pillar-pink { background: var(--pink); color: var(--ink); }
.pillar-pink span { color: rgba(17,17,17,.62); }
.pillar-warm { background: var(--warm); color: var(--ink); border: 1px solid var(--line); }
.pillar-warm span { color: var(--sub); }
.pillar-dark { background: var(--ink); color: white; }
.pillar-dark span { color: rgba(255,255,255,.65); }

/* ----- About: positioning card ----- */
.positioning-card {
  background: var(--warm);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px 18px;
  display: grid;
  gap: 12px;
}
.positioning-line {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 10px;
}
.positioning-line strong {
  font-size: 13px;
  font-weight: 950;
  letter-spacing: -0.005em;
}
.positioning-line em {
  font-style: normal;
  color: var(--sub);
  font-size: 11px;
  font-weight: 800;
}
.positioning-line .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  background: transparent;
}
.positioning-line .dot-pink { background: var(--pink); }
.positioning-line .dot-orange { background: var(--orange); }
.positioning-line .dot-ink { background: var(--ink); }

/* ----- About: market grid ----- */
.market-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.market-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 14px;
}
.market-card strong {
  display: block;
  color: var(--orange);
  font-size: 22px;
  font-weight: 950;
  line-height: 1.05;
  letter-spacing: -0.005em;
}
.market-card span {
  display: block;
  margin-top: 8px;
  color: var(--sub);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  word-break: keep-all;
}

/* Eyebrow on white backgrounds */
.eyebrow-dark { color: var(--orange); }

/* ----- Category icons in product art / thumb / detail ----- */
.art {
  position: relative;
  overflow: hidden;
}
.art-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--orange);
}
.art-icon svg {
  width: 36px;
  height: 36px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.art-mark {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  color: var(--orange);
  font-size: 11px;
  font-weight: 950;
  display: grid;
  place-items: center;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(17,17,17,.08);
}

.thumb-art { position: relative; overflow: hidden; }
.thumb-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--orange);
}
.thumb-icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.thumb-mark {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: white;
  color: var(--orange);
  font-size: 9px;
  font-weight: 950;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.detail-cat {
  position: absolute;
  right: 22px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,.86);
  color: var(--orange);
  display: grid;
  place-items: center;
  z-index: 1;
  backdrop-filter: blur(6px);
}
.detail-cat svg {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ----- Modal layer ----- */
.modal-layer {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}
.modal-layer:empty { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17,17,17,.42);
  backdrop-filter: blur(2px);
  pointer-events: auto;
  animation: hzFadeIn .18s ease;
}

.modal {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  width: calc(100% - 36px);
  background: white;
  border-radius: 28px;
  padding: 24px 22px 22px;
  box-shadow: 0 24px 60px rgba(17,17,17,.32);
  pointer-events: auto;
  text-align: center;
  animation: hzSlideUp .24s cubic-bezier(.2,.8,.2,1);
}
.modal h3 {
  margin: 14px 0 6px;
  font-size: 19px;
  font-weight: 950;
  line-height: 1.25;
  word-break: keep-all;
}
.modal p {
  margin: 0;
  color: var(--sub);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 800;
  word-break: keep-all;
}
.modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto;
  display: grid;
  place-items: center;
  color: white;
}
.modal-icon-orange { background: var(--orange); }
.modal-icon-pink { background: var(--pink-soft); color: var(--orange); }
.modal-icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
.modal-row .pill { width: 100%; }
.modal-progress {
  margin-top: 16px;
  height: 8px;
  border-radius: 999px;
  background: var(--orange-soft);
  overflow: hidden;
}
.modal-progress span {
  display: block;
  height: 100%;
  background: var(--orange);
  border-radius: 999px;
  transition: width .4s ease;
}

.spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid var(--orange-soft);
  border-top-color: var(--orange);
  animation: hzSpin .9s linear infinite;
  display: inline-block;
}

@keyframes hzFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes hzSlideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes hzSpin {
  to { transform: rotate(360deg); }
}

body.has-modal .tabbar { filter: blur(1px) brightness(.96); }

/* ----- Search highlight & removable chips ----- */
mark.hl {
  background: var(--orange-soft);
  color: var(--orange);
  padding: 0 2px;
  border-radius: 4px;
  font-weight: 950;
}

.chip-removable {
  padding: 0 0 0 12px;
  gap: 6px;
}
.chip-removable .chip-text {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}
.chip-removable .chip-x {
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  border-left: 1px solid rgba(17,17,17,.10);
  margin-left: 4px;
  color: var(--sub);
  font-size: 14px;
  font-weight: 950;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.chip-removable .chip-x:hover { color: var(--orange); }

/* ----- Product photos ----- */
.art.art-photo { padding: 0; overflow: hidden; }
.art-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb.thumb-photo-wrap { padding: 0; overflow: hidden; }
.thumb-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-visual.detail-photo {
  background:
    radial-gradient(circle at 22% 18%, rgba(240,190,212,.55) 0 70px, transparent 71px),
    var(--pink-soft);
}
.detail-img {
  position: relative;
  z-index: 1;
  width: 168px;
  height: 168px;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: 0 22px 44px rgba(17,17,17,.18);
}

/* ----- Toast layer ----- */
.toast-layer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 88px;
  display: grid;
  place-items: center;
  z-index: 60;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--ink);
  color: white;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 14px 32px rgba(17,17,17,.32);
  animation: hzToastIn .26s cubic-bezier(.2,.8,.2,1);
  max-width: calc(100% - 36px);
  text-align: center;
}
.toast-orange { background: var(--orange); }
.toast-pink { background: var(--pink); color: var(--ink); }
.toast-ink { background: var(--ink); color: white; }

@keyframes hzToastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ----- Reservation modal ----- */
.modal-tall { max-height: calc(100% - 50px); overflow-y: auto; }
.modal-tall::-webkit-scrollbar { display: none; }

.reservation-stores {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 18px;
}
.store-pick {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: white;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font: inherit;
}
.store-pick.on {
  border-color: var(--orange);
  background: var(--orange-soft);
}
.store-pick:disabled {
  opacity: .45;
  cursor: not-allowed;
  background: var(--warm);
}
.store-pick-name {
  font-size: 13px;
  font-weight: 950;
  color: var(--ink);
}
.store-pick-stock {
  font-size: 11px;
  color: var(--sub);
  font-weight: 800;
}
.store-pick.on .store-pick-stock { color: var(--orange); }

.reservation-qty {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.reservation-qty > span {
  font-size: 13px;
  font-weight: 850;
}
.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}
.qty-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--warm);
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  cursor: pointer;
  line-height: 1;
}
.qty-val {
  min-width: 32px;
  text-align: center;
  font-size: 16px;
  font-weight: 950;
}

.reservation-summary {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--warm);
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.reservation-summary span { font-size: 12px; font-weight: 800; color: var(--sub); }
.reservation-summary strong { font-size: 18px; font-weight: 950; color: var(--orange); }

/* Three-button fab row when product detail shows reservation CTA */
.fab-row { grid-template-columns: 1fr 50px 50px; }
.pill-square-soft { background: var(--pink-soft); color: var(--orange); font-size: 18px; }

/* ============ Dark mode tokens ============ */
[data-theme="dark"] {
  --ink: #f5f1ee;
  --sub: #b6aca9;
  --muted: #756c69;
  --line: #2a2624;
  --warm: #1d1916;
  --pink-soft: #2a1f24;
  --orange-soft: #2e1d18;
  --paper: #14110f;
}
[data-theme="dark"] body { background: #0b0907; }
[data-theme="dark"] .phone { border-color: #0b0907; background: var(--paper); box-shadow: 0 28px 90px rgba(0,0,0,.6); }
[data-theme="dark"] .screen { background: linear-gradient(180deg, var(--warm) 0 188px, var(--paper) 188px); }
[data-theme="dark"] .product,
[data-theme="dark"] .item,
[data-theme="dark"] .tile,
[data-theme="dark"] .market-card,
[data-theme="dark"] .market-tile,
[data-theme="dark"] .nut,
[data-theme="dark"] .modal,
[data-theme="dark"] .store-pick {
  background: #1a1614;
  border-color: var(--line);
  color: var(--ink);
}
[data-theme="dark"] .grade { background: #0b0907; }
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] .item-title,
[data-theme="dark"] .product h3, [data-theme="dark"] .market-card span,
[data-theme="dark"] .modal h3, [data-theme="dark"] .grade-symbol > span {
  color: var(--ink);
}
[data-theme="dark"] .stat strong, [data-theme="dark"] .market-card strong { color: #ffb796; }
[data-theme="dark"] .tile.warm,
[data-theme="dark"] .stat,
[data-theme="dark"] .empty-state,
[data-theme="dark"] .positioning-card { background: #1d1916; }
[data-theme="dark"] .pill-soft { background: #2a1f24; color: #ffb796; }
[data-theme="dark"] .pill { background: #2a2624; color: #ffb796; }
[data-theme="dark"] .pill-outline { background: #1a1614; color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .round-btn,
[data-theme="dark"] .back { background: #1a1614; color: var(--ink); }
[data-theme="dark"] .store { background: #2a1f24; color: #ffb796; }
[data-theme="dark"] .tabbar { background: rgba(20,17,15,.96); }
[data-theme="dark"] .search-input { background: #1a1614; color: var(--ink); border-color: var(--line); }
[data-theme="dark"] mark.hl { background: #2e1d18; color: #ffb796; }
[data-theme="dark"] .modal-backdrop { background: rgba(0,0,0,.62); }

/* ============ Notification bell badge ============ */
.round-btn-bell { position: relative; }
.badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--orange);
  color: white;
  font-size: 9px;
  font-weight: 950;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 2px white;
}
[data-theme="dark"] .badge { box-shadow: 0 0 0 2px var(--paper); }

.notif .notif-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--orange);
}
.notif .notif-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============ Theme toggle + general toggle ============ */
.toggle {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  display: inline-block;
  transition: background .2s ease;
}
.toggle.on { background: var(--orange); }
.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  transition: transform .2s ease;
  box-shadow: 0 2px 6px rgba(17,17,17,.18);
}
.toggle.on .toggle-knob { transform: translateX(18px); }

.theme-toggle { cursor: pointer; }

/* ============ Onboarding interest chips ============ */
.interest-chip {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}
.interest-chip.on {
  background: var(--orange);
  color: white;
  border-color: var(--orange);
}
[data-theme="dark"] .interest-chip { background: #1a1614; color: var(--ink); }
[data-theme="dark"] .interest-chip.on { background: var(--orange); color: white; }

.pill-cta:disabled {
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

/* ============ Store detail ============ */
.store-map { height: 220px; }
.pin { cursor: pointer; transition: transform .15s ease; }
.pin:hover { transform: rotate(-45deg) scale(1.06); }
.pin-active {
  background: var(--ink);
  box-shadow: 0 12px 28px rgba(17,17,17,.36);
}
[data-theme="dark"] .pin-active { background: var(--orange); }

/* ============ Challenge variations ============ */
.challenge-item {
  cursor: pointer;
}
.challenge-thumb-orange { background: var(--orange-soft); color: var(--orange); }
.challenge-thumb-pink { background: var(--pink-soft); color: var(--orange); }
.challenge-thumb-ink { background: var(--ink); color: white; }
.challenge-thumb-warm { background: var(--warm); color: var(--orange); border: 1px solid var(--line); }
.challenge-thumb-orange svg,
.challenge-thumb-pink svg,
.challenge-thumb-ink svg,
.challenge-thumb-warm svg {
  width: 24px; height: 24px;
  stroke: currentColor; stroke-width: 1.8; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}
.challenge-orange .item-title,
.challenge-pink .item-title,
.challenge-warm .item-title { color: var(--ink); }

.pill-tiny { height: 26px; padding: 0 10px; font-size: 11px; }

/* ============ QR modal ============ */
.qr-svg {
  width: 168px;
  height: 168px;
  margin: 18px auto 0;
  display: block;
  background: white;
  padding: 12px;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(17,17,17,.18);
}
[data-theme="dark"] .qr-svg { background: white; }
.qr-svg rect { fill: var(--ink); }
.qr-meta {
  margin-top: 16px;
  display: grid;
  gap: 4px;
  text-align: center;
}
.qr-meta strong { font-size: 14px; font-weight: 950; }
.qr-meta span { color: var(--sub); font-size: 12px; font-weight: 800; }
.qr-code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: .04em;
  font-size: 11px !important;
  margin-top: 6px;
}

/* ============ Search suggestions ============ */
.sug-host { position: relative; }
.sug-dropdown {
  position: absolute;
  top: 60px;
  left: 18px;
  right: 18px;
  z-index: 30;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 6px;
  box-shadow: 0 18px 40px rgba(17,17,17,.18);
  display: grid;
  gap: 2px;
  max-height: 320px;
  overflow-y: auto;
}
[data-theme="dark"] .sug-dropdown { background: #1a1614; }
.sug-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  width: 100%;
  font: inherit;
  color: var(--ink);
}
.sug-item:hover { background: var(--warm); }
.sug-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--orange);
}
.sug-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sug-text { display: grid; gap: 2px; min-width: 0; }
.sug-text strong { font-size: 13px; font-weight: 950; line-height: 1.2; word-break: keep-all; }
.sug-text em { font-style: normal; font-size: 11px; color: var(--sub); font-weight: 800; }

/* ============ Reviews ============ */
.review .thumb { font-size: 22px; }
.review-stars { color: var(--orange); font-weight: 950; letter-spacing: 1px; margin-left: 6px; }

/* ============ Receipt ============ */
.receipt-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 22px;
  display: grid;
  gap: 14px;
  text-align: center;
}
[data-theme="dark"] .receipt-card { background: #1a1614; }
.receipt-head {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.receipt-logo {
  width: 44px; height: 44px;
  border-radius: 12px;
  object-fit: cover;
}
.receipt-store { font-size: 15px; font-weight: 950; }
.receipt-meta { font-size: 11px; color: var(--sub); font-weight: 800; margin-top: 2px; }
.receipt-divider {
  height: 1px;
  background: var(--line);
}
.receipt-divider.dashed {
  background-image: linear-gradient(to right, var(--line) 50%, transparent 50%);
  background-size: 6px 1px;
  background-repeat: repeat-x;
  background-color: transparent;
  height: 1px;
}
.receipt-lines { display: grid; gap: 8px; text-align: left; }
.receipt-line {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}
.receipt-line .receipt-name { font-weight: 950; grid-column: 1; }
.receipt-line .receipt-qty { grid-column: 1; color: var(--sub); font-size: 11px; font-weight: 800; }
.receipt-line .receipt-amount { grid-column: 2; grid-row: 1 / span 2; font-weight: 950; align-self: center; }
.receipt-total { display: grid; gap: 4px; text-align: left; font-size: 12px; }
.receipt-total > div { display: flex; justify-content: space-between; }
.receipt-final { padding-top: 6px; border-top: 1px dashed var(--line); margin-top: 4px; }
.receipt-final span { font-weight: 950; }
.receipt-final strong { font-size: 18px; color: var(--orange); font-weight: 950; }
.receipt-id {
  font-family: ui-monospace, monospace;
  letter-spacing: .04em;
  font-size: 11px;
  color: var(--sub);
}

/* ============ Mobile / PWA polish ============ */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

html, body { overscroll-behavior-y: none; }
body { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

@media (display-mode: standalone) {
  body { background: var(--paper); }
  .stage { padding: 0; }
  .dev-switcher { display: none; }
  .phone {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--paper);
  }
  .screen {
    padding-top: max(18px, var(--safe-top));
    padding-bottom: calc(94px + max(0px, var(--safe-bottom)));
    padding-left: max(18px, var(--safe-left));
    padding-right: max(18px, var(--safe-right));
  }
  .tabbar {
    height: calc(72px + var(--safe-bottom));
    padding-bottom: calc(10px + var(--safe-bottom));
  }
  .toast-layer {
    bottom: calc(88px + var(--safe-bottom));
  }
  .modal {
    bottom: calc(28px + var(--safe-bottom));
  }
}

@media (max-width: 520px) {
  .stage { padding: 0; }
  .dev-switcher { display: none; }
  .phone {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--paper);
  }
  .screen {
    padding-top: max(18px, var(--safe-top));
    padding-bottom: calc(94px + var(--safe-bottom));
    padding-left: max(18px, var(--safe-left));
    padding-right: max(18px, var(--safe-right));
  }
  .tabbar {
    height: calc(72px + var(--safe-bottom));
    padding-bottom: calc(10px + var(--safe-bottom));
  }
  .toast-layer {
    bottom: calc(88px + var(--safe-bottom));
  }
  .modal {
    left: max(18px, var(--safe-left));
    right: max(18px, var(--safe-right));
    width: calc(100% - max(36px, var(--safe-left) + var(--safe-right)));
    transform: none;
    bottom: calc(28px + var(--safe-bottom));
  }
}

/* ============ Install prompt ============ */
.install-prompt {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(96px + var(--safe-bottom));
  width: calc(100% - 28px);
  max-width: 360px;
  background: var(--ink);
  color: white;
  border-radius: 22px;
  padding: 14px 16px;
  box-shadow: 0 18px 36px rgba(17,17,17,.34);
  z-index: 70;
  display: none;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  line-height: 1.4;
}
.install-prompt.show { display: flex; }
.install-prompt strong { font-weight: 950; font-size: 13px; display: block; margin-bottom: 2px; }
.install-prompt em { font-style: normal; color: rgba(255,255,255,.78); font-weight: 800; }
.install-prompt .install-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--orange);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.install-prompt .install-icon img { width: 28px; height: 28px; border-radius: 6px; }
.install-prompt .install-text { flex: 1; min-width: 0; }
.install-prompt button {
  border: 0;
  background: var(--orange);
  color: white;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 950;
  font-size: 12px;
  cursor: pointer;
}
.install-prompt .install-close {
  background: transparent;
  color: rgba(255,255,255,.6);
  font-size: 18px;
  padding: 0 4px;
}

/* Larger tap targets on small screens */
@media (max-width: 520px) {
  .pill { height: 38px; font-size: 13px; }
  .pill-cta { height: 52px; font-size: 14px; }
  .pill.full { height: 52px; }
  .round-btn { width: 38px; height: 38px; }
  .round-btn svg { width: 18px; height: 18px; }
  .item { min-height: 82px; }
  .tab .ico { width: 36px; height: 36px; }
  .tab svg { width: 20px; height: 20px; }
}

/* ============ Beta tag + version mark ============ */
.top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 11px;
}
.top-row .store { margin-bottom: 0; }
.beta-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  cursor: pointer;
  user-select: none;
}
[data-theme="dark"] .beta-tag { background: var(--orange); }

.version-mark {
  margin: 28px 0 6px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: .04em;
}
