:root {
  --portal-ink: #17130d;
  --portal-sidebar: #0d0d0d;
  --portal-sidebar-2: #171717;
  --portal-panel: #fffdfa;
  --portal-page: #f1eee8;
  --portal-border: #d9d0c0;
  --portal-muted: #746b5d;
  --portal-accent: #c59a36;
  --portal-accent-strong: #8a6318;
  --portal-accent-soft: #f4e8c8;
  --portal-dark-surface: var(--portal-sidebar);
  --portal-dark-surface-2: var(--portal-sidebar-2);
  --portal-dark-surface-muted: #c8d0da;
  --portal-success: #166534;
  --portal-warning: #9a5b12;
  --portal-danger: #991b1b;
}

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  background: var(--portal-page);
  color: var(--portal-ink);
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
}

a {
  color: var(--portal-accent-strong);
}

.portal-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.portal-sidebar {
  background: linear-gradient(180deg, var(--portal-sidebar), var(--portal-sidebar-2));
  color: #f8fafc;
  padding: 20px 14px;
}

.portal-brand {
  align-items: center;
  color: #f8fafc;
  display: flex;
  font-weight: 700;
  gap: 10px;
  margin-bottom: 22px;
  text-decoration: none;
}

.portal-brand-mark {
  align-items: center;
  background: var(--portal-accent);
  border-radius: 6px;
  color: #17130d;
  display: inline-flex;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.portal-nav {
  display: grid;
  gap: 6px;
}

.portal-nav a,
.portal-nav-toggle {
  border-radius: 6px;
  color: #dbe4ef;
  display: block;
  padding: 10px 12px;
  text-decoration: none;
}

.portal-nav-toggle {
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
  width: 100%;
}

.portal-nav-toggle::after {
  content: "+";
  float: right;
  font-weight: 700;
}

.portal-nav-toggle[aria-expanded="true"]::after {
  content: "-";
}

.portal-nav a:hover,
.portal-nav-toggle:hover {
  background: rgba(197, 154, 54, .18);
  color: #fff;
}

.portal-nav-primary {
  font-size: .98rem;
  font-weight: 700;
}

.portal-nav-section {
  border-left: 2px solid rgba(197, 154, 54, .45);
  display: grid;
  gap: 2px;
  padding-left: 6px;
}

.portal-nav-subitems {
  display: grid;
  gap: 2px;
  margin: 0 0 4px 8px;
}

.portal-nav-subitems[hidden] {
  display: none;
}

.portal-nav-subitems a {
  color: #aeb9c7;
  font-size: .84rem;
  padding: 7px 10px;
}

.portal-main {
  min-width: 0;
}

.portal-topbar {
  align-items: center;
  background: #fffdfa;
  border-bottom: 1px solid var(--portal-border);
  display: flex;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 28px;
}

.portal-content {
  margin: 0;
  max-width: none;
  padding: 24px clamp(18px, 2vw, 32px);
}

.portal-page-heading {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.portal-page-heading h1 {
  font-size: 1.55rem;
  margin: 0 0 4px;
}

.portal-page-heading p {
  color: var(--portal-muted);
  margin: 0;
}

.portal-card {
  background: var(--portal-panel);
  border: 1px solid var(--portal-border);
  border-left: 3px solid var(--portal-accent);
  border-radius: 6px;
  box-shadow: 0 10px 26px rgba(23, 19, 13, .06);
  margin-bottom: 18px;
  padding: 18px;
}

.portal-card h2 {
  font-size: 1.05rem;
  margin: 0 0 14px;
}

.merchant-detail-tabs {
  align-items: center;
  border-bottom: 1px solid var(--portal-border);
  display: flex;
  gap: 6px;
  margin: 0 0 18px;
  overflow-x: auto;
}

.merchant-detail-tab {
  background: #fbf8f1;
  border: 1px solid var(--portal-border);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  color: var(--portal-ink);
  flex: 0 0 auto;
  font-weight: 700;
  padding: 10px 14px;
  text-decoration: none;
}

.merchant-detail-tab:hover,
.merchant-detail-tab-active {
  background: var(--portal-panel);
  color: var(--portal-accent-strong);
}

.merchant-detail-tab-panel {
  margin-top: 0;
}

.operator-help {
  color: var(--portal-muted);
  line-height: 1.5;
  margin: 0 0 14px;
}

.empty-state,
.warning-panel,
.status-explanation {
  background: #fff7e6;
  border: 1px solid #ead7aa;
  border-radius: 6px;
  color: #4f3d1f;
  line-height: 1.5;
  margin: 12px 0;
  padding: 12px;
}

.empty-state {
  background: #fbf8f1;
}

.technical-details {
  background: #fbf8f1;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  color: var(--portal-muted);
  margin-top: 14px;
  padding: 10px 12px;
}

.technical-details summary {
  color: var(--portal-ink);
  cursor: pointer;
  font-weight: 700;
}

.technical-details .portal-detail-grid,
.technical-details .portal-table-wrap {
  margin-top: 10px;
}

.landing-page-assignment-fieldset {
  margin-bottom: 14px;
}

.landing-page-assignment-table th:first-child,
.landing-page-assignment-table td:first-child {
  text-align: center;
  width: 64px;
}

.landing-page-assignment-table .portal-control {
  margin-top: 4px;
  min-width: 220px;
}

.landing-page-change-panel {
  margin-top: 16px;
}

.landing-page-secondary-section {
  background: #fbf8f1;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  margin-top: 16px;
  padding: 10px 12px;
}

.landing-page-secondary-section summary {
  cursor: pointer;
  font-weight: 700;
}

.landing-page-secondary-section[open] > :not(summary) {
  margin-top: 10px;
}

.portal-hub-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-hub-card {
  background: #fffaf0;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.portal-hub-card h3 {
  font-size: 1rem;
  margin: 0;
}

.portal-hub-card p {
  color: var(--portal-muted);
  margin: 0;
}

.portal-card-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

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

.portal-card-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-pattern-card {
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.portal-pattern-card h3 {
  font-size: 1rem;
  margin: 0;
}

.portal-pattern-card p {
  line-height: 1.45;
  margin: 0;
}

.portal-pattern-card-light,
.portal-pattern-card-form {
  background: var(--portal-panel);
  color: var(--portal-ink);
}

.portal-pattern-card-dark {
  background: linear-gradient(180deg, var(--portal-dark-surface-2), var(--portal-dark-surface));
  border-color: rgba(197, 154, 54, .52);
  box-shadow: 0 16px 36px rgba(13, 13, 13, .18);
  color: #f8fafc;
}

.portal-pattern-card-status,
.portal-pattern-card-action {
  align-content: start;
}

.portal-pattern-card-technical {
  background: #fbf8f1;
  color: var(--portal-muted);
}

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

.portal-stat {
  background: #fffaf0;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  display: grid;
  gap: 4px;
  padding: 10px;
}

.portal-stat-label {
  color: var(--portal-muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.portal-stat-value {
  color: var(--portal-ink);
  font-weight: 700;
  line-height: 1.35;
}

.portal-pattern-card-dark h3,
.portal-pattern-card-dark .portal-stat-value {
  color: #ffffff;
}

.portal-pattern-card-dark p,
.portal-pattern-card-dark .portal-stat-label {
  color: var(--portal-dark-surface-muted);
}

.portal-pattern-card-dark .portal-stat {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .14);
}

.portal-state-badge {
  border: 1px solid var(--portal-border);
  border-radius: 999px;
  display: inline-flex;
  font-size: .82rem;
  font-weight: 700;
  padding: 4px 9px;
  white-space: nowrap;
}

.portal-state-badge-ready {
  background: #dcfce7;
  border-color: #86efac;
  color: var(--portal-success);
}

.portal-state-badge-attention {
  background: #fff7e6;
  border-color: #fde68a;
  color: var(--portal-warning);
}

.portal-state-badge-blocked {
  background: #fee2e2;
  border-color: #fecaca;
  color: var(--portal-danger);
}

.portal-state-badge-neutral {
  background: #f8fafc;
  border-color: #d8dee9;
  color: #475569;
}

.portal-pattern-card-dark .portal-state-badge-neutral {
  background: rgba(197, 154, 54, .2);
  border-color: rgba(197, 154, 54, .52);
  color: #f8e5b1;
}

.portal-pattern-card-dark .portal-btn {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .2);
  color: #ffffff;
}

.portal-pattern-card-dark .portal-btn-primary {
  background: var(--portal-accent);
  border-color: var(--portal-accent);
  color: #17130d;
}

.portal-pattern-card-dark .technical-details {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .16);
  color: var(--portal-dark-surface-muted);
}

.portal-pattern-card-dark .technical-details summary {
  color: #f8fafc;
}

.merchant-status-card-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.merchant-status-card {
  background: #ffffff;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  display: grid;
  gap: 12px;
  grid-template-rows: auto 1fr auto;
  padding: 14px;
}

.merchant-status-card-primary {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.merchant-status-card-state-ready {
  background: #ecfdf5;
  border-color: #86efac;
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .18);
}

.merchant-status-card-state-attention {
  background: #fffbeb;
  border-color: #fcd34d;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .16);
}

.merchant-status-card-state-blocked {
  background: #fff1f2;
  border-color: #fda4af;
  box-shadow: inset 0 0 0 1px rgba(225, 29, 72, .14);
}

.merchant-status-card-state-neutral {
  background: #f8fafc;
  border-color: #cbd5e1;
}

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

.merchant-status-card-heading h3 {
  font-size: 1rem;
  margin: 0;
}

.merchant-status-card-badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: .74rem;
  font-weight: 800;
  line-height: 1;
  padding: 6px 9px;
  white-space: nowrap;
}

.merchant-status-card-state-ready .merchant-status-card-badge {
  background: #14532d;
  color: #ffffff;
}

.merchant-status-card-state-attention .merchant-status-card-badge {
  background: #92400e;
  color: #ffffff;
}

.merchant-status-card-state-blocked .merchant-status-card-badge {
  background: #9f1239;
  color: #ffffff;
}

.merchant-status-card-state-neutral .merchant-status-card-badge {
  background: #475569;
  color: #ffffff;
}

.merchant-status-card-body {
  display: grid;
  gap: 8px;
}

.merchant-status-card-body p {
  display: grid;
  gap: 2px;
  margin: 0;
}

.merchant-status-card-body span {
  color: var(--portal-muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.merchant-status-card-body strong {
  color: var(--portal-ink);
  line-height: 1.35;
}

.merchant-status-card-link {
  align-items: center;
  color: var(--portal-accent-strong);
  display: inline-flex;
  font-weight: 700;
  justify-self: start;
  text-decoration: none;
}

.merchant-status-card-link::after {
  content: ">";
  font-size: .82rem;
  margin-left: 6px;
}

.merchant-status-card-link:hover {
  text-decoration: underline;
}

.merchant-delivery-overview-consolidated {
  display: grid;
  gap: 16px;
  grid-template-columns: 260px minmax(0, 1fr);
}

.merchant-delivery-overview-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.merchant-status-rail {
  background: #ffffff;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  padding: 12px;
}

.merchant-status-rail-header {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.merchant-status-rail-header strong {
  color: var(--portal-ink);
}

.merchant-status-rail ol {
  display: grid;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.merchant-status-rail-item {
  display: grid;
  gap: 10px;
  grid-template-columns: 14px minmax(0, 1fr);
  padding: 0 0 14px;
  position: relative;
}

.merchant-status-rail-item:not(:last-child)::after {
  background: var(--portal-border);
  bottom: 0;
  content: "";
  left: 6px;
  position: absolute;
  top: 14px;
  width: 2px;
}

.merchant-status-rail-dot {
  align-self: start;
  border: 2px solid #d1d5db;
  border-radius: 999px;
  height: 14px;
  margin-top: 3px;
  width: 14px;
  z-index: 1;
}

.merchant-status-rail-dot.status-active,
.merchant-status-rail-dot.status-ready {
  background: #10b981;
  border-color: #10b981;
  color: transparent;
  display: block;
  font-size: 0;
  padding: 0;
}

.merchant-status-rail-dot.status-needs-attention,
.merchant-status-rail-dot.status-needs-setup,
.merchant-status-rail-dot.portal-badge {
  background: #f59e0b;
  border-color: #f59e0b;
  color: transparent;
  display: block;
  font-size: 0;
  padding: 0;
}

.merchant-status-rail-dot.status-inactive,
.merchant-status-rail-dot.status-blocked {
  background: #ef4444;
  border-color: #ef4444;
  color: transparent;
  display: block;
  font-size: 0;
  padding: 0;
}

.merchant-status-rail-item span {
  color: var(--portal-muted);
  display: block;
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.merchant-status-rail-item strong {
  color: var(--portal-ink);
  display: block;
  font-size: .9rem;
  line-height: 1.3;
}

.merchant-status-rail-item small {
  color: var(--portal-muted);
  display: block;
  font-size: .78rem;
  line-height: 1.35;
  margin-top: 3px;
}

.status-overview-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.status-overview-card {
  background: #fffaf0;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.status-overview-card span {
  color: var(--portal-muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-overview-card strong {
  font-size: 1.15rem;
}

.status-overview-card p {
  color: var(--portal-muted);
  line-height: 1.45;
  margin: 0;
}

.product-area-card {
  background: linear-gradient(180deg, var(--portal-dark-surface-2), var(--portal-dark-surface));
  border-color: rgba(197, 154, 54, .52);
  box-shadow: 0 16px 36px rgba(13, 13, 13, .18);
  color: #f8fafc;
  display: grid;
  gap: 0.9rem;
  align-content: start;
}

.product-area-card h3,
.landing-page-overview-card h3 {
  color: #f8fafc;
}

.product-area-card p,
.landing-page-overview-card p {
  color: var(--portal-dark-surface-muted);
}

.product-area-card .portal-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-area-card .portal-detail-grid div,
.landing-page-overview-card .portal-detail-grid div {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .14);
}

.product-area-card .portal-detail-grid span,
.landing-page-overview-card .portal-detail-grid span {
  color: var(--portal-dark-surface-muted);
}

.product-area-card .portal-detail-grid strong,
.landing-page-overview-card .portal-detail-grid strong {
  color: #ffffff;
}

.product-area-card .portal-badge,
.landing-page-overview-card .portal-badge {
  background: rgba(197, 154, 54, .2);
  border-color: rgba(197, 154, 54, .52);
  color: #f8e5b1;
}

.product-area-card .portal-btn,
.landing-page-overview-card .portal-btn {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .2);
  color: #ffffff;
}

.product-area-card .portal-btn-primary,
.landing-page-overview-card .portal-btn-primary {
  background: var(--portal-accent);
  border-color: var(--portal-accent);
  color: #17130d;
}

.product-area-card .technical-details,
.landing-page-overview-card .technical-details {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .16);
  color: var(--portal-dark-surface-muted);
}

.product-area-card .technical-details summary,
.landing-page-overview-card .technical-details summary {
  color: #f8fafc;
}

.landing-page-card-grid,
.merchant-card-grid {
  margin-top: 14px;
}

.landing-page-overview-card,
.merchant-overview-card {
  background: #ffffff;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
  color: var(--portal-text);
  display: grid;
  gap: 0.9rem;
  padding: 14px;
}

.landing-page-overview-card {
  background: linear-gradient(180deg, var(--portal-dark-surface-2), var(--portal-dark-surface));
  border: 1px solid rgba(197, 154, 54, .52);
  box-shadow: 0 16px 36px rgba(13, 13, 13, .18);
  color: #f8fafc;
}

.merchant-overview-card h3 {
  color: var(--portal-text);
  margin: 0;
}

.merchant-overview-card-main {
  align-items: start;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.merchant-overview-identity {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 4px;
  /* Reuse part of the card gap while keeping space between the badge and actions. */
  margin-bottom: -8px;
}

.merchant-status.merchant-production-status {
  font-size: 0.65rem;
  gap: 0.25rem;
  line-height: 1.25;
  padding: 2px 4px;
}

.merchant-status {
  align-items: center;
  border: 1px solid var(--portal-border);
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 700;
  gap: 0.4rem;
  padding: 0.25rem 0.55rem;
  white-space: nowrap;
}

.merchant-status span {
  border-radius: 999px;
  display: inline-block;
  height: 0.62rem;
  width: 0.62rem;
}

.merchant-status.status-active {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.merchant-status.status-active span {
  background: #10b981;
}

.merchant-status.status-inactive {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.merchant-status.status-inactive span {
  background: #ef4444;
}

.merchant-status.status-needs-attention {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.merchant-status.status-needs-attention span {
  background: #f59e0b;
}

.portal-filter-bar {
  align-items: end;
  background: #fbf8f1;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  margin: 14px 0;
  padding: 12px;
}

.portal-filter-bar label {
  color: var(--portal-ink);
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.portal-filter-bar input,
.portal-filter-bar select {
  background: #fffdfa;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  box-sizing: border-box;
  color: var(--portal-ink);
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

.portal-filter-bar select:disabled {
  background: #eee8dc;
  color: var(--portal-muted);
}

.portal-filter-actions {
  display: flex;
  gap: 8px;
}

.merchant-filter-toolbar {
  align-items: start;
  gap: 10px;
  grid-template-columns: minmax(220px, 1.4fr) minmax(180px, .9fr) auto;
  padding: 10px 12px;
}

.portal-filter-field {
  display: grid;
  gap: 6px;
}

.portal-filter-field-muted {
  max-width: 280px;
}

.portal-filter-help {
  color: var(--portal-muted);
  display: block;
  font-size: .78rem;
  line-height: 1.35;
}

.merchant-filter-toolbar .portal-filter-actions {
  align-self: end;
  flex-wrap: nowrap;
}

.operator-stepper {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 14px 0;
}

.operator-stepper-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.operator-step {
  background: #fffaf0;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.operator-step-number {
  align-items: center;
  background: var(--portal-accent);
  border-radius: 999px;
  color: #17130d;
  display: inline-flex;
  font-weight: 700;
  height: 28px;
  justify-content: center;
  width: 28px;
}

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

.workspace-summary-item {
  background: #fffaf0;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.workspace-summary-item span {
  color: var(--portal-muted);
  font-size: .82rem;
  text-transform: uppercase;
}

/* PHASE 47A.1 Merchant Delivery Methods compact selector UI marker. */
.delivery-method-choice {
  margin-top: 18px;
}

.delivery-method-action-compact,
.delivery-method-retained-summary {
  background: #ffffff;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  margin-top: 12px;
  padding: 12px;
}

.delivery-method-current-card {
  background: #ffffff;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px rgba(34, 197, 94, .14);
  margin-top: 14px;
  padding: 14px;
}

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

.delivery-method-card {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #273449;
  display: grid;
  gap: 9px;
  padding: 14px;
  text-decoration: none;
}

.delivery-method-retained-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.delivery-method-retained-summary span {
  color: var(--portal-muted);
  display: block;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.delivery-method-retained-summary strong {
  color: var(--portal-ink);
}

.delivery-method-card:hover {
  border-color: var(--portal-accent);
  box-shadow: 0 10px 24px rgba(23, 19, 13, .08);
}

.delivery-method-card-selected {
  border-color: #14532d;
  box-shadow: inset 0 0 0 2px rgba(20, 83, 45, .42);
}

.delivery-method-card-primary {
  background: #14532d;
  border-color: #166534;
  box-shadow: 0 12px 26px rgba(20, 83, 45, .2);
  color: #ffffff;
}

.delivery-method-card-secondary {
  color: #334155;
}

.delivery-method-card-current {
  background: #14532d;
  border-color: #166534;
  color: #ffffff;
}

.delivery-method-card-retained {
  background: #fff7ed;
  border-color: #fed7aa;
}

.delivery-method-card-planned,
.delivery-method-card-deferred {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.delivery-method-card-current .portal-badge,
.delivery-method-card-current .status-ready,
.delivery-method-card-current .status-not-ready,
.delivery-method-card-current .status-needs-setup,
.delivery-method-card-current .status-blocked,
.delivery-method-card-current .status-not-available {
  background: rgba(255, 255, 255, .18);
  border-color: rgba(255, 255, 255, .34);
  color: #ffffff;
}

.delivery-method-card h3 {
  margin: 0;
}

.delivery-method-card p {
  color: #475569;
  line-height: 1.45;
  margin: 0;
}

.delivery-method-card strong {
  color: #633c0c;
}

.delivery-method-card-current p,
.delivery-method-card-current strong,
.delivery-method-card-current h3 {
  color: #ffffff;
}

.delivery-method-panel {
  background: #fbf8f1;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  margin-top: 16px;
  padding: 16px;
}

.delivery-method-panel-selected {
  border-color: var(--portal-accent);
}

.delivery-method-panel-secondary {
  background: #f8fafc;
  color: var(--portal-muted);
}

.delivery-method-panel-heading {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.delivery-method-panel-heading h2 {
  margin: 8px 0 0;
}

.delivery-planned-fields {
  margin: 12px 0;
}

.delivery-planned-fields .portal-control:disabled {
  background: #eee8dc;
  color: var(--portal-muted);
}

.delivery-review-row {
  align-items: center;
  background: #fffdfa;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  padding: 12px;
}

.delivery-review-row span {
  color: var(--portal-muted);
  font-size: .85rem;
}

.delivery-method-next-action {
  background: #fffdfa;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  color: var(--portal-muted);
  display: inline-flex;
  font-weight: 700;
  margin-top: 4px;
  padding: 9px 12px;
}

.status-ready,
.status-not-ready,
.status-needs-setup,
.status-blocked,
.status-not-available {
  border-radius: 999px;
  display: inline-flex;
  font-size: .82rem;
  font-weight: 700;
  padding: 4px 9px;
}

.status-ready {
  background: #dcfce7;
  color: var(--portal-success);
}

.status-not-ready,
.status-needs-setup,
.status-not-available {
  background: #fff7e6;
  color: var(--portal-warning);
}

.status-blocked {
  background: #fee2e2;
  color: var(--portal-danger);
}

.disabled-filter {
  opacity: .72;
}

.portal-card-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.portal-table-wrap {
  overflow-x: auto;
}

.portal-table {
  border-collapse: collapse;
  width: 100%;
}

.portal-table th,
.portal-table td {
  border-bottom: 1px solid var(--portal-border);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.portal-table th {
  color: var(--portal-muted);
  font-size: .78rem;
  text-transform: uppercase;
}

.delivery-log-advanced-details {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  max-width: 100%;
  padding: 10px 12px 12px;
}

.delivery-log-advanced-details summary {
  cursor: pointer;
  font-weight: 700;
}

.delivery-log-advanced-shell {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.delivery-log-advanced-intro {
  align-items: center;
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-radius: 6px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px;
}

.delivery-log-advanced-intro p {
  color: var(--portal-muted);
  margin: 0;
}

.delivery-log-advanced-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  text-align: left;
}

.delivery-log-advanced-row td {
  background: #fffdf8;
  padding: 0 8px 14px;
}

.delivery-log-advanced-row-hint {
  color: var(--portal-muted);
  font-size: .82rem;
}

.delivery-log-advanced-section {
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-radius: 6px;
  padding: 12px;
}

.delivery-log-advanced-section-source {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.delivery-log-advanced-section h4 {
  color: var(--portal-ink);
  font-size: .82rem;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.delivery-log-advanced-section dl {
  display: grid;
  gap: 6px 10px;
  grid-template-columns: minmax(120px, .7fr) minmax(0, 1fr);
  margin: 0;
}

.delivery-log-advanced-section dt {
  color: var(--portal-muted);
  font-size: .78rem;
}

.delivery-log-advanced-section dd {
  margin: 0;
  overflow-wrap: anywhere;
}

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

.portal-form-wide,
.portal-form-actions {
  grid-column: 1 / -1;
}

.lead-allocation-priority-row {
  border-bottom: 1px solid var(--portal-border);
  margin-bottom: 16px;
  padding-bottom: 16px;
}

.lead-allocation-priority-row .portal-btn:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.portal-inline-form {
  align-items: end;
  display: flex;
  gap: 12px;
}

.portal-label {
  color: #334155;
  display: block;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.portal-control {
  border: 1px solid #b8c3d1;
  border-radius: 5px;
  box-sizing: border-box;
  min-height: 42px;
  padding: 9px 10px;
  width: 100%;
}

.portal-handoff-code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .85rem;
  line-height: 1.5;
  max-height: 36rem;
  min-height: 16rem;
  resize: vertical;
  tab-size: 4;
}

.portal-handoff-summary code {
  overflow-wrap: anywhere;
}

.portal-btn,
.portal-link-button {
  border: 1px solid var(--portal-border);
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  font-size: .92rem;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  text-decoration: none;
}

.portal-btn-primary {
  background: var(--portal-accent);
  border-color: var(--portal-accent);
  color: #17130d;
  font-weight: 700;
}

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

.portal-link-button {
  background: transparent;
  color: var(--portal-accent-strong);
}

.portal-actions {
  display: flex;
  gap: 8px;
}

.portal-alert {
  border-radius: 6px;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.portal-alert-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
}

.portal-alert-warning {
  background: var(--portal-accent-soft);
  border: 1px solid #e7cf8b;
  color: #5f400d;
}

.portal-alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #14532d;
}

.portal-alert code {
  background: #fff;
  border: 1px solid var(--portal-border);
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  padding: 10px;
}

.portal-badge {
  background: var(--portal-accent-soft);
  border-radius: 999px;
  color: #5f400d;
  display: inline-flex;
  font-size: .78rem;
  padding: 3px 9px;
}

.portal-badge-success {
  background: #dcfce7;
  color: var(--portal-success);
}

.portal-detail-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-detail-grid span {
  color: var(--portal-muted);
  display: block;
  font-size: .78rem;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.portal-detail-grid strong {
  overflow-wrap: anywhere;
}



.portal-field-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.portal-field-row {
  align-items: center;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  padding: 12px;
}

.portal-field-row span span {
  color: var(--portal-muted);
  display: block;
  font-size: .85rem;
}

.portal-field-row-locked {
  background: #f8fafc;
}

.portal-option-note {
  color: var(--portal-muted);
  font-size: .85rem;
  margin: -4px 0 4px 14px;
}

.portal-question-card {
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  padding: 14px;
}

.portal-question-included {
  border-color: #d4b45f;
  box-shadow: inset 3px 0 0 var(--portal-accent);
}

.portal-question-heading,
.portal-question-toggle,
.portal-answer-option {
  align-items: center;
  display: flex;
  gap: 12px;
}

.portal-question-heading {
  justify-content: space-between;
}

.portal-question-heading > span:first-child,
.portal-question-toggle span,
.portal-answer-option span {
  min-width: 0;
}

.portal-question-heading small,
.portal-question-toggle small,
.portal-answer-option small {
  color: var(--portal-muted);
  display: block;
  font-size: .8rem;
  overflow-wrap: anywhere;
}

.portal-question-toggle,
.portal-answer-option {
  cursor: pointer;
  flex: 1;
  min-height: 38px;
}

.portal-question-toggle input,
.portal-answer-option input {
  flex: 0 0 auto;
  height: 20px;
  width: 20px;
}

.portal-answer-group {
  border-left: 3px solid var(--portal-accent-soft);
  margin: 14px 0 0 9px;
  padding: 2px 0 2px 18px;
}

.portal-answer-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.portal-answer-summary span {
  color: var(--portal-muted);
  font-size: .85rem;
}

.portal-answer-options {
  display: grid;
  gap: 7px;
}

.portal-answer-option {
  border: 1px solid var(--portal-border);
  border-radius: 5px;
  padding: 9px 11px;
}

.portal-answer-option-stale,
.portal-option-stale {
  background: #fef2f2;
  border-color: #fecaca;
  color: #7f1d1d;
}

.portal-answer-option em {
  display: block;
  font-size: .8rem;
  margin-top: 2px;
}

.portal-question-warning {
  margin: 10px 0 0;
}

.portal-readonly-options {
  margin-bottom: 0;
}

.portal-validation {
  color: var(--portal-danger);
  display: block;
  font-size: .85rem;
  margin-top: 4px;
}

.portal-login-panel {
  background: var(--portal-panel);
  border: 1px solid var(--portal-border);
  border-top: 4px solid var(--portal-accent);
  border-radius: 6px;
  box-shadow: 0 14px 36px rgba(23, 19, 13, .08);
  margin: 24px auto;
  max-width: 520px;
  padding: 22px;
}

.portal-anonymous-shell {
  align-items: center;
  background: var(--portal-bg);
  display: flex;
  min-height: 100vh;
  padding: 24px;
}

.portal-login-heading {
  align-items: flex-start;
  margin-bottom: 20px;
}

.portal-login-form {
  display: grid;
  gap: 16px;
}

.portal-posture-strip,
.portal-posture-card {
  background: #17130d;
  border: 1px solid rgba(197, 154, 54, .45);
  border-radius: 6px;
  color: #f8eed2;
}

.portal-posture-strip {
  display: inline-flex;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 16px;
  padding: 6px 9px;
  text-transform: uppercase;
}

.portal-posture-card {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 12px 14px;
}

.portal-posture-card span {
  color: var(--portal-accent);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.portal-posture-card strong {
  font-size: .92rem;
  font-weight: 600;
}

.container,
.site-nav,
.footer {
  display: none;
}

@media (max-width: 860px) {
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    position: static;
  }

  .portal-content {
    padding: 18px;
  }

  .portal-page-heading,
  .portal-inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-form-grid,
  .portal-detail-grid,
  .merchant-delivery-overview-consolidated,
  .delivery-log-advanced-grid,
  .portal-hub-grid,
  .portal-card-grid,
  .portal-card-grid-two,
  .portal-card-grid-three,
  .portal-stat-grid,
  .merchant-status-card-grid,
  .delivery-method-retained-summary,
  .portal-filter-bar,
  .operator-stepper,
  .operator-stepper-four,
  .delivery-method-grid,
  .workspace-summary-grid {
    grid-template-columns: 1fr;
  }

  .delivery-log-advanced-section dl {
    grid-template-columns: 1fr;
  }

  .delivery-method-panel-heading,
  .delivery-review-row {
    align-items: stretch;
    flex-direction: column;
  }
}
.delivery-lab-payload-json {
  max-width: 100%;
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--portal-border, #dce2eb);
  border-radius: 0.5rem;
  background: #f5f7fa;
  color: #17283e;
  font-family: ui-monospace, "DejaVu Sans Mono", Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre;
  tab-size: 2;
}

[data-delivery-lab-payload] [data-frozen-payload-sha256] {
  overflow-wrap: anywhere;
}

.delivery-lab-payload-json code {
  font-family: inherit;
}
