:root {
  --ink: #15110e;
  --ink-soft: #2b241e;
  --cream: #f7f1e6;
  --cream-deep: #ebe1d1;
  --paper: #fffaf2;
  --line: #d9cdbb;
  --line-dark: #4a4037;
  --muted: #756b60;
  --orange: #c95f3b;
  --orange-dark: #9f4228;
  --gold: #d5a74f;
  --olive: #6e7652;
  --sage: #dfe4d4;
  --danger: #a33f31;
  --danger-soft: #f5dfd9;
  --success: #50613f;
  --success-soft: #e3ead9;
  --shadow: 0 24px 70px rgba(16, 12, 9, 0.3);
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #1a1511;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
}

.demo-shell {
  display: grid;
  grid-template-columns: 320px minmax(520px, 1fr);
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.control-rail {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 28px 24px 24px;
  overflow: hidden;
  color: var(--cream);
  background: var(--ink);
  border-right: 1px solid #342b25;
}

.control-rail::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
}

.rail-brand,
.rail-copy,
.mode-list,
.rail-footer {
  position: relative;
  z-index: 1;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rail-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  background: var(--gold);
  border-radius: 6px;
}

.rail-brand div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rail-brand strong {
  font-size: 16px;
  letter-spacing: 0.02em;
}

.rail-brand span:last-child {
  color: #a99f95;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.rail-copy {
  padding: 64px 0 34px;
}

.rail-kicker {
  margin: 0 0 12px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.rail-copy h1 {
  max-width: 240px;
  margin: 0;
  font-size: 31px;
  line-height: 1.2;
  letter-spacing: 0;
}

.rail-copy > p:last-child {
  max-width: 240px;
  margin: 16px 0 0;
  color: #aaa096;
  font-size: 13px;
  line-height: 1.7;
}

.mode-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mode-button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
  background: transparent;
  border: 1px solid #3a312b;
  border-radius: 7px;
  transition: background 160ms ease, border-color 160ms ease;
}

.mode-button:hover {
  background: #211b17;
  border-color: #5a4b40;
}

.mode-button.active {
  color: var(--ink);
  background: var(--cream);
  border-color: var(--cream);
}

.mode-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--gold);
  background: #2b231e;
  border-radius: 5px;
}

.mode-icon svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.mode-button.active .mode-icon {
  color: var(--orange-dark);
  background: #eadfce;
}

.mode-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.mode-copy strong {
  font-size: 14px;
}

.mode-copy small {
  overflow: hidden;
  color: #938981;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-button.active .mode-copy small {
  color: var(--muted);
}

.mode-index {
  color: #6f645c;
  font-family: var(--mono);
  font-size: 10px;
}

.mode-button.active .mode-index {
  color: #9e8977;
}

.rail-footer {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: auto;
  padding-top: 28px;
}

.local-state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid #362e28;
  border-bottom: 1px solid #362e28;
}

.state-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: #a9b986;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(169, 185, 134, 0.12);
}

.local-state div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.local-state strong {
  color: #d8cec2;
  font-size: 12px;
  font-weight: 600;
}

.local-state span:last-child {
  color: #8e8379;
  font-size: 11px;
}

.reset-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  color: #c9bdb1;
  font-size: 12px;
  cursor: pointer;
  background: transparent;
  border: 1px solid #443a32;
  border-radius: 6px;
}

.reset-button:hover {
  color: var(--cream);
  border-color: #746459;
}

.reset-button svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.device-stage {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 28px 20px;
  background: #e9e1d4;
  background-image:
    linear-gradient(rgba(101, 85, 65, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(101, 85, 65, 0.055) 1px, transparent 1px);
  background-size: 32px 32px;
}

.phone-frame {
  position: relative;
  display: flex;
  width: 422px;
  height: min(890px, calc(100vh - 62px));
  height: min(890px, calc(100dvh - 62px));
  min-height: 620px;
  flex-direction: column;
  overflow: hidden;
  background: var(--cream);
  border: 9px solid #0c0a08;
  border-radius: 34px;
  box-shadow: var(--shadow);
}

.phone-status {
  position: relative;
  display: flex;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  color: #f8f1e7;
  background: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}

.dynamic-island {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 86px;
  height: 20px;
  background: #030303;
  border-radius: 20px;
  transform: translateX(-50%);
}

.status-icons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-icons svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.app-viewport {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  background: var(--cream);
}

.compliance-bar {
  position: relative;
  z-index: 20;
  display: flex;
  min-height: 36px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  color: #f2dfc7;
  font-size: 10px;
  line-height: 1.45;
  background: #2a211b;
  border-bottom: 1px solid #40332a;
}

.compliance-mark {
  display: grid;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  place-items: center;
  color: #2a211b;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
  background: var(--gold);
  border-radius: 50%;
}

.page-view {
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.page-view::-webkit-scrollbar {
  display: none;
}

.page {
  min-height: 100%;
  padding: 0 20px 42px;
  background: var(--cream);
}

.page.home-page,
.page.merchant-login-page,
.page.result-page,
.page.status-page,
.page.apply-page,
.page.store-page {
  padding-right: 0;
  padding-left: 0;
}

.page-home,
.page-store {
  background: var(--cream);
}

.mini-nav {
  position: sticky;
  top: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  min-height: 46px;
  align-items: center;
  padding: 0 12px;
  background: rgba(247, 241, 230, 0.97);
  border-bottom: 1px solid rgba(158, 140, 118, 0.24);
  backdrop-filter: blur(12px);
}

.mini-nav-title {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-side {
  display: inline-flex;
  min-width: 0;
  align-items: center;
}

.nav-side.right {
  justify-content: flex-end;
}

.nav-back,
.nav-text-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 5px;
  padding: 0 5px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: 0;
}

.nav-back svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.page-inner {
  padding: 20px 20px 0;
}

.page-inner.flush {
  padding: 0;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--orange-dark);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-title {
  display: block;
  margin: 0;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: 0;
}

.page-lede {
  display: block;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.section {
  margin-top: 26px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 15px;
  font-weight: 800;
}

.section-meta,
.section-guide {
  color: var(--muted);
  font-size: 10px;
}

.section-guide {
  display: block;
  margin: -3px 0 13px;
  line-height: 1.55;
}

.primary-button,
.secondary-button,
.quiet-button,
.danger-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  border-radius: 6px;
  transition: transform 130ms ease, opacity 130ms ease, background 130ms ease;
}

.primary-button:active,
.secondary-button:active,
.quiet-button:active,
.danger-button:active {
  transform: translateY(1px);
}

.primary-button {
  color: #fff9ef;
  background: var(--orange);
  border: 1px solid var(--orange);
}

.primary-button:hover {
  background: var(--orange-dark);
  border-color: var(--orange-dark);
}

.primary-button:disabled {
  color: #988c7e;
  background: #ddd2c2;
  border-color: #ddd2c2;
}

.secondary-button {
  color: var(--ink);
  background: transparent;
  border: 1px solid #a89885;
}

.secondary-button:hover {
  background: #eee5d8;
}

.quiet-button {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
}

.danger-button {
  color: #fff8f5;
  background: var(--danger);
  border: 1px solid var(--danger);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.full-button {
  width: 100%;
}

.tiny-button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 10px;
}

.inline-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 0;
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  border: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 15px;
}

.field:first-child {
  margin-top: 0;
}

.field-label {
  color: #473d34;
  font-size: 11px;
  font-weight: 700;
}

.required {
  margin-left: 3px;
  color: var(--orange);
}

.input,
.textarea,
.picker-field {
  width: 100%;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #cfc1af;
  border-radius: 5px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.input {
  height: 44px;
  padding: 0 12px;
  font-size: 13px;
}

.textarea {
  min-height: 96px;
  padding: 11px 12px;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: #a79b8d;
}

.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(201, 95, 59, 0.09);
}

.field.has-error .input,
.field.has-error .textarea,
.field.has-error .picker-field {
  border-color: var(--danger);
}

.field-error {
  display: block;
  color: var(--danger);
  font-size: 10px;
  line-height: 1.5;
}

.field-help {
  color: #95897b;
  font-size: 9px;
  line-height: 1.5;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.consent-block {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 11px;
  margin-top: 18px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.consent-block.checked {
  background: #f3ede2;
  border-color: #99876f;
}

.check-box {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  margin-top: 1px;
  color: var(--paper);
  font-size: 12px;
  font-weight: 800;
  background: transparent;
  border: 1px solid #a39482;
  border-radius: 4px;
}

.check-box.checked {
  background: var(--ink);
  border-color: var(--ink);
}

.consent-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.consent-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.consent-note {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.status-pill {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  padding: 4px 8px;
  color: #6d5d4b;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.3;
  background: #e8ddce;
  border-radius: 999px;
}

.status-pill.success {
  color: var(--success);
  background: var(--success-soft);
}

.status-pill.danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.status-pill.waiting {
  color: #88611e;
  background: #f1e3be;
}

.empty-state {
  display: block;
  padding: 24px 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
  border: 1px dashed #cbbcaa;
  border-radius: 6px;
}

/* Home */
.home-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 10px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-sign {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--cream);
  font-size: 14px;
  font-weight: 800;
  background: var(--ink);
  border-radius: 5px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-name {
  font-size: 13px;
  font-weight: 800;
}

.brand-store {
  color: var(--muted);
  font-size: 9px;
}

.home-hero {
  position: relative;
  margin: 8px 14px 0;
  padding: 30px 22px 24px;
  overflow: hidden;
  color: var(--cream);
  background: var(--ink);
  border-radius: 8px;
}

.home-hero::after {
  position: absolute;
  right: -36px;
  bottom: -70px;
  width: 180px;
  height: 180px;
  content: "";
  border: 1px solid rgba(213, 167, 79, 0.23);
  border-radius: 50%;
  box-shadow:
    0 0 0 24px rgba(213, 167, 79, 0.035),
    0 0 0 52px rgba(213, 167, 79, 0.025);
}

.nfc-signal {
  position: relative;
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  margin-bottom: 25px;
}

.nfc-ring {
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(213, 167, 79, 0.42);
  border-radius: 50%;
  animation: signal-pulse 2.8s ease-out infinite;
}

.nfc-ring:nth-child(2) {
  inset: -8px;
  animation-delay: 0.9s;
}

.nfc-core {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
  background: var(--gold);
  border-radius: 50%;
}

@keyframes signal-pulse {
  0% {
    opacity: 0.75;
    transform: scale(0.82);
  }
  75%,
  100% {
    opacity: 0;
    transform: scale(1.16);
  }
}

.home-hero .eyebrow {
  color: var(--gold);
}

.home-store-name {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.18;
}

.home-store-meta {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 8px;
  color: #c9bdb0;
  font-size: 12px;
}

.enter-button {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  margin-top: 26px;
  padding: 0 17px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  background: var(--cream);
  border: 0;
  border-radius: 6px;
}

.enter-button span:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  font-weight: 800;
}

.enter-button small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.enter-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.home-address {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 14px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.home-address div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  padding: 13px 14px;
  background: var(--paper);
}

.home-address span {
  color: var(--muted);
  font-size: 9px;
}

.home-address strong {
  font-size: 11px;
  line-height: 1.55;
}

.mode-entry-section {
  padding: 20px 14px 0;
}

.mode-entry-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.mode-entry-heading strong {
  font-size: 15px;
}

.mode-entry-heading span {
  color: var(--muted);
  font-size: 9px;
}

.home-mode-list {
  border-top: 1px solid var(--line);
}

.home-mode-button {
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  width: 100%;
  min-height: 67px;
  padding: 10px 2px;
  text-align: left;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.home-mode-icon {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  color: var(--orange-dark);
  background: #eadfce;
  border-radius: 5px;
}

.home-mode-icon svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.home-mode-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.home-mode-copy strong {
  font-size: 13px;
}

.home-mode-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-mode-arrow {
  width: 16px;
  fill: none;
  stroke: #8c7f70;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.local-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 20px 14px 0;
  padding: 12px 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
  border-top: 1px solid var(--line);
}

.local-note svg {
  width: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--olive);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

/* Store */
.store-hero-block {
  position: relative;
  padding: 25px 20px 22px;
  overflow: hidden;
  color: var(--cream);
  background: #25201a;
}

.store-hero-block::after {
  position: absolute;
  top: -65px;
  right: -55px;
  width: 190px;
  height: 190px;
  content: "";
  border: 1px solid rgba(213, 167, 79, 0.25);
  border-radius: 50%;
  box-shadow:
    0 0 0 28px rgba(213, 167, 79, 0.035),
    0 0 0 58px rgba(213, 167, 79, 0.02);
}

.store-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.touch-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #ddd1c3;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.touch-dot {
  width: 7px;
  height: 7px;
  background: #b4c28f;
  border-radius: 50%;
}

.dev-tag {
  padding: 3px 6px;
  color: #e8d5b2;
  font-size: 8px;
  border: 1px solid #665544;
  border-radius: 3px;
}

.store-lockup {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 53px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 24px;
}

.store-emblem {
  display: grid;
  width: 53px;
  height: 53px;
  place-items: center;
  color: var(--ink);
  font-size: 23px;
  font-weight: 900;
  background: var(--gold);
  border-radius: 7px;
}

.store-lockup .eyebrow {
  margin-bottom: 5px;
  color: var(--gold);
}

.store-lockup h1 {
  display: block;
  margin: 0;
  font-size: 23px;
  line-height: 1.25;
}

.service-tags {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 17px;
}

.service-tag {
  padding: 4px 7px;
  color: #d8cbbc;
  font-size: 9px;
  background: #352d26;
  border-radius: 3px;
}

.store-service {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 15px;
  color: #afa397;
  font-size: 11px;
  line-height: 1.65;
}

.store-info {
  margin: 0 20px;
  border-bottom: 1px solid var(--line);
}

.store-info-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 9px;
  padding: 12px 0;
  font-size: 11px;
  line-height: 1.55;
  border-top: 1px solid var(--line);
}

.store-info-row:first-child {
  border-top: 0;
}

.store-info-row span {
  color: var(--muted);
}

.store-info-row strong {
  font-weight: 600;
}

.store-body {
  padding: 20px 20px 0;
}

.store-cta {
  width: 100%;
}

.package-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.package-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.package-cover {
  position: relative;
  display: flex;
  min-height: 185px;
  align-items: flex-end;
  padding: 12px 10px;
  overflow: hidden;
  color: var(--ink);
}

.package-cover::before,
.package-cover::after {
  position: absolute;
  top: -26px;
  right: -38px;
  width: 110px;
  height: 110px;
  content: "";
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.25;
}

.package-cover::after {
  top: 20px;
  right: -60px;
  width: 150px;
  height: 150px;
  opacity: 0.13;
}

.cover-amber,
.swatch-amber {
  color: #3d2c16;
  background: #d6ad62;
}

.cover-clay,
.swatch-clay {
  color: #fff8ef;
  background: #a9573f;
}

.cover-olive,
.swatch-olive {
  color: #f9f5e8;
  background: #68744e;
}

.cover-rust,
.swatch-rust {
  color: #fff6ed;
  background: #714331;
}

.cover-label {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.package-body {
  min-width: 0;
  padding: 13px;
}

.package-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.package-name {
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.package-price {
  flex: 0 0 auto;
  color: var(--orange-dark);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 800;
}

.package-description {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.package-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
  color: #6f6255;
  font-size: 9px;
  line-height: 1.5;
}

.fact-divider {
  color: #b3a697;
}

.package-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
  color: #5f5449;
  font-size: 9px;
  line-height: 1.5;
}

.package-item-action {
  width: 100%;
  min-height: 36px;
  margin-top: 11px;
  color: var(--orange-dark);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  background: transparent;
  border: 1px solid #cfb5aa;
  border-radius: 4px;
}

.platform-note {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.platform-note strong {
  display: block;
  font-size: 12px;
}

.platform-note p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

/* Review */
.stepper {
  display: flex;
  gap: 5px;
  margin-top: 18px;
}

.stepper span {
  height: 3px;
  flex: 1;
  background: #ddd0be;
  border-radius: 2px;
}

.stepper span.on {
  background: var(--orange);
}

.step-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.step-heading {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.step-number {
  color: var(--orange-dark);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.6;
}

.step-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.step-title {
  font-size: 13px;
  font-weight: 800;
}

.step-note {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
}

.package-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 19px;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 55px;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.package-choice.selected {
  background: #f4eadc;
  border-color: #9d7c60;
}

.choice-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.choice-title {
  font-size: 11px;
  font-weight: 700;
}

.choice-note {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice-price {
  color: var(--orange-dark);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
}

.choice-check {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--paper);
  font-size: 10px;
  background: transparent;
  border: 1px solid #ae9f8e;
  border-radius: 50%;
}

.package-choice.selected .choice-check {
  background: var(--ink);
  border-color: var(--ink);
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 12px;
}

.rating-option {
  display: flex;
  min-height: 68px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 9px;
  text-align: left;
  cursor: pointer;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.rating-option.selected {
  color: var(--cream);
  background: var(--ink);
  border-color: var(--ink);
}

.rating-label {
  font-size: 12px;
  font-weight: 800;
}

.rating-hint {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

.rating-option.selected .rating-hint {
  color: #bcb0a3;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.keyword-chip {
  min-height: 34px;
  padding: 6px 12px;
  color: #63584c;
  font-size: 10px;
  cursor: pointer;
  background: transparent;
  border: 1px solid #cbbdad;
  border-radius: 999px;
}

.keyword-chip.selected {
  color: #fff9ef;
  background: var(--orange-dark);
  border-color: var(--orange-dark);
}

.quota-panel {
  margin-top: 18px;
  padding: 13px;
  background: #ebe4d8;
  border-left: 3px solid var(--olive);
}

.quota-panel.blocked {
  background: var(--danger-soft);
  border-left-color: var(--danger);
}

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

.quota-title {
  font-size: 10px;
  font-weight: 800;
}

.quota-count {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
}

.quota-note,
.quota-rule {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.dev-link {
  margin-top: 8px;
  padding: 0;
  color: var(--orange-dark);
  font-size: 9px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  background: transparent;
  border: 0;
}

.generate-block {
  margin-top: 14px;
}

.generate-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
  text-align: center;
}

/* Result */
.result-heading {
  padding: 22px 20px 16px;
}

.result-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--success);
  font-size: 10px;
  font-weight: 700;
}

.status-mark {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  color: var(--paper);
  font-size: 10px;
  background: var(--success);
  border-radius: 50%;
}

.draft-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 20px;
}

.draft-row {
  padding: 13px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.draft-row.selected {
  border-color: #8b705b;
  box-shadow: inset 3px 0 0 var(--orange);
}

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

.draft-identity,
.draft-state {
  display: flex;
  align-items: center;
  gap: 7px;
}

.draft-index {
  color: var(--orange-dark);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
}

.draft-style {
  font-size: 10px;
  font-weight: 700;
}

.draft-length {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}

.draft-length.outside {
  color: var(--danger);
}

.selected-label {
  color: var(--orange-dark);
  font-size: 8px;
  font-weight: 800;
}

.draft-preview {
  display: block;
  color: #51473d;
  font-size: 11px;
  line-height: 1.75;
}

.draft-editor {
  width: 100%;
  min-height: 145px;
  padding: 10px;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.75;
  resize: vertical;
  background: #f8f1e5;
  border: 1px solid #ccbaa4;
  border-radius: 4px;
}

.draft-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.draft-hint {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.result-action-panel {
  margin: 18px 20px 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.rate-summary {
  margin-bottom: 12px;
}

.rate-summary strong {
  display: block;
  font-size: 11px;
}

.rate-summary span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.publish-note {
  margin: 18px 20px 0;
  padding: 13px;
  color: #5b4f42;
  background: #ebe1d2;
  border-left: 3px solid var(--gold);
}

.publish-note strong {
  display: block;
  font-size: 10px;
}

.publish-note span {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  line-height: 1.6;
}

.result-back {
  margin: 16px 20px 0;
}

/* Merchant shared */
.merchant-login-page {
  background: var(--cream);
}

.login-hero {
  padding: 28px 20px 24px;
  color: var(--cream);
  background: var(--ink);
}

.login-brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  margin-bottom: 22px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 900;
  background: var(--gold);
  border-radius: 7px;
}

.login-hero .eyebrow {
  color: var(--gold);
}

.login-hero .page-title {
  color: var(--cream);
}

.login-hero .page-lede {
  color: #baaea2;
}

.login-body {
  padding: 20px;
}

.login-panel {
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.panel-title {
  font-size: 14px;
  font-weight: 800;
}

.panel-note {
  color: var(--muted);
  font-size: 9px;
}

.code-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.code-note {
  color: var(--muted);
  font-size: 8px;
}

.login-submit {
  width: 100%;
  margin-top: 17px;
}

.login-local-note {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
  text-align: center;
}

.demo-account {
  margin-top: 14px;
  padding: 14px;
  color: #e7ddd2;
  background: #29221c;
  border-radius: 7px;
}

.demo-account-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}

.demo-account-heading strong {
  font-size: 11px;
}

.demo-account-heading span {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
}

.credential-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 10px;
  border-top: 1px solid #44382f;
}

.credential-row span {
  color: #a99c90;
}

.credential-row strong {
  font-family: var(--mono);
  letter-spacing: 0.03em;
}

.demo-fill {
  width: 100%;
  margin-top: 10px;
  color: var(--cream);
  border-color: #6b5b4f;
}

.access-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.access-note strong {
  display: block;
  font-size: 10px;
}

.access-note span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.merchant-bar {
  padding: 15px 20px 13px;
  color: var(--cream);
  background: var(--ink);
}

.merchant-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.merchant-lockup {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.merchant-mark {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  background: var(--gold);
  border-radius: 5px;
}

.merchant-lockup-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.merchant-lockup-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merchant-lockup-copy span {
  color: #a99d91;
  font-family: var(--mono);
  font-size: 8px;
}

.logout-button {
  min-height: 33px;
  padding: 5px 9px;
  color: #c7bbb0;
  font-size: 9px;
  cursor: pointer;
  background: transparent;
  border: 1px solid #5b4d42;
  border-radius: 4px;
}

.merchant-tabs {
  position: sticky;
  top: 46px;
  z-index: 13;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.merchant-tab {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 66px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 4px;
  color: #7c7166;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
}

.merchant-tab:last-child {
  border-right: 0;
}

.merchant-tab::after {
  position: absolute;
  right: 18px;
  bottom: -1px;
  left: 18px;
  height: 2px;
  content: "";
  background: transparent;
}

.merchant-tab.active {
  color: var(--ink);
}

.merchant-tab.active::after {
  background: var(--orange);
}

.merchant-tab svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.merchant-tab span {
  overflow: hidden;
  width: 100%;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merchant-tab small {
  color: #a09589;
  font-family: var(--mono);
  font-size: 7px;
}

.merchant-content {
  padding: 18px 20px 42px;
}

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

.dashboard-heading h1 {
  margin: 5px 0 0;
  font-size: 22px;
  line-height: 1.3;
}

.dashboard-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.contract-note {
  display: block;
  margin-top: 7px;
  color: #7b6e60;
  font-size: 9px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 18px;
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}

.metric-block {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  padding: 15px 8px;
  border-right: 1px solid var(--line);
}

.metric-block:first-child {
  padding-left: 0;
}

.metric-block:last-child {
  border-right: 0;
}

.metric-value {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.metric-block:nth-child(2) .metric-value {
  color: var(--orange-dark);
}

.metric-label {
  color: var(--muted);
  font-size: 9px;
}

.overview-list {
  margin-top: 2px;
  border-top: 1px solid var(--line);
}

.overview-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 57px;
  border-bottom: 1px solid var(--line);
}

.overview-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  color: var(--orange-dark);
  background: #ebe1d3;
  border-radius: 5px;
}

.overview-icon svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.overview-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.overview-copy strong {
  font-size: 11px;
}

.overview-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-arrow {
  width: 15px;
  fill: none;
  stroke: #958777;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.permission-note {
  margin-top: 20px;
  padding: 13px;
  background: #ebe4d9;
  border-left: 3px solid var(--olive);
}

.permission-note strong {
  display: block;
  font-size: 10px;
}

.permission-note span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.visitor-link {
  width: 100%;
  margin-top: 14px;
}

/* Packages manager */
.manager-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.manager-heading h1 {
  margin: 0;
  font-size: 22px;
}

.manager-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.add-package-button {
  display: inline-flex;
  min-height: 38px;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  color: var(--cream);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  background: var(--ink);
  border: 0;
  border-radius: 5px;
}

.add-package-button svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.9;
}

.manager-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 16px;
  padding: 12px 0;
  background: #eee6da;
}

.manager-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border-right: 1px solid #d6c9b8;
}

.manager-stat:last-child {
  border-right: 0;
}

.manager-stat strong {
  font-family: var(--mono);
  font-size: 18px;
}

.manager-stat:nth-child(2) strong {
  color: var(--success);
}

.manager-stat span {
  color: var(--muted);
  font-size: 8px;
}

.manager-list {
  margin-top: 17px;
  border-top: 1px solid var(--line-dark);
}

.manager-package {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.manager-package.offline {
  opacity: 0.72;
}

.manager-package-main {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 11px;
}

.manager-swatch {
  display: grid;
  min-height: 74px;
  place-items: end start;
  padding: 8px;
  color: inherit;
  font-size: 9px;
  font-weight: 800;
  border-radius: 5px;
}

.manager-package-copy {
  min-width: 0;
}

.manager-name-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.manager-name {
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.manager-price {
  flex: 0 0 auto;
  color: var(--orange-dark);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
}

.manager-meta,
.manager-items {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.55;
}

.manager-items {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manager-package-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-left: 65px;
}

.manager-update {
  color: #998c7e;
  font-size: 8px;
}

.manager-actions {
  display: flex;
  gap: 6px;
}

.manager-action {
  min-height: 31px;
  padding: 5px 9px;
  color: #5e5145;
  font-size: 9px;
  cursor: pointer;
  background: transparent;
  border: 1px solid #cbbdac;
  border-radius: 4px;
}

.manager-action.primary {
  color: var(--orange-dark);
  border-color: #c69e8d;
}

.manager-note {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.manager-note strong {
  display: block;
  font-size: 10px;
}

.manager-note span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

/* Package form */
.package-form-heading {
  margin-bottom: 16px;
}

.package-preview {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 10px;
  background: #eae1d4;
  border: 1px solid #d2c4b2;
  border-radius: 6px;
}

.preview-cover {
  display: flex;
  min-height: 94px;
  align-items: flex-end;
  padding: 9px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 4px;
}

.preview-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.preview-copy strong {
  font-size: 14px;
  line-height: 1.45;
}

.preview-price {
  color: var(--orange-dark);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
}

.preview-meta {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.form-section {
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.form-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.form-section-title {
  font-size: 12px;
  font-weight: 800;
}

.form-section-note {
  color: var(--muted);
  font-size: 8px;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.theme-option {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  padding: 6px;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.theme-option.selected {
  border-color: var(--ink);
}

.theme-swatch {
  width: 100%;
  height: 23px;
  border-radius: 3px;
}

.theme-option span {
  color: var(--muted);
  font-size: 8px;
}

.status-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.status-option {
  display: flex;
  min-height: 58px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 9px;
  text-align: left;
  cursor: pointer;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.status-option.selected {
  background: #ede4d6;
  border-color: #8c7660;
  box-shadow: inset 3px 0 0 var(--orange);
}

.status-option strong {
  font-size: 10px;
}

.status-option span {
  color: var(--muted);
  font-size: 8px;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 9px;
  margin-top: 20px;
}

.form-footnote {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.55;
  text-align: center;
}

/* Cards and dossier */
.readonly-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px;
  color: #49432f;
  background: #ebe5d2;
  border-left: 3px solid var(--olive);
}

.readonly-banner svg {
  width: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--olive);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.readonly-banner strong {
  display: block;
  font-size: 10px;
}

.readonly-banner span {
  display: block;
  margin-top: 4px;
  color: #756d5c;
  font-size: 8px;
  line-height: 1.6;
}

.card-list {
  margin-top: 14px;
  border-top: 1px solid var(--line-dark);
}

.nfc-card-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 66px;
  border-bottom: 1px solid var(--line);
}

.nfc-card-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--orange-dark);
  background: #e9dfd1;
  border-radius: 50%;
}

.nfc-card-icon svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.nfc-card-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nfc-card-copy strong {
  font-size: 11px;
}

.nfc-card-copy span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}

.dossier-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.dossier-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dossier-title-row strong {
  font-size: 14px;
}

.dossier-store {
  display: block;
  margin-top: 12px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.dossier-merchant {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.detail-table {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.detail-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  font-size: 9px;
  line-height: 1.55;
  border-bottom: 1px solid var(--line);
}

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

.detail-row strong {
  overflow-wrap: anywhere;
  font-weight: 600;
}

.dossier-actions {
  margin-top: 13px;
}

/* Apply */
.apply-header {
  padding: 22px 20px 16px;
}

.apply-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
}

.existing-application {
  display: flex;
  min-height: 49px;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 9px 11px;
  text-align: left;
  cursor: pointer;
  background: #ede4d5;
  border: 0;
  border-left: 3px solid var(--olive);
}

.existing-application div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.existing-application strong {
  font-size: 9px;
}

.existing-application span {
  color: var(--muted);
  font-size: 8px;
}

.existing-application svg {
  width: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.demo-fill-form {
  min-height: 37px;
  flex: 0 0 auto;
  padding: 6px 8px;
  color: var(--orange-dark);
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  border: 1px solid #c7aa9b;
  border-radius: 4px;
}

.apply-form {
  padding: 0 20px;
}

.apply-step {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.license-picker {
  display: flex;
  width: 100%;
  min-height: 83px;
  align-items: center;
  gap: 11px;
  padding: 11px;
  text-align: left;
  cursor: pointer;
  background: var(--paper);
  border: 1px dashed #bcae9d;
  border-radius: 5px;
}

.license-plus {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--orange-dark);
  font-size: 18px;
  background: #ede4d6;
  border-radius: 50%;
}

.license-picker-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.license-picker-copy strong {
  font-size: 10px;
}

.license-picker-copy span {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.license-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.license-selected-copy {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.license-mini {
  display: grid;
  width: 39px;
  height: 50px;
  flex: 0 0 auto;
  place-items: center;
  color: #9e3428;
  font-family: serif;
  font-size: 8px;
  font-weight: 800;
  background: #f6e8dc;
  border: 1px solid #d7b9a7;
}

.license-selected-copy div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.license-selected-copy strong {
  font-size: 10px;
}

.license-selected-copy span {
  color: var(--muted);
  font-size: 8px;
}

.license-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.license-action {
  padding: 3px 0;
  color: var(--orange-dark);
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  border: 0;
}

.license-action.remove {
  color: var(--muted);
}

.picker-field {
  display: flex;
  height: 44px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 12px;
}

.picker-field.placeholder {
  color: #a79b8d;
}

.picker-arrow {
  color: var(--muted);
  font-size: 13px;
}

.credit-feedback {
  display: block;
  font-size: 9px;
  line-height: 1.5;
}

.credit-feedback.success {
  color: var(--success);
}

.credit-feedback.error {
  color: var(--danger);
}

.submit-panel {
  margin-top: 3px;
  padding: 17px 0 0;
  border-top: 1px solid var(--line-dark);
}

.submit-panel .primary-button {
  width: 100%;
}

.submit-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.6;
  text-align: center;
}

.local-model-note {
  margin: 18px 20px 0;
  padding: 11px;
  color: #756b5e;
  font-size: 8px;
  line-height: 1.65;
  background: #eae2d6;
  border-left: 3px solid var(--gold);
}

/* Application status */
.status-heading {
  padding: 22px 20px 16px;
}

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

.application-id {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guidance-panel {
  margin: 0 20px;
  padding: 15px;
  color: var(--cream);
  background: #3e392c;
  border-left: 4px solid var(--gold);
}

.guidance-panel.rejected {
  background: #472c26;
  border-left-color: #d17c65;
}

.guidance-label {
  display: block;
  color: #baae9e;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.guidance-title {
  display: block;
  margin-top: 5px;
  font-size: 18px;
  font-weight: 800;
}

.guidance-copy {
  display: block;
  margin-top: 6px;
  color: #d0c5b8;
  font-size: 9px;
  line-height: 1.65;
}

.progress-section {
  margin: 18px 20px 0;
  padding: 5px 0;
}

.progress-step {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr);
  gap: 9px;
  min-height: 55px;
}

.progress-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.progress-dot {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--paper);
  font-size: 9px;
  background: transparent;
  border: 1px solid #b8aa99;
  border-radius: 50%;
}

.progress-line {
  width: 1px;
  flex: 1;
  background: #d1c3b2;
}

.progress-step.done .progress-dot,
.progress-step.current .progress-dot {
  background: var(--success);
  border-color: var(--success);
}

.progress-step.current .progress-dot {
  box-shadow: 0 0 0 4px var(--success-soft);
}

.progress-step.done .progress-line {
  background: var(--success);
}

.progress-step.muted {
  opacity: 0.45;
}

.progress-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-bottom: 16px;
}

.progress-title {
  font-size: 11px;
  font-weight: 700;
}

.progress-note {
  color: var(--muted);
  font-size: 8px;
}

.rejected-banner {
  margin-top: 3px;
  padding: 11px;
  background: var(--danger-soft);
  border-left: 3px solid var(--danger);
}

.rejected-banner strong {
  display: block;
  color: var(--danger);
  font-size: 10px;
}

.rejected-banner span {
  display: block;
  margin-top: 3px;
  color: #765b54;
  font-size: 8px;
  line-height: 1.55;
}

.status-body {
  padding: 0 20px;
}

.history-list {
  border-top: 1px solid var(--line);
}

.history-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 9px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.history-marker {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  background: var(--orange);
  border-radius: 50%;
}

.history-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.history-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.history-title {
  font-size: 10px;
  font-weight: 700;
}

.history-time {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
}

.history-note {
  color: var(--muted);
  font-size: 8px;
}

.status-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 18px;
}

.status-dev {
  margin-top: 18px;
  padding: 13px;
  color: #e5dacd;
  background: #28221d;
}

.status-dev-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.status-dev-heading div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.status-dev-heading strong {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.status-dev-heading span {
  color: #aa9e91;
  font-size: 8px;
  line-height: 1.5;
}

.advance-button {
  min-height: 35px;
  flex: 0 0 auto;
  padding: 6px 9px;
  color: var(--ink);
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
  background: var(--gold);
  border: 0;
  border-radius: 4px;
}

.home-link {
  display: block;
  margin: 18px auto 0;
  padding: 7px 0;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
  background: transparent;
  border: 0;
}

/* Modal and toast */
.toast-root {
  position: absolute;
  right: 16px;
  bottom: 22px;
  left: 16px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  pointer-events: none;
}

.toast {
  max-width: 82%;
  padding: 10px 13px;
  color: var(--cream);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
  background: rgba(21, 17, 14, 0.94);
  border: 1px solid #51453c;
  border-radius: 5px;
  box-shadow: 0 8px 24px rgba(15, 11, 8, 0.2);
  animation: toast-in 180ms ease both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-root {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: none;
}

.modal-root.open {
  display: block;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  display: grid;
  padding: 22px;
  place-items: center;
  background: rgba(13, 10, 8, 0.7);
}

.modal-card {
  width: 100%;
  max-width: 330px;
  max-height: 75%;
  padding: 18px;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid #bcae9c;
  border-radius: 7px;
  box-shadow: 0 24px 60px rgba(7, 5, 3, 0.35);
}

.modal-card h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
}

.modal-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
  white-space: pre-line;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.modal-actions.single {
  grid-template-columns: 1fr;
}

.license-modal-sample {
  position: relative;
  width: 100%;
  margin-top: 14px;
  padding: 17px;
  overflow: hidden;
  color: #513127;
  background: #f2e2d5;
  border: 1px solid #ca9d88;
}

.license-modal-sample::before {
  position: absolute;
  top: 11px;
  right: 11px;
  width: 42px;
  height: 42px;
  content: "";
  border: 3px double rgba(146, 52, 40, 0.55);
  border-radius: 50%;
}

.license-sample-title {
  display: block;
  padding-bottom: 8px;
  font-family: serif;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  border-bottom: 1px solid #c99d88;
}

.license-sample-row {
  display: grid;
  grid-template-columns: 55px minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
  font-size: 8px;
  line-height: 1.5;
}

.license-sample-row span {
  color: #9a6959;
}

.license-sample-row strong {
  overflow-wrap: anywhere;
  font-weight: 600;
}

.stage-note {
  margin: 0;
  color: #6f6257;
  font-family: var(--mono);
  font-size: 9px;
}

html.production-mode .demo-shell {
  display: block;
}

html.production-mode .control-rail,
html.production-mode .stage-note,
html.production-mode .v3-nfc-demo,
html.production-mode .v3-dev-footnote,
html.production-mode .v3-dev-link,
html.production-mode .v3-demo-fill,
html.production-mode .v3-login-help,
html.production-mode .v3-demo-link {
  display: none !important;
}

html.production-mode .device-stage {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.noscript-message {
  padding: 30px;
  color: var(--cream);
}

@media (max-width: 980px) {
  body {
    overflow: hidden;
    background: var(--cream);
  }

  .demo-shell {
    display: block;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .control-rail,
  .stage-note {
    display: none;
  }

  .device-stage {
    display: block;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: 0;
    background: var(--cream);
  }

  .phone-frame {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .phone-status {
    padding-top: env(safe-area-inset-top);
    height: calc(34px + env(safe-area-inset-top));
    flex-basis: calc(34px + env(safe-area-inset-top));
  }

  .dynamic-island {
    top: calc(8px + env(safe-area-inset-top));
  }

  .toast-root {
    bottom: calc(22px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 390px) {
  .page-inner {
    padding-right: 16px;
    padding-left: 16px;
  }

  .home-hero {
    margin-right: 10px;
    margin-left: 10px;
  }

  .home-address {
    margin-right: 10px;
    margin-left: 10px;
  }

  .mode-entry-section {
    padding-right: 10px;
    padding-left: 10px;
  }

  .local-note {
    margin-right: 10px;
    margin-left: 10px;
  }

  .store-body,
  .store-info,
  .result-heading,
  .status-heading,
  .apply-header {
    padding-right: 16px;
    padding-left: 16px;
  }

  .store-info {
    margin-right: 16px;
    margin-left: 16px;
  }

  .merchant-content,
  .merchant-bar {
    padding-right: 16px;
    padding-left: 16px;
  }

  .apply-form {
    padding-right: 16px;
    padding-left: 16px;
  }

  .guidance-panel,
  .draft-list,
  .result-action-panel,
  .publish-note,
  .result-back,
  .progress-section,
  .status-body,
  .local-model-note {
    margin-right: 16px;
    margin-left: 16px;
  }

  .draft-list,
  .result-action-panel,
  .publish-note,
  .progress-section,
  .status-body {
    padding-right: 0;
    padding-left: 0;
  }

  .package-item {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .rating-option {
    padding: 7px;
  }

  .rating-hint {
    font-size: 7px;
  }

  .merchant-tab span {
    font-size: 9px;
  }

  .manager-package-footer {
    padding-left: 0;
  }

  .two-column {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
