/* Page-level design for the app pages that sit on top of the app-modern.css skin:
   dashboard (bento overview), strategies, brokers, analytics / monitor headers,
   split-screen auth, and the error pages. Prefix: pg-. Loaded globally after app-modern.css.
   All motion is transform/opacity and respects prefers-reduced-motion. */

/* ------------------------------------------------------------------ shared */
.pg-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px 28px; flex-wrap: wrap; margin-bottom: 30px; }
.pg-hero h1 { margin: 0 0 10px; font-size: clamp(2rem, 4vw, 3rem); }
.pg-hero p { max-width: 58ch; margin: 0; color: var(--color-muted-fg); font-size: 1.04rem; }
.pg-hero .row { gap: 10px; flex-wrap: wrap; }
.pg-kicker {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px;
  font-size: .76rem; letter-spacing: .09em; text-transform: uppercase; color: var(--color-muted-fg);
}
.pg-kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--color-pos); }
.pg-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 38px 0 16px; }
.pg-section-head h2 { margin: 0; font-size: 1.3rem; }
.pg-section-head .small { color: var(--color-muted-fg); }

.pg-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px 5px 11px; border-radius: 999px;
  font-family: var(--font-heading); font-size: .78rem; line-height: 1.2; white-space: nowrap;
  color: var(--tone, var(--color-fg)); background: var(--tone-bg, var(--color-surface-3));
}
.pg-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pg-pill.live { --tone: var(--color-pos); --tone-bg: var(--color-pos-bg); }
.pg-pill.live i { animation: pg-pulse 1.8s ease-in-out infinite; }
.pg-pill.stopped { --tone: var(--color-danger); --tone-bg: var(--color-danger-bg); }
.pg-pill.draft { --tone: #5f5f68; --tone-bg: var(--color-surface-3); }
.pg-pill.warn { --tone: #a15c07; --tone-bg: #fff4dc; }
@keyframes pg-pulse { 50% { opacity: .3; } }

.pg-empty {
  display: grid; justify-items: center; gap: 8px; text-align: center; padding: 44px 24px;
  background: var(--color-surface); border: 1px dashed var(--color-border-strong); border-radius: 28px;
}
.pg-empty .ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 20px; background: var(--color-surface-2); margin-bottom: 6px; }
.pg-empty h3 { margin: 0; font-size: 1.15rem; }
.pg-empty p { margin: 0 0 10px; max-width: 46ch; color: var(--color-muted-fg); }

/* ------------------------------------------------------------------ dashboard */
.pg-onboard {
  display: flex; align-items: center; gap: 18px 24px; flex-wrap: wrap; margin-bottom: 20px; padding: 22px 26px;
  border-radius: 28px; color: #fff; background: radial-gradient(120% 160% at 0% 0%, #26262c 0%, #0b0b0c 62%);
}
.pg-onboard .ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 16px; background: rgba(255, 255, 255, .12); }
.pg-onboard .grow strong { display: block; font-family: var(--font-heading); font-weight: 400; font-size: 1.1rem; margin-bottom: 2px; color: #fff; }
.pg-onboard .grow p { margin: 0; font-size: .92rem; color: rgba(255, 255, 255, .72); max-width: 62ch; }
.pg-onboard .btn { background: #fff; color: #000; }
.pg-onboard .btn:hover { background: #e9e9ec; color: #000; }

.pg-bento { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 1100px) { .pg-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pg-equity { grid-column: 1 / -1; } }
@media (max-width: 560px) { .pg-bento { grid-template-columns: minmax(0, 1fr); } }
.pg-equity {
  grid-row: span 2; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 26px;
  padding: 28px; color: #fff; border-radius: 30px;
  background: radial-gradient(90% 120% at 100% 0%, #2d2d34 0%, #0b0b0c 58%);
  box-shadow: var(--shadow-md);
}
.pg-equity .k { margin: 0 0 8px; font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; color: rgba(255, 255, 255, .62); }
.pg-equity .big { font-family: var(--font-heading); font-size: clamp(2.2rem, 4.4vw, 3.4rem); letter-spacing: -.04em; line-height: 1; overflow-wrap: anywhere; }
.pg-alloc { display: grid; gap: 10px; }
.pg-alloc .bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .14); }
.pg-alloc .bar i { display: block; height: 100%; background: #3ddc97; border-radius: 999px; transform-origin: left; animation: pg-grow .9s var(--ease) both; }
@keyframes pg-grow { from { transform: scaleX(0); } }
.pg-alloc .legend { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .84rem; color: rgba(255, 255, 255, .72); }
.pg-alloc .legend b { font-family: var(--font-heading); font-weight: 400; color: #fff; }
.pg-alloc .legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #3ddc97; }
.pg-alloc .legend .dot.cash { background: rgba(255, 255, 255, .35); }

.pg-tile { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 132px; padding: 22px 24px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 28px; box-shadow: var(--shadow-sm); }
.pg-tile .k { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--color-muted-fg); }
.pg-tile .ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--color-surface-2); color: var(--color-fg); }
.pg-tile .v { font-family: var(--font-heading); font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -.03em; line-height: 1.05; overflow-wrap: anywhere; }
.pg-tile.wide { grid-column: span 2; }
@media (max-width: 560px) { .pg-tile.wide { grid-column: auto; } }
.pg-tile.pos .ic { background: var(--color-pos-bg); color: var(--color-pos); }
.pg-tile.neg .ic { background: var(--color-danger-bg); color: var(--color-danger); }
.pg-tile .sub { margin: 4px 0 0; font-size: .84rem; color: var(--color-muted-fg); }

.pg-live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pg-live { display: flex; flex-direction: column; gap: 16px; padding: 22px 24px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 28px; box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.pg-live:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pg-live.on { border-top: 3px solid var(--color-pos); }
.pg-live h3 { margin: 0 0 4px; font-size: 1.1rem; overflow-wrap: anywhere; }
.pg-live .sym { font-family: var(--font-mono); font-size: .8rem; color: var(--color-muted-fg); }
.pg-live .row-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pg-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pg-metrics > div { padding: 12px 14px; border-radius: 16px; background: var(--color-surface-2); min-width: 0; }
.pg-metrics .k { display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--color-muted-fg); margin-bottom: 3px; }
.pg-metrics .v { font-family: var(--font-mono); font-size: 1rem; overflow-wrap: anywhere; }
.pg-live .last { margin: 0; font-size: .82rem; color: var(--color-muted-fg); overflow-wrap: anywhere; }
.pg-live .btn { align-self: flex-start; }
.pg-live .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pg-live .actions form { margin: 0; }
.pg-live .deploy-inline { display: flex; flex-direction: column; gap: 6px; }
.pg-live .deploy-inline select { flex: 1 1 180px; min-width: 0; }
.pg-live .actions .btn { align-self: auto; }

/* live indicator panels (markup owned by dashboard/index.html + indicators.js) */
.pg-ind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.pg-ind { padding: 22px 24px !important; border-radius: 28px !important; box-shadow: var(--shadow-sm) !important; }
.pg-ind .indicator-readout { margin-top: 14px; }
/* the card header: name + contract on the left, the Entry / Exit signals on the right, then one full-width line each for what the engine is doing */
.pg-ind .ind-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.pg-ind .ind-title { flex: 1 1 200px; min-width: 0; }
.pg-ind .ind-title strong { overflow-wrap: anywhere; }
.pg-ind .ind-title .mono { overflow-wrap: anywhere; line-height: 1.5; margin-top: 2px; }
.pg-ind .ind-pills { display: flex; gap: 8px; flex: 0 0 auto; }
.pg-ind .ind-pill { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.pg-ind .ind-pill small { font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--color-muted-fg); padding-left: 4px; }
.pg-ind .ind-pill .signal-pill { white-space: nowrap; }
.pg-ind .ind-line { margin: 8px 0 0; line-height: 1.5; overflow-wrap: anywhere; }
.pg-ind .ind-line[hidden] { display: none; }
.pg-ind .spread { flex-wrap: wrap; gap: 8px 12px; }
.pg-ind .badge { white-space: nowrap; }
.pg-ind .indicator-readout .ind { border-radius: 16px; background: var(--color-surface-2); border-color: transparent; }

.pg-orders { list-style: none; margin: 0; padding: 0; display: grid; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 28px; box-shadow: var(--shadow-sm); overflow: hidden; }
.pg-orders li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--color-border); }
.pg-orders li:last-child { border-bottom: 0; }
.pg-side { display: grid; place-items: center; width: 48px; height: 30px; border-radius: 999px; font-family: var(--font-mono); font-size: .74rem; }
.pg-side.buy { background: var(--color-pos-bg); color: var(--color-pos); }
.pg-side.sell { background: var(--color-danger-bg); color: var(--color-danger); }
.pg-orders .t { font-family: var(--font-heading); }
.pg-orders .t small { font-family: var(--font-mono); font-size: .78rem; color: var(--color-muted-fg); margin-left: 8px; }
.pg-orders .why { grid-column: 2; font-size: .82rem; color: var(--color-muted-fg); overflow-wrap: anywhere; }
.pg-orders .when { font-family: var(--font-mono); font-size: .78rem; color: var(--color-muted-fg); text-align: right; }
.pg-orders .px { font-family: var(--font-mono); font-size: .95rem; text-align: right; }

/* ------------------------------------------------------------------ strategies */
.pg-strats { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.pg-strat { display: flex; flex-direction: column; gap: 16px; padding: 24px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 28px; box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.pg-strat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.pg-strat.on { border-top: 3px solid var(--color-pos); }
.pg-strat h3 { margin: 0 0 6px; font-size: 1.15rem; overflow-wrap: anywhere; }
.pg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pg-chip { padding: 4px 11px; border-radius: 999px; background: var(--color-surface-2); font-family: var(--font-mono); font-size: .76rem; color: var(--color-fg-soft); }
.pg-chip.short { background: var(--color-danger-bg); color: var(--color-danger); font-family: var(--font-heading); }
.pg-strat .pg-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pg-strat .pg-metrics > div { padding: 10px 12px; }
@media (max-width: 480px) { .pg-strat .pg-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pg-rules { margin: 0; display: grid; gap: 8px; }
.pg-rules > div { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; align-items: start; }
.pg-rules dt { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--color-muted-fg); padding-top: 2px; }
.pg-rules dd { margin: 0; font-family: var(--font-mono); font-size: .78rem; line-height: 1.5; color: var(--color-fg-soft); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pg-edited { margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--color-warn-bg); color: var(--color-warn); font-size: .8rem; line-height: 1.45; }
.pg-strat .last { margin: 0; font-family: var(--font-mono); font-size: .78rem; color: var(--color-muted-fg); overflow-wrap: anywhere; }
.pg-strat .actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.pg-new {
  display: grid; place-items: center; align-content: center; gap: 10px; min-height: 240px; padding: 24px; width: 100%;
  font: inherit; color: var(--color-fg); text-align: center; cursor: pointer;
  background: transparent; border: 1.5px dashed var(--color-border-strong); border-radius: 28px;
  transition: background-color .2s ease, border-color .2s ease, transform .25s var(--ease);
}
.pg-new:hover { background: var(--color-surface); border-color: var(--color-fg); transform: translateY(-3px); }
.pg-new:disabled { opacity: .5; cursor: not-allowed; }
.pg-new:disabled:hover { background: transparent; border-color: var(--color-border-strong); transform: none; }
.pg-new .ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--color-fg); color: #fff; }
.pg-new strong { font-family: var(--font-heading); font-weight: 400; font-size: 1.1rem; }
.pg-new span { font-size: .86rem; color: var(--color-muted-fg); max-width: 26ch; }

/* ------------------------------------------------------------------ brokers */
.pg-brokers { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.pg-broker { display: flex; flex-direction: column; gap: 18px; padding: 24px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 28px; box-shadow: var(--shadow-sm); }
.pg-broker-head { display: flex; align-items: center; gap: 14px; }
.pg-mark { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 17px; background: var(--color-fg); color: #fff; font-family: var(--font-heading); font-size: .9rem; letter-spacing: .02em; }
.pg-mark.paper { background: var(--color-surface-3); color: var(--color-fg); }
.pg-broker-head h3 { margin: 0 0 2px; font-size: 1.15rem; overflow-wrap: anywhere; }
.pg-broker-head .sub { font-family: var(--font-mono); font-size: .78rem; color: var(--color-muted-fg); }
.pg-broker-head .pg-pill { margin-left: auto; }
.pg-broker .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.pg-connect { margin-top: 28px; padding: 28px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 30px; box-shadow: var(--shadow-sm); }
.pg-connect > h2 { margin: 0 0 4px; font-size: 1.3rem; }
.pg-connect > .lede { margin: 0 0 20px; color: var(--color-muted-fg); }

/* ------------------------------------------------------------------ analytics / monitor */
.pg-scope { min-width: 240px; }
.pg-scope label { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--color-muted-fg); }
.pg-kpis .stat { border-radius: 26px; padding: 20px 24px; }
.pg-kpis .stat .value { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.pg-mon-sym { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* ------------------------------------------------------------------ split-screen auth */
.auth-split { display: grid; grid-template-columns: minmax(0, 1fr); place-items: stretch; align-items: stretch; padding: 16px; gap: 16px; background: none; min-height: 100dvh; }
.auth-main { display: grid; place-items: center; padding: 8px; }
.auth-aside { display: none; }
@media (min-width: 980px) {
  .auth-split { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); padding: 16px; }
  .auth-aside {
    position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
    padding: 44px 48px; border-radius: 36px; color: #fff;
    background: radial-gradient(120% 100% at 0% 0%, #2a2a31 0%, #0b0b0c 60%);
  }
}
.auth-aside .brand { color: #fff; }
.auth-aside h2 { margin: 26px 0 0; max-width: 12ch; color: #fff; font-size: clamp(2.6rem, 4.6vw, 4.2rem); line-height: 1; letter-spacing: -.04em; }
.auth-aside h2 span { color: rgba(255, 255, 255, .5); }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; position: relative; z-index: 1; }
.auth-points li { display: flex; gap: 14px; align-items: flex-start; max-width: 40ch; color: rgba(255, 255, 255, .78); font-size: .98rem; line-height: 1.5; }
.auth-points li b { display: block; font-family: var(--font-heading); font-weight: 400; color: #fff; }
.auth-points .b { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 10px; background: rgba(255, 255, 255, .13); color: #3ddc97; }
.auth-candles { align-self: flex-end; width: min(100%, 440px); height: auto; margin: 0 -8px -8px 0; opacity: .95; pointer-events: none; }
.auth-aside .top { position: relative; z-index: 1; }
.auth-card h1 { font-size: 2rem; }

/* ------------------------------------------------------------------ error pages */
.pg-error { display: grid; justify-items: center; gap: 10px; text-align: center; max-width: 560px; margin: 0 auto; padding: 24px; }
.pg-error .code {
  font-family: var(--font-heading); font-size: clamp(6rem, 22vw, 11rem); line-height: .9; letter-spacing: -.06em;
  background: linear-gradient(180deg, #0b0b0c 30%, rgba(11, 11, 12, .08)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pg-error h1 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.4rem); }
.pg-error p { margin: 0 0 14px; color: var(--color-muted-fg); font-size: 1.05rem; }
.pg-error svg { width: min(100%, 360px); height: auto; margin-bottom: 6px; }
.pg-error .row { justify-content: center; gap: 10px; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  .pg-live, .pg-strat, .pg-new { transition: none; }
  .pg-live:hover, .pg-strat:hover, .pg-new:hover { transform: none; }
  .pg-pill.live i { animation: none; }
  .pg-alloc .bar i { animation: none; }
}

/* the aside already carries the wordmark on wide screens */
@media (min-width: 980px) { .auth-split .auth-card .brand { display: none; } .auth-split .auth-card h1 { margin-top: 4px; } }
/* error pages sit on the studio gradient like the auth pages */
.auth-wrap:has(.pg-error) { min-height: 100dvh; }


/* ------------------------------------------------------------------ live position values */
.live-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .74rem; letter-spacing: .02em;
  background: var(--color-surface-2); color: var(--color-muted-fg); border: 1px solid var(--color-border); font-weight: 400; }
.live-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--color-border-strong); }
.live-badge[data-state="live"] { color: #0b6b3a; background: #e8f6ee; border-color: #bfe5cf; }
.live-badge[data-state="live"]::before { background: #12a150; animation: live-pulse 1.6s ease-in-out infinite; }
.live-badge[data-state="delayed"] { color: #8a5a00; background: #fff4de; border-color: #f1d9a3; }
.live-badge[data-state="delayed"]::before { background: #d99100; }
.live-badge[data-state="error"] { color: #a02a1f; background: #fdecea; border-color: #f2b8b1; }
.live-badge[data-state="error"]::before { background: #d93025; }
@keyframes live-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
.pct { color: inherit; opacity: .8; margin-left: 4px; }
.tick-up { animation: tick-up .9s ease-out; }
.tick-down { animation: tick-down .9s ease-out; }
@keyframes tick-up { 0% { background: rgba(18, 161, 80, .28); } 100% { background: transparent; } }
@keyframes tick-down { 0% { background: rgba(217, 48, 37, .26); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .tick-up, .tick-down, .live-badge[data-state="live"]::before { animation: none; } }

/* live and paper side by side inside the same tile - never added together, and never a section of their own */
.pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px 22px; }
.pair.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pair .col { min-width: 0; }
.pair.two .col + .col { padding-left: 22px; border-left: 1px solid var(--color-border); }
.pair .tag { display: inline-block; margin-bottom: 6px; font-size: .68rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--color-muted-fg); }
.pair .tag.paper::before, .pair .col.paper > .k::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 2px; background: repeating-linear-gradient(45deg, currentColor 0 2px, transparent 2px 4px); vertical-align: 1px; }
.pg-equity .pair.two .col + .col { border-left-color: rgba(255, 255, 255, .18); }
.pair.two .big { font-size: clamp(1.45rem, 2.6vw, 2.2rem); }
.pair.two .v { font-size: clamp(1.1rem, 1.7vw, 1.5rem); }
.pg-tile .pair.two .sub { font-size: .76rem; }
@media (max-width: 560px) {                      /* a phone: stack the two, divided by a rule instead of a column edge */
  .pair.two { grid-template-columns: minmax(0, 1fr); }
  .pair.two .col + .col { padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--color-border); }
  .pg-equity .pair.two .col + .col { border-top-color: rgba(255, 255, 255, .18); }
}
.stat .pair.two { gap: 10px 14px; }
.stat .pair.two .col + .col { padding-left: 14px; }
.stat .pair.two .value { font-size: clamp(1rem, 1.5vw, 1.4rem); white-space: nowrap; overflow-wrap: normal; }
.stat .pair .tag { margin-bottom: 4px; }
@media (max-width: 560px) { .stat .pair.two .col + .col { padding: 10px 0 0; } }
.pg-kpis:has(.pair.two) { grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* two numbers per card need the room */
@media (min-width: 1500px) { .pg-kpis:has(.pair.two) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* with a paper column beside every live figure each tile needs roughly twice the width: equity across the top, the rest in pairs */
.pg-bento.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pg-bento.two .pg-equity { grid-column: 1 / -1; grid-row: auto; }
.pg-bento.two .pg-equity .pair.two .big { white-space: nowrap; }
.pg-tile .pair.two .v { white-space: nowrap; overflow-wrap: normal; }
@media (max-width: 700px) { .pg-bento.two { grid-template-columns: minmax(0, 1fr); } .pg-bento.two .pg-tile.wide { grid-column: auto; } }
.orders-pair .tag { margin-bottom: 10px; }
table.data.compact { font-size: .86rem; }
table.data.compact th, table.data.compact td { padding: 10px 12px; }
table.data.compact td:first-child { white-space: nowrap; }
table.data.compact td:nth-child(3) { white-space: nowrap; }

/* KPI cards with a Live and a Paper number: the monospace figures are wide, so size them to the card and stack the two
   (divided by a rule) when the card is too narrow for both - never let them touch */
.stat:has(.pair.two) { container-type: inline-size; }
.stat .pair.two .value { font-size: clamp(.95rem, 4.6cqi, 1.3rem); letter-spacing: -.02em; }
.stat .pair.two .col + .col { padding-left: 16px; }
@container (max-width: 330px) {
  .stat .pair.two { grid-template-columns: minmax(0, 1fr); }
  .stat .pair.two .col + .col { padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--color-border); }
  .stat .pair.two .value { font-size: 1.3rem; }                       /* stacked, so there is room for the bigger figure */
}
.pg-back { color: inherit; text-decoration: none; }
.pg-back:hover { text-decoration: underline; }
