/* ============================================================================
   HyperGrowth markets — integrity layer
   ----------------------------------------------------------------------------
   Layout and state guards for /markets on every viewport. This file fixes how
   existing surfaces are laid out and how existing states are shown. It never
   changes market values, order / signing / funding logic, or legal copy.

     1. Chart box      the price chart always has a definite box and is never cut
     2. Order book     the book always shows its rows, or says that it is empty
     3. Fixed chrome   docks, drawers and footer links never cover market content
     4. List grid      rows hug their cards
     5. List states    loading, load failure, view-only, delayed prices
     6. Focus          keyboard focus is always visible
     7. Countdown      unit letters follow the countdown's scale
     8. Hidden         a hidden panel draws nothing
     9. Trade path     the trade button, book and ticket stay reachable on
                       every width; the ticket says when trading is off
    10. History chart  the chance line, its axes, caption and hover card
                       (chance-history-chart.js); its range and scale bar is
                       not shown since 2026-11-17
    11. Rules sheet    a plain lead sentence; text in the theme's own ink
    12. Site menu      phones and tablets reach languages, Docs, legal links
                       and the colour themes from the top bar
    13. Outcomes       a market with several outcomes: a row per outcome
                       under the chart, YES / NO in its brand colour, every
                       leading outcome's line; desktop scrolls to the rows
    14. Phones         one type scale, no trade dock, a full-screen ticket

   Load order: after markets-heavy.css and before mobile-reading.css, which
   stays the last link. Every rule here is prefixed with html[data-hg-theme] so
   it wins by selector weight, not by position. Phone type and tap-target sizes
   stay with mobile-reading.css; material and colour stay with markets-heavy.css.
   ========================================================================== */

/* ── 1. Chart box ───────────────────────────────────────────────────────────
   .pm-chart-wrap holds an in-flow presentation bar (scale toggle + status) and
   the chart SVG. The SVG was sized to 100% of the wrap, so it always overflowed
   the wrap by the height of that bar: clipped at the bottom on desktop, and on
   phones — where the wrap has no definite height — a feedback loop. The chart
   script copies the SVG's measured box into its viewBox on every frame, the
   viewBox sets the SVG's intrinsic height, and the auto-height wrap grew by the
   bar's height per frame (about 3,300 px a second on a phone).
   A column layout gives the SVG only the space left under the bar, so its box
   is derived from the wrap and never from its own viewBox. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-detail-shell .pm-chart-wrap {
  display: flex !important;
  flex-direction: column !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-detail-shell .pm-chart-wrap > .hg-chart-presentation {
  flex: 0 0 auto !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-detail-shell .pm-chart-wrap > #priceChart {
  flex: 1 1 0 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

@media (max-width: 760px) {
  /* Phones scroll the document, so nothing above the wrap bounds it. Give the
     wrap its own definite height: tall enough to read a trend, short enough
     that the title, the chance and the trade dock stay on the first screen. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-detail-shell[data-experience] .pm-chart-wrap {
    height: clamp(228px, 38svh, 340px) !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: auto !important;
  }
}

@media (min-width: 1100px) {
  /* Desktop. The chart panel's rows are title / chart / (empty) / spare, split
     1.618 : 0.382, and both the chart row and the chart box carried a hard
     floor (280px, then 38vh). On a laptop-height window, or when an outcome
     rail sits above the panel, the floor was taller than the space that was
     left, and the panel cut the bottom of the chart off — up to half of it on
     multi-outcome markets.
     The floor is now soft. The chart keeps its 1.618 share; when that share is
     under the floor it grows into the spare row, and it stops at the space
     that exists. 123.6% of the chart row is the chart row plus the spare row
     (0.382 / 1.618 = 23.6%). Sports match pages size their chart separately. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page:not(.hg-sports-context-visible) .pm-detail-view .pm-detail-shell[class] .pm-chart-panel[class] {
    grid-template-rows: auto minmax(0, 1.618fr) auto minmax(0, 0.382fr) !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page:not(.hg-sports-context-visible) .pm-detail-view .pm-detail-shell[class] .pm-chart-wrap[class] {
    align-self: start !important;
    height: max(100%, min(clamp(280px, 38vh, 520px), 123.6%)) !important;
    min-height: 0 !important;
    max-height: none !important;
  }
}

/* ── 2. Order book ──────────────────────────────────────────────────────────
   The asks and bids bodies were built to share a fixed panel height
   (flex: 1 1 0 with hidden overflow). Below desktop width the panel is not
   given one — phones scroll the document, and the 761–1099px shell handed the
   chart every spare pixel — so both bodies collapsed to zero and only the
   "Price / Shares / Total" header was left on screen.
   In those layouts the book is sized by its rows instead, and the number of
   levels a side is declared here as --pm-book-levels. The script reads that
   declaration (visibleBookLevelCount) rather than measuring the panel, because
   a row-sized panel's height is the height of the rows it just drew. */
@media (max-width: 760px) {
  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view #orderBookPanel {
    --pm-book-levels: 5;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view #orderBookTable .pm-book-body {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view #orderBookTable .pm-book-row {
    flex: 0 0 auto !important;
    min-height: 30px !important;
    max-height: none !important;
  }

  /* One hairline between asks and bids; the spread row itself stays hidden
     on phones because the chance above the chart already states the mid. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view #orderBookTable .pm-book-body--bids {
    margin-top: 6px;
    padding-top: 6px;
    box-shadow: inset 0 1px 0 var(--hv-hair, rgba(0, 0, 0, 0.09));
  }
}

@media (min-width: 761px) and (max-width: 1099px) {
  /* Between the phone layout and the desktop layout the detail page is a fixed
     shell: header, market area, trade dock. The market area gave the chart
     every spare pixel and the book whatever was left, so the book showed its
     header and no rows, and on short windows (a snapped laptop window, a
     landscape phone) the chart itself ended up under the dock.
     The market area is now a column that scrolls when it has to. The book is
     sized by its rows; the chart keeps a readable minimum and grows into any
     space left over. A portrait tablet shows everything at once and a short
     window scrolls. Sports match pages already scroll the whole page and keep
     their own chart height, so only the book rules below apply to them. The
     doubled [class] selectors outrank the older workspace rules, which are all
     !important. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page:not(.hg-sports-context-visible) .pm-detail-view .pm-detail-shell[class] .pm-detail-workspace[class][class] {
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page:not(.hg-sports-context-visible) .pm-detail-view .pm-detail-shell[class] .pm-detail-workspace[class][class] > * {
    flex-shrink: 0 !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page:not(.hg-sports-context-visible) .pm-detail-view .pm-detail-shell[class] .pm-chart-panel[class] {
    flex: 1 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page:not(.hg-sports-context-visible) .pm-detail-view .pm-detail-shell[class] .pm-chart-wrap[class] {
    height: auto !important;
    min-height: clamp(200px, 34vh, 300px) !important;
    max-height: none !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view #orderBookPanel {
    --pm-book-levels: 5;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view #orderBookPanel,
  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view #orderBookBody,
  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view #coinDepthData,
  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view #orderBookTable {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view #orderBookTable {
    padding-inline: 12px !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view #orderBookTable .pm-book-body {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view #orderBookTable .pm-book-row {
    flex: 0 0 auto !important;
    min-height: 26px !important;
    max-height: none !important;
  }
}

@media (min-width: 1100px) {
  /* Desktop sports match pages scroll the whole page, so their book panel has
     no height to share either and showed the same header-only book. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page.hg-sports-context-visible .pm-detail-view #orderBookPanel {
    --pm-book-levels: 5;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page.hg-sports-context-visible .pm-detail-view #orderBookPanel,
  html[data-hg-theme] body.hg-markets.hg-predict-market-page.hg-sports-context-visible .pm-detail-view #orderBookBody,
  html[data-hg-theme] body.hg-markets.hg-predict-market-page.hg-sports-context-visible .pm-detail-view #coinDepthData,
  html[data-hg-theme] body.hg-markets.hg-predict-market-page.hg-sports-context-visible .pm-detail-view #orderBookTable {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page.hg-sports-context-visible .pm-detail-view #orderBookTable .pm-book-body {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page.hg-sports-context-visible .pm-detail-view #orderBookTable .pm-book-row {
    flex: 0 0 auto !important;
    min-height: 22px !important;
    max-height: none !important;
  }
}

/* A book with no orders says so (syncBookEmptyNote) instead of showing a
   header with nothing under it. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-book-table .pm-book-empty {
  flex: 0 0 auto;
  padding: 14px 12px;
  color: var(--hv-text-2);
  font-size: 12.5px;
  line-height: 1.4;
  text-align: center;
}

/* ── 3. Fixed chrome ───────────────────────────────────────────────────────
   Language, Docs, Terms, Privacy and the theme picker float at the bottom
   right. Over the desktop market list they sat on top of card titles and
   prices. Reserve a slim band for them under the list scroller instead. */
@media (min-width: 761px) {
  html[data-hg-theme] body.hg-markets.hg-predict-market-page:not(.pm-detail-open) #marketListView:not([hidden]) {
    margin-bottom: 44px !important;
  }
}

@media (max-width: 760px) {
  /* On a short list page (loading, load failure, an empty category) the legal
     links sat in the middle of the screen. Keep them at the end of the page. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page:not(.pm-detail-open) #pmLegalChrome {
    margin-top: auto !important;
  }

  /* Phones scroll the document (mobile-reading.css), but an older rule with a
     doubled attribute selector still pinned the detail view to the viewport
     height. Its content then overflowed a fixed box, the page could not scroll
     to the end, and the last rows stayed under the trade dock. Make the view
     content-sized and reserve the dock's height below it. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page.pm-detail-open .pm-detail-view:not([hidden])[class][class] {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    padding-bottom: calc(var(--pm-trade-dock-h, 132px) + 28px + env(safe-area-inset-bottom)) !important;
  }

  /* The list's category dock is hidden on the detail page, so its reserved
     space is not needed there; the trade dock's is reserved just above. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page.pm-detail-open .pm-root {
    padding-bottom: 0 !important;
  }
}

@media (max-width: 1099px) {
  /* The trade dock (phones and tablets) is pinned a few pixels from both edges
     but also carried a 100vw width, which pushed its right edge — the "No"
     button on phones, the payout box on tablets — off screen. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page.pm-detail-open #mobileTradeDock {
    width: auto !important;
    max-width: none !important;
  }

  /* Sports match pages put the positions panel in the page flow instead of
     pinning it as a drawer, but the closed-drawer offset (108% of its height)
     still applied. The panel was drawn that far below its slot: under the trade
     dock and past the end of the page. In the flow it needs no offset. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page.pm-detail-open.hg-sports-context-visible .pm-detail-view .pm-detail-shell .pm-detail-bottom {
    transform: none !important;
  }
}

@media (min-width: 1100px) and (max-height: 820px) {
  /* Laptop-height desktop windows. With nothing to show (signed out, or no
     positions yet) the positions panel still spent 160px on an illustration
     and two lines, taken from the chart and the order book above it. Keep the
     two lines and give the rest back. A panel that has positions, orders or
     fills is not touched. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-personal-dock[data-dock-state="signed-out"] .pm-account-empty__icon,
  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-personal-dock[data-dock-state="empty"] .pm-account-empty__icon {
    display: none !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-personal-dock[data-dock-state="signed-out"] .pm-account-empty,
  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-personal-dock[data-dock-state="empty"] .pm-account-empty {
    min-height: 0 !important;
    padding-block: 6px 10px !important;
    gap: 2px !important;
  }
}

/* ── 4. List grid ──────────────────────────────────────────────────────────
   Desktop rows had a 218–246px minimum while two-sided cards are about 150px
   tall, which left an empty band under every row of them. */
@media (min-width: 1024px) {
  html[data-hg-theme] body.hg-markets.hg-predict-market-page:not(.pm-detail-open) #pmMarketGrid {
    grid-auto-rows: auto !important;
  }
}

/* ── 5. List states ──────────────────────────────────────────────────────── */

/* Status chips share one row and wrap on narrow screens. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

@media (max-width: 760px) {
  /* Chips keep their own width on phones instead of each filling a row. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chip-row > .pm-live-chip {
    width: auto !important;
    max-width: 100%;
    flex: 0 1 auto !important;
  }
}

/* View-only: a plain note, no status dot — it is a mode, not a feed state. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-view-only-chip {
  color: var(--hv-text) !important;
  white-space: normal;
  text-align: start;
  line-height: 1.3;
  padding-block: 6px;
}

/* Prices on screen but not executable right now. Both ambers clear 4.5:1 on
   their card surface at this 12px size. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-live-dot[data-state="delayed"] {
  color: #8a5d10 !important;
}

html[data-hg-theme="hyperliquid"] body.hg-markets.hg-predict-market-page .pm-live-dot[data-state="delayed"] {
  color: #d9a441 !important;
}

/* Loading: card-shaped placeholders in the grid. The status line stays for
   assistive technology only. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page #pmMarketGrid > .pm-empty-state--loading {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-card-skeleton {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: var(--hv-r-slab, 14px);
  background: var(--hv-slab, #fbf8f2);
  box-shadow: var(--hv-lift, inset 0 0 0 1px rgba(0, 0, 0, 0.08));
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-card-skeleton > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-card-skeleton i {
  display: block;
  height: 14px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--hv-text, #16120e) 9%, transparent);
  animation: hg-skeleton-breathe 1.4s ease-in-out infinite;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-card-skeleton__head { justify-content: flex-start !important; }
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-card-skeleton__head i:first-child { width: 34px; height: 34px; border-radius: 9px; flex: 0 0 34px; }
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-card-skeleton__head i:last-child { width: min(62%, 280px); height: 16px; }
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-card-skeleton__row i:first-child { width: 42%; }
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-card-skeleton__row i:last-child { width: 56px; height: 26px; border-radius: 8px; }
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-card-skeleton__row:nth-of-type(3) i:first-child { width: 54%; }
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-card-skeleton__row:nth-of-type(4) i:first-child { width: 33%; }
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-card-skeleton__foot i { width: 84px; height: 10px; }

@keyframes hg-skeleton-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-card-skeleton i { animation: none; }
}

/* Load failure: what happened, what to do, then the raw reason. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page #pmMarketGrid > .pm-empty-state--error {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 10px;
  max-width: 460px;
  margin: 32px auto;
  padding: 28px 24px;
  border-radius: var(--hv-r-slab, 14px);
  background: var(--hv-slab, #fbf8f2);
  box-shadow: var(--hv-lift, inset 0 0 0 1px rgba(0, 0, 0, 0.08));
  text-align: center;
  color: var(--hv-text-2);
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-empty-state__title {
  color: var(--hv-text);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.35;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-empty-state__hint {
  font-size: 13px;
  line-height: 1.5;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-empty-state__retry {
  min-height: 44px;
  min-width: 132px;
  margin-top: 4px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--hv-r-key, 8px);
  background: var(--hv-cta, #16120e);
  color: var(--hv-accent-ink, #f7f0e2);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-empty-state__detail {
  max-width: 100%;
  color: var(--hv-text-2);
  font-size: 11.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* ── 6. Focus ───────────────────────────────────────────────────────────── */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-market-card:focus-visible,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-card-outcome-row:focus-visible,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-card-binary-side:focus-visible,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-card-spark:focus-visible,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-category-chip:focus-visible,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-dock-button:focus-visible,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-empty-state__retry:focus-visible,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-legal-chrome a:focus-visible,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-legal-chrome button:focus-visible {
  outline: 2px solid rgba(var(--hv-accent-rgb, 106, 78, 46), 0.9) !important;
  outline-offset: 2px !important;
}

/* ── 7. Countdown scale ─────────────────────────────────────────────────────
   Two days or more from close the three cells carry days / hours / minutes
   (see renderExpiryCountdown), so the unit letters follow the scale. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-shell .pm-expiry-countdown[data-scale="days"] .pm-expiry-countdown__cell strong[data-expiry-unit="hours"]::after {
  content: "d" !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-shell .pm-expiry-countdown[data-scale="days"] .pm-expiry-countdown__cell strong[data-expiry-unit="mins"]::after {
  content: "h" !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-shell .pm-expiry-countdown[data-scale="days"] .pm-expiry-countdown__cell strong[data-expiry-unit="secs"]::after {
  content: "m" !important;
}

/* ── 8. Hidden means hidden ─────────────────────────────────────────────────
   The recent-trades panel is marked hidden when there are no trades, but a
   display rule kept drawing its empty outline under the order book. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page #recentTradesPanel[hidden] {
  display: none !important;
}

/* ── 9. Trade path ──────────────────────────────────────────────────────────
   From choosing an outcome to pressing the trade button, on every width.

   a. 1024–1099px is the tablet layout (trade dock, ticket sheet, positions
      drawer), but two tablet rules stopped at 1023px and the scripts treated
      1024px and up as desktop. The positions panel stayed expanded, which this
      layout draws as a fixed sheet above the trade dock, so "Buy selected
      outcome" could not be pressed and the order book was hidden; the legal
      links sat on the dock. The scripts now switch at 1099px
      (isMobileDetailLayout) and the two rules are carried up to 1099px here.
      Sports match pages keep their in-flow positions panel (b).
   b. Sports match pages place the positions panel in the page flow at every
      width. Closed, it kept the drawer's pointer-events: none and was inert,
      so its tabs and position Sell buttons were on screen but dead.
   c. Desktop: the legal links float at the bottom right, over the positions
      panel. Reserve the same slim band the market list reserves (section 3).
   d. Desktop: the book and ticket columns had no gutter, so the book's Total
      column ran into the ticket's edge.
   e. Brand theme: the selected outcome's price carried the selected chip's
      tint as its own background, a tan bar behind the price on a dark button.
   f. View-only: the ticket repeats the list's view-only line right above its
      primary button (syncTicketViewOnlyNotice).
   g. The positions tabs carried a near-black top border only as wide as the
      tabs, a stray stub under the panel's own full-width edge.
   h. "Setup & advanced" opened inside a fixed-height column that shrank it to
      whatever was left and clipped the rest (about 125px of 570px on a
      1280×720 window), so slippage and the setup checklist could not be
      reached. Open, it keeps its height and the ticket scrolls instead.
   i. Its contents were still drawn in the old dark terminal's colours (white
      and pale-blue text, near-black tints), about 1:1 to 2.5:1 on the light
      themes. They take the theme's ink tokens, which every theme defines. */

@media (max-width: 1099px) {
  html[data-hg-theme] body.hg-markets.hg-predict-market-page.pm-detail-open #pmLegalChrome {
    display: none !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page.pm-detail-open.hg-sports-context-visible .pm-detail-view .pm-detail-shell .pm-detail-bottom {
    pointer-events: auto !important;
  }
}

@media (min-width: 1024px) and (max-width: 1099px) {
  /* The 1023px drawer rules (outcome-motion.css), for the rest of the tablet
     range. Sports match pages are left to their in-flow panel. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page:not(.hg-sports-context-visible) .pm-detail-view .pm-detail-shell[data-experience="v2"] .pm-personal-dock:not(.is-expanded),
  html[data-hg-theme] body.hg-markets.hg-predict-market-page:not(.hg-sports-context-visible) .pm-detail-view .pm-detail-shell[data-experience="v2"] .pm-personal-dock.is-expanded {
    display: flex !important;
    flex-direction: column;
    position: fixed !important;
    inset: auto 0 0 !important;
    z-index: 125 !important;
    width: 100% !important;
    min-height: min(42dvh, 360px) !important;
    max-height: min(72dvh, 640px) !important;
    overflow: hidden !important;
    border-radius: 18px 18px 0 0;
    transition:
      transform 500ms var(--hg-motion-ease, ease),
      box-shadow 500ms var(--hg-motion-ease, ease);
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page:not(.hg-sports-context-visible) .pm-detail-view .pm-detail-shell[data-experience="v2"] .pm-personal-dock:not(.is-expanded) {
    transform: translate3d(0, 108%, 0) !important;
    pointer-events: none !important;
    box-shadow: none !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page:not(.hg-sports-context-visible) .pm-detail-view .pm-detail-shell[data-experience="v2"] .pm-personal-dock.is-expanded {
    transform: translate3d(0, 0, 0) !important;
    pointer-events: auto !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page:not(.hg-sports-context-visible) .pm-detail-view .pm-detail-shell[data-experience="v2"] .pm-personal-dock .pm-detail-bottom-body {
    display: block !important;
    min-height: 0;
    overflow-y: auto !important;
  }
}

@media (min-width: 1100px) {
  html[data-hg-theme] body.hg-markets.hg-predict-market-page.pm-detail-open #marketDetailView:not([hidden]) {
    padding-bottom: 44px !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page:not(.hg-sports-context-visible) .pm-detail-view .pm-detail-shell[data-experience="v2"] #orderBookPanel {
    margin-inline-end: 14px !important;
  }
}

html[data-hg-theme="brand"] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-detail-shell[data-experience="v2"] #ticketSideButtons .pm-outcome-choice.is-active > span {
  background: transparent !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view #detailAccountTabs {
  border-top-color: transparent !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-ticket-trade-stack__body > .pm-advanced-settings[open] {
  flex-shrink: 0 !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket #ticketSideButtons .pm-outcome-choice:not(.is-active) > span,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-advanced-settings > summary,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket #ticketReadinessTitle,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-readiness-progress,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-readiness-references > summary,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-readiness-references li > span,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-readiness-references li > code,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-readiness-step__eyebrow,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-readiness-step p,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket #oneClickDetails > summary > span,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-one-click__head span,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-one-click__network,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket #oneClickStatusDetail,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket #oneClickDisableNotice,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-one-click__risk,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-slippage-field > span,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-slippage-field > small,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-risk-facts__head span,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-risk-facts__label > small,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-risk-facts__row > p,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-risk-facts__row > small {
  color: var(--hv-text-2) !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket #ticketReadinessSummary,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-readiness-references li > strong,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-readiness-step strong,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket #oneClickStatusTitle,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-one-click__facts dd,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-risk-facts__head strong,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-risk-facts__label > span {
  color: var(--hv-text) !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-readiness-progress,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-readiness-references li {
  background: color-mix(in srgb, var(--hv-text, #16120e) 5%, transparent) !important;
}

/* The notice takes the ticket's free space above it, so it sits directly on
   top of the primary button, which stays pinned to the bottom edge. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket #ticketPrimaryBlocker[data-view-only]:not([hidden]) {
  margin: auto 0 10px !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket #ticketPrimaryBlocker[data-view-only]:not([hidden]) + #prepareOrderButton {
  margin-top: 0 !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket .pm-ticket-view-only {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--hv-r-well, 12px);
  background: color-mix(in srgb, var(--hv-text, #16120e) 5%, transparent);
  box-shadow: inset 0 0 0 1px var(--hv-hair, rgba(0, 0, 0, 0.09));
  color: var(--hv-text, #16120e);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
}

/* ── 10. History chart ──────────────────────────────────────────────────────
   chance-history-chart.js draws the selected outcome's recorded chance over a
   range: a caption saying whose chance the line is and how it moved, a plot
   with round-percentage gridlines and a local-time axis, the live price in a
   tag on the right axis, and range buttons under the plot. The line takes the
   theme accent, or the market's brand colour (markets-brand.css). */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-chart-wrap {
  --hg-chart-ink: var(--hv-accent, #6a4e2e);
  --hg-chart-pill-ink: #ffffff;
  --hg-chart-up: #1d7a4b;
  --hg-chart-down: #b42318;
  --hg-chart-note: #a16207;
}

html[data-hg-theme="hyperliquid"] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-chart-wrap {
  --hg-chart-pill-ink: #061411;
  --hg-chart-up: #4ade80;
  --hg-chart-down: #f87171;
  --hg-chart-note: #fbbf24;
}

/* The bar above the plot: the caption on the left, the history status on the
   right (the scale switch moves to the control row under the plot). It wraps
   instead of clipping when the column is narrow. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-detail-shell .pm-chart-wrap > .hg-chart-presentation {
  flex-wrap: wrap !important;
  align-items: center !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  gap: 4px 12px !important;
  padding: 0 0 6px !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-caption {
  order: 0;
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0;
  color: var(--hv-text);
  font: 600 13px/1.35 var(--hv-num-font, system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-caption[hidden] {
  display: none !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-caption__swatch {
  flex: 0 0 auto;
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: var(--hg-chart-ink);
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-caption__who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--hv-text);
  font-weight: 650;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-caption__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-caption__change {
  color: var(--hv-text-2);
  font-weight: 650;
  white-space: nowrap;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-caption__change[data-direction="up"] {
  color: var(--hg-chart-up);
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-caption__change[data-direction="down"] {
  color: var(--hg-chart-down);
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-caption__period {
  color: var(--hv-text-3);
  font-weight: 500;
  white-space: nowrap;
}

/* Key for the stretches with no recorded price. Since 2026-11-27 those are
   drawn as solid as the rest of the line (as on outcome.xyz), so the key is not
   shown: the hover card still names such a point ("No prices recorded for …"). */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-caption__gaps {
  display: none !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-caption__gaps[hidden] {
  display: none !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-caption__gaps > i {
  width: 16px;
  height: 0;
  border-top: 2px dashed color-mix(in srgb, var(--hg-chart-ink) 60%, transparent);
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-chart-presentation__status {
  order: 1;
  flex: 0 1 auto;
  margin-left: auto !important;
}

/* The history status speaks only when something is wrong (2026-11-28): the
   line that only confirms the chart is current ("Recent market prices", "No
   recent price change") is not shown; "Updates delayed" and "Price history
   unavailable" still are (chart-presentation.js sets data-history-status). */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-chart-presentation[data-history-status="recent"] .hg-chart-presentation__status,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-chart-presentation[data-history-status="quiet"] .hg-chart-presentation__status {
  display: none !important;
}

/* The control row under the plot (ranges on the left, the Auto / 0–100%
   scale on the right) is not shown since 2026-11-17, as on outcome.xyz: the
   chart always draws every recorded price (state.chartRange "all") on the
   auto scale. The row stays in the page, so these two rules bring it back
   (the second covers a scale switch the chart has not moved into the row). */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-detail-shell .pm-chart-wrap > .hg-history-controls,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-detail-shell .pm-chart-wrap .hg-chart-presentation__scales {
  display: none !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap > .hg-history-controls[hidden],
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-ranges[hidden],
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-range[hidden] {
  display: none !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-controls .hg-chart-presentation__scales {
  margin-left: auto;
}

/* Range buttons, in the same segmented style as the scale. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-ranges {
  flex: 0 0 auto;
  display: inline-flex;
  gap: 2px;
  margin: 0;
  padding: 3px;
  border-radius: var(--hv-r-key, 8px);
  background: var(--hv-well, rgba(0, 0, 0, 0.05));
  box-shadow: var(--hv-well-shadow, none);
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-range {
  min-width: 40px;
  min-height: 28px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--hv-text-3);
  font: 650 12px/1 var(--hv-num-font, system-ui, sans-serif);
  cursor: pointer;
  transition: color var(--hv-fast, 140ms) var(--hv-ease, ease), background-color var(--hv-fast, 140ms) var(--hv-ease, ease);
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-range:hover {
  color: var(--hv-text);
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-range[aria-pressed="true"] {
  background: var(--hv-key, #ffffff);
  color: var(--hv-text);
  box-shadow: var(--hv-key-shadow, inset 0 0 0 1px rgba(0, 0, 0, 0.12));
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-range:focus-visible {
  outline: 2px solid var(--hg-chart-ink);
  outline-offset: 1px;
}

/* The plot. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart[data-history-chart] {
  overflow: visible;
  cursor: default;
  touch-action: pan-y;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart[data-history-chart] [hidden] {
  display: none !important;
}

/* Solid hairlines behind a chart read on a scale. A chart that names each
   line at its end (several outcomes, a three-way game's bands) needs none,
   and the time axis needs no tick marks: its labels are enough. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-grid {
  stroke: color-mix(in srgb, var(--hv-text) 7%, transparent);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart[data-hg-multi] .hg-history-grid,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart[data-hg-bands] .hg-history-grid,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-tick {
  display: none;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-axis-label {
  fill: var(--hv-text-3);
  font: 500 11px/1 var(--hv-num-font, system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-line {
  fill: none;
  stroke: var(--hg-chart-ink);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* No recorded price in this stretch: since 2026-11-27 one solid line in the
   same colour and weight as the recorded stretches. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-gap {
  fill: none;
  stroke: var(--hg-chart-ink);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* No wash under the line (2026-11-27): the ground stays one colour. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-fill-top {
  stop-color: var(--hg-chart-ink);
  stop-opacity: 0;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-fill-bottom {
  stop-color: var(--hg-chart-ink);
  stop-opacity: 0;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-tip {
  fill: var(--hg-chart-ink);
  stroke: var(--hv-slab-fill, #ffffff);
  stroke-width: 2;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-tip-halo {
  fill: color-mix(in srgb, var(--hg-chart-ink) 24%, transparent);
  opacity: 0.6;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-tip-halo.is-live {
  animation: hg-history-pulse 2.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes hg-history-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 0.9; transform: scale(1.25); }
}

@media (prefers-reduced-motion: reduce) {
  html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-tip-halo.is-live {
    animation: none;
  }
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-pill rect {
  fill: var(--hg-chart-ink);
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-pill text {
  fill: var(--hg-chart-pill-ink);
  font: 700 11px/1 var(--hv-num-font, system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
}

/* Scrubbing (hover, touch drag, arrow keys): a hairline at the read point, the
   stretch after it faded back, the point ringed, its time on the time axis. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-crosshair {
  stroke: color-mix(in srgb, var(--hv-text) 28%, transparent);
  stroke-width: 1;
  stroke-dasharray: none;
  shape-rendering: crispEdges;
  pointer-events: none;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-scrub {
  fill: var(--hv-slab-fill, #ffffff);
  opacity: 0.62;
  pointer-events: none;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-hover-halo {
  fill: color-mix(in srgb, var(--hg-chart-ink) 20%, transparent);
  pointer-events: none;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-hover-dot {
  fill: var(--hg-chart-ink);
  stroke: var(--hv-slab-fill, #ffffff);
  stroke-width: 2;
  pointer-events: none;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-hover-time rect {
  fill: var(--hv-text);
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-hover-time text {
  fill: var(--hv-slab-fill, #ffffff);
  font: 600 11px/1 var(--hv-num-font, system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
}

/* While scrubbing, the live tag and tip step back so the read point leads. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart[data-scrubbing] .hg-history-tip-halo {
  animation: none;
  opacity: 0;
}

/* The hover card, in the theme's own surface and ink. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-chart-wrap > #chartTooltip {
  min-width: 150px;
  max-width: min(260px, calc(100% - 16px));
  gap: 2px;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--hv-slab-fill, #ffffff);
  box-shadow: inset 0 0 0 1px var(--hv-hair-strong, rgba(0, 0, 0, 0.15)), 0 12px 28px -14px rgba(0, 0, 0, 0.45);
  color: var(--hv-text);
  font: 500 12px/1.35 var(--hv-num-font, system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-chart-wrap > #chartTooltip strong {
  color: var(--hg-chart-ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-chart-wrap > #chartTooltip span {
  color: var(--hv-text);
  font-weight: 600;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-chart-wrap > #chartTooltip small {
  color: var(--hv-text-3);
  font-size: 11.5px;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-chart-wrap > #chartTooltip .pm-chart-tooltip__note {
  color: var(--hg-chart-note);
}

@media (min-width: 761px) {
  /* Pointer layouts: the scale switch matches the range buttons' height
     (chart-presentation.css sizes it as a 44px touch target). */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-controls .hg-chart-presentation__scales {
    padding: 3px !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-controls .hg-chart-presentation__scale {
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    line-height: 1 !important;
  }
}

@media (max-width: 760px) {
  /* Phones: the range buttons share their row evenly and are thumb-sized;
     the scale switch follows on the right, or wraps under them. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-ranges {
    flex: 1 1 220px;
    display: flex;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-chart-wrap .hg-history-range {
    flex: 1 1 0;
    min-width: 0;
    min-height: 34px;
    height: 34px;
    padding: 0 4px;
    font-size: 13px;
  }
}

/* ── 11. Rules sheet ────────────────────────────────────────────────────────
   The dialog takes each theme's surface (markets-themes.css), but its text
   kept the dark terminal's light tokens: on cream the rule itself, the field
   names and the card labels were close to invisible. Everything now reads
   from the theme's own ink, and the rule leads in larger type. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-rules-dialog {
  color: var(--hv-text) !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-rules-dialog__head span,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-rules-block h3,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-rules-dialog .pm-rules-note,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-rules-dialog .pm-rules-chips span,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-rules-dialog .pm-rules-settle span,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-rules-dialog__body dt {
  color: var(--hv-text-2) !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-rules-dialog__head h2,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-rules-dialog .pm-rules-chips strong,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-rules-dialog .pm-rules-settle strong,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-rules-dialog__body dd {
  color: var(--hv-text) !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-rules-dialog__body .pm-rules-narrative p {
  color: var(--hv-text-2) !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  opacity: 1 !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-rules-dialog__body .pm-rules-narrative p.pm-rules-lead {
  margin: 0 0 10px !important;
  padding: 12px 14px;
  border-radius: var(--hv-r-well, 12px);
  background: color-mix(in srgb, var(--hv-text) 5%, transparent);
  box-shadow: inset 3px 0 0 var(--hg-brand, var(--hv-accent, currentColor));
  color: var(--hv-text) !important;
  font-size: 16.5px !important;
  font-weight: 650;
  line-height: 1.45 !important;
}

/* ── 12. Site menu on phones and tablets ────────────────────────────────────
   A globe button in the top bar (markets-terminal.js mountSiteMenu) opens the
   footer as a sheet: languages, Docs, Terms, Privacy and the colour themes.
   Up to 1099px the footer is otherwise out of reach (after every card on the
   list, hidden on a market page). */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-top-menu {
  display: none;
}

@media (max-width: 1099px) {
  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-app-topbar .pm-top-menu {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    margin-inline-end: 8px;
    padding: 0 11px;
    border: 1px solid var(--hv-hair-strong, rgba(0, 0, 0, 0.16));
    border-radius: 999px;
    background: transparent;
    color: var(--hv-text);
    font: 650 12.5px/1 var(--hv-num-font, system-ui, sans-serif);
    letter-spacing: 0.02em;
    cursor: pointer;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-app-topbar .pm-top-menu svg {
    width: 16px;
    height: 16px;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-app-topbar .pm-top-menu[aria-expanded="true"] {
    background: var(--hv-text);
    color: var(--hv-slab-fill, #ffffff);
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-site-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2390;
    background: rgba(12, 10, 8, 0.38);
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-site-sheet-backdrop[hidden] {
    display: none;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #pmLegalChrome[class][class] {
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    top: auto !important;
    bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    z-index: 2400 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 2px !important;
    width: auto !important;
    max-width: 520px !important;
    max-height: min(82svh, 680px) !important;
    margin: 0 auto !important;
    padding: 10px !important;
    overflow-y: auto !important;
    border-radius: 18px !important;
    background: var(--hv-slab-fill, #ffffff) !important;
    box-shadow: inset 0 0 0 1px var(--hv-hair-strong, rgba(0, 0, 0, 0.16)), 0 -10px 40px -14px rgba(0, 0, 0, 0.5) !important;
    color: var(--hv-text) !important;
    font-size: 15px !important;
    pointer-events: none !important;
    visibility: hidden !important;
    transform: translateY(calc(100% + 24px)) !important;
    transition: transform 220ms var(--hv-ease, ease), visibility 0s linear 220ms !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page.hg-site-sheet-open #pmLegalChrome[class][class] {
    pointer-events: auto !important;
    visibility: visible !important;
    transform: none !important;
    transition: transform 220ms var(--hv-ease, ease) !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #pmLegalChrome[class][class] > a,
  html[data-hg-theme] body.hg-markets.hg-predict-market-page #pmLegalChrome[class][class] .pm-legal-chrome__lang-trigger {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 48px !important;
    padding: 0 12px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: transparent !important;
    color: var(--hv-text) !important;
    font: 600 15px/1.2 var(--hv-num-font, system-ui, sans-serif) !important;
    text-align: start !important;
    transform: none !important;
    opacity: 1 !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #pmLegalChrome[class][class] > a::after {
    content: "›";
    margin-inline-start: auto;
    color: var(--hv-text-3);
    font-size: 20px;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #pmLegalChrome[class][class] > a:active,
  html[data-hg-theme] body.hg-markets.hg-predict-market-page #pmLegalChrome[class][class] .pm-legal-chrome__lang-trigger:active {
    background: var(--hv-well, rgba(0, 0, 0, 0.05)) !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #pmLegalChrome[class][class] .pm-legal-chrome__lang {
    display: block !important;
    position: static !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #pmLegalChrome[class][class] .pm-legal-chrome__globe {
    width: 18px;
    height: 18px;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #pmLegalChrome[class][class] #pmLocaleMenu {
    position: static !important;
    inset: auto !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    width: auto !important;
    max-height: none !important;
    margin: 2px 4px 8px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #pmLegalChrome[class][class] #pmLocaleMenu[hidden] {
    display: none !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #pmLegalChrome[class][class] #pmLocaleMenu [role="option"] {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    background: var(--hv-well, rgba(0, 0, 0, 0.05));
    color: var(--hv-text);
    font-size: 14px;
    cursor: pointer;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #pmLegalChrome[class][class] #pmLocaleMenu [role="option"][aria-selected="true"] {
    background: var(--hv-text);
    color: var(--hv-slab-fill, #ffffff);
    font-weight: 650;
  }

  /* In the sheet the theme choices are always out, as the same three dots as
     the desktop footer (the user asked for that feel, 2026-11-16), sized for a
     finger. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page #pmLegalChrome[class][class] .pm-legal-chrome__themes {
    display: block !important;
    margin: 6px 0 0 !important;
    padding: 12px 12px 4px !important;
    border-top: 1px solid var(--hv-hair, rgba(0, 0, 0, 0.09));
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #pmLegalChrome[class][class] .pm-theme-trigger {
    display: none !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #pmLegalChrome[class][class] .pm-theme-menu {
    display: flex !important;
    align-items: center;
    gap: 16px !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #pmLegalChrome[class][class] #pmThemePicker .pm-theme-menu .pm-theme-swatch {
    width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
  }
}

/* ── 13. Markets with several outcomes ──────────────────────────────────────
   As on outcome.xyz: every outcome is a row under the chart with its chance
   and YES / NO to trade it (markets-terminal.js outcomeLineHtml), on every
   width. Nothing names one outcome above the chart: the switcher strip, the
   single big chance and the chart's one-outcome caption are gone. The chart
   draws the leading outcomes' lines in their own colours and names each at
   its end (chance-history-chart.js); the ticket names the outcome above YES /
   NO. YES and NO wear that outcome's brand colour, YES solid and NO a pale
   wash of it; a day's move keeps the order book's up and down colours. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page {
  --hg-up: #1f6b47;
  --hg-down: #8f2f2f;
}

html[data-hg-theme="light"] body.hg-markets.hg-predict-market-page {
  --hg-up: #0f6b4a;
  --hg-down: #9f1239;
}

html[data-hg-theme="hyperliquid"] body.hg-markets.hg-predict-market-page {
  --hg-up: #5fd4a8;
  --hg-down: #f28b98;
}

/* The rows' panel: a plain block under the chart, not the strip it was. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-detail-shell.has-outcomes-rail .pm-outcomes-panel {
  position: static !important;
  inset: auto !important;
  display: block !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 6px 16px 14px !important;
  overflow: visible !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-detail-shell.has-outcomes-rail .pm-outcomes-panel #outcomesPanel {
  display: block !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* The panel's heading row shows nothing (its "Outcomes" title is for screen
   readers and "View all" is hidden), so it keeps no height above the rows. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-detail-shell.has-outcomes-rail .pm-outcomes-panel > .pm-panel-head {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

/* The rows carry every outcome's chance, so the single big chance and the
   chart's one-outcome caption (its name and move) above the chart go. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page.hg-multi-outcome #chartPriceBlock,
html[data-hg-theme] body.hg-markets.hg-predict-market-page.hg-multi-outcome .hg-history-caption .hg-history-caption__swatch,
html[data-hg-theme] body.hg-markets.hg-predict-market-page.hg-multi-outcome .hg-history-caption .hg-history-caption__who,
html[data-hg-theme] body.hg-markets.hg-predict-market-page.hg-multi-outcome .hg-history-caption .hg-history-caption__change,
html[data-hg-theme] body.hg-markets.hg-predict-market-page.hg-multi-outcome .hg-history-caption .hg-history-caption__period {
  display: none !important;
}

/* Phones and tablets: the rows sit under the chart, above the order book. */
@media (max-width: 1099px) {
  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-detail-shell[data-experience="v2"].has-outcomes-rail .pm-detail-workspace,
  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-detail-shell[data-experience="v2"].has-outcomes-rail .pm-detail-workspace[data-workspace-mode="pro"] {
    grid-template-rows: max-content max-content max-content max-content !important;
    grid-template-areas:
      "marketHeader"
      "visualization"
      "outcomes"
      "orderBook" !important;
  }

  /* Tablets lay the workspace out as a column (no grid areas): the same
     order there, the chart, then the rows, then the book. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-detail-shell.has-outcomes-rail .pm-outcomes-panel {
    order: 1 !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-detail-shell.has-outcomes-rail .pm-book-panel {
    order: 2 !important;
  }
}

/* Desktop: the rows sit under the chart and the book, as on outcome.xyz, and
   the page scrolls (a market with one outcome keeps its one-screen frame);
   the ticket stays in view beside them. The chart keeps a fixed height, so
   rows never squeeze it. */
@media (min-width: 1100px) {
  /* The window scrolls, not <body>: as its own scroll box (overflow: auto
     beside <html>'s) it would hold the ticket's sticky position. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page.pm-detail-open.hg-multi-outcome {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page.pm-detail-open.hg-multi-outcome .pm-root {
    height: auto !important;
    max-height: none !important;
    min-height: 100svh;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page.pm-detail-open.hg-multi-outcome #marketDetailView {
    flex: none !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page.pm-detail-open.hg-multi-outcome .pm-detail-pager,
  html[data-hg-theme] body.hg-markets.hg-predict-market-page.pm-detail-open.hg-multi-outcome .pm-detail-pager__page {
    flex: none !important;
    height: auto !important;
    min-height: 0 !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page.pm-detail-open.hg-multi-outcome .pm-detail-shell.has-outcomes-rail {
    height: auto !important;
    grid-template-rows: auto auto !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-detail-shell[data-experience="v2"].has-outcomes-rail .pm-detail-workspace,
  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-detail-shell[data-experience="v2"].has-outcomes-rail .pm-detail-workspace[data-workspace-mode="pro"] {
    height: auto !important;
    grid-template-rows: max-content clamp(400px, calc(100svh - 400px), 560px) max-content !important;
    grid-template-areas:
      "marketHeader marketHeader tradeTicket"
      "visualization orderBook tradeTicket"
      "outcomes outcomes tradeTicket" !important;
  }

  /* Match pages: the chart has its own height beside the match there
     (finance-market-integration.css), so its row follows its content. A game
     in progress places the panels by row instead of by area (the book folded
     away): the match and its chart first, the rows under them, where the
     switcher strip used to sit above. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page.hg-sports-context-visible .pm-detail-view .pm-detail-shell[data-experience="v2"].has-outcomes-rail .pm-detail-workspace {
    grid-template-rows: max-content max-content max-content !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page.pm-detail-open.hg-sports-context-active:not(.hg-sports-book-open) .pm-detail-view .pm-detail-shell[data-experience="v2"].has-outcomes-rail .pm-chart-panel {
    grid-row: 1 !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page.pm-detail-open.hg-sports-context-active:not(.hg-sports-book-open) .pm-detail-view .pm-detail-shell[data-experience="v2"].has-outcomes-rail .pm-detail-workspace > .pm-outcomes-panel {
    grid-row: 2 !important;
    margin: 0 !important;
  }

  /* Clear of the fixed Docs / Terms / Privacy links at the bottom right. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-detail-shell.has-outcomes-rail .pm-outcomes-panel {
    padding: 0 28px 32px 16px !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-detail-shell.has-outcomes-rail #orderTicket {
    position: sticky !important;
    top: 16px !important;
    align-self: start !important;
  }
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-lines {
  display: block;
  border-top: 1px solid var(--hv-hair, rgba(0, 0, 0, 0.09));
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-lines > [role="listitem"] {
  border-bottom: 1px solid var(--hv-hair, rgba(0, 0, 0, 0.09));
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-line__pick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--hv-text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-line.is-active .hg-outcome-line__pick {
  background: var(--hv-well, rgba(0, 0, 0, 0.05));
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-line__name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  color: var(--hv-text);
  font: 600 15px/1.25 var(--hv-num-font, system-ui, sans-serif);
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-line__name > *,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-line__name .hg-branded-label__text,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-line__name .pm-outcome-label__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-line__odds {
  display: grid;
  justify-items: end;
  gap: 3px;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-line__chance {
  color: var(--hv-text);
  font: 750 20px/1 var(--hv-num-font, system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-line__move {
  color: var(--hv-text-3);
  font: 600 12px/1 var(--hv-num-font, system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-line__move[data-direction="up"] {
  color: var(--hg-up);
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-line__move[data-direction="down"] {
  color: var(--hg-down);
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-line__sides {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  gap: 6px;
}

/* YES and NO wear the outcome's brand colour (markets-brand.css palette): YES
   its solid chip colour with the chip's 4.5:1 ink; NO a 20% wash of its line
   colour, its text that colour mixed 45% toward the theme's text (4.9:1 or
   more on the wash for all 211 brands, every theme). So the two read apart in
   every brand. A row carries its outcome's brand and the
   ticket's keys the selected outcome's; an outcome without one takes the
   market's from #marketDetailView, else the theme's accent. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-side,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-yes-no-choice {
  --hg-yes-fill: var(--b-chip, var(--hv-accent));
  --hg-yes-ink: var(--b-chip-ink, var(--hv-accent-ink));
  --hg-no-tone: var(--b-line-l, var(--hv-accent));
  --hg-no-ink: color-mix(in srgb, var(--hg-no-tone) 55%, var(--hv-text));
}

html[data-hg-theme="hyperliquid"] body.hg-markets.hg-predict-market-page .hg-outcome-side,
html[data-hg-theme="hyperliquid"] body.hg-markets.hg-predict-market-page .hg-yes-no-choice {
  --hg-no-tone: var(--b-line-d, var(--hv-accent));
}

/* One line, word and price on a shared baseline, centred in the key (a
   wrapping flex line is what align-content centres). */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-side {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  min-width: 104px;
  min-height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--hv-hair-strong, rgba(0, 0, 0, 0.16));
  border-radius: 10px;
  align-content: center;
  align-self: stretch;
  background: transparent;
  color: var(--hv-text);
  font: inherit;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-side__word {
  font: 700 12px/1 var(--hv-num-font, system-ui, sans-serif);
  letter-spacing: 0.04em;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-side__price {
  font: 700 15px/1 var(--hv-num-font, system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
}

/* A short bar under each key in its colour, as outcome.xyz marks YES and NO;
   the chosen key is filled instead. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-side::after,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-yes-no-choice::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--hg-yes-fill);
  transform: translateX(-50%);
  pointer-events: none;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-side--no::after,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-yes-no-choice--no::after {
  background: color-mix(in srgb, var(--hg-no-tone) 45%, transparent);
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-side.is-selected::after,
html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-yes-no-choice.is-active::after {
  display: none;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-side--yes.is-selected {
  border-color: var(--hg-yes-fill);
  background: var(--hg-yes-fill);
  color: var(--hg-yes-ink);
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-side--no.is-selected {
  border-color: var(--hg-no-tone);
  background: color-mix(in srgb, var(--hg-no-tone) 20%, transparent);
  color: var(--hg-no-ink);
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-side:disabled {
  cursor: default;
  opacity: 0.45;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-lines__more {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 10px 0 0;
  border: 1px solid var(--hv-hair-strong, rgba(0, 0, 0, 0.16));
  border-radius: 10px;
  background: transparent;
  color: var(--hv-text-2);
  font: 600 14px/1 var(--hv-num-font, system-ui, sans-serif);
  cursor: pointer;
}

/* Every outcome's line: its brand colour at 3:1 on the theme (markets-brand.css
   --b-line-l / --b-line-d), or a tone when it has no brand of its own. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-series,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-series__dot,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-end-label {
  --hg-series-ink: var(--b-line-l, var(--hv-text-2));
}

html[data-hg-theme="hyperliquid"] body.hg-markets.hg-predict-market-page #priceChart .hg-history-series,
html[data-hg-theme="hyperliquid"] body.hg-markets.hg-predict-market-page #priceChart .hg-history-series__dot,
html[data-hg-theme="hyperliquid"] body.hg-markets.hg-predict-market-page #priceChart .hg-history-end-label {
  --hg-series-ink: var(--b-line-d, var(--hv-text-2));
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart [data-hg-tone="1"] { --hg-series-ink: #c2410c; }
html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart [data-hg-tone="2"] { --hg-series-ink: #0f766e; }
html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart [data-hg-tone="3"] { --hg-series-ink: #a21caf; }
html[data-hg-theme="hyperliquid"] body.hg-markets.hg-predict-market-page #priceChart [data-hg-tone="1"] { --hg-series-ink: #fb923c; }
html[data-hg-theme="hyperliquid"] body.hg-markets.hg-predict-market-page #priceChart [data-hg-tone="2"] { --hg-series-ink: #2dd4bf; }
html[data-hg-theme="hyperliquid"] body.hg-markets.hg-predict-market-page #priceChart [data-hg-tone="3"] { --hg-series-ink: #e879f9; }

/* The selected outcome's line wears its own colour, not the market's. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart[data-hg-multi][data-hg-brand] {
  --hg-chart-ink: var(--b-line-l, var(--hg-brand, var(--hv-accent)));
}

html[data-hg-theme="hyperliquid"] body.hg-markets.hg-predict-market-page #priceChart[data-hg-multi][data-hg-brand] {
  --hg-chart-ink: var(--b-line-d, var(--hg-brand, var(--hv-accent)));
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-series__line {
  fill: none;
  stroke: var(--hg-series-ink);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Each outcome's unrecorded stretch: the same solid line as the rest of it. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-series__gap {
  fill: none;
  stroke: var(--hg-series-ink);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-series__dot {
  fill: var(--hg-series-ink);
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-end-label.is-selected {
  --hg-series-ink: var(--hg-chart-ink);
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-end-label__code {
  fill: var(--hg-series-ink);
  font: 650 10.5px/1 var(--hv-num-font, system-ui, sans-serif);
  letter-spacing: 0.04em;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-end-label__value {
  fill: var(--hg-series-ink);
  font: 750 14px/1 var(--hv-num-font, system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #priceChart .hg-history-end-label.is-selected .hg-history-end-label__value {
  font-size: 15.5px;
}

/* The ticket names the outcome it trades above YES / NO. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page #hgTicketHead {
  display: none;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #hgTicketHead[data-multi="1"] {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0 0 4px;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #hgTicketHead .hg-brand-tile {
  flex: none;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-ticket-head__text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-ticket-head__text small {
  overflow: hidden;
  color: var(--hv-text-3);
  font: 500 12px/1.3 var(--hv-num-font, system-ui, sans-serif);
  white-space: nowrap;
  text-overflow: ellipsis;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-ticket-head__text strong {
  overflow: hidden;
  color: var(--hv-text);
  font: 700 17px/1.2 var(--hv-num-font, system-ui, sans-serif);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* The ticket's YES / NO: the chosen key in the selected outcome's brand, the
   other plain with its colour bar. Two ids: above the brand layer's chosen
   side rule (markets-brand.css, #marketDetailView #ticketSideButtons) and the
   heavy layer's key rules (markets-heavy.css), which add a gradient. */
html[data-hg-theme] body.hg-markets.hg-predict-market-page #marketDetailView .pm-detail-shell[data-experience="v2"] #ticketSideButtons .pm-outcome-choice.hg-yes-no-choice {
  position: relative !important;
  display: grid !important;
  align-content: center;
  justify-items: center;
  gap: 4px;
  min-height: 60px !important;
  /* Room under the price for the colour bar. */
  padding-top: 6px !important;
  padding-bottom: 14px !important;
  border: 1px solid var(--hv-hair-strong, rgba(0, 0, 0, 0.16)) !important;
  background: var(--hv-well, rgba(0, 0, 0, 0.05)) !important;
  background-image: none !important;
  color: var(--hv-text-2) !important;
  box-shadow: none !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #marketDetailView .pm-detail-shell[data-experience="v2"] #ticketSideButtons .pm-outcome-choice.hg-yes-no-choice > strong,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #marketDetailView .pm-detail-shell[data-experience="v2"] #ticketSideButtons .pm-outcome-choice.hg-yes-no-choice.is-active > strong {
  color: inherit !important;
  background: transparent !important;
  font: 750 15px/1 var(--hv-num-font, system-ui, sans-serif) !important;
  letter-spacing: 0.04em;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #marketDetailView .pm-detail-shell[data-experience="v2"] #ticketSideButtons .pm-outcome-choice.hg-yes-no-choice > span,
html[data-hg-theme] body.hg-markets.hg-predict-market-page #marketDetailView .pm-detail-shell[data-experience="v2"] #ticketSideButtons .pm-outcome-choice.hg-yes-no-choice.is-active > span {
  color: inherit !important;
  background: transparent !important;
  font: 600 12.5px/1 var(--hv-num-font, system-ui, sans-serif) !important;
  font-variant-numeric: tabular-nums;
  opacity: 0.92 !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #marketDetailView .pm-detail-shell[data-experience="v2"] #ticketSideButtons .pm-outcome-choice.hg-yes-no-choice--yes.is-active {
  border-color: var(--hg-yes-fill) !important;
  background: var(--hg-yes-fill) !important;
  background-image: none !important;
  color: var(--hg-yes-ink) !important;
  box-shadow: none !important;
}

html[data-hg-theme] body.hg-markets.hg-predict-market-page #marketDetailView .pm-detail-shell[data-experience="v2"] #ticketSideButtons .pm-outcome-choice.hg-yes-no-choice--no.is-active {
  border-color: var(--hg-no-tone) !important;
  background: color-mix(in srgb, var(--hg-no-tone) 20%, transparent) !important;
  background-image: none !important;
  color: var(--hg-no-ink) !important;
  box-shadow: inset 0 0 0 1px var(--hg-no-tone) !important;
}

/* ── 14. Phones and tablets: a clean page and a full-screen ticket ──────────
   One type scale for the market page and the ticket (12 / 13 / 15 / 18 / 28
   px), the trade dock gone where the outcome rows already offer YES / NO, and
   the ticket covering the whole screen once an outcome and side are chosen. */
@media (max-width: 1099px) {
  html[data-hg-theme] body.hg-markets.hg-predict-market-page.hg-multi-outcome #mobileTradeDock {
    display: none !important;
  }

  /* Match pages too: above the sports rule that keeps the dock out
     (.hg-sports-context-visible #mobileTradeDock:not(.is-ticket-open)). */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page.pm-detail-open.hg-multi-outcome #mobileTradeDock:not(.is-ticket-open) {
    display: none !important;
  }

  /* Match pages lay the workspace out as blocks (sports rule), so the rows
     would sit above the match: a column puts them under its chart instead. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page.pm-detail-open.hg-sports-context-visible.hg-multi-outcome .pm-detail-view .pm-detail-shell[data-experience="v2"] .pm-detail-workspace {
    display: flex !important;
    flex-direction: column !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page.pm-detail-open.hg-sports-context-visible.hg-multi-outcome .pm-detail-view .pm-detail-shell.has-outcomes-rail .pm-outcomes-panel {
    order: 2 !important;
  }

  /* No dock, so no room kept for it under the page (above markets-heavy's
     .pm-detail-open .pm-detail-view:not([hidden])[class][class] rule). */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page.hg-multi-outcome.pm-detail-open .pm-detail-view:not([hidden])[class][class] {
    padding-bottom: calc(24px + env(safe-area-inset-bottom)) !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view .pm-detail-shell.has-outcomes-rail .pm-outcomes-panel {
    padding: 4px 12px 16px !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-line {
    gap: 8px;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-line__pick {
    padding: 0 6px;
  }

  /* YES over its price, NO over its price: two compact keys, with room for
     the colour bar under them. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-side {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
    min-width: 62px;
    padding: 2px 8px 9px;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-side__word {
    font-size: 11px;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .hg-outcome-line__chance {
    font-size: 18px;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page .pm-detail-view #detailTitle {
    font: 650 18px/1.25 var(--hv-num-font, system-ui, sans-serif) !important;
    letter-spacing: -0.01em;
  }

  /* The ticket: full screen, its heading at the top, the action at the bottom. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket.pm-ticket-panel.is-mobile-open {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2600 !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    padding: calc(12px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--hv-slab-fill, #ffffff) !important;
    box-shadow: none !important;
    transform: none !important;
    font-size: 15px !important;
  }

  /* One level above the ticket's content. Every direct child of the ticket is
     a layer of its own at level 1 (markets-terminal.css), and the content
     stack comes after this button, so at the same level the stack was drawn
     over Close and its heading took every tap meant for it: from 2026-11-17
     until this fix, Close did nothing on phones and tablets. */
  html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket.is-mobile-open #closeMobileTicketButton {
    position: absolute !important;
    z-index: 2 !important;
    top: calc(12px + env(safe-area-inset-top)) !important;
    right: 16px !important;
    min-height: 40px !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
    font: 600 13px/1 var(--hv-num-font, system-ui, sans-serif) !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket.is-mobile-open .pm-ticket-trade-stack {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    min-height: 0 !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket.is-mobile-open .pm-ticket-trade-stack__body {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    gap: 14px !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket.is-mobile-open #hgTicketHead {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 84px 6px 0;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket.is-mobile-open #ticketPrimaryBlocker {
    margin-top: auto !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket.is-mobile-open .pm-order-type-toggle button {
    min-height: 40px !important;
    font: 600 13px/1.2 var(--hv-num-font, system-ui, sans-serif) !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket.is-mobile-open #tradePrimaryInputLabel {
    font: 600 12px/1 var(--hv-num-font, system-ui, sans-serif) !important;
    letter-spacing: 0.02em;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket.is-mobile-open .pm-amount-currency,
  html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket.is-mobile-open #orderAmount {
    font: 650 28px/1.1 var(--hv-num-font, system-ui, sans-serif) !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket.is-mobile-open .pm-quick-amounts button {
    min-height: 44px !important;
    font: 600 14px/1 var(--hv-num-font, system-ui, sans-serif) !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket.is-mobile-open #twoStateSelectedLabel {
    font: 600 12px/1.2 var(--hv-num-font, system-ui, sans-serif) !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket.is-mobile-open #twoStateSelectedValue {
    font: 700 22px/1.1 var(--hv-num-font, system-ui, sans-serif) !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket.is-mobile-open .pm-ticket-view-only {
    font: 500 13px/1.35 var(--hv-num-font, system-ui, sans-serif) !important;
  }

  html[data-hg-theme] body.hg-markets.hg-predict-market-page #orderTicket.is-mobile-open #prepareOrderButton {
    min-height: 52px !important;
    font: 650 16px/1 var(--hv-num-font, system-ui, sans-serif) !important;
  }
}
