/* Pro V2 (25 Nov 2026): Srimal's Pro trading layout in our components. Regions top to bottom: top bar 56px,
   market strip, trades tape 32px, then watchlist 280px | centre (stock card over the depth card, scrolls) | ticket 320px.
   Flat panels in Lumen; with the Tray look (data-cards="tray") each card is a tinted outer box with its content in an
   inner box inset 6px (variables shared with Easy V2 in simple-pages.css). */
.tm-pro2 {
  display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); height: 100%; min-width: 1024px; overflow: hidden;
  background: var(--tm-color-bg); color: var(--tm-color-text); font-size: 13px;
  --p2-card: var(--tm-color-panel); --p2-edge: var(--tm-color-divider); --p2-r: 20px;
}
/* Top bar */
.p2-top { display: flex; align-items: center; gap: 24px; height: 56px; padding: 0 16px; background: var(--tm-color-panel); border-bottom: 1px solid var(--tm-color-divider); white-space: nowrap; }
.p2-nav { display: flex; gap: 4px; }
.p2-nav a { padding: 7px 12px; border-radius: 10px; color: var(--tm-color-text-secondary); font-weight: 500; font-size: 14px; text-decoration: none; transition: background 160ms, color 160ms; }
.p2-nav a:hover { color: var(--tm-color-text); background: var(--tm-color-hover); }
.p2-nav a[aria-current="page"] { color: var(--tm-color-text); background: var(--tm-color-hover); }
.p2-top__right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.p2-who { display: grid; line-height: 16px; } .p2-who b { font-weight: 600; } .p2-who span { color: var(--tm-color-text-secondary); font-size: 12px; }
.p2-pulse .tm-pulse { border-bottom: 1px solid var(--tm-color-divider); }
/* Trades tape: every stock's latest trade, moving slowly; hover or focus pauses it, reduced motion stops it. */
.p2-tape { display: flex; align-items: center; height: 32px; background: var(--tm-color-panel); border-bottom: 1px solid var(--tm-color-divider); overflow: hidden; }
.p2-tape__k { flex: none; padding: 0 12px 0 16px; color: var(--tm-color-text-secondary); font-size: 12px; font-weight: 500; }
.p2-tape__run { flex: 1; min-width: 0; overflow: hidden; mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.p2-tape__track, .p2-tape__dup { display: flex; width: max-content; }
.p2-tape__track { animation: p2-tape 90s linear infinite; }
.p2-tape__run:hover .p2-tape__track, .p2-tape__run:focus-within .p2-tape__track { animation-play-state: paused; }
@keyframes p2-tape { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .p2-tape__track { animation: none; } .p2-tape__run { overflow-x: auto; scrollbar-width: none; } }
.p2-tape__i { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 16px; border: 0; border-right: 1px solid var(--tm-color-divider); background: none; color: var(--tm-color-text); font: inherit; font-size: 12.5px; font-variant-numeric: tabular-nums; cursor: pointer; white-space: nowrap; }
.p2-tape__i:hover { background: var(--tm-color-hover); }
.p2-tape__i b { font-weight: 600; }

/* Body: three columns */
.p2-body { display: grid; grid-template-columns: 280px minmax(0, 1fr) 320px; gap: 8px; min-height: 0; padding: 8px; transition: grid-template-columns 220ms ease; }
.p2-body.is-norail { grid-template-columns: 0 minmax(0, 1fr) 320px; gap: 0 8px; }
.p2-body.is-norail .p2-rail { visibility: hidden; border: 0; }
@media (prefers-reduced-motion: reduce) { .p2-body { transition: none; } }
.p2-card { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--p2-card); border: 1px solid var(--p2-edge); border-radius: var(--p2-r); corner-shape: superellipse(2); }
.p2-card .hc-in { display: block; min-height: 0; }

/* Watchlist */
.p2-rail { overflow: hidden; }
.p2-rail__in { display: flex; flex-direction: column; flex: 1; min-height: 0; background: none; }
.p2-rail .tm-mrail__list { flex: 1; min-height: 0; overflow-y: auto; }

/* Centre: stock card over the depth card */
.p2-center { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.p2-stock { flex: none; }
.p2-stock__head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 4px; }
.p2-id { min-width: 0; }
.p2-id__row { display: flex; align-items: center; gap: 8px; }
.p2-code { font-size: 18px; font-weight: 600; }
.p2-name { margin-top: 2px; color: var(--tm-color-text-secondary); }
.p2-stock__head [data-p2="star"] { gap: 6px; margin-top: 2px; }
.p2-stock__head [data-p2="star"][aria-pressed="true"] .tm-icon { fill: currentColor; }
.p2-px { display: grid; justify-items: end; margin-left: auto; }
.p2-px__n { font-size: 28px; font-weight: 600; line-height: 34px; } .p2-px__n small { font-size: 12px; font-weight: 500; color: var(--tm-color-text-secondary); }
.p2-stats { display: flex; gap: 24px; margin: 0; padding: 8px 18px 0; }
.p2-stats div { display: grid; } .p2-stats dt { color: var(--tm-color-text-secondary); font-size: 12px; } .p2-stats dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; }
.p2-plot { position: relative; }
.p2-chartbar { position: absolute; top: 10px; right: 12px; z-index: 2; }
.p2-chart.tm-lchart { display: flex; flex-direction: column; }
.p2-chart.tm-lchart > .tm-tabs { order: -1; align-self: flex-start; width: auto; margin-bottom: 8px; }
.p2-chart.tm-cchart .tm-cchart__bar { padding-right: 140px; }
.p2-qread { padding: 12px 18px 10px; }
.p2-qread .tm-qread { margin: 0; }
.p2-plot { padding: 10px 12px 8px; }
.p2-chart { min-height: 220px; }
.p2-chart .tm-lchart__readout { display: none; }
.p2-chart.tm-cchart { height: 300px; }
.p2-chart.tm-cchart { display: grid; grid-template-rows: auto auto minmax(0, 1fr); }

.p2-depth { flex: none; }
.p2-depth__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 10px 18px 0; }
.p2-depth__head [data-p2="collapse"] { margin-bottom: 6px; }
.p2-depth__body { padding: 8px 12px; min-height: 120px; }
.p2-depth__body[hidden] { display: none; }
.p2-depth__body .tm-book { max-width: none; }
.p2-fund { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 24px; margin: 8px 6px; }
.p2-fund div { display: grid; gap: 2px; } .p2-fund dt { color: var(--tm-color-text-secondary); font-size: 12px; } .p2-fund dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.p2-note { margin: 12px 6px 4px; color: var(--tm-color-text-secondary); font-size: 12px; }
.p2-disc { margin: 0; padding: 0; list-style: none; }
.p2-disc li { display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--tm-color-divider); }
.p2-disc li:last-child { border-bottom: 0; }
.p2-disc div { display: grid; gap: 2px; } .p2-disc b { font-weight: 500; } .p2-disc span { font-size: 12px; }

/* Order ticket */
.p2-ticket { overflow-y: auto; scrollbar-width: thin; padding-bottom: 12px; }
.p2-tk__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 16px 18px 10px; }
.p2-tk__head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.p2-tk__head span { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p2-ticket > .tm-seg--side { margin: 0 12px 10px; }
.p2-tk__body { display: grid; gap: 12px; padding: 12px; }
.p2-quote { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; }
.p2-quote div { display: grid; gap: 2px; padding: 6px 8px; border-radius: 10px; background: var(--tm-color-hover); }
.p2-quote dt { color: var(--tm-color-text-secondary); font-size: 12px; } .p2-quote dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.p2-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.p2-two .tm-field { min-width: 0; }
.p2-more[hidden] { display: none; }
.p2-qty__lab { display: flex; align-items: baseline; justify-content: space-between; }
.p2-link { padding: 0; border: 0; background: none; color: var(--tm-color-primary-text, var(--tm-color-primary)); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; text-align: left; justify-self: start; }
.p2-link:hover { text-decoration: underline; }
.p2-pcts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.p2-ro { display: flex; align-items: center; min-height: 36px; padding: 0 10px; border-radius: 10px; background: var(--tm-color-hover); font-family: var(--tm-font-mono, monospace); font-size: 12px; }
.p2-tk__sum { padding: 12px 18px 0; }
.p2-sum { display: grid; gap: 6px; margin: 0; }
.p2-sum div { display: flex; justify-content: space-between; gap: 8px; }
.p2-sum dt { color: var(--tm-color-text-secondary); } .p2-sum dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; }
.p2-sum .p2-sum__gap { height: 4px; border-bottom: 1px solid var(--tm-color-divider); margin-bottom: 4px; }
.p2-sum .is-total dt, .p2-sum .is-total dd, .p2-sum .is-strong dd { color: var(--tm-color-text); font-weight: 600; }
.p2-warn { margin-top: 10px; }
.p2-submit { width: calc(100% - 24px); margin: 14px 12px 0; }
.p2-tk__foot { margin: 8px 18px 0; color: var(--tm-color-text-secondary); font-size: 12px; text-align: center; }

/* Tray: tinted outer box, inner box inset 6px, smooth corners (colours from the lab's Tray colours). */
:root[data-cards="tray"] .tm-pro2 { --p2-card: var(--hc-out); --p2-edge: var(--hc-edge); --p2-r: calc(var(--hc-r) + 6px); }
:root[data-cards="tray"] .tm-pro2 .p2-card { box-shadow: var(--hc-shadow); }
:root[data-cards="tray"] .tm-pro2 .p2-card .hc-in { margin: 0 6px 6px; background: var(--hc-in); border: 1px solid var(--hc-in-edge); border-radius: var(--hc-r); corner-shape: superellipse(2); box-shadow: var(--hc-in-shadow); overflow: hidden; }
:root[data-cards="tray"] .tm-pro2 .p2-rail .tm-mrail__list { margin: 0 6px; background: var(--hc-in); border: 1px solid var(--hc-in-edge); border-radius: var(--hc-r); corner-shape: superellipse(2); padding: 8px 0; }
:root[data-cards="tray"] .tm-pro2 .p2-rail .tm-mrail__foot { margin: 0; background: none; }
:root[data-cards="tray"] .tm-pro2 .p2-tk__body { padding: 14px; }
/* Watchlist rows as in Srimal's: code, name, a small day chart, price and change (holdings live in the Holdings tab). */
.p2-rail .tm-mrow__own { display: none; }
.p2-rail .tm-mrow__spark { display: block; }
.p2-rail .tm-mrow__spark svg { display: block; width: 56px; height: 24px; }
.p2-rail .tm-mrail:not(.tm-mrail--compact) .tm-mrow { grid-template-columns: minmax(0, 1fr) 56px auto; column-gap: 10px; }
/* Cards scroll as a whole; their parts never shrink (the ticket at 760px tall). */
.p2-ticket > *, .p2-stock > *, .p2-depth > * { flex: none; }
.p2-tk__head h2 { white-space: nowrap; }
/* Targets at least 24px (WCAG 2.5.8). */
.p2-pcts .tm-btn { min-height: 28px; }
.p2-link { display: inline-flex; align-items: center; min-height: 26px; }
