/*
 * Trader space, grid v3: the accounts page (the rail of accounts beside the account drawn on "the line") and the head of
 * the account page (the same detail). Cards are pressable (a 2px ledge, a lit ring when pressed), instrument cells and
 * plates are flat. Tokens of ../v3.css only; hover under (hover: hover).
 */
.sp-main:has(> .v3-dash) { container-type: inline-size; }       /* the page's own width decides, the side menu beside it (2026-11-20) */
.v3-dash { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 28px; align-items: start; }

/* ---------- the rail ---------- */
.v3-rail { min-width: 0; display: grid; gap: 16px; align-content: start; padding-top: 15px; }        /* its title sits level with the account's */
.v3-rail__h { font-size: 1.9rem; font-weight: 660; font-stretch: 116%; letter-spacing: -0.03em; line-height: 1.05; }
.v3-rail__body { display: grid; gap: 14px; min-width: 0; }
.v3-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.v3-chips .v3-chip { padding: 0 11px; }
.v3-accs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.v3-acc {
  appearance: none; width: 100%; display: grid; gap: 14px; padding: 16px 18px; border: 0; border-radius: 12px; cursor: pointer;
  text-align: start; color: var(--ink); font: inherit;
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 0 0 1px var(--hair-2), 0 2px 0 var(--ledge-2);
  transition: box-shadow 0.2s, transform 110ms var(--ease-v3);
  -webkit-tap-highlight-color: transparent;
}
.v3-acc[aria-pressed="true"] { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px var(--ring), 0 2px 0 var(--ledge-2), 0 12px 28px -16px var(--glow); }
.v3-acc:active { transform: translateY(1px); }
.v3-acc__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.v3-acc__n { font-size: 1.05rem; font-weight: 640; font-stretch: 110%; }
.v3-acc__n .num { font-size: 0.85rem; font-weight: 480; color: var(--ink-2); }
.v3-acc__nums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* the markets of the rail: a hairline list under the accounts, the live dot beside the heading */
.v3-mk { display: grid; gap: 8px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--hair); }
.v3-mk__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.v3-mk__h { margin: 0; font-size: var(--t-sm); font-weight: 620; color: var(--ink-2); }
.v3-mk__live { display: inline-flex; align-items: center; gap: 7px; font-size: var(--t-xs); color: var(--ink-3); }
.v3-mk__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.v3-mk__live[data-live="true"] .v3-mk__dot { background: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 18%, transparent); }
.v3-mk__list { display: grid; margin: 0; padding: 0; list-style: none; }
.v3-mk__row { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--hair); font-size: var(--t-sm); }
.v3-mk__sym { font-weight: 640; font-stretch: 106%; }
.v3-mk__px { color: var(--ink); text-align: end; }
.v3-mk__chg { min-width: 4.6rem; font-size: var(--t-xs); text-align: end; color: var(--ink-2); }
.v3-mk__chg[data-tone="up"] { color: var(--up); }
.v3-mk__chg[data-tone="down"] { color: var(--down); }
.v3-acc__note { font-size: var(--t-xs); line-height: 1.4; color: var(--mood-watch); }
.v3-acc__fig { display: grid; gap: 1px; min-width: 0; }
.v3-acc__k { font-size: var(--t-xs); color: var(--ink-3); }
.v3-acc__fig .num { font-size: 1rem; font-weight: 500; color: var(--ink); }
.v3-acc__fig .num[data-tone="up"], .v3-in__v .num[data-tone="up"] { color: var(--up); }
.v3-trk { --at: 0; position: relative; display: block; height: 4px; border-radius: 4px; background: var(--silver-track); }
.v3-trk__fill { position: absolute; inset: 0; border-radius: 4px; transform-origin: left center; transform: scaleX(var(--at)); background: linear-gradient(90deg, color-mix(in srgb, var(--acc) 35%, transparent), var(--blue-hi)); }
.v3-trk__dot {
  position: absolute; top: 50%; inset-inline-start: calc(var(--at) * 100%); width: 10px; height: 10px; border-radius: 50%;
  background: var(--white); transform: translate(-50%, -50%); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 35%, transparent);
}
:root[dir="rtl"] .v3-trk__fill { transform-origin: right center; background: linear-gradient(270deg, color-mix(in srgb, var(--acc) 35%, transparent), var(--blue-hi)); }
:root[dir="rtl"] .v3-trk__dot { transform: translate(50%, -50%); }
.v3-rail__new { justify-self: start; margin-top: 4px; }
.v3-rail .sp-filter-none { display: grid; gap: 10px; justify-items: start; }

/* ---------- the detail: head, the plate of the line, the instruments, the card ---------- */
.v3-detail { min-width: 0; display: grid; gap: 14px; align-content: start; }
.v3-dhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.v3-dhead__title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-width: 0; }
.v3-dhead__h { font-size: var(--t-title); font-weight: 660; font-stretch: 118%; letter-spacing: -0.035em; line-height: 1; color: var(--ink); }
.v3-dhead__h .num { font-size: 0.55em; font-weight: 480; letter-spacing: -0.02em; color: var(--ink-2); vertical-align: 0.15em; }
.v3-dhead__act { display: flex; flex-wrap: wrap; gap: 14px; padding: 6px 6px 9px; }
.v3-plot { margin: 0; padding: 14px 16px 10px; }
.v3-plot__line { height: clamp(280px, 30vw, 380px); }
.v3-plot__cap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; margin-top: 8px; font-size: var(--t-xs); color: var(--ink-3); }
.v3-plot__what.v3-tag { max-width: 100%; padding-block: 4px; white-space: normal; line-height: 1.35; }   /* the site's "Illustration" chip: here, what the real line is */
.v3-plot__when .num { color: var(--ink-2); }
.v3-inst { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.v3-inst[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.v3-in__k { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; margin: 0; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.v3-in__k .sp-icon { color: var(--link); }
.v3-in__k .v3-pill { margin-inline-start: auto; }
.v3-in__v { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; margin: 0; font-size: 1.45rem; font-weight: 500; letter-spacing: -0.02em; color: var(--ink); }
.v3-in__word { font-size: 0.95rem; font-weight: 560; letter-spacing: 0; color: var(--ink-2); }
.v3-in__word.is-big { font-size: 1.35rem; font-weight: 640; font-stretch: 110%; color: var(--ink); }
.v3-in__sub { margin: 0; font-size: var(--t-xs); line-height: 1.5; color: var(--ink-3); }
.v3-in__sub b { font-weight: 500; color: var(--ink-2); }
.v3-card { display: grid; gap: 14px; justify-items: start; padding: 20px 22px; }
.v3-card__head { width: 100%; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.v3-card__h { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: 1.15rem; font-weight: 640; font-stretch: 110%; }
.v3-card__h .sp-icon { color: var(--link); align-self: center; }
.v3-card__k { margin: 0; font-size: var(--t-sm); color: var(--ink-2); }
.v3-card__k b { font-weight: 520; color: var(--ink); }
.v3-card__note { margin: 0; max-width: 68ch; font-size: var(--t-sm); line-height: 1.55; color: var(--ink-2); }
.v3-card__why { margin: 0; font-size: var(--t-sm); font-weight: 560; color: var(--ink); }
.v3-card .key { margin-top: 2px; }
.v3-more { margin: 0; }
.v3-empty { justify-items: start; }
.v3-empty .key { margin-top: 8px; }

@media (hover: hover) {
  .v3-acc:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 0 0 1px var(--hair-3), 0 2px 0 var(--ledge-2); }
  .v3-acc[aria-pressed="true"]:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px var(--ring), 0 2px 0 var(--ledge-2), 0 12px 28px -16px var(--glow); }
}

/* tablets and phones: the rail becomes a row of cards that scrolls sideways, the account under it */
@container (max-width: 1008px) {                 /* a page under ~1000 px (a phone, a tablet, a computer beside the menu): the rail is a row of cards */
  .v3-mk { display: none; }
  .v3-dash { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .v3-rail { padding-top: 0; }
  .v3-accs { grid-auto-flow: column; grid-auto-columns: minmax(250px, 78%); overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 8px; margin: -2px; overscroll-behavior-x: contain; }
  .v3-accs__i { scroll-snap-align: start; }
  .v3-rail__new { display: none; }
}
@media (max-width: 760px) {
  .v3-rail__h { font-size: 1.6rem; }
  .v3-dhead { align-items: flex-start; }
  .v3-dhead__act { width: 100%; }
  .v3-dhead__act .key { flex: 1 1 auto; }
  .v3-plot { padding: 10px 10px 8px; }
  .v3-plot__line { height: 260px; }
  .v3-inst, .v3-inst[data-n="2"] { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .v3-in { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 14px; }
  .v3-in__k, .v3-in .v3-gauge, .v3-in__sub { grid-column: 1 / -1; }
  .v3-in__v { font-size: 1.25rem; }
  .v3-card { padding: 18px 16px; }
}

/* ---------- today's P&L in the Daily Loss cell: one figure beside the label ---------- */
.v3-in__pnl { margin-inline-start: auto; font-size: var(--t-xs); font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.v3-in__pnl[data-tone="up"] { color: var(--up); }
.v3-in__pnl[data-tone="down"] { color: var(--down); }
.v3-in__k .v3-in__pnl + .v3-pill { margin-inline-start: 8px; }
/* phones: today's result has its own line under the label, whatever its amount and the language; the label keeps its mood */
@media (max-width: 760px) {
  .v3-in[data-id="today"] .v3-in__k { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 9px; row-gap: 2px; }
  .v3-in[data-id="today"] .v3-in__k .v3-in__pnl { grid-column: 2 / -1; grid-row: 2; justify-self: start; margin-inline-start: 0; }
  .v3-in[data-id="today"] .v3-in__k .v3-pill { margin-inline-start: 0; }
}

/* ---------- the open positions: a hairline list under the instruments, only while a position is open ---------- */
.v3-open-wrap:empty { display: none; }
.v3-open { display: grid; gap: 4px; padding: 2px 4px 0; }
.v3-open__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding-bottom: 8px; border-bottom: 1px solid var(--hair-2); }
.v3-open__h { margin: 0; font-size: var(--t-sm); font-weight: 620; color: var(--ink-2); }
.v3-open__k { margin: 0; font-size: var(--t-xs); color: var(--ink-3); }
.v3-open__k b { font-weight: 500; color: var(--ink); }
.v3-open__list { list-style: none; margin: 0; padding: 0; display: grid; }
.v3-open__row { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--hair); font-size: var(--t-sm); }
.v3-open__row:last-child { border-bottom: 0; }
.v3-open__side { font-size: var(--t-xs); color: var(--ink-2); }
.v3-open__size { margin-inline-start: 6px; color: var(--ink); }
.v3-open__side[data-side="long"]::before, .v3-open__side[data-side="short"]::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-inline-end: 7px; border-radius: 50%; background: var(--link); vertical-align: 1px; }
.v3-open__side[data-side="short"]::before { background: var(--silver); }
.v3-open__wait { font-size: var(--t-xs); color: var(--ink-3); }
.v3-open__row .num[data-tone="up"] { color: var(--up); }

/* ---------- the consistency meter of an Instant account: one bar, one line ---------- */
.v3-cons { display: grid; gap: 6px; width: 100%; }
.v3-cons__bar { display: block; height: 4px; border-radius: 4px; background: var(--silver-track); overflow: hidden; }
.v3-cons__fill { display: block; height: 100%; border-radius: 4px; transform-origin: left center; background: var(--acc); transition: transform 420ms var(--ease-v3); }
.v3-cons__fill[data-over="true"] { background: var(--silver); }
:root[dir="rtl"] .v3-cons__fill { transform-origin: right center; }
.v3-cons__t { margin: 0; font-size: var(--t-xs); color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .v3-cons__fill { transition: none; } }
