/* Mobile shell layout — loaded with base_mobile / base_public_mobile */

.app-shell-mobile {
  --mobile-topbar-h: 52px;
  --mobile-tabbar-h: 56px;
  --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
  --mobile-safe-top: env(safe-area-inset-top, 0px);
}

.app-shell-mobile .layout,
.app-shell-mobile .sidebar {
  display: none !important;
}

.mobile-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--mobile-topbar-h);
  padding: calc(6px + var(--mobile-safe-top)) 12px 6px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.mobile-topbar-start,
.mobile-topbar-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.mobile-topbar-start {
  width: 40px;
}

.mobile-topbar-actions {
  width: 40px;
  justify-content: flex-end;
}

.mobile-topbar-actions:has(.mobile-topbar-cta) {
  width: auto;
  max-width: 42%;
  gap: 6px;
}

.mobile-topbar-cta {
  white-space: nowrap;
  padding-inline: 10px;
}

.mobile-topbar-title {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.mobile-topbar-heading {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-topbar-sub {
  display: block;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
}

.mobile-back-btn:active {
  background: var(--surface-muted);
}

.app-shell-mobile {
  scroll-padding-bottom: calc(var(--mobile-tabbar-h) + var(--mobile-safe-bottom) + 20px);
}

.mobile-main {
  padding:
    calc(var(--mobile-topbar-h) + var(--mobile-safe-top) + 8px)
    clamp(10px, 3vw, 16px)
    calc(var(--mobile-tabbar-h) + var(--mobile-safe-bottom) + 32px);
  min-height: 100vh;
  min-height: 100dvh;
}

.mobile-tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  align-items: stretch;
  min-height: var(--mobile-tabbar-h);
  padding-bottom: var(--mobile-safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.06);
}

.mobile-tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  padding: 6px 4px;
  border: none;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.mobile-tab-item.active {
  color: var(--primary);
}

.mobile-tab-icon {
  font-size: 16px;
  line-height: 1;
}

.mobile-tab-label {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.1;
}

.mobile-more-sheet[hidden] {
  display: none !important;
}

.mobile-more-sheet:not([hidden]) {
  display: block;
}

.mobile-more-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(15, 23, 42, 0.4);
}

.mobile-more-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 301;
  max-height: 70vh;
  padding-bottom: var(--mobile-safe-bottom);
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.12);
  overflow: auto;
}

.mobile-more-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
  border-bottom: 1px solid var(--border);
}

.mobile-more-head h2 {
  margin: 0;
  font-size: 16px;
}

.mobile-more-nav {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.mobile-more-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.mobile-more-link.active {
  color: var(--primary);
  background: var(--primary-soft);
}

.mobile-more-icon {
  width: 24px;
  text-align: center;
}

.mobile-more-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}

.mobile-more-user {
  font-size: 13px;
  color: var(--muted);
}

.mobile-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--mobile-tabbar-h) + var(--mobile-safe-bottom));
  z-index: 150;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
}

.mobile-action-bar .btn {
  flex: 1;
  min-height: 44px;
}

.mobile-main--with-action-bar {
  padding-bottom: calc(var(--mobile-tabbar-h) + var(--mobile-safe-bottom) + 72px);
}

.mobile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mobile-stats-grid-balanced .stat-card-span-2 {
  grid-column: 1 / -1;
}

.mobile-stats-grid .stat-card {
  padding: 12px;
}

.mobile-filter-bar {
  position: sticky;
  top: calc(var(--mobile-topbar-h) + var(--mobile-safe-top));
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 12px;
  margin-bottom: 8px;
  background: var(--bg);
}

.mobile-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mobile-quick-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  min-height: 72px;
}

.mobile-quick-card strong {
  font-size: 14px;
}

.mobile-quick-card span {
  font-size: 12px;
  color: var(--muted);
}

.mobile-page-heading {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
}

.mobile-section-title {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mobile-accordion {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 10px;
  background: var(--surface);
}

.mobile-accordion summary {
  padding: 14px 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.mobile-accordion summary::-webkit-details-marker {
  display: none;
}

.mobile-accordion .mobile-accordion-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.public-shell-mobile {
  max-width: none;
  width: 100%;
  min-height: 100dvh;
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
}

.public-header-mobile {
  padding-top: max(12px, env(safe-area-inset-top));
}

.public-main-mobile {
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.public-footer-mobile {
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.app-shell-mobile .page-header {
  display: none;
}

.app-shell-mobile .page-header-mobile-visible {
  display: block;
  margin-bottom: 12px;
}

.app-shell-mobile .sub-nav {
  margin-bottom: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.app-shell-mobile .tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
}

.app-shell-mobile .tab {
  flex-shrink: 0;
  min-height: 40px;
}

.settings-viewport-toggle {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.settings-viewport-toggle .btn {
  width: 100%;
  min-height: 44px;
}

.app-shell-mobile .redeem-card {
  max-width: none;
  margin: 0;
}

.app-shell-mobile .redeem-form .btn-primary {
  min-height: 48px;
  font-size: 16px;
}

.app-shell-mobile .form-row,
.app-shell-mobile .import-grid {
  grid-template-columns: 1fr !important;
}

.app-shell-mobile .data-table--responsive td {
  padding: 10px 12px;
}

.app-shell-mobile .ops-log-drawer {
  width: 100%;
  max-width: 100%;
}

/* ── Pipeline (dashboard) mobile ── */
.pipeline-mobile {
  margin-top: -4px;
}

.pipeline-mobile-tabs {
  margin-bottom: 10px;
}

.pipeline-shop-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  font-size: 0.82rem;
}

.pipeline-shop-pill-label {
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--primary);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pipeline-stage-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding: 2px 2px 12px;
  margin: 0 -2px 8px;
  scrollbar-width: none;
}

.pipeline-stage-scroll::-webkit-scrollbar {
  display: none;
}

.pipeline-stage-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 76px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}

.pipeline-stage-chip.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 25%, transparent);
}

.pipeline-stage-chip-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

.pipeline-stage-chip.is-active .pipeline-stage-chip-label {
  color: var(--primary);
}

.pipeline-stage-chip-value {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.1;
}

.pipeline-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.pipeline-search-form {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.pipeline-search-shell {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.pipeline-search-shell:focus-within {
  border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

.pipeline-search-icon {
  color: var(--muted);
  font-size: 1rem;
}

.pipeline-search-shell input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 10px 0;
  font: inherit;
  font-size: 16px;
}

.pipeline-search-shell input:focus {
  outline: none;
}

.pipeline-search-btn {
  min-height: 44px;
  min-width: 52px;
  border-radius: 12px;
}

.pipeline-filters-sheet {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.pipeline-filters-toggle {
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.pipeline-filters-toggle::-webkit-details-marker {
  display: none;
}

.pipeline-filters-toggle::after {
  content: " ▾";
  color: var(--muted);
  font-weight: 400;
}

.pipeline-filters-sheet[open] .pipeline-filters-toggle::after {
  content: " ▴";
}

.pipeline-filters-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pipeline-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 12px 0 0;
  font-size: 0.82rem;
}

.pipeline-filter-tag {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.pipeline-filter-clear {
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.pipeline-filter-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pipeline-filter-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pipeline-filter-field select {
  width: 100%;
  min-height: 44px;
  font-size: 16px;
}

.pipeline-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}

.pipeline-section-head h2 {
  margin: 0;
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
}

.pipeline-orders-head {
  margin-top: 4px;
}

.pipeline-order-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pipeline-order-card {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
}

.pipeline-order-tap {
  display: block;
  padding: 14px 14px 10px;
  text-decoration: none;
  color: inherit;
}

.pipeline-order-tap:active {
  background: var(--surface-muted);
}

.pipeline-order-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.pipeline-order-time {
  font-size: 0.75rem;
  white-space: nowrap;
}

.pipeline-order-id {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  word-break: break-all;
  margin-bottom: 4px;
}

.pipeline-order-buyer {
  margin: 0 0 2px;
  font-weight: 600;
  font-size: 0.9rem;
}

.pipeline-order-items {
  margin: 0 0 8px;
  font-size: 0.82rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pipeline-order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pipeline-meta-chip {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--muted);
}

.pipeline-meta-chip-ok {
  color: var(--success-text);
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 30%, var(--border));
}

.pipeline-meta-chip-warn {
  color: var(--warning);
  background: var(--info-soft);
  border-color: var(--info-border);
}

.pipeline-order-actions {
  display: flex;
  gap: 8px;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
}

.pipeline-order-actions .btn {
  flex: 0 0 auto;
  min-width: 5.5rem;
  min-height: 34px;
  padding-inline: 14px;
}

.pipeline-order-actions .pipeline-inline-form {
  flex: 1;
  display: flex;
}

.pipeline-order-actions .pipeline-inline-form .btn {
  width: 100%;
}

.pipeline-inline-form {
  margin: 0;
}

.pipeline-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-bottom: 8px;
}

.pipeline-page-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.pipeline-empty {
  text-align: center;
  padding: 24px 12px;
}

.pipeline-empty .btn {
  margin-top: 12px;
}

.pipeline-failed-block {
  margin-bottom: 16px;
}

.pipeline-failed-card {
  margin-bottom: 8px;
  padding: 12px 14px;
}

.pipeline-failed-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.pipeline-failed-error {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.pipeline-order-id-link {
  text-decoration: none;
}

.pipeline-order-id-link code {
  font-size: 0.88rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Order detail mobile ── */
.order-detail-mobile {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.od-hero {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
}

.od-hero-id {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  word-break: break-all;
  margin-bottom: 8px;
}

.od-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.od-chip {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.od-chip-muted {
  color: var(--muted);
}

.od-chip-ok {
  background: color-mix(in srgb, var(--ok) 12%, var(--surface-muted));
  border-color: color-mix(in srgb, var(--ok) 35%, var(--border));
  color: var(--ok);
  font-weight: 600;
}

.od-section {
  margin: 0;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
}

.od-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.od-section-head-static {
  cursor: default;
}

.od-section-head::-webkit-details-marker {
  display: none;
}

.od-buyer-sheet > .od-section-head::before {
  content: "▸";
  color: var(--muted);
  font-size: 0.75rem;
  margin-right: 2px;
}

.od-buyer-sheet[open] > .od-section-head::before {
  content: "▾";
}

.od-section-title {
  font-weight: 600;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.od-section-preview {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.od-kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: 0;
  padding: 0 14px 14px;
}

.od-kv-grid-tight {
  gap: 6px 10px;
  padding: 0;
}

.od-kv-wide {
  grid-column: 1 / -1;
}

.od-kv {
  margin: 0;
  min-width: 0;
}

.od-kv dt {
  margin: 0 0 2px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.od-kv dd {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
  word-break: break-word;
}

.od-kv dd code {
  font-size: 0.78rem;
}

.od-kv-break {
  word-break: break-all;
}

.od-item-list,
.od-assign-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.od-item-card {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

.od-item-card:first-child {
  border-top: none;
}

.od-item-thumb-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 52px;
}

.od-item-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

.od-item-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1rem;
}

.od-item-qty {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.od-item-main {
  flex: 1;
  min-width: 0;
}

.od-item-name {
  margin: 0 0 6px;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.od-item-sku-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.od-sku-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 6px 2px 4px;
  border-radius: 6px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  min-width: 0;
}

.od-sku-k {
  flex-shrink: 0;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}

.od-sku-pill code {
  font-size: 0.7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.od-item-catalog-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-bottom: 4px;
}

.od-catalog-sku {
  font-size: 0.7rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.od-item-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.72rem;
}

.od-listing-link {
  font-weight: 600;
  text-decoration: none;
  color: var(--primary);
}

.od-redeem-card {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

.od-redeem-card:first-child {
  border-top: none;
}

.od-redeem-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.od-redeem-product {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.3;
}

.od-redeem-detail {
  margin: 4px 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.od-assign-card {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

.od-assign-card:first-child {
  border-top: none;
}

.od-assign-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.od-assign-product {
  font-size: 0.84rem;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}

.od-empty,
.od-empty-inline {
  padding: 12px 14px 14px;
  margin: 0;
  font-size: 0.84rem;
}

/* ── Shared mobile list patterns ── */
.catalog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

.catalog-page-label {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ── Linked shops mobile ── */
.shops-mobile-account {
  padding: 14px;
  margin-bottom: 12px;
}

.shops-mobile-session-dl {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.shops-mobile-session-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.82rem;
}

.shops-mobile-session-row dt {
  color: var(--muted);
  margin: 0;
}

.shops-mobile-session-row dd {
  margin: 0;
  text-align: right;
}

.shops-mobile-section {
  margin-bottom: 12px;
  overflow: hidden;
}

.shops-mobile-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.shops-mobile-section-head .panel-title {
  margin: 0;
  flex: 1;
}

.shops-mobile-list {
  display: flex;
  flex-direction: column;
}

.shops-mobile-card {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

.shops-mobile-card:first-child {
  border-top: none;
}

.shops-mobile-card.is-active {
  background: color-mix(in srgb, var(--ok) 6%, var(--surface));
}

.shops-mobile-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.shops-mobile-card-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.shops-mobile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.78rem;
}

.shops-mobile-chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  text-transform: capitalize;
}

.shops-mobile-id {
  font-size: 0.72rem;
}

.shops-mobile-settings {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.shops-mobile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shops-mobile-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

.shops-mobile-link-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

/* ── Catalog product list mobile ── */
.catalog-product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.catalog-product-card {
  margin: 0;
  overflow: hidden;
}

.catalog-product-tap {
  display: block;
  padding: 12px 14px 8px;
  text-decoration: none;
  color: inherit;
}

.catalog-product-row1 {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.catalog-product-name {
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
}

.catalog-product-sku {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
}

.catalog-product-shop {
  margin: 4px 0 0;
  font-size: 0.76rem;
}

.catalog-product-stock {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.catalog-stock-pill {
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.catalog-stock-pill-ok {
  background: color-mix(in srgb, var(--ok) 10%, var(--surface-muted));
  border-color: color-mix(in srgb, var(--ok) 30%, var(--border));
  color: var(--ok);
  font-weight: 600;
}

.catalog-stock-pill-total {
  font-weight: 600;
}

.catalog-product-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 14px 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

/* ── Product stock mobile ── */
.product-stock-mobile {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-import-sheet {
  overflow: hidden;
}

.product-import-sheet-summary {
  padding: 12px 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.product-import-sheet-summary::-webkit-details-marker {
  display: none;
}

.product-import-panels {
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--border);
}

.product-import-block {
  padding-top: 12px;
}

.product-import-block.is-highlight {
  padding: 10px;
  margin: 0 -4px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.product-import-label {
  margin: 0 0 8px;
  font-size: 0.82rem;
}

.product-stock-section {
  overflow: hidden;
}

.product-stock-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.product-stock-section-head .panel-title {
  margin: 0;
  flex: 1;
}

.stock-unit-list {
  display: flex;
  flex-direction: column;
}

.stock-unit-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

.stock-unit-card:first-child {
  border-top: none;
}

.stock-unit-index {
  flex: 0 0 auto;
  font-size: 0.72rem;
  color: var(--muted);
  padding-top: 2px;
}

.stock-unit-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stock-unit-row {
  display: flex;
  gap: 8px;
  font-size: 0.8rem;
  line-height: 1.35;
}

.stock-unit-k {
  flex: 0 0 52px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.stock-unit-delete {
  flex: 0 0 auto;
  min-width: 36px;
}

.stock-unit-card-sold {
  align-items: center;
}

.product-stock-empty {
  padding: 12px 14px;
  margin: 0;
}

/* ── Inventory mobile ── */
.inv-mobile-section {
  margin-bottom: 12px;
  overflow: hidden;
}

.inv-mobile-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.inv-mobile-head .panel-title {
  margin: 0;
  flex: 1;
}

.inv-shops-hint,
.inv-totals-foot {
  padding: 0 14px;
  margin: 8px 0;
  font-size: 0.78rem;
}

.inv-shop-group {
  border-top: 1px solid var(--border);
}

.inv-shop-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}

.inv-shop-summary::-webkit-details-marker {
  display: none;
}

.inv-shop-total {
  margin-left: auto;
  font-size: 0.72rem;
}

.inv-order-list {
  padding: 0 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inv-order-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-muted);
  text-decoration: none;
  color: inherit;
  font-size: 0.8rem;
}

.inv-shop-empty {
  padding: 0 14px 10px;
  margin: 0;
}

.inv-mobile-filters {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.inv-unit-list {
  display: flex;
  flex-direction: column;
}

.inv-unit-card {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

.inv-unit-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.inv-unit-product {
  font-size: 0.86rem;
  line-height: 1.3;
}

.inv-unit-dl {
  margin: 0 0 10px;
  display: grid;
  gap: 4px;
  font-size: 0.78rem;
}

.inv-unit-dl > div {
  display: flex;
  gap: 8px;
}

.inv-unit-dl dt {
  flex: 0 0 52px;
  color: var(--muted);
  margin: 0;
}

.inv-unit-dl dd {
  margin: 0;
  min-width: 0;
}

/* ── Users mobile ── */
.users-mobile-create,
.users-mobile-section {
  margin-bottom: 12px;
  overflow: hidden;
}

.users-mobile-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.users-mobile-head .panel-title {
  margin: 0;
  flex: 1;
}

.users-mobile-create form {
  padding: 12px 14px 14px;
}

.users-mobile-list {
  display: flex;
  flex-direction: column;
}

.users-mobile-card {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

.users-mobile-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.users-mobile-stores {
  margin: 0 0 10px;
  font-size: 0.78rem;
}

.users-mobile-action-form {
  margin-bottom: 8px;
}

.users-mobile-grant-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ── Ops panels mobile ── */
.ops-mobile-panel {
  margin-bottom: 12px;
  overflow: hidden;
}

.ops-mobile-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.ops-mobile-panel-head .panel-title {
  margin: 0;
  flex: 1;
}

.ops-mobile-card-list {
  display: flex;
  flex-direction: column;
}

.ops-mobile-card {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

.ops-mobile-card:first-child {
  border-top: none;
}

.ops-mobile-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.ops-mobile-card-code,
.ops-mobile-card-type {
  margin: 0 0 4px;
  font-size: 0.82rem;
}

.ops-mobile-card-msg {
  margin: 6px 0 10px;
  font-size: 0.78rem;
  line-height: 1.4;
  word-break: break-word;
}

.ops-mobile-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.ops-mobile-step {
  margin: 0 0 6px;
  font-size: 0.76rem;
}

.ops-mobile-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ops-mobile-empty {
  padding: 12px 14px;
  margin: 0;
}

