/* The Trade page, Robinhood's look (rh.js). Measured from Robinhood's web pages (design-spec/DESIGN-SPEC.md, refs/rh-*):
   the page #000, the order card near-black (#09090a) with a hairline edge, the name over a big regular-weight price, one clean line
   chart with no grid, spaced uppercase range tabs with a small underline, label/value rows over hairlines, one 44px
   pill. The accent (the line, the tab underline, the pill) is green when the price is up over the range, red when
   down (rh-up / rh-down on body, human.js renderTop). Loaded last: one layer over trade-look.css.
   Near-black, no grey boxes: fills no lighter than #121214; a selected thing is a ring and white ink, not a lighter box.
   Motion is purposeful and short: the phone's sheet slides, a view fades in, the accent's tint eases when the direction
   turns, a tapped button gives. Numbers never animate. */
html.rh { --rh-bg: #000; --rh-card: #09090a; --rh-fill: #121214; --rh-edge: rgba(255, 255, 255, 0.10); --rh-edge-hi: rgba(255, 255, 255, 0.22); --rh-line: rgba(255, 255, 255, 0.09); --rh-soft: rgba(255, 255, 255, 0.06); --rh-t1: #fff; --rh-t2: #b3b5bb; --rh-t3: #8a8d95; --rh-acc: var(--ob-up); --rh-acc-ink: #000; }
html.rh body.rh-down { --rh-acc: var(--ob-down); }
html.rh, html.rh body { background: #000; }
html.rh .top, html.rh .mkts { background: #000; }

/* ---------- layout: chart column and the order card; sections under the chart ---------- */
@media (min-width: 701px) {
  html.rh .app, html.rh body.has-sbar .app { grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto auto auto 1fr; gap: 0 56px; max-width: var(--page-w, 1240px); padding: 28px 32px 96px; }
  html.rh.tk-simple .app > .chartcol { grid-column: 1; grid-row: 1; background: transparent; border: 0; border-radius: 0; padding: 0; }
  html.rh .app > #rhSecs { grid-column: 1; grid-row: 2; }
  html.rh .app > #rhSecs2 { grid-column: 1; grid-row: 4; }
  html.rh.tk-simple .app > #pf { grid-column: 1; grid-row: 3; background: transparent; border: 0; border-radius: 0; padding: 0; margin-top: 40px; }
  html.rh.tk-simple .app > .side { grid-column: 2; grid-row: 1 / span 4; position: sticky; top: calc(var(--hdr, 64px) + 20px); align-self: start; background: transparent; border: 0; border-radius: 0; padding: 0; }
  /* More ways to trade: the drawer is fixed to the window's height and scrolls, its Buy sticky at the bottom (critic r1:
     the card's sticky rule above won, the drawer grew as tall as its content and Buy sat under the window's edge) */
  html.rh.tk-simple body.tk-more .app > .side { position: fixed; top: 0; right: 0; bottom: 0; align-self: stretch; height: auto; max-height: none; width: min(480px, 100vw); max-width: none; margin: 0; overflow-y: auto; background: var(--tk-sheet, #0d0d0f); padding-top: var(--tk-mh); }
}
@media (min-width: 901px) and (max-width: 1100px) { html.rh .app, html.rh body.has-sbar .app { grid-template-columns: minmax(0, 1fr) 320px; gap: 0 28px; padding: 24px 20px 96px; } }
/* a tablet held upright (701-900px): round 9 (critic r9: "a 340px chart and bubble chips" beside a 300px rail) stacks it
   as Robinhood and Kalshi do on an iPad: the chart full width, the phone's bottom bar with Up and Down (or 1-tap's), and
   the card as a sheet that is a card, centred, never the full width. (Final-pass r5's complaint was the card 720px wide
   under the chart with Place trade below the fold; the bar keeps Up and Down on the first screen.) */
@media (min-width: 701px) and (max-width: 900px) and (min-height: 501px) {
  html.rh .app, html.rh body.has-sbar .app { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 20px 24px calc(96px + var(--bbar-h, 0px) + env(safe-area-inset-bottom)); }
  html.rh body .chartwrap, html.rh body .chartwrap #chart { height: clamp(300px, 40vh, 440px); }
}
/* a short screen (a phone on its side, any window under ~500px tall): the phone's pattern, never the card beside the chart
   (founder, 18 Nov, after three rounds of Place trade sitting over the amount at 844x390): one column, a bottom bar with
   Trade (or 1-tap's Up and Down), and the card as a small sheet laid out in two columns so Up/Down, Amount, the chips,
   Pays if right and Place trade are all on screen at once with nothing under the button */
@media (min-width: 560px) and (max-height: 500px) { /* r27: 560, so a sideways small phone (667x375) gets the two-column sheet too */
  html.rh .app, html.rh body.has-sbar .app { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 12px 20px calc(96px + env(safe-area-inset-bottom)); }
  html.rh body .chartwrap, html.rh body .chartwrap #chart { height: 220px; }
  html.rh body .chartwrap { margin-top: 8px; }
  html.rh body .pxblock .px { font-size: 28px; line-height: 34px; }
  html.rh body .tk-asset .symn, html.rh body .pxblock .symn { font-size: 20px; line-height: 26px; }
  html.rh body.rh-sheet:not(.tk-more) .app > .side, html.rh.tk-simple body.rh-sheet:not(.tk-more) .app > .side { left: max(0px, calc(50% - 390px)); right: max(0px, calc(50% - 390px)); max-height: calc(100vh - 8px); }
  html.rh body.rh-sheet .rhc { position: relative; }
  html.rh body.rh-sheet .rhc-h { min-height: 48px; }
  html.rh body.rh-sheet .rhv:not([hidden]) { columns: 2; column-gap: 28px; column-fill: balance; padding: 10px 20px 12px; }
  html.rh body.rh-sheet .rhv > * { break-inside: avoid; }
  html.rh body.rh-sheet #rhForm > .ramt, html.rh body.rh-sheet #rhRev > .rhr:first-of-type, html.rh body.rh-sheet #rhDone > .rhr:first-of-type { break-before: column; }
  html.rh body.rh-sheet .rhv .rhr { min-height: 30px; }
  html.rh body.rh-sheet .rhv .rhr.ramt { min-height: 44px; }
  html.rh body.rh-sheet .rhwhen { margin: 0 0 6px; }
  html.rh body.rh-sheet .rh1t { margin: 0 0 8px; padding-bottom: 6px; }
  html.rh body.rh-sheet .rhside { margin-bottom: 8px; }
  html.rh body.rh-sheet .rhchips { margin: 0 0 4px; }
  html.rh body.rh-sheet #rhGo, html.rh body.rh-sheet #rvGo, html.rh body.rh-sheet #dnGo { height: 48px; margin-top: 8px; }
  html.rh body.rh-sheet .rhs { height: 48px; }
  /* Ask AI sits under Up and Down in the left column, not as a row under both */
  html.rh body.rh-sheet #rhOrder[data-view="form"] > #rhAsk { position: absolute; left: 4px; bottom: 52px; width: calc(50% - 18px); border-top: 0; }
  html.rh body.rh-sheet:not(.tk-more) .app > .side:has(#rhOrder[data-view="form"]) > .tk-morelink { position: absolute; left: 24px; bottom: 12px; width: auto; min-height: 44px; margin: 0; padding: 0; text-align: left; }
  html.rh body.rh-sheet:not(.tk-more) .app > .side:has(#rhOrder[data-view="form"]) { padding-bottom: 0; }
  .rhbar .rhpill { max-width: 360px; }
  /* r27 responsive: the left column's foot is a stack (Ask AI, More ways, the fee line) with room kept for it, so it
     never lands on Quote details (1-tap on) or runs off the sheet's bottom (1-tap off) at 844x390 / 667x375 */
  html.rh body.rh-sheet #rhOrder[data-view="form"] > #rhAsk { bottom: 70px; min-height: 40px; }
  html.rh body.rh-sheet:not(.tk-more) .app > .side:has(#rhOrder[data-view="form"]) > .tk-morelink { bottom: 30px; min-height: 40px; display: flex; align-items: center; }
  html.rh body.rh-sheet #rhOrder[data-view="form"] > #rhFee { position: absolute; left: 24px; bottom: 12px; width: calc(50% - 38px); padding: 0; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* 1-tap on: no Place trade on the right, so Quote details goes to the right column and the left keeps the foot's room */
  html.rh body.rh-sheet #rhOrder.one[data-view="form"] #rhForm > .rhterms { break-before: column; }
  html.rh body.rh-sheet #rhOrder.one[data-view="form"] #rhForm > .ramt { break-before: auto; }
  html.rh body.rh-sheet #rhOrder.one[data-view="form"] #rhForm:not([hidden]) { padding-bottom: 112px; }
}

/* ---------- the header: name, price, change ---------- */
html.rh .pxblock .coin, html.rh .pxblock .symt, html.rh .pxblock .orl { display: none; }
html.rh .tk-asset { margin: -6px 0 0 -10px; padding: 4px 10px; border-radius: 8px; }
html.rh .tk-asset .sym { grid-template-columns: max-content 20px max-content; }
html.rh .tk-asset .symn, html.rh .pxblock .symn { grid-column: 1; font-size: 26px; line-height: 32px; font-weight: 500; letter-spacing: -0.01em; }
html.rh .tk-asset .tk-chev { grid-column: 2; }
html.rh .tk-asset .feed { grid-row: 1; grid-column: 3; justify-self: start; margin-left: 4px; font-size: 13px; }
html.rh .pxblock .pxrow { margin-top: 2px; gap: 0 8px; }
html.rh .pxblock .px { font-size: 36px; line-height: 44px; font-weight: 400; letter-spacing: -0.02em; }
html.rh .pxblock .chg, html.rh .pxblock .chg.up, html.rh .pxblock .chg.down { margin-top: 2px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--rh-t1); }
html.rh .pxblock .chg.up { color: var(--ob-up); }
html.rh .pxblock .chg.down { color: var(--ob-down); }
html.rh .pxblock .chgl { margin-top: 2px; font-size: 14px; line-height: 20px; font-weight: 400; color: var(--rh-t3); }

/* ---------- the chart: no frame, no grid; the tabs under it ---------- */
html.rh .chartwrap { height: 320px; margin-top: 20px; }
html.rh.tk-simple .lwhost { border: 0; border-radius: 0; }
html.rh .chfoot { position: relative; margin-top: 8px; padding-bottom: 0; border-bottom: 1px solid var(--rh-line); align-items: center; }
html.rh .chfoot .rng, html.rh.tk-simple .chfoot .rng { gap: 4px; margin: 0; }
html.rh .chfoot .rng button, html.rh.tk-simple .chfoot .rng button, html.rh.tk-simple .chfoot .rng button.on { position: relative; min-height: 44px; padding: 0 12px; border: 0; border-radius: 0; background: transparent; color: var(--rh-t1); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; box-shadow: none; }
html.rh .chfoot .rng button:first-child { padding-left: 0; }
@media (hover: hover) { html.rh .chfoot .rng button:hover, html.rh.tk-simple .chfoot .rng button:hover { background: transparent; color: var(--rh-acc); } }
html.rh .chfoot .rng button.on { color: var(--rh-acc); }
html.rh .chfoot .rng button.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 2px; background: var(--rh-acc); border-radius: 1px; }
html.rh .chfoot .rng button.on:first-child::after { left: 0; }
html.rh .chfoot .rng button[data-r="0"]::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 6px 2px 0; border-radius: 50%; background: currentColor; vertical-align: middle; }
html.rh .chfoot .lwattr { margin-top: 0; font-size: 11px; color: #55585f; }
html.rh .lwlive { right: 72px; bottom: 36px; background: #0c0c0e; border-color: var(--rh-edge); }
html.rh .tip { background: var(--rh-card); box-shadow: 0 0 0 1px var(--rh-edge); }

/* ---------- the order card ---------- */
html.rh body:not(.tk-more) #updown, html.rh body:not(.tk-more) .side > .card.updown { display: none !important; }
html.rh body.tk-more #rhOrder { display: none; }
.rhc { background: var(--rh-card); border: 1px solid var(--rh-edge); border-radius: 6px; color: var(--rh-t1); font-size: 13px; line-height: 18px; }
.rhc-h { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px; border-bottom: 1px solid var(--rh-edge); }
.rhc-h h2 { flex: 0 0 auto; white-space: nowrap; margin: 0; font-size: 15px; line-height: 20px; font-weight: 600; letter-spacing: 0; }
/* the close X stays at the sheet's right edge when the length picker is hidden (the placed view) */
.rhc-h h2 { margin-right: auto; }
.rhc-len { position: relative; flex: 1 1 auto; min-width: 0; display: flex; justify-content: flex-end; }
.rhc-len select { max-width: 100%; text-overflow: ellipsis; }
.rhc-len[hidden] { display: none; }
.rhc-len select { appearance: none; -webkit-appearance: none; height: 32px; padding: 0 28px 0 12px; border: 1px solid var(--rh-edge); border-radius: 6px; background: #000 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 6.5 8 3.5 11 6.5M5 9.5 8 12.5 11 9.5' fill='none' stroke='%23fff' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center / 12px; color: var(--rh-t1); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.rhc-len select:focus-visible { border-color: #6b747a; }
@media (hover: hover) { .rhc-len select:hover { border-color: #6b747a; } }
.rhc-x { display: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--rh-t3); cursor: pointer; }
.rhc-x svg { width: 16px; height: 16px; }
.rhv { padding: 16px 20px 20px; }
.rhv[hidden] { display: none; }
.rhside { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.rhs { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; white-space: nowrap; height: 44px; padding: 0 12px; border: 0; border-radius: 6px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.rhs.u { background: var(--ob-up-bg); color: var(--ob-up); }
.rhs.d { background: var(--ob-down-bg); color: var(--ob-down); }
.rhs.u.on { background: rgba(31, 209, 112, 0.18); box-shadow: inset 0 0 0 1.5px var(--ob-up); }
.rhs.d.on { background: rgba(255, 77, 90, 0.18); box-shadow: inset 0 0 0 1.5px var(--ob-down); }
.rhside:has(.on) .rhs:not(.on) { background: #0c0c0e; color: var(--rh-t3); box-shadow: inset 0 0 0 1px var(--rh-edge); }
.rhs:disabled { opacity: 0.45; cursor: default; }
.rhs-p { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rhr { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.rhr > span, .rhr > label { color: var(--rh-t1); font-weight: 500; }
.rhr > b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.rhr > b.up { color: var(--ob-up); }
.rhr.ramt { min-height: 48px; }
.rhr.tot { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--rh-edge); }
.rhr.tot > span, .rhr.tot > b { font-weight: 700; }
.rhamt { display: inline-flex; align-items: center; gap: 2px; width: 144px; height: 40px; padding: 0 12px; border: 1px solid var(--rh-edge); border-radius: 4px; background: #000; color: var(--rh-t3); }
.rhamt:focus-within { border-color: #8a949a; }
.rhamt input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--rh-t1); font: inherit; font-size: 14px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.rhchips { display: flex; justify-content: flex-end; gap: 6px; margin: 2px 0 8px; }
.rhchip { height: var(--ob-h-chip, 28px); padding: 0 10px; border: 0; border-radius: 999px; background: transparent; box-shadow: inset 0 0 0 1px var(--rh-edge); color: var(--rh-t2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
@media (hover: hover) { .rhchip:hover { color: #fff; } }
.rhchip.on { background: var(--rh-fill); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55); color: #fff; }
.rhchip:disabled { opacity: 0.4; cursor: default; }
/* a chip above the cash: dim, still tappable, and the line under the chips says why */
.rhchip.over { opacity: 0.4; }
.rhchipx { margin: -4px 0 8px; font-size: 12px; line-height: 16px; color: var(--rh-t2); text-align: right; }
/* "Not enough cash ($4.45) · Use $4.45": the second half a plain text button */
.rhmsg .rhuse { display: inline; width: auto; height: auto; margin: 0; padding: 0; font-size: 13px; color: var(--ob-ink); text-decoration: none; }
.rhpill { display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; margin-top: 16px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--rh-acc); color: var(--rh-acc-ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; touch-action: none; }
@media (hover: hover) { .rhpill:hover:not(:disabled) { filter: brightness(1.08); } }
.rhpill:disabled { background: var(--rh-fill); box-shadow: inset 0 0 0 1px var(--rh-edge); color: var(--rh-t3); cursor: default; }
.rhpill.sec { background: transparent; color: var(--rh-acc); box-shadow: inset 0 0 0 1px var(--rh-acc); }
/* Ask AI: a quiet text row with an icon at the foot of the card, never a bordered pill beside Place trade (critic r4) */
.rhfee { margin: 0; padding: 2px 20px 12px; font-size: 12px; color: var(--rh-t3); }
.rhask { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin: 0; padding: 0 20px; border: 0; border-top: 1px solid var(--rh-soft); border-radius: 0 0 6px 6px; background: transparent; color: var(--rh-t2); font: inherit; font-size: 13px; font-weight: 500; text-align: left; cursor: pointer; }
.rhask svg { flex: 0 0 auto; width: 14px; height: 14px; color: var(--rh-t3); }
@media (hover: hover) { .rhask:hover { color: var(--rh-t1); } }
@media (hover: hover) { .rhask:hover svg { color: var(--rh-t1); } }
#rhAsk[hidden] { display: none; }
.rhmsg { margin: 10px 0 0; font-size: 13px; line-height: 18px; color: var(--rh-t2); }
.rhmsg:empty { display: none; }
.rhmsg.bad { color: var(--ob-down); }
.rhk { margin: 0 0 4px; font-size: 12px; font-weight: 500; color: var(--rh-t3); }
.rht { margin: 0 0 6px; font-size: 17px; line-height: 22px; font-weight: 600; }
.rhx { margin: 0 0 12px; font-size: 13px; line-height: 18px; color: var(--rh-t2); }
.rhfine { margin: 12px 0 0; font-size: 12px; line-height: 17px; color: var(--rh-t3); }
.rhtx { display: block; width: 100%; height: 40px; margin-top: 6px; border: 0; background: transparent; color: var(--rh-t1); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
@media (hover: hover) { .rhtx:hover { color: var(--rh-acc); } }
.rhok { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 4px 0 12px; border-radius: 50%; background: var(--ob-up-bg); color: var(--ob-up); }
.rhok svg { width: 24px; height: 24px; }
.rhfill { margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--rh-t1); }
html.rh .tk-morelink, html.rh.tk-simple .tk-morelink { display: block; width: 100%; margin-top: 8px; padding: 10px 0; border: 0; border-top: 0; background: transparent; color: var(--rh-t3); font: inherit; font-size: 13px; font-weight: 500; text-align: center; cursor: pointer; }
@media (hover: hover) { html.rh .tk-morelink:hover, html.rh.tk-simple .tk-morelink:hover { background: transparent; color: var(--rh-t1); } }

/* ---------- under the chart: Your position, About, Stats; then Your trades ---------- */
.rhsecs { display: flex; flex-direction: column; }
.rhsec { margin-top: 40px; }
.rhsec[hidden] { display: none; }
.rhsec h2, html.rh.tk-simple .app > #pf .ch h2 { margin: 0; padding-bottom: 14px; font-size: var(--ob-h2, 20px); line-height: 28px; font-weight: 600; letter-spacing: -0.01em; color: var(--rh-t1); }
.rhsec h2 { border-bottom: 1px solid var(--rh-line); }
.rhsec p { margin: 16px 0 0; font-size: 15px; line-height: 24px; color: var(--rh-t1); max-width: 760px; }
.rhlink { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--rh-acc); text-decoration: none; }
@media (hover: hover) { .rhlink:hover { color: var(--rh-t1); } }
.rhpos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 24px; margin-top: 16px; }
.rhpos > div, .rhstats > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rhpos span, .rhstats dt { font-size: 13px; line-height: 18px; color: var(--rh-t3); }
.rhpos b, .rhstats dd { margin: 0; font-size: 16px; line-height: 22px; font-weight: 500; color: var(--rh-t1); font-variant-numeric: tabular-nums; }
.rhpos b.up { color: var(--ob-up); } .rhpos b.down { color: var(--ob-down); }
.rhstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 24px; margin: 16px 0 0; }
.rhstats > div { padding-bottom: 12px; border-bottom: 1px solid var(--rh-soft); }

/* Your trades: Robinhood's list (a heading over a hairline, rows split by hairlines, no boxes) */
html.rh.tk-simple .app > #pf .ch { margin: 0; padding: 0; border-bottom: 1px solid var(--rh-line); align-items: center; }
html.rh.tk-simple .app > #pf .ch h2 { border: 0; }
html.rh .tk-hist, html.rh #pf .csv { font-size: 14px; font-weight: 600; color: var(--rh-acc); }
html.rh.tk-simple #pf .sub { margin: 0; padding: 18px 0 6px; border: 0; background: transparent; font-size: 13px; font-weight: 600; color: var(--rh-t3); }
html.rh.tk-simple #pf .bet { margin: 0; padding: 12px 0; border-top: 1px solid var(--rh-soft); min-height: 60px; }
@media (hover: hover) { html.rh.tk-simple #pf .bet:hover { background: transparent; } }
html.rh.tk-simple #pf .bet .b1 { font-size: 15px; font-weight: 500; color: var(--rh-t1); }
html.rh.tk-simple #pf .bet .b2 { font-size: 13px; color: var(--rh-t3); }
html.rh.tk-simple #pf .pfsum { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--rh-soft); color: var(--rh-t2); }
html.rh.tk-simple #pf .empty { padding: 18px 0; color: var(--rh-t2); font-size: 15px; }

/* ---------- the phone (and any screen under ~500px tall): price, chart, tabs, sections; a sticky Trade button opens the
   card as a sheet ---------- */
.rhbar, .rhback { display: none; }
@media (max-width: 900px), (max-height: 500px) { /* round 9: a tablet upright takes the phone's bar and sheet too */
  html.rh .app, html.rh body.has-sbar .app { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
  html.rh .pxblock .px { font-size: 32px; line-height: 40px; }
  html.rh .tk-asset .symn, html.rh .pxblock .symn { font-size: 24px; line-height: 30px; }
  html.rh .chartwrap, html.rh .chartwrap #chart { height: 240px; }
  html.rh .chfoot .rng { flex: 1; justify-content: space-between; }
  html.rh .chfoot .rng button { padding: 0 8px; }
  html.rh .chfoot .lwattr { display: none; }
  html.rh .rhpos, html.rh .rhstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html.rh .rhsec { margin-top: 32px; }
  html.rh .rhsec h2, html.rh.tk-simple .app > #pf .ch h2 { font-size: 22px; }
  html.rh.tk-simple .app > #pf { margin-top: 32px; padding: 0; background: transparent; border: 0; }
  html.rh.tk-simple .app > .chartcol { padding: 0; background: transparent; border: 0; }
  /* the card is a sheet over the page */
  html.rh body:not(.tk-more) .side, html.rh.tk-simple body:not(.tk-more) .app > .side { display: none; }
  html.rh body.rh-sheet:not(.tk-more) .side, html.rh.tk-simple body.rh-sheet:not(.tk-more) .app > .side { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 95; max-height: 88vh; margin: 0; padding: 0 0 env(safe-area-inset-bottom); overflow-y: auto; background: var(--rh-card); border: 0; border-top: 1px solid var(--rh-edge); border-radius: 16px 16px 0 0; }
  html.rh body.rh-sheet .rhc { border: 0; border-radius: 16px 16px 0 0; }
  html.rh body.rh-sheet .rhc-h::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: rgba(255, 255, 255, 0.22); }
  /* the sheet slides up, the page behind dims; closing runs it back down (rh.js closeSheet: rh-closing) */
  html.rh body.rh-sheet:not(.tk-more) .app > .side { animation: rhSheetIn 0.32s cubic-bezier(0.2, 0.9, 0.25, 1); }
  html.rh body.rh-sheet.rh-closing:not(.tk-more) .app > .side { animation: rhSheetOut 0.22s cubic-bezier(0.4, 0, 1, 1) forwards; }
  body.rh-sheet .rhback { animation: rhFade 0.32s ease; }
  body.rh-closing .rhback { animation: rhFade 0.22s ease reverse forwards; }
  html.rh .rhc-h { position: relative; min-height: 56px; }
  html.rh .rhc-x { display: inline-flex; align-items: center; justify-content: center; }
  html.rh #rhAsk { min-height: 48px; }
  html.rh .tk-morelink { margin: 0 0 12px; }
  html.rh .rhs { height: 52px; }
  html.rh .rhpill { height: 52px; font-size: 16px; }
  html.rh .rhamt input { font-size: 16px; }
  html.rh .rhc-len select { height: 36px; font-size: 16px; }
  .rhback { display: block; position: fixed; inset: 0; z-index: 94; background: rgba(0, 0, 0, 0.6); }
  .rhback[hidden] { display: none; }
  body:not(.rh-sheet):not(.tk-more) .rhbar { display: flex; }
  /* the Trade bar sits ABOVE the phone's tab bar (nav.css .bbar), so Trade keeps Home / Markets / Portfolio like every
     other page (critic r4: the bar covered the tabs) */
  .rhbar { position: fixed; left: 0; right: 0; bottom: calc(var(--bbar-h, 0px) + env(safe-area-inset-bottom)); z-index: 60; align-items: center; gap: 12px; padding: 12px 16px; background: #000; border-top: 1px solid var(--rh-line); }
  body.has-bbar .rhbar { bottom: calc(var(--bbar-h, 0px) + env(safe-area-inset-bottom)); }
  html.rh .app, html.rh body.has-sbar .app { padding-bottom: calc(96px + var(--bbar-h, 0px) + env(safe-area-inset-bottom)); }
  /* 1-tap on: the bar is two buttons, "Up $0.514" and "Down $0.515", and each tap places the trade (rule 0e) */
  .rhbar.one .rhbar-t, .rhbar.one #rhTrade { display: none; }
  .rhbar-ot { display: none; }
  .rhbar.one .rhbar-ot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: 1; min-width: 0; }
  .rhbar-ot .rhs { height: 52px; font-size: 16px; }
  .rhbar-ot .rhs .rhs-a { font-size: 12px; font-weight: 500; opacity: 0.8; }
  .rhbar-ot .rhs > span:first-child { display: flex; flex-direction: row; align-items: baseline; line-height: 1.15; white-space: nowrap; }
  .rhbar-ot .rhs .rhs-a { font-size: inherit; font-weight: inherit; opacity: 1; }
  /* the bar's 1-tap switch: a 48x52 tap, "1-tap" over a small track, green when on (final-pass r5) */
  .rhbar-sw { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 48px; height: 52px; margin: 0 -4px 0 -4px; padding: 0; border: 0; background: transparent; color: var(--rh-t2); font: inherit; cursor: pointer; }
  .rhbar-sw[hidden] { display: none; }
  .rhbar-swl { font-size: 11px; line-height: 13px; font-weight: 600; white-space: nowrap; }
  .rhbar-swt { position: relative; width: 34px; height: 20px; border-radius: 10px; background: var(--rh-fill); box-shadow: inset 0 0 0 1px var(--rh-edge-hi); transition: background-color 0.2s ease; }
  .rhbar-swt i { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #8a8d95; transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.25, 1), background-color 0.2s ease; }
  .rhbar-sw[aria-checked="true"] { color: var(--ob-up); }
  .rhbar-sw[aria-checked="true"] .rhbar-swt { background: var(--ob-up); box-shadow: none; }
  .rhbar-sw[aria-checked="true"] .rhbar-swt i { transform: translateX(14px); background: #000; }
  .rhbar-sw:focus-visible { outline: 2px solid var(--rh-t1); outline-offset: 2px; border-radius: 8px; }
  .rhbar-t { flex: 1; min-width: 0; font-size: 13px; line-height: 17px; color: var(--rh-t2); font-variant-numeric: tabular-nums; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .rhbar .rhpill { flex: 0 0 auto; width: 44%; margin: 0; }
  .rhbar-l { display: grid; grid-template-columns: 42px auto; justify-content: start; white-space: nowrap; }
  .rhbar-l b { font-weight: 600; color: var(--rh-t1); }
  html.rh .mbar { bottom: calc(68px + var(--bbar-h, 0px) + env(safe-area-inset-bottom)); }
  .rhpill.swipe { position: relative; }
  .rhpill.swipe::before { content: ""; width: 0; height: 0; margin-right: 8px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 6px solid currentColor; }
}
@media (max-width: 360px) {
  html.rh .pxblock .px { font-size: 28px; }
  /* the bar with its 1-tap switch: Up and Down keep their price inside the pill at 320 */
  .rhbar { gap: 8px; padding: 12px 12px; }
  .rhbar-ot .rhs { padding: 0 9px; font-size: 15px; }
}

/* ---------- 1-tap (rh.js: One-tap trading, Amount per tap) ---------- */
.rh1t { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin: -6px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--rh-soft); }
.rh1t-l { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rh1t-l b { font-size: 14px; font-weight: 600; color: var(--rh-t1); }
.rh1t-l span { font-size: 12px; line-height: 16px; color: var(--rh-t3); font-variant-numeric: tabular-nums; }
.rhsw { position: relative; flex: 0 0 auto; width: 44px; height: 26px; padding: 0; border: 0; border-radius: 13px; background: var(--rh-fill); box-shadow: inset 0 0 0 1px var(--rh-edge-hi); cursor: pointer; transition: background-color 0.2s ease, box-shadow 0.2s ease; }
.rhsw i { position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 50%; background: #8a8d95; transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.25, 1), background-color 0.2s ease; }
.rhsw[aria-checked="true"] { background: var(--ob-up); box-shadow: none; } /* a switch is on in green whatever the market did */
.rhsw[aria-checked="true"] i { transform: translateX(18px); background: #000; }
.rhsw:focus-visible { outline: 2px solid var(--rh-t1); outline-offset: 2px; }
.rhc.one #rhForm > .rhr:not(.ramt), .rhc.one #rhGo { display: none; }
.rhc.one .rhs { height: 56px; font-size: 16px; }
.rhc.one .rhs.u { box-shadow: inset 0 0 0 1px rgba(31, 209, 112, 0.35); }
.rhc.one .rhs.d { box-shadow: inset 0 0 0 1px rgba(255, 77, 90, 0.35); }
.rh1tx { margin: 6px 0 0; font-size: 12px; line-height: 17px; color: var(--rh-t3); }
.rh1tx:empty { display: none; }
.rhs.fired { animation: rhTap 0.26s cubic-bezier(0.2, 0.9, 0.25, 1), rhFlash 0.45s ease-out; } /* an instant pressed flash on each 1-tap (critic r8) */
@keyframes rhFlash { 0% { filter: brightness(1.9); } 100% { filter: none; } }

/* ---------- motion: short, purposeful, never on a number ---------- */
.rhs, .rhpill, .rhchip, .rhlink, .dwbtn, html.rh .chfoot .rng button, html.rh .pxblock .chg { transition: background-color 0.35s ease, color 0.35s ease, box-shadow 0.2s ease, transform 0.12s ease, filter 0.15s ease; }
.rhs:active:not(:disabled), .rhpill:active:not(:disabled), .rhchip:active:not(:disabled) { transform: scale(0.98); }
.rhv:not([hidden]) { animation: rhIn 0.22s ease; }
html.rh .chfoot .rng button.on::after { animation: rhUl 0.25s cubic-bezier(0.2, 0.9, 0.25, 1); transition: background-color 0.35s ease; }
@keyframes rhIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes rhUl { from { transform: scaleX(0.2); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rhTap { 0% { transform: scale(1); } 35% { transform: scale(0.95); } 100% { transform: scale(1); } }
@keyframes rhSheetIn { from { transform: translateY(100%); } to { transform: none; } }
@keyframes rhSheetOut { from { transform: none; } to { transform: translateY(100%); } }
@keyframes rhFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .rhv:not([hidden]), .rhs.fired, html.rh .chfoot .rng button.on::after, html.rh body.rh-sheet .app > .side, body.rh-sheet .rhback, body.rh-closing .rhback { animation: none !important; }
  .rhs, .rhpill, .rhchip, .rhsw, .rhsw i { transition: none; }
}

/* Your trades' header: the title left, Export CSV and History together on the right */
html.rh.tk-simple .app > #pf .ch { display: flex; gap: 20px; }
html.rh.tk-simple .app > #pf .ch h2 { flex: 1; min-width: 0; }
html.rh.tk-simple .app > #pf .ch .csv, html.rh.tk-simple .app > #pf .ch .tk-hist { flex: 0 0 auto; margin: 0; padding: 0; background: transparent; border: 0; }

/* ---------- More ways to trade (trade-simple.js openMore): one sheet in the card's language ---------- */
/* opened from the phone's trade sheet, the sheet's 60% backdrop (#rhBack) must not sit over the drawer */
body.tk-more .rhback { display: none !important; }
/* the header is the title row only (Ask is the chat's own tab); the 150 px block was room for an Ask row that is not there */
html body.tk-more { --tk-mh: 68px; }
html body.tk-more.tk-asking { --tk-mh: 68px; }
html body.tk-more:has(.tk-mhead .tk-askrow) { --tk-mh: 150px; }
html body.tk-more .tk-mhead { grid-template-rows: 36px; align-content: center; padding-top: 0; }
html body.tk-more .side > .card:first-child, html body.tk-more .side > section:not([hidden]) { scroll-margin-top: var(--tk-mh); }
html body.tk-more .side .card.updown { padding-top: 18px; }
/* Up / Down at the top: the trade card's buttons (44 px, tinted, a ring when picked), no arrows, no solid fill */
html.tk-simple body.tk-more .updown .udrow.atm .udc { display: flex; justify-content: space-between; height: 44px; padding: 0 14px; border-radius: 6px; font-size: 15px; }
html.tk-simple body.tk-more .updown .udrow.atm .udc .udcl, html.tk-simple body.tk-more .updown .udrow.atm .udc .udcp { font-size: 15px; font-weight: 600; letter-spacing: 0; }
html.tk-simple body.tk-more .updown .udrow.atm .udc .udcl::before { content: none; }
/* every Up / Down in the drawer, the price-target rows too: picked = a tint and a ring, as on the card */
html.tk-simple body.tk-more .updown .udc { border-radius: 6px; }
html.tk-simple body.tk-more .updown .udc.u.on, html.tk-simple body.tk-more .updown .udc.u.on .udcl { background: rgba(31, 209, 112, 0.18); color: var(--ob-up); }
html.tk-simple body.tk-more .updown .udc.d.on, html.tk-simple body.tk-more .updown .udc.d.on .udcl { background: rgba(255, 77, 90, 0.18); color: var(--ob-down); }
html.tk-simple body.tk-more .updown .udc.u.on { box-shadow: inset 0 0 0 1.5px var(--ob-up); }
html.tk-simple body.tk-more .updown .udc.d.on { box-shadow: inset 0 0 0 1.5px var(--ob-down); }
html.tk-simple body.tk-more .updown .udc.on .udcl { background: transparent !important; box-shadow: none; }
@media (max-width: 700px) {
  html.tk-simple body.tk-more .updown .udrow.atm .udc { height: 52px; }
}
html.tk-simple body.tk-more .app > .side { padding-top: var(--tk-mh); }
/* the card's first line: what Up / Down are measured from and when the trade ends if placed now */
.rhwhen { margin: -4px 0 12px; font-size: 13px; line-height: 18px; color: var(--rh-t2); }
.rhwhen[hidden] { display: none; }

/* ---------- colour: the submit button follows the side picked, not the day (critic r1: "I picked Up and the button is
   red"). The day's colour stays on the chart, the change line, the range tab and the phone's Trade button; links and
   the AI button are white. ---------- */
.rhpill { background: #fff; color: #000; }
#rhGo[data-side="up"]:not(:disabled), #rvGo[data-side="up"]:not(:disabled) { background: var(--ob-up); color: #000; }
#rhGo[data-side="down"]:not(:disabled), #rvGo[data-side="down"]:not(:disabled) { background: var(--ob-down); color: #000; }
#rhTrade { background: #fff; color: #000; } /* r27: the white primary (in the day colour it read as Sell on a red day; in Draw "Adjust" was solid red) */
.rhpill.sec { background: transparent; color: var(--rh-t1); box-shadow: inset 0 0 0 1px var(--rh-edge-hi); }
@media (hover: hover) { .rhpill.sec:hover { filter: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4); } }
.rhlink, html.rh .tk-hist, html.rh #pf .csv { color: var(--rh-t1); }
@media (hover: hover) { .rhlink:hover, html.rh .tk-hist:hover, html.rh #pf .csv:hover { color: var(--rh-t2); } }
@media (hover: hover) { .rhtx:hover { color: var(--rh-t2); } }

/* touch screens (a tablet, a phone on its side): every small control is a 44px tap, its look unchanged (critic r1) */
@media (pointer: coarse) {
  /* real 44px boxes (critic r4 measures the box, not a ::after): the chips are 44px pills; the switch is a 52x44 button
     with its 44x26 track drawn inside it */
  .rhchip { min-width: 44px; height: 44px; padding: 0 12px; }
  .rhsw { width: 52px; height: 44px; background: transparent; box-shadow: none; }
  .rhsw::before { content: ""; position: absolute; left: 4px; top: 9px; width: 44px; height: 26px; border-radius: 13px; background: var(--rh-fill); box-shadow: inset 0 0 0 1px var(--rh-edge-hi); transition: background-color 0.2s ease; }
  .rhsw[aria-checked="true"] { background: transparent; }
  .rhsw[aria-checked="true"]::before { background: var(--ob-up); box-shadow: none; }
  .rhsw i { top: 13px; left: 8px; z-index: 1; }
  .rhamt { height: 46px; } #rhLen { min-height: 44px; } /* the amount input itself 44px inside its 1px edge */
  /* the range row: each length at least 44px wide, LIVE as wide as its word (critic r1: 1H and 1M 28px wide at 320) */
  html.rh .chfoot .rng button:not([data-r="0"]), html.rh.tk-simple .chfoot .rng button:not([data-r="0"]) { min-width: 44px; padding: 0 4px; }
  html.rh.tk-simple .chfoot .rng { gap: 0; }
}
/* 1-tap on: the status line keeps its height whether or not "Placing 1 trade…" shows, so Up and Down never move under
   the thumb (critic r3: the sheet grew 17px on every tap); a refusal shows in the toast only, never in the card too */
.rhc.one .rh1tx:empty, .rh1tx[hidden] { display: none; } /* no reserved empty band (critic r6) */
.rhc.one #rhMsg:not(.blk) { display: none; } /* 1-tap: only why Up / Down are dimmed (the amount), never a second copy of a toast */
/* touch screens: the sheet's close button is a 44px tap, its look unchanged */
@media (pointer: coarse) { .rhc-x { width: 44px; height: 44px; margin: -6px -6px -6px 0; } }

/* ---------- critic r4 ---------- */
/* values never break across lines ("$67,848 –" / "$68,045", "−$0.54" / "(−36.00%)"); two stat columns under ~900px */
.rhpos b, .rhstats dd, .rhr > b, .rhwhen > span { white-space: nowrap; }
@media (max-width: 900px) { html.rh .rhpos, html.rh .rhstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* a big screen uses its width like a trading screen (critic r4: a 950px strip at 2560): a ~1400px page, the chart 45% of
   the window's height, the card 360px */
@media (min-width: 1920px) {
  html.rh .app, html.rh body.has-sbar .app { grid-template-columns: minmax(0, 1fr) 360px; max-width: 1400px; gap: 0 64px; }
  html.rh .chartwrap { height: max(320px, 45vh); }
}
/* touch: the market name, Draw, About's link and History are real 44px taps (critic r4) */
@media (pointer: coarse) {
  html.rh .tk-asset { min-height: 44px; }
  html.rh .dwbtn, html.rh body .dwbtn { height: 44px; }
  .rhlink, html.rh .tk-hist { display: inline-flex; align-items: center; min-height: 44px; }
  .skip:focus { min-height: 44px; }
}
@media (pointer: coarse) { html.rh body .dwbtn { min-width: 44px; justify-content: center; } html.rh .tk-morelink, html.rh.tk-simple .tk-morelink { min-height: 44px; } }
/* More ways to trade, the price rows: the column heads say Up and Down, so each pill is just its price, centred, with a
   gap between the two (critic r4: "Down $0.932" ran out of its pill) */
html.tk-simple body.tk-more .updown .udhd, html.tk-simple body.tk-more .updown .udrow:not(.atm) { grid-template-columns: minmax(0, 1fr) 84px 84px; column-gap: 8px; }
html.tk-simple body.tk-more .updown .udrow:not(.atm) .udc .udcl { display: none; }
html.tk-simple body.tk-more .updown .udrow:not(.atm) .udc { display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; padding: 0 6px; }
html.tk-simple body.tk-more .updown .udrow:not(.atm) .udc .udcp { white-space: nowrap; }

/* 1-tap on: one button format on every page (round 6): "Up · $1" on line 1, the price on line 2 */
.rhc .rhside .rhs, .rhbar-ot .rhs { flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; line-height: 1.15; }
.rhc.one .rhs .rhs-p, .rhbar-ot .rhs .rhs-p { font-size: 13px; font-weight: 500; opacity: 0.85; }
/* round 8 (critic: 1H / 1D / 1W / 1M 27-31px wide at 320): the range tabs never shrink under 44px wide on a touch-sized
   layout; the row gives up its gaps first */
@media (pointer: coarse), (max-width: 1024px), (max-height: 500px) {
  html.rh .chfoot .rng button, html.rh.tk-simple .chfoot .rng button { flex: 0 0 auto; min-width: 44px; min-height: 44px; }
}
@media (max-width: 360px) { html.rh .chfoot .rng button:not([data-r="0"]), html.rh.tk-simple .chfoot .rng button:not([data-r="0"]) { padding: 0 2px; letter-spacing: 0.06em; } html.rh .chfoot .rng { gap: 0; } }
/* round 8 (critic: "Price to beat $67,635.76 ·" / "ends 10:42 AM"): a narrow card (the tablet's 300px card, a phone's
   sheet) gives the end time its own line with no separator, never a line ending on a bare dot */
.rhc { container-type: inline-size; }
/* a daily market's note is two plain lines that wrap inside the card, never one clipped line (r18) */
.rhwhen.daily > span { white-space: normal; display: block; }
.rhwhen.daily .rhw-s { display: none; }
@container (max-width: 330px) { .rhwhen .rhw-s { display: none; } .rhwhen .rhw-e { display: block; } }
/* the Ask panel open over the page (a drawer or a sheet): the Trade bar steps aside so the chat's input is never under it
   (a short screen now has the bar too) */
html.ochat-drawer-open .rhbar, html.ochat-sheet-open .rhbar { display: none !important; }
html.ochat-push .rhbar { right: var(--oc-w, 420px); }
/* round 9 (founder: at 844x390 the chart was ~100px tall above the bottom bar): a short screen puts the market, its
   price and the change on one line, and the chart takes the rest of the first view down to the bottom bar (the bar's
   own height, rh.js --rhbar-h, and a phone's tab bar, --bbar-h), never under 140px; the range tabs and Draw follow under it as before */
@media (max-height: 500px) {
  html.rh body .app, html.rh body.has-sbar .app { padding-top: 8px; }
  html.rh body .pxblock { display: flex; align-items: center; flex-wrap: wrap; column-gap: 14px; row-gap: 0; padding: 0; }
  html.rh body .pxblock .tk-asset { flex: none; margin: 0 0 0 -10px; }
  html.rh body .tk-asset .symn, html.rh body .pxblock .symn { font-size: 18px; line-height: 24px; }
  html.rh body .pxblock .pxrow { flex: 0 1 auto; flex-wrap: nowrap; align-items: baseline; gap: 0 8px; margin-top: 0; min-width: 0; }
  html.rh body .pxblock .px { flex: none; font-size: 22px; line-height: 30px; }
  html.rh body .pxblock .chg, html.rh body .pxblock .chgl { margin-top: 0; font-size: 13px; line-height: 18px; white-space: nowrap; }
  html.rh body .chartwrap, html.rh body .chartwrap #chart { height: max(140px, calc(100vh - var(--hdr, 64px) - var(--rhbar-h, 77px) - var(--bbar-h, 0px) - 64px)); min-height: 0; }
  html.rh body .chartwrap { margin-top: 4px; }
}

/* ---------- round 9 ---------- */
/* touch chips: 44px-tall pills, never 44px circles beside pill buttons (critic r9: "bubble chips" at 768 and 320) */
@media (pointer: coarse) { .rhchip { min-width: 56px; padding: 0 14px; } }
@media (pointer: coarse) and (max-width: 360px) { .rhchip { min-width: 52px; padding: 0 10px; } }
@media (max-width: 900px), (max-height: 500px) {
  /* the sheet's grabber in its own strip above the header row, never under the length select (critic r9 at 320) */
  html.rh body.rh-sheet .rhc-h { padding-top: 14px; padding-bottom: 4px; }
  html.rh body.rh-sheet .rhc-h::before { top: 5px; }
}
/* a short phone: the sheet is a card, not the whole screen. The Price row says the price the Up / Down button already
   shows, so it steps out (critic r9: the sheet began 78px from the top with Ask AI cut off) */
@media (max-width: 700px) and (max-height: 700px) {
  html.rh body.rh-sheet #rhForm > .rhr:has(#rhPx) { display: none; }
  html.rh body.rh-sheet .rhwhen { margin-bottom: 10px; }
  html.rh body.rh-sheet .rh1t { margin-bottom: 6px; padding-bottom: 4px; }
}
/* a tablet upright (round 9): the sheet is a 480px card at the bottom centre, and the bar's buttons sit under it */
@media (min-width: 701px) and (max-width: 900px) and (min-height: 501px) {
  html.rh body.rh-sheet:not(.tk-more) .app > .side, html.rh.tk-simple body.rh-sheet:not(.tk-more) .app > .side { top: auto; left: calc(50% - 240px); right: calc(50% - 240px); border-left: 1px solid var(--rh-edge); border-right: 1px solid var(--rh-edge); }
  /* round 12 (final-pass r9 critic: "a phone bar floating in the middle" with ~140px of black each side): the bar spans
     the content width, as the chart and the trades list above it, two wide Up / Down buttons */
  body:not(.rh-sheet):not(.tk-more) .rhbar { padding-left: 16px; padding-right: 16px; }
}
/* More ways to trade (round 9, critic r9: "looks like a different product from the main ticket"): its Buy area uses the
   main card's pieces: Amount on the left with the bordered amount box on the right, outlined chips under it, "Pays if
   right" as a label / value row, and a plain "Place trade". Only the strike table is its own. */
html.rh body.tk-more .side .updown .udamt { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; row-gap: 8px; }
html.rh body.tk-more .side .updown .udamt .flab { display: block; margin: 0; text-align: left; font-size: 14px; font-weight: 500; color: var(--rh-t1); }
html.rh body.tk-more .side .updown .udsz { display: contents; }
html.rh body.tk-more .side .updown .udsz .amt { grid-column: 2; display: inline-flex; align-items: center; gap: 2px; width: 144px; height: 40px; padding: 0 12px; border: 1px solid var(--rh-edge); border-radius: 4px; background: #000; color: var(--rh-t3); font-size: 14px; }
html.rh body.tk-more .side .updown .udsz .amt:focus-within { border-color: #8a949a; }
html.rh body.tk-more .side .updown .udsz .amt input { flex: 1; min-width: 0; width: auto; height: 100%; padding: 0; border: 0; background: transparent; color: var(--rh-t1); font-size: 14px; font-weight: 600; text-align: right; }
html.rh body.tk-more .side .updown .udchips { grid-column: 1 / -1; justify-self: end; display: flex; gap: 6px; }
html.rh body.tk-more .side .updown .chipb { height: 26px; padding: 0 10px; border-radius: 999px; background: transparent; box-shadow: inset 0 0 0 1px var(--rh-edge); color: var(--rh-t2); font-size: 12px; font-weight: 600; }
@media (hover: hover) { html.rh body.tk-more .side .updown .chipb:hover { color: #fff; background: transparent; } }
html.rh body.tk-more .side .updown .chipb.on { background: var(--rh-fill); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55); color: #fff; }
html.rh body.tk-more .side .updown .udpay { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; margin: 6px 0 0; font-size: 14px; font-weight: 500; color: var(--rh-t1); }
html.rh body.tk-more .side .updown .udpay b { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0; color: var(--rh-t1); }
@media (pointer: coarse) { html.rh body.tk-more .side .updown .chipb { min-width: 56px; height: 44px; padding: 0 14px; } html.rh body.tk-more .side .updown .udsz .amt { height: 46px; } html.rh body.tk-more .side .updown .udsz .amt input { font-size: 16px; } }
/* a very big screen (round 9, critic r9: at 2560 the Trade page was a small island, 60% black): the chart takes the
   extra width, the card stays 360px */
@media (min-width: 2200px) {
  html.rh .app, html.rh body.has-sbar .app { max-width: 1680px; }
}
/* the header's container (nav.css --page-w) on every wide screen, so the logo lines up with the chart */
@media (min-width: 1600px) { html.rh .app, html.rh body.has-sbar .app { max-width: var(--page-w, 1240px); } }

/* ---------- round 10 ---------- */
/* touch: the amount chips are one full-width segmented row of equal parts under the amount, 10px corners, never round
   bubbles (critic r9: 56x44 near-circles next to the wide Up / Down buttons) */
@media (pointer: coarse) {
  .rhchips { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; justify-content: stretch; }
  .rhchip, .rhchip { min-width: 0; width: 100%; padding: 0 6px; border-radius: 10px; }
}
/* the More ways link's focus after its sheet closes: a soft ring around the words, rounded like the card, never a 3px
   square box wider than the card (critic r9) */
html.rh .tk-morelink:focus { outline: none; }
html.rh .tk-morelink:focus-visible { outline: none; color: var(--rh-t1); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35); border-radius: 12px; }
/* the chart's range tabs: one tight group on the left at every width from 600px, Draw on the right (critic r9: spread
   ~270px apart at 768, five unrelated words); words, not "1M", so no tab reads like a trade's length ("1 min") */
@media (min-width: 600px) { html.rh .chfoot .rng, html.rh.tk-simple .chfoot .rng { flex: 0 1 auto; justify-content: flex-start; gap: 12px; } }
@media (max-width: 599px) { html.rh .chfoot .rng button, html.rh.tk-simple .chfoot .rng button { letter-spacing: 0.06em; } }
/* the Finished header carries its total when nothing is running: "Finished … 5 · +$0.84" (round 10) */
#doneH { justify-content: flex-start; gap: 6px; }
#doneH #doneCnt { margin-left: auto; }
#doneH .dsum[hidden] { display: none; }
#doneH .dsum::before { content: "\00b7\00a0"; color: var(--rh-t3, #8b8e95); }
#doneH .dsum.up { color: var(--ob-up); } #doneH .dsum.down { color: var(--ob-down); }
/* the phone bar's length line over Up / Down (round 10): the market, the length and the price to beat, wrapping on two
   lines at 320 rather than cutting a number */
@media (max-width: 900px), (max-height: 500px) {
  .rhbar { flex-wrap: wrap; row-gap: 6px; }
  .rhbar-len { flex: 1 0 100%; order: -1; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0; min-height: 28px; margin: -4px 0 0; padding: 4px 0; border: 0; background: transparent; color: var(--rh-t2); font: inherit; font-size: 13px; line-height: 18px; text-align: left; cursor: pointer; }
  .rhbar-len[hidden] { display: none; }
  .rhbar-len b { font-weight: 600; color: var(--rh-t1); white-space: nowrap; }
  .rhbar-len .rhbar-cv { margin-left: 4px; color: var(--rh-t2); font-size: 11px; }
  .rhbar-len .rhbar-pb { white-space: nowrap; }
  .rhbar-len .rhbar-sep { white-space: pre; }
}
/* round 11 (critic r9: a 32px tap that opens the length picker): a 44px tap on touch, its words centred in it */
@media (pointer: coarse) { .rhbar-len { min-height: 44px; align-items: center; align-content: center; margin: -8px 0 -6px; } }
@media (max-width: 360px) { html.rh .chfoot .rng button, html.rh.tk-simple .chfoot .rng button { padding: 0 4px; font-size: 11px; letter-spacing: 0.03em; } html.rh .chfoot .rng button.on::after { left: 4px; right: 4px; } html.rh .chfoot .rng button.on:first-child::after { left: 0; } }
/* round 11 (critic r9: "Draw is crashing into MONTH and getting cut off by the trade bar on a small phone"): under 460px
   the five range tabs share the row's width evenly (each ~47px at 320, a 44px tap), never running into Draw; and a
   phone's chart is as tall as leaves the range row and Draw clear above the bar on the first screen (214px at 320x640,
   up to 300px on a tall phone) */
@media (max-width: 460px) {
  html.rh .chfoot, html.rh.tk-simple .chfoot { gap: 8px; }
  html.rh .chfoot .rng, html.rh.tk-simple .chfoot .rng { flex: 1 1 0; min-width: 0; gap: 0; justify-content: space-between; }
  html.rh .chfoot .rng button, html.rh.tk-simple .chfoot .rng button, html.rh.tk-simple .chfoot .rng button.on,
  html.rh .chfoot .rng button:not([data-r="0"]), html.rh.tk-simple .chfoot .rng button:not([data-r="0"]) { flex: 1 1 0; min-width: 0; padding: 0 2px; font-size: 11px; letter-spacing: 0.03em; text-align: center; white-space: nowrap; }
  html.rh .chfoot .rng button:first-child, html.rh.tk-simple .chfoot .rng button:first-child { padding-left: 0; text-align: left; }
  html.rh .chfoot .rng button.on::after { left: 6px; right: 6px; } html.rh .chfoot .rng button.on:first-child::after { left: 0; right: 10px; }
  html.rh .chfoot .rng button[data-r="0"]::before { margin-right: 4px; }
}
@media (max-width: 700px) and (min-height: 501px) {
  html.rh body .chartwrap, html.rh body .chartwrap #chart { height: clamp(180px, calc(100vh - var(--hdr, 56px) - var(--rhbar-h, 111px) - var(--bbar-h, 60px) - 200px), 300px); }
}
/* round 11 (critic r9: "each finished trade takes three lines on a wide screen"): a finished row's result and time share
   one line under its P&L, "Lost · 1:49:05 PM", so a 1920 screen shows twice the trades */
@media (min-width: 901px) and (min-height: 501px) {
  .bet.done .br { white-space: nowrap; }
  .bet.done .br .st, .bet.done .br .st2 { display: inline; }
  .bet.done .br .st2:not(:empty)::before { content: "\00a0\00b7\00a0"; }
}
/* round 11 (critic r9: "the Up/Down button looks different on every page"): the ticket's and the bar's Up / Down take the
   one chip's corners (market-row.css .mrow .ud, Portfolio's popular cards: 10px); the selected outline stays the only variant */
.rhs, .rhbar-ot .rhs { border-radius: 10px; }

/* Payoff: the multiple, and a bar of what you risk (grey) against what you win on top (green), to scale (vihan, 18 Nov) */
.rhpo { min-height: 30px; }
.pobar { display: flex; gap: 2px; height: 6px; margin: 0 0 8px; border-radius: 3px; overflow: hidden; }
.pobar[hidden] { display: none; }
.pobar > i { display: block; height: 100%; }
.pobar > .pr { background: var(--rh-t3, #8a8d95); opacity: 0.5; border-radius: 3px 0 0 3px; }
.pobar > .pw { background: var(--ob-up, #30d158); opacity: 0.85; border-radius: 0 3px 3px 0; }
.rhc.one #rhForm > .pobar { display: none; } /* 1-tap: no rows, so no row-less bar */

/* the 1-tap switch is cyan blue when on (vihan, 18 Nov), so it never reads as an Up/P&L green */
.rhsw[aria-checked="true"] { background: var(--ob-onetap, #22b8f0); }
.rhbar-sw[aria-checked="true"] { color: var(--ob-onetap, #22b8f0); }
.rhbar-sw[aria-checked="true"] .rhbar-swt { background: var(--ob-onetap, #22b8f0); }
@media (pointer: coarse) { .rhsw[aria-checked="true"] { background: transparent; } .rhsw[aria-checked="true"]::before { background: var(--ob-onetap, #22b8f0); } }

/* success is its own green (--ob-ok), separate from the P&L / Up green (vihan, 18 Nov) */
.rhok { background: var(--ob-ok-bg, rgba(16, 185, 129, 0.16)); color: var(--ob-ok, #10b981); }
/* hover on the card's Up / Down and the 1-tap switch, as Home's and Markets' buttons brighten (UX-25) */
@media (hover: hover) {
  .rhs.u:hover:not(:disabled):not(.on) { background: rgba(31, 209, 112, 0.18); }
  .rhs.d:hover:not(:disabled):not(.on) { background: rgba(255, 77, 90, 0.18); }
  .rhsw:hover, .rhbar-sw:hover { filter: brightness(1.18); }
  .rhchip:hover:not(.on) { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3); }
}
/* until rh.js has seated the order card and put the sections in order, Your trades stays off the page (UX-34) */
html.rh:not(.rh-on) #pf, html.rh:not(.rh-on) #rhSecs, html.rh:not(.rh-on) #rhSecs2 { display: none; }
/* a chart range loading its history (UX-51): a thin bar along the chart top; the chart and its price axis stay as they are */
#chartcol { position: relative; }
#chartcol.rngload::before { content: ""; position: absolute; z-index: 5; top: 0; left: 0; height: 2px; width: 30%; background: rgba(255, 255, 255, 0.55); animation: rngBar 0.9s ease-in-out infinite; pointer-events: none; }
@keyframes rngBar { from { left: 0; } to { left: 70%; } }
@media (prefers-reduced-motion: reduce) { #chartcol.rngload::before { animation: none; width: 100%; opacity: 0.4; } }

/* Let a larger stake wrap without losing its price or winning payout. */
.tap-payout:empty { display: none; }
.rhs .tap-payout { color: var(--rh-t1); font-size: 12px; font-weight: 500; line-height: 1.25; white-space: normal; text-align: left; }
html.rh .rhc.one .rhs:not([data-firm]), html.rh .rhbar-ot .rhs:has(.tap-payout:not(:empty)) {
  height: auto; min-height: 68px; padding-block: 7px; overflow-wrap: anywhere;
}
html.rh .rhc.one .rhs-l, html.rh .rhbar-ot .rhs > span:first-child { white-space: normal; flex-wrap: wrap; }
html.rh [data-firm] .rhs-p { font-variant-numeric: tabular-nums; }

.rhterms { display: none; color: var(--rh-t2); font-size: 13px; }
.rhc.one .rhterms { display: block; }
.rhterms summary { width: fit-content; padding: 8px 0; cursor: pointer; }
.rhterms dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 2px 0 10px; }
.rhterms dt { color: var(--rh-t1); }
.rhterms dd { margin: 0; line-height: 1.4; font-variant-numeric: tabular-nums; }

html.rh .rhc.one .rhside .rhs, html.rh .rhbar-ot:has(.firm-caption:not([hidden])) .rhs {
  height: 44px; min-height: 44px; align-items: center; justify-content: center; padding: 0 8px;
}
.rhside:has(.firm-caption:not([hidden])), .rhbar-ot:has(.firm-caption:not([hidden])) { row-gap: 3px; }
.rhs .rhs-p:empty { display: none; }
@media (max-width: 780px) {
  .rhbar-sw { width: auto; min-width: 48px; padding-inline: 3px; }
}

/* ---------- tradephone (19 Nov): the Trade page held in one hand ---------- */
@media (max-width: 900px), (max-height: 500px) {
  /* the page ends above the sticky bar AND the tab bar: rh.js measures the bar (--rhbar-h, no safe area in it), nav.css
     the tab bar (--bbar-h, its safe area apart). A fixed 96px left the last Stats row under the bar for good */
  html.rh .app, html.rh body.has-sbar .app { padding-bottom: calc(var(--rhbar-h, 124px) + var(--bbar-h, 0px) + 24px + env(safe-area-inset-bottom)); }
  /* the bar's Buy Up / Buy Down: 48px for the thumb (Robinhood's Trade button ~50px), the label 16/600 */
  html.rh .rhbar-ot:has(.firm-caption:not([hidden])) .rhs { height: 48px; min-height: 48px; font-size: 16px; font-weight: 600; }
  html.rh .rhbar-ot .firm-caption { font-size: 13px; line-height: 16px; }
}
/* "1-tap": tabular figures give the 1 a wide box, so it read "1 - tap"; the label is a word, not a number */
.rhbar-swl, .rh1t-l b { font-variant-numeric: normal; font-feature-settings: "cv01", "ss03"; }
/* a small phone (320-374) with Build in the card's header: "Trade Bitcoin" stays on one line (a little less padding, a
   narrower length select, the title 14px; a long market name ends in an ellipsis rather than wrapping) */
@media (max-width: 374px) {
  html.rh .rhc-h { gap: 4px; padding-left: 14px; padding-right: 14px; }
  html.rh .rhc-h h2 { min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.rh .rhc-len select { padding: 0 22px 0 8px; background-position: right 6px center; }
}

/* 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; }

/* touch (r16 devices: iPads and a phone held sideways measured Quote details 34px and the Amount label 18px): 44px rows
   for a finger, keyed on the pointer, never the width, since an iPad is wider than the phone layout */
@media (pointer: coarse) {
  .rhterms summary { display: flex; align-items: center; min-height: 44px; padding: 0 12px 0 0; }
  #rhAmtL { display: inline-flex; align-items: center; min-height: 44px; }
}

/* an ultrawide (2560x1080, r16 devices): the 1680px page every view shares, and the chart takes the height a short wide
   window has instead of 45vh (486px under a 1192px wide chart); text columns keep their widths */
@media (min-width: 2200px) and (min-aspect-ratio: 2/1) {
  html.rh .chartwrap { height: clamp(486px, calc(100vh - var(--hdr, 64px) - 340px), 64vh); }
}
.seg button[hidden] { display: none; }

/* r18: on a tablet the bar's 1-tap label has room: 13px with its amount on one line, a wider tap (it was 11px in a 48px column) */
@media (min-width: 600px) {
  .rhbar-sw { width: auto; min-width: 68px; margin: 0; padding: 0 6px; }
  .rhbar-swl { font-size: 13px; line-height: 16px; }
}
/* r18: a long note beside the market name ("· Updates once a day") goes on its own line on a narrow phone, never past the edge */
@media (max-width: 400px) { html.rh .tk-asset .feed { grid-row: 2; grid-column: 1 / -1; justify-self: start; margin-left: 0; } }

/* ---------- round 21: a landscape phone (844x390, 740x360) ----------
   the fixed bar was two rows (the length line, then the buttons: 128px, a third of the screen) and covered the Draw button
   and the range tabs at scroll 0 (a tap on Draw hit the length line). Now one row: the length line sits left of the switch and the
   buttons, the bar is about 80px, and the chart leaves room for the tab row above the bar. Only the bar and the chart's height change. */
@media (max-height: 500px) and (min-width: 560px) {
  .rhbar { flex-wrap: nowrap; row-gap: 0; padding: 6px 16px; gap: 10px; }
  .rhbar-len { flex: 0 1 220px; order: 0; margin: 0; min-height: 0; padding: 0; align-self: center; }
  .rhbar-len b, .rhbar-len .rhbar-pb { white-space: normal; }
  .rhbar-sw { height: 44px; }
  html.rh .rhs, html.rh .rhpill { height: 44px; }
  html.rh .rhbar-ot:has(.firm-caption:not([hidden])) .rhs { height: 44px; min-height: 44px; }
  html.rh body .chartwrap, html.rh body .chartwrap #chart { height: max(120px, calc(100vh - var(--hdr, 64px) - var(--rhbar-h, 80px) - var(--bbar-h, 0px) - 120px)); height: max(120px, calc(100dvh - var(--hdr, 64px) - var(--rhbar-h, 80px) - var(--bbar-h, 0px) - 120px)); }
}
@media (pointer: coarse) and (max-height: 500px) and (min-width: 560px) { .rhbar-len { margin: 0; min-height: 44px; } }

/* r24 phone pass: 12px words wherever they fit. The range tabs from 390px (five ~50px tabs: MONTH is 46px at 12px with no
   tracking); 320-389 keep 11px, the most that fits beside the two 44px round buttons. The bar's 1-tap label from 375px,
   its column as wide as the words. */
@media (min-width: 390px) and (max-width: 460px) {
  html.rh .chfoot .rng button, html.rh.tk-simple .chfoot .rng button, html.rh.tk-simple .chfoot .rng button.on,
  html.rh .chfoot .rng button:not([data-r="0"]), html.rh.tk-simple .chfoot .rng button:not([data-r="0"]) { font-size: 12px; letter-spacing: 0; }
}
@media (min-width: 375px) and (max-width: 599px) {
  .rhbar-sw { width: auto; min-width: 48px; }
  .rhbar-swl { font-size: 12px; line-height: 14px; }
}
/* r27 phone audit: short landscape keeps the 1-tap bar to one slim row */
@media (max-width: 640px) and (max-height: 500px) and (orientation: landscape) { .rhbar { padding: 6px 16px; } }
/* r27 phone audit: at 320px the range tabs touched each other (27-37px wide); they share the row evenly */
@media (max-width: 360px) { html.rh .chfoot .rng button, html.rh.tk-simple .chfoot .rng button, html.rh.tk-simple .chfoot .rng button.on { padding: 0 6px; letter-spacing: 0.02em; min-width: 40px; } }

/* r27: Share this trade, a quiet text button under Done */
.rhshare { display: block; width: 100%; min-height: 40px; margin: 6px 0 0; padding: 0; border: 0; background: transparent; color: var(--rh-t2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
@media (hover: hover) { .rhshare:hover { color: var(--rh-t1); } }
/* r27 design pass: action buttons are the white primary; the day's colour describes the market, never an action
   (a green "Place trade" on a Down pick, a red "Adjust" in Draw) */
.rhpill { background: #fff !important; color: #000 !important; }
.rhpill.sec { background: transparent !important; color: var(--rh-t1) !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3) !important; }
@media (hover: hover) { .rhpill:hover { background: #e7e7ea !important; } }
.rhpill:disabled, .rhpill[aria-disabled="true"] { background: #2a2a30 !important; color: #8b8b93 !important; }
/* r27 critic: the price-to-beat line breathes between the card's title and the 1-tap row */
#rhWhen { margin: 2px 0 12px; }
/* r27 responsive: Stats' values wrap at a space when a column is too narrow ("4, 3 run by Omnibook" ran 32px past the
   edge at 320 and widened the whole page to 336, so a phone opened zoomed out); a running trade's status line wraps
   under itself on a small phone instead of squeezing the trade's name into one word a line */
html.rh .rhstats dd { white-space: normal; }
.bet .bsell { white-space: nowrap; }
@media (max-width: 380px) {
  .bet:not(.done) .br { max-width: 44vw; }
  .bet:not(.done) .br .st { white-space: normal; }
  .bet:not(.done) .br .st .wl, .bet:not(.done) .br .st .tn { white-space: nowrap; }
}
