:root {
  --bg: #ffffff;
  --paper: #ffffff;
  --ink: #202020;
  --muted: #77736b;
  --line: #ece8f2;
  --accent: #1f6b52;
  --accent-2: #b96d48;
  --danger: #b8453d;
  --soft: #f5f2fb;
  --radius: 14px;
  --shadow: 0 10px 28px rgba(32, 32, 32, 0.08);
}

.utility-head-actions {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  width: 100%;
}

.utility-head-actions .tutorial-link {
  justify-self: end;
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.tutorial-shell {
  align-content: center;
  padding-top: 18px;
  padding-bottom: 12vh;
}

.tutorial-hero {
  padding-block: 20px;
}

.tutorial-note p {
  white-space: pre-wrap;
}

.tutorial-actions {
  gap: 10px;
}

.tutorial-action-wrap {
  display: grid;
  gap: 7px;
}

.tutorial-action {
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 4px;
  min-height: 50px;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  text-align: center;
}

.tutorial-action small {
  display: block;
  width: 100%;
  text-align: center;
  color: rgba(255,255,255,.72);
}

.tutorial-action strong {
  display: block;
  width: 100%;
  text-align: center;
}

.tutorial-action-note {
  padding: 0 6px 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.update-popup-modal {
  z-index: 8200;
  align-items: center;
  padding: 18px;
}

.update-popup-shell {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(420px, calc(100% - 44px));
}

.update-popup-card {
  width: 100%;
  border-radius: 26px;
}

.update-popup-content {
  white-space: pre-wrap;
  line-height: 1.8;
  color: var(--ink);
  text-align: center;
}

.update-popup-close {
  min-width: 128px;
  border-radius: 999px;
}

.update-popup-close:disabled {
  opacity: .72;
  cursor: not-allowed;
  transform: none;
}

@font-face {
  font-family: "ThemeUIFont";
  src: url("/assets/AlimamaFangYuanTiVF-Thin.woff2") format("woff2");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  touch-action: manipulation;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "ThemeUIFont", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

.home-page,
.tool-page {
  position: relative;
  background:
    radial-gradient(circle at -42px 88%, rgba(31, 107, 82, .08) 0 148px, transparent 149px),
    radial-gradient(circle at calc(100% + 58px) 6%, rgba(185, 109, 72, .07) 0 154px, transparent 155px),
    radial-gradient(circle at 92% 62%, rgba(32, 32, 32, .035) 0 74px, transparent 75px),
    #fff;
  background-attachment: fixed;
}

* {
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.btn,
.pill,
summary,
th,
td,
.nav a {
  white-space: nowrap;
  word-break: keep-all;
  writing-mode: horizontal-tb;
}

.shell {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 246, 242, 0.94);
  border-bottom: 1px solid var(--line);
}

.home-page .topbar {
  display: none;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
}

.brand-mark {
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav a,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.nav a:hover,
.pill:hover,
.pill.active {
  color: var(--ink);
  border-color: var(--line);
  background: var(--paper);
}

.hero {
  padding: 34px 0 18px;
}

.product-home {
  padding-top: 10px;
  width: min(720px, calc(100% - 36px));
}

.home-title {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 0 12px;
  text-align: center;
}

.home-title h1 {
  font-size: 30px;
  margin: 0;
}

.home-title p {
  margin: 0;
  color: var(--muted);
}

.home-shortcuts {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-width: 100%;
  padding-top: 8px;
}

.quick-float,
.quick-float-link {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.quick-float-btn {
  min-width: 74px;
  border-radius: 999px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(32, 32, 32, .08);
  background: var(--ink);
  color: #fff;
  box-shadow: 0 12px 30px rgba(32,32,32,.18);
  transform: translateY(0);
  transition: transform .2s ease, box-shadow .2s ease;
}

.quick-float-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.quick-float-btn:hover,
.quick-float-btn:active {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(32,32,32,.22);
}

.home-float-stack {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.home-float-stack .quick-float-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.home-more-menu {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 45;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.home-more-panel {
  display: grid;
  justify-items: end;
  gap: 9px;
  opacity: 0;
  transform: translateY(14px) scale(.98);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.home-more-menu.open .home-more-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.home-more-panel .quick-float-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: auto;
  width: max-content;
  box-shadow: 0 10px 24px rgba(32,32,32,.16);
}

.more-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: auto;
  width: max-content;
}

.more-menu-toggle svg {
  transition: transform .2s ease;
}

.home-more-menu.open .more-menu-toggle svg {
  transform: rotate(90deg);
}

.notice-float {
  position: fixed;
  right: 14px;
  bottom: 86px;
  z-index: 35;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  min-width: 52px;
  height: 52px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(32,32,32,.12);
  display: grid;
  place-items: center;
  padding: 0;
}

.notice-float svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.tool-shell {
  position: relative;
  z-index: 1;
  width: min(620px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 34px;
}

.home-entry-page .tool-shell {
  width: min(500px, calc(100% - 42px));
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-content: center;
  padding: 48px 0 92px;
}

.entry-carousel {
  width: 100%;
  height: clamp(132px, 38vw, 210px);
  overflow: hidden;
  border: 0;
  background: transparent;
  margin: 0 auto 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transform: translateY(0);
}

.entry-carousel-track {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-inline: auto;
  opacity: 0;
  transform: translateY(26px);
}

.entry-carousel-track.marquee {
  justify-content: flex-start;
  width: max-content;
  min-width: 100%;
  padding-left: max(0px, calc((100% - min(82vw, 420px)) / 2));
  animation: entryMarquee 18s linear infinite;
}

.entry-carousel.is-ready .entry-carousel-track {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .34s ease, transform .34s ease;
}

.entry-carousel-track img {
  width: auto;
  max-width: min(82vw, 420px);
  max-height: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 20px;
  display: block;
  background: rgba(255,255,255,.72);
}

.entry-carousel-track:has(img:only-child) {
  width: 100%;
  animation: none;
}

.entry-carousel-track:has(img:only-child) img {
  max-width: 100%;
}

@keyframes entryMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-50% - 5px)); }
}

.tool-hero {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 18px 0 20px;
  text-align: center;
}

.tool-icon {
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
}

.tool-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.tool-hero h1 {
  margin: 0;
  font-size: 28px;
}

.tool-hero p,
.tool-item small {
  margin: 0;
  color: var(--muted);
}

.tool-list {
  display: grid;
  gap: 14px;
  padding: 4px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.home-entry-page .tool-list {
  width: min(430px, calc(100% - 22px));
  margin-inline: auto;
}

.tool-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 15px;
  background: var(--ink);
  border: 1px solid var(--ink);
  color: #fff;
  text-align: center;
  animation: toolUp .34s ease both;
  animation-delay: calc(var(--tool-index, 0) * 42ms);
}

.tool-item:nth-child(1) { --tool-index: 1; }
.tool-item:nth-child(2) { --tool-index: 2; }
.tool-item:nth-child(3) { --tool-index: 3; }
.tool-item:nth-child(4) { --tool-index: 4; }
.tool-item:nth-child(5) { --tool-index: 5; }
.tool-item:nth-child(n+6) { --tool-index: 6; }

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

.tool-item.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.tool-item.dark {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.tool-item.custom-tool-item {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.tool-item.dark small {
  color: rgba(255,255,255,.72);
}

.tool-icon {
  width: 42px;
  height: 42px;
  background: var(--ink);
  color: #fff;
}

.tool-item.dark .tool-icon {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.tool-item strong,
.tool-item small {
  display: block;
  min-width: 0;
}

.tool-item strong {
  width: 100%;
  text-align: center;
}

.tool-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(32,32,32,.12);
}

.home-announcement {
  width: min(430px, calc(100% - 22px));
  margin: 14px auto 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  line-height: 1.75;
  white-space: pre-wrap;
  box-shadow: 0 10px 24px rgba(32,32,32,.08);
  animation: toolUp .34s ease both;
}

.download-page {
  background:
    radial-gradient(circle at 12% 4%, rgba(255, 141, 188, .16) 0 148px, transparent 149px),
    radial-gradient(circle at 90% 16%, rgba(119, 191, 255, .14) 0 130px, transparent 131px),
    radial-gradient(circle at 50% 92%, rgba(255, 209, 94, .16) 0 170px, transparent 171px),
    #fff;
}

.download-shell {
  width: min(520px, calc(100% - 34px));
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 18px 0 28px;
  display: grid;
  align-content: center;
  gap: 14px;
}

.download-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.download-back,
.download-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
}

.download-back {
  color: var(--ink);
  font-weight: 800;
}

.download-back svg,
.download-share-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.download-share-btn {
  min-width: auto;
  width: max-content;
  padding-inline: 14px;
}

.download-hero {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 22px 18px;
  border: 1px solid rgba(32,32,32,.06);
  border-radius: 26px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 18px 40px rgba(255, 133, 180, .14);
  text-align: center;
}

.download-logo {
  width: 86px;
  height: 86px;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 14px 26px rgba(32,32,32,.12);
}

.download-hero h1 {
  margin: 4px 0 0;
  font-size: 28px;
}

.download-hero p,
.download-action small,
.download-note p {
  margin: 0;
  color: var(--muted);
}

.download-card,
.download-note {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 12px 30px rgba(32,32,32,.08);
}

.download-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.download-card-title {
  padding: 0 4px 2px;
  font-weight: 900;
}

.download-action {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 74px;
  padding: 12px;
  border-radius: 18px;
  background: #f8fbff;
  border: 1px solid rgba(32,32,32,.06);
}

.download-action.ios {
  background: #fff8fc;
}

.download-action strong,
.download-action small {
  display: block;
}

.download-action strong {
  margin-bottom: 4px;
  font-size: 16px;
}

.download-action-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
}

.download-action-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.download-note {
  padding: 14px 16px;
  line-height: 1.7;
}

.download-note strong {
  display: block;
  margin-bottom: 4px;
}

.poster-card {
  width: min(520px, calc(100% - 24px));
}

.poster-body {
  display: grid;
  justify-items: center;
}

.poster-canvas {
  width: min(100%, 420px);
  height: auto;
  border-radius: 20px;
  box-shadow: 0 16px 42px rgba(32,32,32,.16);
  background: #fff;
}

.tool-back {
  display: block;
  width: max-content;
  margin: 18px auto 0;
  color: var(--muted);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 22px;
  align-items: stretch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 260px;
}

.eyebrow {
  color: var(--accent-2);
  font-weight: 700;
  margin-bottom: 12px;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.admin-main h1 {
  font-size: clamp(24px, 3vw, 36px);
}

.lead {
  max-width: 620px;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 16px;
}

.hero-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.carousel {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--soft);
  border: 1px solid var(--line);
}

.carousel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .35s ease;
}

.carousel img.active {
  opacity: 1;
}

.quick-redeem {
  display: grid;
  gap: 12px;
}

.segment {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 16px;
}

.quick-redeem h2 {
  margin: 0;
  font-size: 21px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius);
  min-height: 44px;
  padding: 0 12px;
  outline: none;
}

.textarea {
  min-height: 88px;
  padding: 12px;
  resize: vertical;
}

.tall-textarea {
  min-height: 170px;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(32, 32, 32, 0.08);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: max-content;
  min-height: 42px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: #000;
}

.btn.secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}

.admin-actions > .btn.secondary,
.admin-actions .action-menu-body .btn.secondary {
  background: #1768d1;
  border-color: #1768d1;
  color: #fff;
}

.admin-actions > .btn:not(.secondary):not(.warn),
.input-action > .btn.secondary,
.input-action button.btn.secondary {
  background: #0f8f5f;
  border-color: #0f8f5f;
  color: #fff;
}

.action-menu > summary.btn.secondary {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.admin-actions > .pill {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.admin-actions > .check-row {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding-inline: 0;
}

.admin-actions > .pill.active {
  background: #0f8f5f;
  border-color: #0f8f5f;
}

.btn.warn {
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.btn.logout-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn.logout-danger:hover {
  background: #9f332d;
  border-color: #9f332d;
}

.home-pill {
  gap: 6px;
}

.home-pill svg,
.auth-home-link svg,
.utility-back svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}

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

.input-action button {
  order: -1;
}

.inline-upload {
  width: max-content;
  margin-top: 8px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin-right: 18px;
  color: var(--ink);
  cursor: pointer;
}

.table-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 14px 0 14px;
}

.search-action {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0;
}

.search-action .input {
  border-radius: 12px 0 0 12px;
  min-height: 52px;
}

.search-action .btn {
  order: initial;
  min-height: 52px;
  border-radius: 0 12px 12px 0;
  padding-inline: 20px;
}

.combo-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: stretch;
  min-width: min(360px, 100%);
}

.combo-search .input {
  width: 100%;
  border-radius: 12px 0 0 12px;
}

.combo-search .select {
  width: 48px;
  min-width: 48px;
  padding-inline: 0;
  border-left: 0;
  border-radius: 0 12px 12px 0;
  color: transparent;
  cursor: pointer;
  background:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%) calc(50% - 4px) 50% / 7px 7px no-repeat,
    linear-gradient(135deg, var(--ink) 50%, transparent 50%) calc(50% + 4px) 50% / 7px 7px no-repeat,
    #fff;
}

.combo-search .select option {
  color: var(--ink);
}

.product-combo {
  position: relative;
  display: block;
  width: 100%;
  color: var(--ink);
  font-size: 14px;
}

.product-combo .input {
  padding-right: 36px;
  background:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%) calc(100% - 22px) 50% / 7px 7px no-repeat,
    linear-gradient(135deg, var(--ink) 50%, transparent 50%) calc(100% - 14px) 50% / 7px 7px no-repeat,
    #fff;
}

.product-combo-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 80;
  display: block;
  max-height: min(320px, 52vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(32, 32, 32, 0.12);
  padding: 6px;
}

.product-combo-option,
.product-combo-empty {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  padding: 10px 12px;
}

.product-combo-option {
  cursor: pointer;
}

.product-combo-option:hover,
.product-combo-option.active {
  background: #f4f7f6;
}

.product-combo-empty {
  color: var(--muted);
}

.inline-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 260px;
  min-width: min(100%, 220px);
  max-width: 100%;
}

.inline-search.wide-search {
  flex-basis: 340px;
}

.inline-search .input,
.inline-search .combo-search {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.inline-search .btn {
  flex: 0 0 auto;
  min-width: 70px;
}

.inline-toggle-field .inline-toggle-control {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.inline-toggle-field .select {
  flex: 1 1 auto;
  min-width: 0;
}

.mini-check {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.field small {
  color: var(--danger);
  font-size: 12px;
  margin-left: 6px;
  font-weight: 700;
}

.bulk-product-modal {
  width: min(560px, calc(100% - 18px));
}

.bulk-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bulk-edit-grid .field > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.image-mini-btn {
  min-height: 28px;
  padding-inline: 10px;
}

.category-row,
.sort-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  align-items: center;
  border: none;
  box-shadow: none;
  scrollbar-width: none;
}

.category-row::-webkit-scrollbar,
.sort-row::-webkit-scrollbar {
  display: none;
}

.category-row {
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.category-row + .category-row,
.toolbar + .category-row {
  margin-top: 12px;
}

.utility-page .topbar {
  display: none;
}

.utility-page .hero {
  padding-top: 28px;
}

.utility-page .narrow-page {
  width: min(720px, calc(100% - 40px));
}

.utility-page .result-box {
  animation: softUp .26s ease both;
}

.utility-page .segment {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.utility-page .hero-panel {
  margin-inline: auto;
}

.utility-page {
  background:
    radial-gradient(circle at 0 12%, rgba(31, 107, 82, .07) 0 128px, transparent 129px),
    radial-gradient(circle at 100% 72%, rgba(185, 109, 72, .055) 0 118px, transparent 119px),
    #fff;
}

.category-row .pill,
.sort-row .pill,
.nav a,
.nav .pill {
  flex: 0 0 auto;
}

.sort-row {
  padding: 4px;
  justify-content: center;
  gap: 3px;
  border-radius: 999px;
  background: #f4f4f4;
  margin-bottom: 2px;
}

.category-row .pill,
.sort-row .pill {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border-color: rgba(32,32,32,.08);
  background: rgba(255,255,255,.78);
  color: var(--muted);
  font-size: 13px;
  box-shadow: none;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.sort-row .pill {
  flex: 1 1 0;
  border-color: transparent;
  background: transparent;
}

.sort-row .pill svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.category-row .pill.active,
.sort-row .pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding-bottom: 24px;
}

@media (min-width: 980px) {
  .product-home .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.product-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(32, 32, 32, .055);
  border-radius: 16px;
  background: var(--paper);
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(32, 32, 32, 0.065);
  content-visibility: auto;
  contain-intrinsic-size: 260px;
  transform: translateY(0) scale(1);
  opacity: 1;
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
  will-change: transform, opacity;
}

.product-card.product-enter {
  transform: translate3d(0, 42px, 0);
  opacity: 0;
  transition: transform .5s cubic-bezier(.16,.92,.24,1), opacity .36s ease, box-shadow .24s ease, border-color .24s ease;
  transition-delay: var(--card-delay, 0ms);
}

.product-card.product-enter.product-visible {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

.product-card:hover {
  transform: translateY(0) scale(1);
  border-color: rgba(32, 32, 32, .12);
  box-shadow: 0 10px 24px rgba(32,32,32,.095);
}

.product-card.product-enter.product-visible:hover {
  transform: translate3d(0, 0, 0);
}

.product-card:active {
  transform: translateY(-2px) scale(.985);
}

.product-card.product-enter.product-visible:active {
  transform: translateY(-2px) scale(.985);
}

.product-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f8f6fc;
  overflow: hidden;
}

.product-id {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 253, 250, .94);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}

.product-card:hover img {
  transform: scale(1.045);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 250, .94);
  border-radius: 999px;
  min-height: 26px;
  padding: 0 9px;
  color: var(--muted);
  font-size: 12px;
}

.stock-badge {
  position: absolute;
  left: 8px;
  top: 8px;
}

.soldout-mask {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(32, 32, 32, .54);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
}

.product-body {
  display: grid;
  gap: 6px;
  padding: 10px;
  position: relative;
}

.product-title {
  min-height: 32px;
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.product-title.centered {
  min-height: 30px;
  text-align: center;
  display: grid;
  place-items: center;
}

.compact-product {
  gap: 10px;
  padding-bottom: 12px;
}

.card-bottom-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  min-height: 42px;
}

.heat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  white-space: nowrap;
}

.heat svg {
  width: 16px;
  height: 16px;
  fill: var(--ink);
}

.product-loading {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 120px;
  color: var(--muted);
  font-size: 13px;
}

.product-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 120px;
  color: var(--muted);
  font-size: 13px;
}

.product-load-tip {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 4100;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(32, 32, 32, .92);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
  box-shadow: 0 12px 30px rgba(0,0,0,.16);
  animation: loadTipFade .2s ease both;
}

.product-load-tip i {
  width: 34px;
  height: 2px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.22);
  position: relative;
}

.product-load-tip i::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 45%;
  border-radius: inherit;
  background: #fff;
  animation: loadingLine 1.1s cubic-bezier(.45,0,.2,1) infinite;
}

.product-load-tip.is-end i {
  display: none;
}

.product-load-tip.is-end {
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
}

.more-loading {
  min-height: 68px;
  pointer-events: none;
}

.product-loading::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ink);
  opacity: .34;
  animation: softPulse 1.1s ease-in-out infinite;
}

.product-loading i {
  position: relative;
  width: 54px;
  height: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(32,32,32,.08);
}

.product-loading i::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 45%;
  border-radius: inherit;
  background: var(--ink);
  animation: loadingLine 1.25s cubic-bezier(.45,0,.2,1) infinite;
}

@keyframes softPulse {
  0%, 100% { transform: scale(.72); opacity: .25; }
  50% { transform: scale(1); opacity: .52; }
}

@keyframes loadingLine {
  from { transform: translateX(-105%); }
  to { transform: translateX(230%); }
}

@keyframes loadTipFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.price {
  color: var(--accent);
  font-weight: 900;
  font-size: 18px;
}

.load-more-wrap {
  display: grid;
  place-items: center;
  padding: 0 0 70px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 18px 18px;
  background: rgba(32, 32, 32, .48);
}

.modal.open {
  display: flex;
}

#previewModal {
  align-items: flex-start;
  padding-top: 7vh;
}

#zoomModal,
#imagePreviewModal {
  align-items: center;
  padding: 18px;
  background: rgba(24, 24, 24, .72);
}

#zoomModal {
  z-index: 7200;
  overscroll-behavior: none;
  touch-action: none;
}

html.zoom-modal-open,
body.zoom-modal-open {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.sheet-modal {
  align-items: flex-end;
  padding: 12vh 0 0;
  background: rgba(32, 32, 32, .38);
}

.modal-card {
  width: min(760px, 100%);
  max-height: min(86vh, 820px);
  max-height: min(86dvh, 820px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: 0 22px 70px rgba(0,0,0,.24);
  overscroll-behavior: contain;
}

#previewModal.open .product-preview-card {
  animation: softUp .38s cubic-bezier(.16,1,.3,1) both;
}

@keyframes softUp {
  from {
    opacity: 0;
    transform: translateY(82px) scale(.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sheet-modal .modal-card {
  width: 100%;
  max-height: min(78vh, 680px);
  border-radius: 22px 22px 0 0;
  border-inline: none;
  border-bottom: none;
  animation: sheetUp .24s ease-out both;
}

@keyframes sheetUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.modal-head,
.modal-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.search-modal .modal-head {
  border-bottom: 0;
  padding-bottom: 0;
}

.search-modal .modal-body {
  padding-top: 10px;
}

.modal-foot {
  border-top: 1px solid var(--line);
  border-bottom: none;
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--paper);
}

.modal-body {
  min-height: 0;
  padding: 16px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.product-preview-card {
  width: min(400px, calc(100% - 72px));
  border-radius: 28px;
  max-height: min(86vh, 720px);
  max-height: min(86dvh, 720px);
}

.product-preview-card .modal-body {
  flex: 0 1 auto;
  padding-bottom: 12px;
}

.product-preview-card .modal-foot {
  position: static;
  flex: 0 0 auto;
  padding-top: 10px;
}

.preview-single {
  display: grid;
  gap: 7px;
}

.preview-label {
  margin: 0;
  text-align: center;
  font-size: 18px;
}

.preview-image-box {
  position: relative;
  width: min(420px, 100%);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
}

.preview-single h2 {
  margin: 2px 0 0;
  text-align: left;
  font-size: 20px;
  overflow-wrap: anywhere;
}

.modal-meta,
.modal-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  text-align: left;
}

.modal-price {
  color: var(--accent);
  font-weight: 900;
  font-size: 22px;
  text-align: right;
  white-space: nowrap;
}

.preview-info-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.modal-desc.long-desc {
  max-height: 4.5em;
  overflow: hidden;
  cursor: pointer;
}

.modal-desc.long-desc.expanded {
  max-height: none;
}

.back-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.preview-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(40px, auto);
  gap: 8px;
  min-height: 0;
  align-items: stretch;
}

.preview-actions .btn {
  min-height: 40px;
}

.preview-actions.no-buy [data-close] {
  grid-column: 1 / -1;
}

.simple-notice-modal {
  width: min(420px, calc(100% - 48px));
}

#announcementModal {
  align-items: flex-start;
  padding-top: 16vh;
}

.simple-notice-modal .notice-content {
  color: var(--ink);
  line-height: 1.8;
  white-space: pre-wrap;
  text-align: left;
}

.notice-actions {
  display: grid;
  grid-template-columns: 1fr;
  padding-top: 10px;
}

.zoom-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  color: var(--ink);
  cursor: pointer;
}

.zoom-btn svg,
.icon-text-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}

.icon-text-btn {
  gap: 6px;
}

.zoom-card {
  width: min(720px, calc(100% - 28px));
  max-height: min(88vh, 760px);
  max-height: min(88dvh, 760px);
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.zoom-card .modal-body {
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 14px;
  overflow: visible;
}

.image-preview-card {
  width: min(720px, calc(100% - 28px));
  max-height: min(88vh, 760px);
  max-height: min(88dvh, 760px);
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}

.image-preview-card .modal-body {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 14px;
}

.image-preview-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(70vh, 620px);
  max-height: min(70dvh, 620px);
  object-fit: contain;
  border-radius: 18px;
  background: transparent;
  box-shadow: 0 18px 48px rgba(0,0,0,.18);
}

.zoom-track {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: min(76vh, 660px);
  height: min(76dvh, 660px);
  margin: 0 auto;
  overflow: hidden;
  padding: 0;
  border-radius: 18px;
  background: transparent;
  border: 0;
  box-shadow: none;
  cursor: zoom-in;
  touch-action: none;
  user-select: none;
  contain: layout paint;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  isolation: isolate;
}

.zoom-close-btn {
  min-width: 112px;
  min-height: 42px;
  padding-inline: 24px;
  border-radius: 14px;
  background: #111;
  color: #fff;
  box-shadow: 0 12px 28px rgba(0,0,0,.22);
}

.zoom-image {
  display: block;
  flex: 0 0 auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 18px;
  background: transparent;
  box-shadow: 0 18px 48px rgba(0,0,0,.2);
  transform-origin: center center;
  transition: none;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translate3d(0, 0, 0) scale(1);
  will-change: transform;
  contain: paint;
}

.zoom-track.is-zoomed {
  cursor: grab;
}

.zoom-track .zoom-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.zoom-track .zoom-image.is-wide {
  width: auto;
  height: auto;
}

.zoom-track .zoom-image.is-tall {
  width: auto;
  height: auto;
}

.zoom-track .zoom-image.is-square {
  width: auto;
  height: auto;
}

.pay-sheet-head {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 4px 0 2px;
  text-align: center;
}

.pay-sheet-head h2 {
  margin: 0;
  font-size: 22px;
}

.pay-sheet-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.pay-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 2px 0 4px;
}

.pay-steps span {
  display: grid;
  place-items: center;
  min-height: 32px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
}

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

.pay-choice {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.pay-choice svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
  stroke: currentColor;
}

.pay-choice.alipay {
  color: #1677ff;
}

.pay-choice.wxpay {
  color: #16a34a;
}

.pay-choice span {
  color: var(--ink);
  font-weight: 700;
}

.pay-choice i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
}

.pay-choice.active {
  border-color: currentColor;
}

.pay-choice.alipay.active {
  background: #eef6ff;
}

.pay-choice.wxpay.active {
  background: #eefbf3;
}

.pay-choice.active i::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  margin: 3px;
  border-radius: 50%;
  background: currentColor;
}

.action-row,
.outside-actions,
.admin-actions,
.login-links,
.admin-topline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.outside-actions {
  margin-top: 12px;
}

.outside-actions.single {
  justify-content: center;
}

.admin-topline {
  justify-content: flex-end;
  margin-bottom: 10px;
}

.admin-actions > [id^="refresh"] {
  order: 90;
  margin-left: auto;
}

.login-links {
  justify-content: space-between;
  color: var(--muted);
}

.link-button {
  border: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
}

.mini-tool {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 700;
}

.danger-text {
  color: var(--danger);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.status-badge.green {
  color: #147342;
  background: #e8f7ee;
}

.status-badge.blue {
  color: #2565b6;
  background: #eaf3ff;
}

.status-badge.red {
  color: #b83a32;
  background: #fff0ee;
}

.status-badge.gray {
  color: #5d6470;
  background: #f1f2f4;
}

.status-action {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.icon-pill {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
}

.nav-close-btn {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.auth-page #loginView {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 18px;
  padding-block: 28px;
}

.auth-page {
  background:
    radial-gradient(circle at 12% 8%, rgba(31, 107, 82, .075) 0 138px, transparent 139px),
    radial-gradient(circle at 92% 86%, rgba(185, 109, 72, .06) 0 150px, transparent 151px),
    #fff;
}

.auth-home-link,
.utility-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(32, 32, 32, .055);
}

.auth-title,
.utility-head {
  display: grid;
  gap: 8px;
}

.auth-title h1,
.utility-head h1 {
  margin: 0;
  font-size: 26px;
}

.auth-title p,
.utility-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-page #loginView .hero-panel,
.utility-page .hero-panel {
  border-radius: 22px;
  border-color: rgba(32,32,32,.08);
  box-shadow: 0 12px 34px rgba(32,32,32,.07);
}

.utility-head {
  margin-bottom: 14px;
  padding: 4px 0 2px;
}

.utility-page .segment {
  justify-content: flex-start;
  gap: 8px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
}

.utility-page .segment .pill {
  border-color: transparent;
  background: transparent;
}

.utility-page .segment .pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.icon-pill svg,
.notice-nav-btn svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.notice-nav-btn {
  gap: 8px;
}

.narrow-page {
  max-width: 720px;
}

.notice-modal {
  width: min(520px, 100%);
}

.result-wrap {
  margin-top: 14px;
}

.delivery-pre,
.detail-pre {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  margin: 8px 0 0;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--soft);
  color: var(--ink);
  font-family: inherit;
}

.compact-select {
  width: min(260px, 100%);
}

.child-row td {
  background: #fbf8f1;
}

.preview-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.preview-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.thumb-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.thumb-row::-webkit-scrollbar {
  display: none;
}

.thumb-row img {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  scroll-snap-align: start;
}

.result-box,
.notice {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  padding: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.utility-page .result-box,
.utility-page .quick-redeem {
  border-radius: 24px;
}

.detail-list {
  display: grid;
  gap: 8px;
}

.detail-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow-x: visible;
  white-space: normal;
  font-size: 13px;
  text-align: left;
}

.detail-row > span:first-child {
  color: var(--muted);
}

.detail-row strong {
  font-weight: 700;
  overflow-wrap: anywhere;
  text-align: left;
  justify-self: start;
}

.detail-row > :not(span) {
  justify-self: start;
  text-align: left;
}

.detail-row .status-badge {
  width: auto;
  min-width: 0;
}

.detail-row:has(.delivery-content-block),
.detail-row-delivery {
  grid-template-columns: 1fr;
}

.detail-row:has(.delivery-content-block) > span:first-child,
.detail-row-delivery > span:first-child {
  font-weight: 800;
  color: var(--ink);
}

.delivery-content-block {
  min-width: 0;
  width: 100%;
}

.delivery-section-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.delivery-section {
  min-width: 0;
}

.delivery-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  min-width: 0;
}

.delivery-section-head b {
  font-size: 13px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.delivery-section-head .pill {
  flex: 0 0 auto;
  max-width: 100%;
}

.review-switch {
  align-items: flex-start;
  gap: 8px;
}

.review-switch span {
  display: block;
  flex: 1 1 100%;
  margin-left: 24px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.category-toggle {
  gap: 4px;
}

.detail-copy {
  cursor: pointer;
  color: var(--accent);
  text-decoration: underline;
}

.code-copy {
  border: 0;
  background: transparent;
  color: #0f766e;
  cursor: pointer;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.withdrawal-action {
  border-color: #16a34a;
  background: #dcfce7;
  color: #166534;
}

.withdrawal-action.pending {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1d4ed8;
}

.sidebar {
  background: #f8fafc;
}

.side-nav .btn.secondary,
.side-nav summary.btn.secondary {
  border-color: #d7dde6;
  background: #fff;
  color: #111827;
}

.side-nav .btn.secondary:hover,
.side-nav summary.btn.secondary:hover {
  border-color: #111827;
  background: #f1f5f9;
}

.notice {
  background: #f3efe8;
  color: var(--muted);
}

.order-query-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.query-section-title {
  display: block;
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.order-query-item:last-child {
  border-bottom: none;
}

.admin-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100vh;
}

.mobile-admin-bar {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.side-nav {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.nav-group {
  display: grid;
  gap: 8px;
}

.nav-group summary {
  list-style: none;
  position: relative;
  padding-right: 28px;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-50%) rotate(-45deg);
  transition: transform .18s ease;
}

.nav-group[open] summary::after {
  transform: translateY(-65%) rotate(45deg);
}

.nav-sub {
  display: grid;
  gap: 6px;
  padding-left: 10px;
}

.side-nav .btn,
.side-nav summary {
  position: relative;
  justify-content: flex-start;
  text-align: left;
}

.nav-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: none;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(184, 69, 61, .28);
}

.nav-badge.show {
  display: inline-block;
}

.pill-count {
  display: none;
  min-width: 18px;
  height: 18px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

.pill-count.show {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.side-nav .btn.active,
.nav-group.has-active > summary {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.nav-group.has-active > summary::after {
  border-color: currentColor;
}

.admin-main {
  padding: 22px;
}

.admin-main > section {
  align-content: start;
  gap: 12px;
}

.admin-main > section:not(.hidden) {
  display: grid;
}

.admin-main > section > h1 {
  margin: 0;
}

.admin-main > section > .panel {
  min-width: 0;
}

.admin-main > section > .admin-actions {
  padding: 10px;
  border: 1px solid rgba(32, 32, 32, .06);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.92));
  box-shadow: 0 10px 26px rgba(17, 24, 39, .05);
}

.admin-main > section > .panel,
.admin-main > section > .table-wrap,
.admin-main > section > .form-grid {
  box-shadow: 0 12px 34px rgba(17, 24, 39, .045);
}

.admin-main .section-head {
  padding: 2px 0;
}

.admin-main .section-head strong {
  font-size: 15px;
}

.admin-main > section > .admin-actions,
.admin-main > section > .category-row:first-of-type {
  margin-top: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.stat,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 14px;
}

.stat-button {
  width: 100%;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  appearance: none;
}

.stat-button:hover {
  border-color: var(--ink);
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.dashboard-block {
  margin-top: 12px;
}

.dashboard-block h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.chart-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.dashboard-period-tabs {
  margin: 10px 0 2px;
}

.dashboard-period-tabs .pill {
  min-width: 68px;
  justify-content: center;
}

.wave-chart {
  display: grid;
  gap: 8px;
  min-height: 180px;
}

.wave-chart svg {
  width: 100%;
  height: 150px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(to bottom, transparent 24%, var(--line) 25%, transparent 26%),
    linear-gradient(to bottom, transparent 49%, var(--line) 50%, transparent 51%),
    linear-gradient(to bottom, transparent 74%, var(--line) 75%, transparent 76%),
    #fff;
}

.wave-line {
  filter: drop-shadow(0 6px 10px rgba(32, 32, 32, .06));
  transition: opacity .2s ease, stroke-width .2s ease;
}

.wave-labels {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.rank-list {
  display: grid;
  gap: 10px;
}

.rank-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.rank-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f8f7f5;
  color: var(--rank-color);
  font-size: 13px;
}

.rank-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.rank-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.rank-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-title strong {
  flex: 0 0 auto;
}

.rank-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.rank-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--rank-color);
}

.action-menu {
  position: relative;
}

.action-menu summary {
  list-style: none;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu-body {
  position: absolute;
  z-index: 950;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  gap: 7px;
  width: max-content;
  min-width: max(104px, 100%);
  max-width: min(220px, calc(100vw - 28px));
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.action-menu-body .btn {
  width: auto;
  min-width: 104px;
  min-height: 38px;
  padding-inline: 12px;
  justify-self: center;
  white-space: nowrap;
}

.merchant-filter-tabs .action-menu {
  display: inline-grid;
  justify-items: center;
}

.merchant-filter-tabs .action-menu summary {
  justify-self: center;
}

.merchant-filter-tabs .action-menu-body {
  left: 50%;
  transform: translateX(-50%);
  min-width: 96px;
  max-width: calc(100vw - 48px);
}

.merchant-filter-tabs .action-menu-body .btn {
  min-width: 86px;
}

.action-menu-body .btn.active {
  background: #0f8f5f;
  border-color: #0f8f5f;
  color: #fff;
}

.action-menu-body .select {
  width: min(190px, calc(100vw - 52px));
  min-width: 124px;
}

.form-top-actions {
  display: flex;
  justify-content: flex-start;
  margin-bottom: -4px;
}

.table-wrap {
  overflow-x: auto;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.table-wrap th,
.table-wrap td {
  text-align: center;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

.table-wrap th,
.table-wrap td {
  text-align: center;
}

tbody tr {
  background: #fff;
}

tbody tr:hover td {
  background: #fbf8f1;
}

.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 22px;
}

.table-pager {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 13px;
  overflow-x: auto;
  white-space: nowrap;
}

.account-segment {
  margin-bottom: 12px;
}

input[readonly],
textarea[readonly] {
  background: var(--soft);
  color: var(--muted);
}

.table-pager span,
.table-pager .pager-size {
  order: 1;
  flex: 0 0 auto;
}

.table-pager .pill {
  order: 2;
  flex: 0 0 auto;
}

.pager-size {
  width: auto;
  min-height: 36px;
}

.mini-pill {
  min-height: 28px;
  padding: 4px 8px;
  margin-left: 6px;
}

.qr-preview {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.wallet-balance {
  margin-bottom: 12px;
  max-width: 100%;
  min-width: 0;
}

.wallet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
}

.wallet-head > div {
  min-width: 0;
  flex: 1 1 auto;
}

.wallet-head .btn {
  flex: 0 0 auto;
}

.wallet-balance strong {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.wallet-balance span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.wallet-segment {
  margin-bottom: 12px;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.wallet-view-panel {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.wallet-view-panel .table-wrap {
  width: 100%;
  max-width: 100%;
}

.wallet-view-panel table {
  width: 100%;
  min-width: 860px;
}

th {
  color: var(--muted);
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.merchant-edit-page {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.merchant-edit-tabs {
  margin-bottom: 2px;
}

.form-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 0;
  border: none;
  background: transparent;
}

.textarea-action {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.textarea-action .btn {
  margin-top: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.delivery-field-list {
  display: grid;
  gap: 8px;
}

.delivery-field-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 2px;
}

.delivery-field-row .check-row {
  min-width: max-content;
  white-space: nowrap;
  flex-wrap: nowrap;
}

.bonus-list {
  display: grid;
  gap: 8px;
}

.bonus-row {
  display: grid;
  grid-template-columns: auto minmax(0, .8fr) minmax(0, 1.2fr) auto;
  gap: 8px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 2px;
}

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

.card-price-grid.card-price-tree {
  grid-template-columns: 1fr;
}

.card-price-group {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.card-price-parent-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.card-price-toggle {
  min-width: 48px;
}

.card-price-toggle.empty-toggle {
  opacity: .45;
  pointer-events: none;
}

.card-price-children {
  display: grid;
  gap: 8px;
  padding-left: 56px;
}

.card-price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.card-price-row span {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  white-space: normal;
  word-break: break-all;
}

.card-price-row.child-price span {
  color: var(--muted);
}

.card-price-row.parent-price span {
  font-weight: 800;
  color: var(--ink);
}

.card-price-row .input {
  min-height: 38px;
  padding: 0 8px;
}

.delivery-template-list {
  display: grid;
  gap: 12px;
}

.latest-code-panel {
  display: grid;
  gap: 10px;
}

.latest-code-text {
  min-height: 210px;
  white-space: pre;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.auth-switch {
  margin: 0 auto 12px;
  justify-content: center;
}

.auth-bottom-link {
  display: flex;
  justify-content: center;
  margin-top: -4px;
}

.distributor-note {
  display: grid;
  gap: 6px;
  text-align: left;
}

.distributor-note p {
  margin: 0;
  line-height: 1.75;
}

.dist-price-list {
  display: grid;
  gap: 10px;
}

.dist-price-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.dist-price-card div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dist-price-card strong,
.dist-price-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dist-price-card span {
  color: var(--muted);
  font-size: 12px;
}

.dist-price-card b {
  flex: 0 0 auto;
  color: var(--ink);
}

.compact-filter {
  gap: 8px;
}

.pay-choice-grid {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.permission-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.permission-parent {
  font-weight: 800;
}

.permission-child {
  margin-left: 16px;
}

.bonus-row .textarea {
  min-height: 64px;
}

.sort-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.icon-btn {
  min-width: max-content;
}

.delivery-redeem-fields {
  display: grid;
  gap: 10px;
}

.detail-field-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.detail-field-copy {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  min-height: 30px;
  padding: 0 9px;
  cursor: pointer;
  white-space: nowrap;
}

.full {
  grid-column: 1 / -1;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed !important;
  left: 50%;
  top: max(12px, env(safe-area-inset-top));
  z-index: 9999;
  transform: translateX(-50%);
  max-width: min(420px, calc(100% - 28px));
  background: var(--ink);
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 18px;
  padding: 11px 15px;
  box-shadow: 0 14px 42px rgba(17, 24, 39, .18);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  pointer-events: none;
  animation: toastDrop .22s ease both;
}

.toast[data-type="success"] {
  background: var(--accent);
}

.toast[data-type="error"] {
  background: var(--danger);
}

@keyframes toastDrop {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 760px) {
  .home-page,
  .tool-page {
    background-attachment: scroll;
  }

  .modal {
    z-index: 4000;
    padding: 14px 12px calc(96px + env(safe-area-inset-bottom));
    align-items: flex-start;
  }

  .modal-card {
    max-height: calc(100vh - 122px);
    max-height: calc(100dvh - 122px);
  }

  .sheet-modal {
    align-items: flex-end;
    padding: 12vh 0 0;
  }

  .sheet-modal .modal-card {
    max-height: min(78vh, 680px);
    max-height: min(78dvh, 680px);
  }

  .modal-body {
    min-height: 0;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  #zoomModal,
  #imagePreviewModal {
    align-items: center;
    padding: 16px;
  }

  #zoomModal .modal-card,
  #imagePreviewModal .modal-card {
    max-height: none;
  }

  .zoom-track {
    width: 100%;
    height: min(74vh, 660px);
    height: min(74dvh, 660px);
    border-radius: 18px;
  }

  .zoom-image {
    border-radius: 16px;
  }

  .bulk-edit-grid {
    grid-template-columns: 1fr;
  }

  .inline-toggle-field .inline-toggle-control {
    gap: 6px;
  }

  #detailModal .modal-card,
  #withdrawalModal .modal-card,
  #codeSearchModal .modal-card {
    width: min(560px, calc(100% - 8px));
  }

  #detailModal .outside-actions,
  #withdrawalModal .action-row {
    position: sticky;
    bottom: -16px;
    z-index: 3;
    flex-wrap: wrap;
    overflow: visible;
    margin: 12px -2px -16px;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, #fff 72%, rgba(255,255,255,.88));
  }

  .topbar-inner {
    flex-wrap: wrap;
    padding: 8px 0;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
  }

  .topbar .nav {
    display: none;
  }

  .sort-row,
  .category-row {
    justify-content: flex-start;
  }

  .hero-grid,
  .toolbar,
  .preview-layout,
  .admin-layout,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 22px;
  }

  .hero-copy {
    min-height: auto;
  }

  .products-grid {
    gap: 10px;
  }

  .product-body {
    padding: 8px;
  }

  .product-title {
    font-size: 13px;
    min-height: 24px;
  }

  .card-bottom-line {
    text-align: center;
    gap: 5px;
    font-size: 11px;
  }

  .product-preview-card {
    width: min(360px, calc(100% - 64px));
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
  }

  .product-preview-card .modal-body {
    padding: 14px;
    flex: 0 1 auto;
  }

  .product-preview-card .modal-foot {
    padding: 10px 14px 14px;
    position: static;
    bottom: auto;
    margin-top: 0;
  }

  .preview-image-box {
    width: min(310px, 100%);
  }

  .preview-img {
    object-fit: cover;
  }

  .thumb-row img {
    flex-basis: 46px;
    width: 46px;
    height: 46px;
  }

  .preview-single h2 {
    font-size: 18px;
  }

  .modal-meta,
  .modal-desc {
    font-size: 13px;
  }

  .modal-price {
    font-size: 19px;
  }

  .preview-info-line {
    grid-template-columns: minmax(0, 1fr) auto;
    font-size: 12px;
  }

  .action-row,
  .outside-actions,
  .table-pager {
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .action-row .btn,
  .outside-actions .btn {
    flex: 0 0 auto;
    width: auto;
  }

  .card-price-grid {
    grid-template-columns: 1fr;
  }

  .card-price-row {
    grid-template-columns: minmax(0, 1fr) 104px;
    padding: 9px;
  }

  .card-price-children {
    padding-left: 14px;
  }

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

  .price {
    font-size: 16px;
  }

  .admin-layout {
    display: block;
    padding-top: 54px;
  }

  .mobile-admin-bar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 45;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 86px;
    align-items: center;
    gap: 8px;
    min-height: 54px;
    padding: 7px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }

  .mobile-admin-bar strong {
    text-align: center;
    font-size: 17px;
    white-space: nowrap;
    justify-self: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-admin-bar .pill {
    width: 86px;
    padding-inline: 6px;
    justify-self: end;
    font-size: 12px;
  }

  .mobile-admin-bar .icon-pill {
    justify-self: end;
    width: 36px;
    height: 36px;
  }

  .merchant-mobile-bar {
    grid-template-columns: 44px minmax(0, 1fr) auto 76px;
  }

  .merchant-mobile-bar .notice-icon.hidden {
    display: inline-flex !important;
    visibility: hidden;
    pointer-events: none;
  }

  .merchant-mobile-bar .pill {
    width: 76px;
  }

  .hamburger-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
  }

  .hamburger-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
  }

  .sidebar {
    display: none;
    position: fixed;
    z-index: 44;
    top: 54px;
    left: 0;
    right: 0;
    max-height: calc(100vh - 54px);
    overflow: auto;
    height: auto;
    padding: 12px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .admin-layout.nav-open .sidebar {
    display: block;
  }

  .sidebar .brand {
    display: none;
  }

  .side-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    margin-top: 0;
  }

  .side-nav .btn,
  .side-nav summary {
    min-width: 0;
    width: 100%;
    min-height: 46px;
    justify-content: flex-start;
    padding: 0 13px;
    font-size: 14px;
    text-align: left;
  }

  .nav-group {
    position: relative;
  }

  .nav-group summary {
    padding-right: 34px;
  }

  .nav-sub {
    position: static;
    min-width: 0;
    padding: 6px 0 2px 12px;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .nav-sub .btn {
    min-height: 40px;
    font-size: 13px;
  }

  .admin-main {
    min-height: calc(100vh - 54px);
    min-height: calc(100dvh - 54px);
    padding: 12px 12px calc(118px + env(safe-area-inset-bottom));
  }

  .admin-main > section {
    gap: 10px;
    padding-bottom: 24px;
    max-width: 100%;
  }

  .admin-main > section > .panel,
  .admin-main > section > .form-grid {
    margin-top: 0 !important;
  }

  .admin-main .panel,
  .admin-main .stat {
    padding: 12px;
    border-radius: 12px;
  }

  .admin-main > section > h1 {
    display: none;
  }

  .admin-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 7px;
    width: 100%;
    overflow: visible;
    padding: 8px;
    border-radius: 12px;
  }

  .admin-actions > .input,
  .admin-actions > .select,
  .admin-actions > .compact-select,
  .admin-actions > .unified-search {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }

  .admin-actions > .input.compact-select,
  .admin-actions > .unified-search,
  .admin-actions > .merchant-picker,
  .admin-actions > .combo-search {
    flex: 1 1 168px;
    width: auto;
    min-width: 0;
  }

  .admin-actions > .btn,
  .admin-actions > .pill,
  .admin-actions > .check-row,
  .admin-actions > .action-menu,
  .admin-actions > .inline-search {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
  }

  .admin-actions > .inline-search {
    flex: 1 1 220px;
    min-width: min(100%, 210px);
  }

  .admin-actions > .inline-search .input,
  .admin-actions > .inline-search .combo-search {
    min-width: 0;
  }

  .admin-actions .btn,
  .admin-actions .pill,
  .admin-actions .check-row,
  .admin-actions summary {
    min-width: max-content;
    width: auto;
    justify-content: center;
    min-height: 38px;
    padding-inline: 12px;
    font-size: 13px;
  }

  .admin-actions .check-row {
    justify-content: flex-start;
  }

  .admin-actions .merchant-picker {
    color: transparent;
  }

  .admin-actions .merchant-picker option {
    color: var(--ink);
  }

  .admin-main > section > .table-wrap {
    border-radius: 14px;
    max-width: 100%;
    margin-bottom: calc(72px + env(safe-area-inset-bottom));
    padding-bottom: 6px;
  }

  .admin-main [data-panel="wallet"] {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    gap: 9px;
  }

  .admin-main [data-panel="wallet"] .wallet-head {
    width: 100%;
    box-sizing: border-box;
    align-items: flex-start;
    gap: 8px;
  }

  .admin-main [data-panel="wallet"] .wallet-head .btn {
    min-width: 56px;
    padding-inline: 12px;
  }

  .admin-main [data-panel="wallet"] .wallet-balance strong {
    font-size: 22px;
    line-height: 1.2;
  }

  .admin-main [data-panel="wallet"] .wallet-segment {
    display: flex;
    width: 100%;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 2px;
  }

  .admin-main [data-panel="wallet"] .wallet-segment .pill {
    flex: 0 0 auto;
    min-width: 86px;
    justify-content: center;
  }

  .admin-main [data-panel="wallet"] .wallet-view-panel {
    width: 100%;
  }

  .admin-main [data-panel="wallet"] .wallet-view-panel .table-wrap {
    margin-bottom: calc(72px + env(safe-area-inset-bottom));
    overflow-x: auto;
    overflow-y: hidden;
  }

  .merchant-edit-page {
    grid-template-columns: 1fr;
  }

  .admin-topline {
    justify-content: flex-start;
    margin: 0 0 8px;
    overflow-x: auto;
  }

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

  .stat strong {
    font-size: 19px;
  }

  h1,
  .admin-main h1 {
    font-size: 28px;
    line-height: 1.16;
  }

  .detail-row {
    grid-template-columns: 86px minmax(0, 1fr);
    font-size: 12px;
  }

  .delivery-section-head {
    align-items: flex-start;
  }

  .delivery-section-head .pill {
    flex: 0 0 auto;
  }

  .action-menu-body {
    position: absolute;
    left: 0;
    right: auto;
    top: calc(100% + 6px);
    bottom: auto;
    z-index: 980;
    width: max-content;
    min-width: max(104px, 100%);
    max-width: min(220px, calc(100vw - 28px));
    max-height: min(56vh, 300px);
    overflow: auto;
  }

  .merchant-filter-tabs .action-menu-body {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    min-width: 96px;
    max-width: calc(100vw - 48px);
  }

  .delivery-field-row {
    grid-template-columns: auto minmax(138px, 1fr) minmax(156px, 1fr) auto auto auto;
  }

  .bonus-row {
    grid-template-columns: auto minmax(132px, .8fr) minmax(190px, 1.2fr) auto;
  }

  .section-head {
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .detail-field-list {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .table-pager .pill,
  .table-pager .select {
    flex: 0 0 auto;
  }

  .table-pager {
    justify-content: flex-start;
    margin-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .table-pager span,
  .table-pager .pager-size {
    order: 1;
  }

  .table-pager span {
    margin-right: 0;
  }

  .table-pager::after {
    content: "";
    display: none;
  }
}
