:root {
  --canvas: var(--wm-color-canvas);
  --panel: var(--wm-color-surface);
  --ink: var(--wm-color-ink);
  --muted: var(--wm-color-muted);
  --muted-soft: var(--wm-color-muted-soft);
  --teal: var(--wm-color-primary);
  --teal-deep: var(--wm-color-action);
  --teal-soft: var(--wm-color-primary-soft);
  --orange: var(--wm-color-accent);
  --line: var(--wm-color-line);
  --line-strong: var(--wm-color-line-strong);
  --page-width: var(--mobile-shell-content-width, 346.56px);
  --device-height: 760px;
  --statusbar-height: 25px;
  --content-gutter: 11px;
  --bottom-nav-height: 62px;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--wm-color-app-bg);
  font-family: var(--wm-font-ui);
  -webkit-font-smoothing: antialiased;
}

button,
input { font: inherit; }

button { border: 0; cursor: pointer; }

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.reference-page {
  position: relative;
  width: min(100%, var(--page-width));
  height: calc(100% - var(--statusbar-height));
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  background: var(--canvas);
}

.reference-scroll {
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.reference-scroll::-webkit-scrollbar { display: none; }

.reference-header,
.reference-header img {
  display: block;
  width: 100%;
  height: auto;
}

.reference-header { position: relative; }
.reference-header-service {
  position: absolute;
  inset: 0 1.5% 0 auto;
  width: 13%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
}
.reference-header-service:focus-visible { outline: 2px solid var(--wm-color-primary); outline-offset: -4px; }

.reference-main {
  position: relative;
  padding: 0 var(--content-gutter) calc(var(--bottom-nav-height) + 24px + env(safe-area-inset-bottom));
}

.reference-search {
  position: relative;
  width: 100%;
  margin: 9px 0 9px;
}

.reference-search > img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--wm-color-line);
  border-radius: 17px;
  box-shadow: 0 4px 12px rgba(var(--wm-action-rgb), .045);
}

.reference-search-input {
  position: absolute;
  inset: 0 8px 0 38px;
  z-index: 2;
  width: calc(100% - 46px);
  padding: 0;
  color: transparent;
  caret-color: transparent;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13px;
}

.reference-search-input::placeholder { color: transparent; }

.reference-search-input.has-value {
  padding: 0 8px;
  color: var(--ink);
  caret-color: var(--ink);
  background: rgba(255, 255, 255, .78);
  border-radius: 12px;
}

.reference-search-submit {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  padding: 0;
  background: transparent;
  border-radius: 999px;
  pointer-events: none;
}

.reference-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 818 / 353;
  background: var(--wm-color-primary-wash);
  border: 1px solid var(--wm-color-line);
  border-radius: 17px;
  isolation: isolate;
  box-shadow: 0 7px 18px rgba(var(--wm-action-rgb), .08);
}

.reference-carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.reference-slide {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  visibility: hidden;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity .38s ease, transform .38s cubic-bezier(.22, .75, .25, 1), visibility 0s linear .38s;
  pointer-events: none;
}

.reference-slide.is-active {
  visibility: visible;
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0s;
  pointer-events: auto;
}

.reference-slide.is-before,
.reference-slide.is-after {
  visibility: visible;
  opacity: 1;
  pointer-events: none;
}

.reference-slide.is-before { transform: translateX(-100%); }
.reference-slide.is-after { transform: translateX(100%); }

.reference-carousel { touch-action: pan-y; }

.reference-slide > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.reference-slide-indicator-cover {
  position: absolute;
  left: 43.5%;
  top: 90.55%;
  z-index: 2;
  width: 13%;
  height: 5.75%;
  pointer-events: none;
  background: linear-gradient(90deg, #cfd0d3 0%, #d0d1d3 48%, #cbcccf 100%);
  border-radius: 999px;
}

.reference-slide-cta-mask {
  position: absolute;
  left: 4.52%;
  top: 60.91%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 23.35%;
  height: 17.56%;
  padding: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    #eef3fa 0 61.27%,
    #edf3fa 61.27% 100%
  );
}

.reference-slide-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96.86%;
  height: 79.03%;
  gap: 6.5px;
  color: #fff;
  font-family: var(--wm-font-family);
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .01em;
  white-space: nowrap;
  background: var(--reference-slide-cta-bg, var(--wm-color-action));
  border-radius: 999px;
}

.reference-slide-cta-arrow {
  display: inline-flex;
  align-self: center;
  align-items: center;
  justify-content: center;
  flex: 0 0 4px;
  width: 4px;
  height: 7px;
  color: #fff;
}

.reference-slide-cta-arrow svg {
  display: block;
  width: 4px;
  height: 7px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reference-carousel-hotspot {
  position: absolute;
  left: 6%;
  bottom: 12%;
  z-index: 3;
  width: 39%;
  height: 27%;
  padding: 0;
  background: transparent;
  border-radius: 999px;
}

.reference-notice {
  position: relative;
  width: 100%;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--wm-color-line);
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(var(--wm-action-rgb), .04);
}

.reference-notice > img {
  display: block;
  width: 100%;
  height: auto;
}

.reference-notice > button {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  background: transparent;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px 3px;
  margin-top: 14px;
  padding: 0 1px;
}

.shortcut-card {
  display: grid;
  grid-template-rows: 39px 16px;
  gap: 5px;
  align-content: start;
  justify-items: center;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font-size: 10px;
  line-height: 16px;
  text-decoration: none;
  white-space: nowrap;
}

.shortcut-card--link { cursor: pointer; }

.shortcut-card img {
  display: block;
  width: 39px;
  height: 39px;
  object-fit: cover;
  transition: transform .2s ease;
}

.shortcut-card span {
  width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
}

.shortcut-card:active img,
.shortcut-card:hover img { transform: translateY(-1px); }

/* Three ranking entrances use distinct filled Tabler glyphs, with the same
   round tile size and optical density as the seven approved shortcuts. */
.shortcut-card .shortcut-icon {
  display: flex;
  width: 39px;
  height: 39px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: visible;
}
.shortcut-icon--value { background: var(--wm-color-primary-soft-strong); }
.shortcut-icon--popular { background: #ffe8d1; }
.shortcut-icon--recommended { background: #e9e7ff; }
.shortcut-card .shortcut-icon img { width: 24px; height: 24px; object-fit: contain; }
.shortcut-card .shortcut-icon--popular img { width: 26px; height: 26px; }

.recommendation-ad {
  width: 100%;
  margin-top: 16px;
  overflow: hidden;
  background: var(--wm-color-primary-wash);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 7px 17px rgba(var(--wm-action-rgb), .075);
}

.recommendation-ad > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 1;
  object-fit: cover;
}

.recommendation-title {
  position: relative;
  margin: 17px 2px 0;
  padding-left: 13px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
  line-height: 25px;
  letter-spacing: -.02em;
}

.recommendation-title::before {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 4px;
  content: "";
  background: var(--teal);
  border-radius: 999px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 8px;
  margin-top: 10px;
}

.product-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 3px 10px rgba(var(--wm-ink-rgb), .035);
  transition: border-color .2s ease, transform .2s ease;
}

.product-image {
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--wm-color-primary-wash);
  border-radius: 13px 13px 0 0;
}

.product-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.product-body { padding: 8px 10px 12px; }

.product-body h3 {
  display: -webkit-box;
  min-height: 38px;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 19px;
  letter-spacing: -.02em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-subtitle {
  min-height: 17px;
  margin: 4px 0 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-row {
  display: grid;
  gap: 3px;
  margin-bottom: 8px;
}

.price-row strong {
  color: var(--orange);
  font-size: 15px;
  font-weight: 800;
  line-height: 18px;
}

.price-row del {
  color: var(--muted-soft);
  font-size: 10px;
  line-height: 13px;
  text-decoration: line-through;
}

.metric-list {
  display: grid;
  gap: 4px;
  color: var(--wm-color-muted-strong);
  font-size: 10px;
  line-height: 18px;
}

.metric-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  column-gap: 6px;
  align-items: center;
  min-height: 23px;
  padding: 2px 4px 2px 2px;
  border-radius: 8px;
  white-space: nowrap;
}

.metric-item img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: cover;
  border-radius: 50%;
}

.metric-item > span {
  min-width: 0;
  overflow: hidden;
  padding-left: 2px;
  text-overflow: ellipsis;
}

.metric-item--flow { background: var(--wm-color-primary-soft); }
.metric-item--fresh { background: var(--wm-color-primary-wash); }
.metric-item--cost { background: var(--wm-color-primary-wash); }

.card-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  padding: 0;
  background: transparent;
}

.reference-empty {
  display: none;
  margin-top: 10px;
  padding: 16px 10px;
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  font-size: 12px;
  text-align: center;
}

.reference-empty:not([hidden]) { display: block; }

.live-float {
  position: absolute;
  right: 8px;
  bottom: calc(var(--bottom-nav-height) + 9px + env(safe-area-inset-bottom));
  z-index: 7;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  width: 132px;
  min-height: 40px;
  padding: 5px 6px;
  background: rgba(255, 255, 255, .97);
  border: 1px solid var(--wm-color-line);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(var(--wm-action-rgb), .17);
  pointer-events: none;
}

.live-float::before {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 5px;
  height: 5px;
  content: "";
  background: #ef9a62;
  border-radius: 50%;
}

.live-float-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  overflow: hidden;
  background: var(--teal-soft);
  border: 1px solid var(--wm-color-line);
  border-radius: 50%;
}

.live-float-icon img {
  display: block;
  width: 17px;
  height: 17px;
  object-fit: contain;
  border-radius: 50%;
}

.live-float-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.live-float-copy strong {
  color: var(--teal-deep);
  font-size: 9px;
  line-height: 12px;
}

.live-float-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-float button {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 4px 5px 4px 6px;
  color: #fff;
  background: var(--teal-deep);
  border-radius: 999px;
  font-size: 8px;
  font-weight: 700;
  line-height: 13px;
  white-space: nowrap;
  pointer-events: auto;
}

.live-float button b {
  font-size: 12px;
  font-weight: 400;
  line-height: 11px;
}

.live-float[hidden] { display: none; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(var(--wm-ink-rgb), .38);
}

.modal {
  width: min(100%, 330px);
  padding: 0 20px 20px;
  overflow: hidden;
  background: var(--wm-color-surface);
  border: 1px solid var(--wm-color-line);
  border-radius: 17px;
  box-shadow: 0 24px 58px rgba(var(--wm-action-rgb), .2);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -20px;
  padding: 15px 20px 13px;
  background: var(--teal-soft);
  border-bottom: 1px solid var(--wm-color-line);
}

.modal h2 {
  margin: 0;
  color: var(--teal-deep);
  font-size: 18px;
}

.modal-close {
  width: 28px;
  height: 28px;
  color: var(--teal-deep);
  background: #fff;
  border: 1px solid var(--wm-color-line);
  border-radius: 50%;
  font-size: 20px;
}

.modal p {
  margin: 14px 0 10px;
  color: var(--wm-color-muted-strong);
  font-size: 13px;
  line-height: 1.7;
}

.modal-note {
  padding: 10px;
  color: var(--wm-color-muted-strong);
  background: var(--teal-soft);
  border-radius: 9px;
  font-size: 11px;
  line-height: 1.55;
}

.modal-primary {
  width: 100%;
  margin-top: 13px;
  padding: 10px;
  color: #fff;
  background: var(--teal-deep);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 350px) {
  :root { --content-gutter: 9px; }

  .shortcut-card { font-size: 9px; }
  .shortcut-card img { width: 36px; height: 36px; }
  .shortcut-card .shortcut-icon { width: 36px; height: 36px; }
  .shortcut-card { grid-template-rows: 36px 15px; }
  .product-body { padding-right: 8px; padding-left: 8px; }
  .product-body h3 { font-size: 14px; }
  .metric-item { grid-template-columns: 20px minmax(0, 1fr); column-gap: 4px; padding-right: 2px; }
  .metric-item img { width: 20px; height: 20px; }
  .live-float { right: 6px; width: 128px; }
}

@media (min-width: 520px) {
  .reference-page { box-shadow: 0 0 0 1px rgba(var(--wm-primary-rgb), .14); }
}

