/* The one market row (.mrow) and the one live-trade row (.ltr), on Home and the Markets page (dashboard/market-row.js).
   Its own colours from theme.css's --ob-* tokens (fallbacks where theme.css is not served), so the row reads the same
   on both pages. Green and red only mean up and down. Numbers change in place and never flash. */
.mrows, .ltrs {
  --mr-t1: var(--ob-ink, #f4f4f5); --mr-t2: #b3b5bb; --mr-t3: #8a8d95; --mr-line: rgba(255, 255, 255, 0.06);
  --mr-up: var(--ob-up, #1fd170); --mr-up-soft: rgba(31, 209, 112, 0.10); --mr-up-on: rgba(31, 209, 112, 0.18);
  --mr-down: var(--ob-down, #ff4d5a); --mr-down-soft: rgba(255, 77, 90, 0.10); --mr-down-on: rgba(255, 77, 90, 0.18);
  --mr-raised: #111113; --mr-pad: 0px;
}
.mrows { display: flex; flex-direction: column; border-top: 1px solid var(--mr-line); container-type: inline-size; }
.mrows .num, .ltrs .num { font-variant-numeric: tabular-nums; }

/* ---------- the market row: star, icon, name over price and change, the length's line, Up / Down ---------- */
.mrow { box-sizing: border-box; display: grid; grid-template-columns: 24px 32px minmax(0, 1fr) 96px 216px; column-gap: 12px; align-items: center; min-height: 64px; padding: 8px 0; border-bottom: 1px solid var(--mr-line); color: var(--mr-t1); font-size: 14px; line-height: 20px; }
.mrow.nostar { grid-template-columns: 32px minmax(0, 1fr) 96px 216px; }
.mrow .ico { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: #19191c; color: #fff; font-size: 12px; font-weight: 700; line-height: 1; overflow: hidden; font-variant-numeric: normal; }
.mrow .r-n { display: flex; flex-direction: column; min-width: 0; }
.mrow .r-n a { color: var(--mr-t1); text-decoration: none; font-size: 14px; line-height: 20px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) { .mrow .r-n a:hover { color: #fff; text-decoration: none; } }
.mrow .r-s { font-size: 12px; line-height: 16px; color: var(--mr-t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow .r-s .p { color: var(--mr-t2); }
.mrow .r-s .chg:not(:empty) { margin-left: 6px; }
.mrow .r-s .chg.up { color: var(--mr-up); } .mrow .r-s .chg.down { color: var(--mr-down); }
.mrow .r-sp { display: block; width: 96px; height: 32px; overflow: visible; }
.mrow .r-sp .ln { fill: none; stroke: var(--mr-t3); stroke-width: 1.5; stroke-linejoin: round; }
.mrow .r-sp.up .ln { stroke: var(--mr-up); } .mrow .r-sp.down .ln { stroke: var(--mr-down); }
.mrow .r-b { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
/* Up / Down: a button on Home (its sheet and 1-tap), a link on the Markets page (the Trade page on that side); one look */
.mrow .ud { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; height: 34px; padding: 0 10px; border: 0; border-radius: 10px; font: 600 13px/1 var(--ob-sans, inherit); cursor: pointer; white-space: nowrap; text-decoration: none; box-sizing: border-box; transition: background-color 120ms; }
.mrow .ud > span, .mrow .ud b { flex: none; overflow: visible; font-weight: 600; }
.mrow .ud .amt { display: none; }
.mrow .ud.u { background: var(--mr-up-soft); color: var(--mr-up); }
.mrow .ud.d { background: var(--mr-down-soft); color: var(--mr-down); }
@media (hover: hover) { .mrow .ud.u:hover { background: var(--mr-up-on); } } @media (hover: hover) { .mrow .ud.d:hover { background: var(--mr-down-on); } }
.mrow .ud:disabled, .mrow .ud.off { background: var(--mr-raised); color: var(--mr-t3); cursor: default; }
@media (hover: hover) { .mrow .ud.off:hover { background: var(--mr-raised); color: var(--mr-t3); cursor: default; } }
.mrow .ud:disabled b, .mrow .ud.off b { font-weight: 500; }
.mrow .ud.busy { opacity: 0.6; }
.mrow .ud:focus-visible, .mrow .star:focus-visible, .mrow .r-n a:focus-visible { outline: 2px solid rgba(244, 244, 245, 0.75); outline-offset: 2px; }
/* the star: an outline when not watched, filled when watched */
.mrow .star, .star[data-watch] { display: inline-grid; place-items: center; width: 24px; height: 32px; margin: 0; padding: 0; border: 0; border-radius: 999px; background: transparent; color: #71717a; cursor: pointer; flex: none; }
@media (hover: hover) { .star[data-watch]:hover { color: #a1a1aa; } }
.star[data-watch] svg path { fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; }
.star[data-watch].on { color: #f4f4f5; }
.star[data-watch].on svg path { fill: currentColor; }

/* a class heading inside the list (the Markets page, sorted by type) */
.mrows .mgrp { padding: 18px 0 8px; font-size: 15px; font-weight: 600; color: var(--mr-t1); border-bottom: 1px solid var(--mr-line); }
.mrows .mgrp:first-child { padding-top: 6px; }

/* a phone row: name, price and change, then Up / Down with the word over its price (Robinhood's phone list) */
@media (max-width: 640px) {
  .mrow { grid-template-columns: 24px 32px minmax(0, 1fr) 148px; column-gap: 10px; min-height: 60px; }
  .mrow.nostar { grid-template-columns: 32px minmax(0, 1fr) 148px; }
  .mrow .r-sp { display: none; }
  .mrow .r-b { gap: 4px; }
  /* the price and its change wrap onto two lines rather than cut the change ("−0.…") */
  .mrow .r-s { white-space: normal; overflow: visible; text-overflow: clip; }
  .mrow .r-s .p, .mrow .r-s .chg, .mrow .r-s .e { white-space: nowrap; }
  /* a long name ("OpenAI valuation", "Hyperliquid") wraps between words, never cut with an ellipsis */
  .mrow .r-n a { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: normal; word-break: normal; }
  .mrow .ud { flex-direction: column; justify-content: center; height: 44px; padding: 0 4px; gap: 3px; }
  .mrow .ud > span { font-size: 11px; font-weight: 500; line-height: 1; }
  .mrow .ud b { line-height: 1; }
}
@media (max-width: 359px) {
  .mrow { grid-template-columns: 20px 28px minmax(0, 1fr) 132px; column-gap: 8px; }
  .mrow.nostar { grid-template-columns: 28px minmax(0, 1fr) 132px; }
  .mrow .ico { width: 28px; height: 28px; font-size: 11px; }
  .mrow .star { width: 20px; }
  .mrow .r-n a { white-space: normal; overflow: visible; text-overflow: clip; }
}
/* touch: Up / Down, the name and the star are real 44px taps (one hit area each: no ::after areas on these) */
@media (pointer: coarse) {
  .mrow .ud { min-height: 44px; }
  .mrow .r-n a { display: inline-flex; align-items: center; min-height: 44px; }
  .mrow .star { height: 44px; }
}

/* ---------- the live-trade row: chip and the trade, the time and who under it, the money on the right ---------- */
.ltr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 16px; align-items: center; min-height: 60px; padding: 10px var(--mr-pad); border-top: 1px solid var(--mr-line); box-sizing: border-box; }
.ltr:first-child { border-top: 0; }
.ltr .mid { min-width: 0; }
.ltr .t { color: var(--mr-t2); font-variant-numeric: lining-nums tabular-nums; margin-right: 8px; }
.ltr .c1 { display: flex; align-items: flex-start; gap: 8px; min-width: 0; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--mr-t1); }
.ltr .c1 .nm { min-width: 0; overflow-wrap: break-word; }
/* the line under a trade wraps between words and never cuts a price in half; at most two lines */
.ltr .c2 { font-size: 13px; line-height: 18px; color: var(--mr-t2); margin-top: 2px; font-variant-numeric: lining-nums proportional-nums; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ltr .c2 .you { margin-left: 4px; color: #d4d4d8; font-weight: 510; }
.ltr .rt { text-align: right; line-height: 1.25; }
.ltr .pp { display: block; font-size: 14px; font-weight: 600; color: var(--mr-t1); font-variant-numeric: tabular-nums; }
.ltr .pp.dim { color: var(--mr-t3); font-weight: 500; }
.ltr .ps { display: block; font-size: 13px; color: var(--mr-t2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.ltr .up, .ltr .pp.up { color: var(--mr-up); } .ltr .down, .ltr .pp.down { color: var(--mr-down); }
/* one badge width (Bought, Sold, Won, Lost), so the titles line up; quiet grey, never green / red */
.ltr .dchip { display: inline-flex; align-items: center; justify-content: center; min-width: 60px; box-sizing: border-box; height: 20px; font-size: 12px; font-weight: 600; line-height: 20px; padding: 0 8px; border-radius: 999px; flex: 0 0 auto; background: rgba(255, 255, 255, 0.06); color: #d4d4d8; }

/* the length switch over a list of rows (5 min / 15 min): the Markets page's; Home's .seg looks the same */
.mr-len { display: inline-flex; flex: none; gap: 2px; padding: 2px; border-radius: 999px; background: #111113; }
.mr-len button { height: 28px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: #8a8d95; font: 500 12px/1 var(--ob-sans, inherit); cursor: pointer; white-space: nowrap; }
@media (hover: hover) { .mr-len button:hover { color: #f4f4f5; } }
.mr-len button.on { background: #19191c; color: #f4f4f5; font-weight: 600; }
.mr-len button:focus-visible { outline: 2px solid rgba(244, 244, 245, 0.75); outline-offset: 2px; }
@media (pointer: coarse) { .mr-len button { height: 44px; min-width: 56px; } }

/* ---------- a wide list: name and price, a wider line, Up / Down. No extra figure columns: "$0 traded" was a wall of
   zeros (round 5) and "Chance up 50%" / one shared end time said the same thing on every row (round 6, reviewed) ---------- */
.mrow .r-x, .mrows > .mrhead > .r-x { display: none !important; }
@container (min-width: 720px) {
  .mrow { grid-template-columns: 24px 32px minmax(0, 1fr) 160px 216px; }
  .mrow.nostar { grid-template-columns: 32px minmax(0, 1fr) 160px 216px; }
  .mrow .r-sp { width: 160px; }
}
@container (min-width: 940px) {
  .mrow { grid-template-columns: 24px 32px minmax(0, 1fr) 240px 232px; }
  .mrow.nostar { grid-template-columns: 32px minmax(0, 1fr) 240px 232px; }
  .mrow .r-sp { width: 240px; }
}
/* the one header row over a wide list (round 6): each column named once, never under every value */
.mrhead { display: none !important; box-sizing: border-box; column-gap: 12px; align-items: center; min-height: 32px; padding: 6px 0; border-bottom: 1px solid var(--mr-line); color: var(--mr-t3); font-size: 12px; line-height: 16px; font-weight: 500; }
.mrhead > .r-x { display: none; }
.mrhead .r-x > span { text-align: right; justify-content: flex-end; }
.mrhead .hb { text-align: center; }
/* round 6: on a phone the price and its change never run under Up / Down: the name column clips, the change and its
   window wrap to their own line */
@media (max-width: 640px) {
  .mrow .r-n { overflow: hidden; }
  .mrow .r-s { display: flex; flex-wrap: wrap; column-gap: 6px; }
  .mrow .r-s .p { flex-basis: 100%; overflow: hidden; text-overflow: ellipsis; }
  .mrow .r-s .chg:not(:empty) { margin-left: 0; }
}
/* the star is a 44x44 tap on touch, the 16px glyph drawn small inside it (critic r6) */
@media (pointer: coarse), (max-width: 900px) {
  .mrow .star { width: 44px; height: 44px; margin: 0 -10px; }
  .star[data-watch] { min-width: 44px; min-height: 44px; }
}

/* round 7 (critic r1): a narrow rail (Home's and Markets' Live trades) wrapped the line under a trade mid-phrase
   ("4:06:38 AM  Trader 4D20 · at" / "$0.5138"). The time never splits from its AM, and where the row is narrow the price
   per $1 steps out (the money on the right says what was paid and what it pays; the tooltip keeps it), so a trade's
   line is one line; a result's longer line ("ended at $67,840.12") still wraps between words, never inside a price */
.ltr { container-type: inline-size; }
.ltr .c2 .t, .ltr .c2 .at { white-space: nowrap; }
@container (max-width: 420px) { .ltr .c2 .at { display: none; } }
/* round 8: the 5 min / 15 min switch is a 44px tap on every touch-sized layout, the track drawn as before */
@media (pointer: coarse), (max-width: 1024px), (max-height: 500px) { .mr-len button { height: 44px; min-width: 56px; } .mr-len { padding: 0; } }

/* round 1 (final-pass r9 critic): a phone row is Robinhood's two-line row: the name over its price and change, the
   block centred on the Up / Down chips. The name keeps a 44px tap through padding that takes no room in the row (no
   tall gap under it any more), and the price and change share one line, wrapping only where they cannot fit (320). */
@media (max-width: 640px) {
  .mrow .r-n { justify-content: center; align-self: center; }
  .mrows .mrow .r-n a { display: block; min-height: 0; padding: 12px 0; margin: -12px 0; line-height: 20px; }
  .mrow .r-s { display: flex; flex-wrap: wrap; column-gap: 6px; row-gap: 0; }
  .mrow .r-s .p { flex-basis: auto; }
}
@media (max-width: 640px) {
  html body .mrows .mrow .ud > span { font-size: 12px; font-weight: 500; line-height: 1; }
  html body .mrows .mrow .ud b { font-size: 14px; font-weight: 600; opacity: 1; line-height: 1; }
  .mrow { grid-template-columns: 24px 32px minmax(0, 1fr) 128px; }
  .mrow.nostar { grid-template-columns: 32px minmax(0, 1fr) 128px; }
}
@media (max-width: 359px) {
  .mrow { grid-template-columns: 20px 28px minmax(0, 1fr) 120px; }
  .mrow.nostar { grid-template-columns: 28px minmax(0, 1fr) 120px; }
  html body .mrows .mrow .ud { padding: 0 6px; }
}
/* pressed: Up / Down give a little under the finger on Home and Markets alike (UX-14; was Home's only) */
.ud:active:not(:disabled):not(.off):not([aria-disabled="true"]) { transform: scale(0.97); opacity: 1; filter: brightness(0.9); }
.mrow .star:active { transform: scale(0.9); }
@media (prefers-reduced-motion: reduce) { .ud:active { transform: none; } }

/* the whole row opens the market, on Home and on Markets alike (UX-23, UX-66): the name's link stretches over the row,
   so a click anywhere, Cmd / Ctrl-click, a middle-click, "Copy link" and the status-bar address all work; the star and
   Up / Down sit above it and keep their own jobs */
.mrow { position: relative; cursor: pointer; }
.mrow .r-n a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.mrow .star, .mrow .r-b, .mrow .ud { position: relative; z-index: 1; }
@media (hover: hover) { .mrow:hover { background-color: rgba(255, 255, 255, 0.025); } }
.mrow .r-n a:focus-visible { outline: none; }
.mrow:has(.r-n a:focus-visible) { box-shadow: inset 0 0 0 2px rgba(244, 244, 245, 0.75); border-radius: 8px; }
/* 320-359px (critic: rows jumped between two and three lines as "$68,020.61 −0.60%" wrapped): the star steps out (the
   Trade page and wider screens keep it), so every row is two lines, the change beside the price */
@media (max-width: 359px) {
  .mrow, .mrow.nostar { grid-template-columns: 28px minmax(0, 1fr) 120px; }
  .mrow .star { display: none; }
  .mrow .r-s { flex-wrap: nowrap; column-gap: 4px; }
  .mrow .r-s .chg { font-size: 12px; } /* r24: 12px fits beside the price (the longest, "$58,857.70 −5.12%", measured at 320) */
}

/* Quotes shown on each action are per $1 of payout. A one-tap action also shows
   the amount and an estimate at this side's ask. Compact lists put the two
   actions below the market name so long amounts can wrap in either column. */
.tap-payout:empty { display: none; }
.ud .tap-payout, .fc-b .tap-payout {
  font-size: 12px; font-weight: 500; line-height: 1.25; color: var(--ob-ink, #f4f4f5);
  white-space: normal; overflow-wrap: anywhere; text-align: left;
}
body .mrows .mrow .ud, body .sl-b .ud.big, body .ic-b .ud, body .fc-b .udl.fb {
  height: auto; min-height: 44px; min-width: 0; flex-direction: column; padding: 7px 9px; align-items: flex-start;
  justify-content: center; gap: 3px; white-space: normal; overflow-wrap: anywhere; text-align: left;
}
body.ot-on .mrows .mrow .ud, body.ot-on .sl-b .ud.big, body.ot-on .ic-b .ud, body.ot-on .fc-b .udl.fb {
  height: auto; min-height: 50px; padding: 7px 9px;
}
body.ot-on .ud .amt { font-style: normal; }
body .mrow .r-b { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container (max-width: 440px) {
  body .mrows .mrow { grid-template-columns: 24px 32px minmax(0, 1fr); row-gap: 6px; }
  body .mrows .mrow.nostar { grid-template-columns: 32px minmax(0, 1fr); }
  body .mrow .r-sp { display: none; }
  body .mrow .r-b { grid-column: 1 / -1; }
}
@media (max-width: 359px) {
  body .mrows .mrow { grid-template-columns: 28px minmax(0, 1fr); }
}
body [data-firm] b { font-size: 13px; font-variant-numeric: tabular-nums; line-height: 1.25; }

body.ot-on .mrows .mrow .ud, body.ot-on .sl-b .ud.big, body.ot-on .ic-b .ud, body.ot-on .fc-b .udl.fb {
  height: 44px; min-height: 44px; align-items: center; justify-content: center; padding: 0 8px;
}
body.ot-on .fc-b { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.ot-on :is(.r-b, .sl-b, .ic-b, .fc-b) { row-gap: 3px; }
body.ot-on :is(.ud, .udl.fb) b:empty { display: none; }

/* a price that is loading (firm-digital.js firm-wait): the last payout, dimmed, until the fresh one lands */
.firm-caption.firm-wait { opacity: .55; }

/* Portfolio's Popular markets cards (portfolio.js): "Buy Up" on the button, "Pays $1.95" under it */
.pfudw { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pfudw .pfpay { font-size: 12px; line-height: 16px; color: var(--ob-ink-2, #d4d4d8); text-align: center; font-variant-numeric: tabular-nums; }
/* touch (r16 devices: "Pays $1.95" measured 16px tall on every phone and iPad): the payout opens its exact terms, so it
   is a real 44px tap, centred on its text; it takes the row's bottom padding first, so the row grows only a little */
@media (pointer: coarse) {
  details.firm-caption > summary { min-height: 44px; line-height: 44px; margin: -6px 0 -10px; } /* rows and Featured cards; the ▸ kept */
}

/* r18: the disclosure on a row's quote is a small chevron, not the browser's solid triangle (it read as a play button) */
details.firm-caption > summary { list-style: none; }
details.firm-caption > summary::-webkit-details-marker { display: none; }
details.firm-caption > summary::after { content: "\203A"; display: inline-block; margin-left: 4px; color: var(--ob-ink-3, #8a8f98); transition: transform .15s; }
details.firm-caption[open] > summary::after { transform: rotate(90deg); }
/* r27 design audit: a closed market's row says "Closed · opens …" once; no "Closed ›" disclosure under each button */
.is-closed details.firm-caption { display: none; }

/* r27 (vihan, 21 Nov): Markets only lists markets. A list row: star, icon, name with its price and change, the price's
   line; the whole row opens the market's Trade page (feeds/page.js). No Up / Down on a list. */
.mrows .mrow.listonly { position: relative; grid-template-columns: 24px 32px minmax(0, 1fr) 96px; cursor: pointer; }
.mrows .mrow.listonly.nostar { grid-template-columns: 32px minmax(0, 1fr) 96px; }
.mrows .mrow.listonly .r-n a::after { content: ''; position: absolute; inset: 0; }
.mrows .mrow.listonly .star { position: relative; z-index: 1; }
@media (hover: hover) { .mrows .mrow.listonly:hover { background: rgba(255, 255, 255, 0.03); } }
@container (min-width: 720px) { .mrows .mrow.listonly { grid-template-columns: 24px 32px minmax(0, 1fr) 160px; } .mrows .mrow.listonly.nostar { grid-template-columns: 32px minmax(0, 1fr) 160px; } }
@container (min-width: 940px) { .mrows .mrow.listonly { grid-template-columns: 24px 32px minmax(0, 1fr) 240px; } .mrows .mrow.listonly.nostar { grid-template-columns: 32px minmax(0, 1fr) 240px; } }
@media (max-width: 640px) {
  .mrows .mrow.listonly { grid-template-columns: 24px 32px minmax(0, 1fr) 80px; }
  .mrows .mrow.listonly.nostar { grid-template-columns: 32px minmax(0, 1fr) 80px; }
  .mrows .mrow.listonly .r-sp { display: block; width: 80px; height: 28px; }
}
@media (max-width: 359px) { .mrows .mrow.listonly { grid-template-columns: 20px 28px minmax(0, 1fr) 64px; } .mrows .mrow.listonly .r-sp { width: 64px; } }
/* r27 responsive: at 320-359 the list keeps its star in the 20px column above (the row rule hid it, so the icon fell into
   the star's column, the name into the icon's 28px and Markets read "Bitc", "Gold" at 320); no star (nostar) drops the column */
@media (max-width: 359px) {
  .mrows .mrow.listonly .star { display: inline-grid; width: 20px; }
  .mrows .mrow.listonly.nostar { grid-template-columns: 28px minmax(0, 1fr) 64px; }
}
/* a closed / paused note: " · Closed · opens …" after the price; on a phone it sits on its own line, with no leading dot */
.mrow .r-s .e.dot::before { content: '\00a0\00b7\00a0'; }
@media (max-width: 640px) { .mrow .r-s .e.dot { display: block; } .mrow .r-s .e.dot::before { content: none; } }
/* r27 responsive: a closed market's note is its own line under the price and wraps rather than losing its end
   ("opens Sun 3:00 PM P" at 375; at 320 the nowrap row squeezed the price out entirely) */
@media (max-width: 640px) {
  .mrow .r-s:has(.e.dot) { flex-wrap: wrap; }
  .mrow .r-s .e.dot { flex-basis: 100%; white-space: normal; }
}
