/* TradingFloor AI component layer (VISUAL_SPEC.md v1, ported from style/src/tf-proposed.css).
   Loaded last on the workspace (and on RNS Chat for the scroller only). Tokens alias the Atelier
   variables so both themes follow html[data-theme]. All new classes are prefixed .tf-. */

/* ---------- 1. Tokens ---------- */
:is(body[data-app],body.rns-promo){
  --tf-bg:var(--atelier-bg,#090a0c);--tf-surface:var(--atelier-surface,#121416);--tf-raised:var(--atelier-surface-raised,#191b1f);
  --tf-sunken:#0d0e10;
  --tf-text:var(--atelier-text,#e8e7e3);--tf-muted:var(--atelier-muted,#a2a5ab);--tf-quiet:var(--atelier-quiet,#878b93);
  --tf-accent:var(--atelier-accent,#c5b08e);--tf-accent-ink:var(--atelier-accent-ink,#211e18);
  --tf-accent-grad:linear-gradient(145deg,#d8c8ac,#b9a17a);--tf-accent-grad-hover:linear-gradient(145deg,#e0d2b9,#c1aa85);--tf-accent-border:#bca783;
  --tf-line:var(--atelier-line,#2d3035);--tf-edge:var(--atelier-edge,#47443f);
  --tf-wash:var(--atelier-wash,rgba(197,176,142,.065));--tf-wash-strong:rgba(197,176,142,.14);
  --tf-highlight:var(--atelier-highlight,rgba(255,255,255,.045));--tf-shadow:var(--atelier-shadow,0 12px 35px rgba(0,0,0,.13));
  --tf-shadow-pop:0 22px 55px rgba(0,0,0,.32);--tf-scrim:rgba(4,5,6,.62);
  --tf-up:#48d88a;--tf-down:#ff737b;
  --tf-breaking-ink:#f0a39b;--tf-breaking-bg:#2a1716;--tf-breaking-line:#5a2b28;
  --tf-listen:#89cda7;--tf-think:#8cadd5;--tf-error:#b99385;
  --tf-skeleton:#1b1d21;--tf-skeleton-shine:rgba(255,255,255,.05);
  --tf-font-ui:'DM Sans',system-ui,sans-serif;--tf-font-display:'Manrope','DM Sans',sans-serif;--tf-font-mono:'IBM Plex Mono',ui-monospace,monospace;
  --tf-r-sm:8px;--tf-r-md:10px;--tf-r-lg:12px;--tf-r-xl:16px;--tf-r-2xl:20px;--tf-r-pill:999px;
  --tf-ease:cubic-bezier(.22,.7,.25,1);--tf-ease-out:cubic-bezier(.2,.8,.2,1);
  --tf-d1:120ms;--tf-d2:200ms;--tf-d3:280ms;--tf-gutter:16px;
}
html[data-theme=light] :is(body[data-app],body.rns-promo){
  --tf-sunken:#f0ece5;--tf-wash-strong:rgba(128,102,66,.12);
  --tf-shadow-pop:0 20px 55px rgba(67,55,36,.14);--tf-scrim:rgba(41,43,48,.38);
  --tf-up:#087b4c;--tf-down:#bd2f49;
  --tf-breaking-ink:#a3352d;--tf-breaking-bg:#fbeceb;--tf-breaking-line:#efc3bf;
  --tf-listen:#387454;--tf-think:#3f6a9e;--tf-error:#8a5a48;
  --tf-skeleton:#ebe6de;--tf-skeleton-shine:rgba(255,255,255,.7);
}

/* ---------- 2. Shared primitives ---------- */
body[data-app] svg.i{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}
body[data-app] :focus-visible{outline:2px solid var(--tf-accent);outline-offset:2px}
.tf-eyebrow{display:flex;align-items:center;gap:8px;margin:0;font:500 10px/1.4 var(--tf-font-mono);letter-spacing:1.4px;text-transform:uppercase;color:var(--tf-muted)}
.tf-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Live pulse */
.tf-pulse{position:relative;display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--tf-accent);flex:none}
.tf-pulse::after{content:"";position:absolute;inset:0;border-radius:50%;background:var(--tf-accent);animation:tf-pulse 2s var(--tf-ease-out) infinite}
.tf-pulse.is-paused{background:var(--tf-quiet)}.tf-pulse.is-paused::after{animation:none;opacity:0}
@keyframes tf-pulse{0%{transform:scale(1);opacity:.55}70%,100%{transform:scale(3);opacity:0}}

/* ---------- 3. Horizontal scroller with edge fade ---------- */
.tf-scroller{display:flex;align-items:center;gap:8px;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;
  scroll-snap-type:x proximity;scroll-padding-inline:var(--tf-gutter);scrollbar-width:none;-webkit-overflow-scrolling:touch;padding-block:4px;
  --fade-l:0px;--fade-r:0px;
  -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 var(--fade-l),#000 calc(100% - var(--fade-r)),transparent 100%);
          mask-image:linear-gradient(90deg,transparent 0,#000 var(--fade-l),#000 calc(100% - var(--fade-r)),transparent 100%)}
.tf-scroller::-webkit-scrollbar{display:none}
.tf-scroller>*{flex:none;scroll-snap-align:start}
.tf-scroller[data-overflow~=start]{--fade-l:32px}
.tf-scroller[data-overflow~=end]{--fade-r:32px}
@media(max-width:680px){.tf-scroller.bleed{margin-inline:calc(var(--tf-gutter)*-1);padding-inline:var(--tf-gutter)}}

/* ---------- 4. Underline tabs ---------- */
.tf-tabs{gap:24px;border-bottom:1px solid var(--tf-line);padding-block:0}
.tf-tab{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:46px;min-width:44px;padding:0 1px;border:0;background:none;
  font:500 13px/1 var(--tf-font-ui);color:var(--tf-muted);white-space:nowrap;transition:color var(--tf-d1)}
.tf-tab:hover{color:var(--tf-text)}
.tf-tab[aria-selected=true],.tf-tab[aria-pressed=true],.tf-tab[aria-current=true]{color:var(--tf-accent)}
.tf-tab::after{content:"";position:absolute;left:0;right:0;bottom:0;height:2px;border-radius:2px 2px 0 0;background:var(--tf-accent);transform:scaleX(0);transition:transform var(--tf-d2) var(--tf-ease)}
.tf-tab[aria-selected=true]::after,.tf-tab[aria-pressed=true]::after,.tf-tab[aria-current=true]::after{transform:scaleX(1)}
.tf-tab:focus-visible{outline-offset:-2px;border-radius:6px}
@media(max-width:680px){.tf-tabs{gap:20px}.tf-tab{min-height:44px}}

/* ---------- 5. Segmented control ---------- */
.tf-seg{display:flex;gap:3px;padding:3px;border:1px solid var(--tf-line);border-radius:var(--tf-r-lg);background:var(--tf-raised);box-shadow:inset 0 1px var(--tf-highlight)}
.tf-seg>button{flex:1 1 auto;min-height:40px;min-width:0;padding:0 8px;border:0;border-radius:9px;background:transparent;font:550 12px/1.2 var(--tf-font-ui);color:var(--tf-muted);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:background var(--tf-d1),color var(--tf-d1)}
.tf-seg>button[aria-pressed=true],.tf-seg>button[aria-selected=true]{background:var(--tf-wash-strong);color:var(--tf-accent);box-shadow:inset 0 0 0 1px var(--tf-edge),inset 0 1px var(--tf-highlight)}
.tf-seg.equal>button{flex:1 1 0}
@media(pointer:coarse){.tf-seg>button{min-height:44px}}

/* ---------- 6. Chips ---------- */
.tf-chip{position:relative;display:inline-flex;align-items:center;gap:7px;height:36px;max-width:220px;padding:0 13px;border:1px solid var(--tf-line);
  border-radius:var(--tf-r-pill);background:var(--tf-surface);color:var(--tf-muted);font:500 12px/1 var(--tf-font-ui);white-space:nowrap;
  transition:border-color var(--tf-d1),color var(--tf-d1),background var(--tf-d1)}
.tf-chip>span:not(.tf-count){overflow:hidden;text-overflow:ellipsis}
.tf-chip::after{content:"";position:absolute;inset:-4px -2px}
.tf-chip:hover{color:var(--tf-text);border-color:var(--tf-edge)}
.tf-chip[aria-pressed=true],.tf-chip[aria-selected=true]{background:var(--tf-wash-strong);border-color:var(--tf-edge);color:var(--tf-accent)}
.tf-chip svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}
.tf-chip.square{border-radius:var(--tf-r-md)}
.tf-count{display:inline-grid;place-items:center;min-width:20px;height:18px;padding:0 5px;border-radius:var(--tf-r-pill);background:var(--tf-raised);color:var(--tf-quiet);font:500 10px/1 var(--tf-font-mono)}
.tf-chip[aria-pressed=true] .tf-count{background:transparent;color:var(--tf-accent)}
html[data-theme=light] .tf-count{color:#625f59}
html[data-theme=light] .tf-chip[aria-pressed=true]{color:#6a5335}
html[data-theme=light] .tf-chip[aria-pressed=true] .tf-count{color:#6a5335}

/* ---------- 7. Buttons ---------- */
.tf-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 16px;border-radius:11px;border:1px solid transparent;font:550 13px/1 var(--tf-font-ui);white-space:nowrap;text-decoration:none;cursor:pointer}
.tf-btn svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.tf-btn.primary{background:var(--tf-accent-grad);color:var(--tf-accent-ink);border-color:var(--tf-accent-border);box-shadow:inset 0 1px rgba(255,255,255,.4),0 5px 15px rgba(0,0,0,.12)}
.tf-btn.primary:hover{background:var(--tf-accent-grad-hover)}
.tf-btn.ghost{border-color:var(--tf-edge);background:var(--tf-wash);color:var(--tf-accent)}
.tf-btn.quiet{border-color:var(--tf-line);background:var(--tf-surface);color:var(--tf-muted)}
.tf-btn.quiet:hover,.tf-btn.ghost:hover{color:var(--tf-text);border-color:var(--tf-edge)}
.tf-icon-btn{display:inline-grid;place-items:center;width:40px;height:40px;padding:0;border-radius:var(--tf-r-md);color:var(--tf-muted);border:1px solid transparent;background:transparent;cursor:pointer}
.tf-icon-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.tf-icon-btn:hover{background:var(--tf-raised);color:var(--tf-text);border-color:var(--tf-line)}
.tf-icon-btn[aria-pressed=true]{color:var(--tf-accent);border-color:var(--tf-edge);background:var(--tf-wash)}
@media(pointer:coarse){.tf-icon-btn{width:44px;height:44px}}

/* ---------- 8. Cards, skeleton ---------- */
.tf-card{min-width:0;border:1px solid var(--tf-line);border-radius:var(--tf-r-xl);background:linear-gradient(150deg,var(--tf-raised),var(--tf-surface) 75%);box-shadow:inset 0 1px var(--tf-highlight),var(--tf-shadow)}
.tf-skel{position:relative;overflow:hidden;border-radius:6px;background:var(--tf-skeleton)}
.tf-skel::after{content:"";position:absolute;inset:0;transform:translateX(-100%);background:linear-gradient(90deg,transparent,var(--tf-skeleton-shine),transparent);animation:tf-shimmer 1.4s ease-in-out infinite}
@keyframes tf-shimmer{to{transform:translateX(100%)}}

/* ---------- 9. Bottom navigation (≤680px) ---------- */
/* The nav keeps the legacy .mobile-nav class for existing hooks (chat-open hide, voice inert). These selectors outrank every legacy .mobile-nav rule, including the three gold :last-child rules. */
body[data-app] #next-app nav.tf-bottom-nav.mobile-nav{display:none}
@media(max-width:680px){
  body[data-app] #next-app nav.tf-bottom-nav.mobile-nav{position:fixed;left:0;right:0;bottom:0;z-index:50;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;
    height:auto;overflow:visible;justify-content:normal;align-items:stretch;
    padding:6px max(8px,env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-right));
    background:color-mix(in srgb,var(--tf-surface) 92%,transparent);-webkit-backdrop-filter:blur(16px) saturate(1.2);backdrop-filter:blur(16px) saturate(1.2);
    border:0;border-top:1px solid var(--tf-line);box-shadow:0 -8px 30px rgba(0,0,0,.13),inset 0 1px var(--tf-highlight)}
}
body[data-app] #next-app .tf-bottom-nav.mobile-nav>.tf-nav-item{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
  flex:initial;min-width:0;min-height:54px;margin:0;padding:0;border:0;border-radius:var(--tf-r-lg);background:transparent;box-shadow:none;
  color:var(--tf-muted);font:550 11px/1.1 var(--tf-font-ui);letter-spacing:.1px}
body[data-app] #next-app .tf-bottom-nav.mobile-nav>.tf-nav-item>b{display:block;max-width:100%;font-weight:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-inline:2px}
body[data-app] #next-app .tf-bottom-nav .tf-nav-icon{position:relative;display:grid;place-items:center;width:52px;max-width:100%;height:30px;border-radius:var(--tf-r-pill);transition:background var(--tf-d2) var(--tf-ease)}
body[data-app] #next-app .tf-bottom-nav .tf-nav-icon svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
body[data-app] #next-app .tf-bottom-nav.mobile-nav>.tf-nav-item[aria-current=page]{color:var(--tf-accent);background:transparent}
body[data-app] #next-app .tf-bottom-nav .tf-nav-item[aria-current=page] .tf-nav-icon{background:var(--tf-wash-strong);box-shadow:inset 0 0 0 1px var(--tf-edge)}
body[data-app] #next-app .tf-bottom-nav.mobile-nav>.tf-nav-item.ask{gap:2px}
body[data-app] #next-app .tf-bottom-nav .tf-nav-item.ask .tf-nav-icon{width:44px;height:44px;margin-top:-10px;border-radius:50%;background:var(--tf-accent-grad);color:var(--tf-accent-ink);
  border:1px solid var(--tf-accent-border);box-shadow:inset 0 1px rgba(255,255,255,.4),0 6px 16px rgba(0,0,0,.28)}
body[data-app] #next-app .tf-bottom-nav .tf-nav-item.ask .tf-nav-icon svg{stroke-width:1.9}
.tf-badge{position:absolute;top:-3px;left:calc(50% + 6px);min-width:18px;height:18px;padding:0 5px;border-radius:var(--tf-r-pill);
  background:var(--tf-accent-grad);color:var(--tf-accent-ink);font:600 10px/18px var(--tf-font-mono);text-align:center;box-shadow:0 0 0 2px var(--tf-surface)}
.tf-badge[hidden]{display:none}
@media(max-width:680px){body[data-app] .mobile-chat-toggle{display:none!important}}
@media(max-width:1020px){body[data-app].chat-open .tf-bottom-nav{visibility:hidden}}

/* ---------- 10. Sheet (More menu) ---------- */
.tf-sheet-layer{position:fixed;inset:0;z-index:185;pointer-events:none;visibility:hidden}
.tf-sheet-layer.is-open{pointer-events:auto;visibility:visible}
.tf-scrim{position:absolute;inset:0;background:var(--tf-scrim);opacity:0;transition:opacity var(--tf-d3) var(--tf-ease)}
.tf-sheet{position:absolute;left:0;right:0;bottom:0;max-height:min(88dvh,720px);overflow:auto;overscroll-behavior:contain;
  padding:8px var(--tf-gutter) calc(18px + env(safe-area-inset-bottom));border-radius:var(--tf-r-2xl) var(--tf-r-2xl) 0 0;
  background:linear-gradient(180deg,var(--tf-raised),var(--tf-surface) 120px);border-top:1px solid var(--tf-edge);box-shadow:var(--tf-shadow-pop);color:var(--tf-text);
  transform:translateY(102%);transition:transform var(--tf-d3) var(--tf-ease)}
.tf-sheet-layer.is-open>.tf-scrim{opacity:1}
.tf-sheet-layer.is-open>.tf-sheet{transform:none}
.tf-grabber{display:block;width:36px;height:4px;margin:2px auto 12px;border-radius:2px;background:var(--tf-edge)}
.tf-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.tf-sheet h2{margin:0;font:600 15px/1.3 var(--tf-font-display);letter-spacing:-.2px;color:var(--tf-text)}
.tf-tile-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:12px}
.tf-tile{display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;gap:10px;min-width:0;min-height:84px;padding:12px;border:1px solid var(--tf-line);
  border-radius:var(--tf-r-xl);background:linear-gradient(145deg,var(--tf-raised),var(--tf-surface));box-shadow:inset 0 1px var(--tf-highlight);text-align:left;color:var(--tf-text);text-decoration:none}
.tf-tile svg{width:20px;height:20px;fill:none;stroke:var(--tf-accent);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.tf-tile strong{display:block;font:550 12px/1.3 var(--tf-font-ui);color:var(--tf-text)}
.tf-tile small{display:block;margin-top:2px;font-size:11px;line-height:1.35;color:var(--tf-muted)}
.tf-tile[aria-current=page]{border-color:var(--tf-edge);background:var(--tf-wash-strong)}
.tf-sheet-row{display:flex;align-items:center;gap:12px;width:100%;min-height:52px;padding:0 4px;border:0;border-top:1px solid var(--tf-line);background:none;font:500 13px/1.3 var(--tf-font-ui);color:var(--tf-muted);text-align:left;text-decoration:none}
.tf-sheet-row svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}
.tf-sheet-row .tf-row-value{margin-left:auto;color:var(--tf-accent);font-size:12px}
.tf-sheet-row:hover{color:var(--tf-text)}

@media(prefers-reduced-motion:reduce){
  .tf-pulse::after,.tf-skel::after{animation:none}
  .tf-sheet,.tf-scrim,.tf-tab::after,.tf-nav-icon{transition:none}
}

/* ---------- In-app Back chip and recently viewed (next round) ---------- */
body[data-app] .tf-nav-back{display:flex;min-height:0}
body[data-app] .tf-nav-back button{display:inline-flex;align-items:center;gap:6px;margin:0 0 12px;padding:6px 12px 6px 8px;border:1px solid var(--tf-accent-border);border-radius:var(--tf-r-pill);background:var(--tf-wash);color:var(--tf-accent);font:600 12px/1.2 var(--tf-font-ui);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body[data-app] .tf-nav-back button:hover{background:var(--tf-wash-strong)}
body[data-app] .tf-nav-back svg.i{width:15px;height:15px}
body[data-app] .search-recent-head{padding:10px 10px 4px;color:var(--tf-quiet);font:500 10px/1 var(--tf-font-mono);letter-spacing:.12em;text-transform:uppercase}
body[data-app] .tf-members-card{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;margin-top:16px;padding:14px 16px;border:1px dashed var(--tf-accent-border);border-radius:var(--tf-r-lg);background:var(--tf-wash);color:var(--tf-text);font:400 14px/1.5 var(--tf-font-ui)}
body[data-app] .tf-members-card p{margin:0;flex:1 1 240px}
body[data-app] .tf-members-card a{display:inline-flex;align-items:center;padding:8px 14px;border-radius:var(--tf-r-pill);background:var(--tf-accent-grad);color:var(--tf-accent-ink);font-weight:700;white-space:nowrap}
body[data-app] .tf-visitor-bar{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;margin:0 0 14px;padding:12px 14px;border:1px solid var(--tf-line);border-radius:var(--tf-r-lg);background:var(--tf-surface);color:var(--tf-muted);font:400 13px/1.5 var(--tf-font-ui)}
body[data-app] .tf-visitor-bar p{margin:0;flex:1 1 260px}
body[data-app] .tf-visitor-bar strong{color:var(--tf-text)}
body[data-app] .tf-visitor-bar a{display:inline-flex;padding:7px 13px;border-radius:var(--tf-r-pill);background:var(--tf-accent-grad);color:var(--tf-accent-ink);font-weight:700;white-space:nowrap}
body[data-app] .tf-visitor-bar a.quiet{background:none;border:1px solid var(--tf-line);color:var(--tf-text)}

/* ---------- Tour ---------- */
body[data-app] .tf-tour{position:fixed;inset:0;z-index:300}
body[data-app] .tf-tour-ring{position:fixed;border-radius:14px;box-shadow:0 0 0 2px var(--tf-accent),0 0 0 9999px var(--tf-scrim);transition:all var(--tf-d3) var(--tf-ease);pointer-events:none}
body[data-app] .tf-tour-card,body[data-app] .tf-tour-offer{background:var(--tf-raised);color:var(--tf-text);border:1px solid var(--tf-edge);border-radius:var(--tf-r-xl);box-shadow:var(--tf-shadow-pop);font:400 14px/1.5 var(--tf-font-ui)}
body[data-app] .tf-tour-card{position:fixed;width:min(340px,calc(100vw - 24px));padding:16px 18px;display:grid;gap:6px}
body[data-app] .tf-tour-card h2{margin:0;font:700 17px/1.3 var(--tf-font-display)}
body[data-app] .tf-tour-card p{margin:0;color:var(--tf-muted)}
body[data-app] .tf-tour-count{font:500 10px/1 var(--tf-font-mono)!important;letter-spacing:.12em;text-transform:uppercase;color:var(--tf-accent)!important}
body[data-app] .tf-tour-actions{display:flex;align-items:center;gap:8px;margin-top:8px}
body[data-app] .tf-tour-actions span{flex:1}
body[data-app] :is(.tf-tour-card,.tf-tour-offer) button{min-height:36px;padding:0 14px;border-radius:var(--tf-r-pill);background:var(--tf-accent-grad);color:var(--tf-accent-ink);font-weight:700}
body[data-app] :is(.tf-tour-card,.tf-tour-offer) button.quiet{background:none;border:1px solid var(--tf-line);color:var(--tf-text);font-weight:500}
body[data-app] .tf-tour-offer{position:fixed;z-index:120;left:max(12px,env(safe-area-inset-left,0px));right:max(12px,env(safe-area-inset-right,0px));bottom:calc(84px + env(safe-area-inset-bottom,0px));display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;padding:12px 14px;max-width:520px;margin:0 auto}
body[data-app] .tf-tour-offer p{margin:0;flex:1 1 220px;color:var(--tf-muted)}
body[data-app] .tf-tour-offer strong{color:var(--tf-text)}
@media(min-width:1021px){body[data-app] .tf-tour-offer{bottom:24px;left:auto;right:calc(var(--chat,338px) + 24px)}}
@media(prefers-reduced-motion:reduce){body[data-app] .tf-tour-ring{transition:none}}

/* Today's price move on scored AI Picks */
body[data-app] .signal-move{display:inline-block;margin-top:3px;font:500 11px/1.2 var(--tf-font-mono);font-style:normal;color:var(--tf-quiet)}
body[data-app] .signal-move.up{color:var(--tf-up)}
body[data-app] .signal-move.down{color:var(--tf-down)}

/* ---------- Watchlist: swipe left to remove, confirm first ---------- */
body[data-app] .tf-swipe{position:relative;overflow:hidden;max-height:240px;transition:max-height var(--tf-d3) var(--tf-ease),opacity var(--tf-d2) var(--tf-ease)}
body[data-app] .tf-swipe .watch-row{position:relative;z-index:1;background:var(--tf-bg);touch-action:pan-y;transition:transform var(--tf-d2) var(--tf-ease-out)}
body[data-app] .tf-swipe .watch-row:hover{background:linear-gradient(var(--tf-wash),var(--tf-wash)),var(--tf-bg)}
body[data-app] .tf-swipe-action{position:absolute;inset:0 0 0 auto;width:88px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;background:#c2334d;color:#fff;font:700 12px/1 var(--tf-font-ui);border:0}
body[data-app] .tf-swipe-action svg{width:18px;height:18px}
body[data-app] .tf-swipe-action:focus-visible{outline:2px solid #fff;outline-offset:-4px}
body[data-app] .tf-swipe.is-removing{max-height:0;opacity:0}
body[data-app] .tf-swipe-hint{margin:10px 2px 0;color:var(--tf-quiet);font:400 12px/1.4 var(--tf-font-ui)}
@media(hover:hover) and (pointer:fine){body[data-app] .tf-swipe-hint{display:none}}
body[data-app] .tf-confirm{width:min(380px,calc(100vw - 32px));padding:22px;border:1px solid var(--tf-edge);border-radius:var(--tf-r-xl);background:var(--tf-raised);color:var(--tf-text);box-shadow:var(--tf-shadow-pop)}
body[data-app] .tf-confirm::backdrop{background:var(--tf-scrim)}
body[data-app] .tf-confirm h2{margin:0 0 8px;font:700 18px/1.3 var(--tf-font-display)}
body[data-app] .tf-confirm p{margin:0;color:var(--tf-muted);font:400 14px/1.5 var(--tf-font-ui)}
body[data-app] .tf-confirm-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}
body[data-app] .tf-confirm-actions button{min-height:42px;padding:0 18px;border-radius:var(--tf-r-pill);font:700 14px/1 var(--tf-font-ui)}
body[data-app] .tf-confirm-actions .quiet{border:1px solid var(--tf-line);color:var(--tf-text);background:none}
body[data-app] .tf-confirm-actions .danger{background:#c2334d;color:#fff;border:0}
@media(prefers-reduced-motion:reduce){body[data-app] :is(.tf-swipe,.tf-swipe .watch-row){transition:none}}

/* Top bar: wordmark a step larger now the Market Week link has moved to the rail and More */
body[data-app] .topbar .wordmark{font-size:24px}
body[data-app] .topbar .wordmark small{top:calc(100% + 3px)}
@media(max-width:680px){
 body[data-app] .topbar .wordmark{font-size:20px;padding-left:46px}
 body[data-app] .topbar .wordmark::before{width:38px;height:38px;top:calc(50% + 6px)}
 body[data-app] .topbar .wordmark small{left:46px;top:calc(100% + 2px)}
}

/* Good/Bad assessments: open the full list; flag a price move against the assessment */
body[data-app] .signal-see-all{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:0 12px;border:1px solid var(--tf-line);border-radius:var(--tf-r-pill);background:none;color:var(--tf-accent);font:600 12px/1 var(--tf-font-ui);white-space:nowrap}
body[data-app] .signal-see-all:hover{background:var(--tf-wash)}
body[data-app] .signal-flag{display:table;margin:5px 0 0;padding:2px 7px;border:1px solid var(--tf-edge);border-radius:var(--tf-r-pill);color:var(--tf-muted);font:600 10px/1.4 var(--tf-font-ui);font-style:normal;letter-spacing:.02em}

/* News: RNS leads the tabs, set apart from the region filters */
body[data-app] .wn-regions .wn-rns-tab{margin-right:12px;position:relative}
body[data-app] .wn-regions .wn-rns-tab::after{content:"";position:absolute;right:-8px;top:22%;bottom:22%;width:1px;background:var(--tf-line)}
body[data-app] .signal-review{margin:10px 0 0;padding:10px 12px;border-left:3px solid var(--tf-edge);border-radius:0 var(--tf-r-md) var(--tf-r-md) 0;background:var(--tf-wash);color:var(--tf-muted);font:400 13px/1.5 var(--tf-font-ui)}
body[data-app] .signal-review strong{color:var(--tf-text)}
body[data-app] .signal-review.confirmed{border-left-color:var(--tf-accent)}
body[data-app] .signal-review:is(.weaker,.stronger){border-left-color:var(--tf-think)}
body[data-app] .signal-card .signal-review{display:block;-webkit-line-clamp:unset;line-clamp:unset;max-height:none;overflow:visible}

/* Stock terminal headlines: the Market view's AI score and digestion where the AI has scored */
body[data-app] .tr-news-ai .tr-ai-score{font:600 12px/1.4 var(--tf-font-mono);color:var(--tf-muted)}
body[data-app] .tr-news-ai .tr-ai-score strong{font-size:15px;color:var(--tf-text)}
body[data-app] .tr-news-ai .tr-ai-score.up strong{color:var(--tf-up)}
body[data-app] .tr-news-ai .tr-ai-score.down strong{color:var(--tf-down)}
body[data-app] .tr-ai-summary{margin:0;max-width:900px;color:var(--tf-muted);font:400 14px/1.65 var(--tf-font-ui);overflow-wrap:anywhere}
body[data-app] .tr-news-bottom .tr-digest{display:inline-flex;align-items:center;gap:10px;min-height:40px;padding:0;border:0;background:none;color:var(--tf-accent);font:600 12px/1 var(--tf-font-ui);cursor:pointer}
body[data-app] .tr-news-bottom .tr-digest svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5}

/* Watchlist push alerts */
body[data-app] .tf-swipe .watch-bell{position:absolute;z-index:2;top:50%;right:10px;transform:translateY(-50%);width:38px;height:38px;display:grid;place-items:center;border:1px solid transparent;border-radius:var(--tf-r-pill);background:var(--tf-bg);color:var(--tf-quiet);transition:opacity var(--tf-d1) var(--tf-ease)}
body[data-app] .tf-swipe .watch-bell svg{width:18px;height:18px}
body[data-app] .tf-swipe .watch-bell:hover{color:var(--tf-text)}
body[data-app] .tf-swipe .watch-bell.on{color:var(--tf-accent);border-color:var(--tf-accent-border);background:var(--tf-wash)}
body[data-app] .tf-swipe .watch-bell.on svg{fill:currentColor}
body[data-app] .tf-swipe:is(.is-open,.is-moving) .watch-bell{opacity:0;pointer-events:none}
body[data-app] .tf-swipe .watch-row{padding-right:58px}
body[data-app] .tf-push-hint{margin:6px 2px 0;color:var(--tf-quiet);font:400 12px/1.5 var(--tf-font-ui)}
body[data-app] .tf-push-hint button{margin-left:6px;padding:0;border:0;background:none;color:var(--tf-accent);font:600 12px/1.5 var(--tf-font-ui);text-decoration:underline;cursor:pointer}
