/* MetaSynx home page: the drawn phone. Everything inside .ph-screen is in app dp (1 CSS px = 1 dp) at the app's own
   font sizes (text scale 1.0), drawn from app/lib (theme.dart AppColors dark; each widget's own file for sizes).
   The whole phone scales as one unit: set --ph-scale on .ph (393 × 852 dp screen + a 10 dp bezel). */

.ph {
  --ph-scale: 1;
  position: relative;
  flex: none;
  width: calc(413px * var(--ph-scale));
  height: calc(872px * var(--ph-scale));
  border-radius: calc(56px * var(--ph-scale));
  background: #05080B;
  box-shadow: 0 0 0 1px #2B3644, 0 40px 90px -30px rgba(0, 161, 255, .28), 0 24px 60px -24px rgba(0, 224, 138, .16);
  /* a drawn phone is a picture: a touch, a wheel or a click on it reaches the page (it never takes the page's scroll) */
  pointer-events: none;
}
.ph > .ph-screen {
  position: absolute;
  left: calc(10px * var(--ph-scale));
  top: calc(10px * var(--ph-scale));
  transform: scale(var(--ph-scale));
  transform-origin: 0 0;
}

.ph-screen {
  --bg: #0A0E14;
  --surface: #161B22;
  --border: #30363D;
  --primary: #00D4AA;
  --t2: #9CA3AF;
  --t3: #C0C7D0;
  --muted: #8B949E;
  --loss: #F44336;
  --err: #F44336;
  --warn: #FF9800;
  --c-eg: #00FF8F;
  --c-dll: #00A1FF;
  --grad: linear-gradient(90deg, #00FF8F, #00A1FF);
  position: relative;
  width: 393px;
  height: 852px;
  overflow: hidden;
  border-radius: 46px;
  background: var(--bg);
  color: #fff;
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.172; /* Roboto's own ascent + descent: what Flutter's Text uses with no height set */
  text-align: left;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: normal;
  user-select: none;
  isolation: isolate;
}
.ph-screen *, .ph-screen *::before, .ph-screen *::after { box-sizing: border-box; }
.ph-screen svg { display: block; flex: none; }
.ph-screen b, .ph-screen strong { font-weight: 700; }
.ph-screen i { font-style: normal; }

/* Live numbers: colour follows the sign (AppColors.pl: > 0 primary, < 0 loss, exactly 0 tertiary). */
.ph-screen .pos { color: var(--primary); }
.ph-screen .neg { color: var(--loss); }
.ph-screen .zero { color: var(--t3); }
.ph-screen .warn { color: var(--warn); }

/* ── Stacked views (route push / pop: 300 ms, Flutter's page route) ── */
.ph-view {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
  transform: none;
  transition: transform 300ms cubic-bezier(.18, 1, .04, 1), opacity 150ms;
  /* no will-change: a layer per view on every phone made each frame's layerize cost add up; Chrome promotes a view
     while its transform transitions anyway */
}
.ph-view.on { transform: none; }
.ph-view.off-right { transform: translateX(100%); }
.ph-view.off-left { transform: translateX(-30%); }
/* a bottom-nav tab switch (Home ↔ Chart): the other tab fades out under the new one */
.ph-view.tab-off { opacity: 0; pointer-events: none; }

/* ── Status bar (9:41, full signal + battery) and the home indicator ── */
.ph-status {
  position: relative; z-index: 2;
  height: 36px; flex: none;
  padding: 2px 26px 0 30px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 600; letter-spacing: .2px; color: #fff;
}
.ph-status-icons { display: flex; align-items: center; gap: 6px; }
.ph-homeind {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 9;
  height: 21px; pointer-events: none;
}
.ph-homeind::after {
  content: ''; position: absolute; left: 50%; bottom: 8px;
  width: 134px; height: 5px; margin-left: -67px; border-radius: 3px; background: rgba(255, 255, 255, .88);
}

/* ── Home ── */
.ph-home { position: absolute; inset: 0; display: flex; flex-direction: column; }
.ph-home-body { flex: 1; min-height: 0; padding: 24px 24px 0; display: flex; flex-direction: column; }
.ph-header { height: 45px; flex: none; display: flex; align-items: center; }
.ph-logo { height: 45px; width: auto; display: block; }
.ph-header-btns { margin-left: auto; display: flex; gap: 10px; }
.ph-hbtn {
  width: 32px; height: 32px; flex: none; border-radius: 8px;
  background: rgba(0, 212, 170, .15); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.ph-list { flex: 1; min-height: 0; margin-top: 15px; overflow: hidden; }

.ph-card {
  position: relative;
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}
.ph-card.ph-total {
  margin-bottom: 12px;
  border: 0.5px solid transparent;
  background:
    linear-gradient(135deg, rgba(0, 212, 170, .15), rgba(0, 212, 170, .05)) padding-box,
    linear-gradient(var(--bg), var(--bg)) padding-box,
    linear-gradient(90deg, #00FF8F, #00A1FF) border-box;
}
.ph-card.ph-total.open { margin-bottom: 16px; }
.ph-crow { display: flex; align-items: center; }
.ph-cname { flex: 1; min-width: 0; display: flex; align-items: center; }
.ph-cname b { font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-cname .num { margin-left: 6px; font-size: 12px; color: var(--t2); }
.ph-total .ph-cname b { color: var(--primary); }
.ph-total .ph-cname .cnt { margin-left: 5px; font-size: 12px; font-weight: 700; color: var(--primary); }
.ph-toggle { padding: 4px 6px; color: var(--t2); }
.ph-main {
  margin-left: 8px;
  padding: 2px 6px; border-radius: 4px;
  background: var(--grad);
  color: #000; font-size: 9px; font-weight: 700;
}
.ph-main.glow { box-shadow: 0 0 8px rgba(0, 255, 143, .2); }
.ph-chev { color: var(--t2); }
.ph-cpl { display: flex; flex-direction: column; align-items: flex-end; margin-right: 8px; }
.ph-cpl small { display: flex; font-size: 11px; color: var(--t2); white-space: nowrap; }
.ph-cpl small i { margin-left: 8px; }
.ph-cpl strong { margin-top: 2px; font-size: 14px; font-weight: 600; }
.ph-stats { display: flex; margin-top: 6px; }
.ph-stats > div { flex: 1; min-width: 0; }
.ph-stats small { display: flex; font-size: 11px; color: var(--t2); white-space: nowrap; }
.ph-stats small i { margin-left: 8px; }
.ph-stats strong { display: block; margin-top: 2px; font-size: 14px; font-weight: 600; color: #fff; white-space: nowrap; }

/* Equity Guard (top) + Daily Loss Limit (bottom): 3 dp LinearProgressIndicators flush inside the card's clip.
   Fill = --eg / --dll (0..1) on the .ph-cw wrapper, which clips like the app's ClipRRect (bars over the border). */
.ph-cw { position: relative; margin-bottom: 12px; border-radius: 12px; overflow: hidden; }
.ph-cw > .ph-card { margin-bottom: 0; }
.ph-rb { position: absolute; left: 0; height: 3px; pointer-events: none; }
.ph-rb.eg { top: 0; width: calc(var(--eg, 0) * 100%); background: var(--c-eg); }
.ph-rb.dll { bottom: 0; width: calc(var(--dll, 0) * 100%); background: var(--c-dll); }
.ph-rb { transition: width 400ms linear; }

/* Copilot button (GradientFab: 48 dp, 1.25 dp brand ring, Icons.blur_on 28 through the brand gradient) */
.ph-fab {
  position: absolute; right: 16px; bottom: 94px; z-index: 5;
  width: 48px; height: 48px; border-radius: 50%;
  border: 1.25px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(90deg, #00FF8F, #00A1FF) border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  display: flex; align-items: center; justify-content: center;
}

/* Bottom navigation (BottomNavBar: surface, 1 dp top border, 4 dp padding, items 6 dp padding, icon 22, label 10) */
.ph-nav {
  position: relative; z-index: 4; flex: none;
  height: 78px; padding: 4px 0 21px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; align-items: flex-start;
}
.ph-nav > span {
  flex: 1; padding: 6px 0;
  display: flex; flex-direction: column; align-items: center;
  font-size: 10px; color: var(--t2);
}
.ph-nav > span svg { margin-bottom: 2px; }
.ph-nav > span.cal svg { margin: 1px 0 3px; }
.ph-nav > span.on { color: #fff; font-weight: 600; }
.ph-nav > span.on svg, .ph-nav > span.on em { color: transparent; }
.ph-nav > span.on em {
  font-style: normal;
  background: linear-gradient(135deg, #00FF8F, #00A1FF);
  -webkit-background-clip: text; background-clip: text;
}
.ph-nav > span em { font-style: normal; line-height: 1.172; }

/* ── Pushed screens: AppBar (surface, 56 dp, chevron_left, title 18 w600) under the status bar ── */
.ph-push { position: absolute; inset: 0; display: flex; flex-direction: column; }
.ph-top { flex: none; background: var(--surface); }
.ph-appbar { height: 56px; display: flex; align-items: center; }
.ph-back { width: 56px; height: 56px; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; }
.ph-title { margin-left: 16px; flex: 1; min-width: 0; font-size: 18px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-appbar .ph-header-btns { margin-right: 15px; }
.ph-quote { margin-right: 16px; display: flex; flex-direction: column; align-items: flex-end; font-size: 14px; font-weight: 500; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ph-quote .ask { color: var(--primary); }
.ph-quote .bid { color: var(--err); }
.ph-scroll {
  position: relative; flex: 1; min-height: 0;
  margin-bottom: 21px;
  overflow: hidden; /* scrolled by the sequences only (scrollTop, smooth): never by the reader's finger or wheel */
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.ph-scroll::-webkit-scrollbar { display: none; }
.ph-pad { padding: 16px; }

/* ── New Order ── */
.ph-label { font-size: 12px; letter-spacing: 2px; color: var(--t3); }
.ph-label + * { margin-top: 8px; }
.ph-sec .ph-label + svg { margin-top: 0; }
.ph-gap24 { height: 24px; }
.ph-field {
  height: 55px; padding: 0 16px;
  display: flex; align-items: center;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
  font-size: 18px; color: #fff;
}
.ph-field.hint { font-size: 16px; color: rgba(156, 163, 175, .5); height: 49px; }
.ph-field.sl { border-color: rgba(244, 67, 54, .5); }
.ph-field.tp { border-color: rgba(0, 212, 170, .5); }
.ph-seg { display: flex; border-radius: 12px; background: var(--surface); }
.ph-seg > span {
  flex: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid transparent;
  color: var(--t2);
}
.ph-seg.side > span { padding: 15px 0; font-size: 16px; font-weight: 700; }
.ph-seg.side > span.buy.on { background: var(--primary); color: #000; }
.ph-seg.side > span.sell.on { background: var(--err); color: #fff; }
.ph-seg.exec > span { padding: 11px 0; font-size: 14px; }
.ph-seg.exec > span.on { background: rgba(0, 212, 170, .2); border-color: var(--primary); color: var(--primary); font-weight: 700; }
/* ACCOUNTS (n/n) with the Lot ratios pill right after it (lot_ratios_pill.dart, on: gradient under a black label) */
.ph-acchead { display: flex; align-items: center; }
.ph-acchead .ph-label + * { margin-top: 0; }
.ph-ratios { margin-left: 10px; padding: 6px 12px; border-radius: 18px; background: var(--grad); color: #000; font-size: 12px; font-weight: 700; line-height: 1.172; white-space: nowrap; }
.ph-acchead + .ph-chips2 { margin-top: 8px; }
.ph-chips2 { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-achip {
  display: flex; align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 212, 170, .2);
  border: 0.5px solid var(--primary);
}
.ph-achip svg { color: var(--primary); margin-right: 8px; }
.ph-achip b { display: flex; align-items: center; font-size: 13px; font-weight: 600; color: #fff; }
.ph-achip b i { margin-left: 6px; padding: 1px 4px; border-radius: 3px; background: var(--primary); color: #000; font-size: 8px; font-weight: 700; }
.ph-achip small { display: block; font-size: 10px; color: var(--t3); }
.ph-achip small.ratio { color: #00A1FF; font-weight: 600; } /* lots from a ratio other than 1: blue (gradientBlueText) */
.ph-lotbox {
  display: flex; align-items: center;
  padding: 12px 8px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
}
.ph-lotbox > span { padding: 8px 12px; font-size: 14px; }
.ph-lotbox .dn { color: rgba(244, 67, 54, .7); }
.ph-lotbox .up { color: rgba(0, 212, 170, .7); }
.ph-lotbox strong { flex: 1; text-align: center; font-size: 24px; font-weight: 700; color: #fff; }
.ph-sltp { display: flex; gap: 16px; }
.ph-sltp > div { flex: 1; min-width: 0; }
.ph-place {
  margin-top: 32px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: var(--primary);
  font-size: 16px; font-weight: 700; color: #000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: filter 120ms, transform 120ms;
}
.ph-place.sell { background: var(--err); color: #fff; }
.ph-place.pressed { filter: brightness(.82); transform: scale(.985); }
/* _isPlacing: the button disabled (Material's disabled fill) with a white CircularProgressIndicator */
.ph-place.busy { background: rgba(255, 255, 255, .12); filter: none; transform: none; }
.ph-spin { width: 26px; height: 26px; border-radius: 50%; border: 3.5px solid #fff; border-right-color: transparent; animation: cpSpin 800ms linear infinite; }

/* ── Total Overview / account screen ── */
.ph-sum {
  padding: 16px;
  border-radius: 12px;
  border: 0.5px solid transparent;
  background:
    linear-gradient(135deg, rgba(0, 212, 170, .15), rgba(0, 212, 170, .05)) padding-box,
    linear-gradient(var(--bg), var(--bg)) padding-box,
    linear-gradient(90deg, #00FF8F, #00A1FF) border-box;
}
.ph-sum-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.ph-sum-top b { font-size: 12px; letter-spacing: 1px; color: var(--primary); }
.ph-sum-top span { font-size: 11px; color: var(--t2); }
.ph-sum .ph-stats { margin-top: 0; }
.ph-sum .ph-stats small i { margin-left: 6px; }
.ph-sum .ph-stats strong { font-size: var(--fig, 16px); }
.ph-sum-div { display: flex; align-items: center; margin: 12px 0; }
.ph-sum-div::before { content: ''; flex: 1; border-top: 1px solid var(--border); }
.ph-sum-div svg { margin-left: 8px; color: var(--t2); }
.ph-sum-grid { display: flex; justify-content: space-around; text-align: center; }
.ph-sum-grid small { display: block; font-size: 11px; color: var(--t2); }
.ph-sum-grid span { display: block; font-size: 13px; }
.ph-sum-grid .zero { color: var(--t3); }
.ph-sec { margin-top: 24px; display: flex; align-items: center; }
.ph-sec b { font-size: 12px; letter-spacing: 1px; color: var(--t2); }
.ph-sec .ph-label { line-height: 1.172; }
.ph-sec svg { margin-left: 8px; color: var(--t2); }
.ph-pairs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ph-pair {
  display: flex; align-items: center;
  padding: 6px 10px; border-radius: 8px;
  background: rgba(0, 212, 170, .2); border: 1px solid var(--primary);
  color: var(--primary); font-size: 12px; font-weight: 500;
}
.ph-pair i { margin-left: 6px; padding: 2px 6px; border-radius: 10px; background: var(--primary); color: #000; font-size: 10px; font-weight: 700; }
.ph-groups { margin-top: 16px; }
.ph-group { margin-bottom: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.ph-ghead { display: flex; align-items: stretch; padding: 12px; }
.ph-ghead > b { align-self: center; font-size: 14px; color: #fff; }
.ph-side { flex: 1; align-self: center; margin-left: 12px; font-size: 12px; color: var(--t2); white-space: nowrap; }
.ph-side2 { display: flex; flex-direction: column; justify-content: space-between; gap: 2px; }
.ph-side .b { color: var(--primary); }
.ph-side .s { color: var(--err); }
.ph-gpl { margin-left: 12px; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.ph-gpl small { font-size: 10px; }
.ph-gpl strong { font-size: 14px; font-weight: 700; }
.ph-gpl .zero { color: #fff; }
.ph-row { display: flex; align-items: center; padding: 12px; border-top: 0.5px solid var(--border); }
.ph-tag { padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.ph-tag.buy { color: var(--primary); background: rgba(0, 212, 170, .2); }
.ph-tag.sell { color: var(--err); background: rgba(244, 67, 54, .2); }
.ph-lots { margin-left: 8px; font-size: 13px; color: #fff; }
.ph-acct { margin-left: 8px; padding: 2px 6px; border-radius: 4px; background: rgba(22, 27, 34, .5); font-size: 11px; color: var(--t2); }
.ph-rright { margin-left: auto; display: flex; align-items: center; }
.ph-rright small { font-size: 10px; margin-right: 6px; }
.ph-rright strong { font-size: 13px; font-weight: 600; }
.ph-rright svg { margin-left: 8px; color: var(--t2); }

/* ── The order card (components/order_card.dart): top right, 70 % wide, brand gradient, black ink ── */
.ph-orders { position: absolute; top: 96px; right: 16px; z-index: 7; width: 275px; }
.ph-ocard {
  padding: 0 0 10px 16px;
  border-radius: 10px;
  background: linear-gradient(90deg, #00FF8F, #00A1FF);
  box-shadow: 0 4px 12px rgba(0, 161, 255, .3);
  color: #000;
  animation: phCardIn 300ms cubic-bezier(.215, .61, .355, 1);
}
.ph-ocard.bad { background: #FF1744; box-shadow: 0 4px 12px rgba(255, 23, 68, .3); }
.ph-ohead { display: flex; align-items: flex-start; }
.ph-ohead p { flex: 1; margin: 12px 0 0; font-size: 14px; font-weight: 600; }
.ph-ohead span { width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; }
.ph-oline { display: flex; align-items: flex-start; padding: 4px 16px 0 0; }
.ph-oline svg { margin-top: 1px; margin-right: 6px; }
.ph-oline p { flex: 1; min-width: 0; margin: 0; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* one line each (operator 17 Nov) */
.ph-oline p b { font-weight: 700; }
.ph-oline > em { margin-left: 10px; font-style: normal; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ph-oline > em b { font-weight: 700; }
.ph-oline > em span { font-weight: 500; color: rgba(0, 0, 0, .7); }
@keyframes phCardIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: none; } }

/* ── Bottom sheet + 0.54 black scrim ── */
.ph-scrim { position: absolute; inset: 0; z-index: 20; background: rgba(0, 0, 0, .54); opacity: 0; pointer-events: none; transition: opacity 250ms; }
.ph-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 21;
  max-height: 90%;
  border-radius: 16px 16px 0 0;
  background: var(--surface);
  transform: translateY(100%);
  transition: transform 250ms cubic-bezier(.2, 0, 0, 1);
}
.ph-sheet.open { transform: none; }
.ph-scrim.open { opacity: 1; }

/* ── A finger tap (a ring that swells and fades where the next tap lands) ── */
.ph-tap {
  position: absolute; z-index: 30;
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .28);
  border: 2px solid rgba(255, 255, 255, .85);
  pointer-events: none;
  opacity: 0;
  animation: phTap 600ms ease-out;
}
/* A finger held down for a drag (E's): follows the line being dragged (loops.js sets its transform) */
.ph-finger {
  position: absolute; left: 0; top: 0; z-index: 30;
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  border: 2px solid rgba(255, 255, 255, .8);
  pointer-events: none; opacity: 0;
  transition: opacity 150ms, background-color 150ms;
}
.ph-finger.show { opacity: .95; }
.ph-finger.press { background: rgba(255, 255, 255, .42); }
@keyframes phTap {
  0% { opacity: .95; transform: scale(.4); }
  60% { opacity: .7; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.35); }
}

/* ── Chart (screens/chart.dart; the canvas, lines and labels from utils/chart_html.dart, dark) ── */
.ph-chart { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.ch-top { height: 46px; flex: none; padding: 0 12px; display: flex; align-items: center; gap: 8px; }
.ch-field { flex: 1; min-width: 0; height: 38px; padding: 1px; border-radius: 8px; background: var(--grad); }
.ch-field span { display: flex; align-items: center; height: 100%; padding: 0 12px; border-radius: 7px; background: var(--surface); font-size: 15px; color: #fff; }
.ch-srch { width: 38px; height: 38px; flex: none; border-radius: 8px; border: 1px solid #00A1FF; background: var(--surface); color: #00A1FF; display: flex; align-items: center; justify-content: center; }
.ch-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ch-sel { flex: none; display: flex; gap: 8px; padding: 4px 12px; }
.ch-dd { flex: 1; min-width: 0; display: flex; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--t2); }
.ch-dd span { flex: 1; min-width: 0; font-size: 12px; font-weight: 500; line-height: 18px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-dd svg { margin-left: 4px; }
.ch-badge { margin-left: 4px; padding: 2px 5px; border-radius: 10px; background: var(--primary); color: #000; font-size: 10px; font-weight: 700; line-height: 1.172; }
.ch-badge[hidden] { display: none; }
.ch-area { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #0a0a0a; }
.ch-plot { position: absolute; inset: 0; }
.ch-svg { position: absolute; left: 0; top: 0; overflow: hidden; }
.ch-svg line { shape-rendering: crispEdges; }
.ch-cdl line { shape-rendering: auto; }
.ch-ln line.gone { animation: chGone 400ms forwards; }
.ch-ax span, .ch-tag { position: absolute; left: 328px; width: 65px; padding-left: 9px; font-size: 12px; line-height: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ch-ax span { color: #d1d4dc; transform: translateY(-50%); }
.ch-tag { height: 18px; margin-top: -9px; border-radius: 2px 0 0 2px; }
.ch-tx { position: absolute; left: 0; width: 328px; height: 25px; overflow: hidden; }
.ch-tx span { position: absolute; top: 5px; transform: translateX(-50%); font-size: 12px; color: #d1d4dc; white-space: nowrap; }
/* Left labels (pos-label / pos-pl / pos-dollar / pos-close-btn / tsl / pct tags: 11 px w600, 3 px corners, 1 px borders) */
.ch-lb { position: absolute; left: 0; top: 0; }
.ch-lab { position: absolute; left: 0; display: flex; align-items: center; transform: translateY(-50%); }
.ch-lab > span { padding: 2px 6px; border: 1px solid currentColor; border-radius: 3px; background: #0A0E14; font-size: 11px; font-weight: 600; line-height: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ch-lab > .x { padding: 2px 5px; }
.ch-lab > .pl.neg, .ch-area .neg { color: #FF5252; }
.ch-lab > .pl.zero { color: #9CA3AF; }
.ch-lab > .pt { color: #38BDF8; border-color: rgba(56, 189, 248, .5); letter-spacing: .3px; }
.ch-lab > .pt.m { border-color: rgba(56, 189, 248, .45); letter-spacing: 0; }
.ch-lab.drag > span { box-shadow: 0 0 8px rgba(255, 255, 255, .3); }
.ch-lab.hit > .pt { background: #38BDF8; color: #000; }
.ch-lab.gone { animation: chGone 400ms forwards; }
@keyframes chGone { to { opacity: 0; } }
/* Overlays: timeframe chip + symbol P/L (#tf-row), the bid / ask lines box (top right), risk mode's corner buttons */
.ch-tfrow { position: absolute; top: 4px; left: 10px; z-index: 3; display: flex; align-items: center; gap: 6px; }
.ch-tf, .ch-pnl { display: flex; align-items: center; height: 34px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); white-space: nowrap; }
.ch-tf { gap: 6px; padding: 0 12px; font-size: 13px; font-weight: 500; color: #fff; }
.ch-tf b { font-weight: 500; }
.ch-tf em { margin-left: -4px; font-style: normal; font-size: 11px; letter-spacing: .2px; color: var(--t3); font-variant-numeric: tabular-nums; }
.ch-pnl { padding: 0 10px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ch-pnl[hidden] { display: none; }
.ch-pnl i { margin: 0 4px; color: rgba(255, 255, 255, .25); }
.ch-pnl .zero { color: var(--t2); }
.ch-pnl:has(.pos) { border-color: rgba(0, 212, 170, .4); }
.ch-pnl:has(.neg) { border-color: rgba(255, 82, 82, .4); }
.ch-ba { position: absolute; top: 4px; right: 10px; z-index: 3; display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--primary); color: var(--primary); font-size: 12px; font-weight: 700; }
.ch-corner { position: absolute; right: 4px; bottom: 4px; z-index: 3; display: none; flex-direction: column; gap: 4px; }
.ph-chart.risk .ch-corner { display: flex; }
.ch-corner span { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--surface); border: 1px solid var(--primary); color: var(--primary); }
/* Bottom bar: tools, BUY, SELL, alerts (chartCanvasBackground) */
.ch-foot { flex: none; }
.ch-bar { height: 48px; padding: 0 16px 4px; display: flex; align-items: center; gap: 12px; background: #0a0a0a; }
.ph-chart.risk .ch-bar, .ph-chart.nobar .ch-bar, .ph-chart:not(.risk) .rk { display: none; }
.ch-sq { position: relative; width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--surface); border: 1px solid var(--primary); color: var(--primary); }
.ch-tools .i-x, .ph-chart.menu .ch-tools .i-menu { display: none; }
.ph-chart.menu .ch-tools .i-x { display: block; }
.ch-buy, .ch-sell { flex: 1; padding: 12px 0; border-radius: 8px; text-align: center; font-size: 14px; font-weight: 700; }
.ch-buy { background: #00B386; color: #000; }
.ch-sell { background: #D32F2F; color: #fff; }
/* Tools menu (chart_tools_menu.dart): 0.25 scrim over the body, pills from the bottom left, nearest first */
.ch-mscrim { position: absolute; inset: 0; z-index: 6; background: rgba(0, 0, 0, .25); opacity: 0; pointer-events: none; transition: opacity 200ms; }
.ch-menu { position: absolute; left: 16px; bottom: 8px; z-index: 7; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; pointer-events: none; }
.ch-menu > div {
  height: 44px; padding: 0 16px 0 12px; display: flex; align-items: center; gap: 10px;
  border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
  font-size: 14px; font-weight: 500; color: #fff;
  opacity: 0; transform: translateY(8px); transition: opacity 180ms ease-out, transform 180ms ease-out;
}
.ch-menu > div svg { color: var(--primary); }
.ph-chart.menu .ch-mscrim, .ph-chart.menu .ch-menu > div { opacity: 1; transform: none; }
.ph-chart.menu .ch-menu > div:nth-child(2) { transition-delay: 40ms; }
.ph-chart.menu .ch-menu > div:nth-child(1) { transition-delay: 80ms; }
/* Risk calculator panel (risk_panel.dart portrait, risk_panel_controls.dart) */
.rk { background: var(--surface); border-top: 1px solid var(--border); padding: 8px 12px; }
.rk-top { display: flex; align-items: center; height: 36px; }
.rk-seg { height: 32px; padding: 2px; display: flex; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); }
.rk-seg.side { flex: 2; }
.rk-seg.kind { flex: 3; margin-left: 8px; }
.rk-seg span { flex: 1; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--t2); }
.rk-seg .buy.on { background: var(--primary); color: #000; }
.rk-seg .sell.on { background: var(--err); color: #fff; }
.rk-seg.kind .on { background: var(--grad); color: #000; }
.rk-x { width: 36px; height: 36px; margin-left: 4px; flex: none; display: flex; align-items: center; justify-content: flex-end; color: var(--t2); }
.rk-cards { display: flex; gap: 8px; margin-top: 8px; }
.rk-card { position: relative; flex: 1; min-width: 0; padding: 31px 6px 4px 10px; border-radius: 10px; }
.rk-card.r { background: rgba(244, 67, 54, .08); border: 1px solid rgba(244, 67, 54, .35); }
.rk-card.w { background: rgba(0, 212, 170, .08); border: 1px solid rgba(0, 212, 170, .35); }
.rk-head { position: absolute; left: 10px; right: 6px; top: 0; height: 40px; display: flex; align-items: center; }
.rk-card.w .rk-head { right: 0; }
.rk-head em { flex: 1; font-style: normal; font-size: 11px; font-weight: 600; color: var(--t3); }
.rk-chip { height: 26px; margin-left: 4px; padding: 0 4px 0 8px; display: flex; align-items: center; border-radius: 7px; background: var(--surface); border: 1px solid var(--border); color: var(--t3); }
.rk-chip b { font-size: 12px; font-weight: 600; color: #fff; }
.rk-cb { width: 32px; display: flex; justify-content: flex-end; padding-right: 6px; }
.rk-cb i { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border-radius: 5px; background: var(--grad); color: #000; }
.rk-fig { display: block; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rk-card.r .rk-fig { color: var(--loss); }
.rk-card.w .rk-fig { color: var(--primary); }
.rk-where { padding: 1px 0; font-size: 10px; line-height: 13px; color: var(--t3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rk-where em { font-style: normal; font-weight: 600; }
.rk-where b { font-size: 11px; font-weight: 600; color: #fff; }
.rk-rr { display: flex; gap: 2px; height: 4px; margin-top: 9px; border-radius: 2px; overflow: hidden; }
.rk-rr .r { flex: 100 1 0; background: var(--loss); }
.rk-rr .g { flex: 200 1 0; background: var(--primary); transition: flex-grow 120ms; }
.rk-bot { display: flex; gap: 8px; margin-top: 9px; }
.rk-lots { flex: 1; min-width: 0; height: 40px; padding: 0 10px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: rgba(244, 67, 54, .08); border: 1px solid rgba(244, 67, 54, .35); font-size: 14px; font-weight: 700; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ph-gbtn { flex: 1; min-width: 0; height: 40px; padding: 0 16px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--grad); color: #000; font-size: 14px; font-weight: 700; white-space: nowrap; }
/* Review: the accounts sheet (risk_accounts_sheet.dart, sizing_banner.dart) */
.ch-review { padding: 16px 16px 33px; }
.rv-top { display: flex; align-items: flex-start; }
.rv-h { flex: 1; min-width: 0; font-size: 13px; color: #fff; font-variant-numeric: tabular-nums; }
.rv-h b { display: block; font-weight: 600; }
.rv-h span { display: block; margin-top: 2px; font-weight: 500; }
.rv-pill { flex: none; margin-left: 8px; padding: 6px 12px; border-radius: 18px; border: 1px solid var(--border); font-size: 12px; font-weight: 700; line-height: 1.172; color: var(--t3); white-space: nowrap; }
.rv-pill.on { border-color: transparent; background: var(--grad); color: #000; }
.rv-cap { margin-top: 6px; font-size: 12px; color: var(--t3); }
.rv-rows { margin-top: 12px; }
.rv-row { display: flex; align-items: flex-start; margin-bottom: 6px; padding: 8px 12px; border-radius: 8px; background: rgba(0, 212, 170, .15); border: 1px solid var(--primary); color: var(--primary); }
.rv-main { flex: 1; min-width: 0; margin-left: 8px; }
.rv-l1 { display: flex; align-items: center; }
.rv-l1 b { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: #fff; }
.rv-l1 .ph-main { margin-left: 6px; }
.rv-lots { margin-left: 8px; font-size: 12px; color: #fff; font-variant-numeric: tabular-nums; }
.rv-lots.ratio { color: #00A1FF; font-weight: 600; } /* AccountSizing.ratio ≠ 1: gradientBlueText */
.rv-l2 { display: flex; justify-content: space-between; margin-top: 2px; font-size: 12px; color: var(--t2); font-variant-numeric: tabular-nums; }
.rv-l2 > span:first-child { color: var(--t3); }
.rv-fig i { color: var(--t3); }
.rv-fig em { font-style: normal; }
.rv-btns { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.rv-cancel { flex: 1; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: var(--t2); }
.rv-btns .ph-gbtn { flex: 2; }
/* A drag's confirm (GradientDialog: surface, 12 radius, 0.5 brand ring, 40 dp side inset) */
.ph-dlg {
  position: absolute; left: 40px; right: 40px; top: 50%; z-index: 22;
  border: .5px solid transparent; border-radius: 12px;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box;
  opacity: 0; pointer-events: none; transform: translateY(-50%) scale(.94); transition: opacity 150ms, transform 150ms;
}
.ph-dlg.open { opacity: 1; transform: translateY(-50%); }
.md-t { padding: 20px 24px 0; font-size: 14px; color: #fff; }
.md-c { padding: 20px 24px 24px; }
.md-c > b { display: block; font-size: 15px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.md-c small { display: block; margin: 16px 0 8px; font-size: 12px; color: var(--t2); }
.md-row { display: flex; align-items: center; margin-bottom: 6px; padding: 8px 12px; border-radius: 8px; background: rgba(0, 212, 170, .15); border: 1px solid var(--primary); color: var(--primary); }
.md-row span { flex: 1; margin-left: 8px; font-size: 13px; color: #fff; }
.md-row em { font-style: normal; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.md-a { display: flex; justify-content: flex-end; padding: 0 8px 8px; }
.md-a span { height: 40px; padding: 0 12px; display: flex; align-items: center; font-size: 14px; font-weight: 500; color: var(--t2); }
.md-a .ok { color: var(--primary); }
/* The phone's notification banner (E's), sliding down from the top */
.ph-pushn {
  position: absolute; left: 8px; right: 8px; top: 8px; z-index: 25;
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  border-radius: 22px; background: rgba(35, 43, 54, .97); box-shadow: 0 12px 28px rgba(0, 0, 0, .55);
  transform: translateY(-140%); transition: transform 450ms cubic-bezier(.3, .7, .2, 1);
}
.ph-pushn.show { transform: none; }
.ph-pushn .ic { flex: none; width: 38px; height: 38px; border-radius: 9px; background: #0B0F15 url(app-ring.png) center / 80% no-repeat; } /* the logo ring (app/assets/logoRing.png), large in its square */
.ph-pushn b { display: block; font-size: 15px; font-weight: 600; color: #fff; }
.ph-pushn span { display: block; margin-top: 2px; font-size: 14px; line-height: 1.3; color: #C0C7D0; }

/* ── Analytics (screens/analytics.dart + analytics/*) ── */
.ph-an { position: absolute; inset: 0; display: flex; flex-direction: column; }
.ph-screen .t2 { color: var(--t2); }
.ph-screen .t3 { color: var(--t3); }
.an-bar { height: 56px; padding: 0 8px 0 16px; display: flex; align-items: center; }
.an-bar > b { font-size: 18px; font-weight: 600; color: #fff; }
.an-pills { margin-left: auto; display: flex; gap: 8px; }
.an-pill {
  display: flex; align-items: center; gap: 4px; padding: 6px 12px;
  border-radius: 8px; background: var(--bg); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: #fff;
}
.an-pill svg { color: var(--t2); }
.ph-an[data-tab="journal"] .an-range { display: none; }
.an-tabs {
  position: relative; flex: none; margin: 12px 16px 0; height: 36px; padding: 3px;
  display: flex; border-radius: 10px; background: var(--surface); border: 1px solid var(--border);
}
.an-tabs > span { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--t2); transition: color 200ms; }
.an-ind { position: absolute; left: 3px; top: 3px; bottom: 3px; width: calc((100% - 6px) / 3); border-radius: 8px; background: var(--grad); transition: transform 300ms cubic-bezier(.4, 0, .2, 1); }
.ph-an[data-tab="history"] .an-ind { transform: translateX(100%); }
.ph-an[data-tab="journal"] .an-ind { transform: translateX(200%); }
.ph-an[data-tab="overview"] .an-tabs > [data-tab="overview"],
.ph-an[data-tab="history"] .an-tabs > [data-tab="history"],
.ph-an[data-tab="journal"] .an-tabs > [data-tab="journal"] { color: #000; font-weight: 600; }
.an-pages { position: relative; flex: 1; min-height: 0; }
.an-pg.ph-scroll { position: absolute; inset: 0; margin: 0; padding: 12px 0 24px; display: none; }
.ph-an[data-tab="overview"] [data-pg="overview"], .ph-an[data-tab="history"] [data-pg="history"], .ph-an[data-tab="journal"] [data-pg="journal"] { display: block; }

/* Overview: balance / equity (240 dp) over the drawdown chart (120 dp), one card in two parts */
.an-charts { padding: 0 8px; }
.an-eq, .an-dd { position: relative; background: var(--surface); border: 1px solid var(--border); }
.an-eq { height: 240px; padding: 28px 5px 0; border-bottom: 0; border-radius: 12px 12px 0 0; }
.an-dd { height: 120px; padding: 20px 5px 5px; border-top: 0; border-radius: 0 0 12px 12px; }
.an-plot { position: absolute; left: 53px; top: 28px; overflow: visible; }
.an-plot.dd { top: 40px; }
.an-grid line { stroke: rgba(48, 54, 61, .5); stroke-width: .5; }
.an-dd .an-grid line { stroke: rgba(48, 54, 61, .3); }
.an-line { fill: none; stroke-dasharray: 1; stroke-dashoffset: 0; stroke-linejoin: round; transition: stroke-dashoffset 1600ms cubic-bezier(.4, 0, .2, 1); }
.an-fill { transition: opacity 700ms 900ms; }
.ph-an.an-undrawn .an-line { stroke-dashoffset: 1; transition: none; }
.ph-an.an-undrawn .an-fill { opacity: 0; transition: none; }
.an-ylab { position: absolute; left: 5px; top: 28px; width: 44px; }
.an-ylab.dd { top: 40px; }
.an-ylab span { position: absolute; right: 0; font-size: 9px; line-height: 12px; color: var(--t2); }
.an-ylab.dd span { font-size: 8px; line-height: 10px; }
.an-xlab { position: absolute; left: 5px; right: 5px; top: 218px; }
.an-xlab span { position: absolute; transform: translateX(-50%); font-size: 9px; color: var(--t2); white-space: nowrap; }
.an-legend {
  position: absolute; left: 14px; top: 6px; padding: 3px 5px; border-radius: 4px; background: var(--surface);
  display: flex; align-items: center; font-size: 10px; font-weight: 500; color: var(--t2); white-space: nowrap;
}
.an-legend b { margin-left: 2px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.an-legend em { width: 14px; }
.an-legend svg { margin-left: 8px; color: var(--t2); }
.an-legend .g { color: #00FF8F; }
.an-legend .bl { color: #00A1FF; }
.an-legend .o { color: #FF9800; }
.an-legend .r { color: #EF4444; }
.an-dd .an-legend { top: 2px; }
.an-mode {
  position: absolute; right: 8px; top: 4px; display: flex; align-items: center; padding: 2px 4px 2px 10px;
  border-radius: 6px; background: var(--bg); border: 1px solid var(--border); font-size: 11px; font-weight: 600; color: var(--t3);
}
.an-stats { padding: 12px 16px 0; }
.an-hero { display: flex; gap: 10px; }
.an-hero > div { flex: 1; min-width: 0; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.an-hero small { display: block; font-size: 10px; font-weight: 500; color: var(--t2); }
.an-hero b { display: block; margin-top: 4px; font-size: 15px; font-weight: 700; white-space: nowrap; }
.an-two { display: flex; gap: 10px; margin-top: 10px; }
.an-sec { flex: 1; min-width: 0; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.an-sec label { display: block; padding: 10px 12px 6px; font-size: 9px; font-weight: 600; letter-spacing: .8px; color: var(--t3); }
.an-sec p { margin: 0; padding: 9px 12px; display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 500; color: var(--t2); }
.an-sec p + p { border-top: .5px solid var(--border); }
.an-sec p b { display: flex; align-items: baseline; font-size: 12px; font-weight: 700; white-space: nowrap; }
.an-sec p b em { margin-right: 6px; font-style: normal; font-size: 10px; color: var(--t3); }
.an-sec u, .jn-st u { text-decoration: none; }

/* History (history.dart) */
.hs-sum { margin: 0 16px 6px; padding: 12px 14px; display: flex; align-items: center; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.hs-dd { width: 130px; height: 34px; padding: 0 2px 0 10px; display: flex; align-items: center; justify-content: space-between; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); font-size: 12px; color: #fff; }
.hs-dd svg { color: var(--t2); }
.hs-n { margin-left: 5px; font-size: 13px; font-weight: 500; color: var(--t3); }
.hs-sum > b { margin-left: auto; font-size: 15px; font-weight: 700; }
.hs-one { margin: 4px 16px; border-radius: 10px; border: 1px solid var(--border); overflow: hidden; }
.hs-grp { margin: 12px 16px; border-radius: 10px; border: 1px solid var(--border); overflow: hidden; }
.hs-gh { padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; background: var(--bg); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 500; color: var(--t2); }
.hs-gh b { font-size: 13px; font-weight: 700; }
.hs-t { padding: 12px; background: var(--surface); }
.hs-grp .hs-t + .hs-t { border-top: 1px solid var(--border); }
.hs-r1 { display: flex; align-items: center; }
.hs-r1 > b { font-size: 14px; font-weight: 700; color: #fff; }
.hs-tag { margin-left: 8px; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.hs-tag.buy { color: var(--primary); background: rgba(0, 212, 170, .15); }
.hs-tag.sell { color: var(--err); background: rgba(244, 67, 54, .15); }
.hs-r1 strong { margin-left: auto; font-size: 14px; font-weight: 700; }
.hs-r2, .hs-r3 { display: flex; justify-content: space-between; }
.hs-r2 { margin-top: 6px; font-size: 12px; color: var(--t3); }
.hs-r3 { margin-top: 4px; font-size: 11px; color: var(--muted); }

/* Journal: the month calendar (_buildCalendar, _CalendarCell) and Month Stats */
.jn-cal, .jn-st { margin: 0 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.jn-cal { padding: 14px 14px 16px; }
.jn-h { display: flex; align-items: center; }
.jn-nav { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); color: var(--t2); }
.jn-nav.off { color: var(--muted); }
.jn-h > b { padding: 0 8px; font-size: 13px; font-weight: 500; color: #fff; }
.jn-h strong { margin-left: auto; font-size: 13px; font-weight: 700; }
.jn-w { display: flex; margin-top: 14px; }
.jn-w span { flex: 1; text-align: center; font-size: 10px; font-weight: 500; color: var(--muted); }
.jn-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 6px; }
.jd { position: relative; aspect-ratio: .9; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); transition: background-color 250ms; }
.jd.today { border: 1.4px solid var(--primary); }
.jd em { position: absolute; left: 5px; top: 4px; font-style: normal; font-size: 10px; font-weight: 500; color: var(--t2); }
.jd.future em { color: var(--muted); }
.jd b { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-size: 10px; font-weight: 700; transition: opacity 250ms; }
.jd.has.pos { background: rgba(0, 212, 170, .12); }
.jd.has.neg { background: rgba(244, 67, 54, .12); }
.jn-fill .jd.has:not(.lit) { background: var(--bg); }
.jn-fill .jd.has:not(.lit) b { opacity: 0; }
.jn-st { margin-top: 14px; padding: 12px 14px 14px; }
.jn-st > b { font-size: 12px; font-weight: 600; color: var(--t3); }
.jn-s3 { display: grid; grid-template-columns: repeat(3, 1fr); row-gap: 12px; margin-top: 10px; }
.jn-s3 p { margin: 0; }
.jn-s3 label { display: block; font-size: 10.5px; color: var(--muted); }
.jn-s3 b { display: block; margin-top: 3px; font-size: 14px; font-weight: 700; color: #fff; }
.jn-s3 small { display: block; margin-top: 1px; font-size: 10px; color: var(--muted); }
.jn-top { display: flex; align-items: center; gap: 5px; margin-top: 12px; font-size: 11.5px; color: var(--t3); }
.jn-top svg { color: var(--muted); }

/* The Journal day page (journal.dart) */
.ph-jday .ph-title { margin-left: 16px; }
.jy-ctx { margin-bottom: 14px; padding: 9px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--primary); }
.jy-ctx p { margin: 0; padding: 2.5px 0; display: flex; align-items: flex-start; gap: 7px; font-size: 12px; line-height: 1.35; color: #fff; }
.jy-ctx svg { margin-top: 1px; color: var(--primary); }
.jy-h { display: flex; align-items: center; gap: 6px; color: var(--t3); }
.jy-h b { font-size: 13px; font-weight: 600; color: #fff; }
.jy-box { margin-top: 8px; min-height: 97px; padding: 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; line-height: 1.4; color: var(--muted); }
.jy-box.has { color: #fff; }
.jy-save { margin-top: 12px; height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--grad); font-size: 15px; font-weight: 700; color: #000; }
.jy-tags { margin-top: 22px; }
.jy-add { margin-left: auto; padding: 4px 8px; display: flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--primary); }
.jy-hint { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.jy-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.jy-chips span { padding: 3px 9px; border-radius: 6px; border: 1px solid; font-size: 11.5px; font-weight: 600; }
.jy-tot { margin-top: 26px; display: flex; align-items: center; }
.jy-tot b { flex: 1; font-size: 13px; font-weight: 600; color: #fff; }
.jy-tot strong { font-size: 15px; font-weight: 700; }
.jy-list { margin-top: 10px; padding: 4px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.jy-t { padding: 8px 0; }
.jy-t + .jy-t { border-top: 1px solid var(--border); }
.jy-t > div { display: flex; align-items: center; }
.jy-t > div > b { font-size: 14px; font-weight: 700; color: #fff; }
.jy-t strong { margin-left: auto; margin-right: 12px; font-size: 13px; font-weight: 600; }
.jy-t svg { color: var(--muted); }
.jy-t svg + svg { margin-left: 12px; }
.jy-t small { display: block; margin-top: 1px; font-size: 11px; color: var(--muted); }

/* ── The Copilot sheet (home_copilot.dart + copilot_sheet.dart) over Home's 0.54 scrim ── */
.cp-status { position: absolute; left: 0; right: 0; top: 0; z-index: 22; }
.cp-sheet { position: absolute; left: 0; right: 0; top: 36px; bottom: 0; z-index: 21; display: flex; flex-direction: column; border-radius: 20px 20px 0 0; background: var(--surface); }
.cp-handle { flex: none; width: 36px; height: 4px; margin: 10px auto 6px; border-radius: 2px; background: var(--border); }
.cp-hdr { flex: none; padding: 4px 16px 8px 20px; display: flex; align-items: center; }
.cp-hdr > b { margin-left: 10px; font-size: 18px; font-weight: 600; color: #fff; }
.cp-hdr > span:not(.ph-hbtn) { margin: 5px auto 0 8px; font-size: 11px; color: var(--t2); }
.cp-hdr .ph-hbtn + .ph-hbtn { margin-left: 10px; }
.cp-chat { flex: 1; min-height: 0; padding: 4px 16px 12px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.cp-chat > * { flex: none; }
.cp-me { display: flex; justify-content: flex-end; margin: 4px 0; }
.cp-me span { max-width: 306px; padding: 10px 14px; border-radius: 14px; background: rgba(0, 212, 170, .15); border: 1px solid rgba(0, 212, 170, .4); font-size: 14px; line-height: 1.3; color: #fff; }
.cp-work { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 14px; color: var(--t3); }
.cp-spin { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--primary); border-right-color: transparent; animation: cpSpin 800ms linear infinite; }
@keyframes cpSpin { to { transform: rotate(360deg); } }
.cp-card { --acc: rgba(0, 212, 170, .5); --accF: var(--primary); margin: 6px 0; padding: 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--acc); }
.cp-card.orange { --acc: rgba(255, 159, 28, .5); --accF: #FF9F1C; }
.cp-card.dll { --acc: rgba(0, 161, 255, .5); --accF: #00A1FF; } /* guardKindColor('daily_loss_limit') */
.cp-head { display: flex; align-items: flex-start; }
.cp-head b { flex: 1; font-size: 16px; font-weight: 700; color: #fff; }
.cp-ratios { margin-left: 8px; padding: 5px 11px; border-radius: 18px; border: 1px solid #484F58; font-size: 12px; font-weight: 600; color: var(--t3); } /* outlined, as cp_order.png */
.cp-strip { margin-top: 12px; padding: 12px 14px; display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 4px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; font-variant-numeric: tabular-nums; }
.cp-strip b { font-weight: 700; color: #fff; }
.cp-strip i { font-weight: 500; color: var(--t3); }
.cp-strip b.pos { color: var(--primary); }
.cp-strip b.orange { color: #FF9F1C; }
.cp-rl { flex-wrap: nowrap; align-items: flex-start; column-gap: 0; }
.cp-rl + .cp-rl { margin-top: 10px; }
.cp-rl b { flex: none; width: 46px; font-size: 13px; }
.cp-rl b.dll { color: #00A1FF; }
.cp-rl span { flex: 1; font-weight: 700; color: #fff; }
.cp-boxes { display: flex; gap: 8px; margin-top: 10px; }
.cp-box { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); }
.cp-box b { display: block; font-size: 13px; font-weight: 700; }
.cp-box b.white { color: #fff; }
.cp-box strong { display: block; margin-top: 3px; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cp-box strong.sm { font-size: 12px; font-weight: 400; color: #fff; }
.cp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cp-chip { min-height: 36px; padding: 6px 10px; display: flex; align-items: center; border-radius: 10px; background: rgba(0, 212, 170, .12); border: 1px solid rgba(0, 212, 170, .6); font-size: 13px; }
.cp-chip b { font-weight: 600; color: #fff; }
.cp-chip .ph-main { margin-left: 5px; }
.cp-chip em { margin-left: 6px; font-style: normal; color: var(--t3); font-variant-numeric: tabular-nums; }
.cp-info { margin-top: 15px; }
.cp-info p { margin: 0; display: flex; align-items: flex-start; gap: 6px; font-size: 12px; line-height: 1.3; color: var(--t3); }
.cp-info svg { margin-top: 1px; }
.cp-info i { opacity: .9; }
.cp-info.warn p { color: var(--warn); }
.cp-gap12 { height: 12px; }
.cp-gap6 { height: 6px; }
.cp-total { margin-top: 10px; padding: 10px 12px; display: flex; align-items: center; border-radius: 12px; border: 1px solid var(--border); }
.cp-total span { flex: 1; font-size: 12px; color: var(--t3); }
.cp-total strong { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cp-total + .cp-det { margin-top: 6px; }
.cp-det { min-height: 44px; display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--primary); }
.cp-btns { display: flex; gap: 10px; }
.cp-btns span { height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 20px; font-size: 14px; font-weight: 500; }
.cp-cancel { flex: 1; border: 1px solid var(--border); color: var(--t3); }
.cp-confirm { flex: 2; background: var(--accF); color: #000; }
.cp-fold { padding: 10px 8px 10px 14px; }
.cp-fold > div { display: flex; align-items: center; }
.cp-fold b { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-fold b .pos { color: var(--primary); }
.cp-fold.one { display: flex; align-items: center; }
.cp-fold.one > b { font-weight: 600; margin-right: 8px; }
.cp-exp { color: var(--t3); }
.cp-out { margin-top: 2px; display: flex; align-items: center; gap: 4px; font-size: 12px; }
.cp-out.pos { font-weight: 600; }
.cp-out .cp-spin { width: 12px; height: 12px; margin-right: 2px; }
.cp-fold.one .cp-out { margin-top: 0; }
.cp-inrow { flex: none; padding: 8px 12px 37px 16px; }
.cp-in { display: flex; align-items: flex-end; padding: 4px; border-radius: 29.5px; background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--grad) border-box; border: 1.5px solid transparent; }
.cp-in > div { flex: 1; min-width: 0; padding: 14px 4px 14px 14px; font-size: 14px; line-height: 20px; }
.cp-hint { color: var(--t2); }
.cp-typed { color: #fff; }
.cp-in.typed .cp-hint, .cp-in:not(.typed) .cp-typed { display: none; }
.cp-act { flex: none; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--grad); color: #000; }
.cp-in.typed .mic, .cp-in:not(.typed) .send { display: none; }
@media (prefers-reduced-motion: reduce) {
  .an-line, .an-fill, .an-ind, .jd, .jd b { transition: none; }
  .cp-spin { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ph-view, .ph-sheet, .ph-scrim, .ph-place, .ph-rb, .ph-finger { transition: none; }
  .ph-spin { animation: none; }
  .ph-ocard, .ph-tap { animation: none; }
  .ch-lab.gone, .ch-ln line.gone { animation: none; opacity: 0; }
  .ch-mscrim, .ch-menu > div, .ph-dlg, .ph-pushn, .rk-rr .g { transition: none; }
  .ph-scroll { scroll-behavior: auto; }
}
