/*
 * CRY-EX Merchant: app layout and app-only components.
 * Tokens come from /shared/cryex-theme.css. Base rules, .cx-button, the
 * sign-in gate, the account bar, dialogs and the footer come from
 * /shared/cryex-shell.css. Layout breakpoint: 920px (desktop from 921px);
 * 560px only tweaks content inside components.
 */

/* ---- Base ---- */
body[data-cryex-app="merchant"] {
  --cx-mobile-nav: 72px; /* room the footer keeps for the fixed tab bar */
  --merchant-gutter: clamp(16px, 3vw, 42px);
  --merchant-ok-on-dark: #4ade80; /* --cx-success in dark mode */
  --merchant-alert-on-dark: #ff8a80; /* --cx-danger in dark mode */
  min-width: 320px;
  margin: 0;
  background: var(--cx-canvas);
  color: var(--cx-ink);
  font-size: 16px;
  line-height: 1.5;
}

html { scroll-behavior: smooth; }

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

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

[hidden],
.is-hidden { display: none !important; }

body[data-cryex-app="merchant"] .main-content:focus { outline: 0; }

/* ---- Buttons (app modifiers on the shared .cx-button) ---- */
body[data-cryex-app="merchant"] .cx-button.is-compact {
  min-height: 44px;
  padding: 0 14px;
  font-size: 14px;
}

body[data-cryex-app="merchant"] .cx-button--danger,
body[data-cryex-app="merchant"] .cx-button--danger:hover:not(:disabled) {
  border-color: transparent;
  background: var(--cx-danger);
  color: #fff;
}

body[data-cryex-app="merchant"] .cx-button--on-dark {
  border-color: var(--cx-line-strong);
  background: rgba(255, 255, 255, 0.07);
  color: var(--cx-text);
}

body[data-cryex-app="merchant"] .cx-button--on-dark:hover:not(:disabled) {
  border-color: var(--cx-muted);
}

body[data-cryex-app="merchant"] .icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  background: var(--cx-surface);
  color: var(--cx-ink);
}

body[data-cryex-app="merchant"] .icon-button svg { width: 20px; height: 20px; }

body[data-cryex-app="merchant"] .text-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--cx-ink-muted);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

body[data-cryex-app="merchant"] .text-button:hover { color: var(--cx-ink); }
body[data-cryex-app="merchant"] .text-button svg { width: 16px; height: 16px; }

/* ---- Navigation: dark top bar on desktop, drawer on mobile ---- */
body[data-cryex-app="merchant"] .sidebar {
  display: flex;
  background: var(--cx-bg);
  color: var(--cx-text);
}

body[data-cryex-app="merchant"] .brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body[data-cryex-app="merchant"] .brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  font-size: 20px;
}

body[data-cryex-app="merchant"] .brand > span { display: grid; gap: 2px; line-height: 1; }
body[data-cryex-app="merchant"] .brand-mark { display: block; width: 34px; height: 34px; border-radius: var(--cx-radius); }

body[data-cryex-app="merchant"] :is(.brand, .mobile-merchant-brand) small {
  color: var(--cx-accent);
  font-weight: 800;
  letter-spacing: 0.16em;
}

body[data-cryex-app="merchant"] .nav-label { display: none; }

body[data-cryex-app="merchant"] .nav-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: var(--cx-radius);
  color: var(--cx-muted);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

body[data-cryex-app="merchant"] .nav-link:hover { background: rgba(255, 255, 255, 0.07); color: var(--cx-text); }
body[data-cryex-app="merchant"] .nav-link.is-active { background: var(--cx-accent-soft); color: var(--cx-accent); }
body[data-cryex-app="merchant"] .nav-link svg { width: 18px; height: 18px; flex: none; }

body[data-cryex-app="merchant"] .nav-count {
  min-width: 22px;
  margin-left: auto;
  padding: 2px 7px;
  border-radius: var(--cx-radius-pill);
  background: var(--cx-app-accent);
  color: var(--cx-on-accent);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
}

body[data-cryex-app="merchant"] .sidebar-foot { display: grid; gap: 12px; margin-top: auto; padding-top: 24px; }

body[data-cryex-app="merchant"] .store-mini {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 8px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--cx-line);
  border-radius: var(--cx-radius-lg);
}

body[data-cryex-app="merchant"] .store-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--cx-radius);
  background: var(--cx-accent);
  color: var(--cx-on-accent);
  font-size: 12px;
  font-weight: 800;
}

body[data-cryex-app="merchant"] .store-mini div { display: grid; min-width: 0; gap: 2px; }

body[data-cryex-app="merchant"] .store-mini :is(strong, div span) {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-cryex-app="merchant"] .store-mini div span { color: var(--cx-muted); font-size: 12px; }
body[data-cryex-app="merchant"] .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--merchant-ok-on-dark); }

body[data-cryex-app="merchant"] .support-note {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 0;
  border-radius: var(--cx-radius);
  background: transparent;
  color: var(--cx-muted);
  text-align: left;
}

body[data-cryex-app="merchant"] .support-note:hover { background: rgba(255, 255, 255, 0.06); }

body[data-cryex-app="merchant"] .support-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: none;
  place-items: center;
  border: 1px solid var(--cx-line-strong);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

body[data-cryex-app="merchant"] .support-note div { display: grid; gap: 2px; font-size: 12px; }
body[data-cryex-app="merchant"] .support-note strong { color: var(--cx-text); font-size: 13px; }

/* ---- Page header row and content ---- */
body[data-cryex-app="merchant"] .topbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

body[data-cryex-app="merchant"] .topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

body[data-cryex-app="merchant"] .connection-pill {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-pill);
  background: var(--cx-surface);
  color: var(--cx-ink-muted);
  font-size: 13px;
  white-space: nowrap;
}

body[data-cryex-app="merchant"] .connection-pill b { font-weight: 600; }

body[data-cryex-app="merchant"] .connection-pill span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cx-accent-strong);
  animation: merchant-blink 1.4s infinite;
}

body[data-cryex-app="merchant"] .connection-pill.is-online span { background: var(--cx-success); animation: none; }
body[data-cryex-app="merchant"] .connection-pill.is-offline span { background: var(--cx-danger); animation: none; }

body[data-cryex-app="merchant"][data-merchant-access="guest"] .connection-pill,
body[data-cryex-app="merchant"][data-merchant-access="registration"] .connection-pill { display: none; }

@keyframes merchant-blink { 50% { opacity: 0.35; } }

body[data-cryex-app="merchant"] .notification-button { position: relative; }

body[data-cryex-app="merchant"] .notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--cx-surface);
  border-radius: 50%;
  background: var(--cx-danger);
}

body[data-cryex-app="merchant"] .content-wrap {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 16px var(--merchant-gutter) 64px;
}

body[data-cryex-app="merchant"] .page-view { display: none; }
body[data-cryex-app="merchant"] .page-view.is-active { display: block; animation: merchant-view-in 0.24s ease-out; }

@keyframes merchant-view-in { from { opacity: 0; transform: translateY(5px); } }

body[data-cryex-app="merchant"] .section-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin: 0 0 20px;
}

body[data-cryex-app="merchant"] .section-title-row h1 {
  margin: 0 0 4px;
  font-size: clamp(28px, 3vw, 36px);
  line-height: var(--cx-leading-tight);
  letter-spacing: var(--cx-tracking-tight);
}

body[data-cryex-app="merchant"] .section-title-row p { max-width: 60ch; margin: 0; color: var(--cx-ink-muted); font-size: 15px; }

body[data-cryex-app="merchant"] :is(.section-kicker, .live-label) {
  color: var(--cx-ink-faint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: var(--cx-tracking-caps);
  text-transform: uppercase;
}

body[data-cryex-app="merchant"] .live-label { display: flex; align-items: center; gap: 6px; }

body[data-cryex-app="merchant"] .live-label i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cx-danger);
  box-shadow: 0 0 0 4px var(--cx-danger-soft);
}

body[data-cryex-app="merchant"] .panel {
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-lg);
  background: var(--cx-surface);
}

body[data-cryex-app="merchant"] .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 12px;
}

body[data-cryex-app="merchant"] .panel-header h2 { margin: 2px 0 0; font-size: 18px; line-height: 1.3; }
body[data-cryex-app="merchant"] .panel-header p { margin: 4px 0 0; color: var(--cx-ink-muted); font-size: 14px; }

body[data-cryex-app="merchant"] .empty-state {
  display: grid;
  min-height: 200px;
  place-items: center;
  align-content: center;
  padding: 24px;
  color: var(--cx-ink-muted);
  text-align: center;
}

body[data-cryex-app="merchant"] .empty-illustration {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: var(--cx-radius-lg);
  background: var(--cx-surface-muted);
}

body[data-cryex-app="merchant"] .empty-illustration svg { width: 26px; height: 26px; }
body[data-cryex-app="merchant"] .empty-state strong { color: var(--cx-ink); font-size: 15px; }
body[data-cryex-app="merchant"] .empty-state p { max-width: 34ch; margin: 4px 0 0; font-size: 14px; }

body[data-cryex-app="merchant"] :is(.order-board, .menu-grid) > .empty-state {
  grid-column: 1 / -1;
  min-height: 280px;
  border: 1px dashed var(--cx-border);
  border-radius: var(--cx-radius-lg);
}

/* ---- Overview ---- */
body[data-cryex-app="merchant"] .setup-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border-radius: var(--cx-radius-lg);
  background: var(--cx-bg);
  color: var(--cx-text);
}

body[data-cryex-app="merchant"] .setup-banner-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  border-radius: var(--cx-radius);
  background: var(--cx-accent);
  color: var(--cx-on-accent);
}

body[data-cryex-app="merchant"] .setup-banner-icon svg { width: 22px; height: 22px; }
body[data-cryex-app="merchant"] .setup-banner > div:nth-child(2) { display: grid; gap: 2px; }
body[data-cryex-app="merchant"] .setup-banner strong { font-size: 15px; }
body[data-cryex-app="merchant"] .setup-banner span { color: var(--cx-muted); font-size: 14px; }
body[data-cryex-app="merchant"] .setup-banner .cx-button { margin-left: auto; }

body[data-cryex-app="merchant"] .operations-brief {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 22px 24px;
  border: 1px solid var(--cx-line-strong);
  border-radius: var(--cx-radius-lg);
  background:
    radial-gradient(circle at 92% 10%, var(--cx-accent-soft), transparent 14rem),
    var(--cx-bg);
  color: var(--cx-text);
}

body[data-cryex-app="merchant"] .operations-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--merchant-ok-on-dark);
  font-size: 13px;
}

body[data-cryex-app="merchant"] .operations-status > i {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

body[data-cryex-app="merchant"] .operations-status.is-closed { color: var(--merchant-alert-on-dark); }

body[data-cryex-app="merchant"] .operations-brief h1 {
  margin: 6px 0 4px;
  font-size: clamp(24px, 2.4vw, 30px);
  line-height: var(--cx-leading-tight);
  letter-spacing: var(--cx-tracking-tight);
}

body[data-cryex-app="merchant"] .operations-brief p { margin: 0; color: var(--cx-muted); font-size: 15px; }
body[data-cryex-app="merchant"] .operations-brief-actions { display: flex; flex: none; gap: 10px; }

body[data-cryex-app="merchant"] .queue-button b {
  display: grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  padding: 0 7px;
  border-radius: var(--cx-radius-pill);
  background: var(--cx-bg);
  color: var(--cx-accent);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

body[data-cryex-app="merchant"] .compact-orders { padding: 0 12px 12px; }

body[data-cryex-app="merchant"] .compact-order {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 8px;
  border-top: 1px solid var(--cx-border);
}

body[data-cryex-app="merchant"] .compact-order:first-child { border-top: 0; }

body[data-cryex-app="merchant"] .order-symbol {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: var(--cx-radius);
  background: var(--cx-surface-muted);
  color: var(--cx-ink-muted);
}

body[data-cryex-app="merchant"] .order-symbol svg { width: 20px; height: 20px; }
body[data-cryex-app="merchant"] .compact-order.is-pending .order-symbol { background: var(--cx-danger-soft); color: var(--cx-danger); }
body[data-cryex-app="merchant"] .compact-order-info { min-width: 0; }

body[data-cryex-app="merchant"] .compact-order-info > strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-cryex-app="merchant"] .compact-order-info > span { display: block; margin-top: 2px; color: var(--cx-ink-faint); font-size: 13px; }
body[data-cryex-app="merchant"] .compact-order-side { display: grid; justify-items: end; gap: 4px; }
body[data-cryex-app="merchant"] .compact-order-side strong { font-size: 15px; font-weight: 800; }
body[data-cryex-app="merchant"] .compact-order > .cx-button { min-width: 116px; }

body[data-cryex-app="merchant"] .today-panel { margin-top: 16px; }
body[data-cryex-app="merchant"] .today-panel .panel-header { padding-bottom: 8px; }

body[data-cryex-app="merchant"] .today-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 20px 18px;
}

body[data-cryex-app="merchant"] .today-stats article {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-radius: var(--cx-radius);
  background: var(--cx-canvas);
}

body[data-cryex-app="merchant"] .today-stats span { color: var(--cx-ink-muted); font-size: 13px; font-weight: 700; }
body[data-cryex-app="merchant"] .today-stats strong { font-size: 22px; font-variant-numeric: tabular-nums; }

body[data-cryex-app="merchant"] .order-status {
  padding: 4px 8px;
  border-radius: var(--cx-radius-sm);
  background: var(--cx-surface-muted);
  color: var(--cx-ink-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
}

body[data-cryex-app="merchant"] .order-status.pending { background: var(--cx-danger-soft); color: var(--cx-danger); }
body[data-cryex-app="merchant"] .order-status:is(.accepted, .preparing) { background: var(--cx-info-soft); color: var(--cx-info); }
body[data-cryex-app="merchant"] .order-status:is(.ready, .completed) { background: var(--cx-success-soft); color: var(--cx-success); }

body[data-cryex-app="merchant"] :is(.merchant-reach-summary, .merchant-reach-network) { margin-top: 16px; }

body[data-cryex-app="merchant"] .merchant-reach-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 0 20px 12px;
}

body[data-cryex-app="merchant"] .merchant-reach-metrics article {
  display: grid;
  min-height: 76px;
  align-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  background: var(--cx-canvas);
}

body[data-cryex-app="merchant"] .merchant-reach-metrics span { color: var(--cx-ink-muted); font-size: 13px; font-weight: 700; }

body[data-cryex-app="merchant"] .merchant-reach-metrics strong {
  overflow: hidden;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-cryex-app="merchant"] .merchant-reach-summary-state {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px 14px;
  color: var(--cx-ink-muted);
  font-size: 14px;
}

body[data-cryex-app="merchant"] .reach-order-source {
  display: grid;
  gap: 2px;
  margin: 10px 16px 0;
  padding: 8px 10px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  background: var(--cx-accent-soft);
  color: var(--cx-accent-ink);
  font-size: 13px;
}

body[data-cryex-app="merchant"] .reach-order-source span {
  overflow: hidden;
  color: var(--cx-ink-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-cryex-app="merchant"] .reach-order-source.is-compact {
  display: flex;
  gap: 6px;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
}

/* ---- Orders ---- */
body[data-cryex-app="merchant"] .order-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

body[data-cryex-app="merchant"] .filter-chip {
  display: inline-flex;
  min-height: 44px;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-pill);
  background: var(--cx-surface);
  color: var(--cx-ink-muted);
  font-size: 14px;
  font-weight: 700;
}

body[data-cryex-app="merchant"] .filter-chip span {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  padding: 0 6px;
  border-radius: var(--cx-radius-pill);
  background: var(--cx-surface-muted);
  font-size: 12px;
}

body[data-cryex-app="merchant"] .filter-chip.is-active { border-color: var(--cx-ink); background: var(--cx-ink); color: var(--cx-surface); }
body[data-cryex-app="merchant"] .filter-chip.is-active span { background: var(--cx-accent); color: var(--cx-on-accent); }

body[data-cryex-app="merchant"] .order-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  align-items: start;
  gap: 16px;
}

body[data-cryex-app="merchant"] .order-card {
  overflow: hidden;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-lg);
  background: var(--cx-surface);
}

body[data-cryex-app="merchant"] .order-card.is-pending { border-color: var(--cx-danger); box-shadow: inset 4px 0 var(--cx-danger); }

body[data-cryex-app="merchant"] .order-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--cx-border);
}

body[data-cryex-app="merchant"] .order-card-head > div > span {
  color: var(--cx-ink-faint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body[data-cryex-app="merchant"] .order-card-head h3 { margin: 2px 0 0; font-size: 18px; }

body[data-cryex-app="merchant"] .order-sla {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--cx-radius-sm);
  background: var(--cx-surface-muted);
  color: var(--cx-ink-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

body[data-cryex-app="merchant"] .order-sla svg { width: 14px; height: 14px; flex: none; }
body[data-cryex-app="merchant"] .order-sla.is-new { background: var(--cx-success-soft); color: var(--cx-success); }
body[data-cryex-app="merchant"] .order-sla.is-attention { background: var(--cx-warning-soft); color: var(--cx-warning); }
body[data-cryex-app="merchant"] .order-sla.is-urgent { background: var(--cx-danger-soft); color: var(--cx-danger); }

body[data-cryex-app="merchant"] .order-customer { display: flex; align-items: center; gap: 10px; padding: 12px 16px 8px; }

body[data-cryex-app="merchant"] .customer-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
  border-radius: var(--cx-radius);
  background: var(--cx-surface-muted);
  font-size: 12px;
  font-weight: 800;
}

body[data-cryex-app="merchant"] .order-customer div { display: grid; gap: 2px; }
body[data-cryex-app="merchant"] .order-customer strong { font-size: 15px; }
body[data-cryex-app="merchant"] .order-customer div span { color: var(--cx-ink-muted); font-size: 13px; }

body[data-cryex-app="merchant"] .order-connections {
  margin: 4px 16px 8px;
  padding: 12px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  background: var(--cx-canvas);
}

body[data-cryex-app="merchant"] .order-connections > span,
body[data-cryex-app="merchant"] .order-connections dt {
  color: var(--cx-ink-faint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body[data-cryex-app="merchant"] .order-connections dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 8px 0 0;
}

body[data-cryex-app="merchant"] .order-connections :is(dt, dd) { margin: 0; }
body[data-cryex-app="merchant"] .order-connections dd { margin-top: 2px; font-size: 14px; font-weight: 700; }

body[data-cryex-app="merchant"] .order-items { display: grid; gap: 6px; padding: 8px 16px 12px; }

body[data-cryex-app="merchant"] .order-line {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 8px;
  font-size: 14px;
}

body[data-cryex-app="merchant"] .order-line b { color: var(--cx-ink-muted); }
body[data-cryex-app="merchant"] .order-line span:last-child { font-weight: 700; }

body[data-cryex-app="merchant"] .order-meta-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; }

body[data-cryex-app="merchant"] .meta-chip {
  padding: 4px 8px;
  border-radius: var(--cx-radius-sm);
  background: var(--cx-surface-muted);
  color: var(--cx-ink-muted);
  font-size: 13px;
}

body[data-cryex-app="merchant"] .order-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--cx-canvas);
}

body[data-cryex-app="merchant"] .order-total-row span { color: var(--cx-ink-muted); font-size: 14px; }
body[data-cryex-app="merchant"] .order-total-row strong { font-size: 17px; }

body[data-cryex-app="merchant"] .order-actions {
  display: grid;
  grid-template-columns: auto minmax(104px, 1fr) minmax(0, 1.2fr);
  gap: 8px;
  padding: 12px 16px 16px;
}

body[data-cryex-app="merchant"] .order-actions.stage-action { grid-template-columns: minmax(0, 1fr); }
body[data-cryex-app="merchant"] .stage-buttons { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 8px; }
body[data-cryex-app="merchant"] .stage-buttons .cx-button { padding-inline: 12px; }
body[data-cryex-app="merchant"] .stage-action > span { color: var(--cx-ink-muted); font-size: 14px; }

body[data-cryex-app="merchant"] .stage-action > span b {
  display: block;
  color: var(--cx-ink);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body[data-cryex-app="merchant"] .prep-control { position: relative; display: grid; }

body[data-cryex-app="merchant"] .prep-control > span {
  position: absolute;
  z-index: 1;
  top: 5px;
  left: 11px;
  color: var(--cx-ink-muted);
  font-size: 11px;
  line-height: 1;
  pointer-events: none;
}

body[data-cryex-app="merchant"] .prep-select {
  width: 100%;
  height: 48px;
  padding: 14px 24px 2px 10px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  background: var(--cx-surface);
  color: var(--cx-ink);
  font-size: 15px;
  font-weight: 700;
}

body[data-cryex-app="merchant"] .accepted-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 16px;
  color: var(--cx-ink-muted);
  font-size: 14px;
}

body[data-cryex-app="merchant"] .accepted-state strong { font-weight: 800; white-space: nowrap; }
body[data-cryex-app="merchant"] .accepted-state.is-ready { background: var(--cx-success-soft); }
body[data-cryex-app="merchant"] .accepted-state.is-ready strong { color: var(--cx-success); }

/* ---- Menu ---- */
body[data-cryex-app="merchant"] .toolbar { display: flex; align-items: center; gap: 12px; padding: 12px; }

body[data-cryex-app="merchant"] .search-field {
  display: flex;
  height: 48px;
  flex: 1;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  background: var(--cx-canvas);
}

body[data-cryex-app="merchant"] .search-field svg { width: 18px; height: 18px; flex: none; color: var(--cx-ink-faint); }

body[data-cryex-app="merchant"] .search-field input {
  width: 100%;
  min-height: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--cx-ink);
  font-size: 15px;
}

body[data-cryex-app="merchant"] .toolbar select {
  height: 48px;
  min-width: 170px;
  padding: 0 12px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  background: var(--cx-surface);
  color: var(--cx-ink);
  font-size: 15px;
}

body[data-cryex-app="merchant"] .toolbar-count { margin: 0 4px; color: var(--cx-ink-faint); font-size: 14px; white-space: nowrap; }

body[data-cryex-app="merchant"] .menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 16px;
  margin-top: 16px;
}

body[data-cryex-app="merchant"] .menu-card {
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-lg);
  background: var(--cx-surface);
}

body[data-cryex-app="merchant"] .menu-card-main {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

body[data-cryex-app="merchant"] .menu-card .menu-thumb { width: 56px; height: 56px; font-size: 20px; }
body[data-cryex-app="merchant"] .menu-card.is-off .menu-card-main { opacity: 0.6; }

body[data-cryex-app="merchant"] .menu-card-copy > span {
  color: var(--cx-ink-faint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body[data-cryex-app="merchant"] .menu-card-copy h3 { margin: 2px 0; font-size: 16px; line-height: 1.3; }

body[data-cryex-app="merchant"] .menu-card-copy p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--cx-ink-muted);
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body[data-cryex-app="merchant"] .menu-card-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--cx-border);
}

body[data-cryex-app="merchant"] .menu-card-foot .icon-button { flex: none; border-color: transparent; color: var(--cx-ink-muted); }
body[data-cryex-app="merchant"] .menu-promote-button { flex: none; }
body[data-cryex-app="merchant"] .menu-card-foot .icon-button:hover { border-color: var(--cx-border); color: var(--cx-ink); }
body[data-cryex-app="merchant"] .menu-card-foot .icon-button svg { width: 18px; height: 18px; }
body[data-cryex-app="merchant"] .menu-card-price { display: grid; justify-items: end; gap: 2px; text-align: right; }
body[data-cryex-app="merchant"] .menu-card-price strong { font-size: 16px; white-space: nowrap; }
body[data-cryex-app="merchant"] .menu-card-price span { color: var(--cx-ink-faint); font-size: 13px; white-space: nowrap; }

/* One switch look for the menu availability button and the store form toggle. */
body[data-cryex-app="merchant"] .menu-switch {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  padding: 0 6px 0 0;
  border: 0;
  background: transparent;
  color: var(--cx-ink);
  font-size: 14px;
  font-weight: 700;
}

body[data-cryex-app="merchant"] :is(.menu-switch i, .toggle-field > i) {
  position: relative;
  width: 44px;
  height: 26px;
  flex: none;
  border-radius: var(--cx-radius-pill);
  background: var(--cx-border);
  transition: background-color var(--cx-duration-fast);
}

body[data-cryex-app="merchant"] :is(.menu-switch i, .toggle-field > i)::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--cx-shadow-xs);
  content: "";
  transition: transform var(--cx-duration-fast);
}

body[data-cryex-app="merchant"] :is(.menu-switch[aria-checked="true"] i, .toggle-field input:checked + i) { background: var(--cx-success); }
body[data-cryex-app="merchant"] :is(.menu-switch[aria-checked="true"] i, .toggle-field input:checked + i)::after { transform: translateX(18px); }
body[data-cryex-app="merchant"] .menu-switch[aria-checked="false"] span { color: var(--cx-ink-muted); }

body[data-cryex-app="merchant"] .menu-thumb {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  overflow: hidden;
  border-radius: var(--cx-radius);
  background: var(--cx-surface-muted);
  color: var(--cx-ink-muted);
  font-size: 16px;
  font-weight: 800;
}

body[data-cryex-app="merchant"] .menu-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Promo codes ---- */
body[data-cryex-app="merchant"] .promo-approval-note {
  display: grid;
  gap: 2px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-lg);
  background: var(--cx-warning-soft);
  color: var(--cx-ink-muted);
  font-size: 14px;
}

body[data-cryex-app="merchant"] .promo-approval-note strong { color: var(--cx-ink); }

body[data-cryex-app="merchant"] .promo-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

body[data-cryex-app="merchant"] :is(.promo-summary-card, .report-stat) {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-lg);
  background: var(--cx-surface);
}

body[data-cryex-app="merchant"] :is(.promo-summary-card, .report-stat) > span { color: var(--cx-ink-muted); font-size: 14px; font-weight: 600; }

body[data-cryex-app="merchant"] :is(.promo-summary-card, .report-stat) strong {
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

body[data-cryex-app="merchant"] :is(.promo-summary-card, .report-stat) small { color: var(--cx-ink-faint); font-size: 13px; }
body[data-cryex-app="merchant"] .promo-page-status { margin: 0; padding: 0 20px 12px; color: var(--cx-ink-muted); font-size: 14px; }

body[data-cryex-app="merchant"] .promo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 12px;
  padding: 0 20px 20px;
}

body[data-cryex-app="merchant"] .promo-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-lg);
  background: var(--cx-canvas);
}

body[data-cryex-app="merchant"] .promo-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
body[data-cryex-app="merchant"] .promo-card-head > div { display: grid; gap: 2px; }
body[data-cryex-app="merchant"] .promo-card-head > div > span { color: var(--cx-ink-faint); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
body[data-cryex-app="merchant"] .promo-code { font-family: var(--cx-font-mono); font-size: 18px; letter-spacing: 0.04em; }

body[data-cryex-app="merchant"] .promo-state {
  padding: 4px 8px;
  border-radius: var(--cx-radius-pill);
  background: var(--cx-surface-muted);
  color: var(--cx-ink-muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

body[data-cryex-app="merchant"] .promo-state.is-active { background: var(--cx-success-soft); color: var(--cx-success); }
body[data-cryex-app="merchant"] .promo-state.is-scheduled { background: var(--cx-info-soft); color: var(--cx-info); }
body[data-cryex-app="merchant"] .promo-offer { margin: 0; font-size: 16px; font-weight: 700; }

body[data-cryex-app="merchant"] .promo-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0;
}

body[data-cryex-app="merchant"] .promo-facts dt { color: var(--cx-ink-faint); font-size: 12px; }
body[data-cryex-app="merchant"] .promo-facts dd { margin: 0; font-size: 14px; font-weight: 700; }

body[data-cryex-app="merchant"] .promo-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding-top: 12px;
  border-top: 1px solid var(--cx-border);
}

body[data-cryex-app="merchant"] .promo-card-actions p { flex: 1 1 auto; margin: 0; color: var(--cx-ink-muted); font-size: 13px; }

body[data-cryex-app="merchant"] .promo-empty {
  display: grid;
  grid-column: 1 / -1;
  justify-items: center;
  gap: 4px;
  padding: 24px;
  border: 1px dashed var(--cx-border);
  border-radius: var(--cx-radius-lg);
  text-align: center;
}

body[data-cryex-app="merchant"] .promo-empty p { max-width: 40ch; margin: 0 0 8px; color: var(--cx-ink-muted); font-size: 14px; }
body[data-cryex-app="merchant"] .promo-empty.is-error strong { color: var(--cx-danger); }

body[data-cryex-app="merchant"] .promo-loading { display: grid; grid-column: 1 / -1; gap: 10px; }

body[data-cryex-app="merchant"] .promo-loading i {
  height: 72px;
  border-radius: var(--cx-radius-lg);
  background: var(--cx-surface-muted);
  animation: merchant-blink 1.4s infinite;
}

body[data-cryex-app="merchant"] .promo-modal-intro { margin: 0 0 16px; color: var(--cx-ink-muted); font-size: 14px; }

body[data-cryex-app="merchant"] .promo-form-error {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--cx-danger);
  border-radius: var(--cx-radius);
  background: var(--cx-danger-soft);
  color: var(--cx-danger);
  font-size: 14px;
  font-weight: 600;
}

/* ---- Sales ---- */
body[data-cryex-app="merchant"] .segmented-control {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  background: var(--cx-surface);
}

body[data-cryex-app="merchant"] .segmented-control button {
  min-height: 40px;
  flex: 1;
  padding: 0 14px;
  border: 0;
  border-radius: var(--cx-radius-sm);
  background: transparent;
  color: var(--cx-ink-muted);
  font-size: 14px;
  font-weight: 700;
}

body[data-cryex-app="merchant"] .segmented-control button.is-active { background: var(--cx-ink); color: var(--cx-surface); }

body[data-cryex-app="merchant"] .report-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 12px;
}

body[data-cryex-app="merchant"] .sales-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.6fr);
  gap: 16px;
  margin-top: 16px;
}

body[data-cryex-app="merchant"] .chart-total { color: var(--cx-ink-muted); font-size: 14px; font-weight: 700; }
body[data-cryex-app="merchant"] .chart-wrap { padding: 8px 20px 20px; }

body[data-cryex-app="merchant"] .bar-chart {
  display: flex;
  height: 240px;
  align-items: flex-end;
  gap: 8px;
  padding-top: 20px;
  border-bottom: 1px solid var(--cx-border);
  background: repeating-linear-gradient(to bottom, transparent 0 59px, var(--cx-surface-muted) 59px 60px);
}

body[data-cryex-app="merchant"] .chart-column {
  display: grid;
  height: 100%;
  flex: 1;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 8px;
}

body[data-cryex-app="merchant"] .chart-column i {
  display: block;
  min-height: 3px;
  border-radius: 6px 6px 2px 2px;
  background: var(--cx-border);
  transition: height 0.5s ease;
}

body[data-cryex-app="merchant"] .chart-column i:hover { background: var(--cx-accent-strong); }
body[data-cryex-app="merchant"] .chart-column span { color: var(--cx-ink-faint); font-size: 12px; text-align: center; }

body[data-cryex-app="merchant"] #topItems { padding: 0 16px 16px; }

body[data-cryex-app="merchant"] .top-item {
  display: grid;
  grid-template-columns: 24px 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--cx-border);
}

body[data-cryex-app="merchant"] .top-item:first-child { border-top: 0; }
body[data-cryex-app="merchant"] .top-rank { color: var(--cx-ink-faint); font-size: 13px; font-weight: 800; }
body[data-cryex-app="merchant"] .top-item .menu-thumb { width: 40px; height: 40px; }
body[data-cryex-app="merchant"] .top-item strong { display: block; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
body[data-cryex-app="merchant"] .top-item span { color: var(--cx-ink-faint); font-size: 13px; }
body[data-cryex-app="merchant"] .top-item > b { font-size: 14px; }

/* ---- Store details and registration ---- */
body[data-cryex-app="merchant"] .profile-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--cx-radius-pill);
  background: var(--cx-danger-soft);
  color: var(--cx-danger);
  font-size: 13px;
  font-weight: 700;
}

body[data-cryex-app="merchant"] .profile-state i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
body[data-cryex-app="merchant"] .profile-state.is-ready { background: var(--cx-success-soft); color: var(--cx-success); }

body[data-cryex-app="merchant"] .merchant-access {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-lg);
  background: var(--cx-surface);
}

body[data-cryex-app="merchant"] .merchant-access > div:first-child { display: grid; min-width: 0; gap: 6px; margin-right: auto; }
body[data-cryex-app="merchant"] .merchant-access strong { font-size: 18px; line-height: 1.35; }
body[data-cryex-app="merchant"] .merchant-access span:not(.section-kicker) { max-width: 68ch; color: var(--cx-ink-muted); font-size: 15px; }
body[data-cryex-app="merchant"] .merchant-access-actions { display: flex; flex: none; gap: 10px; }
body[data-cryex-app="merchant"] .merchant-dashboard-access { min-height: 180px; }
body[data-cryex-app="merchant"] .merchant-dashboard-access h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.1; }
body[data-cryex-app="merchant"] .merchant-dashboard-access p { max-width: 62ch; margin: 0; color: var(--cx-ink-muted); }

body[data-cryex-app="merchant"] .store-form { display: grid; gap: 16px; width: min(100%, 760px); }
body[data-cryex-app="merchant"] .profile-card { padding: 22px; }

body[data-cryex-app="merchant"] .profile-visual {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding: 16px;
  border-radius: var(--cx-radius-lg);
  background: var(--cx-bg);
  color: var(--cx-text);
}

body[data-cryex-app="merchant"] .large-avatar {
  display: grid;
  width: 56px;
  height: 56px;
  flex: none;
  place-items: center;
  border-radius: var(--cx-radius-lg);
  background: var(--cx-accent);
  color: var(--cx-on-accent);
  font-size: 18px;
  font-weight: 900;
}

body[data-cryex-app="merchant"] .profile-visual div:last-child { display: grid; min-width: 0; gap: 2px; }
body[data-cryex-app="merchant"] .profile-visual strong { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
body[data-cryex-app="merchant"] .profile-visual span { color: var(--cx-muted); font-size: 14px; }

body[data-cryex-app="merchant"] .form-section-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }

body[data-cryex-app="merchant"] .form-section-head > span {
  display: grid;
  width: 32px;
  height: 32px;
  flex: none;
  place-items: center;
  border-radius: var(--cx-radius);
  background: var(--cx-accent-soft);
  color: var(--cx-accent-ink);
  font-size: 14px;
  font-weight: 800;
}

body[data-cryex-app="merchant"] .form-section-head h3 { margin: 0; font-size: 17px; }
body[data-cryex-app="merchant"] .form-section-head p { margin: 2px 0 0; color: var(--cx-ink-muted); font-size: 14px; }

body[data-cryex-app="merchant"] .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
body[data-cryex-app="merchant"] .span-2 { grid-column: 1 / -1; }
body[data-cryex-app="merchant"] .field { display: grid; align-content: start; gap: 6px; }

body[data-cryex-app="merchant"] :is(.field > span, .merchant-address-field > label) { font-size: 14px; font-weight: 700; }

body[data-cryex-app="merchant"] .field :is(input, select, textarea),
body[data-cryex-app="merchant"] :is(.input-suffix, .input-prefix) {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  background: var(--cx-surface);
  color: var(--cx-ink);
  font-size: 16px;
}

body[data-cryex-app="merchant"] .field :is(input, select) { padding: 0 12px; }
body[data-cryex-app="merchant"] .field textarea { min-height: 96px; padding: 10px 12px; line-height: 1.5; resize: vertical; }

body[data-cryex-app="merchant"] .field :is(input, select, textarea):focus,
body[data-cryex-app="merchant"] :is(.input-suffix, .input-prefix):focus-within {
  border-color: var(--cx-accent-strong);
}

body[data-cryex-app="merchant"] :is(.input-suffix, .input-prefix) { display: flex; align-items: center; overflow: hidden; }
body[data-cryex-app="merchant"] :is(.input-suffix, .input-prefix) input { flex: 1; min-height: 46px; border: 0; background: transparent; }
body[data-cryex-app="merchant"] :is(.input-suffix, .input-prefix) span { padding: 0 12px; color: var(--cx-ink-muted); font-size: 14px; white-space: nowrap; }
body[data-cryex-app="merchant"] .input-prefix span { padding-right: 2px; color: var(--cx-ink); font-weight: 700; }
body[data-cryex-app="merchant"] .field-help { color: var(--cx-ink-faint); font-size: 13px; font-weight: 500; line-height: 1.45; }

body[data-cryex-app="merchant"] .toggle-field {
  position: relative;
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  background: var(--cx-canvas);
  cursor: pointer;
}

body[data-cryex-app="merchant"] .toggle-field > span { display: grid; gap: 2px; margin-right: auto; }
body[data-cryex-app="merchant"] .toggle-field strong { font-size: 15px; }
body[data-cryex-app="merchant"] .toggle-field small { color: var(--cx-ink-muted); font-size: 13px; }
body[data-cryex-app="merchant"] .toggle-field input { position: absolute; opacity: 0; pointer-events: none; }

body[data-cryex-app="merchant"] .toggle-field input:focus-visible + i { outline: 3px solid var(--cx-focus); outline-offset: 3px; }
body[data-cryex-app="merchant"] .toggle-field.compact { align-self: end; min-height: 48px; padding: 6px 12px; }

body[data-cryex-app="merchant"] .merchant-address-field { display: grid; gap: 8px; }
body[data-cryex-app="merchant"] .merchant-address-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }

body[data-cryex-app="merchant"] .merchant-address-results {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  background: var(--cx-surface);
  box-shadow: var(--cx-shadow-soft);
}

body[data-cryex-app="merchant"] .merchant-address-results button {
  display: grid;
  min-height: 52px;
  gap: 2px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--cx-border);
  background: transparent;
  color: var(--cx-ink);
  text-align: left;
}

body[data-cryex-app="merchant"] .merchant-address-results button:last-child { border-bottom: 0; }
body[data-cryex-app="merchant"] .merchant-address-results button:hover { background: var(--cx-canvas); }
body[data-cryex-app="merchant"] .merchant-address-results button strong { font-size: 15px; }
body[data-cryex-app="merchant"] :is(.merchant-address-results button small, .merchant-address-results > p) { color: var(--cx-ink-muted); font-size: 14px; }
body[data-cryex-app="merchant"] .merchant-address-results > p { margin: 0; padding: 12px; }

body[data-cryex-app="merchant"] .location-preview {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  background: var(--cx-accent-soft);
}

body[data-cryex-app="merchant"] .location-preview.is-empty { background: var(--cx-canvas); }

body[data-cryex-app="merchant"] .location-marker {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--cx-radius);
  background: var(--cx-surface);
  color: var(--cx-accent-ink);
}

body[data-cryex-app="merchant"] .location-preview.is-empty .location-marker { color: var(--cx-ink-faint); }
body[data-cryex-app="merchant"] .location-marker svg { width: 20px; height: 20px; }
body[data-cryex-app="merchant"] .location-preview > div { display: grid; min-width: 0; gap: 2px; }

body[data-cryex-app="merchant"] .location-preview small {
  color: var(--cx-ink-faint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body[data-cryex-app="merchant"] .location-preview output { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
body[data-cryex-app="merchant"] .merchant-map-shell { overflow: hidden; border: 1px solid var(--cx-border); border-radius: var(--cx-radius-lg); }
body[data-cryex-app="merchant"] .merchant-osm-map { min-height: 320px; }

body[data-cryex-app="merchant"] .merchant-map-fallback {
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 24px;
  background: var(--cx-canvas);
  text-align: center;
}

body[data-cryex-app="merchant"] .merchant-map-fallback > div { display: grid; max-width: 360px; gap: 6px; }
body[data-cryex-app="merchant"] .merchant-map-fallback span { color: var(--cx-ink-muted); font-size: 14px; }

body[data-cryex-app="merchant"] :is(.fulfillment-contract, .customer-contract) {
  padding: 16px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-lg);
  background: var(--cx-canvas);
}

body[data-cryex-app="merchant"] .fulfillment-contract { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; }

body[data-cryex-app="merchant"] .fulfillment-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: var(--cx-radius);
  background: var(--cx-accent-soft);
}

body[data-cryex-app="merchant"] .fulfillment-icon svg { width: 22px; height: 22px; }
body[data-cryex-app="merchant"] :is(.fulfillment-contract, .customer-contract) strong { display: block; font-size: 15px; }
body[data-cryex-app="merchant"] :is(.fulfillment-contract p, .customer-contract li) { color: var(--cx-ink-muted); font-size: 14px; }
body[data-cryex-app="merchant"] .fulfillment-contract p { margin: 4px 0 0; }
body[data-cryex-app="merchant"] .customer-contract ul { margin: 8px 0 0; padding-left: 20px; }

body[data-cryex-app="merchant"] :is(.registration-privacy-note, .registration-password-note) { margin: 16px 0 0; color: var(--cx-ink-muted); font-size: 14px; }
body[data-cryex-app="merchant"] .registration-password-note strong { color: var(--cx-ink); }

body[data-cryex-app="merchant"] .store-form-status { margin: 16px 0 0; color: var(--cx-ink-muted); font-size: 14px; font-weight: 600; }

body[data-cryex-app="merchant"] .store-form-status:not(:empty) {
  padding: 10px 12px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  background: var(--cx-canvas);
}

body[data-cryex-app="merchant"] .store-form-status.is-error { border-color: var(--cx-danger); background: var(--cx-danger-soft); color: var(--cx-danger); }
body[data-cryex-app="merchant"] .store-form-status.is-success { border-color: var(--cx-success); background: var(--cx-success-soft); color: var(--cx-success); }

body[data-cryex-app="merchant"] .form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--cx-border);
}

body[data-cryex-app="merchant"] .form-actions > span { max-width: 260px; color: var(--cx-ink-faint); font-size: 13px; }
body[data-cryex-app="merchant"] .form-actions .prs-security { width: 100%; flex: 1 0 100%; order: -1; }

body[data-cryex-app="merchant"] .merchant-wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

body[data-cryex-app="merchant"] .merchant-wizard-actions > span { color: var(--cx-ink-muted); font-size: 14px; font-weight: 700; }

/* ---- Dialogs (surface, border and backdrop come from the shell) ---- */
body[data-cryex-app="merchant"] .modal {
  width: min(600px, calc(100vw - 28px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden auto;
}

body[data-cryex-app="merchant"] .modal[open] { animation: merchant-modal-in 0.2s ease-out; }

@keyframes merchant-modal-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }

body[data-cryex-app="merchant"] :is(.modal-header, .modal-footer) {
  position: sticky;
  z-index: 2;
  display: flex;
  gap: 8px;
  padding: 16px 22px;
  background: var(--cx-surface);
}

body[data-cryex-app="merchant"] .modal-header { top: 0; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--cx-border); }
body[data-cryex-app="merchant"] .modal-header h2 { margin: 2px 0 0; font-size: 20px; }
body[data-cryex-app="merchant"] .modal-body { padding: 20px 22px 24px; }

body[data-cryex-app="merchant"] .modal-footer {
  bottom: 0;
  justify-content: flex-end;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--cx-border);
}

body[data-cryex-app="merchant"] .item-image-editor {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 14px;
  border: 1px dashed var(--cx-border);
  border-radius: var(--cx-radius-lg);
  background: var(--cx-canvas);
}

body[data-cryex-app="merchant"] .item-image-preview {
  display: grid;
  width: 72px;
  height: 72px;
  flex: none;
  place-items: center;
  overflow: hidden;
  border-radius: var(--cx-radius-lg);
  background: var(--cx-surface-muted);
  color: var(--cx-ink-faint);
  font-size: 20px;
}

body[data-cryex-app="merchant"] .item-image-preview img { width: 100%; height: 100%; object-fit: cover; }
body[data-cryex-app="merchant"] .item-image-editor label { display: grid; gap: 2px; cursor: pointer; }
body[data-cryex-app="merchant"] .item-image-editor label strong { font-size: 15px; }
body[data-cryex-app="merchant"] .item-image-editor label span { color: var(--cx-ink-muted); font-size: 13px; }
body[data-cryex-app="merchant"] .item-image-editor label input { position: absolute; opacity: 0; pointer-events: none; }
body[data-cryex-app="merchant"] .item-image-editor label em { margin-top: 4px; color: var(--cx-accent-ink); font-size: 14px; font-style: normal; font-weight: 700; }

body[data-cryex-app="merchant"] .confirm-modal { width: min(400px, calc(100vw - 28px)); text-align: center; }
body[data-cryex-app="merchant"] .confirm-modal form { padding: 28px; }

body[data-cryex-app="merchant"] .confirm-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: var(--cx-radius-lg);
  background: var(--cx-danger-soft);
  color: var(--cx-danger);
  font-size: 20px;
  font-weight: 900;
}

body[data-cryex-app="merchant"] .confirm-modal h2 { margin: 0; font-size: 20px; }
body[data-cryex-app="merchant"] .confirm-modal p { margin: 8px auto 20px; color: var(--cx-ink-muted); font-size: 15px; }
body[data-cryex-app="merchant"] .confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
body[data-cryex-app="merchant"] .confirm-actions .cx-button { padding-inline: 12px; white-space: normal; }

body[data-cryex-app="merchant"] .support-modal { width: min(660px, calc(100vw - 28px)); }
body[data-cryex-app="merchant"] .notification-modal { width: min(560px, calc(100vw - 28px)); }
body[data-cryex-app="merchant"] :is(.support-intro, .notification-toolbar p) { margin: 0; color: var(--cx-ink-muted); font-size: 14px; }
body[data-cryex-app="merchant"] .support-case-section { margin: 20px 0; }
body[data-cryex-app="merchant"] .support-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
body[data-cryex-app="merchant"] :is(.support-section-head h3, .support-form h3) { margin: 0; font-size: 16px; }
body[data-cryex-app="merchant"] .support-ticket-list { display: grid; max-height: 230px; gap: 8px; overflow-y: auto; }

body[data-cryex-app="merchant"] .support-ticket {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 12px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  background: var(--cx-canvas);
}

body[data-cryex-app="merchant"] .support-ticket > div { display: grid; min-width: 0; gap: 2px; }
body[data-cryex-app="merchant"] .support-ticket > div strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
body[data-cryex-app="merchant"] :is(.support-ticket > div span, .support-ticket > small) { color: var(--cx-ink-faint); font-size: 13px; }
body[data-cryex-app="merchant"] .support-ticket > p { grid-column: 1 / -1; margin: 0; color: var(--cx-ink-muted); font-size: 14px; }
body[data-cryex-app="merchant"] .support-ticket > small { grid-column: 1 / -1; padding-top: 6px; border-top: 1px solid var(--cx-border); }

body[data-cryex-app="merchant"] .support-ticket-status {
  align-self: start;
  padding: 3px 8px;
  border-radius: var(--cx-radius-pill);
  background: var(--cx-surface-muted);
  color: var(--cx-ink-muted);
  font-size: 12px;
  font-weight: 800;
}

body[data-cryex-app="merchant"] .support-ticket-status:is(.is-resolved, .is-closed, .is-completed) { background: var(--cx-success-soft); color: var(--cx-success); }
body[data-cryex-app="merchant"] .support-ticket-status:is(.is-pending, .is-waiting, .is-waiting_for_reply, .is-in_progress) { background: var(--cx-warning-soft); color: var(--cx-warning); }

body[data-cryex-app="merchant"] .support-empty {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 18px;
  border: 1px dashed var(--cx-border);
  border-radius: var(--cx-radius);
  color: var(--cx-ink-muted);
  font-size: 14px;
  text-align: center;
}

body[data-cryex-app="merchant"] .support-empty strong { color: var(--cx-ink); }
body[data-cryex-app="merchant"] .support-empty.is-error { border-color: var(--cx-danger); color: var(--cx-danger); }
body[data-cryex-app="merchant"] .support-form { display: grid; gap: 14px; padding-top: 18px; border-top: 1px solid var(--cx-border); }
body[data-cryex-app="merchant"] .support-form > .cx-button { justify-self: end; }

body[data-cryex-app="merchant"] .notification-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
body[data-cryex-app="merchant"] .notification-list { display: grid; max-height: min(520px, 65dvh); gap: 8px; overflow-y: auto; }

body[data-cryex-app="merchant"] .notification-item {
  display: grid;
  width: 100%;
  min-height: 64px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  background: var(--cx-surface);
  color: var(--cx-ink);
  text-align: left;
}

body[data-cryex-app="merchant"] .notification-item:hover { background: var(--cx-canvas); }
body[data-cryex-app="merchant"] .notification-item.is-unread { border-color: var(--cx-accent-strong); background: var(--cx-accent-soft); }
body[data-cryex-app="merchant"] .notification-item > span:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
body[data-cryex-app="merchant"] .notification-item strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
body[data-cryex-app="merchant"] .notification-item small { color: var(--cx-ink-muted); font-size: 13px; }
body[data-cryex-app="merchant"] .notification-item time { color: var(--cx-ink-faint); font-size: 12px; }
body[data-cryex-app="merchant"] .notification-item > i { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--cx-danger); }

body[data-cryex-app="merchant"] .notification-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--cx-radius);
  background: var(--cx-accent-soft);
  color: var(--cx-accent-ink);
}

body[data-cryex-app="merchant"] .notification-icon svg { width: 18px; height: 18px; }

/* ---- Toasts ---- */
body[data-cryex-app="merchant"] .toast-region {
  position: fixed;
  right: 24px;
  bottom: max(24px, env(safe-area-inset-bottom));
  display: grid;
  width: min(360px, calc(100vw - 32px));
  gap: 8px;
  pointer-events: none;
}

body[data-cryex-app="merchant"] .toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--cx-radius-lg);
  background: var(--cx-bg);
  color: var(--cx-text);
  box-shadow: var(--cx-shadow);
  animation: merchant-toast-in 0.25s ease-out;
  transition: opacity 0.2s, transform 0.2s;
}

body[data-cryex-app="merchant"] .toast::before {
  width: 22px;
  height: 22px;
  flex: none;
  background-color: var(--cx-accent);
  content: "";
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 4 4L19 6'/%3E%3C/svg%3E") center / 16px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 4 4L19 6'/%3E%3C/svg%3E") center / 16px no-repeat;
}

body[data-cryex-app="merchant"] .toast.is-error::before {
  background-color: var(--merchant-alert-on-dark);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 5v9M12 18h.01'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 5v9M12 18h.01'/%3E%3C/svg%3E");
}

body[data-cryex-app="merchant"] .toast div { display: grid; gap: 2px; }
body[data-cryex-app="merchant"] .toast strong { font-size: 14px; }
body[data-cryex-app="merchant"] .toast span { color: var(--cx-muted); font-size: 13px; }

@keyframes merchant-toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---- Desktop: dark top bar, light page header row ---- */
@media (min-width: 921px) {
  body[data-cryex-app="merchant"] .sidebar {
    position: fixed;
    z-index: var(--cx-z-menu);
    inset: 0 0 auto;
    height: var(--cx-header);
    align-items: center;
    gap: 18px;
    padding: 0 var(--merchant-gutter);
    border-bottom: 1px solid var(--cx-line);
  }

  body[data-cryex-app="merchant"] :is(.sidebar-close, .sidebar-foot, .sidebar-scrim, .menu-toggle, .mobile-merchant-brand, .merchant-mobile-nav) { display: none; }
  body[data-cryex-app="merchant"] .nav-list { display: flex; flex: 1; align-items: center; gap: 2px; }
  body[data-cryex-app="merchant"] .nav-link { min-height: 40px; gap: 7px; }
  body[data-cryex-app="merchant"] .nav-link.is-active { box-shadow: inset 0 -2px var(--cx-accent-strong); }
  body[data-cryex-app="merchant"] .nav-link[data-nav="settings"] { margin-left: auto; }
  body[data-cryex-app="merchant"] .nav-count { margin-left: 2px; }
  body[data-cryex-app="merchant"] .main-content { padding-top: var(--cx-header); }

  body[data-cryex-app="merchant"] .topbar {
    min-height: 44px;
    margin: 16px var(--merchant-gutter) 0;
  }

  body[data-cryex-app="merchant"] .topbar :is(.workspace-auth-actions, .workspace-profile) { display: none !important; }
}

/* Between 921px and 1180px the top bar drops its icons so labels never wrap. */
@media (min-width: 921px) and (max-width: 1180px) {
  body[data-cryex-app="merchant"] .nav-link svg { display: none; }
  body[data-cryex-app="merchant"] .nav-link { padding: 0 10px; }
  body[data-cryex-app="merchant"] .sidebar { gap: 10px; }
  body[data-cryex-app="merchant"] .merchant-navbar-account .workspace-profile-copy { display: none; }
}

/* ---- Mobile: dark header, drawer, fixed tab bar ---- */
@media (max-width: 920px) {
  body[data-cryex-app="merchant"] .sidebar {
    position: fixed;
    z-index: var(--cx-z-overlay);
    inset: 0 auto 0 0;
    width: min(320px, calc(100vw - 48px));
    flex-direction: column;
    padding: 20px 16px max(20px, env(safe-area-inset-bottom));
    overflow-y: auto;
    box-shadow: var(--cx-shadow);
    transform: translateX(-100%);
    transition: transform 0.24s ease;
  }

  body[data-cryex-app="merchant"] .sidebar.is-open { transform: translateX(0); }
  body[data-cryex-app="merchant"] .nav-list { display: grid; gap: 4px; margin-top: 24px; }
  body[data-cryex-app="merchant"] .nav-link { min-height: 48px; font-size: 15px; }
  body[data-cryex-app="merchant"] .nav-link.is-active { box-shadow: inset 3px 0 var(--cx-accent-strong); }
  body[data-cryex-app="merchant"] .sidebar .icon-button { border-color: var(--cx-line-strong); background: transparent; color: var(--cx-text); }

  body[data-cryex-app="merchant"] .sidebar .merchant-navbar-account {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
    margin: 24px 0 0;
    padding: 16px 0 0;
    border-top: 1px solid var(--cx-line);
    border-left: 0;
  }

  body[data-cryex-app="merchant"] .sidebar .merchant-navbar-account .workspace-auth-actions { display: flex; width: 100%; }
  body[data-cryex-app="merchant"] .sidebar .merchant-navbar-account .workspace-auth-button { flex: 1; }

  body[data-cryex-app="merchant"] .sidebar-scrim {
    position: fixed;
    z-index: var(--cx-z-scrim);
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(8, 12, 9, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }

  body[data-cryex-app="merchant"] .sidebar-scrim.is-open { opacity: 1; pointer-events: auto; }

  body[data-cryex-app="merchant"] .topbar {
    min-height: calc(64px + env(safe-area-inset-top));
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    background:
      radial-gradient(circle at 18% 2%, var(--cx-accent-soft), transparent 17rem),
      linear-gradient(180deg, var(--cx-bg), var(--cx-bg-soft));
    color: var(--cx-text);
  }

  body[data-cryex-app="merchant"] .topbar :is(.icon-button, .connection-pill) {
    border-color: var(--cx-line-strong);
    background: rgba(255, 255, 255, 0.055);
    color: var(--cx-text);
  }

  body[data-cryex-app="merchant"] .notification-dot { border-color: var(--cx-bg); }
  body[data-cryex-app="merchant"] .desktop-action { display: none; }

  body[data-cryex-app="merchant"] .mobile-merchant-brand {
    display: grid;
    min-height: 44px;
    align-content: center;
    gap: 3px;
    font-size: 17px;
    line-height: 1;
  }

  body[data-cryex-app="merchant"] .mobile-merchant-brand small { font-size: 11px; }

  body[data-cryex-app="merchant"] .merchant-mobile-auth { display: flex; }

  body[data-cryex-app="merchant"] .merchant-mobile-nav {
    position: fixed;
    z-index: var(--cx-z-menu);
    inset: auto 0 0;
    display: grid;
    height: calc(var(--cx-mobile-nav) + env(safe-area-inset-bottom));
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid var(--cx-line);
    background: rgba(8, 8, 8, 0.95);
    box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.27);
    backdrop-filter: blur(16px);
  }

  body[data-cryex-app="merchant"] .merchant-mobile-nav a {
    display: flex;
    min-height: 56px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: var(--cx-radius);
    color: var(--cx-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
  }

  body[data-cryex-app="merchant"] .merchant-mobile-nav a { position: relative; }
  body[data-cryex-app="merchant"] .merchant-mobile-nav a.is-active { color: var(--cx-accent); }

  body[data-cryex-app="merchant"] .tab-count {
    position: absolute;
    top: 4px;
    left: calc(50% + 6px);
    min-width: 20px;
    padding: 1px 6px;
    border-radius: var(--cx-radius-pill);
    background: var(--cx-app-accent);
    color: var(--cx-on-accent);
    font-size: 11px;
    line-height: 1.5;
  }
  body[data-cryex-app="merchant"] .merchant-mobile-nav svg { width: 22px; height: 22px; }

  body[data-cryex-app="merchant"][data-auth-state="signed-in"] .toast-region {
    right: 16px;
    bottom: calc(var(--cx-mobile-nav) + 12px + env(safe-area-inset-bottom));
  }

  body[data-cryex-app="merchant"] .content-wrap { padding-top: 20px; }
  body[data-cryex-app="merchant"] .operations-brief { flex-direction: column; align-items: stretch; }
  body[data-cryex-app="merchant"] .operations-brief-actions { display: grid; grid-template-columns: 1fr 1fr; }
  body[data-cryex-app="merchant"] .merchant-reach-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body[data-cryex-app="merchant"] .sales-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 920px) and (max-height: 500px) and (orientation: landscape) {
  body[data-cryex-app="merchant"] { --cx-mobile-nav: 56px; }
  body[data-cryex-app="merchant"] .merchant-mobile-nav { padding-block: 4px; }
  body[data-cryex-app="merchant"] .merchant-mobile-nav a { min-height: 48px; flex-direction: row; gap: 6px; }
}

/* ---- Small phones: content tweaks only ---- */
@media (max-width: 560px) {
  body[data-cryex-app="merchant"] .topbar .connection-pill { display: none; }
  body[data-cryex-app="merchant"] .section-title-row > :is(.cx-button, .segmented-control) { width: 100%; }
  body[data-cryex-app="merchant"] .setup-banner { flex-wrap: wrap; }
  body[data-cryex-app="merchant"] .setup-banner .cx-button { width: 100%; margin-left: 0; }
  body[data-cryex-app="merchant"] .operations-brief { padding: 20px; }
  body[data-cryex-app="merchant"] .operations-brief-actions { grid-template-columns: 1fr; }
  body[data-cryex-app="merchant"] .operations-brief-actions .queue-button { order: -1; }
  body[data-cryex-app="merchant"] .compact-order { grid-template-columns: 44px minmax(0, 1fr) auto; }
  body[data-cryex-app="merchant"] .compact-order > .cx-button { grid-column: 2 / -1; }
  body[data-cryex-app="merchant"] .today-stats { padding-inline: 14px; gap: 8px; }
  body[data-cryex-app="merchant"] .today-stats strong { font-size: 19px; }
  body[data-cryex-app="merchant"] .merchant-reach-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: 14px; }
  body[data-cryex-app="merchant"] .merchant-reach-summary-state { flex-direction: column; align-items: stretch; padding-inline: 14px; }
  body[data-cryex-app="merchant"] .order-connections dl { grid-template-columns: 1fr; }
  body[data-cryex-app="merchant"] .order-actions { grid-template-columns: 1fr 1fr; }
  body[data-cryex-app="merchant"] .order-actions > .cx-button--primary { grid-column: 1 / -1; }
  body[data-cryex-app="merchant"] .toolbar { flex-wrap: wrap; }
  body[data-cryex-app="merchant"] .search-field { flex-basis: 100%; }
  body[data-cryex-app="merchant"] .toolbar select { min-width: 0; flex: 1; }
  body[data-cryex-app="merchant"] .promo-summary-grid { grid-template-columns: 1fr; }
  body[data-cryex-app="merchant"] .promo-list { padding-inline: 12px; }
  body[data-cryex-app="merchant"] :is(.merchant-access, .merchant-access-actions) { flex-direction: column; align-items: stretch; }
  body[data-cryex-app="merchant"] .profile-card { padding: 16px; }
  body[data-cryex-app="merchant"] .form-grid { grid-template-columns: minmax(0, 1fr); }
  body[data-cryex-app="merchant"] .merchant-address-search { grid-template-columns: 1fr; }
  body[data-cryex-app="merchant"] .merchant-osm-map { min-height: 260px; }
  body[data-cryex-app="merchant"] .form-actions { flex-direction: column; align-items: stretch; }
  body[data-cryex-app="merchant"] :is(.modal-header, .modal-body, .modal-footer) { padding-inline: 16px; }
  body[data-cryex-app="merchant"] .modal-footer .cx-button { flex: 1; }
  body[data-cryex-app="merchant"] .item-image-editor { align-items: flex-start; }
  body[data-cryex-app="merchant"] .support-form > .cx-button { width: 100%; }
  body[data-cryex-app="merchant"] .notification-toolbar { flex-direction: column; align-items: flex-start; }
}

@media (forced-colors: active) {
  body[data-cryex-app="merchant"] :is(.operations-brief, .order-sla, .order-status, .operations-status > i, .toggle-field > i) {
    border: 1px solid CanvasText;
  }
}
