/* The market chooser (design D, "Words"): a full-page overlay on tredye.com's home and the NSE dashboards, once a day.
   <html data-chooser="due"> is set before first paint by the market boot script (source/web/src/lib/market-boot.ts);
   _tredye/chooser.js builds the overlay and sets "open". Tokens only. */
html[data-chooser="due"]::before{content:"";position:fixed;inset:0;z-index:2147483000;background:var(--background);animation:tch-failsafe 0s linear 6s forwards}
@keyframes tch-failsafe{to{visibility:hidden}}
html[data-chooser="open"]{overflow:hidden}
.tch{position:fixed;inset:0;z-index:2147483000;display:flex;flex-direction:column;overflow:auto;color:var(--foreground);font:400 15px/1.5 var(--font-sans);background:color-mix(in oklab,var(--background) 82%,transparent);-webkit-backdrop-filter:blur(22px) saturate(1.1);backdrop-filter:blur(22px) saturate(1.1);transition:opacity var(--dur-scene,520ms) var(--ease-glide,cubic-bezier(.22,1,.36,1)),transform var(--dur-scene,520ms) var(--ease-glide,cubic-bezier(.22,1,.36,1)),filter var(--dur-scene,520ms) var(--ease-glide,cubic-bezier(.22,1,.36,1))}
.tch *{box-sizing:border-box}
.tch [hidden]{display:none!important}
.tch.tch-gone{opacity:0;transform:scale(1.04);filter:blur(6px);pointer-events:none}
.tch-top{display:flex;justify-content:center;padding:34px 16px 0}
.tch-lockup{display:inline-flex;align-items:center;gap:10px;font:400 italic 28px/1 var(--font-display);letter-spacing:-.01em;color:var(--foreground)}
.tch-lockup svg{width:30px;height:20px}
.tch-duo{flex:1;display:grid;grid-template-columns:1fr 1px 1fr;align-items:center;padding:0 clamp(24px,6vw,96px);min-height:560px}
.tch-rule{height:62%;background:var(--hairline-strong);align-self:center}
.tch-side{padding:0 clamp(16px,4vw,64px);display:grid;gap:18px;justify-items:start;border-radius:var(--radius-3xl)}
.tch-word{font:400 clamp(72px,11vw,168px)/.86 var(--font-display);letter-spacing:-.04em;margin:0;padding-bottom:.14em;display:flex;align-items:flex-start;gap:14px}
.tch-c .tch-word{color:var(--muted-foreground);opacity:.55}
.tch-n .tch-word{transition:letter-spacing .5s var(--ease-glide,ease)}
.tch-n:hover .tch-word{letter-spacing:-.025em}
.tch-pill{display:inline-flex;align-items:center;gap:7px;height:28px;padding:0 12px;margin-top:clamp(10px,1.6vw,24px);border-radius:999px;font:500 13px/1 var(--font-sans);letter-spacing:0;white-space:nowrap}
.tch-pill.soon{background:var(--surface-3);color:var(--foreground-secondary)}
.tch-pill.open{background:color-mix(in oklab,var(--up) 12%,transparent);color:var(--up)}
.tch-dot{width:6px;height:6px;border-radius:50%;background:currentColor}
.tch-pill.open .tch-dot{background:var(--up-bright);animation:tch-breathe 2.4s var(--ease-glide,ease) infinite}
@keyframes tch-breathe{0%{box-shadow:0 0 0 0 color-mix(in oklab,var(--up-bright) 45%,transparent)}70%{box-shadow:0 0 0 7px transparent}100%{box-shadow:0 0 0 0 transparent}}
.tch-sub{margin:0;font:400 18px/1.45 var(--font-sans);color:var(--foreground-secondary);max-width:30ch}
.tch-sub b{color:var(--foreground);font-weight:500}
/* "Trading": a slow glint, the same sweep as the rail's Play label, in the foreground and brand tokens */
.tch-sub b.tch-shine{font-weight:600;background-image:linear-gradient(105deg,var(--foreground) 0%,var(--foreground) 38%,var(--brand) 47%,var(--brand) 53%,var(--foreground) 62%,var(--foreground) 100%);background-size:300% 100%;background-position:100% 0;-webkit-background-clip:text;background-clip:text;color:transparent;animation:tch-shine 5s ease-in-out 1.2s infinite}
@keyframes tch-shine{0%{background-position:100% 0}32%,100%{background-position:0 0}}
.tch-btn{appearance:none;border:0;cursor:pointer;height:44px;padding:0 20px;border-radius:999px;font:500 14px var(--font-sans);display:inline-flex;align-items:center;justify-content:center;gap:8px;white-space:nowrap;transition:transform var(--dur-tap,140ms) var(--ease-spring,ease),background-color .2s}
.tch-btn:active{transform:scale(.96)}
.tch-btn:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
.tch-btn.quiet{background:var(--surface-3);color:var(--foreground)}
.tch-btn.quiet:hover{background:var(--surface-muted)}
.tch-btn.brand{background:var(--brand);color:var(--brand-foreground)}
.tch-btn.big{height:52px;padding:0 26px;font-size:15px}
.tch-arrow{transition:transform .3s var(--ease-spring,ease)}
.tch-n{cursor:pointer;outline:none}
.tch-n:hover .tch-arrow{transform:translateX(4px)}
.tch-n:focus-visible{outline:none} /* no focus style on the NSE side, by the owner's choice; Enter / Esc still enter */
.tch-notify{display:grid;gap:10px;justify-items:start;width:100%}
.tch-form{display:grid;gap:8px;grid-template-columns:1fr auto;width:min(100%,440px);animation:tch-rise .42s var(--ease-glide,ease)}
@keyframes tch-rise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.tch-form input{height:44px;min-width:0;border:0;border-radius:999px;padding:0 18px;background:var(--surface);box-shadow:0 0 0 1px var(--tile-ring),var(--shadow-inset);color:var(--foreground);font:400 15px var(--font-sans)}
.tch-form input:focus{outline:2px solid var(--ring);outline-offset:1px}
.tch-small{margin:0;font:400 12.5px/1.45 var(--font-sans);color:var(--subtle-foreground)}
.tch-small.err{color:var(--down)}
.tch-thanks{display:flex;align-items:center;gap:10px;font:500 14px var(--font-sans);color:var(--foreground);animation:tch-rise .42s var(--ease-glide,ease)}
.tch-thanks i{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;background:color-mix(in oklab,var(--up) 14%,transparent);color:var(--up);font-style:normal;font-size:13px}

@media (max-width:767px){
  .tch-duo{flex:none;grid-template-columns:1fr;gap:34px;padding:36px 20px 24px;min-height:0}
  .tch-rule{display:none}
  .tch-side{padding:0}
  .tch-n{order:-1}
}
/* motion off (the site's setting, then the system's): no sweep, no pulse, no fade; "Trading" is plain emphasised text */
.tch.tch-still,.tch.tch-still *{animation:none!important;transition:none!important}
.tch.tch-still .tch-sub b.tch-shine{background:none;-webkit-background-clip:border-box;background-clip:border-box;color:var(--foreground)}
@media (prefers-reduced-motion:reduce){html:not([data-motion="full"]) .tch,html:not([data-motion="full"]) .tch *{animation:none!important;transition:none!important}
  html:not([data-motion="full"]) .tch .tch-sub b.tch-shine{background:none;-webkit-background-clip:border-box;background-clip:border-box;color:var(--foreground)}}
.tch:focus{outline:none}
