:root {
  --dx-submit-radius: var(--dx-header-glass-radius, var(--dx-radius-md, 10px));
  --dx-submit-rim: rgba(255, 255, 255, 0.42);
  --dx-submit-surface: rgba(255, 255, 255, 0.16);
  --dx-submit-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  --dx-submit-ink: #1a1d24;
  --dx-submit-muted: #4b5261;
  --dx-submit-accent: #ff1910;
  --dx-submit-accent-2: #ff9810;
  /* Surface/control tokens — light defaults; flipped to black-glass under
     body.dx-route-profile-protected #dex-submit in dex.css. */
  --dx-submit-panel: rgba(255, 255, 255, 0.62);     /* inner card surfaces */
  --dx-submit-panel-rim: rgba(255, 255, 255, 0.54); /* inner card borders */
  --dx-submit-line: rgba(255, 255, 255, 0.42);      /* sheet dividers */
  --dx-submit-field: rgba(255, 255, 255, 0.84);     /* inputs / chips / badges */
  --dx-submit-field-rim: rgba(17, 24, 39, 0.2);     /* control borders */
  --dx-submit-track: rgba(17, 24, 39, 0.14);        /* progress track */
}

#dex-submit {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Single black-glass sheet: the shell carries the one rim/shadow/backdrop;
   the two columns inside are flattened to transparent regions split by a
   divider (mirrors the settings unified-sheet pattern). */
#dex-submit .dx-submit-shell {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr);
  gap: 0;
  border: 1px solid var(--dx-submit-rim);
  border-radius: var(--dx-submit-radius);
  background: var(--dx-submit-surface);
  box-shadow: var(--dx-submit-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  backdrop-filter: blur(22px) saturate(135%);
}

#dex-submit .dx-submit-shell.is-flow-gate {
  grid-template-columns: minmax(0, 3.4fr) minmax(240px, 1.1fr);
}

/* Canonical card skin (kept on .dx-submit-main for the surface contract:
   radius > 0 + blur(24px) saturate(170%)); no bg/border so the sheet shows
   through. */
#dex-submit .dx-submit-surface {
  border-radius: var(--dx-submit-radius);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
}

/* Command column reads as the right region of the sheet, split by a divider. */
#dex-submit .dx-submit-command {
  border-left: 1px solid var(--dx-submit-line);
}

#dex-submit[data-dx-submit-submitting="true"] .dx-submit-shell {
  cursor: progress;
}

#dex-submit[data-dx-submit-submitting="true"] .dx-submit-main {
  position: relative;
  isolation: isolate;
}

#dex-submit[data-dx-submit-submitting="true"] .dx-submit-main > * {
  opacity: 0.74;
}

#dex-submit[data-dx-submit-submitting="true"] .dx-submit-main::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--dx-submit-radius);
  pointer-events: none;
  z-index: 4;
  background: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.18) 36%,
    rgba(255, 255, 255, 0.62) 50%,
    rgba(255, 255, 255, 0.18) 64%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-140%);
  animation: dx-submit-fetch-sheen 1.05s ease-in-out infinite;
}

#dex-submit[data-dx-submit-submitting="true"] .dx-submit-input,
#dex-submit[data-dx-submit-submitting="true"] .dx-submit-badge,
#dex-submit[data-dx-submit-submitting="true"] .dx-submit-step-chip,
#dex-submit[data-dx-submit-submitting="true"] .dx-button-element {
  cursor: progress;
}

#dex-submit[data-dx-submit-submitting="true"] a {
  pointer-events: none;
}

@keyframes dx-submit-fetch-sheen {
  0% {
    transform: translateX(-140%);
  }
  100% {
    transform: translateX(140%);
  }
}

#dex-submit .dx-submit-main,
#dex-submit .dx-submit-command {
  min-height: 0;
  display: grid;
  align-content: start;
}

#dex-submit .dx-submit-main {
  grid-template-rows: auto auto 1fr;
  gap: clamp(10px, 1.2vw, 16px);
  padding: clamp(14px, 1.9vw, 24px);
  overflow: hidden;
}

#dex-submit .dx-submit-shell.is-flow-gate .dx-submit-main {
  grid-template-rows: auto 1fr;
  gap: clamp(10px, 1.6vw, 18px);
}

#dex-submit .dx-submit-heading {
  display: grid;
  gap: 6px;
}

#dex-submit .dx-submit-kicker {
  margin: 0;
  font-family: var(--font-mono, "Courier Prime", monospace);
  font-size: clamp(11px, 1vw, 12px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dx-submit-muted);
}

#dex-submit .dx-submit-heading-title,
#dex-submit .dx-submit-title,
#dex-submit .dx-submit-command-title {
  margin: 0;
  color: var(--dx-submit-ink);
  font-family: var(--font-heading, "Stretch Pro", sans-serif);
  line-height: 1.02;
  text-wrap: balance;
}

#dex-submit .dx-submit-heading-title {
  font-size: clamp(1.45rem, 3vw, 2.22rem);
}

#dex-submit .dx-submit-title {
  font-size: clamp(1.2rem, 2.4vw, 1.78rem);
}

#dex-submit .dx-submit-command-title {
  font-size: clamp(0.92rem, 1.45vw, 1.12rem);
}

#dex-submit .dx-submit-copy {
  margin: 0;
  color: var(--dx-submit-muted);
  font-family: var(--font-mono, "Courier Prime", monospace);
  font-size: clamp(14px, 1.05vw, 16px);
  line-height: 1.5;
}

#dex-submit .dx-submit-copy--compact {
  font-size: clamp(12px, 0.98vw, 14px);
  line-height: 1.44;
}

#dex-submit .dx-submit-action-card {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(155, 18, 18, 0.36);
  border-radius: 10px;
  background: rgba(170, 24, 24, 0.1);
  padding: 10px 12px;
}

#dex-submit .dx-submit-action-kicker {
  margin: 0;
  color: #7f1414;
  font-family: var(--font-heading, "Stretch Pro", sans-serif);
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

#dex-submit .dx-submit-action-copy {
  margin: 0;
  color: #4a1010;
  font-family: var(--font-mono, "Courier Prime", monospace);
  font-size: clamp(13px, 1vw, 14px);
  line-height: 1.45;
}

#dex-submit .dx-submit-progress-wrap {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--dx-submit-panel-rim);
  border-radius: calc(var(--dx-submit-radius) - 2px);
  background: var(--dx-submit-panel);
}

#dex-submit .dx-submit-progress-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#dex-submit .dx-submit-step-chip {
  appearance: none;
  border: 1px solid var(--dx-submit-field-rim);
  border-radius: 999px;
  padding: 5px 10px;
  font-family: var(--font-mono, "Courier Prime", monospace);
  font-size: 12px;
  background: var(--dx-submit-field);
  color: var(--dx-submit-ink);
}

#dex-submit .dx-submit-step-chip:disabled {
  opacity: 0.56;
}

#dex-submit .dx-submit-step-chip.is-active {
  border-color: rgba(255, 25, 16, 0.42);
  background: linear-gradient(130deg, rgba(255, 25, 16, 0.2), rgba(255, 152, 16, 0.14));
}

#dex-submit .dx-submit-step-chip.is-done {
  border-color: rgba(17, 115, 44, 0.44);
  background: rgba(34, 197, 94, 0.14);
}

#dex-submit .dx-submit-progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--dx-submit-track);
}

#dex-submit .dx-submit-progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0.2);
  background: linear-gradient(130deg, var(--dx-submit-accent), var(--dx-submit-accent-2));
}

#dex-submit .dx-submit-stage {
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

#dex-submit .dx-submit-shell.is-flow-gate .dx-submit-stage {
  display: grid;
  align-items: center;
  overflow: visible;
  padding-right: 0;
}

#dex-submit .dx-submit-stage-card {
  display: grid;
  gap: clamp(10px, 1.2vw, 16px);
  padding: clamp(12px, 1.5vw, 18px) 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#dex-submit .dx-submit-gate-card {
  min-height: 0;
}

#dex-submit .dx-submit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#dex-submit .dx-submit-field {
  display: grid;
  gap: 6px;
}

#dex-submit .dx-submit-field-label {
  color: var(--dx-submit-ink);
  font-family: var(--font-heading, "Stretch Pro", sans-serif);
  font-size: 13px;
  letter-spacing: 0.02em;
}

#dex-submit .dx-submit-input {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid var(--dx-submit-field-rim);
  background: var(--dx-submit-field);
  color: var(--dx-submit-ink);
  font-family: var(--font-mono, "Courier Prime", monospace);
  font-size: clamp(15px, 1.04vw, 16px);
  line-height: 1.4;
  padding: 10px 12px;
}

#dex-submit .dx-submit-input:focus-visible {
  outline: none;
  border-color: rgba(255, 25, 16, 0.58);
  box-shadow: 0 0 0 3px rgba(255, 25, 16, 0.18);
}

#dex-submit .dx-submit-notes {
  min-height: 132px;
  resize: vertical;
}

#dex-submit .dx-submit-field.has-error .dx-submit-input {
  border-color: rgba(255, 80, 70, 0.72);
  box-shadow: 0 0 0 3px rgba(255, 80, 70, 0.18);
}

#dex-submit .dx-submit-field-error {
  order: 99; /* always render below the control regardless of DOM order */
  margin: 0;
  color: #ff8a80;
  font-family: var(--font-mono, "Courier Prime", monospace);
  font-size: 12px;
  line-height: 1.35;
}

#dex-submit .dx-submit-field-error[hidden] {
  display: none;
}

/* Custom dropdown — replaces the OS-native <select> popup with a dark-glass
   listbox that matches the form chrome. The toggle reuses .dx-submit-input. */
#dex-submit .dx-submit-dropdown {
  position: relative;
}

#dex-submit .dx-submit-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

#dex-submit .dx-submit-dropdown-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dex-submit .dx-submit-dropdown-value.is-placeholder {
  color: var(--dx-submit-muted, rgba(255, 255, 255, 0.6));
}

#dex-submit .dx-submit-dropdown-chevron {
  flex: 0 0 auto;
  opacity: 0.7;
  font-size: 0.8em;
  transition: transform 0.2s ease;
}

#dex-submit .dx-submit-dropdown.is-open .dx-submit-dropdown-chevron {
  transform: rotate(180deg);
}

#dex-submit .dx-submit-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 280px;
  overflow-y: auto;
  display: grid;
  gap: 2px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--dx-blackglass-rim, rgba(255, 255, 255, 0.16));
  background: var(--dx-blackglass-bg, linear-gradient(145deg, rgba(20, 21, 27, 0.97), rgba(13, 14, 18, 0.95)));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  animation: dx-submit-dropdown-in 0.16s ease-out;
}

/* The element-level display above outranks the UA [hidden] rule, so close it
   explicitly — otherwise the menu stays painted over the controls below it. */
#dex-submit .dx-submit-dropdown-menu[hidden] {
  display: none;
}

@keyframes dx-submit-dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

#dex-submit .dx-submit-dropdown-menu::-webkit-scrollbar {
  width: 8px;
}

#dex-submit .dx-submit-dropdown-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

#dex-submit .dx-submit-dropdown-option {
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: var(--font-mono, "Courier Prime", monospace);
  font-size: 14px;
  line-height: 1.3;
  color: var(--dx-blackglass-ink, #f3f3f4);
}

#dex-submit .dx-submit-dropdown-option:hover,
#dex-submit .dx-submit-dropdown-option:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

#dex-submit .dx-submit-dropdown-option.is-selected {
  background: rgba(255, 90, 40, 0.16);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  #dex-submit .dx-submit-dropdown-menu {
    animation: none;
  }
  #dex-submit .dx-submit-dropdown-chevron {
    transition: none;
  }
}

/* Step 0 lane gate — full-shell chooser (no command rail), large cards. */
#dex-submit .dx-submit-shell--gate {
  grid-template-columns: 1fr;
}

#dex-submit .dx-submit-gate {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2.4vw, 30px);
  min-height: 0;
  overflow-y: auto;
}

#dex-submit .dx-submit-gate .dx-submit-heading-title {
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
}

#dex-submit .dx-submit-gate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: clamp(12px, 1.5vw, 18px);
  align-items: stretch;
}

/* Gate cards are a 1:1 port of the catalog-carousel slide: a light card with
   full-bleed media on top, a copy block (kicker · title · supporting line ·
   meta), and a full-width primary button. Built on a grid that sizes to its
   content, with min-width:0 + overflow-wrap so copy always wraps inside the
   card — never clips horizontally — and the gate scrolls if the row is tall. */
#dex-submit .dx-submit-gate-card {
  appearance: none;
  cursor: pointer;
  text-align: left;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 0;
  padding: 0;
  border-radius: var(--dx-radius-md, 14px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.92);
  color: #1a1d24;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

#dex-submit .dx-submit-gate-card:hover,
#dex-submit .dx-submit-gate-card:focus-visible {
  transform: translateY(-3px);
  outline: none;
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.3);
}

/* Media cap — the catalog slide uses a 5/3 image. */
#dex-submit .dx-submit-gate-media {
  display: block;
  aspect-ratio: 5 / 3;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.56);
}

#dex-submit .dx-submit-gate-media--contain {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 25, 16, 0.3), transparent 38%),
    radial-gradient(circle at 78% 82%, rgba(39, 185, 255, 0.28), transparent 40%),
    linear-gradient(150deg, #0c1019, #1c2334);
}

#dex-submit .dx-submit-gate-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

#dex-submit .dx-submit-gate-media--contain .dx-submit-gate-img {
  width: 62%;
  height: 62%;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.34));
}

#dex-submit .dx-submit-gate-card:hover .dx-submit-gate-img,
#dex-submit .dx-submit-gate-card:focus-visible .dx-submit-gate-img {
  transform: scale(1.04);
}

#dex-submit .dx-submit-gate-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: clamp(16px, 1.6vw, 22px);
  /* The card is a <button>, which inherits white-space: nowrap; reset it so the
     copy lines wrap inside the card instead of overflowing and clipping. */
  white-space: normal;
}

#dex-submit .dx-submit-gate-kicker {
  font-family: var(--font-heading, "Stretch Pro", sans-serif);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b7180;
}

#dex-submit .dx-submit-gate-title {
  font-family: var(--font-heading, "Stretch Pro", sans-serif);
  font-size: clamp(1.2rem, 1.7vw, 1.5rem);
  line-height: 1.06;
  color: #15181f;
  overflow-wrap: anywhere;
}

#dex-submit .dx-submit-gate-body {
  font-family: var(--font-mono, "Courier Prime", monospace);
  font-size: 13px;
  line-height: 1.5;
  color: #4b5261;
  overflow-wrap: anywhere;
}

#dex-submit .dx-submit-gate-meta {
  font-family: var(--font-mono, "Courier Prime", monospace);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: #6b7180;
  overflow-wrap: anywhere;
}

/* CTA — full-width primary button, the gate's "VIEW COLLECTION". Inherits the
   gradient/skin from .dx-button-element--primary; we only stretch it. */
#dex-submit .dx-submit-gate-cta {
  margin-top: auto;
  width: 100%;
  justify-content: center;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  #dex-submit .dx-submit-gate-card {
    transition: none;
  }
}

#dex-submit .dx-submit-badge-group,
#dex-submit .dx-submit-license-options,
#dex-submit .dx-submit-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

#dex-submit .dx-submit-badge,
#dex-submit .dx-submit-pill {
  appearance: none;
  border: 1px solid var(--dx-submit-field-rim);
  border-radius: 10px;
  padding: 6px 10px;
  background: var(--dx-submit-field);
  color: var(--dx-submit-ink);
  font-family: var(--font-mono, "Courier Prime", monospace);
  font-size: 12px;
  line-height: 1.2;
}

#dex-submit .dx-submit-badge.is-selected,
#dex-submit .dx-submit-pill--accent {
  border-color: rgba(255, 25, 16, 0.44);
  background: linear-gradient(130deg, rgba(255, 25, 16, 0.22), rgba(255, 152, 16, 0.2));
}

#dex-submit .dx-submit-badge.is-disabled {
  opacity: 0.52;
}

#dex-submit .dx-submit-badge[data-dx-tooltip] {
  cursor: help;
}

#dx-submit-tooltip-layer {
  position: fixed;
  inset: auto auto auto auto;
  z-index: 1200;
  width: max-content;
  max-width: min(280px, 92vw);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.98);
  color: #111;
  font: 600 11px/1.35 var(--font-body, system-ui);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  pointer-events: none;
  white-space: normal;
}

#dx-submit-tooltip-layer[hidden] {
  display: none;
}

#dex-submit .dx-submit-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

#dex-submit .dx-submit-list-item {
  color: var(--dx-submit-muted);
  font-family: var(--font-mono, "Courier Prime", monospace);
  font-size: 14px;
  line-height: 1.45;
}

#dex-submit .dx-submit-license-card {
  max-height: min(42vh, 320px);
  overflow: auto;
  border: 1px solid var(--dx-submit-field-rim);
  border-radius: 10px;
  background: var(--dx-submit-field);
  padding: 12px;
}

#dex-submit .dx-submit-license-pre {
  margin: 0;
  white-space: pre-wrap;
  color: var(--dx-submit-ink);
  font-family: var(--font-mono, "Courier Prime", monospace);
  font-size: 13px;
  line-height: 1.4;
}

#dex-submit .dx-submit-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--dx-submit-ink);
  font-family: var(--font-mono, "Courier Prime", monospace);
  font-size: 13px;
}

#dex-submit .dx-submit-stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

#dex-submit .dx-submit-gate-actions {
  gap: 10px;
}

#dex-submit .dx-submit-gate-actions .dx-button-element {
  min-width: clamp(180px, 23vw, 280px);
}

#dex-submit .dx-submit-command {
  position: sticky;
  top: calc(var(--dx-fixed-header-space, 114px) - var(--dx-fixed-header-top, 12px) + 8px);
  max-height: calc(100vh - (var(--dx-fixed-header-space, 114px) - var(--dx-fixed-header-top, 12px) + 20px));
  overflow: auto;
  gap: 10px;
  align-content: start;
  padding: clamp(12px, 1.5vw, 18px);
}

#dex-submit .dx-submit-command--gate {
  gap: 12px;
}

#dex-submit .dx-submit-command-card {
  border: 0;
  border-top: 1px solid var(--dx-submit-line);
  border-radius: 0;
  background: transparent;
  padding: 12px 0;
  display: grid;
  gap: 6px;
}

#dex-submit .dx-submit-command-card:first-child {
  border-top: 0;
  padding-top: 2px;
}

#dex-submit .dx-submit-checklist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

#dex-submit .dx-submit-check-item {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--dx-submit-ink);
  font-family: var(--font-mono, "Courier Prime", monospace);
  font-size: 12px;
}

#dex-submit .dx-submit-check-item::before {
  content: "•";
  font-size: 14px;
  line-height: 1;
}

#dex-submit .dx-submit-check-item.is-done::before {
  content: "✓";
  color: #0f7a32;
}

#dex-submit .dx-submit-check-item.is-pending {
  opacity: 0.84;
}

#dex-submit .dx-submit-toast-stack {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  gap: 6px;
  z-index: 6;
}

#dex-submit .dx-submit-toast {
  margin: 0;
  border-radius: 8px;
  border: 1px solid rgba(17, 24, 39, 0.15);
  padding: 7px 10px;
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
  font-family: var(--font-mono, "Courier Prime", monospace);
  font-size: 12px;
}

#dex-submit .dx-submit-toast--error {
  background: rgba(153, 27, 27, 0.92);
}

@media (max-width: 1100px) {
  #dex-submit .dx-submit-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  #dex-submit .dx-submit-shell.is-flow-gate {
    grid-template-columns: 1fr;
  }

  #dex-submit .dx-submit-main {
    min-height: 0;
  }

  #dex-submit .dx-submit-command {
    position: relative;
    top: auto;
    max-height: none;
    border-left: 0;
    border-top: 1px solid var(--dx-submit-line);
  }
}

@media (max-width: 820px) {
  #dex-submit .dx-submit-grid {
    grid-template-columns: 1fr;
  }

  #dex-submit .dx-submit-input {
    font-size: 16px;
  }

  #dex-submit .dx-submit-main,
  #dex-submit .dx-submit-command {
    padding: 12px;
  }

  #dex-submit .dx-submit-gate-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  #dex-submit .dx-submit-gate-actions .dx-button-element {
    width: 100%;
    min-width: 0;
  }

  #dex-submit .dx-submit-toast-stack {
    right: 8px;
    left: 8px;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 560px) {
  #dex-submit .dx-submit-stage-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #dex-submit .dx-submit-stage-actions .dx-button-element {
    width: 100%;
    justify-content: center;
  }

  #dex-submit .dx-submit-badge,
  #dex-submit .dx-submit-pill,
  #dex-submit .dx-submit-step-chip {
    min-height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #dex-submit .dx-submit-progress-fill {
    transition: none;
  }

  #dex-submit[data-dx-submit-submitting="true"] .dx-submit-main::after {
    animation: none;
    transform: none;
    opacity: 0.34;
  }
}

/* ===== Redesigned compose/send flow ===== */

/* Inline pipeline switch — matches the settings tab pills (individual bordered
   pills, 4px radius, gradient-filled active), not a segmented box. */
#dex-submit .dx-submit-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#dex-submit .dx-submit-switch-option {
  appearance: none;
  min-height: 38px;
  padding: 0.48rem 0.9rem;
  border: 1px solid var(--dx-submit-line);
  border-radius: 4px;
  font: 700 clamp(11px, 1vw, 12px) var(--font-heading, "Stretch Pro", sans-serif);
  letter-spacing: 0.02em;
  text-transform: uppercase !important;
  background: var(--dx-submit-field);
  color: var(--dx-submit-ink);
  cursor: pointer;
}

#dex-submit .dx-submit-switch-option.is-active {
  border-color: transparent;
  background: linear-gradient(130deg, var(--dx-submit-accent), var(--dx-submit-accent-2));
  color: #fff;
}

#dex-submit .dx-submit-switch-option.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Section grouping inside the single sheet */
#dex-submit .dx-submit-group {
  display: grid;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--dx-submit-line);
}

#dex-submit .dx-submit-group:first-of-type {
  border-top: 0;
  padding-top: 4px;
}

#dex-submit .dx-submit-group-label {
  margin: 0;
  font: 700 11px var(--font-heading, "Stretch Pro", sans-serif);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dx-submit-muted);
}

/* Progressive disclosure (Advanced + legal) */
#dex-submit .dx-submit-advanced,
#dex-submit .dx-submit-legal {
  border-top: 1px solid var(--dx-submit-line);
  padding-top: 12px;
  display: grid;
  gap: 12px;
}

#dex-submit .dx-submit-advanced-summary,
#dex-submit .dx-submit-legal-summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 700 13px var(--font-heading, "Stretch Pro", sans-serif);
  letter-spacing: 0.02em;
  color: var(--dx-submit-ink);
}

#dex-submit .dx-submit-advanced-summary::-webkit-details-marker,
#dex-submit .dx-submit-legal-summary::-webkit-details-marker {
  display: none;
}

#dex-submit .dx-submit-advanced-summary::before,
#dex-submit .dx-submit-legal-summary::before {
  content: "+";
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--dx-submit-field-rim);
  font-size: 14px;
  line-height: 1;
}

#dex-submit details[open] > .dx-submit-advanced-summary::before,
#dex-submit details[open] > .dx-submit-legal-summary::before {
  content: "–";
}

/* Pitch system segmented control */
#dex-submit .dx-submit-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#dex-submit .dx-submit-seg-option {
  appearance: none;
  border: 1px solid var(--dx-submit-field-rim);
  border-radius: 8px;
  padding: 7px 12px;
  font: 600 12px var(--font-mono, "Courier Prime", monospace);
  background: var(--dx-submit-field);
  color: var(--dx-submit-ink);
  cursor: pointer;
}

#dex-submit .dx-submit-seg-option.is-active {
  border-color: transparent;
  background: linear-gradient(130deg, rgba(255, 25, 16, 0.22), rgba(255, 152, 16, 0.2));
}

/* Pitch root note chips */
#dex-submit .dx-submit-notechips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 6px;
}

#dex-submit .dx-submit-notechip {
  appearance: none;
  border: 1px solid var(--dx-submit-field-rim);
  border-radius: 8px;
  padding: 9px 6px;
  min-height: 40px;
  font: 600 13px var(--font-mono, "Courier Prime", monospace);
  background: var(--dx-submit-field);
  color: var(--dx-submit-ink);
  cursor: pointer;
}

#dex-submit .dx-submit-notechip.is-active {
  border-color: transparent;
  background: linear-gradient(130deg, var(--dx-submit-accent), var(--dx-submit-accent-2));
  color: #fff;
}

/* Tag token input */
#dex-submit .dx-submit-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--dx-submit-field-rim);
  background: var(--dx-submit-field);
}

#dex-submit .dx-submit-tok {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: linear-gradient(130deg, rgba(255, 25, 16, 0.22), rgba(255, 152, 16, 0.2));
  font: 600 12px var(--font-mono, "Courier Prime", monospace);
  color: var(--dx-submit-ink);
}

#dex-submit .dx-submit-tok-remove {
  appearance: none;
  border: 0;
  border-radius: 999px;
  width: 18px;
  height: 18px;
  line-height: 1;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.18);
  color: var(--dx-submit-ink);
}

#dex-submit .dx-submit-tok-input {
  flex: 1 1 120px;
  min-width: 120px;
  border: 0;
  background: transparent;
  color: var(--dx-submit-ink);
  font: 600 14px var(--font-mono, "Courier Prime", monospace);
  outline: none;
}

#dex-submit .dx-submit-tag-suggest {
  display: grid;
  gap: 8px;
}

#dex-submit .dx-submit-tag-facet {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

#dex-submit .dx-submit-tag-facet-label {
  font: 700 10px var(--font-heading, "Stretch Pro", sans-serif);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dx-submit-muted);
  min-width: 64px;
}

#dex-submit .dx-submit-tag-opt {
  appearance: none;
  border: 1px solid var(--dx-submit-field-rim);
  border-radius: 999px;
  padding: 5px 10px;
  font: 600 12px var(--font-mono, "Courier Prime", monospace);
  background: var(--dx-submit-field);
  color: var(--dx-submit-ink);
  cursor: pointer;
}

#dex-submit .dx-submit-tag-opt.is-selected {
  border-color: transparent;
  background: linear-gradient(130deg, rgba(255, 25, 16, 0.22), rgba(255, 152, 16, 0.2));
}

/* Readiness meter (command panel) */
#dex-submit .dx-submit-readiness {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--dx-submit-track);
}

#dex-submit .dx-submit-readiness-fill {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(130deg, var(--dx-submit-accent), var(--dx-submit-accent-2));
  transition: transform 220ms cubic-bezier(.2, .7, .2, 1);
}

#dex-submit .dx-submit-readiness.is-complete .dx-submit-readiness-fill {
  background: linear-gradient(130deg, #18b46c, #34c759);
}

#dex-submit .dx-submit-lookup-preview {
  font-family: var(--font-mono, "Courier Prime", monospace);
  letter-spacing: 0.02em;
}

/* Review summary */
#dex-submit .dx-submit-review-grid {
  display: grid;
  gap: 6px;
}

#dex-submit .dx-submit-review-row {
  display: grid;
  grid-template-columns: minmax(96px, 130px) minmax(0, 1fr);
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--dx-submit-line);
}

#dex-submit .dx-submit-review-row:last-child {
  border-bottom: 0;
}

#dex-submit .dx-submit-review-key {
  font: 700 11px var(--font-heading, "Stretch Pro", sans-serif);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dx-submit-muted);
}

#dex-submit .dx-submit-review-val {
  font: 600 13px var(--font-mono, "Courier Prime", monospace);
  color: var(--dx-submit-ink);
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  #dex-submit .dx-submit-switch {
    display: flex;
    width: 100%;
  }

  #dex-submit .dx-submit-switch-option {
    flex: 1 1 0;
  }

  #dex-submit .dx-submit-review-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
