/* BasisTrail app UI, recoded for the web from the SwiftUI source. 1 app point = 1 CSS px on a
   402 x 874 iPhone 17 Pro screen. Values mirror BTColor, BTSpacing, BTFont, BTPaper and
   BTPaperComponents; animations mirror their SwiftUI curves. */
:root {
  --print: #0F2742; --cotton: #FFFEFA; --desk: #ECE9E1; --groove: #F2F1EC; --muted: #4F5868; --hi: #FFFFFF;
  --gain: #1B7A47; --gain-fill: rgb(27 122 71 / 0.08); --gold: #B5872A; --gold-text: #8C6519; --paid: #A87A22;
  --board: #0F2742; --board-type: #F4F1E8; --shade: rgb(15 39 66 / 0.16); --sep: #E5E2D8; --sep-strong: #8F8A7A;
  --s0: #0F2742; --s1: #B5872A; --s2: #4E9A9A; --s3: #7A8699; --s4: #8C6519;
  --gs: "General Sans", -apple-system, system-ui, sans-serif; --sf: -apple-system, "SF Pro Text", system-ui; --gm: "Geist Mono", ui-monospace, monospace;
  --spring: cubic-bezier(0.22, 1, 0.36, 1); --curve: cubic-bezier(0.65, 0, 0.35, 1);
  --cotton-glow: rgb(255 254 250 / 0.85); --cotton-clear: rgb(255 254 250 / 0); --island: #050608;
  --mask: #000; --edge-hi: rgb(255 255 255 / 0.9); --ink-14: rgb(15 39 66 / 0.14); --ink-10: rgb(15 39 66 / 0.1); --ink-8: rgb(15 39 66 / 0.08); --glass: rgb(252 252 250 / 0.86); --desk-clear: rgb(236 233 225 / 0); --ink-22: rgb(15 39 66 / 0.22); --ink-18: rgb(15 39 66 / 0.18); --ink-12: rgb(15 39 66 / 0.12); --ink-6: rgb(15 39 66 / 0.06); --sep-soft: rgb(143 138 122 / 0.6); --scrim: rgb(0 0 0 / 0.18); --scrim-soft: rgb(0 0 0 / 0.08); --white: #fff; --screen-off: #111;
}
.bt {
  font-family: var(--gs); color: var(--print); -webkit-font-smoothing: antialiased; text-rendering: geometricPrecision; user-select: none;
}
.app { position: relative; width: 402px; height: 874px; overflow: hidden;
  background: radial-gradient(520px 520px at 0% 30%, var(--cotton-glow), var(--cotton-clear) 100%), var(--desk); }
.app-card { width: 362px; }
.bt *, .bt *::before, .bt *::after { box-sizing: border-box; margin: 0; }

/* status bar and island */
.app .status { position: absolute; inset: 0 0 auto; height: 62px; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 0 36px 0 52px; font-family: var(--sf); font-weight: 600; font-size: 17px; letter-spacing: -0.2px; }
.app .status .icons { display: flex; align-items: center; gap: 7px; }
.app::before { content: ""; position: absolute; inset: 0 0 auto; height: 70px; z-index: 19; pointer-events: none; background: linear-gradient(180deg, var(--desk) 55%, var(--desk-clear)); }
.app .island { position: absolute; left: 50%; top: 11px; width: 125px; height: 37px; margin-left: -62.5px; border-radius: 20px; background: var(--island); z-index: 21; }

/* the scrolling page */
.app .page { position: absolute; inset: 0; padding: 74px 20px 120px; display: flex; flex-direction: column; gap: 20px; will-change: transform; transition: transform 1.8s cubic-bezier(0.4, 0, 0.2, 1); }
.app .page > * { flex-shrink: 0; }
.bt .header { display: flex; align-items: center; gap: var(--space-sm, 12px); min-height: 44px; }
.bt .header .mark { width: 30px; height: 31px; }
.bt .header .word { font-weight: 600; font-size: 19px; letter-spacing: -0.4px; }
.bt .header .grow { flex: 1; }
.bt .sync { display: inline-flex; align-items: center; gap: var(--space-2xs, 4px); font-size: 12px; color: var(--muted); }
.bt .sync svg { width: 24px; height: 11px; overflow: visible; }
.bt .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--board); color: var(--board-type); display: grid; place-items: center; font-weight: 600; font-size: 15px; }

.bt .hero { display: flex; flex-direction: column; gap: var(--space-sm, 12px); }
.bt .label { font-size: 15px; color: var(--muted); }
.bt .amount { display: flex; align-items: flex-start; gap: 1px; font-weight: 600; line-height: 1.2; }
.bt .amount .whole { font-size: 50px; letter-spacing: -2.25px; font-variant-numeric: tabular-nums; }
.bt .amount .cents { font-size: 23px; font-weight: 500; letter-spacing: -0.4px; margin-top: var(--space-2xs, 4px); }
.bt .pill { align-self: flex-start; font-weight: 500; font-size: 14px; padding: 3px var(--space-sm, 12px); border-radius: 6px; color: var(--gain); background: var(--gain-fill); }

.bt .groove { display: flex; padding: var(--space-2xs, 4px); border-radius: 12px; background: var(--groove); box-shadow: inset 0 0 0 0.75px var(--ink-10); position: relative; }
.bt .groove span { flex: 1; min-height: 44px; display: grid; place-items: center; font-weight: 500; font-size: 15px; color: var(--muted); position: relative; z-index: 1; }
.bt .groove span.on { color: var(--print); }
.bt .groove .rider { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n, 5)); border-radius: 8px; background: var(--cotton); box-shadow: 2px 2px 6px var(--shade); transform: translateX(calc(var(--on, 1) * 100%)); transition: transform 0.42s cubic-bezier(0.3, 1.25, 0.5, 1); }

.bt .chart { position: relative; height: 132px; margin: var(--space-sm, 12px) 0; }
.bt .chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.bt .chart .area { fill: url(#appArea); opacity: 0; transition: opacity 1.2s var(--curve) 0.15s; }
.bt .chart .inv { fill: none; stroke: var(--sep-soft); stroke-width: 1; stroke-dasharray: 3 4; }
.bt .chart .line { fill: none; stroke: var(--print); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: var(--len, 500); stroke-dashoffset: var(--len, 500); transition: stroke-dashoffset 1.2s var(--curve) 0.15s; }
.bt .chart .dot { fill: var(--gold); opacity: 0; transition: opacity 0.2s 1.35s; }

/* the paper card: cotton, a lit top-left edge, a cast falling right */
.bt .card { position: relative; padding: 20px; border-radius: 8px; background: var(--cotton); display: flex; flex-direction: column; gap: var(--space-md, 16px);
  box-shadow: 5px 4px 10px var(--shade); }
.bt .card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 0.75px;
  background: linear-gradient(135deg, var(--edge-hi), var(--ink-8)); -webkit-mask: linear-gradient(var(--mask) 0 0) content-box, linear-gradient(var(--mask) 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.bt .card-head { display: flex; align-items: baseline; justify-content: space-between; }
.bt .card-title { font-weight: 600; font-size: 17px; letter-spacing: -0.2px; }
.bt .link { font-weight: 500; font-size: 15px; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; text-decoration-thickness: 1.5px; min-height: 32px; display: inline-flex; align-items: center; }

.bt .bar { display: flex; gap: var(--space-3xs, 2px); border-radius: 4px; overflow: hidden; height: var(--bh, 14px); }
.bt .bar i { display: block; height: 100%; border-radius: 2px; transform-origin: left; transform: scaleX(0.001); transition: transform 0.6s cubic-bezier(0.25, 1.15, 0.5, 1); }
.bt .keys { display: flex; align-items: flex-start; }
.bt .keys > div { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.bt .keys b { font-family: var(--gm); font-weight: 400; font-size: 12px; }
.bt .keys span { font-size: 11px; color: var(--muted); }
.bt .stamp { align-self: flex-end; font-weight: 600; font-size: 14px; color: var(--paid); padding: var(--space-3xs, 2px) 6px; line-height: 1.15; border: 2px solid currentColor; border-radius: 6px; transform: rotate(-6deg); filter: url(#appInk); transition: transform 0.3s cubic-bezier(0.7, 0, 0.84, 0) 1.2s, opacity 0.3s cubic-bezier(0.7, 0, 0.84, 0) 1.2s; }

.bt .gold-label { display: flex; align-items: center; gap: 6px; color: var(--gold-text); font-weight: 500; font-size: 13px; }
.bt .gold-label svg { width: 12px; height: 12px; fill: currentColor; }
.bt .headline { font-weight: 500; font-size: 19px; letter-spacing: -0.2px; line-height: 1.25; }
.bt .sub { font-size: 14px; color: var(--muted); line-height: 1.35; }
.bt .chips { display: flex; gap: var(--space-sm, 12px); }
.bt .chip { min-height: 34px; padding: 0 var(--space-md, 16px); border-radius: 999px; background: var(--cotton); box-shadow: inset 0 0 0 0.75px var(--ink-10); display: inline-flex; align-items: center; font-weight: 500; font-size: 14px; white-space: nowrap; }

.bt .legend { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; row-gap: var(--space-xs, 8px); }
.bt .legend div { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.bt .legend i { width: 10px; height: 10px; border-radius: 2px; }
.bt .legend b { margin-left: auto; font-family: var(--gm); font-weight: 400; font-size: 12px; color: var(--muted); }

/* iOS 26 tab bar: a floating glass capsule */
.app .tabbar { position: absolute; left: 22px; right: 22px; bottom: 21px; height: 62px; z-index: 15; border-radius: 31px; display: flex; padding: var(--space-2xs, 4px); gap: 0;
  background: var(--glass); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: inset 0 0.5px 0 var(--edge-hi), 0 8px 24px var(--ink-12), inset 0 0 0 0.5px var(--ink-6); }
.app .tab { flex: 1; display: grid; place-items: center; align-content: center; gap: var(--space-3xs, 2px); border-radius: 27px; font-weight: 600; font-size: 10px; color: var(--print); }
.app .tab svg { width: 24px; height: 22px; }
.app .tab.on { background: var(--ink-8); flex: 1.15; }
.app .home { position: absolute; left: 50%; bottom: 8px; width: 140px; height: 5px; margin-left: -70px; border-radius: 3px; background: var(--screen-off); z-index: 16; }

/* entrance: riseIn (opacity + 14pt, spring 0.5/0.9, 70ms steps) */
.js .bt:not(.on) [data-rise] { opacity: 0; transform: translateY(14px); }
.bt [data-rise] { transition: opacity 0.5s var(--spring), transform 0.5s var(--spring); transition-delay: calc(var(--i, 0) * 70ms); }
.bt.on [data-rise] { opacity: 1; transform: none; }
.bt.on .chart .area { opacity: 1; } .bt.on .chart .line { stroke-dashoffset: 0; } .bt.on .chart .dot { opacity: 1; }
.js .bt:not(.on) .stamp { opacity: 0; transform: rotate(-6deg) scale(1.9); }
.bt.on .bar i { transform: none; } .bt.on .stamp { opacity: 1; transform: rotate(-6deg); }

/* rows: PaperRow (16 medium title, 13 detail, mono figures), hairlines between */
.bt .rows { padding: var(--space-2xs, 4px) var(--space-md, 16px); gap: 0; }
.bt .rows.plain { padding: 0; }
.bt .row { display: flex; align-items: center; gap: var(--space-md, 16px); min-height: 60px; border-bottom: 0.5px solid var(--sep); }
.bt .row:last-child { border-bottom: 0; }
.bt .ticker { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--white); font-weight: 600; font-size: 11px; flex: none; }
.bt .ictile { width: 36px; height: 36px; border-radius: 10px; background: var(--groove); display: grid; place-items: center; flex: none; }
.bt .ictile svg { width: 18px; height: 18px; color: var(--print); }
.bt .rt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-3xs, 2px); }
.bt .rt b { font-weight: 500; font-size: 16px; }
.bt .rt span { font-size: 13px; color: var(--muted); }
.bt .fig { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-3xs, 2px); font-family: var(--gm); }
.bt .fig b { font-weight: 400; font-size: 15px; }
.bt .fig span { font-size: 12px; color: var(--muted); }
.bt .fig span.up { color: var(--gain); }
/* waterfall sheet card */
.bt .wf { gap: 0; padding: var(--space-sm, 12px) 20px var(--space-md, 16px); }
.bt .wf-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) 104px; align-items: center; gap: var(--space-sm, 12px); min-height: 52px; font-size: 15px; }
.bt .wf-row b, .bt .wf-total b { font-family: var(--gm); font-weight: 400; text-align: right; }
.bt .wf-track { position: relative; height: 16px; }
.bt .wf-track i { position: absolute; top: 0; bottom: 0; border-radius: 3px; transform-origin: left; transform: scaleX(0.001); transition: transform 0.6s cubic-bezier(0.25, 1.1, 0.5, 1); }
.bt.on .wf-track i { transform: none; }
.bt .wf-total { display: flex; justify-content: space-between; align-items: center; border-top: 1.5px solid var(--print); padding-top: var(--space-sm, 12px); margin-top: var(--space-2xs, 4px); font-weight: 600; font-size: 15px; }

/* screen titles and header buttons */
.bt .screen-title { font-weight: 600; font-size: 30px; letter-spacing: -0.9px; }
.bt .icon-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--cotton); display: grid; place-items: center; box-shadow: 1px 1px 4px var(--shade); }
.bt .icon-btn svg { width: 18px; height: 18px; color: var(--print); }

/* holdings summary: ring and the unrealized figure */
.bt .hsum { display: flex; align-items: center; gap: 20px; }
.bt .ring { position: relative; width: 140px; height: 140px; flex: none; }
.bt .ring svg { width: 100%; height: 100%; }
.bt .ring g circle { transition: stroke-dasharray 0.9s cubic-bezier(0.25, 1, 0.5, 1); }
.bt:not(.on) .ring g circle { stroke-dasharray: 0 999; }
.bt .ring-mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: var(--space-3xs, 2px); }
.bt .ring-mid span { font-size: 13px; color: var(--muted); }
.bt .ring-mid b { font-weight: 600; font-size: 15px; }
.bt .hsum-t { display: flex; flex-direction: column; gap: var(--space-2xs, 4px); }
.bt .hsum-t span { font-size: 14px; color: var(--muted); }
.bt .hsum-t b { font-family: var(--gm); font-weight: 500; font-size: 22px; color: var(--gain); }

/* ledger: search, chips, the review stamp */
.bt .search { display: flex; align-items: center; gap: var(--space-sm, 12px); min-height: 48px; padding: 0 var(--space-md, 16px); border-radius: 12px; background: var(--cotton); box-shadow: inset 0 0 0 0.75px var(--ink-14); color: var(--muted); font-size: 16px; }
.bt .search svg { width: 20px; height: 20px; color: var(--muted); }
.bt .chips { overflow: hidden; }
.bt .mini-stamp { font-weight: 600; font-size: 11px; color: var(--paid); border: 1.5px solid currentColor; border-radius: 5px; padding: 1px var(--space-2xs, 4px); transform: rotate(-5deg); filter: url(#appInk); }

/* analyst: the voice groove, the question, tool rows, the answer and the composer */
.bt .groove--fit { align-self: flex-start; width: 260px; }
.bt .bubble { align-self: flex-end; max-width: 240px; padding: var(--space-sm, 12px) var(--space-md, 16px); border-radius: 16px 16px 4px 16px; background: var(--cotton); box-shadow: 4px 4px 10px var(--shade); font-size: 16px; line-height: 1.3; }
.bt .tools { display: flex; flex-direction: column; gap: var(--space-xs, 8px); }
.bt .tool { display: flex; align-items: center; gap: var(--space-xs, 8px); min-height: 40px; padding: 0 var(--space-sm, 12px); border-radius: 8px; background: var(--cotton); box-shadow: 3px 3px 8px var(--shade); font-size: 13px; white-space: nowrap; overflow: hidden; }
.bt .tool svg { width: 16px; height: 16px; flex: none; }
.bt .tool b { font-weight: 600; }
.bt .tool .tool-d { color: var(--muted); overflow: hidden; text-overflow: ellipsis; flex: 1; }
.bt .tool > svg:last-child { color: var(--muted); }
.bt .answer { gap: 20px; }
.bt .answer p { font-size: 16px; line-height: 1.4; }
.bt .answer b { font-weight: 600; }
.bt .answer table { border-collapse: collapse; font-size: 16px; width: 100%; }
.bt .answer th { text-align: left; font-weight: 600; padding: 10px var(--space-xs, 8px); border-bottom: 1px solid var(--sep); }
.bt .answer td { padding: 10px var(--space-xs, 8px); border-bottom: 1px solid var(--sep); line-height: 1.3; vertical-align: top; }
.bt .answer th:first-child, .bt .answer td:first-child { padding-left: 0; }
.app .composer { position: absolute; left: 20px; right: 20px; bottom: 96px; z-index: 14; display: flex; align-items: center; gap: var(--space-sm, 12px); }
.app .composer .field { flex: 1; min-height: 44px; display: flex; align-items: center; padding: 0 var(--space-md, 16px); border-radius: 12px; background: var(--cotton); box-shadow: inset 0 0 0 0.75px var(--ink-14); color: var(--muted); font-size: 16px; }
.app .composer .send { width: 36px; height: 36px; border-radius: 50%; background: var(--ink-22); display: grid; place-items: center; }
.app .composer .send svg { width: 18px; height: 18px; }

/* the waterfall sheet over a dimmed Today */
.app .dimmed { filter: saturate(0.9); }
.app .dim { position: absolute; inset: 0; z-index: 12; background: var(--scrim); }
.app .sheet { position: absolute; left: 0; right: 0; top: 52px; bottom: 0; z-index: 17; border-radius: 36px 36px 0 0; padding: 30px 20px 0; display: flex; flex-direction: column; gap: 20px;
  background: radial-gradient(520px 520px at 0% 30%, var(--cotton-glow), var(--cotton-clear) 100%), var(--desk); box-shadow: 0 -2px 20px var(--scrim-soft);
  transform: translateY(100%); transition: transform 0.55s cubic-bezier(0.2, 0.9, 0.3, 1); }
.bt.on .sheet { transform: none; }
.app .sheet > * { flex: none; }
.app .grabber { position: absolute; top: 8px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--ink-18); }
.app .sheet-head { display: flex; align-items: center; justify-content: space-between; }
.app .sheet-title { font-weight: 600; font-size: 22px; letter-spacing: -0.5px; }
.app .sheet-x { width: 36px; height: 36px; border-radius: 50%; background: var(--cotton); display: grid; place-items: center; }
.app .sheet-x svg { width: 15px; height: 15px; color: var(--print); }
.bt .stamp--big { align-self: flex-start; font-size: 20px; margin-left: var(--space-xs, 8px); transition-delay: 1.4s; }
.bt.on .stamp--big { transform: rotate(-6deg); opacity: 1; }
.bt .chip--icon { align-self: flex-start; gap: 6px; } .bt .chip--icon svg { width: 12px; height: 12px; fill: var(--print); }
.app .sheet ~ .tabbar { z-index: 11; }

@media (prefers-reduced-motion: reduce) {
  .bt [data-rise], .bt .chart .area, .bt .chart .line, .bt .chart .dot, .bt .bar i, .bt .stamp, .bt .wf-track i, .bt .ring g circle, .app .sheet, .app .page { transition: none !important; }
}
