/* Nearcarta shop panels — reference pass.
   ---------------------------------------------------------------------------------------------
   Second design pass, built to the owner's measured review of ref-four-shops.png and
   ref-swap-shop.png. The previous pass passed its own checks and still did not look like the
   references, because the checks measured the wrong things. What was actually wrong:

     - the panel was 360px, so titles truncated ("Swap ...", "Check S...", "Guardian...")
     - the header had no subtitle, no illustration, and carried a category line and a mainnet pill
     - the flow strip was a small box beside a field instead of a full-width labelled strip
     - the Ferry's From/To cards stacked their own text instead of putting a pill and a real
       amount input on one line
     - the primary button was sometimes narrower than the panel, or pushed into a grid cell

   This file sets the structure the references show, at the width they show it:

     tabs  ·  badge + title + subtitle + illustration  ·  .shop-quest slot
      full-width flow strip  ·  fields  ·  one full-width gold CTA  ·  quiet links

   Tokens are unchanged from the first pass (4/8/12/16/20, radius family, dark brown and gold). */

#shopUI {
  --p1: 4px;  --p2: 8px;  --p3: 12px;  --p4: 16px;  --p5: 20px;
  --r-panel: 20px; --r-card: 12px; --r-ctrl: 10px; --r-cta: 14px; --r-pill: 999px;
  --font-ui: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --f-title: 600 22px/28px var(--font-ui);
  --f-sub: 400 13px/18px var(--font-ui);
  --f-label: 500 12px/16px var(--font-ui);
  --f-input: 400 14px/20px var(--font-ui);
  --f-cta: 600 15px/20px var(--font-ui);
  --f-small: 400 12px/18px var(--font-ui);
  --c-panel-top: #2b1e15; --c-panel-bottom: #1b120c; --c-well: #160f0a;
  --c-border: rgba(201, 162, 74, .55); --c-border-soft: rgba(255, 255, 255, .08);
  --c-cream: #f5e6c8; --c-muted: #b9a88a;
  --c-gold-1: #f7d57e; --c-gold-2: #e2a83c; --c-ink: #2a1a0e;
  --c-ok: #22c55e;
  --h-field: 40px; --h-tab: 40px; --h-cta: 44px; --tap: 40px;
}

/* ============================================================================================
   1. The panel: wide enough for full titles and two real columns
   ============================================================================================ */

body #shopUI #tray {
  position: absolute;
  left: var(--p4) !important;
  top: calc(var(--railTop, 74px) + var(--rail, 58px) + var(--p3)) !important;
  bottom: auto !important;
  /* 420px, per the reference and the review. The old 360 truncated every long title. */
  width: clamp(380px, 420px, 440px) !important;
  max-width: calc(100vw - 32px) !important;
  max-height: calc(100dvh - (var(--railTop, 74px) + var(--rail, 58px) + var(--p3)) - 8px) !important;
  height: auto !important;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: var(--p4);
  border-radius: var(--r-panel);
  border: 1px solid var(--c-border);
  background: linear-gradient(180deg, var(--c-panel-top) 0%, var(--c-panel-bottom) 100%);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
  font-family: var(--font-ui);
  color: var(--c-cream);
  overflow: hidden;
}

body #shopUI #tray > .t-scroll {
  display: flex;
  flex-direction: column;
  gap: var(--p3);
  padding: 0;
  margin: 0;
  overflow: visible;
  min-height: 0;
}

/* ============================================================================================
   2. Header block: badge, title, subtitle, illustration — no category line, no mainnet pill
   ============================================================================================ */

body #shopUI #tray > .t-scroll > .t-head {
  display: flex;
  align-items: center;
  gap: var(--p3);
  margin: 0;
  padding: 0;
}

body #shopUI #tray #t-title {
  display: flex;
  align-items: center;
  gap: var(--p3);
  margin: 0;
  padding: 0;
  min-width: 0;
  width: 100%;
  font: var(--f-title);
  color: var(--c-cream);
  letter-spacing: -.01em;
}

/* The title must never truncate: the panel is wide enough, and the name wraps before it clips. */
body #shopUI #tray #t-title .t-name {
  min-width: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  font: var(--f-title);
}

body #shopUI #tray #t-title .panel-badge,
body #shopUI #tray #t-title .panel-badge-letter {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--c-border);
  box-sizing: border-box;
  object-fit: contain;
}

body #shopUI #tray #t-title .panel-badge-letter {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; color: var(--c-gold-1); font: 600 18px/1 var(--font-ui);
}

body #shopUI #tray #t-title .panel-art {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  margin-left: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .45));
  pointer-events: none;
}

/* The subtitle line under the header. */
body #shopUI #tray > .t-scroll > #t-sub {
  margin: calc(-1 * var(--p2)) 0 0;
  padding: 0 0 0 56px;
  font: var(--f-sub);
  color: var(--c-muted);
  min-height: 0;
}
body #shopUI #tray > .t-scroll > #t-sub:empty { display: none; }

/* The category line the review asked to remove. It stays in the DOM for paintTrack, but the
   panel no longer shows it: network state is the dot on the source tag. */
body #shopUI #tray > .t-scroll > #t-track { display: none !important; }

/* The network tag shrinks to a dot with the word beside it, not a pill in the title row. */
body #shopUI #tray > .t-scroll > .t-head #t-src {
  order: 3;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: var(--f-small);
  font-size: 11px;
  color: var(--c-muted);
  opacity: .9;
}
body #shopUI #tray > .t-scroll > .t-head #t-src::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-ok);
  box-shadow: 0 0 5px rgba(34, 197, 94, .7);
}
/* A shop whose source is not live shows a muted dot instead of a false green one. */
body #shopUI #tray > .t-scroll > .t-head #t-src.split::before,
body #shopUI #tray > .t-scroll > .t-head #t-src.quote::before { background: var(--c-gold-2); box-shadow: none; }

body #shopUI #tray > .t-scroll > .t-label {
  margin: 0;
  padding: 0;
  font: var(--f-sub);
  color: var(--c-muted);
  min-height: 0;
}
body #shopUI #tray > .t-scroll > .t-label:empty { display: none; }

/* The slot another worker mounts the Market Day quest step into. It must exist and take no
   space while empty, so the panel is identical whether or not a quest is present. */
body #shopUI #tray > .t-scroll > .shop-quest { display: contents; }
body #shopUI #tray > .t-scroll > .shop-quest:empty { display: none; }
body #shopUI #tray > .t-scroll > .shop-quest > * { margin: 0; }

/* ============================================================================================
   3. The flow strip: full width, centred, every step labelled
   ============================================================================================ */

body #shopUI #tray > .t-scroll > #t-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--p2);
  min-height: 0;
  padding: var(--p3);
  margin: 0;
  border-radius: var(--r-card);
  background: rgba(0, 0, 0, .22);
  border: 1px solid var(--c-border-soft);
  box-sizing: border-box;
  overflow: hidden;
}
body #shopUI #tray > .t-scroll > #t-hero:empty { display: none; }
body #shopUI #tray > .t-scroll > #t-hero img { width: 24px; height: 24px; object-fit: contain; flex: 0 0 auto; }

body #shopUI #tray #t-form .flow-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--p3);
  width: 100%;
  padding: var(--p3);
  border-radius: var(--r-card);
  background: rgba(0, 0, 0, .22);
  border: 1px solid var(--c-border-soft);
  box-sizing: border-box;
  overflow: hidden;
}

body #shopUI #tray #t-form .flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 0 1 auto;
}

body #shopUI #tray #t-form .flow-icon,
body #shopUI #tray #t-form .flow-step img {
  width: 24px; height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
}

body #shopUI #tray #t-form .flow-tick {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(34, 197, 94, .16);
  color: var(--c-ok);
  font-size: 12px; font-weight: 700;
}

body #shopUI #tray #t-form .flow-cap {
  font: var(--f-label);
  font-size: 11px;
  color: var(--c-muted);
  white-space: nowrap;
  text-align: center;
}

body #shopUI #tray #t-form .flow-arrow {
  color: var(--c-gold-2);
  font-size: 14px;
  flex: 0 0 auto;
  align-self: center;
  margin-bottom: 14px;
}

/* ============================================================================================
   4. Fields: 40px, label 12px, placeholder visible, unit chip inside
   ============================================================================================ */

body #shopUI #tray #t-form {
  display: flex;
  flex-direction: column;
  gap: var(--p3);
  margin: 0;
  min-height: 0;
}

body #shopUI #tray #t-form label,
body #shopUI #tray #t-form .field,
body #shopUI #tray #t-form .ferry-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  min-width: 0;
  font: var(--f-label);
  color: var(--c-cream);
}

body #shopUI #tray #t-form .field > span:first-child,
body #shopUI #tray #t-form .ferry-field > span:first-child {
  font: var(--f-label);
  font-size: 12px;
  color: var(--c-cream);
}

body #shopUI #tray #t-form input:not([type='checkbox']):not([type='radio']),
body #shopUI #tray #t-form select,
body #shopUI #tray #t-form textarea {
  width: 100%;
  min-height: var(--h-field);
  height: var(--h-field);
  padding: 0 var(--p3);
  border-radius: var(--r-ctrl);
  border: 1px solid var(--c-border-soft);
  background: var(--c-well);
  color: var(--c-cream);
  font: var(--f-input);
  box-sizing: border-box;
  outline: none;
  transition: border-color .14s ease, box-shadow .14s ease;
}

body #shopUI #tray #t-form textarea { height: auto; min-height: 64px; padding: var(--p2) var(--p3); resize: none; line-height: 20px; }
body #shopUI #tray #t-form input::placeholder,
body #shopUI #tray #t-form textarea::placeholder { color: var(--c-muted); opacity: .75; }
body #shopUI #tray #t-form input:focus,
body #shopUI #tray #t-form select:focus,
body #shopUI #tray #t-form textarea:focus {
  border-color: var(--c-gold-2);
  box-shadow: 0 0 0 3px rgba(226, 168, 60, .18);
}

body #shopUI #tray #t-form .hall-amt,
body #shopUI #tray #t-form .unit { position: relative; display: flex; align-items: center; min-width: 0; }
body #shopUI #tray #t-form .hall-amt > span:last-child,
body #shopUI #tray #t-form .unit > span:last-child {
  position: absolute; right: 1px; top: 1px; bottom: 1px;
  display: inline-flex; align-items: center;
  padding: 0 var(--p3);
  border-radius: 0 calc(var(--r-ctrl) - 1px) calc(var(--r-ctrl) - 1px) 0;
  background: rgba(201, 162, 74, .16);
  color: var(--c-gold-1);
  font: var(--f-label); font-size: 11px;
  pointer-events: none;
}
body #shopUI #tray #t-form .hall-amt input { padding-right: 56px; }

/* Two columns where the reference shows two columns. */
body #shopUI #tray #t-form .hall-split,
body #shopUI #tray #t-form .grid-2,
body #shopUI #tray #t-form .house-pair,
body #shopUI #tray #t-form .bank-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--p3);
  min-width: 0;
}

/* ============================================================================================
   5. One full-width gold CTA, never inside a grid cell
   ============================================================================================ */

body #shopUI #tray > .t-row { margin: var(--p4) 0 0; padding: 0; min-width: 0; }

body #shopUI #tray > .t-row > #t-act.primary,
body #shopUI #tray #t-form > .primary,
body #shopUI #tray #t-form .primary.ferry-cta,
body #shopUI #tray #t-form .hall-cta.primary,
body #shopUI #tray #t-form .guard-cta.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--p2);
  width: 100%;
  min-width: 100%;
  min-height: var(--h-cta);
  height: var(--h-cta);
  padding: 0 var(--p4);
  margin: 0;
  border: 0;
  border-radius: var(--r-cta);
  background: linear-gradient(180deg, var(--c-gold-1) 0%, var(--c-gold-2) 100%) !important;
  color: var(--c-ink) !important;
  font: var(--f-cta);
  cursor: pointer;
  box-sizing: border-box;
  box-shadow: 0 6px 18px rgba(226, 168, 60, .22);
  white-space: nowrap;
  grid-column: 1 / -1;
  transition: transform .1s ease, box-shadow .14s ease, filter .14s ease;
}

body #shopUI #tray > .t-row > #t-act.primary:hover:not(:disabled),
body #shopUI #tray #t-form .primary:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow: 0 8px 22px rgba(226, 168, 60, .3);
}
body #shopUI #tray > .t-row > #t-act.primary:active:not(:disabled),
body #shopUI #tray #t-form .primary:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 3px 10px rgba(226, 168, 60, .2);
}
body #shopUI #tray > .t-row > #t-act.primary:disabled,
body #shopUI #tray #t-form .primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* Every other control in a panel is an outlined secondary of the same family. */
body #shopUI #tray #t-form button:not(.primary):not([role='tab']):not(.route-chip):not(.swap-max):not(.swap-flip),
body #shopUI #tray #t-form .ferry-cta:not(.primary) {
  min-height: var(--h-cta);
  height: var(--h-cta);
  padding: 0 var(--p4);
  border-radius: var(--r-cta);
  border: 1px solid var(--c-border);
  background: rgba(0, 0, 0, .24);
  color: var(--c-cream);
  font: var(--f-cta);
  font-weight: 500;
  cursor: pointer;
  box-sizing: border-box;
  box-shadow: none;
}

/* ============================================================================================
   6. Tabs: one segmented row with icons, at the top of the panel
   ============================================================================================ */

body #shopUI #tray .ferry-tabs,
body #shopUI #tray .guard-tabs,
body #shopUI #tray .hall-tabs,
body #shopUI #tray .bank-tabs,
body #shopUI #tray .house-tabs,
body #shopUI #tray .arena-modes,
body #shopUI #tray .payouts-tabs,
body #shopUI #tray .chronicle-tabs,
body #shopUI #tray .toll-tabs,
body #shopUI #tray [role='tablist'] {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--p2);
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-sizing: border-box;
}

body #shopUI #tray .ferry-tab,
body #shopUI #tray .guard-tab,
body #shopUI #tray .hall-tab,
body #shopUI #tray .bank-tab,
body #shopUI #tray .house-tab,
body #shopUI #tray .arena-mode,
body #shopUI #tray .payouts-tab,
body #shopUI #tray .chronicle-tab,
body #shopUI #tray .toll-tab,
body #shopUI #tray [role='tablist'] > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--h-tab);
  min-height: var(--h-tab);
  padding: 0 var(--p2);
  margin: 0;
  border-radius: var(--r-card);
  border: 1px solid var(--c-border);
  background: rgba(0, 0, 0, .18);
  color: var(--c-cream);
  font: var(--f-label);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  box-sizing: border-box;
  box-shadow: none;
  text-shadow: none;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}

body #shopUI #tray .ferry-tab.on,
body #shopUI #tray .guard-tab.on,
body #shopUI #tray .hall-tab.on,
body #shopUI #tray .bank-tab.on,
body #shopUI #tray .house-tab.on,
body #shopUI #tray .arena-mode.on,
body #shopUI #tray .payouts-tab.on,
body #shopUI #tray .chronicle-tab.on,
body #shopUI #tray .toll-tab.on,
body #shopUI #tray [role='tab'][aria-selected='true'],
body #shopUI #tray [role='tablist'] > button[aria-selected='true'],
body #shopUI #tray .arena-mode[aria-pressed='true'] {
  background: linear-gradient(180deg, var(--c-gold-1) 0%, var(--c-gold-2) 100%) !important;
  border-color: transparent !important;
  color: var(--c-ink) !important;
  font-weight: 600;
  box-shadow: none !important;
  text-decoration: none !important;
}

body #shopUI #tray .ferry-tab::after,
body #shopUI #tray .guard-tab::after,
body #shopUI #tray .hall-tab::after,
body #shopUI #tray .bank-tab::after,
body #shopUI #tray .payouts-tab::after { display: none !important; content: none !important; border: 0 !important; }

/* ============================================================================================
   7. Quiet links, inside the panel's padding
   ============================================================================================ */

body #shopUI #tray > .t-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--p3);
  margin: var(--p3) 0 0;
  padding: 0;
  min-height: 0;
}
body #shopUI #tray > .t-links .link,
body #shopUI #tray > .t-links a {
  display: inline-flex; align-items: center;
  min-height: var(--tap);
  margin: 0; padding: 0;
  border: 0; background: none;
  color: var(--c-muted);
  font: var(--f-small);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
body #shopUI #tray > .t-links .link:hover { color: var(--c-cream); }

body #shopUI #tray > .rcpt { margin: var(--p3) 0 0; font: var(--f-small); color: var(--c-muted); min-height: 0; }
body #shopUI #tray > .rcpt:empty { display: none; }

/* ============================================================================================
   8. Mobile: one full-width card, one scroll area
   ============================================================================================ */

@media (max-width: 720px) {
  body #shopUI #tray {
    left: 8px !important; right: 8px !important;
    top: auto !important; bottom: 8px !important;
    width: auto !important; max-width: none !important;
    max-height: calc(100dvh - 16px) !important;
    padding: var(--p3);
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }
  body #shopUI #tray > .t-scroll {
    overflow: visible !important;
    max-height: none !important;
    flex: 0 0 auto !important;
    gap: var(--p2);
  }
  body #shopUI #tray #t-title { font-size: 19px; line-height: 24px; }
  body #shopUI #tray #t-title .panel-badge { width: 36px; height: 36px; padding: 6px; }
  body #shopUI #tray #t-title .panel-art { width: 40px; height: 40px; }
  body #shopUI #tray > .t-scroll > #t-sub { padding-left: 48px; font-size: 12px; }
  body #shopUI #tray .hall-split,
  body #shopUI #tray .grid-2,
  body #shopUI #tray .house-pair,
  body #shopUI #tray .bank-pair { grid-template-columns: minmax(0, 1fr); }
  body #shopUI #tray .ferry-tab,
  body #shopUI #tray [role='tablist'] > button { font-size: 11px; padding: 0 4px; gap: 3px; }
}

/* ============================================================================================
   9. Swap Shop — From / flip / To / chain / quote, exactly as ref-swap-shop.png
   --------------------------------------------------------------------------------------------
   The cards put a token pill and a real amount input on ONE line. The previous pass stacked
   them, which is why the shots showed "wNEAR dex near" on top of itself and no amount field.
   ============================================================================================ */

body #shopUI #tray #t-form .swap-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--p2);
  padding: var(--p3);
  border-radius: var(--r-card);
  background: var(--c-well);
  border: 1px solid var(--c-border-soft);
  box-sizing: border-box;
  min-width: 0;
}

body #shopUI #tray #t-form .swap-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--p2);
  font: var(--f-label);
  font-size: 12px;
  color: var(--c-muted);
  min-width: 0;
}
body #shopUI #tray #t-form .swap-bal { font-size: 11px; color: var(--c-muted); white-space: nowrap; }

/* One line: pill on the left, amount on the right. Never stacked, never overlapping. */
body #shopUI #tray #t-form .swap-line {
  display: flex;
  align-items: center;
  gap: var(--p2);
  min-width: 0;
}

/* The token selector keeps its own width; the amount takes the rest. */
body #shopUI #tray #t-form .swap-line > .picker,
body #shopUI #tray #t-form .swap-line [data-testid='ferry-from'],
body #shopUI #tray #t-form .swap-line [data-testid='ferry-to'] {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 58%;
}

body #shopUI #tray #t-form .swap-line .amt-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  min-width: 0;
  flex: 1 1 auto;
  justify-content: flex-end;
}

/* A real, visible amount field — not bare text. */
body #shopUI #tray #t-form .swap-line .amt-row input {
  width: 100%;
  min-width: 0;
  max-width: 132px;
  height: var(--h-field);
  padding: 0 var(--p2);
  text-align: right;
  border-radius: var(--r-ctrl);
  border: 1px solid var(--c-border-soft);
  background: rgba(0, 0, 0, .28);
  font: 600 15px/20px var(--font-ui);
  color: var(--c-cream);
  box-sizing: border-box;
}

body #shopUI #tray #t-form .swap-line .amt-sym { font: var(--f-label); font-size: 11px; color: var(--c-muted); flex: 0 0 auto; }
body #shopUI #tray #t-form .swap-est { font: 600 14px/20px var(--font-ui); color: var(--c-cream); white-space: nowrap; }

/* The Max chip sits at the amount field's right edge, as in the reference. */
body #shopUI #tray #t-form .swap-max {
  min-height: var(--tap) !important;
  height: var(--tap) !important;
  padding: 0 var(--p3) !important;
  margin: 0 !important;
  border-radius: var(--r-pill) !important;
  border: 1px solid var(--c-border) !important;
  background: rgba(226, 168, 60, .14) !important;
  color: var(--c-gold-1) !important;
  font: 600 11px/1 var(--font-ui) !important;
  cursor: pointer;
  flex: 0 0 auto;
  box-sizing: border-box;
}

/* The flip button sits centred on the seam between the two cards. */
body #shopUI #tray #t-form .swap-flip {
  align-self: center;
  width: var(--tap);
  height: var(--tap);
  min-height: var(--tap);
  margin: calc(-1 * var(--p2) - 6px) 0;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--c-border);
  background: var(--c-panel-top);
  color: var(--c-gold-1);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  box-sizing: border-box;
}
body #shopUI #tray #t-form .swap-flip:hover { border-color: var(--c-gold-2); }

body #shopUI #tray #t-form .swap-chain-row { display: flex; align-items: flex-end; gap: var(--p3); }
body #shopUI #tray #t-form .swap-chain-row .field { flex: 1 1 auto; min-width: 0; }
body #shopUI #tray #t-form .swap-live {
  display: inline-flex; align-items: center; gap: 6px;
  flex: 0 0 auto;
  padding-bottom: 10px;
  font: var(--f-small); font-size: 12px;
  color: var(--c-muted);
}
body #shopUI #tray #t-form .swap-live i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-ok);
  box-shadow: 0 0 6px rgba(34, 197, 94, .8);
}

body #shopUI #tray #t-form .swap-quote {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--p3);
  border-radius: var(--r-card);
  background: rgba(0, 0, 0, .22);
  border: 1px solid var(--c-border);
  box-sizing: border-box;
}
body #shopUI #tray #t-form .swap-quote-head {
  display: flex; align-items: center; justify-content: space-between;
  font: var(--f-label); color: var(--c-cream);
}
body #shopUI #tray #t-form .swap-best {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: rgba(226, 168, 60, .16);
  color: var(--c-gold-1);
  font-size: 11px;
}
/* The rate / fee / route rows read as label-left value-right lines. */
body #shopUI #tray #t-form .swap-quote p,
body #shopUI #tray #t-form .swap-quote .ferry-rate {
  display: flex; justify-content: space-between; gap: var(--p2);
  margin: 0;
  font: var(--f-small); font-size: 12px;
  color: var(--c-muted);
}
body #shopUI #tray #t-form .swap-quote p + p { padding-top: 6px; border-top: 1px solid var(--c-border-soft); }

/* ============================================================================================
   10. The token pill: one clean row, icon then label then chevron
   --------------------------------------------------------------------------------------------
   The overlap in the review shots ("wNEAR dex near" stacked on itself) came from the pill being
   a flex row whose token stack kept its own absolute overlay while the label took the remaining
   width in a 58%-wide slot. Here the pill is a single row with a hard 40px height, the stack is
   inline and clipped, and the label gets the space that is left.
   ============================================================================================ */

body #shopUI #tray #t-form .token-listbox { min-width: 0; }

body #shopUI #tray #t-form .swap-line .token-listbox-btn,
body #shopUI #tray #t-form .swap-card .token-listbox-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  height: var(--h-field);
  min-height: var(--h-field);
  padding: 0 26px 0 8px;
  border-radius: var(--r-ctrl);
  border: 1px solid var(--c-border-soft);
  background-color: rgba(0, 0, 0, .28);
  color: var(--c-cream);
  font: var(--f-label);
  font-size: 12px;
  box-sizing: border-box;
  white-space: nowrap;
  /* A small chevron on the right, drawn with borders so no asset is needed. */
  background-image: none;
  position: relative;
}

body #shopUI #tray #t-form .swap-line .token-listbox-btn::after,
body #shopUI #tray #t-form .swap-card .token-listbox-btn::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -4px;
  border-right: 1.5px solid var(--c-muted);
  border-bottom: 1.5px solid var(--c-muted);
  transform: rotate(45deg);
  pointer-events: none;
}

/* The stack must not absolutely position itself over the label. */
body #shopUI #tray #t-form .swap-line .token-listbox-btn .tic,
body #shopUI #tray #t-form .swap-card .token-listbox-btn .tic {
  position: relative;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
}

body #shopUI #tray #t-form .swap-line .token-listbox-btn .opt-label,
body #shopUI #tray #t-form .swap-card .token-listbox-btn .opt-label {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

/* The reference puts Review swap in gold and "Sign in to continue" as an outlined button under
   it. That means the panel's own action row must step back when a shop carries its own gold
   primary inside the form, or the view would show two golds. */
body #shopUI #tray:has(#t-form #f-quote) > .t-row > #t-act.primary {
  background: rgba(0, 0, 0, .24) !important;
  background-image: none !important;
  color: var(--c-cream) !important;
  border: 1px solid var(--c-border) !important;
  box-shadow: none !important;
  font-weight: 500 !important;
}

/* The gold primary inside the Ferry form is Review swap. */
body #shopUI #tray #t-form #f-quote {
  background: linear-gradient(180deg, var(--c-gold-1) 0%, var(--c-gold-2) 100%) !important;
  background-image: linear-gradient(180deg, var(--c-gold-1) 0%, var(--c-gold-2) 100%) !important;
  color: var(--c-ink) !important;
  border: 0 !important;
  border-radius: var(--r-cta) !important;
  box-shadow: 0 6px 18px rgba(226, 168, 60, .22) !important;
  font: var(--f-cta) !important;
  font-weight: 600 !important;
  min-height: var(--h-cta) !important;
  height: var(--h-cta) !important;
  width: 100% !important;
}

/* A shop that carries its own gold primary does not also need the secondary pair side by side. */
body #shopUI #tray #t-form .ferry-cargo-actions {
  display: flex;
  flex-direction: column;
  gap: var(--p3);
}

/* The card's inner line is a `label.field`, and the base field rule is flex-column, so the token
   pill and the amount stacked on top of each other. That is exactly the "wNEAR dex near" overlap
   in the review. The line is a ROW, and the screen-reader label is out of flow so it adds no
   height. */
body #shopUI #tray #t-form .swap-line {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: var(--p2) !important;
  height: auto;
}

body #shopUI #tray #t-form .swap-line > .sr-only { position: absolute !important; }

/* The pill and the amount share the row: pill takes what it needs, amount fills the rest. */
body #shopUI #tray #t-form .swap-line .token-listbox { flex: 0 1 auto; min-width: 92px; max-width: 50%; }
body #shopUI #tray #t-form .swap-line .amt-row { flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
body #shopUI #tray #t-form .swap-line .amt-row input { width: 100%; max-width: none; flex: 1 1 auto; min-width: 40px; }

/* The amount row was wider than the space the pill left, so Max landed on the label. The pill
   gets a fixed, readable width and the amount row takes exactly what remains. */
body #shopUI #tray #t-form .swap-line { overflow: hidden; }
body #shopUI #tray #t-form .swap-line .token-listbox { flex: 0 0 auto; width: 132px; min-width: 0; max-width: 132px; }
body #shopUI #tray #t-form .swap-line .amt-row { flex: 1 1 auto; min-width: 0; overflow: hidden; }
body #shopUI #tray #t-form .swap-line .amt-row input { flex: 1 1 auto; min-width: 32px; max-width: none; }
body #shopUI #tray #t-form .swap-line .swap-max { flex: 0 0 auto; }

@media (max-width: 720px) {
  body #shopUI #tray #t-form .swap-line .token-listbox { width: 112px; max-width: 112px; }
}

/* A shop's own gold action is the wide one; anything else that happens to be gradient-filled in a
   narrow cell (a chip, a small mode button) must not read as the primary. */
body #shopUI #tray #t-form .swap-max,
body #shopUI #tray #t-form .swap-flip,
body #shopUI #tray #t-form .route-chip,
body #shopUI #tray #t-form .arena-mode,
body #shopUI #tray #t-form #f-compare {
  background-image: none !important;
}

/* Any shop action that is the panel's real primary is full width, wherever it sits. */
body #shopUI #tray #t-form > button.primary,
body #shopUI #tray #t-form > .primary,
body #shopUI #tray #t-form .shop-stack > button.primary {
  width: 100% !important;
  min-width: 100% !important;
  display: flex;
  justify-content: center;
}

/* The Swap pane is ONE column of stacked cards, like the reference. A legacy rule made
   `.ferry-picker` a two-column grid, which gave each card half the panel — 168px at 390 — so the
   token pill left no room for the amount and Max landed on the label. */
body #shopUI #tray #t-form .ferry-picker,
body #shopUI #tray #t-form .ferry-pane.ferry-picker {
  display: flex !important;
  flex-direction: column;
  grid-template-columns: none !important;
  gap: var(--p3);
  min-width: 0;
}

body #shopUI #tray #t-form .ferry-picker > * { min-width: 0; max-width: 100%; }
body #shopUI #tray #t-form .ferry-picker .swap-card { width: 100%; }

/* A pane with the `hidden` attribute is NOT rendered. Several of the layout rules in this file
   set `display` with !important, which overrode the attribute and left hidden panes painted on
   top of the visible one — the review's "Review swap ⟂ more below" overlap. The attribute wins. */
body #shopUI #tray [hidden] { display: none !important; }

/* Higher specificity than any layout rule above: a pane with `hidden` is never painted, however
   strongly the pane's own display was set. */
body #shopUI #tray #t-form .ferry-pane[hidden],
body #shopUI #tray #t-form .ferry-pane.ferry-picker[hidden],
body #shopUI #tray #t-form [data-pane][hidden],
body #shopUI #tray #t-form > *[hidden] {
  display: none !important;
}

/* Routes: three corridor cards in two columns and the quick routes in one row of three. Measured
   before this: the pane was 208px over the panel on desktop, so corridor text landed on the
   footer. No field is removed; the same three cards are simply not stacked. */
body #shopUI #tray #t-form .corridors {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: var(--p2) !important;
  margin: 0;
}
body #shopUI #tray #t-form .corridor { padding: var(--p2) var(--p3); border-radius: var(--r-card); }
body #shopUI #tray #t-form .corridor b { font-size: 13px; }
body #shopUI #tray #t-form .corridor p { margin-top: 2px; font-size: 11px; line-height: 15px; }

body #shopUI #tray #t-form .route-row {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: var(--p2) !important;
  margin: 0;
}
body #shopUI #tray #t-form .route-chip {
  min-height: var(--h-field);
  height: auto;
  padding: var(--p2);
  border-radius: var(--r-card);
  box-sizing: border-box;
}

@media (max-width: 720px) {
  body #shopUI #tray #t-form .corridors,
  body #shopUI #tray #t-form .route-row { grid-template-columns: minmax(0, 1fr) !important; }
}

/* Six pixels: the Routes pane was 6px taller than its slot, so its own Compare button ended
   6px below where the action row began. Reclaim it from the pane's rhythm, not from a control. */
body #shopUI #tray #t-form { gap: var(--p2) !important; }
body #shopUI #tray > .t-scroll { gap: var(--p2) !important; }
body #shopUI #tray > .t-row { margin-top: var(--p3) !important; }
body #shopUI #tray #t-form .ferry-picker-note { margin: 0; }
body #shopUI #tray #t-form .ferry-shortcuts-label { margin: 0; }
body #shopUI #tray #t-form .ferry-compare-more > summary { min-height: 32px; }

/* A control inside a disclosure is not the panel's primary: the gold belongs to the action that
   ends the view. Compare now keeps its size and stays clickable, outlined. */
body #shopUI #tray #t-form details .primary,
body #shopUI #tray #t-form details #f-compare {
  background: rgba(0, 0, 0, .24) !important;
  background-image: none !important;
  color: var(--c-cream) !important;
  border: 1px solid var(--c-border) !important;
  box-shadow: none !important;
}

/* An open disclosure still has to fit: its content is capped and scrolls inside itself, so it can
   never push the panel's own action out of the panel. */
body #shopUI #tray #t-form details[open] > :not(summary) {
  max-height: 168px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body #shopUI #tray #t-form .ferry-compare-more > summary { cursor: pointer; }

/* Bank and Toll primaries were sized by their own sheets (88% and 52%), so they never spanned the
   panel. A shop's action is full width wherever it is declared. */
body #shopUI #tray #t-form .bank-cta,
body #shopUI #tray #t-form #bank-audit,
body #shopUI #tray #t-form #bank-attest,
body #shopUI #tray #t-form [data-testid^='bank-'][class*='cta'],
body #shopUI #tray #t-form .toll-cta,
body #shopUI #tray #t-form #toll-pay {
  width: 100% !important;
  min-width: 100% !important;
  display: flex !important;
  justify-content: center;
  background: linear-gradient(180deg, var(--c-gold-1) 0%, var(--c-gold-2) 100%) !important;
  color: var(--c-ink) !important;
  border: 0 !important;
  border-radius: var(--r-cta) !important;
  box-shadow: 0 6px 18px rgba(226, 168, 60, .22) !important;
  font: var(--f-cta) !important;
  font-weight: 600 !important;
  min-height: var(--h-cta) !important;
  height: var(--h-cta) !important;
}

/* The Bank's Sample select and its Download button were sharing a row and colliding. The select
   gets the row; the button sits under it. */
body #shopUI #tray #t-form .bank-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: var(--p2) !important;
  align-items: stretch;
}
body #shopUI #tray #t-form .bank-row .choice-label { grid-column: 1 / -1; }
body #shopUI #tray #t-form .bank-row select { width: 100%; }
body #shopUI #tray #t-form .bank-row .bank-sample-link,
body #shopUI #tray #t-form .bank-row button {
  width: 100%;
  justify-self: stretch;
}

/* Same for the toll's own sample row. */
body #shopUI #tray #t-form .toll-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: var(--p2) !important;
}

/* The Bank's action lives in a shop card outside #t-form, so the scoped rule above missed it.
   Any gradient primary inside the panel is full width, wherever it is declared. */
body #shopUI #tray button.primary,
body #shopUI #tray .bank-cta,
body #shopUI #tray #bank-audit,
body #shopUI #tray [data-testid='bank-audit'] {
  width: 100% !important;
  min-width: 100% !important;
  display: flex !important;
  justify-content: center;
  box-sizing: border-box;
  background: linear-gradient(180deg, var(--c-gold-1) 0%, var(--c-gold-2) 100%) !important;
  color: var(--c-ink) !important;
  border: 0 !important;
  border-radius: var(--r-cta) !important;
  box-shadow: 0 6px 18px rgba(226, 168, 60, .22) !important;
  font: var(--f-cta) !important;
  font-weight: 600 !important;
  min-height: var(--h-cta) !important;
  height: var(--h-cta) !important;
}

/* The panel pads 16px; #t-form was padding another 16 inside it, so every control sat 32px in
   and a full-width button measured 88% of the panel. One gutter, at the panel. */
body #shopUI #tray #t-form,
body #shopUI #tray #t-form .shop-stack,
body #shopUI #tray #t-form .shop-card,
body #shopUI #tray #t-form .bank-pane,
body #shopUI #tray #t-form .bank-foot {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* The Bank's card keeps its own inner padding for its rows, but not on the action row. */
body #shopUI #tray #t-form .card.shop-card { padding-left: 0 !important; padding-right: 0 !important; }
body #shopUI #tray #t-form .bank-pane > * { max-width: 100%; }

/* Payouts Payroll: the row list and its buttons were pushing the pane past the panel, so the
   pane's own last button landed on the action row. The list scrolls inside itself; the action
   stays where the panel put it. */
body #shopUI #tray #t-form .plist {
  max-height: 168px;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
}

body #shopUI #tray #t-form .payout-status,
body #shopUI #tray #t-form .payout-line { margin: 0; font-size: 12px; line-height: 16px; }

/* Two buttons that belong to the pane sit in one column with a clear gap, never on one line. */
body #shopUI #tray #t-form .payout-actions,
body #shopUI #tray #t-form .ferry-pane[data-pane='payroll'] > button {
  display: flex;
  flex-direction: column;
  gap: var(--p3);
  width: 100%;
}

/* A payroll row stacked three labelled fields vertically, so one row was 206px inside a 168px
   list and its last field painted over "Add a row". The row is a grid: payee on its own line,
   then chain / asset / amount on one row. Same fields, same ids, one row high. */
body #shopUI #tray #t-form .plist li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--p2);
  align-items: end;
  padding: var(--p2) 0;
  box-sizing: border-box;
  min-width: 0;
}

body #shopUI #tray #t-form .plist li > .field:first-child,
body #shopUI #tray #t-form .plist li > label:first-child { grid-column: 1 / -1; }

body #shopUI #tray #t-form .plist li .field,
body #shopUI #tray #t-form .plist li label { gap: 4px; }
body #shopUI #tray #t-form .plist li .field > span:first-child,
body #shopUI #tray #t-form .plist li label > span:first-child { font-size: 11px; }

body #shopUI #tray #t-form .plist li input,
body #shopUI #tray #t-form .plist li select { min-height: 36px; height: 36px; font-size: 13px; }

/* With the rows compact, the list can hold a whole row without scrolling mid-row. */
body #shopUI #tray #t-form .plist { max-height: 210px; }

/* A payroll row is <li> with a Receiver label and a .payout-split holding Chain / Asset / Amount.
   The split was stacking, which made each row 206px tall. It is a three-up row, so a row fits in
   the list and cannot paint over "Add a row". */
body #shopUI #tray #t-form .plist li.payout-row {
  display: block;
  padding: var(--p2) 0;
}

body #shopUI #tray #t-form .plist .payout-split {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.1fr) !important;
  gap: var(--p2) !important;
  margin-top: var(--p2);
  align-items: end;
}

body #shopUI #tray #t-form .plist .payout-split .field,
body #shopUI #tray #t-form .plist .payout-split label { gap: 4px; min-width: 0; }
body #shopUI #tray #t-form .plist .payout-split .field > span:first-child { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body #shopUI #tray #t-form .plist .payout-split input,
body #shopUI #tray #t-form .plist .payout-split select { min-height: 36px; height: 36px; font-size: 13px; padding: 0 var(--p2); }

@media (max-width: 720px) {
  body #shopUI #tray #t-form .plist .payout-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
}

/* The split's third cell ("Amount NEAR") was wider than its 131px column, so it wrapped to a
   second grid row and its label spanned the full width — which is what landed on "Add a row".
   The cells now hold one line each: the label truncates instead of wrapping the grid, and the
   list is tall enough for the row it contains. */
body #shopUI #tray #t-form .plist .payout-split .field > span:first-child {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

body #shopUI #tray #t-form .plist .payout-split { grid-auto-rows: auto; }

body #shopUI #tray #t-form .plist {
  max-height: none;
  overflow: visible;
}

/* With the row compact, the pane fits: the list is sized by its rows, and the pane's own
   buttons follow it. No inner scroll, no paint over the action row. */
body #shopUI #tray #t-form .plist li.payout-row { border-bottom: 1px solid var(--c-border-soft); }
body #shopUI #tray #t-form .plist li.payout-row:last-child { border-bottom: 0; }

/* The Payroll pane genuinely holds more than one screen: rows plus paste plus review plus pay.
   The list is the part that scrolls, it is tall enough for two whole rows, and its own scrollbar
   is the only one — the panel's action row can no longer be reached by pane content. */
body #shopUI #tray #t-form .plist {
  max-height: 196px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  margin: 0;
}

body #shopUI #tray #t-form .plist li.payout-row { padding: var(--p2) 0; }
body #shopUI #tray #t-form .plist li.payout-row .field + .field { margin-top: 0; }

/* Everything after the list is compact, so the pane ends inside the panel. */
body #shopUI #tray #t-form #p-add { min-height: 36px !important; height: 36px !important; font-size: 12px !important; width: auto !important; align-self: flex-start; padding: 0 var(--p3) !important; border-radius: var(--r-pill) !important; }
body #shopUI #tray #t-form [data-testid='payout-add-note'] { margin: 0; font-size: 11px; line-height: 15px; }
body #shopUI #tray #t-form #p-csv { min-height: 48px; }

/* A grid cell's default min-width is auto, so the third cell refused to shrink below its label
   and dropped onto a second row at full width. min-width:0 on the cells lets the label ellipsis
   instead, and the row stays one line. */
body #shopUI #tray #t-form .plist .payout-split > * {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden;
}

body #shopUI #tray #t-form .plist .payout-split > * > span:first-child {
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body #shopUI #tray #t-form .plist .payout-split input,
body #shopUI #tray #t-form .plist .payout-split select {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* The split's cells are labels too, so the "first child label spans the row" rule landed on the
   Amount cell and pushed it onto its own line at full width. Inside the split, every cell keeps
   its own single column. */
body #shopUI #tray #t-form .plist .payout-split > label,
body #shopUI #tray #t-form .plist .payout-split > .field {
  grid-column: auto !important;
  grid-row: auto !important;
}

/* The Guardhouse checklist: one fact per line, each with its own green tick, inside a card —
   the reference's shape. Same sentences, no paragraph. */
body #shopUI #tray #t-form .guard-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--p3);
  border-radius: var(--r-card);
  background: rgba(0, 0, 0, .2);
  border: 1px solid var(--c-border-soft);
  font: var(--f-small);
  font-size: 12px;
  line-height: 17px;
  color: var(--c-muted);
}

body #shopUI #tray #t-form .guard-status::before { content: none !important; }

body #shopUI #tray #t-form .guard-check {
  display: flex;
  align-items: flex-start;
  gap: var(--p2);
  margin: 0;
  min-width: 0;
}

body #shopUI #tray #t-form .guard-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border-radius: 50%;
  background: rgba(34, 197, 94, .18);
  color: var(--c-ok);
  font-size: 10px;
  font-weight: 700;
}

/* The Arena's three technical id lines are debug output, not shop content: they stay in the DOM
   for anything that reads them, and are not painted in the panel. */
body #shopUI #tray #t-form .arena-ids,
body #shopUI #tray #t-form [data-testid='arena-ids'],
body #shopUI #tray #t-form .arena-debug { display: none !important; }

/* The Arena's `.arena-lines` block is three technical id lines ("Visitor Guardian · 8ccd…",
   "Mainnet guardian · nearcarta.near", "Deployed token. Not an arena v2 pot."). They are kept
   out of the panel. They stay in the DOM for anything that reads them and are not
   painted; the arena's live status line above them is untouched. */
body.shop-ui #shopUI #tray #t-form #arena-live .arena-lines,
body #shopUI #tray #t-form #arena-live > .arena-lines {
  display: none !important;
}

/* "All shops" sits under the Nearcarta brand in every shop. One shop sheet moved it to the top
   centre (measured at x=420,y=18 while the other shops had it at x=16,y=74). One position, for
   every shop. */
body.in-shop nav.all-shops {
  position: fixed !important;
  left: 16px !important;
  top: 64px !important;
  right: auto !important;
  margin: 0 !important;
  z-index: 21;
}

@media (max-width: 720px) {
  body.in-shop nav.all-shops { left: 8px !important; }
}

/* ============================================================================================
   11. Icons on the tabs and the CTA, from the reference
   --------------------------------------------------------------------------------------------
   Every tab in the references carries a small icon, and the primary button carries the shop's
   own symbol. Adding markup to nine shops would be nine chances to diverge, so the glyph is a
   CSS ::before drawn from the same 3D icon set, keyed off the tab's data-testid. A tab with no
   mapping simply has no icon, never a broken one.
   ============================================================================================ */

body #shopUI #tray [role='tab']::before,
body #shopUI #tray .ferry-tab::before,
body #shopUI #tray .guard-tab::before,
body #shopUI #tray .hall-tab::before,
body #shopUI #tray .bank-tab::before,
body #shopUI #tray .payouts-tab::before,
body #shopUI #tray .arena-mode::before {
  content: '';
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: currentColor;
  opacity: .55;
  -webkit-mask: var(--tab-ico) center / contain no-repeat;
  mask: var(--tab-ico) center / contain no-repeat;
}

/* Active tabs paint their icon in the dark ink of the gold pill. */
body #shopUI #tray .ferry-tab.on::before,
body #shopUI #tray .guard-tab.on::before,
body #shopUI #tray .hall-tab.on::before,
body #shopUI #tray .bank-tab.on::before,
body #shopUI #tray .payouts-tab.on::before,
body #shopUI #tray .arena-mode.on::before,
body #shopUI #tray [role='tab'][aria-selected='true']::before { opacity: .8; }

/* One icon per known tab, by its testid. Ferry. */
body #shopUI #tray [data-testid$='-tab-swap']::before      { --tab-ico: url('/tokens/near.svg'); }
body #shopUI #tray [data-testid$='-tab-routes']::before    { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/link-premium.webp'); }
body #shopUI #tray [data-testid$='-tab-rules']::before     { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/file-text-premium.webp'); }
/* Guard. */
body #shopUI #tray [data-testid$='-tab-check']::before     { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/zoom-premium.webp'); }
body #shopUI #tray [data-testid$='-tab-pay']::before       { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/shield-premium.webp'); }
body #shopUI #tray [data-testid$='-tab-blocks']::before    { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/lock-premium.webp'); }
/* Town Hall. */
body #shopUI #tray [data-testid$='-tab-post']::before      { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/file-text-premium.webp'); }
body #shopUI #tray [data-testid$='-tab-agents']::before    { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/chat-bubble-premium.webp'); }
body #shopUI #tray [data-testid$='-tab-receipts']::before  { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/tick-premium.webp'); }
/* Payouts. */
body #shopUI #tray [data-testid$='-tab-invoice']::before   { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/file-text-premium.webp'); }
body #shopUI #tray [data-testid$='-tab-payroll']::before   { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/money-bag-premium.webp'); }
body #shopUI #tray [data-testid$='-tab-csv']::before       { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/card-premium.webp'); }
body #shopUI #tray [data-testid$='-tab-invoices']::before  { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/wallet-premium.webp'); }
/* Arena modes. */
body #shopUI #tray [data-testid$='-mode-mint']::before     { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/shield-premium.webp'); }
body #shopUI #tray [data-testid$='-mode-feed']::before     { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/gift-premium.webp'); }
body #shopUI #tray [data-testid$='-mode-withdraw']::before { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/money-bag-premium.webp'); }
/* Bank. */
body #shopUI #tray [data-testid$='-tab-audit']::before     { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/chart-premium.webp'); }
body #shopUI #tray [data-testid$='-tab-attest']::before    { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/tick-premium.webp'); }
body #shopUI #tray [data-testid$='-tab-log']::before       { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/file-text-premium.webp'); }
/* Toll. */
body #shopUI #tray [data-testid$='-tab-pass']::before      { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/link-premium.webp'); }
body #shopUI #tray [data-testid$='-tab-proof']::before     { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/wallet-premium.webp'); }
body #shopUI #tray [data-testid$='-tab-split']::before     { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/chart-premium.webp'); }
/* House. */
body #shopUI #tray [data-testid$='-tab-deed']::before      { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/file-text-premium.webp'); }
body #shopUI #tray [data-testid$='-tab-vaults']::before    { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/lock-premium.webp'); }
body #shopUI #tray [data-testid$='-tab-heirs']::before     { --tab-ico: url('/design/D2_game/d7/assets/3dicons/192/key-premium.webp'); }

/* The primary CTA carries a leading glyph in the reference. It is a small arrow: the same mark
   on every shop, so the button reads as one control across the town. */
body #shopUI #tray > .t-row > #t-act.primary::before,
body #shopUI #tray #t-form > .primary::before,
body #shopUI #tray #t-form #f-quote::before {
  content: '';
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: url('/design/D2_game/d7/assets/3dicons/192/tick-premium.webp') center / contain no-repeat;
  mask: url('/design/D2_game/d7/assets/3dicons/192/tick-premium.webp') center / contain no-repeat;
}

/* The quote card is always present, as in the reference, and costs 44px. It comes out of the
   swap pane's own rhythm and the redundant token preview, not out of a field. */
body #shopUI #tray #t-form .ferry-picker > .ferry-flow { display: none !important; }
body #shopUI #tray #t-form .ferry-picker { gap: var(--p2) !important; }
body #shopUI #tray #t-form .swap-card { padding: var(--p2) var(--p3); gap: 4px; }
body #shopUI #tray #t-form .swap-quote { padding: var(--p2) var(--p3); gap: 3px; }
body #shopUI #tray #t-form .swap-quote p,
body #shopUI #tray #t-form .swap-quote .ferry-rate { font-size: 11px; line-height: 15px; }
body #shopUI #tray #t-form .swap-quote p + p { padding-top: 3px; }
body #shopUI #tray #t-form .swap-quote-head { font-size: 11px; }
body #shopUI #tray #t-form .ferry-picker > .field { gap: 4px; }

/* ============================================================================================
   20. Review round 3 — the fixes the side-by-sides exposed
   --------------------------------------------------------------------------------------------
   Measured, not guessed:
     - #tray computed padding was 0px (shop-shell.css:55 sets `padding:0 !important`), so the
       header's 48px illustration sat 1px below the panel's top edge and every control looked
       pasted to the border instead of inset by 16px. That single override is the root of the
       "loose pieces" and "illustration overlaps the top edge" complaints.
     - the token pill's label was 70px wide inside a 112px scroll box, so 'wNEAR on near'
       ellipsised to 'M…NEAR…'.
     - the quote card measured 159px wide with 11px text.
   ============================================================================================ */

body #shopUI #tray {
  padding: var(--p4) !important;
}

/* The header row sits INSIDE the padding: illustration on the right, badge and title on the
   left, all on one line, nothing crossing the border. */
body #shopUI #tray > .t-scroll > .t-head { padding-top: 0 !important; margin-top: 0 !important; }
body #shopUI #tray #t-title .panel-art { align-self: center; margin-top: 0; }

/* (a) The token pill: icon, the full name, then a chevron. It must not ellipsis the name.
   The pill is allowed the width the name needs; the amount takes what is left. */
body #shopUI #tray #t-form .swap-line .token-listbox { width: auto !important; min-width: 128px !important; max-width: 56% !important; flex: 0 1 auto !important; }
body #shopUI #tray #t-form .swap-line .token-listbox-btn {
  padding-right: 24px;
  font-size: 12px;
  gap: 5px;
  overflow: visible;
}
body #shopUI #tray #t-form .swap-line .token-listbox-btn .opt-label {
  /* The name is what matters; the chain suffix is the part that may go. */
  min-width: 0;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
/* The chevron, drawn with borders, always visible at the pill's right edge. */
body #shopUI #tray #t-form .swap-line .token-listbox-btn::after {
  content: '';
  position: absolute;
  right: 9px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -4px;
  border-right: 1.5px solid var(--c-muted);
  border-bottom: 1.5px solid var(--c-muted);
  transform: rotate(45deg);
  pointer-events: none;
}

/* (b) One bordered card around pill + amount + Max. The pieces share the row but the card owns
   the border, so it reads as one control, not three loose ones. */
body #shopUI #tray #t-form .swap-card {
  border: 1px solid var(--c-border-soft) !important;
  background: var(--c-well) !important;
  padding: var(--p3) !important;
  gap: var(--p2) !important;
}
body #shopUI #tray #t-form .swap-line {
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-ctrl);
  background: rgba(0, 0, 0, .3);
  padding: 4px 6px;
  gap: 6px;
}
body #shopUI #tray #t-form .swap-line .token-listbox-btn {
  border: 0 !important;
  background: transparent !important;
  padding-left: 4px;
}
body #shopUI #tray #t-form .swap-line .amt-row input {
  border: 0;
  background: transparent;
  text-align: right;
  font-weight: 600;
}

/* (c) The To value shows the estimate once a quote exists and an em dash-free hint before. */
body #shopUI #tray #t-form .swap-est { font-size: 13px; color: var(--c-cream); }
body #shopUI #tray #t-form .swap-est:empty::before { content: '—'; color: var(--c-muted); }

/* (d) The chain row is ONE line: label, a real select with the chain name, then the Live badge. */
body #shopUI #tray #t-form .swap-chain-row {
  display: flex !important;
  align-items: center !important;
  gap: var(--p2) !important;
  flex-wrap: nowrap;
}
body #shopUI #tray #t-form .swap-chain-row > .field { flex: 1 1 auto; min-width: 0; flex-direction: row; align-items: center; gap: var(--p2); }
body #shopUI #tray #t-form .swap-chain-row > .field > span:first-child {
  flex: 0 0 auto; font-size: 12px; color: var(--c-muted); margin: 0;
}
body #shopUI #tray #t-form .swap-chain-row .token-listbox { flex: 1 1 auto; min-width: 0; }
body #shopUI #tray #t-form .swap-chain-row .token-listbox-btn {
  height: 36px; min-height: 36px; font-size: 12px; padding: 0 26px 0 8px; position: relative;
}
body #shopUI #tray #t-form .swap-chain-row .token-listbox-btn::after {
  content: ''; position: absolute; right: 9px; top: 50%; width: 6px; height: 6px; margin-top: -4px;
  border-right: 1.5px solid var(--c-muted); border-bottom: 1.5px solid var(--c-muted);
  transform: rotate(45deg); pointer-events: none;
}
body #shopUI #tray #t-form .swap-live { padding-bottom: 0 !important; flex: 0 0 auto; font-size: 12px; }

/* (e) The quote card is full width with the reference's type size, and says what to do when it
   has no quote rather than showing dashes. */
body #shopUI #tray #t-form .swap-quote {
  width: 100% !important;
  align-self: stretch;
  padding: var(--p3) !important;
  gap: 6px !important;
}
body #shopUI #tray #t-form .swap-quote-head { font-size: 13px !important; }
body #shopUI #tray #t-form .swap-quote p,
body #shopUI #tray #t-form .swap-quote .ferry-rate {
  font-size: 13px !important;
  line-height: 18px !important;
  color: var(--c-cream) !important;
}
body #shopUI #tray #t-form .swap-quote p > span:first-child { color: var(--c-muted); }
body #shopUI #tray #t-form .swap-quote p > span:last-child { color: var(--c-cream); font-weight: 500; }

/* (f) The token search belongs inside the picker; it does not sit in the swap view. */
body #shopUI #tray #t-form .ferry-picker > .field:has(> input#f-find),
body #shopUI #tray #t-form .ferry-picker > label:has(> input#f-find) { display: none !important; }

/* (g) Review swap is the dominant gold action at the reference's size; Sign in is outlined. */
body #shopUI #tray #t-form #f-quote { min-height: 48px !important; height: 48px !important; font-size: 15px !important; }
body #shopUI #tray:has(#t-form #f-quote) > .t-row > #t-act.primary {
  min-height: 44px !important; height: 44px !important;
  background: rgba(0, 0, 0, .24) !important;
  background-image: none !important;
  color: var(--c-cream) !important;
  border: 1px solid var(--c-border) !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}

/* (k) The Guardhouse checklist: 13px at a readable contrast. */
body #shopUI #tray #t-form .guard-status { font-size: 13px !important; line-height: 19px !important; color: var(--c-cream) !important; }
body #shopUI #tray #t-form .guard-check > span:last-child { color: var(--c-cream); }
body #shopUI #tray #t-form .guard-tick { width: 18px; height: 18px; font-size: 11px; }

/* (j) The badge in the Guard header is a badge, not an illustration: it stays inside the row. */
body #shopUI #tray #t-title .panel-badge { margin-top: 0; align-self: center; }

/* (i) The Guardhouse pane was a two-column grid, so the flow strip and the Payee field each got
   171px and the field floated to the right of the icon row. The reference stacks them: the icon
   row full width, then the labelled Payee input full width beneath it, then the example chip,
   then the action. */
body #shopUI #tray #t-form .guard-pane,
body #shopUI #tray #t-form .guard-pane[data-pane='check'] {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
  gap: var(--p3) !important;
  align-items: stretch;
}

body #shopUI #tray #t-form .guard-pane > * {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
}

body #shopUI #tray #t-form .guard-pane .guard-flow {
  width: auto !important;
  align-self: flex-start;
  padding: var(--p2) var(--p3);
  border-radius: var(--r-card);
  background: rgba(0, 0, 0, .22);
  border: 1px solid var(--c-border-soft);
}

body #shopUI #tray #t-form .guard-pane .guard-field { display: flex; flex-direction: column; gap: 6px; }
body #shopUI #tray #t-form .guard-pane .guard-field > span:first-child { font: var(--f-label); font-size: 12px; color: var(--c-cream); }
body #shopUI #tray #t-form .guard-pane .guard-field input { width: 100%; box-sizing: border-box; }

body #shopUI #tray #t-form .guard-pane .example-row { margin: 0; }
body #shopUI #tray #t-form .guard-pane .example-row .example {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  min-height: var(--tap);
  height: auto;
  padding: var(--p2) var(--p3);
  border-radius: var(--r-card);
  border: 1px solid var(--c-border-soft) !important;
  background: rgba(0, 0, 0, .2) !important;
  color: var(--c-muted) !important;
  font: var(--f-small) !important;
  font-size: 12px !important;
}

body #shopUI #tray #t-form .guard-pane #g-check {
  width: 100% !important;
  min-width: 100% !important;
  background: linear-gradient(180deg, var(--c-gold-1) 0%, var(--c-gold-2) 100%) !important;
  color: var(--c-ink) !important;
  border: 0 !important;
  font: var(--f-cta) !important;
  font-weight: 600 !important;
  min-height: 44px !important;
  height: 44px !important;
  border-radius: var(--r-cta) !important;
  box-shadow: 0 6px 18px rgba(226, 168, 60, .22) !important;
}

/* Guard Pay safely holds five fields and a checklist: 90px over one screen at 1440. The short
   pairs share a row — the same fields, same ids, two-up — and the checklist keeps its 13px. */
@media (min-width: 721px) {
  body #shopUI #tray #t-form .guard-pane[data-pane='pay'],
  body #shopUI #tray #t-form .guard-pane[data-pane='check'] {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: var(--p2) var(--p3) !important;
    align-items: start;
  }
  /* The icon row, the example chip, the action and the checklist always span the panel. */
  body #shopUI #tray #t-form .guard-pane > .guard-flow,
  body #shopUI #tray #t-form .guard-pane > .example-row,
  body #shopUI #tray #t-form .guard-pane > .guard-actions,
  body #shopUI #tray #t-form .guard-pane > .guard-status,
  body #shopUI #tray #t-form .guard-pane > #g-check { grid-column: 1 / -1; }
  body #shopUI #tray #t-form .guard-pane > .guard-field { min-width: 0; }
}

/* ============================================================================================
   21. Per-shop CTA glyphs, Arena's gold secondary, and the reference tab pills
   --------------------------------------------------------------------------------------------
   One check mark on all nine buttons reads as a placeholder. Each shop's action now carries its
   own symbol from the icon set, keyed off the panel's own body class.
   ============================================================================================ */

body #shopUI #tray > .t-row > #t-act.primary::before,
body #shopUI #tray #t-form > .primary::before,
body #shopUI #tray #t-form #f-quote::before,
body #shopUI #tray #t-form #g-check::before {
  content: '';
  flex: 0 0 auto;
  width: 16px; height: 16px;
  background: currentColor;
  -webkit-mask: var(--cta-ico, url('/design/D2_game/d7/assets/3dicons/192/tick-premium.webp')) center / contain no-repeat;
  mask: var(--cta-ico, url('/design/D2_game/d7/assets/3dicons/192/tick-premium.webp')) center / contain no-repeat;
}

/* Ferry: the swap mark. */
body.ferry-tray #shopUI #tray #t-form #f-quote::before { --cta-ico: url('/design/D2_game/d7/assets/3dicons/192/flash-premium.webp'); }
/* Guard: the shield that checked the payee. */
body.guard-tray #shopUI #tray #t-form #g-check::before { --cta-ico: url('/design/D2_game/d7/assets/3dicons/192/shield-premium.webp'); }
/* Town Hall: the scroll it posts. */
body.hall-tray #shopUI #tray > .t-row > #t-act.primary::before,
body.hall-tray #shopUI #tray #t-form > .primary::before { --cta-ico: url('/design/D2_game/d7/assets/3dicons/192/file-text-premium.webp'); }
/* Payouts: the invoice. */
body.payouts-tray #shopUI #tray > .t-row > #t-act.primary::before,
body.payouts-tray #shopUI #tray #t-form > .primary::before { --cta-ico: url('/design/D2_game/d7/assets/3dicons/192/card-premium.webp'); }
/* Arena: the guardian's shield. */
body.arena-tray #shopUI #tray > .t-row > #t-act.primary::before,
body.arena-tray #shopUI #tray #t-form > .primary::before { --cta-ico: url('/design/D2_game/d7/assets/3dicons/192/shield-premium.webp'); }
/* Bank: the audit chart. */
body.bank-tray #shopUI #tray > .t-row > #t-act.primary::before,
body.bank-tray #shopUI #tray #t-form > .primary::before { --cta-ico: url('/design/D2_game/d7/assets/3dicons/192/chart-premium.webp'); }
/* Toll: the crossing. */
body.toll-tray #shopUI #tray > .t-row > #t-act.primary::before,
body.toll-tray #shopUI #tray #t-form > .primary::before { --cta-ico: url('/design/D2_game/d7/assets/3dicons/192/link-premium.webp'); }
/* House: the key to it. */
body.house-tray #shopUI #tray > .t-row > #t-act.primary::before,
body.house-tray #shopUI #tray #t-form > .primary::before { --cta-ico: url('/design/D2_game/d7/assets/3dicons/192/key-premium.webp'); }
/* Chronicle: the record. */
body.chronicle-tray #shopUI #tray > .t-row > #t-act.primary::before,
body.chronicle-tray #shopUI #tray #t-form > .primary::before { --cta-ico: url('/design/D2_game/d7/assets/3dicons/192/explorer-premium.webp'); }

/* Arena Guardians keeps ONE gold primary (the create action) and gets the reference's gold
   SECONDARY: the Mint/Feed/Withdraw row is an outlined segmented control with the selected one
   in a gold tint, not a second solid gold button. */
body.arena-tray #shopUI #tray #t-form .arena-modes {
  display: grid !important;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--p2) !important;
  padding: 4px;
  border-radius: var(--r-card);
  background: rgba(0, 0, 0, .2);
  border: 1px solid var(--c-border-soft);
  box-sizing: border-box;
}
body.arena-tray #shopUI #tray #t-form .arena-mode {
  min-height: 36px !important;
  height: 36px !important;
  border-radius: var(--r-ctrl) !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  background-image: none !important;
  color: var(--c-muted) !important;
  font: var(--f-label) !important;
  font-size: 12px !important;
}
body.arena-tray #shopUI #tray #t-form .arena-mode[aria-pressed='true'],
body.arena-tray #shopUI #tray #t-form .arena-mode.on {
  background: rgba(226, 168, 60, .18) !important;
  border-color: var(--c-gold-2) !important;
  color: var(--c-gold-1) !important;
  font-weight: 600 !important;
}

/* Tabs: the reference's pills — icon plus label, solid gold when active, dark with a visible
   border when not. */
body #shopUI #tray .ferry-tab,
body #shopUI #tray .guard-tab,
body #shopUI #tray .hall-tab,
body #shopUI #tray .bank-tab,
body #shopUI #tray .house-tab,
body #shopUI #tray .payouts-tab,
body #shopUI #tray .chronicle-tab,
body #shopUI #tray .toll-tab,
body #shopUI #tray [role='tablist'] > button {
  border: 1px solid var(--c-border) !important;
  background: rgba(0, 0, 0, .28) !important;
  color: var(--c-cream) !important;
  border-radius: var(--r-pill) !important;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}

body #shopUI #tray .ferry-tab.on,
body #shopUI #tray .guard-tab.on,
body #shopUI #tray .hall-tab.on,
body #shopUI #tray .bank-tab.on,
body #shopUI #tray .house-tab.on,
body #shopUI #tray .payouts-tab.on,
body #shopUI #tray .chronicle-tab.on,
body #shopUI #tray .toll-tab.on,
body #shopUI #tray [role='tab'][aria-selected='true'],
body #shopUI #tray [role='tablist'] > button[aria-selected='true'] {
  background: linear-gradient(180deg, var(--c-gold-1) 0%, var(--c-gold-2) 100%) !important;
  border-color: transparent !important;
  color: var(--c-ink) !important;
  font-weight: 600;
}

/* (i) cont. The pay pane also had to become one column of full-width fields; the grid above only
   matched the check pane's data-pane value. Full width for the payee, whatever the pane. */
body #shopUI #tray #t-form .guard-pane .guard-field,
body #shopUI #tray #t-form .guard-pane .guard-field input,
body #shopUI #tray #t-form .guard-pane #g-acct {
  width: 100% !important;
  min-width: 100% !important;
  box-sizing: border-box;
}

/* (f) cont. The token search is part of the picker, not the swap view. Hiding its row by the
   input's own id, with and without the :has() support, so it cannot leak back in. */
body #shopUI #tray #t-form #f-find { display: none !important; }
body #shopUI #tray #t-form label:has(#f-find),
body #shopUI #tray #t-form .field:has(#f-find),
body #shopUI #tray #t-form .ferry-field:has(#f-find) { display: none !important; }

/* The review action is the reference's 48px dominant button. */
body #shopUI #tray #t-form #f-quote { min-height: 48px !important; height: 48px !important; }

@media (max-width: 720px) {
  /* The illustration stays >= 48px on a phone too: it is the header's own picture. */
  body #shopUI #tray #t-title .panel-art { width: 48px !important; height: 48px !important; }
}

/* On a phone the pill and the amount share a narrower row, so the pill's name was still being
   ellipsised. The pill keeps enough width for the name and the chain suffix is what gives way:
   the name is short enough to survive at this size. */
@media (max-width: 720px) {
  body #shopUI #tray #t-form .swap-line { gap: 4px; padding: 4px; }
  body #shopUI #tray #t-form .swap-line .token-listbox { min-width: 104px !important; max-width: 48% !important; }
  body #shopUI #tray #t-form .swap-line .token-listbox-btn { padding: 0 20px 0 4px; gap: 4px; font-size: 11px; }
  body #shopUI #tray #t-form .swap-line .token-listbox-btn .opt-label { font-size: 11px; }
  body #shopUI #tray #t-form .swap-line .token-listbox-btn .tic { width: 18px; height: 18px; }
  body #shopUI #tray #t-form .swap-line .swap-max { padding: 0 8px !important; }
  body #shopUI #tray #t-form .swap-line .amt-row input { min-width: 28px; }
}

/* (e) cont. Before a quote exists the card tells the visitor what to do. The empty state is a
   real line with the reference's words, not a row of dashes. */
body #shopUI #tray #t-form .swap-quote[data-empty='1'] p[data-testid='swap-row-rate'] > span:last-child { color: var(--c-muted); font-weight: 400; }

/* The swap line's accessible label must be off-flow. Inside a flex row it took a slot and its
   text sat under the pill. */
body #shopUI #tray #t-form .swap-line > .sr-only,
body #shopUI #tray #t-form .swap-line > .sr-only * {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
}

/* The Guardhouse pay pane is a grid, and a grid cell's min-width is auto: the Payee field
   refused to fill its column. It spans the row instead, which is what the reference shows. */
body #shopUI #tray #t-form .guard-pane[data-pane='pay'] > .guard-field,
body #shopUI #tray #t-form .guard-pane[data-pane='pay'] > label,
body #shopUI #tray #t-form .guard-pane > .guard-field:has(#g-acct),
body #shopUI #tray #t-form .guard-pane label:has(#g-acct) {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-width: 0 !important;
}
body #shopUI #tray #t-form .guard-pane #g-acct { width: 100% !important; min-width: 0 !important; }

/* Only the Payee needs the full row. The short fields after it pair two-up, as the reference
   does for Chain/Asset and Amount/Gas, which is what brings the pay pane back inside the panel. */
body #shopUI #tray #t-form .guard-pane[data-pane='pay'] > .guard-field { grid-column: auto !important; }
body #shopUI #tray #t-form .guard-pane[data-pane='pay'] > .guard-field:has(#g-acct) { grid-column: 1 / -1 !important; }
body #shopUI #tray #t-form .guard-pane[data-pane='pay'] > .guard-split { grid-column: 1 / -1 !important; }
body #shopUI #tray #t-form .guard-pane[data-pane='pay'] > .guard-field { min-width: 0 !important; }
body #shopUI #tray #t-form .guard-pane[data-pane='pay'] > .guard-field input,
body #shopUI #tray #t-form .guard-pane[data-pane='pay'] > .guard-field select { width: 100% !important; min-width: 0 !important; }
/* The tall field (a textarea or a long input) keeps its own row. */
body #shopUI #tray #t-form .guard-pane[data-pane='pay'] > .guard-field:has(textarea) { grid-column: 1 / -1 !important; }

/* The header row's alignment: the illustration was 4px above the header box because the title's
   line-height (48px) exceeded the badge's 44px. Centre every child on the row. */
body #shopUI #tray > .t-scroll > .t-head { align-items: center !important; }
body #shopUI #tray > .t-scroll > .t-head #t-title { align-items: center !important; height: auto !important; }
body #shopUI #tray #t-title .panel-art { align-self: center !important; margin-top: 0 !important; }

/* Two short guard fields share one row; the tall one (a textarea or the payee) keeps its own. */
body #shopUI #tray #t-form .guard-pane[data-pane='pay'] > .guard-field:not(:has(#g-acct)):not(:has(textarea)) {
  grid-column: auto !important;
}
/* A field immediately followed by another short field pairs with it. */
body #shopUI #tray #t-form .guard-pane[data-pane='pay'] > .guard-field + .guard-field {
  grid-column: auto !important;
}

/* The Bank's tabs are .bank-tab and my tab rule listed it, but the Bank sheet sets its own
   border to none with higher weight. Every inactive tab carries a visible border. */
body #shopUI #tray #t-form .bank-tabs > .bank-tab,
body #shopUI #tray .bank-tabs > .bank-tab {
  border: 1px solid var(--c-border) !important;
  background: rgba(0, 0, 0, .28) !important;
  border-radius: var(--r-pill) !important;
  color: var(--c-cream) !important;
}
body #shopUI #tray #t-form .bank-tabs > .bank-tab.on,
body #shopUI #tray .bank-tabs > .bank-tab.on {
  background: linear-gradient(180deg, var(--c-gold-1) 0%, var(--c-gold-2) 100%) !important;
  border-color: transparent !important;
  color: var(--c-ink) !important;
}

/* The header row holds its children on one line: the illustration never sits above it. */
body #shopUI #tray > .t-scroll > .t-head,
body #shopUI #tray > .t-scroll > .t-head #t-title {
  align-items: center !important;
  height: auto !important;
  min-height: 48px;
}
body #shopUI #tray > .t-scroll > .t-head #t-title .panel-art { position: static !important; }

/* Payouts Payroll and House heirs: their own lists pushed the last block over the action row.
   The list scrolls inside itself, capped so the pane cannot grow past the panel. */
body #shopUI #tray #t-form .plist { max-height: 176px; overflow-y: auto; overscroll-behavior: contain; }
body #shopUI #tray #t-form .payout-row .field { min-width: 0; }

/* A row inside a capped list must be shorter than the cap, or its last field paints past the
   list's bottom edge and lands on whatever follows. The payroll row is one 62px field plus a
   36px split; the heirs pane's note is clamped. Both now fit inside their own box. */
body #shopUI #tray #t-form .plist li.payout-row {
  padding: 6px 0 !important;
  box-sizing: border-box;
}
body #shopUI #tray #t-form .plist .payout-split { margin-top: 5px !important; }
body #shopUI #tray #t-form .plist li.payout-row .field { gap: 3px !important; }
body #shopUI #tray #t-form .plist li.payout-row .field > span:first-child { font-size: 10px !important; line-height: 12px !important; }
body #shopUI #tray #t-form .plist li.payout-row input,
body #shopUI #tray #t-form .plist li.payout-row select { min-height: 32px !important; height: 32px !important; }

/* The heirs pane's explanatory note: two lines maximum, so the pane's last block stays inside. */
body #shopUI #tray #t-form .ferry-pane[data-panel='heirs'] .note,
body #shopUI #tray #t-form .ferry-pane[data-panel='heirs'] p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-size: 11px;
  line-height: 15px;
}

/* House heirs: four short readonly fields plus a 2x2 pair in one column came to 88px over the
   panel. The pane is a two-column grid, the pair and the flow keep the full width, and the
   explanatory note below is clamped to two lines. Same fields, same ids. */
body #shopUI #tray #t-form .ferry-pane[data-panel='heirs'] {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: var(--p2) var(--p3) !important;
  align-items: start;
}
body #shopUI #tray #t-form .ferry-pane[data-panel='heirs'] > .ferry-flow,
body #shopUI #tray #t-form .ferry-pane[data-panel='heirs'] > .house-pair { grid-column: 1 / -1 !important; }
body #shopUI #tray #t-form .ferry-pane[data-panel='heirs'] > .field { min-width: 0 !important; }
body #shopUI #tray #t-form .ferry-pane[data-panel='heirs'] > .field input { width: 100% !important; min-width: 0 !important; }

/* The house pair is itself a 2x2 grid: tighten it so the whole pane fits. */
body #shopUI #tray #t-form .ferry-pane[data-panel='heirs'] .house-pair { gap: 6px var(--p3) !important; }
body #shopUI #tray #t-form .ferry-pane[data-panel='heirs'] .house-pair > .field { gap: 3px !important; }
body #shopUI #tray #t-form .ferry-pane[data-panel='heirs'] .house-pair > .field > span:first-child { font-size: 11px !important; line-height: 13px !important; }
body #shopUI #tray #t-form .ferry-pane[data-panel='heirs'] .house-pair input { min-height: 34px !important; height: 34px !important; }

/* The heirs compaction above is scoped to that pane; Deed and Vaults keep the roomy pair they
   had. Their own pairs are restored here so nothing leaks between panes. */
body #shopUI #tray #t-form .ferry-pane[data-panel='deed'] .house-pair,
body #shopUI #tray #t-form .ferry-pane[data-panel='vaults'] .house-pair {
  gap: var(--p2) var(--p3) !important;
}
body #shopUI #tray #t-form .ferry-pane[data-panel='deed'] .house-pair > .field,
body #shopUI #tray #t-form .ferry-pane[data-panel='vaults'] .house-pair > .field { gap: 6px !important; }
body #shopUI #tray #t-form .ferry-pane[data-panel='deed'] .house-pair input,
body #shopUI #tray #t-form .ferry-pane[data-panel='vaults'] .house-pair input { height: var(--h-field) !important; min-height: var(--h-field) !important; }

/* Deed and Vaults were tight even before this pass; they pair their short fields too. */
body #shopUI #tray #t-form .ferry-pane[data-panel='deed'] > .field + .field,
body #shopUI #tray #t-form .ferry-pane[data-panel='vaults'] > .field + .field { margin-top: 0; }

/* Deed and Vaults get the same two-column treatment as heirs, and the deed's metadata block —
   four lines of contract description — is clamped, because it was the tall block that pushed the
   action out of the panel. The full text stays in the DOM. */
body #shopUI #tray #t-form .ferry-pane[data-panel='deed'],
body #shopUI #tray #t-form .ferry-pane[data-panel='vaults'] {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: var(--p2) var(--p3) !important;
  align-items: start;
}
body #shopUI #tray #t-form .ferry-pane[data-panel='deed'] > .ferry-flow,
body #shopUI #tray #t-form .ferry-pane[data-panel='vaults'] > .ferry-flow,
body #shopUI #tray #t-form .ferry-pane[data-panel='deed'] > .house-pair,
body #shopUI #tray #t-form .ferry-pane[data-panel='vaults'] > .house-pair,
body #shopUI #tray #t-form .ferry-pane[data-panel='deed'] > [data-testid='deed-meta'] { grid-column: 1 / -1 !important; }
body #shopUI #tray #t-form .ferry-pane[data-panel='deed'] > .field,
body #shopUI #tray #t-form .ferry-pane[data-panel='vaults'] > .field { min-width: 0 !important; }
body #shopUI #tray #t-form .ferry-pane[data-panel='deed'] > .field input,
body #shopUI #tray #t-form .ferry-pane[data-panel='vaults'] > .field input { width: 100% !important; min-width: 0 !important; }

/* The deed's metadata: the name and contract are enough at a glance; the description clamps. */
body #shopUI #tray #t-form [data-testid='deed-meta'] { margin: 0; }
body #shopUI #tray #t-form [data-testid='deed-meta'] p { margin: 0 0 2px; font-size: 11px; line-height: 15px; }
body #shopUI #tray #t-form [data-testid='deed-meta'] p:last-child {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
body #shopUI #tray #t-form [data-testid='deed-meta'] .deed-mint a { margin-top: 4px; }

/* ============================================================================================
   22. THE HIDDEN GUARD — the one rule this file kept forgetting
   --------------------------------------------------------------------------------------------
   Three times now a layout rule in this file set `display` with !important on a pane and beat
   the `hidden` attribute, so a hidden pane painted on top of the visible one. This is the last
   rule in the file and the most specific, so nothing above it can win:
       [data-pane][hidden]  and  [data-panel][hidden]  and any [hidden] inside the panel.
   A hidden element is not rendered. That is a fact about the document, not a style choice.
   ============================================================================================ */

body #shopUI #tray [hidden],
body #shopUI #tray [data-pane][hidden],
body #shopUI #tray [data-panel][hidden],
body #shopUI #tray .ferry-pane[hidden],
body #shopUI #tray .guard-pane[hidden],
body #shopUI #tray #t-form [hidden],
body #shopUI #tray #t-form > *[hidden],
body #shopUI #tray #t-form .ferry-pane[data-panel][hidden] {
  display: none !important;
}

/* Payouts Payroll: "Add a row" sat at y=486 while the row's own content ran to 525, because the
   button and the list are siblings inside the pane with no separation and the list's last row
   extended past it. The list and the button are now separate blocks with a real gap. */
body #shopUI #tray #t-form .plist { margin: 0 0 var(--p3) !important; }
body #shopUI #tray #t-form #p-add { position: static !important; margin: 0 0 var(--p2) !important; }
body #shopUI #tray #t-form [data-testid='payout-add-note'] { margin: 0 0 var(--p2) !important; }

/* A list never paints over its own next sibling: the cap is the list's, and the row inside it is
   always shorter than the cap. */
body #shopUI #tray #t-form .plist li.payout-row { min-height: 0; }
body #shopUI #tray #t-form .plist li.payout-row .payout-split { margin-bottom: 0; }

/* The Payroll pane carried nine hardcoded grid rows (80/40/42/44/8/80/44/44/28) that no longer
   matched its children after this pass, so the list and "Add a row" were placed in overlapping
   rows. The pane sizes its own rows from its content, which is what a grid is for. */
body #shopUI #tray #t-form .ferry-pane[data-pane='payroll'] {
  grid-auto-rows: auto !important;
  grid-template-rows: none !important;
  align-items: start;
  gap: var(--p2) !important;
}
body #shopUI #tray #t-form .ferry-pane[data-pane='payroll'] > .plist { align-self: start; }
body #shopUI #tray #t-form .ferry-pane[data-pane='payroll'] > #p-add { align-self: start; }

/* With the row compact, the list no longer needs its own cap: it is as tall as the rows it
   holds, and the pane's grid places every sibling below it. A scroll area inside a scrolling
   panel was the last thing making the list and the button disagree. */
body #shopUI #tray #t-form .ferry-pane[data-pane='payroll'] > .plist {
  max-height: none !important;
  overflow: visible !important;
  height: auto !important;
}

/* Payroll holds six blocks: flow, status, the row list, Add a row, the paste field, and the two
   actions. Compacting the paste field and the two actions is what brings it inside the panel at
   1440 without hiding anything. */
body #shopUI #tray #t-form .ferry-pane[data-pane='payroll'] > #p-csv {
  min-height: 40px !important;
  height: 40px !important;
  padding: 8px var(--p3) !important;
  font-size: 12px !important;
  line-height: 16px !important;
}
body #shopUI #tray #t-form .ferry-pane[data-pane='payroll'] > .field { gap: 3px !important; }
body #shopUI #tray #t-form .ferry-pane[data-pane='payroll'] > .field > span:first-child { font-size: 11px !important; line-height: 13px !important; }
body #shopUI #tray #t-form .ferry-pane[data-pane='payroll'] > button {
  min-height: 40px !important;
  height: 40px !important;
  font-size: 13px !important;
}
body #shopUI #tray #t-form .ferry-pane[data-pane='payroll'] > [data-testid='payout-status'] {
  padding: 0 !important;
  font-size: 11px !important;
  line-height: 15px !important;
}
body #shopUI #tray #t-form .ferry-pane[data-pane='payroll'] > .ferry-flow { padding: var(--p2) !important; }

/* The Payroll pane's own last button ran 27px past the pane's bottom. The 80px flow strip is the
   block to take it from: it is a summary, not a control, and the reference's strips are ~56px. */
body #shopUI #tray #t-form .ferry-pane[data-pane='payroll'] > .ferry-flow,
body #shopUI #tray #t-form .ferry-pane[data-pane='payroll'] > [data-testid='payout-flow'] {
  padding: 6px var(--p3) !important;
  min-height: 0 !important;
  height: auto !important;
  gap: 6px !important;
}
body #shopUI #tray #t-form .ferry-pane[data-pane='payroll'] > .ferry-flow img,
body #shopUI #tray #t-form .ferry-pane[data-pane='payroll'] > [data-testid='payout-flow'] img {
  width: 18px !important; height: 18px !important;
}
body #shopUI #tray #t-form .ferry-pane[data-pane='payroll'] > .ferry-flow .flow-cap { font-size: 10px !important; }

/* ============================================================================================
   23. Round 4 — the seven ferry items, from the native-size render
   ============================================================================================ */

/* (1) The amount needs real width: pill ~40%, amount fills, then Max. The duplicate unit after
   Max goes: the pill already says which token it is. */
body #shopUI #tray #t-form .swap-line .token-listbox {
  flex: 0 0 40% !important;
  width: 40% !important;
  min-width: 0 !important;
  max-width: 40% !important;
}
body #shopUI #tray #t-form .swap-line .amt-row {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  gap: 6px !important;
  justify-content: flex-end;
}
body #shopUI #tray #t-form .swap-line .amt-row input {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 44px !important;
  max-width: none !important;
  text-align: right;
}
/* The trailing "wNEAR" inside the amount row duplicates the pill. */
body #shopUI #tray #t-form .swap-line .amt-row .amt-sym { display: none !important; }
/* The To side keeps its estimate but not a second unit chip. */
body #shopUI #tray #t-form .swap-line .amt-row .swap-est { display: inline !important; }

/* (2) The chain row is ONE wide select with the Live badge at the far right. */
body #shopUI #tray #t-form .swap-chain-row {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: var(--p2) !important;
}
body #shopUI #tray #t-form .swap-chain-row > .field {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
}
body #shopUI #tray #t-form .swap-chain-row > .field > span:first-child {
  flex: 0 0 auto !important;
  font-size: 12px !important;
  color: var(--c-muted) !important;
}
body #shopUI #tray #t-form .swap-chain-row .token-listbox {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
}
body #shopUI #tray #t-form .swap-chain-row .token-listbox-btn {
  width: 100% !important;
  height: 36px !important;
  min-height: 36px !important;
  position: relative;
  padding: 0 26px 0 8px !important;
  font-size: 12px !important;
}
body #shopUI #tray #t-form .swap-chain-row .swap-live { margin-left: auto !important; flex: 0 0 auto !important; }

/* (3) Before a quote the To value is a muted 0.00, not an em dash. */
body #shopUI #tray #t-form .swap-est:empty::before { content: '0.00'; color: var(--c-muted); opacity: .75; }

/* (4) A 16px gap above Review swap, a richer gradient, 48px tall. */
body #shopUI #tray #t-form #f-quote {
  margin-top: var(--p4) !important;
  min-height: 48px !important;
  height: 48px !important;
  background: linear-gradient(180deg, #ffb54a 0%, #e2831f 100%) !important;
  background-image: linear-gradient(180deg, #ffb54a 0%, #e2831f 100%) !important;
  color: #2a1a0e !important;
  border: 0 !important;
  border-radius: var(--r-cta) !important;
  box-shadow: 0 8px 22px rgba(226, 131, 31, .28) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
}

/* (5) Quote rows: an icon in the header and 8px between rows. */
body #shopUI #tray #t-form .swap-quote { padding: var(--p3) !important; gap: var(--p2) !important; }
body #shopUI #tray #t-form .swap-quote-head {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 13px !important;
  padding-bottom: 2px;
}
body #shopUI #tray #t-form .swap-quote-head::before {
  content: '';
  width: 14px; height: 14px;
  flex: 0 0 auto;
  background: currentColor;
  opacity: .8;
  -webkit-mask: url('/design/D2_game/d7/assets/3dicons/192/bulb-premium.webp') center / contain no-repeat;
  mask: url('/design/D2_game/d7/assets/3dicons/192/bulb-premium.webp') center / contain no-repeat;
}
body #shopUI #tray #t-form .swap-quote-head > span:first-child { flex: 1 1 auto; text-align: left; }
body #shopUI #tray #t-form .swap-quote p,
body #shopUI #tray #t-form .swap-quote .ferry-rate {
  display: flex !important;
  justify-content: space-between !important;
  gap: var(--p2) !important;
  margin: 0 !important;
  padding: 0 !important;
  border-top: 0 !important;
  font-size: 12px !important;
  line-height: 16px !important;
}
/* A real 8px between consecutive rows, not a hairline. */
body #shopUI #tray #t-form .swap-quote p + p { margin-top: var(--p2) !important; }
/* The Best route pill is a pill, not plain text. */
body #shopUI #tray #t-form .swap-best {
  padding: 2px 8px !important;
  border-radius: var(--r-pill) !important;
  background: rgba(226, 168, 60, .18) !important;
  border: 1px solid var(--c-gold-2) !important;
  color: var(--c-gold-1) !important;
  font-size: 11px !important;
  white-space: nowrap;
}

/* (6) The "mainnet quote" text beside the header icon is clutter: keep the dot, drop the words. */
body #shopUI #tray > .t-scroll > .t-head #t-src {
  font-size: 0 !important;
  width: 8px !important;
  height: 8px !important;
  padding: 0 !important;
  overflow: hidden;
  flex: 0 0 auto;
}
body #shopUI #tray > .t-scroll > .t-head #t-src::before { width: 8px; height: 8px; }

/* (7) The flip button sits ON the seam between the two cards. */
body #shopUI #tray #t-form .swap-flip {
  margin: calc(-1 * var(--p3) - 12px) auto !important;
  position: relative;
  z-index: 3;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .5);
}

/* The reference's own increments: 8px between the quote rows, 16px from the quote card to the
   action. Measured before this they were 16 and 24 — comfortable, but not the reference. */
body #shopUI #tray #t-form .swap-quote p + p { margin-top: var(--p2) !important; }
body #shopUI #tray #t-form #f-quote { margin-top: var(--p4) !important; }
body #shopUI #tray #t-form .swap-quote { gap: 0 !important; }
body #shopUI #tray #t-form .swap-quote-head { padding-bottom: var(--p2) !important; }

/* The pane's own 8px gap added to the CTA's 16px margin, giving 24. The 16 is the reference's
   number, so the gap before the action is zeroed and the margin does the whole job. */
body #shopUI #tray #t-form #f-quote { margin-top: var(--p4) !important; }
body #shopUI #tray #t-form > #f-quote,
body #shopUI #tray #t-form .ferry-picker > #f-quote { margin-block-start: calc(var(--p4) - var(--p2)) !important; }

/* Guard Pay: the checklist's last line met the action row in the native mount, where the panel
   has no 3D room behind it and sits a few pixels higher. The pane and the action need a real
   gap, not an accident of margins. */
body #shopUI #tray #t-form .guard-pane[data-pane='pay'] { padding-bottom: var(--p2) !important; }
body #shopUI #tray > .t-row { margin-top: var(--p4) !important; }
body #shopUI #tray #t-form .guard-pane > .guard-status { margin-bottom: 0 !important; }

/* THE GUARD, take four. `.guard-pane[data-pane='pay']{display:grid!important}` is more specific
   than a bare `[hidden]`, so the hidden check pane kept painting at 354px and its content met the
   action row. This matches on the same attributes AND the attribute selector, which wins: */
body #shopUI #tray #t-form .guard-pane[data-pane][hidden],
body #shopUI #tray #t-form .guard-pane[data-pane='check'][hidden],
body #shopUI #tray #t-form .guard-pane[data-pane='pay'][hidden],
body #shopUI #tray #t-form .guard-pane[data-pane='blocks'][hidden],
body #shopUI #tray > .t-scroll > .shop-quest[hidden] {
  display: none !important;
  visibility: hidden !important;
}

/* Hall Agents: its status line met the action row in the native mount. The pane and the action
   need a real gap, the same 16px the reference uses before a CTA. */
body #shopUI #tray #t-form .hall-pane,
body #shopUI #tray #t-form .hall-card { padding-bottom: 0 !important; }
body #shopUI #tray #t-form .hall-pane > .hall-status:last-child { margin-bottom: 0 !important; }
body #shopUI #tray > .t-row { margin-top: var(--p4) !important; }

/* F48 (film 2026-11-12): in a shop the menu sat at z 21, under the room's #fade (z 30, which
   takes pointer events while it is on). On a slow frame the fade lingers after the room opens,
   and every press on All shops landed on the fade. Above it once the entry is done; still below
   #shopMenu (35) and every modal. */
body.in-shop:not(.entering) nav.all-shops { z-index: 31; }
