:root {
  color-scheme: light;
  --ink: #1f2937;
  --muted: #64748b;
  --subtle: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --panel: #ffffff;
  --panel-raised: #f8fafc;
  --wash: #eef4f9;
  --canvas: #f1f5f9;
  --graphite: #080a0f;
  --graphite-2: #111827;
  --ember: #ff9500;
  --ember-soft: rgba(255, 149, 0, 0.12);
  --gold: #d68a10;
  --gold-soft: rgba(255, 149, 0, 0.16);
  --bitcoin: #ff9500;
  --fire: #dc2626;
  --danger: #b94444;
  --shadow: 0 20px 56px rgba(11, 17, 24, 0.13);
  --soft-shadow: 0 12px 30px rgba(11, 17, 24, 0.09);
  --radius: 8px;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f8fafc;
  --muted: #d7dee7;
  --subtle: #aeb8c4;
  --line: #29415a;
  --line-strong: #35536f;
  --panel: #0a1a2f;
  --panel-raised: #101824;
  --wash: #102b4a;
  --canvas: #03060a;
  --graphite: #f4f6f8;
  --graphite-2: #d7dde4;
  --ember: #ff9500;
  --ember-soft: rgba(255, 149, 0, 0.18);
  --gold: #ffb347;
  --gold-soft: rgba(255, 149, 0, 0.18);
  --bitcoin: #ff9500;
  --fire: #dc2626;
  --danger: #ff7777;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.34);
  --soft-shadow: 0 16px 44px rgba(0, 0, 0, 0.26);
}

body[data-theme="dark"] .topbar,
body[data-theme="dark"] .market-main,
body[data-theme="dark"] .quote-panel,
body[data-theme="dark"] .dashboard-sidebar,
body[data-theme="dark"] .wallet-entry {
  background:
    linear-gradient(135deg, rgba(5, 8, 13, 0.9), rgba(10, 26, 47, 0.84) 58%, rgba(16, 43, 74, 0.72)),
    var(--panel);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  margin: 0;
  height: 100%;
  min-width: 320px;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(rgba(17, 21, 26, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 21, 26, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 16% 0%, rgba(247, 147, 26, 0.13), transparent 28rem),
    radial-gradient(circle at 84% 14%, rgba(255, 149, 0, 0.09), transparent 24rem),
    var(--canvas);
  background-size: 28px 28px, 28px 28px, auto, auto, auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body[data-theme="dark"] {
  background:
    radial-gradient(circle at 82% 12%, rgba(255, 149, 0, 0.18), transparent 24rem),
    radial-gradient(circle at 18% 78%, rgba(31, 96, 151, 0.32), transparent 34rem),
    linear-gradient(rgba(215, 222, 231, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(215, 222, 231, 0.026) 1px, transparent 1px),
    linear-gradient(135deg, #03060a 0%, #05080d 34%, #0a1a2f 72%, #102b4a 100%),
    var(--canvas);
  background-size: auto, auto, 32px 32px, 32px 32px, auto, auto;
}

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

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.topbar {
  position: relative;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(250px, 0.8fr) minmax(300px, 1fr) minmax(430px, auto);
  align-items: center;
  gap: 18px;
  min-height: 76px;
  padding: 12px clamp(16px, 3vw, 38px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--panel) 94%, transparent), color-mix(in srgb, var(--panel-raised) 88%, transparent)),
    color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 24px rgba(17, 24, 32, 0.06);
}

body[data-theme="dark"] .topbar {
  border-color: rgba(41, 65, 90, 0.86);
  background:
    linear-gradient(90deg, rgba(3, 6, 10, 0.92), rgba(10, 26, 47, 0.84) 58%, rgba(16, 43, 74, 0.7)),
    rgba(5, 8, 13, 0.94);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.22);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand > img {
  width: 174px;
  max-width: min(174px, 43vw);
  height: 44px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.12));
}

.brand-seal {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--bitcoin) 42%, var(--line));
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(247, 147, 26, 0.3), rgba(255, 255, 255, 0.08)),
    var(--panel-raised);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 0 30px rgba(247, 147, 26, 0.18);
}

.brand-seal img {
  width: 23px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 4px 9px rgba(247, 147, 26, 0.34));
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand strong {
  max-width: 190px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-mark {
  display: none;
}

.nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.nav a,
.header-action,
.theme-toggle,
.surface-switcher a,
.status-pill,
.quote-head span,
.icon-button,
.card-top button,
.actions button,
.wallet-form button,
.supplier-upload button,
#refreshOpsEvents {
  border-radius: var(--radius);
}

.nav a,
.header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.header-action {
  min-width: 0;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel-raised);
}

.header-action span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--gold);
}

.header-action svg,
.dashboard-sidebar svg,
.trust-stack svg {
  display: block;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.header-action svg {
  width: 18px;
  height: 18px;
}

.header-action b {
  font: inherit;
}

.header-action.primary-action {
  color: #111827;
  border-color: color-mix(in srgb, var(--ember) 54%, var(--line));
  background: linear-gradient(135deg, #ffb347, var(--ember));
}

.header-action.primary-action span {
  color: #111827;
}

.nav a[aria-current="true"],
.surface-switcher a[aria-current="true"] {
  color: var(--ink);
  background: color-mix(in srgb, var(--gold) 14%, var(--wash));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 32%, transparent);
}

.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.select-shell {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  max-width: 230px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 8px;
  color: var(--muted);
  background: var(--panel-raised);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.select-shell select {
  min-height: 30px;
  min-width: 0;
  max-width: 132px;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.theme-toggle {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel-raised);
}

.theme-toggle {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 900;
}

.shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  width: min(1540px, 100%);
  min-height: 0;
  height: 100%;
  margin: 0 auto;
  padding: 12px clamp(14px, 2vw, 24px);
  overflow: hidden;
}

#app[data-active-surface="marketplace"] {
  grid-template-rows: minmax(0, 1fr);
}

#app[data-active-surface="marketplace"] > .surface-intro {
  display: none;
}

[data-surface],
#app [data-surface] {
  display: none;
}

#app[data-active-surface="supplier"] [data-surface~="supplier"],
#app[data-active-surface="marketplace"] [data-surface~="marketplace"],
#app[data-active-surface="sales"] [data-surface~="sales"] {
  display: grid;
}

.surface-intro,
.section-head {
  color: #fff;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 149, 0, 0.16), transparent 30%),
    linear-gradient(112deg, rgba(3, 6, 10, 0.98) 0%, rgba(10, 26, 47, 0.92) 52%, rgba(16, 43, 74, 0.78) 100%),
    url("assets/marketplace-concept.png") center / cover;
}

.surface-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: clamp(18px, 3vw, 32px);
  align-items: stretch;
  min-height: 174px;
  max-height: 230px;
  margin-bottom: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: clamp(16px, 2vw, 24px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.surface-intro h1 {
  max-width: 890px;
  margin: 0;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.03;
  letter-spacing: 0;
}

.surface-intro p:not(.kicker) {
  max-width: 740px;
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.55;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.wallet-entry {
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(10, 26, 47, 0.64);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.wallet-entry span,
.wallet-entry li,
.dashboard-command span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.surface-intro .wallet-entry span,
.surface-intro .wallet-entry li {
  color: rgba(255, 255, 255, 0.66);
}

.wallet-entry strong {
  color: #fff;
  font-size: 15px;
  line-height: 1.35;
}

.wallet-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.wallet-actions button {
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.wallet-actions button:first-child {
  background: linear-gradient(135deg, rgba(247, 147, 26, 0.72), rgba(247, 147, 26, 0.32));
}

.wallet-entry ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

.surface-switcher {
  display: grid;
  gap: 10px;
}

.surface-switcher a {
  display: flex;
  align-items: center;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 12px 14px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.07);
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
}

.surface-switcher a[aria-current="true"] {
  color: #fff;
  background: linear-gradient(135deg, rgba(247, 147, 26, 0.38), rgba(255, 149, 0, 0.16));
}

.market-grid {
  grid-template-columns: 248px minmax(0, 1fr) minmax(340px, 390px);
  grid-template-areas: "sidebar main quote";
  gap: 14px;
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
}

.market-main,
.quote-panel,
.dashboard-sidebar,
.role-band,
.supplier-band,
.wallet-dashboard,
.ops-portal,
.bundle-panel,
.pipeline-panel,
.supplier-upload {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 96%, var(--gold) 4%), var(--panel) 28%),
    var(--panel);
  box-shadow: var(--shadow);
}

body[data-theme="dark"] .market-main,
body[data-theme="dark"] .quote-panel,
body[data-theme="dark"] .dashboard-sidebar,
body[data-theme="dark"] .role-band,
body[data-theme="dark"] .supplier-band,
body[data-theme="dark"] .wallet-dashboard,
body[data-theme="dark"] .ops-portal,
body[data-theme="dark"] .bundle-panel,
body[data-theme="dark"] .pipeline-panel,
body[data-theme="dark"] .supplier-upload {
  border-color: rgba(41, 65, 90, 0.92);
  background:
    radial-gradient(circle at 86% 10%, rgba(255, 149, 0, 0.09), transparent 19rem),
    linear-gradient(135deg, rgba(5, 8, 13, 0.92), rgba(10, 26, 47, 0.88) 62%, rgba(16, 43, 74, 0.76)),
    var(--panel);
}

.dashboard-sidebar {
  grid-area: sidebar;
  position: static;
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  padding: 12px;
  overflow: auto;
}

.dashboard-sidebar nav,
.trust-stack {
  display: grid;
  gap: 7px;
}

.dashboard-sidebar a,
.dashboard-sidebar button,
.trust-stack article {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 36px;
  border-radius: var(--radius);
  padding: 6px;
  color: var(--muted);
  border: 0;
  text-decoration: none;
  font-size: 13px;
  font-weight: 850;
  background: transparent;
  text-align: left;
}

.dashboard-sidebar a[aria-current="page"],
.dashboard-sidebar a:hover,
.dashboard-sidebar button:hover {
  color: var(--ink);
  background: var(--wash);
}

body[data-theme="dark"] .dashboard-sidebar a[aria-current="page"],
body[data-theme="dark"] .dashboard-sidebar a:hover,
body[data-theme="dark"] .dashboard-sidebar button:hover {
  background: rgba(255, 149, 0, 0.12);
  box-shadow: inset 3px 0 0 var(--ember);
}

.dashboard-sidebar a span,
.dashboard-sidebar button span,
.trust-stack article span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--gold);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--gold) 9%, transparent), transparent),
    var(--panel-raised);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 14%, transparent);
}

.dashboard-sidebar a svg,
.dashboard-sidebar button svg,
.trust-stack article svg {
  width: 16px;
  height: 16px;
}

.dashboard-sidebar a[aria-current="page"] span,
.dashboard-sidebar a:hover span,
.dashboard-sidebar button:hover span {
  border-color: color-mix(in srgb, var(--gold) 48%, var(--line));
  color: var(--bitcoin);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 16%, transparent),
    0 0 0 3px color-mix(in srgb, var(--gold) 10%, transparent);
}

.trust-stack {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.trust-stack article {
  grid-template-columns: 32px minmax(0, 1fr);
  min-height: 56px;
  align-items: start;
}

.trust-stack strong,
.trust-stack small {
  display: block;
}

.trust-stack article span {
  grid-row: 1 / span 2;
}

.trust-stack strong,
.trust-stack small {
  grid-column: 2;
}

.trust-stack strong {
  align-self: end;
}

.trust-stack small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.market-main {
  grid-area: main;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  padding: 14px clamp(14px, 2vw, 20px);
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 18%, transparent);
}

.section-head h1 {
  max-width: 790px;
  margin: 0;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.08;
  letter-spacing: 0;
}

.kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  min-width: 170px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 7px 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill:first-child {
  border-color: rgba(255, 178, 56, 0.5);
  background: rgba(255, 149, 0, 0.18);
}

.status-pill.muted {
  color: rgba(255, 255, 255, 0.78);
}

.toolbar {
  display: flex;
  gap: 12px;
  padding: 10px clamp(14px, 2vw, 20px);
  border-bottom: 1px solid var(--line);
  background: var(--panel-raised);
}

body[data-theme="dark"] .toolbar,
body[data-theme="dark"] .dashboard-command,
body[data-theme="dark"] .market-stats {
  border-color: rgba(41, 65, 90, 0.86);
  background:
    linear-gradient(90deg, rgba(16, 24, 36, 0.92), rgba(10, 26, 47, 0.78)),
    var(--panel-raised);
}

.dashboard-command {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 210px) minmax(170px, 230px);
  gap: 10px;
  padding: 10px clamp(14px, 2vw, 20px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--panel) 92%, var(--gold) 8%), var(--panel));
}

.dashboard-command label,
.dashboard-command div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.dashboard-command input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--ink);
  background: var(--panel-raised);
  outline: 0;
}

.dashboard-command div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--panel-raised) 94%, var(--ember) 6%), var(--panel-raised));
}

.dashboard-command strong {
  font-size: 13px;
}

.toolbar label,
.quote-panel label,
.wallet-form label,
.supplier-upload label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.toolbar label {
  flex: 1 1 0;
}

.toolbar select,
.quote-panel input,
.quote-panel select,
.quote-panel textarea,
.wallet-form input,
.wallet-mini-form input,
.wallet-mini-form textarea,
.supplier-upload input,
.supplier-upload textarea,
.role-grid select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 11px;
  color: var(--ink);
  background: var(--panel);
  text-transform: none;
  outline: 0;
}

.toolbar select:focus,
.quote-panel input:focus,
.quote-panel select:focus,
.quote-panel textarea:focus,
.wallet-form input:focus,
.wallet-mini-form input:focus,
.wallet-mini-form textarea:focus,
.supplier-upload input:focus,
.supplier-upload textarea:focus,
.role-grid select:focus {
  border-color: color-mix(in srgb, var(--gold) 70%, var(--line));
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.market-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  padding: 10px clamp(14px, 2vw, 20px);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.brand-ribbon {
  display: grid;
  grid-template-columns: auto repeat(5, minmax(42px, auto));
  gap: 8px;
  align-items: center;
  padding: 10px clamp(14px, 2vw, 20px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--panel) 92%, var(--ember) 8%), var(--panel));
}

body[data-theme="dark"] .brand-ribbon {
  border-color: rgba(41, 65, 90, 0.86);
  background:
    linear-gradient(90deg, rgba(255, 149, 0, 0.08), rgba(10, 26, 47, 0.72)),
    rgba(5, 8, 13, 0.72);
}

.brand-ribbon span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.brand-ribbon img {
  display: block;
  width: auto;
  height: 32px;
  max-width: 118px;
  border-radius: 8px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.14));
}

.market-stats div,
.product-card dl div,
.spec-grid div,
.quote-summary div,
.role-grid label,
.role-grid div,
.ops-board article,
.pipeline-flow span,
.upload-state,
.empty-state,
.compatibility-panel,
.bundle-card,
.ops-event,
.elita-panel,
.elita-output {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-raised);
}

body[data-theme="dark"] .market-stats div,
body[data-theme="dark"] .product-card dl div,
body[data-theme="dark"] .spec-grid div,
body[data-theme="dark"] .quote-summary div,
body[data-theme="dark"] .role-grid label,
body[data-theme="dark"] .role-grid div,
body[data-theme="dark"] .ops-board article,
body[data-theme="dark"] .pipeline-flow span,
body[data-theme="dark"] .upload-state,
body[data-theme="dark"] .empty-state,
body[data-theme="dark"] .compatibility-panel,
body[data-theme="dark"] .bundle-card,
body[data-theme="dark"] .ops-event,
body[data-theme="dark"] .elita-panel,
body[data-theme="dark"] .elita-output {
  border-color: rgba(41, 65, 90, 0.86);
  background: rgba(16, 24, 36, 0.86);
}

.market-stats div {
  padding: 12px;
}

.market-stats span,
.role-grid span,
.ops-board span,
dt,
.quote-summary span,
.ops-event span,
.ops-board small,
.elita-output span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.market-stats strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
}

.stat-brand-line {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.stat-brand-line > span:not(.rail-chip) {
  flex-basis: 100%;
  min-width: 0;
  color: inherit;
  font-size: 13px;
  font-weight: inherit;
  text-transform: none;
  white-space: normal;
}

.stat-brand-line > img {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: contain;
}

.rail-chip {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.rail-chip > img {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  object-fit: contain;
}

.rail-chip span {
  display: none;
}

.carousel-wrap {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  gap: 12px;
  align-items: center;
  padding: 12px clamp(12px, 2vw, 20px);
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel-raised);
  font-size: 24px;
  line-height: 1;
}

.product-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(224px, 254px);
  gap: 14px;
  overflow-x: auto;
  padding: 4px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.product-card {
  display: grid;
  grid-template-rows: auto auto 128px auto minmax(36px, auto) auto;
  gap: 9px;
  min-height: 328px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 46%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, var(--gold) 8%), var(--panel) 42%),
    var(--panel);
  box-shadow: var(--soft-shadow);
  scroll-snap-align: start;
}

body[data-theme="dark"] .product-card {
  border-color: rgba(41, 65, 90, 0.94);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 149, 0, 0.13), transparent 45%),
    linear-gradient(180deg, rgba(16, 43, 74, 0.72), rgba(10, 26, 47, 0.9) 46%, rgba(5, 8, 13, 0.92)),
    var(--panel);
}

.product-card.active {
  border-color: color-mix(in srgb, var(--ember) 70%, var(--line));
  box-shadow: 0 0 0 3px var(--ember-soft), 0 0 28px rgba(255, 178, 56, 0.18), var(--soft-shadow);
}

.product-card.stock-immediate {
  border-color: color-mix(in srgb, var(--ember) 76%, var(--line));
  box-shadow: 0 0 0 1px rgba(255, 178, 56, 0.25), 0 0 24px rgba(255, 178, 56, 0.18), var(--soft-shadow);
}

.product-card.stock-limited,
.product-card.stock-ready_route {
  border-color: color-mix(in srgb, var(--gold) 58%, var(--line));
  box-shadow: 0 0 0 1px rgba(247, 181, 56, 0.18), 0 0 20px rgba(247, 181, 56, 0.12), var(--soft-shadow);
}

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

.brand-chip {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  color: var(--ink);
}

.brand-chip > img,
.brand-logo {
  flex: 0 0 auto;
  width: 42px;
  height: 28px;
  border-radius: 7px;
  object-fit: contain;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.brand-chip b,
.brand-chip small {
  display: block;
  min-width: 0;
  overflow: hidden;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-chip b {
  font-size: 12px;
  font-weight: 950;
}

.brand-chip small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.product-brand-chip {
  flex: 1 1 auto;
}

.product-brand-chip > img {
  width: 58px;
  height: 30px;
}

.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ember);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.stock-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.stock-limited .stock-badge,
.stock-ready_route .stock-badge {
  color: var(--gold);
}

.stock-quote_lane .stock-badge {
  color: color-mix(in srgb, var(--ember) 78%, var(--muted));
}

.stock-quote_lane .stock-badge::before {
  opacity: 0.45;
  box-shadow: none;
}

.card-top button,
.actions button,
.wallet-form button,
.supplier-upload button,
#refreshOpsEvents {
  min-height: 38px;
  border: 0;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 900;
}

.card-top button,
.secondary,
#refreshOpsEvents {
  color: var(--ink);
  background: var(--wash);
}

.miner-visual,
.product-media {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  min-height: 128px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 72%, rgba(0, 0, 0, 0.12), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.42), transparent),
    color-mix(in srgb, var(--wash) 86%, var(--gold) 14%);
  overflow: hidden;
}

.product-media {
  margin: 0;
  padding: 10px;
}

.product-media img {
  display: block;
  width: 100%;
  height: 108px;
  object-fit: contain;
  filter: drop-shadow(0 18px 20px rgba(17, 20, 24, 0.22));
}

.spec-brand-chip {
  max-width: 100%;
}

.spec-brand-chip > img {
  width: 66px;
  height: 30px;
}

body[data-theme="dark"] .miner-visual {
  background:
    radial-gradient(circle at 50% 72%, rgba(0, 0, 0, 0.26), transparent 30%),
    linear-gradient(135deg, rgba(215, 222, 231, 0.08), transparent),
    color-mix(in srgb, var(--wash) 82%, var(--gold) 18%);
}

.miner-visual::before {
  content: "";
  position: absolute;
  inset: auto 28px 16px;
  height: 18px;
  z-index: -1;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
  filter: blur(13px);
}

.miner-face {
  display: flex;
  gap: 10px;
  justify-content: center;
  width: 172px;
  height: 92px;
  padding-top: 17px;
  border: 1px solid #79828c;
  border-radius: 7px;
  background: linear-gradient(145deg, #e3e7eb, #f8fafc);
  box-shadow: 0 18px 28px rgba(17, 20, 24, 0.18);
}

body[data-theme="dark"] .miner-face {
  border-color: #4d5967;
  background: linear-gradient(145deg, #27313b, #636d78);
}

.miner-face span {
  width: 40px;
  height: 40px;
  border: 8px solid #2b333c;
  border-radius: 50%;
  background: radial-gradient(circle, #cbd3dc 0 22%, #7e8995 24% 100%);
}

.miner-body {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 190px;
  height: 34px;
  margin-top: -4px;
  padding: 7px;
  border-radius: 0 0 7px 7px;
  background: #2b333c;
}

.miner-body i {
  display: block;
  border-radius: 4px;
  background: #87919c;
}

.miner-visual b {
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: var(--bitcoin);
  font-size: 11px;
  font-weight: 900;
}

.product-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.16;
}

.product-card p,
.bundle-card span,
.compatibility-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.product-card dl,
.spec-grid {
  display: grid;
  gap: 8px;
  margin: 0;
}

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

.product-card dl div,
.spec-grid div,
.quote-summary div {
  padding: 10px;
}

.inventory-empty {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--muted);
  background: var(--panel-raised);
}

.inventory-empty strong {
  color: var(--ink);
  font-size: 16px;
}

.inventory-empty button {
  width: max-content;
  min-height: 36px;
  border: 0;
  border-radius: var(--radius);
  padding: 8px 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--ember), color-mix(in srgb, var(--fire) 42%, var(--ember)));
  font-size: 12px;
  font-weight: 900;
}

dd,
.quote-summary strong {
  display: block;
  margin: 4px 0 0;
  font-size: 14px;
}

.compare-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 14px;
  padding: 14px clamp(14px, 2vw, 20px);
  border-top: 1px solid var(--line);
}

.bundle-panel {
  display: grid;
  gap: 12px;
  padding: 14px clamp(14px, 2vw, 20px);
  border-top: 1px solid var(--line);
  box-shadow: none;
}

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

.bundle-card {
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 12px;
  color: var(--ink);
  text-align: left;
}

.bundle-card.active {
  border-color: color-mix(in srgb, var(--ember) 62%, var(--line));
  background: color-mix(in srgb, var(--ember) 12%, var(--panel));
}

.bundle-card.muted {
  color: var(--muted);
}

.bundle-card b {
  color: var(--ember);
}

.compatibility-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  color: var(--ink) !important;
  background: var(--panel-raised);
  text-transform: none !important;
}

.check-row input {
  width: auto;
  min-height: 0;
  accent-color: var(--ember);
}

.check-row span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  line-height: 1.35;
}

.cart-upsell {
  display: grid;
  gap: 8px;
}

.compare-copy h2,
.bundle-panel h2,
.role-band h2,
.wallet-dashboard h2,
.supplier-band h2,
.ops-copy h2,
.quote-head h2,
.pipeline-panel h2,
.supplier-upload h2 {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.1;
}

.compare-copy p:not(.kicker),
.bundle-panel p,
.role-band p,
.wallet-dashboard p,
.supplier-band p,
.ops-copy p,
.pipeline-panel p {
  max-width: 780px;
  color: var(--muted);
  line-height: 1.55;
}

.spec-grid {
  grid-template-columns: 1fr 1fr;
}

.quote-panel {
  grid-area: quote;
  position: static;
  min-height: 0;
  max-height: 100%;
  padding: 14px;
  overflow: auto;
  scrollbar-width: thin;
}

.order-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  padding: 0 clamp(14px, 2vw, 20px) 14px;
}

.order-strip article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--panel-raised);
}

.order-strip article[data-state="active"] {
  border-color: color-mix(in srgb, var(--ember) 58%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--panel-raised) 84%, var(--bitcoin) 16%), var(--panel-raised));
  box-shadow: inset 0 1px 0 rgba(255, 191, 91, 0.18);
}

.order-strip span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  background: var(--ember);
  font-size: 12px;
  font-weight: 900;
}

.order-strip small {
  color: var(--muted);
  line-height: 1.35;
}

.order-dashboard {
  display: grid;
  gap: 10px;
  margin: 0 clamp(14px, 2vw, 20px) 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background:
    radial-gradient(circle at top right, rgba(255, 149, 0, 0.12), transparent 34%),
    var(--panel);
}

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

.order-dashboard-head h2 {
  max-width: 760px;
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.order-dashboard-head > span {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--ember) 44%, var(--line));
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--bitcoin);
  background: color-mix(in srgb, var(--panel-raised) 86%, var(--bitcoin) 14%);
  font-size: 11px;
  font-weight: 900;
}

.order-dashboard-card {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(180px, 1.4fr) minmax(140px, 1fr) minmax(220px, 1.6fr);
  gap: 8px;
  width: 100%;
  border: 0;
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.order-dashboard-card > div {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--panel-raised);
}

.order-dashboard-card span,
.order-timeline span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.order-dashboard-card strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.3;
}

.order-dashboard-card[data-state="active"] > div:first-child {
  border-color: color-mix(in srgb, var(--ember) 62%, var(--line));
}

.order-dashboard-card:focus-visible > div {
  outline: 2px solid color-mix(in srgb, var(--bitcoin) 78%, transparent);
  outline-offset: 2px;
}

.order-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.order-timeline li {
  display: grid;
  gap: 4px;
  border-left: 3px solid color-mix(in srgb, var(--line) 76%, transparent);
  padding: 8px 10px;
  background: color-mix(in srgb, var(--panel-raised) 92%, transparent);
}

.order-timeline li[data-state="active"] {
  border-left-color: var(--ember);
}

.order-timeline b {
  font-size: 12px;
}

body.order-detail-open {
  overflow: hidden;
}

.order-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 28px);
}

.order-detail-modal[hidden] {
  display: none;
}

.order-detail-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(780px, 100%);
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
  border: 1px solid rgba(255, 149, 0, 0.28);
  border-radius: var(--radius);
  padding: clamp(16px, 3vw, 24px);
  background:
    radial-gradient(circle at top right, rgba(255, 149, 0, 0.14), transparent 34%),
    var(--panel);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
}

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

.order-detail-grid > div {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--panel-raised);
}

.order-detail-grid span,
.order-detail-timeline span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.order-detail-grid strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.3;
}

.order-detail-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.order-detail-timeline li {
  display: grid;
  gap: 5px;
  border-left: 3px solid color-mix(in srgb, var(--line) 76%, transparent);
  padding: 9px 10px;
  background: color-mix(in srgb, var(--panel-raised) 92%, transparent);
}

.order-detail-timeline li[data-state="active"] {
  border-left-color: var(--ember);
}

.order-detail-timeline b {
  font-size: 12px;
}

.quote-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.quote-head span {
  align-self: start;
  border: 1px solid var(--line);
  padding: 8px 10px;
  color: var(--muted);
  background: var(--panel-raised);
  font-size: 12px;
  font-weight: 900;
}

form {
  display: grid;
  gap: 10px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row.compact {
  grid-template-columns: 120px 1fr;
}

.quote-panel textarea,
.wallet-mini-form textarea,
.supplier-upload textarea {
  min-height: 72px;
  resize: vertical;
}

.quote-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.elita-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--panel-raised) 90%, var(--gold) 10%), var(--panel-raised));
}

.elita-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.elita-head strong,
.elita-output strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}

.elita-head span {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  border: 1px solid color-mix(in srgb, var(--gold) 52%, var(--line));
  border-radius: var(--radius);
  color: var(--bitcoin);
  background: var(--panel);
  font-size: 11px;
  font-weight: 950;
}

.elita-form {
  gap: 8px;
}

.elita-panel .form-row {
  gap: 8px;
}

.elita-panel button {
  min-height: 36px;
  border: 0;
  border-radius: var(--radius);
  padding: 8px 10px;
  color: #111827;
  background:
    linear-gradient(135deg, #ffbf5b, var(--bitcoin)),
    var(--bitcoin);
  font-size: 12px;
  font-weight: 900;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 10px 24px rgba(255, 149, 0, 0.16);
}

.elita-output {
  display: grid;
  gap: 6px;
  padding: 10px;
}

.elita-output p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.elita-output ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.elita-output[data-state="ready"] {
  border-color: color-mix(in srgb, var(--ember) 42%, var(--line));
}

.elita-output[data-state="error"] {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
  color: var(--danger);
}

.profile-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, var(--gold));
  border-radius: var(--radius);
  padding: 12px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--panel-raised) 92%, var(--bitcoin) 8%), var(--panel-raised));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.profile-summary strong,
.profile-summary small {
  display: block;
  min-width: 0;
}

.profile-summary strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
}

.profile-summary small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
}

.profile-summary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.profile-summary-actions button {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(255, 149, 0, 0.24);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 149, 0, 0.11), rgba(16, 24, 36, 0.82)),
    var(--panel-raised);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.profile-summary-actions button.secondary {
  color: #111827;
  border-color: transparent;
  background: linear-gradient(135deg, #ffbf5b, var(--bitcoin));
}

.profile-summary .upload-state {
  grid-column: 1 / -1;
  margin: -2px 0 0;
}

.profile-settings-panel[hidden] {
  display: none;
}

.wallet-mini-form {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.wallet-mini-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.wallet-mini-head strong {
  display: block;
  font-size: 16px;
  line-height: 1.2;
}

.wallet-mini-head > span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 8px;
  color: var(--muted);
  background: var(--panel-raised);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  white-space: nowrap;
}

.wallet-mini-head > span[data-state="ready"] {
  color: var(--ember);
  border-color: color-mix(in srgb, var(--ember) 48%, var(--line));
  background: color-mix(in srgb, var(--ember) 10%, var(--panel-raised));
}

.wallet-mini-head > span[data-state="error"] {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 48%, var(--line));
}

.wallet-connect-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.wallet-connect-grid button,
.wallet-methods button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--panel-raised) 92%, var(--gold) 8%), var(--panel-raised));
}

.wallet-connect-grid button {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 3px 8px;
  min-height: 70px;
  padding: 9px;
  text-align: left;
}

.wallet-connect-grid button span {
  display: grid;
  grid-row: 1 / span 2;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius);
  color: var(--bitcoin);
  background: color-mix(in srgb, var(--bitcoin) 13%, var(--panel));
}

.wallet-connect-grid svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-vector svg,
.brand-cluster svg,
.brand-vector img,
.brand-cluster img,
.wallet-methods button svg,
.wallet-methods button img,
.wallet-modal-actions button[data-wallet-provider] svg {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.brand-vector svg,
.brand-cluster svg,
.wallet-methods button svg,
.wallet-modal-actions button[data-wallet-provider] svg {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-vector img {
  width: 22px;
  height: 22px;
  border-radius: 7px;
}

.brand-vector.is-bitcoin {
  color: #ff9500;
}

.brand-vector.is-lightning {
  color: #ffb347;
}

.brand-vector.is-usdt {
  color: #d7dee7;
}

.brand-vector.is-swiss {
  color: #ffb347;
}

.wallet-connect-grid strong,
.wallet-connect-grid small {
  display: block;
  min-width: 0;
}

.wallet-connect-grid strong {
  font-size: 12px;
  font-weight: 950;
}

.wallet-connect-grid small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.wallet-connect-grid .brand-cluster,
.wallet-option-list .brand-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-self: start;
}

.brand-cluster i {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  border: 1px solid rgba(255, 149, 0, 0.15);
  border-radius: 999px;
  padding: 2px 5px;
  color: color-mix(in srgb, var(--muted) 86%, var(--gold));
  background: rgba(255, 149, 0, 0.07);
  font-style: normal;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.brand-cluster i svg {
  flex: 0 0 11px;
  width: 11px;
  height: 11px;
}

.brand-cluster i img {
  flex: 0 0 18px;
  width: 18px;
  height: 14px;
  border-radius: 4px;
  object-fit: contain;
}

.wallet-connect-grid button[data-available="true"] {
  border-color: color-mix(in srgb, var(--ember) 52%, var(--line));
  box-shadow: 0 0 0 2px var(--ember-soft);
}

.wallet-connect-grid button[data-available="false"] {
  opacity: 0.78;
}

.wallet-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.wallet-methods button {
  min-height: 34px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.wallet-methods button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.wallet-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.wallet-mini-form button {
  min-height: 36px;
  border: 0;
  border-radius: var(--radius);
  padding: 8px 10px;
  color: #111827;
  background: linear-gradient(135deg, #ffbf5b, var(--bitcoin));
  font-size: 12px;
  font-weight: 900;
}

.wallet-mini-form .wallet-connect-grid button,
.wallet-mini-form .wallet-methods button {
  border: 1px solid rgba(41, 65, 90, 0.92);
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(16, 43, 74, 0.36), rgba(16, 24, 36, 0.9)),
    var(--panel-raised);
  box-shadow: inset 0 1px 0 rgba(215, 222, 231, 0.06);
}

.wallet-mini-form .wallet-connect-grid button {
  min-height: 68px;
}

.wallet-mini-form .wallet-connect-grid button span {
  color: var(--bitcoin);
  background: rgba(255, 149, 0, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 149, 0, 0.16);
}

.wallet-mini-form .wallet-connect-grid button[data-available="true"] {
  border-color: rgba(255, 149, 0, 0.42);
  background:
    linear-gradient(145deg, rgba(255, 149, 0, 0.1), rgba(16, 43, 74, 0.28) 48%, rgba(16, 24, 36, 0.92)),
    var(--panel-raised);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(255, 149, 0, 0.08);
}

.wallet-mini-form .wallet-methods button {
  min-height: 36px;
  color: color-mix(in srgb, var(--ink) 88%, var(--gold));
  background:
    linear-gradient(145deg, rgba(5, 8, 13, 0.36), rgba(16, 43, 74, 0.24)),
    var(--panel-raised);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.wallet-mini-form .wallet-methods button svg {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  color: var(--bitcoin);
}

.wallet-mini-form .wallet-methods button img,
.wallet-modal-actions button[data-wallet-provider] img {
  flex: 0 0 24px;
  width: 24px;
  height: 18px;
  border-radius: 5px;
  object-fit: contain;
}

body.wallet-modal-open {
  overflow: hidden;
}

.wallet-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 0;
  background: #03060a;
}

.wallet-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 82% 12%, rgba(255, 149, 0, 0.16), transparent 25rem),
    radial-gradient(circle at 18% 78%, rgba(31, 96, 151, 0.34), transparent 34rem),
    linear-gradient(rgba(215, 222, 231, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(215, 222, 231, 0.026) 1px, transparent 1px),
    linear-gradient(135deg, #03060a 0%, #05080d 38%, #0a1a2f 72%, #102b4a 100%);
  background-size: auto, 32px 32px, 32px 32px, auto;
}

.wallet-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 28px;
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: auto;
  border: 0;
  border-radius: 0;
  padding: clamp(22px, 4vw, 48px);
  color: #f8fafc;
  background:
    radial-gradient(circle at 70% 20%, rgba(255, 149, 0, 0.14), transparent 24rem),
    linear-gradient(135deg, rgba(3, 6, 10, 0.82), rgba(10, 26, 47, 0.78) 58%, rgba(16, 43, 74, 0.62));
  box-shadow: none;
}

.wallet-modal-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: min(1080px, 100%);
  margin: 0 auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 18px;
}

.wallet-modal-head h2 {
  margin: 2px 0 0;
  max-width: 760px;
  font-size: clamp(34px, 5vw, 64px);
  letter-spacing: 0;
  line-height: 0.94;
}

.wallet-modal-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  color: #d7dee7;
  background: rgba(16, 24, 36, 0.86);
}

.wallet-modal-close svg,
.wallet-modal-actions svg,
.wallet-option-list svg,
.qr-orbit svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wallet-modal-body {
  display: grid;
  grid-template-columns: minmax(330px, 0.9fr) minmax(380px, 1.1fr);
  gap: 18px;
  width: min(1080px, 100%);
  margin: 0 auto;
  align-self: start;
}

.wallet-qr-card,
.wallet-modal-rail {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(16, 24, 36, 0.9), rgba(10, 26, 47, 0.78)),
    rgba(16, 24, 36, 0.72);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.22);
}

.wallet-qr-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: clamp(20px, 3vw, 28px);
  overflow: hidden;
}

.wallet-qr-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-left: 3px solid #ff9500;
  pointer-events: none;
}

.qr-orbit {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 149, 0, 0.42);
  border-radius: var(--radius);
  color: #ff9500;
  background: rgba(255, 149, 0, 0.1);
}

.wallet-connect-qr {
  position: relative;
  z-index: 1;
  width: min(320px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  border: 16px solid #fff;
  border-radius: var(--radius);
  background: #fff;
  image-rendering: pixelated;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

.wallet-qr-card strong,
.wallet-qr-card p,
.wallet-qr-card code {
  position: relative;
  z-index: 1;
}

.wallet-qr-card strong {
  max-width: 420px;
  color: #fff;
  font-size: 22px;
  line-height: 1.22;
}

.wallet-qr-card p,
.wallet-modal-rail p,
  .wallet-option-list small,
  .wallet-modal-state {
  color: #d7dee7;
  line-height: 1.4;
}

.wallet-qr-card code {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--radius);
  padding: 10px;
  color: #ffb238;
  background: rgba(3, 6, 10, 0.76);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-modal-rail {
  display: grid;
  gap: 16px;
  padding: clamp(20px, 3vw, 28px);
}

.wallet-modal-rail > p {
  margin: 0;
  font-weight: 700;
}

.wallet-access-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.wallet-access-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: #aeb8c4;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wallet-access-steps li:not(:last-child)::after {
  content: "";
  height: 2px;
  margin-right: 14px;
  background: rgba(255, 149, 0, 0.24);
}

.wallet-access-steps b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 149, 0, 0.36);
  border-radius: 999px;
  color: #ff9500;
  background: rgba(255, 149, 0, 0.1);
}

.wallet-access-steps [aria-current="step"] {
  color: #ff9500;
}

.wallet-access-steps [aria-current="step"] b {
  color: #111827;
  background: #ff9500;
}

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

.wallet-status-row span {
  display: grid;
  place-items: center;
  min-height: 34px;
  border: 1px solid rgba(255, 149, 0, 0.34);
  border-radius: var(--radius);
  color: #ffb238;
  background: rgba(255, 149, 0, 0.12);
  font-size: 11px;
  font-weight: 950;
  text-align: center;
}

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

.wallet-option-list button {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 4px 10px;
  min-height: 76px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius);
  padding: 12px;
  color: #f8fafc;
  text-align: left;
  background: rgba(5, 8, 13, 0.36);
}

.wallet-option-list button.featured {
  border-color: rgba(255, 149, 0, 0.58);
  background:
    linear-gradient(135deg, rgba(255, 149, 0, 0.14), rgba(220, 38, 38, 0.08)),
    rgba(5, 8, 13, 0.42);
  box-shadow: inset 3px 0 0 #ff9500;
}

.wallet-option-list button[data-settlement-provider] {
  border-style: dashed;
  background:
    linear-gradient(135deg, rgba(255, 179, 71, 0.1), rgba(16, 43, 74, 0.22)),
    rgba(5, 8, 13, 0.24);
}

.wallet-option-list button:hover,
.wallet-option-list button:focus-visible,
.wallet-modal-actions button:hover,
.wallet-modal-actions button:focus-visible,
.wallet-modal-close:hover,
.wallet-modal-close:focus-visible {
  border-color: rgba(255, 149, 0, 0.62);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 149, 0, 0.18);
}

.wallet-option-list button[data-available="true"] {
  border-color: rgba(255, 149, 0, 0.52);
}

.wallet-option-list button[data-available="false"] {
  opacity: 0.78;
}

.wallet-option-list span {
  display: grid;
  grid-row: 1 / span 2;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  color: #ff9500;
  background: rgba(255, 149, 0, 0.1);
}

.wallet-option-list strong,
.wallet-option-list small {
  min-width: 0;
}

.wallet-option-list strong {
  align-self: end;
  font-size: 13px;
  font-weight: 950;
}

.wallet-option-list small {
  align-self: start;
  font-size: 11px;
  font-weight: 760;
}

.wallet-option-list .brand-cluster {
  margin-top: 2px;
}

.wallet-option-list .brand-cluster i {
  font-size: 9px;
  padding: 3px 6px;
}

.wallet-modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.wallet-modal-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--radius);
  padding: 9px 10px;
  color: #f8fafc;
  background: rgba(16, 24, 36, 0.72);
  font-size: 12px;
  font-weight: 950;
}

.wallet-modal-actions .primary {
  grid-column: 1 / -1;
  border: 0;
  color: #111827;
  background: linear-gradient(135deg, #ffb347, var(--bitcoin));
}

.wallet-modal-state {
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius);
  padding: 10px;
  background: rgba(3, 6, 10, 0.72);
  font-size: 12px;
  font-weight: 760;
}

.wallet-modal-state[data-state="ready"] {
  color: var(--ember);
  border-color: rgba(255, 149, 0, 0.44);
}

.wallet-modal-state[data-state="error"] {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 44%, var(--line));
}

.actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
}

.primary {
  color: #111827;
  background:
    linear-gradient(135deg, #ffbf5b, var(--ember)),
    var(--ember);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 12px 28px rgba(255, 149, 0, 0.16);
}

.primary:hover,
.card-top button:hover,
.secondary:hover,
.header-action:hover,
#refreshOpsEvents:hover,
.theme-toggle:hover {
  transform: translateY(-1px);
}

.wallet-dashboard,
.role-band,
.supplier-band,
.ops-portal,
.pipeline-grid {
  margin-top: 22px;
}

.wallet-dashboard {
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  gap: 24px;
  padding: clamp(22px, 4vw, 34px);
}

.wallet-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.wallet-form button,
.wallet-form .upload-state {
  grid-column: 1 / -1;
}

.role-band,
.supplier-band {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 480px);
  gap: 24px;
  padding: clamp(22px, 4vw, 34px);
}

.role-grid,
.supplier-steps {
  display: grid;
  gap: 10px;
  align-content: center;
}

.role-grid label,
.role-grid div,
.supplier-steps span {
  padding: 14px;
}

.role-grid strong,
.ops-board strong {
  font-size: 15px;
  line-height: 1.35;
}

.ops-portal {
  grid-template-columns: minmax(0, 0.85fr) minmax(460px, 1.15fr);
  gap: 24px;
  padding: clamp(22px, 4vw, 34px);
}

.ops-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  align-content: center;
}

.ops-board article {
  display: grid;
  gap: 8px;
  min-height: 110px;
  padding: 14px;
}

.ops-board article:nth-child(2) {
  border-color: color-mix(in srgb, var(--gold) 46%, var(--line));
}

.ops-board article:nth-child(3) {
  border-color: color-mix(in srgb, var(--ember) 46%, var(--line));
}

.ops-board small,
.ops-event span {
  color: var(--ember);
}

.ops-events {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding: 18px 0 0;
}

.ops-events-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ops-events-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.ops-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
}

.ops-event strong {
  display: block;
  margin-top: 4px;
}

.ops-event time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.ops-event pre {
  grid-column: 1 / -1;
  max-height: 180px;
  overflow: auto;
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
  white-space: pre-wrap;
}

.ops-control-body {
  display: block;
  min-height: 100%;
  overflow: auto;
}

.ops-control-shell {
  display: grid;
  gap: 16px;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(14px, 2.5vw, 28px);
}

.ops-control-hero,
.ops-control-toolbar,
.ops-order-card {
  border: 1px solid rgba(255, 149, 0, 0.2);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(5, 8, 13, 0.92), rgba(10, 26, 47, 0.86)),
    var(--panel);
  box-shadow: var(--soft-shadow);
}

.ops-control-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(18px, 3vw, 30px);
}

.ops-control-hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(30px, 4vw, 58px);
  line-height: 0.98;
}

.ops-control-hero p:not(.kicker) {
  max-width: 720px;
  color: var(--muted);
}

.ops-control-hero img {
  width: clamp(72px, 10vw, 132px);
  aspect-ratio: 1;
  object-fit: contain;
}

.ops-control-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.ops-control-toolbar span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.ops-order-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.ops-order-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.ops-order-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.ops-order-card header span,
.ops-order-card dt,
.ops-order-card ol span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.ops-order-card h2 {
  margin: 3px 0 0;
  font-size: 18px;
  line-height: 1.2;
}

.ops-brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--ink);
}

.ops-brand-chip img {
  width: 76px;
  height: 30px;
  border-radius: 7px;
  object-fit: contain;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.ops-brand-chip b,
.ops-brand-chip small {
  display: block;
  line-height: 1.05;
}

.ops-brand-chip b {
  font-size: 12px;
  font-weight: 950;
}

.ops-brand-chip small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.ops-order-card header > strong {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 149, 0, 0.34);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--bitcoin);
  font-size: 11px;
  font-weight: 950;
}

.ops-order-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.ops-order-card dl > div {
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius);
  padding: 9px;
  background: rgba(3, 6, 10, 0.36);
}

.ops-order-card dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 900;
}

.ops-order-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

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

.ops-card-actions button {
  min-height: 38px;
  border: 1px solid rgba(255, 149, 0, 0.22);
  border-radius: var(--radius);
  padding: 8px;
  color: #f8fafc;
  background: rgba(16, 24, 36, 0.76);
  font-size: 12px;
  font-weight: 900;
}

.ops-card-actions button:hover {
  border-color: rgba(255, 149, 0, 0.54);
}

.ops-order-card ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ops-order-card ol li {
  border-left: 3px solid var(--ember);
  padding-left: 8px;
}

.ops-order-card ol b {
  display: block;
  font-size: 12px;
}

.pipeline-grid {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  gap: 24px;
}

.pipeline-panel,
.supplier-upload {
  padding: clamp(22px, 4vw, 34px);
}

.pipeline-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(92px, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.pipeline-flow span,
.supplier-steps span {
  font-weight: 900;
}

.supplier-steps {
  grid-template-columns: 1fr 1fr;
}

.supplier-upload {
  display: grid;
  gap: 14px;
}

.upload-state,
.empty-state {
  margin: 0;
  padding: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.upload-state[data-state="ready"] {
  color: var(--ember);
  border-color: color-mix(in srgb, var(--ember) 40%, var(--line));
}

.upload-state[data-state="error"] {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
}

@media (prefers-reduced-motion: no-preference) {
  .primary,
  .secondary,
  .card-top button,
  .header-action,
  .theme-toggle,
  .icon-button {
    transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
  }
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    gap: 8px;
    padding: 10px 16px;
  }

  .shell {
    height: 100%;
    grid-template-rows: minmax(0, 1fr);
    padding: 10px 16px;
  }

  .nav {
    display: none;
  }

  .header-tools {
    display: grid;
    grid-template-columns: minmax(180px, 1.2fr) repeat(4, minmax(104px, 1fr));
    gap: 8px;
    width: 100%;
  }

  .market-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 0.54fr) minmax(0, 0.46fr);
    grid-template-areas:
      "main"
      "quote";
    gap: 10px;
  }

  .wallet-dashboard,
  .role-band,
  .supplier-band,
  .ops-portal,
  .pipeline-grid {
    grid-template-columns: 1fr;
  }

  #app[data-active-surface="marketplace"] .market-grid > .dashboard-sidebar {
    display: none;
  }

  .dashboard-sidebar nav {
    grid-auto-flow: column;
    grid-auto-columns: minmax(136px, 1fr);
    grid-template-columns: none;
    overflow-x: auto;
  }

  .trust-stack {
    display: none;
  }

  .quote-panel {
    position: static;
    max-height: none;
  }

  .wallet-modal-body {
    grid-template-columns: 1fr;
  }

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

  .surface-intro {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    min-height: 130px;
    max-height: 150px;
  }

  .dashboard-command {
    grid-template-columns: minmax(280px, 1fr) minmax(180px, 0.55fr) minmax(200px, 0.65fr);
  }

  .toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-rail {
    grid-auto-columns: minmax(260px, 31vw);
  }

  .compare-panel {
    grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  }

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

  .market-main > .section-head {
    display: none;
  }

  .market-stats {
    display: none;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    min-height: 86px;
    padding: 10px 12px;
  }

  .nav {
    display: none;
  }

  .header-tools {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .shell {
    height: 100%;
    gap: 8px;
    padding: 10px;
  }

  .market-grid {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 0.38fr) minmax(0, 0.62fr);
    grid-template-areas:
      "main"
      "quote";
    gap: 10px;
  }

  .brand-seal {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .header-action,
  .theme-toggle {
    min-height: 38px;
    padding: 8px 7px;
    font-size: 11px;
  }

  .select-shell {
    grid-column: 1 / -1;
    flex: 1 1 190px;
    max-width: none;
    justify-content: space-between;
  }

  .header-action.primary-action {
    grid-column: span 2;
  }

  .header-action.primary-action b {
    max-width: none;
    white-space: normal;
    line-height: 1.05;
  }

  .surface-intro,
  .section-head,
  .dashboard-command,
  .compare-panel,
  .form-row,
  .form-row.compact,
  .actions,
  .order-strip,
  .order-dashboard-card,
  .order-timeline,
  .order-detail-grid,
  .order-detail-timeline {
    grid-template-columns: 1fr;
  }

  .order-dashboard {
    margin-inline: 10px;
    padding: 12px;
  }

  .order-dashboard-head {
    display: grid;
  }

  .order-dashboard-head h2 {
    font-size: 15px;
  }

  .order-detail-modal {
    padding: 10px;
  }

  .order-detail-panel {
    max-height: calc(100vh - 20px);
    padding: 14px;
  }

  .ops-control-hero,
  .ops-control-toolbar,
  .ops-order-card header {
    display: grid;
  }

  .ops-order-card dl,
  .ops-card-actions {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: grid;
  }

  .surface-intro {
    min-height: 84px;
    max-height: 108px;
    overflow: hidden;
    padding: 12px;
  }

  .surface-intro p:not(.kicker),
  .wallet-entry {
    display: none;
  }

  .surface-intro h1,
  .section-head h1 {
    font-size: clamp(24px, 8vw, 34px);
  }

  .status-stack {
    align-items: flex-start;
  }

  .toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .toolbar label {
    min-width: 0;
  }

  .toolbar label:last-child {
    grid-column: 1 / -1;
  }

  .dashboard-command div {
    display: none;
  }

  .elita-panel {
    gap: 7px;
    padding: 10px;
  }

  .elita-output {
    padding: 9px;
  }

  .elita-form {
    gap: 7px;
  }

  .elita-form .form-row,
  .elita-form .form-row.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .elita-form button {
    min-height: 36px;
  }

  .elita-head strong,
  .elita-output strong {
    font-size: 14px;
  }

  .quote-head {
    margin-bottom: 12px;
  }

  .quote-head h2 {
    font-size: 22px;
  }

  #app[data-active-surface="marketplace"] .market-grid > .dashboard-sidebar {
    display: none;
  }

  .dashboard-sidebar nav {
    display: flex;
    overflow-x: auto;
  }

  .dashboard-sidebar a {
    min-width: 128px;
  }

  .trust-stack,
  .wallet-actions {
    grid-template-columns: 1fr;
  }

  .carousel-wrap {
    grid-template-columns: 1fr;
  }

  .market-stats,
  .spec-grid,
  .bundle-grid,
  .wallet-connect-grid,
  .wallet-form,
  .supplier-steps,
  .product-card dl,
  .ops-board,
  .pipeline-flow {
    grid-template-columns: 1fr;
  }

  .icon-button {
    display: none;
  }

  .product-rail {
    grid-auto-columns: minmax(188px, calc(50vw - 24px));
    gap: 8px;
    padding: 2px;
  }

  .product-card {
    grid-template-rows: auto 76px auto minmax(30px, auto) auto;
    gap: 7px;
    min-height: 218px;
    padding: 10px;
  }

  .miner-visual,
  .product-media {
    min-height: 76px;
  }

  .wallet-mini-head,
  .profile-summary,
  .wallet-methods {
    grid-template-columns: 1fr;
    display: grid;
  }

  .profile-summary {
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
  }

  .profile-summary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .profile-summary-actions button {
    width: 100%;
    min-height: 36px;
  }

  .wallet-connect-grid button {
    min-height: 58px;
  }

  .product-media img {
    height: 64px;
  }

  .section-head,
  .dashboard-command,
  .toolbar,
  .carousel-wrap,
  .compare-panel,
  .bundle-panel {
    padding-inline: 10px;
  }

  .quote-summary {
    grid-template-columns: 1fr;
  }

  .wallet-modal {
    padding: 10px;
  }

  .wallet-modal-panel {
    max-height: calc(100vh - 20px);
    padding: 14px;
    gap: 12px;
    overflow: hidden;
  }

  .wallet-modal-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding-bottom: 10px;
  }

  .wallet-modal-head h2 {
    font-size: clamp(28px, 8vw, 34px);
    line-height: 0.96;
  }

  .wallet-access-steps {
    width: 100%;
  }

  .wallet-access-steps li {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 7px;
    font-size: 10px;
  }

  .wallet-access-steps b {
    width: 32px;
    height: 32px;
  }

  .wallet-modal-body {
    grid-template-rows: minmax(148px, 156px) minmax(0, 1fr);
    gap: 10px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .wallet-qr-card {
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 10px 12px;
    min-height: 0;
    padding: 14px;
  }

  .wallet-qr-card .qr-orbit,
  .wallet-qr-card code {
    display: none;
  }

  .wallet-connect-qr {
    grid-row: 1 / span 2;
    width: 116px;
    border-width: 8px;
    align-self: center;
  }

  .wallet-qr-card strong {
    align-self: end;
    font-size: 17px;
  }

  .wallet-qr-card p {
    align-self: start;
    margin: 0;
    font-size: 12px;
  }

  .wallet-status-row,
  .wallet-option-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .wallet-status-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .wallet-modal-rail {
    gap: 9px;
    min-height: 0;
    overflow: auto;
    padding: 12px;
  }

  .wallet-modal-rail > p {
    font-size: 12px;
  }

  .wallet-status-row span {
    min-height: 30px;
    padding: 4px;
    font-size: 9px;
  }

  .wallet-option-list button {
    grid-template-columns: 30px minmax(0, 1fr);
    min-height: 64px;
    padding: 9px;
  }

  .wallet-option-list span {
    width: 30px;
    height: 30px;
  }

  .wallet-option-list strong {
    font-size: 12px;
  }

  .wallet-option-list small {
    font-size: 10px;
    line-height: 1.25;
  }

  .wallet-modal-actions button {
    min-height: 36px;
    padding: 8px;
    font-size: 11px;
  }

  .wallet-modal-actions .primary {
    grid-column: 1 / -1;
  }
}
