/*
 * Grid v3, the shared system of the trader space, the sign-in and the checkout (loaded after style.css; the terminal keeps
 * style.css alone). A deep black ground under a hairline grid; blue is light, not paint: it draws what the trader reaches
 * and keeps (goal, equity, "You keep", the one action), silver what they stay above and what the firm holds. Physical keys
 * (a lit face on a vertical ledge), one blue key per screen with a running laser, switches whose lit thumb slides,
 * near-square plates with corner brackets. Archivo for words (wide and heavy for titles), Martian Mono for figures only.
 * Never italic; hover only where a pointer hovers; reduced motion gives a still page. The blues derive from the brand
 * accent (brand.json, set by brand.js), so another brand keeps its own colour.
 */
@font-face { font-family: "Archivo V3"; src: url("vendor/fonts/archivo-latin-var.woff2") format("woff2"); font-weight: 400 700; font-stretch: 100% 125%; font-style: normal; font-display: swap; unicode-range: U+0020-007E, U+00A0-017F, U+02C6-02DC, U+2009-206F, U+20AC, U+2122, U+2190-2193, U+2212-2265, U+25B2-25BC; }
@font-face { font-family: "Martian Mono V3"; src: url("vendor/fonts/martian-mono-latin.woff2") format("woff2"); font-weight: 400 600; font-stretch: 87.5%; font-style: normal; font-display: swap; unicode-range: U+0020-007E, U+00A0, U+00B1, U+00B7, U+00D7, U+2009, U+2013-2014, U+2026, U+202F, U+2066-2069, U+20AC, U+2190-2193, U+2212, U+2248; }
@property --beam { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  /* ink and hairlines */
  --ink: #eef1f6;
  --ink-2: #b3bcc8;
  --ink-3: #8b94a2;
  --silver: #c3cad4;
  --hair: rgba(206, 216, 230, 0.1);
  --hair-2: rgba(206, 216, 230, 0.17);
  --hair-3: rgba(206, 216, 230, 0.3);
  --tick: rgba(206, 216, 230, 0.45);
  --grid-1: rgba(190, 205, 228, 0.045);
  --grid-2: rgba(190, 205, 228, 0.085);
  --silver-track: rgba(195, 202, 212, 0.14);
  --silver-share: rgba(195, 202, 212, 0.22);
  /* surfaces: plates, wells, cells, keys, the raised thumb */
  --plate-top: rgba(14, 17, 21, 0.86);
  --plate-bottom: rgba(9, 11, 14, 0.9);
  --well-top: rgba(5, 6, 8, 0.96);
  --well-bottom: rgba(12, 14, 18, 0.96);
  --cell: rgba(13, 16, 20, 0.82);
  --cell-solid: #0d1014;                            /* a cell that must hide what is under it (a strip on one hairline) */
  --chip-bg: rgba(16, 19, 24, 0.8);
  --card-top: rgba(22, 26, 32, 0.92);
  --card-bottom: rgba(14, 17, 21, 0.92);
  --key-top: #1d222a;
  --key-bottom: #14181e;
  --key-top-hi: #222830;
  --key-bottom-hi: #181c23;
  --thumb-top: #252c37;
  --thumb-bottom: #1b2029;
  --ledge: #05060a;
  --ledge-2: #040507;
  --halo: #0c0e12;                                   /* the knockout behind the labels of the drawing */
  /* a plate: the graphite fill under four 11px corner brackets, a hairline ring, one long soft drop (any panel may take it) */
  --plate-bg:
    linear-gradient(var(--tick), var(--tick)) 0 0 / 11px 1px no-repeat, linear-gradient(var(--tick), var(--tick)) 0 0 / 1px 11px no-repeat,
    linear-gradient(var(--tick), var(--tick)) 100% 0 / 11px 1px no-repeat, linear-gradient(var(--tick), var(--tick)) 100% 0 / 1px 11px no-repeat,
    linear-gradient(var(--tick), var(--tick)) 0 100% / 11px 1px no-repeat, linear-gradient(var(--tick), var(--tick)) 0 100% / 1px 11px no-repeat,
    linear-gradient(var(--tick), var(--tick)) 100% 100% / 11px 1px no-repeat, linear-gradient(var(--tick), var(--tick)) 100% 100% / 1px 11px no-repeat,
    linear-gradient(180deg, var(--plate-top), var(--plate-bottom));
  --plate-shadow: inset 0 0 0 1px var(--hair), 0 30px 60px -30px rgba(0, 0, 0, 0.85);
  --white: #ffffff;
  --shade: rgba(0, 0, 0, 0.8);
  /* the blue family, from the brand accent */
  --blue: var(--acc);
  --blue-hi: color-mix(in oklab, var(--acc) 84%, #fff);
  --blue-deep: color-mix(in oklab, var(--acc) 58%, #000);
  --link: color-mix(in oklab, var(--acc) 52%, #fff);
  --pale: color-mix(in oklab, var(--acc) 14%, #fff);
  --beam-ink: color-mix(in oklab, var(--acc) 18%, #fff);
  --ring: color-mix(in srgb, color-mix(in oklab, var(--acc) 70%, #fff) 80%, transparent);
  --tint: color-mix(in srgb, var(--acc) 16%, transparent);
  --glow: color-mix(in srgb, var(--acc) 50%, transparent);
  /* the three moods of a limit (a word always says it too) */
  --mood-ok: color-mix(in oklab, var(--up) 62%, #fff);
  --mood-watch: #f0b44c;
  --mood-tight: #f08c3c;

  --f-sans: "Archivo V3", "Readex Pro Arabic Var", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Martian Mono V3", "Readex Pro Arabic Var", ui-monospace, "SF Mono", Menlo, monospace;
  --t-xs: 0.75rem;
  --t-sm: 0.875rem;
  --t-base: clamp(1rem, 0.96rem + 0.18vw, 1.0625rem);
  --t-lg: clamp(1.08rem, 1rem + 0.35vw, 1.25rem);
  --t-title: clamp(1.9rem, 1.3rem + 1.6vw, 2.8rem);
  --t-h1: clamp(1.75rem, 1.2rem + 1.5vw, 2.5rem);
  --cellsize: 64px;
  --gutter: clamp(16px, 3.4vw, 44px);
  --wrap: 1380px;
  --wrap-wide: 1560px;
  --ease-v3: cubic-bezier(0.16, 1, 0.3, 1);

  /* the older tokens of style.css, in the v3 ground (the pages still written with them follow) */
  --font-sans: var(--f-sans);
  --font-mono: var(--f-mono);
  --text: var(--ink);
  --mute: var(--ink-2);
  --dim: var(--ink-3);
  --line: var(--hair);
  --line-2: var(--hair-2);
  --line-strong: var(--hair-3);
  --bg-2: rgba(10, 12, 15, 0.94);
  --surface: var(--cell);
  --surface-2: rgba(18, 21, 26, 0.9);
  --surface-3: var(--key-top);
  --surface-4: var(--thumb-top);
  --warn: var(--mood-watch);
  --acc-ink: var(--white);
  --acc-text: var(--link) !important;               /* blue text is the light tint, 8.9:1 on the ground */
  --focus: var(--link) !important;
  --r-lg: 4px;
}

body {
  position: relative;
  font-family: var(--f-sans);
  font-size: var(--t-sm);
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--bg);
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}
/* The engineering ground: a 64px cell, a heavier line every 256px, faded toward both sides. */
body::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-2) 1px, transparent 1px), linear-gradient(90deg, var(--grid-2) 1px, transparent 1px),
    linear-gradient(var(--grid-1) 1px, transparent 1px), linear-gradient(90deg, var(--grid-1) 1px, transparent 1px);
  background-size: calc(var(--cellsize) * 4) calc(var(--cellsize) * 4), calc(var(--cellsize) * 4) calc(var(--cellsize) * 4), var(--cellsize) var(--cellsize), var(--cellsize) var(--cellsize);
  background-position: calc(50% + 0.5px) -1px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%);
}
::selection { background: var(--acc); color: var(--white); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { font-weight: 640; text-wrap: balance; }
.num, .mono {
  font-family: var(--f-mono); font-stretch: 87.5%; font-variant-numeric: tabular-nums slashed-zero;
  letter-spacing: -0.015em; font-weight: 450; direction: ltr; unicode-bidi: isolate;
}
.v3-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--link); font-weight: 600;
  text-decoration: none; text-underline-offset: 4px;
}

/* ---------- keys: a lit face on a vertical ledge; .btn takes the same face ---------- */
.key, .btn {
  --h: 48px;
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 20px; border: 0; border-radius: 9px; cursor: pointer;
  font: 640 var(--t-sm)/1.2 var(--f-sans); font-stretch: 106%; letter-spacing: 0.005em; white-space: nowrap;
  color: var(--ink); text-decoration: none;
  background: linear-gradient(180deg, var(--key-top) 0%, var(--key-bottom) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), inset 0 0 0 1px var(--hair-2), 0 3px 0 var(--ledge), 0 10px 22px -10px var(--shade);
  transition: transform 110ms var(--ease-v3), box-shadow 110ms var(--ease-v3), background 200ms var(--ease-v3), color 200ms;
  -webkit-tap-highlight-color: transparent;
}
.key:active, .btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 0 0 1px rgba(206, 216, 230, 0.2), 0 1px 0 var(--ledge), 0 6px 14px -8px var(--shade);
}
.key--sm, .btn.sm { --h: 44px; padding: 0 15px; font-size: var(--t-sm); }
.key--lg { --h: 58px; padding: 0 24px; font-size: 1rem; border-radius: 10px; }
.btn.ghost, .btn.primary, .btn.danger { color: var(--ink); background: linear-gradient(180deg, var(--key-top) 0%, var(--key-bottom) 100%); border: 0; font-weight: 640; }
.key--blue, .btn.key--blue {
  color: var(--white);
  background: linear-gradient(180deg, color-mix(in oklab, var(--acc) 92%, #fff) 0%, var(--acc) 60%, color-mix(in oklab, var(--acc) 94%, #000) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 3px 0 var(--blue-deep),
    0 12px 26px -12px color-mix(in srgb, var(--acc) 70%, transparent), 0 22px 40px -20px rgba(0, 0, 0, 0.75);
}
.key--blue:active, .btn.key--blue:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.2), 0 1px 0 var(--blue-deep), 0 8px 18px -8px color-mix(in srgb, var(--acc) 70%, transparent);
}
.key__sub { font-weight: 560; font-size: 0.8125rem; padding-inline-start: 12px; border-inline-start: 1px solid rgba(255, 255, 255, 0.3); }
.key .sp-icon, .btn .sp-icon { flex: 0 0 auto; }
/* the laser: one bright segment running around the frame of the one primary key on screen */
.key--laser::before {
  content: ""; position: absolute; z-index: -1; inset: -5px -5px -8px -5px; border-radius: 13px; padding: 1.25px;
  background: conic-gradient(from var(--beam), transparent 0deg 250deg, rgba(143, 170, 255, 0) 262deg, rgba(160, 188, 255, 0.85) 300deg, var(--white) 318deg, rgba(160, 188, 255, 0.6) 330deg, transparent 345deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: v3-beam 3.6s linear infinite; pointer-events: none;
}
.key--laser::after { content: ""; position: absolute; z-index: -2; inset: -5px -5px -8px -5px; border-radius: 13px; border: 1px solid rgba(143, 170, 255, 0.16); pointer-events: none; }
.key--lg.key--laser::before, .key--lg.key--laser::after { border-radius: 14px; }
@keyframes v3-beam { to { --beam: 360deg; } }
.key[aria-disabled="true"], .key:disabled, .btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
@media (hover: hover) {
  .key:hover, .btn:not(:disabled):not([aria-disabled="true"]):hover { background: linear-gradient(180deg, var(--key-top-hi) 0%, var(--key-bottom-hi) 100%); }
  .key--blue:hover, .btn.key--blue:not(:disabled):hover { background: linear-gradient(180deg, color-mix(in oklab, var(--acc) 86%, #fff) 0%, color-mix(in oklab, var(--acc) 94%, #fff) 48%, var(--acc) 100%); }
  .key--laser:hover::before { animation-duration: 2.2s; }
  .v3-link:hover { text-decoration: underline; }
}

/* ---------- segmented switches: a recessed well holding keycaps (the keycap choices below) ---------- */
.v3-seg {
  position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 13px;
  background: linear-gradient(180deg, var(--well-top), var(--well-bottom));
  box-shadow: inset 0 0 0 1px var(--hair-2), inset 0 2px 8px rgba(0, 0, 0, 0.6);
}
.v3-seg__opt {
  appearance: none; position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 46px; padding: 6px 10px; border: 0; border-radius: 9px; cursor: pointer; text-align: center; background: transparent;
  font: 580 var(--t-sm)/1.2 var(--f-sans); color: var(--ink-2); transition: color 0.2s, background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.v3-seg__opt input { position: absolute; opacity: 0; pointer-events: none; }
.v3-seg__opt:has(input:focus-visible) { outline: 2px solid var(--link); outline-offset: 2px; }
.v3-seg__sub { font-family: var(--f-mono); font-stretch: 87.5%; font-size: var(--t-xs); font-weight: 450; color: var(--ink-3); direction: ltr; unicode-bidi: isolate; }
.v3-seg__opt:is([aria-pressed="true"], [aria-selected="true"], :has(input:checked)) .v3-seg__sub { color: var(--pale); }

/* ---------- plates: near-square panels with four corner brackets; cells; tags; chips ---------- */
.plate { position: relative; border-radius: 4px; background: var(--plate-bg); box-shadow: var(--plate-shadow); }
.v3-cell { display: grid; gap: 8px; align-content: start; padding: 16px 18px; border-radius: 12px; background: var(--cell); box-shadow: inset 0 0 0 1px var(--hair-2); }
.v3-tag {
  display: inline-flex; align-items: center; gap: 7px; min-height: 26px; padding: 0 10px; border-radius: 999px; white-space: nowrap;
  font-size: var(--t-xs); font-weight: 560; color: var(--ink-2); background: var(--chip-bg); box-shadow: inset 0 0 0 1px var(--hair-2);
}
.v3-tag--blue { color: var(--pale); background: var(--tint); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--link) 60%, transparent); }
.v3-chip {
  appearance: none; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 var(--t-xs)/1 var(--f-sans); color: var(--ink-2); background: var(--chip-bg); box-shadow: inset 0 0 0 1px var(--hair-2);
}
.v3-chip .num { font-size: 11px; color: var(--ink-3); }
.v3-chip[aria-pressed="true"] .num { color: var(--pale); }
/* ---------- keycap choices (founder 2026-11-05, "des contours avec effet bouton"): every option of a switch and every
   filter chip is a key: an outline, a lit top edge, a 2px wall under the face; pressed travels 1px; the chosen one is
   pressed in (2px down, an inner shade), ringed in blue, a small light bar on switches (never a blue fill: the one blue key
   stays the action). Box-shadow and transform only, so nothing moves the layout; the thumb space-seg.js places is not drawn. */
.v3-seg__thumb { display: none; }
:is(.v3-seg__opt, .v3-chip, .sp-filter .btn) {
  --cap-ring: var(--hair-2); --cap-wall: 2px;
  border-radius: 9px; background: linear-gradient(180deg, var(--key-top) 0%, var(--key-bottom) 100%);
  --cap-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -2px 0 rgba(0, 0, 0, 0.28), inset 0 0 0 1px var(--cap-ring),
    0 var(--cap-wall) 0 var(--ledge), 0 var(--cap-wall) 0 1px var(--cap-ring), 0 6px 10px -6px var(--shade);
  box-shadow: var(--cap-shadow);
  transition: transform 160ms var(--ease-v3), box-shadow 160ms var(--ease-v3), background 160ms, color 160ms;
}
:is(.v3-seg__opt, .v3-chip, .sp-filter .btn):active:not(:disabled, [aria-pressed="true"], [aria-selected="true"], :has(input:checked)) { --cap-ring: var(--hair-3); --cap-wall: 1px; transform: translateY(1px); box-shadow: var(--cap-shadow); }
:is(.v3-seg__opt:is([aria-pressed="true"], [aria-selected="true"], :has(input:checked)), .v3-chip[aria-pressed="true"], .sp-filter .btn[aria-pressed="true"]) {
  color: var(--ink); transform: translateY(2px); background: linear-gradient(180deg, var(--thumb-bottom) 0%, var(--thumb-top) 100%);
  box-shadow: inset 0 0 0 1px var(--ring), inset 0 2px 5px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--hair);
}
.v3-seg__opt:is([aria-pressed="true"], [aria-selected="true"], :has(input:checked))::after {
  content: ""; position: absolute; inset-inline: 32%; inset-block-end: 4px; block-size: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--blue-hi), var(--link)); box-shadow: 0 1px 6px var(--glow);
}
:is(.v3-seg__opt, .v3-chip, .sp-filter .btn):is(:disabled, [aria-disabled="true"], :has(input:disabled)) { cursor: not-allowed; transform: none; opacity: 1; color: var(--ink-3); background: transparent; box-shadow: inset 0 0 0 1px var(--hair); }
@media (hover: hover) {
  :is(.v3-seg__opt, .v3-chip, .sp-filter .btn):not([aria-pressed="true"], [aria-selected="true"], :has(input:checked), :disabled, [aria-disabled="true"], :has(input:disabled)):hover {
    --cap-ring: var(--hair-3); color: var(--ink); background: linear-gradient(180deg, var(--key-top-hi) 0%, var(--key-bottom-hi) 100%);
  }
}
@media (prefers-reduced-motion: reduce) { :is(.v3-seg__opt, .v3-chip, .sp-filter .btn) { transition: none; } }
/* the mood of a limit: a dot and a word, green only when comfortable */
.v3-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; font-size: 11px; font-weight: 600;
  color: var(--mood-ok); background: color-mix(in srgb, var(--up) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--up) 32%, transparent);
}
.v3-pill::before { content: ""; inline-size: 6px; block-size: 6px; border-radius: 50%; background: currentColor; }
.v3-pill[data-mood="watch"] { color: var(--mood-watch); background: color-mix(in srgb, var(--mood-watch) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mood-watch) 32%, transparent); }
.v3-pill[data-mood="tight"] { color: var(--mood-tight); background: color-mix(in srgb, var(--mood-tight) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mood-tight) 40%, transparent); }
.v3-gauge { position: relative; display: block; block-size: 4px; border-radius: 4px; overflow: hidden; background: var(--silver-track); }
.v3-gauge > span { position: absolute; inset: 0; border-radius: inherit; transform-origin: left center; background: linear-gradient(90deg, color-mix(in srgb, var(--acc) 45%, transparent), var(--blue-hi)); }
:root[dir="rtl"] .v3-gauge > span { transform-origin: right center; background: linear-gradient(270deg, color-mix(in srgb, var(--acc) 45%, transparent), var(--blue-hi)); }

/* ---------- the payout split: You keep (white over the blue share), Firm (over the silver share), a 3px gap ---------- */
.v3-split__labels { width: 100%; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.v3-split__l { display: grid; gap: 2px; margin: 0; color: var(--ink-2); }
.v3-split__l b { font-size: var(--t-xs); font-weight: 600; }
.v3-split__l .num { font-size: 1.1rem; color: var(--ink); }
.v3-split__l:last-child { text-align: end; }
.v3-split__l--you b { color: var(--link); }
.v3-split__l--you .num { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.1rem); font-weight: 500; letter-spacing: -0.03em; color: var(--white); }
.v3-split__bar { width: 100%; display: flex; gap: 3px; height: 12px; }
.v3-split__you {
  flex: 0 0 80%; border-radius: 3px; background: linear-gradient(90deg, color-mix(in oklab, var(--acc) 88%, var(--ledge)), color-mix(in oklab, var(--acc) 92%, var(--white)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 18px -8px color-mix(in srgb, var(--acc) 80%, transparent);
}
:root[dir="rtl"] .v3-split__you { background: linear-gradient(270deg, color-mix(in oklab, var(--acc) 88%, var(--ledge)), color-mix(in oklab, var(--acc) 92%, var(--white))); }
.v3-split__firm { flex: 1 1 0; border-radius: 3px; background: var(--silver-share); }

@media (prefers-reduced-motion: reduce) {
  .key--laser::before { animation: none; background: conic-gradient(from 300deg, transparent 0 250deg, rgba(160, 188, 255, 0.7) 300deg, transparent 345deg); }
  .v3-seg.is-live .v3-seg__thumb { transition: none; }
}
