/* ---------- The Studio and Quest styles' own screens (the Round 2 designs) ----------
   Only used when <html data-style="studio|quest">; Classic never renders these classes. Colours are the variables
   from app.css (never hard-coded), so the accents keep working. */

/* shared bits */
.ico { fill: none; stroke: currentColor; stroke-width: var(--icon-stroke); stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; display: block; }
.ico .solid { fill: currentColor; stroke: none; }
.icw { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.svgw { display: inline-flex; flex-shrink: 0; }
.svgw svg { display: block; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.grain { position: relative; isolation: isolate; }
.grain::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .035; z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.mtr { display: flex; gap: 3px; height: 12px; }
.mtr i { flex: 1; border-radius: 3px; background: var(--seg-off); }
.mtr i.on { background: var(--accent); }
.mtr.shield i.on { background: var(--shield); }
.pring .pr-off { fill: none; stroke: var(--seg-off); }
.pring .pr-on { fill: none; stroke: var(--accent); stroke-linecap: round; }
.home.styled { min-height: 100%; display: flex; flex-direction: column; }
.home.styled .link-btn { color: var(--accent-text); }
.home.styled .home-body.home-main { max-width: none; padding: 0; margin: 0; display: block; }
.home.styled .home-body.home-page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 32px 48px; }
button.s-start-title, button.blc-go-t { background: none; border: 0; padding: 0; color: inherit; cursor: pointer; text-align: left; }

/* ---------- the top bar ---------- */
.appbar { display: flex; align-items: center; flex-shrink: 0; }
.appbar .grow { flex: 1; }
.ab-brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.ab-brand .logo-svg svg { width: 32px; height: 32px; display: block; }
.logo-svg .tri { fill: var(--accent); } .logo-svg .cdl { fill: var(--green); }
.logo-svg .hex { fill: var(--accent); } .logo-svg .tri-in { fill: var(--accent-ink); } .logo-svg .cdl-in { fill: var(--accent-ink); opacity: .75; }
.ab-brand span { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.ab-nav { display: flex; align-items: center; }
.ab-tab { display: flex; align-items: center; gap: 7px; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color .12s, color .12s; }
.ab-tab.off { opacity: .45; cursor: default; }
.ab-tab .pro-tag { font-family: var(--font-mono); font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }
.ab-right { display: flex; align-items: center; gap: 10px; }
.ab-saved { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); padding: 0 6px; }
.ab-new { display: flex; align-items: center; gap: 8px; border: 0; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; flex: none; }
.ab-circ { display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--line2); background: transparent; color: var(--soft); padding: 0; cursor: pointer; transition: background-color .12s; }
.ab-circ:hover { background: var(--panel2); color: var(--text); }
.ab-acct { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 999px; padding: 3px 14px 3px 3px; height: 44px; cursor: pointer; }
.ab-acct.static { cursor: default; }
.ab-acct.locked .ab-avatar { background: var(--warn-soft); color: var(--warn); }
.ab-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--up-soft); color: var(--up-text); font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.ab-rank { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--accent-text); }
.rank-glyph circle { fill: none; stroke: var(--seg-off); stroke-width: 2; }
.rank-glyph circle.on { stroke: var(--accent); }

/* Studio */
.appbar.studio { height: 72px; padding: 0 48px; gap: 24px; }
.appbar.studio .ab-nav { height: 48px; padding: 5px; gap: 2px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.appbar.studio .ab-tab { height: 38px; padding: 0 16px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 500; }
.appbar.studio .ab-tab:not(.on):not(.off):hover { background: var(--panel2); color: var(--text); }
.appbar.studio .ab-tab.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.appbar.studio .ab-tab.on .pro-tag { background: color-mix(in srgb, var(--accent-ink) 18%, transparent); color: var(--accent-ink); }
.appbar.studio .ab-new { height: 44px; padding: 0 20px 0 16px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.appbar.studio .ab-new:hover { background: var(--accent-hover); }
.appbar.studio .ab-circ { width: 44px; height: 44px; }

/* Quest */
.appbar-wrap.quest { position: sticky; top: 0; z-index: 20; background: var(--bg); }
.appbar.quest { height: 56px; padding: 0 28px; gap: 20px; }
.appbar.quest .ab-brand .logo-svg svg { width: 30px; height: 30px; }
.appbar.quest .ab-brand span { font-size: 15px; font-weight: 700; letter-spacing: 0; }
.appbar.quest .ab-nav { gap: 4px; margin-left: 20px; }
.appbar.quest .ab-tab { height: 36px; padding: 0 12px; border-radius: 12px; color: var(--muted); font-size: 14px; font-weight: 700; }
.appbar.quest .ab-tab:not(.on):not(.off):hover { background: var(--panel); color: var(--text); }
.appbar.quest .ab-tab.on { background: var(--panel2); color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }
.appbar.quest .ab-circ { width: 36px; height: 36px; border: 0; color: var(--muted); }
.appbar.quest .ab-saved { color: var(--dim); }
.ab-streak { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 8px; border-radius: 10px; background: var(--flame-soft); color: var(--flame); font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.ab-streak:not(.on) { color: var(--muted); background: var(--panel2); }
.ab-crest { display: flex; align-items: center; gap: 10px; }
.ab-crest-t { display: flex; flex-direction: column; line-height: 1.2; }
.ab-crest-t b { font-size: 13px; }
.ab-crest-t span { font-size: 11px; font-weight: 600; color: var(--dim); }
.appbar.quest .ab-acct { height: 36px; padding: 2px; border: 0; background: none; }
.appbar.quest .ab-avatar { width: 32px; height: 32px; background: var(--accent); color: var(--accent-ink); font-size: 14px; }
/* New backtest / Add account (0.22.0: Quest's Home had it only far down the page): a small violet key with its lip */
.appbar.quest .ab-new { height: 36px; padding: 0 14px 0 10px; gap: 6px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 0 var(--accent-lip);
  transition: transform .08s, box-shadow .08s; }
.appbar.quest .ab-new:active { transform: translateY(3px); box-shadow: none; }
@media (max-width: 1440px) { .appbar.quest .ab-new { font-size: 0; gap: 0; padding: 0; width: 36px; justify-content: center; } } /* just its +, the name is its tooltip */
.crest-svg { display: inline-flex; flex-shrink: 0; }
.crest-svg svg { width: 100%; height: 100%; overflow: visible; }
.crest-svg .cr-bg { fill: var(--accent-soft); stroke: var(--line2); stroke-width: 1.4; }
.crest-svg .cr-ring { fill: none; stroke: var(--accent-hi); stroke-width: 1.6; stroke-linecap: round; }
.crest-svg text { fill: var(--text); font-family: var(--font-display); font-weight: 800; font-size: 8.4px; }
.xp-rail20 { padding: 0 0 0; }
.xp-rail20 .mtr { height: 6px; gap: 2px; }
.xp-rail20 .mtr i { border-radius: 0; }

/* ---------- Studio Home ---------- */
.s-home { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 464px); gap: 20px; padding: 12px 48px 32px; width: 100%; max-width: 1680px; margin: 0 auto; align-items: start; }
.s-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.s-card { background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 22px 24px; }
.s-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.s-card-head h2 { font-family: var(--font-display); font-weight: 700; font-size: 19px; margin: 0; display: flex; align-items: baseline; gap: 8px; }
.s-count { font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--dim); }
.s-muted { color: var(--muted); font-size: 13px; }
.s-faint { color: var(--dim); }
.s-mono { font-family: var(--font-mono); font-size: 12px; }
.s-link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); font-size: 14px; font-weight: 600; text-decoration: none; }
.s-eyebrow { font-size: 13px; color: var(--muted); }
.pill-btn { height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; color: var(--soft); font-weight: 600; cursor: pointer; }
.pill-btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.s-hero { display: grid; grid-template-columns: minmax(0, 1fr) 1px minmax(220px, 280px); gap: 32px; min-height: 380px; padding: 36px; border-radius: 28px;
  background: var(--lamp), var(--hero); border: 1px solid var(--hero-edge); }
.s-hero-l { display: flex; flex-direction: column; min-width: 0; }
.s-greet { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--accent-text); }
.s-hero-title { font-family: var(--font-display); font-weight: 800; font-size: 44px; line-height: 1.02; letter-spacing: -.02em; margin: 10px 0 12px; }
.s-hero-sub { font-size: 15px; color: var(--hero-muted); max-width: 440px; margin: 0 0 18px; line-height: 1.5; }
.s-market { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.s-label { font-size: 12px; color: var(--dim); }
.mk-row { display: flex; align-items: center; gap: 10px; }
.mk-seg { display: flex; gap: 4px; }
.mk { cursor: pointer; font-family: var(--font-mono); white-space: nowrap; }
.mk-more { height: 36px; width: auto; max-width: 130px; padding: 0 12px; border-radius: 999px; background: transparent; border: 1px solid var(--line2); color: var(--muted); cursor: pointer; }
.q-hero .mk-more { height: 38px; border-radius: 12px; border-width: 2px; background: var(--panel2); font-weight: 700; }
.s-hero .mk-seg { height: 42px; padding: 4px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 55%, transparent); }
.s-hero .mk { height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid transparent; background: none; color: var(--muted); font-size: 13px; }
.s-hero .mk:hover { color: var(--text); }
.s-hero .mk.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.s-start { display: flex; align-items: center; gap: 20px; margin-top: auto; }
.day-ring-btn { position: relative; width: 112px; height: 112px; flex-shrink: 0; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; }
.day-ring .arc { fill: none; stroke: var(--hero-edge); stroke-linecap: round; transition: stroke .2s; }
.day-ring .arc.on { stroke: var(--accent); }
.drb-disc { position: absolute; inset: 12px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 14%, transparent), 0 12px 32px color-mix(in srgb, var(--accent) 28%, transparent); transition: background-color .14s, box-shadow .14s; }
.drb-disc .icw { margin-left: 4px; }
.day-ring-btn.done .drb-disc .icw { margin-left: 0; }
.day-ring-btn:hover .drb-disc { background: var(--accent-hover); box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 24%, transparent), 0 12px 32px color-mix(in srgb, var(--accent) 34%, transparent); }
.s-start-t { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.s-start-title { font-size: 18px; font-weight: 600; }
.s-start-title:hover { color: var(--accent-text); }
.s-steps { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.s-steps .st { display: inline-flex; align-items: center; gap: 6px; }
.s-steps .st i { width: 8px; height: 8px; border-radius: 50%; background: var(--hero-edge); }
.s-steps .st.on i { background: var(--accent); }
.s-steps .arr { color: var(--dim); }
.s-start-t a { color: var(--accent-text); }
.s-hero-div { background: color-mix(in srgb, var(--accent-text) 14%, transparent); }
.s-hero-r { display: flex; flex-direction: column; gap: 12px; }
.s-streak { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.s-flame { display: flex; align-items: center; justify-content: center; margin-right: -4px; }
.s-big { font-family: var(--font-display); font-weight: 800; font-size: 80px; line-height: .9; letter-spacing: -.03em; }
.s-unit { font-size: 15px; font-weight: 600; color: var(--soft); align-self: flex-end; margin-bottom: 6px; }
.s-dots { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; }
.s-dot { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.s-dot-in { width: 36px; height: 36px; border-radius: 12px; background: var(--seg-off); outline: 1px solid var(--line2); outline-offset: -1px; display: flex; align-items: center; justify-content: center; color: var(--accent-ink); }
.s-dot.done .s-dot-in { background: var(--accent); outline: 0; }
.s-dot.today:not(.done) .s-dot-in { background: transparent; outline: 2px dashed var(--accent); outline-offset: -2px; }
.s-dot-l { font-size: 11px; font-weight: 600; color: var(--muted); }
.s-dot.today .s-dot-l { color: var(--accent-text); }
.s-weekend { color: var(--dim); height: 36px; display: flex; align-items: center; }
.s-mark { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--accent-text); margin-top: auto; }

.s-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 320px); gap: 20px; }
.sd-body { display: flex; gap: 22px; align-items: flex-start; }
.sd-grid-wrap { display: flex; flex-direction: column; gap: 6px; min-width: 0; overflow: hidden; }
.sd-months { display: grid; grid-template-columns: repeat(20, 14px); gap: 5px; margin-left: 19px; font-size: 11px; color: var(--dim); height: 14px; white-space: nowrap; }
.sd-months span { overflow: visible; }
.sd-grid { display: flex; gap: 5px; }
.sd-rows { display: flex; flex-direction: column; gap: 5px; width: 14px; }
.sd-rows span { height: 14px; font-size: 10px; line-height: 14px; color: var(--dim); }
.sd-col { display: flex; flex-direction: column; gap: 5px; }
.sd-c { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle, var(--seg-off) 0 3px, transparent 3.5px); }
.sd-c.sealed { background: var(--accent); }
.sd-c.open { background: none; box-shadow: inset 0 0 0 2px var(--open-ring); }
.sd-c.today { outline: 2px solid var(--accent); outline-offset: 2px; }
.sd-c.future { opacity: .35; }
.sd-side { display: flex; flex-direction: column; gap: 2px; min-width: 90px; }
.sd-num { display: flex; align-items: center; gap: 8px; }
.sd-num b { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1.1; }
.sd-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.sd-ring { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--open-ring); display: inline-block; margin-right: 6px; }
.sd-open { margin-top: 12px; font-size: 13px; color: var(--soft); display: flex; align-items: center; }
.s-sealed .s-link { font-size: 13px; }

.s-rank .rk-top { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.rk-rings circle { fill: none; stroke: var(--seg-off); stroke-width: 2.2; }
.rk-rings circle.on { stroke: var(--accent); }
.rk-name { font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1.15; }
.rk-line { font-style: italic; font-size: 14px; color: var(--soft); }
.rk-bar { height: 8px; border-radius: 99px; background: var(--seg-off); margin-bottom: 8px; overflow: hidden; }
.rk-bar span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.s-start-steps .gs-meter { margin-bottom: 14px; height: 8px; }
.gs-next { display: flex; flex-direction: column; gap: 3px; margin-bottom: 14px; }
.gs-actions { display: flex; align-items: center; gap: 14px; }

.s-recap { position: relative; display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 28px; padding: 22px 28px 22px 32px; overflow: hidden; }
.s-recap::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 2px; background: var(--accent); }
.s-recap .rc-col + .rc-col { border-left: 1px solid var(--line); padding-left: 24px; }
.rc-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rc-kicker { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--accent-text); font-weight: 600; }
.rc-big { font-size: 16px; font-weight: 600; color: var(--soft); }
.rc-big b { font-family: var(--font-display); font-weight: 800; font-size: 30px; color: var(--text); }
.rc-mid { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 26px; }
.rc-delta { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-body); font-size: 12px; font-weight: 600; }
.rc-delta.up { color: var(--up-text); }
.rc-delta.down { color: var(--down-text); }
.rc-text { font-size: 15px; font-weight: 600; }
.rc-meter { height: 8px; gap: 2px; margin: 4px 0; }

.s-list { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 12px; }
.s-list .s-card-head { margin-bottom: 4px; }
.bl-all { font-size: 14px; font-weight: 600; }
.bl-cont { border-radius: 20px; padding: 20px; background: var(--lamp), var(--hero); border: 1px solid var(--hero-edge); display: flex; flex-direction: column; gap: 10px; }
.blc-kicker { font-size: 13px; font-weight: 600; color: var(--accent-text); }
.blc-title { display: flex; align-items: center; gap: 12px; }
.blc-title b { font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1.1; letter-spacing: -.01em; }
.chip { font-family: var(--font-mono); font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap; }
.blc-sub { font-size: 13px; color: var(--hero-muted); }
.mini-chart { height: 84px; border-radius: 10px; background: color-mix(in srgb, var(--bg) 60%, transparent); overflow: hidden; }
.mini-chart svg { width: 100%; height: 100%; display: block; }
.mini-chart line.up { stroke: var(--green); stroke-width: 1; }
.mini-chart rect.up { fill: var(--green); }
.mini-chart line.down { stroke: var(--red); stroke-width: 1; }
.mini-chart rect.down { fill: var(--red); }
.mini-chart line.cur { stroke: var(--accent); stroke-width: 2; }
.blc-mrow { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--soft); margin-bottom: 6px; }
.blc-mrow .mono { font-weight: 600; color: var(--text); }
.blc-two { display: grid; grid-template-columns: 1fr 120px; gap: 20px; }
.sand-bar { height: 6px; border-radius: 99px; background: var(--seg-off); overflow: hidden; }
.sand-bar span { display: block; height: 100%; background: var(--sand); }
.day-pips { display: flex; gap: 4px; }
.day-pips i { flex: 1; height: 8px; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--dim); }
.day-pips i.on { background: var(--accent); box-shadow: none; }
.blc-go { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.blc-play { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 14%, transparent); }
.blc-play .icw { margin-left: 3px; }
.blc-play:hover { background: var(--accent-hover); }
.blc-go-t { display: flex; flex-direction: column; gap: 2px; }
.blc-go-t b { font-size: 15px; font-weight: 600; }
.blc-go-t span { font-size: 12px; color: var(--hero-muted); }
.blc-status { margin-left: auto; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }
.blc-status.passed { background: var(--up-soft); color: var(--up-text); }
.blc-status.failed { background: var(--down-soft); color: var(--down-text); }
.bl-rows { display: flex; flex-direction: column; gap: 6px; }
.bl-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto 32px; align-items: center; gap: 12px; min-height: 60px; padding: 8px 8px 8px 10px; border-radius: 14px; cursor: pointer; transition: background-color .12s; }
.bl-row:hover, .bl-row:focus-visible { background: var(--panel2); outline: none; }
.sym-chip { font-family: var(--font-mono); font-size: 11px; font-weight: 600; padding: 5px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sym-chip.fx { background: var(--up-soft); color: var(--up-text); }
.bl-name { display: flex; flex-direction: column; min-width: 0; }
.bl-name b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bl-name span { font-size: 12px; color: var(--dim); }
.bl-ring { display: flex; align-items: center; gap: 8px; }
.bl-prog { font-family: var(--font-mono); font-size: 12px; color: var(--soft); white-space: nowrap; }
.bl-prog.passed { color: var(--up-text); }
.bl-prog.failed { color: var(--down-text); }
.bl-more { width: 32px; height: 32px; border-radius: 50%; border: 0; background: none; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.bl-more:hover { background: var(--panel); color: var(--text); }
.bl-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--dim); padding-top: 8px; }

/* ---------- Quest Home ---------- */
.q-home { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; padding: 24px 28px 36px; width: 100%; max-width: 1680px; margin: 0 auto; }
.q-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; box-shadow: 0 4px 0 var(--lipc); min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.q-hero { grid-column: span 8; } .q-quests { grid-column: span 4; }
.q-resume, .q-run, .q-steps, .q-level { grid-column: span 4; }
.q-list { grid-column: span 8; } .q-tip { grid-column: span 4; }
.q-head { display: flex; align-items: center; gap: 10px; }
.q-head h2 { font-family: var(--font-display); font-weight: 700; font-size: 17px; margin: 0; letter-spacing: -.01em; }
.q-count { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 8px; background: var(--panel2); color: var(--muted); }
.q-chip { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-hi); white-space: nowrap; }
.q-eyebrow { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.q-muted { color: var(--muted); }
.q-faint { color: var(--dim); }
.q-link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-hi); font-weight: 700; font-size: 14px; text-decoration: none; }
.q-sep { height: 1px; background: var(--line); margin: 4px 0; }
.q-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 2px solid var(--line2); background: var(--panel2); color: var(--text);
  font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 3px 0 var(--lipc); transition: transform .08s, box-shadow .08s, background-color .12s; white-space: nowrap; }
.q-btn:hover { background: color-mix(in srgb, var(--panel2) 80%, var(--accent)); }
.q-btn:active { transform: translateY(3px); box-shadow: none; }
.q-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 0 var(--accent-lip); }
.q-btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text-hi)); }
.q-btn.big { height: 56px; min-width: 260px; font-size: 16px; font-weight: 800; }
.q-btn:disabled { opacity: .55; cursor: default; }
.xp-pill { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; border: 1.5px solid var(--accent-hi); color: var(--accent-hi); font-size: 12px; font-weight: 800; white-space: nowrap; }
.xp-pill.got { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.hex-tile, .hex-badge { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); }
.hex-tile { width: 40px; height: 44px; background: var(--accent-soft); color: var(--accent-hi); }
.hex-badge { width: 40px; height: 44px; background: var(--accent); color: var(--accent-ink); }

.q-hero { display: grid; grid-template-columns: minmax(0, 1fr) 1px minmax(240px, 300px); gap: 28px; padding: 30px 32px; border-radius: 22px; position: relative; overflow: hidden;
  background: radial-gradient(420px 260px at 92% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), var(--panel); }
.q-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48.5' height='28'%3E%3Cpath d='M0 14 8.08 0h16.17l8.08 14-8.08 14H8.08z' fill='none' stroke='%23ffffff' stroke-opacity='.05'/%3E%3C/svg%3E");
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse at 70% 30%, #000 20%, transparent 75%); }
.qh-l, .qh-r { position: relative; z-index: 1; }
.qh-l { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.q-hello { font-size: 15px; font-weight: 600; color: var(--muted); }
.q-title { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
.q-sub { font-size: 14px; color: var(--muted); margin: 0; }
.q-hero .mk-seg { gap: 8px; }
.q-hero .mk { height: 38px; padding: 0 16px; border-radius: 12px; border: 2px solid var(--line2); background: var(--panel2); color: var(--soft); font-size: 13px; font-weight: 700; }
.q-hero .mk.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.qh-go { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.q-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--dim); flex-wrap: wrap; }
.qh-div { border-left: 1px dashed var(--line); position: relative; z-index: 1; }
.qh-r { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.qh-streak { display: flex; align-items: center; gap: 12px; }
.qh-flame { display: flex; }
.qh-big { font-family: var(--font-display); font-weight: 800; font-size: 72px; line-height: 1; }
.qh-unit { font-size: 14px; font-weight: 700; text-align: left; line-height: 1.25; color: var(--soft); }
.qh-dots { display: flex; align-items: flex-start; gap: 10px; }
.qh-dot { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.qd-in { width: 28px; height: 28px; border-radius: 50%; background: var(--seg-off); color: var(--bg); display: flex; align-items: center; justify-content: center; }
.qh-dot.done .qd-in { background: var(--flame); box-shadow: 0 3px 0 color-mix(in srgb, var(--flame) 50%, var(--bg)); }
.qh-dot.today:not(.done) .qd-in { background: none; box-shadow: inset 0 0 0 2px var(--flame); outline: 2px dashed var(--flame); outline-offset: -2px; box-shadow: none; }
.qd-l { font-size: 11px; font-weight: 700; color: var(--dim); }
.qh-dot.today .qd-l { color: var(--flame); }
.qh-moon { color: var(--dim); height: 28px; display: flex; align-items: center; }

.qq-row { display: flex; align-items: center; gap: 14px; min-height: 60px; }
.qq-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.qq-t b { font-size: 14px; font-weight: 700; }
.qq-row.done .qq-t b { color: var(--muted); }
.qq-pips { display: flex; gap: 4px; }
.qq-pips i { width: 22px; height: 6px; border-radius: 3px; background: var(--seg-off); }
.qq-pips i.on { background: var(--accent); }
.qq-row.done .hex-tile { background: var(--accent); color: var(--accent-ink); }
.qq-foot { margin-top: auto; }

.qr-top { display: flex; gap: 14px; justify-content: space-between; }
.qr-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.25; margin: 4px 0 2px; }
.qr-chart { width: 120px; flex-shrink: 0; }
.qr-chart .mini-chart { height: 60px; border: 1px solid var(--line); }
.qr-days { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.qr-days .mtr { flex: 1; height: 8px; gap: 2px; }
.qr-days .mtr i { border-radius: 2px; }
.qr-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.qm-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.q-bar { height: 16px; border-radius: 99px; background: var(--seg-off); overflow: hidden; }
.q-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-hi)); box-shadow: inset -3px 0 0 color-mix(in srgb, var(--text-hi) 70%, var(--accent-hi)); }
.q-bar.thin { height: 8px; margin-top: 8px; }
.q-bar.thin span { box-shadow: none; }
.qm-two .mtr { height: 10px; gap: 2px; }
.hex-pips { display: flex; align-items: center; gap: 6px; }
.hex-pips i, .hex-row i { width: 14px; height: 16px; background: var(--seg-off); clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); }
.hex-pips i.on, .hex-row i.on { background: var(--accent); }
.hex-pips .q-muted { margin-left: 6px; }
.q-steps .mtr { height: 10px; }
.qs-next { display: flex; gap: 12px; align-items: center; }
.q-run.empty p { margin: 0; font-size: 14px; }

.ql-top { display: flex; align-items: center; gap: 16px; }
.ql-name { font-family: var(--font-display); font-weight: 700; font-size: 22px; }
.ql-bottom { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.ql-badges { display: flex; gap: 8px; margin-top: 8px; }
.ql-next b { font-size: 14px; }

.q-list .bl-row { min-height: 48px; grid-template-columns: 76px minmax(0, 1fr) auto 32px; border-radius: 12px; }
.q-list .sym-chip { border-radius: 8px; background: transparent; border: 2px solid var(--line2); color: var(--soft); }
.q-list .bl-name { flex-direction: row; align-items: baseline; gap: 10px; }
.q-list .bl-name span { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-hi); white-space: nowrap; }
.q-list .pring .pr-on { stroke: var(--accent-hi); }
.qt-text { font-size: 16px; line-height: 1.5; margin: 0; }
.qt-text b { color: var(--up-text); }
.hex-row { display: flex; gap: 5px; flex-wrap: wrap; }
.q-tip .q-eyebrow { color: var(--accent-hi); }
.q-recap { display: flex; align-items: center; gap: 12px; }
.q-recap .q-tile, .q-recap > .q-tile { width: 40px; height: 40px; border-radius: 12px; background: var(--panel2); display: flex; align-items: center; justify-content: center; color: var(--accent-hi); flex-shrink: 0; }

/* narrower windows */
@media (max-width: 1680px) { .appbar.studio .ab-saved { font-size: 0; gap: 0; } } /* just its icon (the tooltip says it) */
@media (max-width: 1440px) { .appbar.studio .ab-saved { display: none; } } /* laptops: the gear and help stay inside */
@media (max-width: 1280px) {
  .s-home { grid-template-columns: minmax(0, 1fr); padding: 12px 24px 32px; }
  .s-list { position: static; }
  .appbar.studio { padding: 0 24px; gap: 14px; }
  .appbar.studio .ab-saved { display: none; }
  .q-hero, .q-list { grid-column: span 12; } .q-quests, .q-tip { grid-column: span 6; }
  .q-resume, .q-run, .q-steps { grid-column: span 6; } .q-level { grid-column: span 12; }
}
@media (max-width: 900px) {
  .s-hero { grid-template-columns: 1fr; } .s-hero-div { display: none; }
  .s-row, .s-recap { grid-template-columns: 1fr; }
  .s-recap .rc-col + .rc-col { border-left: 0; padding-left: 0; }
  .q-hero { grid-template-columns: 1fr; } .qh-div { display: none; }
  .q-quests, .q-tip, .q-resume, .q-run, .q-steps { grid-column: span 12; }
}
@media (prefers-reduced-motion: reduce) { .q-btn, .drb-disc, .day-ring .arc { transition: none; } }

/* Top bars on narrower windows (0.19.1): never wider than the window, down to its smallest size (960 px). The least
   important words go first (a rank's name, then "New backtest" becomes a plain +), the tabs and gaps tighten, and the
   tab list scrolls as the last resort (it gives way before anything else). Nebula, Clarity and Dojo have their steps in
   their own files, the Charts bar in live.css. */
.appbar .ab-nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.appbar .ab-nav::-webkit-scrollbar { display: none; }
@media (max-width: 1360px) { .appbar .ab-rank { font-size: 0; gap: 0; } } /* the picture and the tooltip say the rank */
@media (max-width: 1400px) { .ab-crest-t { display: none; } } /* Quest: the crest alone (its tooltip has the level and XP) */
@media (max-width: 1200px) { .appbar.quest .ab-streak { display: none; } } /* the streak is on Home */
@media (max-width: 1240px) {
  .appbar.studio .ab-tab { padding: 0 11px; }
  .appbar.quest { padding: 0 20px; gap: 14px; }
  .appbar.quest .ab-nav { margin-left: 4px; }
  .appbar.quest .ab-tab { padding: 0 9px; }
}
@media (max-width: 1140px) {
  .appbar.studio { padding: 0 16px; gap: 10px; }
  .appbar.studio .ab-right, .appbar.quest .ab-right { gap: 8px; }
  .appbar.quest { padding: 0 14px; gap: 10px; }
}
@media (max-width: 1080px) { /* Quest: only the open page keeps its name, the others are their icons (and tooltips) */
  .appbar.quest .ab-tab:not(.on) .ab-tab-l, .appbar.quest .ab-tab:not(.on) .pro-tag { display: none; }
  .appbar.quest .ab-tab:not(.on) { padding: 0 8px; gap: 0; }
}
@media (max-width: 1020px) { .appbar.studio { padding: 0 12px; gap: 8px; } .appbar.studio .ab-tab { padding: 0 8px; } }

/* ---------- the replay screen (Studio and Quest) ---------- */
.ws.styled { background: var(--bg); }
.ws.styled .grow { flex: 1; }
.wt-top { display: flex; align-items: center; gap: 12px; flex-shrink: 0; min-width: 0; }
.wt-top .logo-svg svg { width: 26px; height: 26px; display: block; }
.wt-title { min-width: 0; max-width: 300px; display: flex; flex-direction: column; }
.wt-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wt-name .ws-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.wt-chip { font-family: var(--font-mono); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap; }
.wt-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wt-tabs { display: flex; gap: 2px; flex-shrink: 0; }
.wt-tabs .tab { display: flex; align-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.wt-clock { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; color: var(--soft); white-space: nowrap; flex-shrink: 0; }
.wt-clock .replay-time { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.wt-clock .replay-time b { font-weight: 500; }
.wt-clock .replay-time .clock { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--text); }
.wt-clock .tz-sel { background: none; border: 0; color: var(--dim); font-size: 11px; padding: 0; width: auto; max-width: 118px; cursor: pointer; }
.ws.styled .mode-badge, .ws.styled .blind-badge { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 999px; border: 0; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 600; cursor: default; }
.ws.styled .blind-badge { cursor: pointer; }
.mchips { display: flex; align-items: stretch; flex-shrink: 0; }
.mchip { display: flex; flex-direction: column; justify-content: center; padding: 0 12px; line-height: 1.2; font-size: 11px; color: var(--muted); white-space: nowrap; }
.mchip b { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--text); }
.mchip b.pos { color: var(--up-text); } .mchip b.neg { color: var(--down-text); }
.mchip[hidden] { display: none; }
.wt-top .help-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line2); background: transparent; color: var(--soft); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; flex-shrink: 0; }
.ws.styled .ws-body { gap: 16px; min-height: 0; }
.ws.styled .charts { flex: 1; min-width: 0; }
.ws.styled .tool { display: flex; align-items: center; justify-content: center; }
.ws.styled .toolbox { scrollbar-width: none; overflow-y: auto; overflow-x: hidden; }
.ws.styled .toolbox::-webkit-scrollbar { display: none; }
.cc-head { display: flex; align-items: center; gap: 8px; flex-shrink: 0; min-width: 0; }
.cc-sym { font-size: 14px; font-weight: 600; margin-right: 4px; }
.ws.styled .ctl { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.ws.styled .ctl:disabled { opacity: .38; cursor: not-allowed; }
.ws.styled .skip { gap: 4px; }
.speed-seg { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.spd { border: 0; background: none; color: var(--muted); font-family: var(--font-mono); font-size: 12px; cursor: pointer; }
.spd-more { border: 0; background: none; color: var(--muted); width: 42px; padding: 0 2px; font-family: var(--font-mono); font-size: 12px; cursor: pointer; }
.spd-more.on { color: var(--accent-text); }
/* the day line (0.17.0): a small slider in the chart's bar, after ETH+RTH and before Focus, in every look (Workspace.build). The
   slot takes the room the bar has left (never more, so it never makes a bar wrap or grow); the whole bar height is the click
   target. --dl-ring = the bar's own background, the halo around the thumb and the dots. */
.dl-slot { flex: 1 1 0; min-width: 0; align-self: stretch; display: flex; align-items: stretch; margin: 0 8px; container: dl / inline-size; --dl-ring: var(--chrome); }
@container dl (max-width: 99px) { .dl-slot .day-line { display: none; } }
.day-line { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; cursor: pointer; padding: 0 6px; }
.day-line.back-off { cursor: not-allowed; }
.dl-track { position: relative; height: 3px; border-radius: 99px; background: var(--seg-off); }
.dl-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: color-mix(in srgb, var(--accent) 45%, var(--seg-off)); }
.dl-thumb { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--dl-ring, var(--panel)); }
.dl-mark { position: absolute; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--dim); box-shadow: 0 0 0 1.5px var(--dl-ring, var(--panel)); }
.dl-mark.win { background: var(--green); } .dl-mark.loss { background: var(--red); }
.dl-ticks { position: relative; height: 11px; font-family: var(--font-mono); font-size: 9.5px; line-height: 11px; color: var(--dim); }
/* hovering: what a click does ("Jump to 10:42") takes the place of the session names under the line, inside the bar */
.day-line:hover .dl-ticks { opacity: 0; }
.dl-hover { position: absolute; top: 5px; transform: translateX(-50%); z-index: 4; white-space: nowrap; pointer-events: none; padding: 2px 8px; border-radius: 999px;
  background: var(--panel2); border: 1px solid var(--line2); color: var(--text); font: 600 11px var(--font-mono); box-shadow: 0 6px 18px color-mix(in srgb, var(--bg) 55%, transparent); }
.dl-hover.off { color: var(--muted); font-family: var(--font-body); }
/* the bars that hold it sit above the chart, so the hover pill and a session's callout can drop onto it */
.chart-card .cc-head, .ws-toolbar { position: relative; z-index: 5; }
.dl-tick { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.dl-tick:first-child { transform: none; }
.ws.styled .ch-bar { flex: 0 0 auto; white-space: nowrap; overflow: hidden; }
.ws.styled .ch-meter { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 10px; row-gap: 6px; border: 0; background: none; padding: 0; cursor: pointer; min-width: 0; text-align: left; }
.ws.styled .ch-meter:hover { background: none; }
.ws.styled .ch-meter b { font-family: var(--font-mono); }
.ws.styled .ch-track { position: static; grid-column: 1 / -1; background: var(--seg-off); border-radius: 3px; }
.ws.styled .ch-fill { background: var(--accent); }
.ws.styled .ch-meter.ok .ch-fill { background: var(--green); }
.ws.styled .ch-meter.warn .ch-fill { background: repeating-linear-gradient(45deg, var(--warn) 0 6px, color-mix(in srgb, var(--warn) 65%, var(--bg)) 6px 12px); }
.ws.styled .ch-meter.bad .ch-fill { background: var(--red); }
.ws.styled .ch-meter[data-k="target"] { flex: 2 1 0; }
.ws.styled .ch-meter[data-k="maxLoss"], .ws.styled .ch-meter[data-k="day"] { flex: 1 1 0; }
.ws.styled .ch-name { flex: 0 0 auto; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; max-width: 280px; }
.ws.styled .side { border-left: 0; min-height: 0; }
.ws.styled .stabs { border-bottom: 0; flex-shrink: 0; }
.ws.styled .stab { border-bottom: 0; display: flex; align-items: center; justify-content: center; }
.ws.styled .side-body { gap: 12px; }
.ws.styled .ticket { gap: 10px; }
.ws.styled .ticket input, .ws.styled .ticket select { height: 36px; border-radius: 10px; }
.ws.styled .side-btn { height: 52px; font-size: 16px; }
.ws.styled .place { height: 52px; font-size: 15px; }
.ws.styled .ticket-summary { border-radius: 14px; padding: 10px 12px; }
.ws.styled .bottom-head { min-height: 44px; font-size: 13px; padding: 4px 10px 4px 16px; }
.ws.styled .bottom-toggle { width: 32px; height: 32px; border-radius: 50%; }

/* Studio: a chart card with its own header and the video-player bar under it; the panels are cards */
.wt-top.studio { height: 56px; padding: 0 14px; }
.wt-back { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line2); background: transparent; color: var(--soft); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; flex-shrink: 0; }
.wt-back:hover, .wt-top .help-btn:hover { background: var(--panel2); color: var(--text); }
.wt-top.studio .wt-tabs { height: 40px; padding: 4px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.wt-top.studio .wt-tabs .tab { height: 30px; padding: 0 14px; border-radius: 999px; font-weight: 500; }
.wt-top.studio .wt-tabs .tab.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.wt-top.studio .wt-clock { border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.wt-top.studio .mchips { height: 40px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); padding: 0 4px; }
.wt-top.studio .mchip + .mchip { border-left: 1px solid var(--line); }
.ws.styled.studio .ch-bar { display: flex; align-items: center; gap: 24px; margin: 0 12px 10px; min-height: 48px; padding: 0 16px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; }
.ws.styled.studio .ch-meter { color: var(--muted); font-size: 12px; }
.ws.styled.studio .ch-meter b { font-size: 13px; }
.ws.styled.studio .ch-track { height: 10px; -webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(3.333% - 3px), transparent calc(3.333% - 3px) 3.333%); mask: repeating-linear-gradient(90deg, #000 0 calc(3.333% - 3px), transparent calc(3.333% - 3px) 3.333%); }
.ws.styled.studio .ch-meter:not([data-k="target"]) .ch-track { height: 8px; -webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(5% - 3px), transparent calc(5% - 3px) 5%); mask: repeating-linear-gradient(90deg, #000 0 calc(5% - 3px), transparent calc(5% - 3px) 5%); }
.ws.styled.studio .ch-meter:not([data-k="target"]):not(.warn):not(.bad) .ch-fill { background: var(--sand); }
.ws.styled.studio .ws-body { padding: 0 12px 12px; gap: 12px; }
.ws.styled.studio .s-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.chart-card { flex: 1; min-height: 0; display: flex; flex-direction: column; border-radius: 24px; background: var(--chrome); border: 1px solid var(--line); overflow: hidden; }
.ws.styled.studio .cc-head { height: 46px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); }
.ws.styled.studio .cc-head .tf-group { background: var(--bg); border-radius: 999px; padding: 3px; }
.ws.styled.studio .cc-head .tf { height: 28px; min-width: 38px; border-radius: 999px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; }
.ws.styled.studio .cc-head .tf.active { background: var(--accent); color: var(--accent-ink); }
.ws.styled.studio .cc-head .ctl { height: 32px; padding: 0 12px; border-radius: 999px; background: transparent; border: 1px solid var(--line2); color: var(--soft); font-size: 13px; }
.ws.styled.studio .cc-head .ctl:hover { background: var(--panel2); }
.ws.styled.studio .cc-head .ctl.on { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-text); }
.cc-main { flex: 1; min-height: 0; display: flex; }
.ws.styled.studio .toolbox { width: 44px; margin: 8px 0 8px 8px; padding: 6px 0; gap: 3px; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); }
.ws.styled.studio .tool { width: 34px; height: 34px; border-radius: 50%; }
.ws.styled.studio .tool.active { background: var(--accent); color: var(--accent-ink); }
.ws.styled.studio .tool-list { gap: 4px; }
.transport { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.transport.studio { min-height: 64px; padding: 5px 12px; border-top: 1px solid var(--line); }
.transport.studio .ctl { height: 38px; padding: 0 14px; border-radius: 999px; background: var(--panel2); border: 0; color: var(--soft); font-size: 13px; font-weight: 600; }
.transport.studio .ctl:hover:not(:disabled) { background: color-mix(in srgb, var(--panel2) 80%, var(--accent)); color: var(--text); }
.transport.studio .ctl.big-play, .transport.studio .ctl.big-play.on { width: 54px; height: 54px; padding: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent), 0 8px 24px color-mix(in srgb, var(--accent) 26%, transparent); margin: 0 4px; }
.transport.studio .ctl.big-play:hover { background: var(--accent-hover); }
.transport.studio .ctl.big-play .icw { margin-left: 3px; }
.transport.studio .ctl.big-play.on .icw { margin-left: 0; }
.transport.studio .skip-n { width: 46px; height: 32px; border-radius: 999px; text-align: center; background: var(--bg); border-color: var(--line); }
.transport.studio .speed-seg { background: var(--bg); border-radius: 999px; padding: 3px; }
.transport.studio .spd { height: 30px; min-width: 38px; border-radius: 999px; }
.transport.studio .spd.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.ws.styled.studio .side { width: 340px; border-radius: 24px; border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.ws.styled.studio .stabs { margin: 10px 10px 4px; height: 42px; padding: 4px; border-radius: 999px; background: var(--bg); gap: 2px; }
.ws.styled.studio .stab { border-radius: 999px; font-size: 14px; }
.ws.styled.studio .stab.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.ws.styled.studio .side-body { padding: 6px 12px 12px; }
.ws.styled.studio .side-btn { border-radius: 16px; border: 0; }
.ws.styled.studio .side-btn.buy { background: var(--up-soft); color: var(--up-text); }
.ws.styled.studio .side-btn.sell { background: var(--down-soft); color: var(--down-text); }
.ws.styled.studio .side-btn.buy.active, .ws.styled.studio .side-btn.buy:hover { background: var(--buy-bg); color: var(--buy-ink); }
.ws.styled.studio .side-btn.sell.active, .ws.styled.studio .side-btn.sell:hover { background: var(--sell-bg); color: var(--sell-ink); }
.ws.styled.studio .ticket .segs { border-radius: 999px; padding: 3px; }
.ws.styled.studio .ticket .segs .seg { border-radius: 999px; padding: 7px; }
.ws.styled.studio .place { border-radius: 16px; }
.ws.styled.studio .bottom { border-radius: 18px; border: 1px solid var(--line); overflow: hidden; }
.ws.styled.studio .bottom-head { min-height: 40px; padding: 2px 10px 2px 14px; }

/* Quest: the run HUD under the bar, tools on the left, the controls above the chart, chunky pressable buttons */
.wt-top.quest { height: 52px; padding: 0 16px; }
.wt-home { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 8px; border-radius: 12px; border: 0; background: none; color: var(--soft); font-weight: 700; font-size: 14px; cursor: pointer; flex-shrink: 0; }
.wt-home:hover { background: var(--panel); color: var(--text); }
.wt-top.quest .wt-name .ws-name { font-size: 15px; }
.wt-top.quest .wt-chip { font-family: var(--font-body); font-weight: 700; border-radius: 8px; background: var(--panel2); color: var(--muted); }
.wt-top.quest .wt-tabs { height: 36px; padding: 3px; border-radius: 12px; background: var(--panel); }
.wt-top.quest .wt-tabs .tab { height: 30px; padding: 0 12px; border-radius: 9px; font-size: 13px; font-weight: 700; }
.wt-top.quest .wt-tabs .tab.active { background: var(--panel2); color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }
.wt-top.quest .wt-clock .replay-time .clock { font-weight: 500; }
.wt-top.quest .mchips { gap: 6px; }
.wt-top.quest .mchip { flex-direction: row; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-size: 12px; }
.wt-top.quest .help-btn { width: 32px; height: 32px; border: 0; }
.wt-crest { display: flex; background: none; border: 0; padding: 2px; border-radius: 10px; cursor: pointer; }
.wt-crest:hover { background: var(--panel); }
.wt-rail { flex-shrink: 0; }
.wt-rail .mtr { height: 4px; gap: 2px; }
.wt-rail .mtr i { border-radius: 0; }
.ws.styled.quest .ch-bar { display: flex; align-items: center; gap: 20px; min-height: 68px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.ws.styled.quest .ch-meter { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ws.styled.quest .ch-meter b { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.ws.styled.quest .ch-meter[data-k="target"] .ch-track { height: 14px; border-radius: 99px; }
.ws.styled.quest .ch-meter[data-k="target"] .ch-fill { background: linear-gradient(90deg, var(--accent), var(--accent-hi)); border-radius: 99px; }
.ws.styled.quest .ch-meter:not([data-k="target"]) .ch-track { height: 10px; -webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(10% - 2px), transparent calc(10% - 2px) 10%); mask: repeating-linear-gradient(90deg, #000 0 calc(10% - 2px), transparent calc(10% - 2px) 10%); }
.ws.styled.quest .ch-meter:not([data-k="target"]):not(.warn):not(.bad) .ch-fill { background: var(--shield); }
.ws.styled.quest .ch-name { border-radius: 10px; background: var(--accent-soft); color: var(--accent-hi); font-weight: 800; }
.ws.styled.quest .ws-body { gap: 0; }
.ws.styled.quest .toolbox { width: 52px; padding: 8px 0; gap: 4px; border-right: 1px solid var(--line); background: var(--bg); }
.ws.styled.quest .tool { width: 40px; height: 40px; border-radius: 12px; }
.ws.styled.quest .tool.active { background: var(--accent-soft); color: var(--accent-hi); }
.q-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.q-transport { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 10px; background: var(--chrome); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; flex-shrink: 0; }
.q-transport .sep { width: 1px; align-self: stretch; margin: 6px 2px; background: var(--line); flex-shrink: 0; }
.q-transport .cc-head { gap: 6px; }
.q-transport .cc-sym { display: none; }
.q-transport .tf-group { background: var(--sunken); border-radius: 10px; padding: 3px; }
.q-transport .tf { height: 28px; min-width: 32px; border-radius: 8px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.q-transport .tf.active { background: var(--panel2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.q-transport .ctl { height: 34px; padding: 0 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--soft); font-size: 12.5px; font-weight: 700; box-shadow: 0 2px 0 var(--lipc); }
.q-transport .ctl:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.q-transport .ctl.on { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-text); }
.q-transport .ctl.big-play, .q-transport .ctl.big-play.on { width: 40px; height: 40px; padding: 0; border-radius: 50%; background: var(--accent); border: 0; color: var(--accent-ink); box-shadow: 0 3px 0 var(--accent-lip); }
.q-transport .ctl.big-play .icw { margin-left: 2px; }
.q-transport .ctl.big-play.on .icw { margin-left: 0; }
.q-transport .skip-n { width: 44px; height: 30px; border-radius: 8px; text-align: center; }
.q-transport .spd { height: 34px; min-width: 42px; border-radius: 10px; border: 2px solid var(--line2); color: var(--text); font-weight: 600; }
.q-chart { flex: 1; min-height: 0; display: flex; background: var(--chrome); }
.ws.styled.quest .side { width: 340px; border-left: 1px solid var(--line); background: var(--bg); }
.ws.styled.quest .stabs { margin: 12px; height: 40px; padding: 4px; border-radius: 12px; background: var(--panel); gap: 2px; }
.ws.styled.quest .stab { border-radius: 9px; font-weight: 700; }
.ws.styled.quest .stab.active { background: var(--panel2); color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }
.ws.styled.quest .side-body { padding: 4px 14px 14px; }
.ws.styled.quest .side-btn { border-radius: 12px; }
.ws.styled.quest .side-btn.buy { background: var(--buy-bg); border: 0; color: var(--buy-ink); box-shadow: 0 4px 0 color-mix(in srgb, var(--buy-bg) 55%, var(--bg)); }
.ws.styled.quest .side-btn.sell { background: transparent; border: 2px solid var(--sell-bg); color: var(--sell-bg); }
.ws.styled.quest .side-btn.sell.active, .ws.styled.quest .side-btn.sell:hover { background: var(--sell-bg); color: var(--sell-ink); }
.ws.styled.quest .side-btn.buy:not(.active) { opacity: .92; }
.ws.styled.quest .ticket .segs { border-radius: 12px; padding: 3px; }
.ws.styled.quest .ticket .segs .seg { border-radius: 9px; padding: 7px; font-weight: 700; }
.ws.styled.quest .place { border-radius: 14px; }
.ws.styled.quest .bottom { border-top: 1px solid var(--line); }

@media (max-width: 1400px) {
  .wt-top.studio .wt-sub, .wt-top .logo-svg { display: none; }
  .wt-top .mchip:nth-child(2) { display: none; } /* Equity (Balance and Today stay) */
  .wt-top .wt-title { min-width: 140px; }
  .transport.studio .ctl:not(.ny):not(.day):not(.jump) > span:not(.icw) { display: none; } /* the labels (Day, NY and Jump keep theirs); the icons stay */
  .transport.studio .ctl { padding: 0 11px; }
}
@media (max-width: 1180px) {
  .wt-top .tz-sel, .wt-top.quest .mchip:nth-child(2) { display: none; }
  .ws.styled.studio .side { width: 320px; }
}
/* A narrow window (the app opens down to 960 px): the backtest's name gives up room first (it ends in …),
   then Quest's "Home" keeps only its arrow and its chips put the label over the number, so ? and the crest stay in the bar. */
@media (max-width: 1280px) { .wt-top .wt-title { min-width: 72px; } }
@media (max-width: 1100px) {
  .wt-top.quest .wt-home-word { display: none; }
  .wt-top.quest .wt-home { padding: 0 8px; }
  .wt-top.quest .mchip { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; height: 36px; padding: 0 9px; font-size: 10.5px; line-height: 1.15; }
}
/* The journal in one column on a narrow window (app.css does this for Classic; the styled looks' own columns beat it) */
@media (max-width: 1000px) { .ws.styled .journal { grid-template-columns: minmax(0, 1fr); } .ws.styled .journal-left { position: static; } }
.ws.styled .toolbox > * { flex-shrink: 0; }
/* On a short window the list of favourite tools is what scrolls (mouse wheel), like in Classic. Before, the whole column scrolled and the
   ⋯ "All drawing tools" and ★ buttons went out of sight, so a click there hit the player bar instead. */
.ws.styled .toolbox > .tool-list { flex: 0 1 auto; min-height: 40px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.ws.styled .toolbox > .tool-list::-webkit-scrollbar { display: none; }
.ws.styled .toolbox > .tool-more, .ws.styled .toolbox > .fav-toggle { flex-shrink: 0; }
.ws.styled .ctl.icon-only { width: 34px; padding: 0; }
.day-line { container-type: inline-size; }
@container (max-width: 200px) { .dl-ticks { display: none; } }
.q-transport { flex-wrap: wrap; row-gap: 6px; }
.q-transport .cc-head .ctl > span:not(.icw) { display: none; }
.q-transport .cc-head .ctl { width: 34px; padding: 0; }
.q-transport .transport { margin: 0; }
/* Quest's day line: chunkier, in its own colours, between Jump and Focus (the session news stays a banner on the chart) */
.q-transport .dl-slot { margin: 0 4px 0 10px; }
.ws.styled.quest .dl-track { height: 5px; }
.ws.styled.quest .dl-fill { background: linear-gradient(90deg, var(--accent), var(--accent-hi)); }
.ws.styled.quest .dl-thumb { width: 12px; height: 12px; margin: -6px 0 0 -6px; background: var(--accent-hi); box-shadow: 0 0 0 2px var(--dl-ring), 0 2px 0 var(--accent-lip); }
.ws.styled.quest .dl-ticks { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.q-transport .cc-head .ctl.rth { width: auto; padding: 0 10px; }
.q-transport .transport .ctl { padding: 0 10px; }
.transport .ctl.jump, .transport .ctl.fwd { flex-direction: row-reverse; } /* Jump ⌃, Day ⏭, NY ⏱: the word first */
.q-transport { gap: 6px; }
.q-transport .tf { min-width: 28px; padding: 0 5px; }
.q-transport .transport { gap: 6px; }
.q-transport .transport .ctl { padding: 0 9px; }
.q-transport .skip-n { width: 40px; }

/* ---------- the journal (inside a backtest) ---------- */
.cal-seal { display: none; }
.ws.styled .journal { grid-template-columns: minmax(420px, 540px) minmax(0, 1fr); gap: 20px; padding: 16px 20px 28px; }
.ws.styled .journal-left { top: 12px; }
.ws.styled .cal { padding: 18px 20px; }
.ws.styled .cal-head { gap: 10px; margin-bottom: 14px; }
.ws.styled .cal-head b { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -.01em; }
.ws.styled .cal-head .icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line2); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.ws.styled .cal-grid { gap: 7px; }
.ws.styled .cal-dow { font-size: 12px; font-weight: 600; text-align: left; padding: 0 0 2px 4px; }
.ws.styled .cal-cell { position: relative; min-height: 74px; padding: 8px 9px; border-radius: 14px; background: transparent; border: 1px solid var(--line); color: var(--muted); font-size: 11px; gap: 2px; transition: background-color .12s; }
.ws.styled .cal-cell:not(.empty):hover { background: var(--panel2); }
.ws.styled .cal-cell.empty { border: 0; }
.ws.styled .cal-d { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text); }
.ws.styled .cal-pnl { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; }
/* a narrow day square shrinks its amount instead of cutting it off ("+$86…") */
.ws.styled .cal-cell { container-type: inline-size; }
.ws.styled .cal-cell .cal-pnl { font-size: clamp(8px, 19cqw, 11.5px); }
.ws.styled .cal-cell.win .cal-pnl { color: var(--up-text); }
.ws.styled .cal-cell.loss .cal-pnl { color: var(--down-text); }
.ws.styled .cal-cell.sel { outline: 2px solid var(--accent); outline-offset: -1px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.ws.styled .cal-seal { display: block; position: absolute; top: 9px; right: 9px; width: 15px; height: 15px; border-radius: 50%; }
.ws.styled .cal-seal.sealed { background: var(--accent); }
.ws.styled .cal-seal.sealed::after { content: ""; position: absolute; left: 5px; top: 2.5px; width: 3.5px; height: 7px; border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ws.styled .cal-seal.open { box-shadow: inset 0 0 0 2px var(--open-ring); }
.ws.styled .cal-weeks { margin-top: 12px; font-family: var(--font-mono); font-size: 11.5px; }
.ws.styled .day-list { padding: 12px 16px; }
.ws.styled .day-row { border-radius: 10px; border-bottom: 0; padding: 8px 8px; font-size: 13px; }
.ws.styled .day-detail { padding: 22px 24px; gap: 14px; }
.ws.styled .dd-head h2 { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: -.01em; margin: 0; }
.ws.styled .tile { border-radius: 14px; }
.ws.styled .tile-value { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
/* Analytics' tiles a little wider in these looks, so a five- or six-digit amount at this size stays inside its tile */
.ws.styled .an-body > .tiles { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
/* the day's four tiles need more room at this size (see app.css): two by two sooner */
.ws.styled .day-detail .dd-head .tiles.small { width: min(100%, 624px); }
@container dd (max-width: 623px) { .ws.styled .day-detail .dd-head .tiles.small { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ws.styled.quest .day-detail .dd-head .tiles.small { width: min(100%, 664px); } /* (Quest's heavier amounts) */
@container dd (max-width: 663px) { .ws.styled.quest .day-detail .dd-head .tiles.small { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ws.styled .day-detail .table tbody tr { transition: background-color .12s; }
.ws.styled .day-detail h4 { font-size: 11.5px; letter-spacing: .08em; }
/* Studio: soft cards, the day as the warm hero */
.ws.styled.studio .cal, .ws.styled.studio .day-list { border-radius: 24px; }
.ws.styled.studio .day-detail { border-radius: 24px; background: var(--lamp), var(--hero); border-color: var(--hero-edge); }
.ws.styled.studio .day-detail .tile { background: color-mix(in srgb, var(--bg) 45%, transparent); border-color: color-mix(in srgb, var(--accent-text) 12%, transparent); }
.ws.styled.studio .cal-cell.win { background: var(--up-soft); border-color: transparent; }
.ws.styled.studio .cal-cell.loss { background: var(--down-soft); border-color: transparent; }
/* Quest: chunky cards, hex seals */
.ws.styled.quest .cal, .ws.styled.quest .day-list, .ws.styled.quest .day-detail { border-radius: 18px; box-shadow: 0 4px 0 var(--lipc); }
.ws.styled.quest .cal-cell { border-radius: 12px; border-width: 2px; }
.ws.styled.quest .cal-cell.win { background: var(--up-soft); }
.ws.styled.quest .cal-cell.loss { background: var(--down-soft); }
.ws.styled.quest .cal-seal { border-radius: 0; width: 15px; height: 17px; clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); }
.ws.styled.quest .cal-seal.sealed::after { left: 5.5px; top: 3.5px; }
.ws.styled.quest .cal-seal.open { clip-path: none; border-radius: 50%; }
.ws.styled.quest .day-detail .tile { background: var(--panel2); border: 0; }
.ws.styled.quest .day-detail .tile-label { text-transform: uppercase; letter-spacing: .06em; font-weight: 800; font-size: 10.5px; }
.ws.styled.quest .dd-head h2 { font-weight: 700; font-size: 22px; }

/* ---------- the Daily challenge result as its own moment ---------- */
.moment-wrap .modal { background: none; border: 0; box-shadow: none; }
.moment-wrap .modal-head { display: none; }
.moment-wrap .modal-body { padding: 0; }
.dm { display: flex; flex-direction: column; gap: 16px; padding: 26px 28px; border-radius: 28px; color: var(--text); box-shadow: 0 30px 80px color-mix(in srgb, var(--bg) 80%, transparent); }
.dm .grow { flex: 1; }
.dm-head { display: flex; align-items: center; gap: 12px; }
.dm-head b { font-size: 15px; }
.dm-sub { font-size: 12px; color: var(--muted); }
.dm-x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line2); background: transparent; color: var(--soft); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.dm-x:hover { background: var(--panel2); color: var(--text); }
.dm-reveal { padding: 18px 26px; border-radius: 20px; }
.dm-was { font-size: 13px; color: var(--muted); }
.dm-date { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1.1; letter-spacing: -.02em; animation: dm-in .5s ease-out both; }
@keyframes dm-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dm-dots { display: flex; gap: 6px; }
.dm-dot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dm-dot i { width: 28px; height: 28px; border-radius: 9px; background: var(--seg-off); display: flex; align-items: center; justify-content: center; color: var(--accent-ink); }
.dm-dot.done i { background: var(--accent); }
.dm-dot small { font-size: 10.5px; font-weight: 600; color: var(--muted); }
.dm-dot.today small { color: var(--accent-text); }
.dm-trades { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--font-mono); font-size: 12px; color: var(--soft); }
.dm-trades span { display: inline-flex; align-items: center; gap: 5px; }
.dm-trades .icw { color: var(--accent); }
.dm-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dm-primary, .dm-second { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 24px; font-size: 16px; font-weight: 700; cursor: pointer; }
.dm-link { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--soft); font-weight: 600; font-size: 14px; cursor: pointer; padding: 6px; }
.dm-link:hover { color: var(--text); }
.dm-foot { text-align: center; font-size: 12px; color: var(--dim); }
.dm .up { color: var(--up-text); } .dm .down { color: var(--down-text); }
/* Studio: the warm card, the Day Ring, the streak */
.dm.studio { background: var(--lamp), var(--hero); border: 1px solid var(--hero-edge); }
.dm.studio .dm-trophy { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.dm.studio .dm-head b { color: var(--accent-text); }
.dm.studio .dm-line { font-size: 14px; color: var(--soft); }
.dm.studio .dm-reveal { background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid var(--line); }
.dm-grid { display: grid; grid-template-columns: 190px minmax(0, 1fr) 190px; gap: 16px; align-items: center; }
.dm-ringbox { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dm-ringwrap { position: relative; width: 150px; height: 150px; }
.dm-ring .arc { fill: none; stroke: var(--hero-edge); stroke-linecap: round; }
.dm-ring .arc.on { stroke: var(--accent); }
.dm-ringin { position: absolute; inset: 22px; border-radius: 50%; background: color-mix(in srgb, var(--bg) 55%, transparent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.dm-ringin b { font-family: var(--font-display); font-weight: 800; font-size: 26px; }
.dm-ringin span { font-size: 11.5px; color: var(--muted); }
.dm-legend { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
.dm-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dm-legend i { width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--dim); }
.dm-legend .on i { background: var(--accent); box-shadow: none; }
.dm-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dm-tile { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--bg) 50%, transparent); border: 1px solid var(--line); }
.dm-tile.good { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.dm-tl { font-size: 12px; color: var(--muted); }
.dm-tile b { font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1.1; }
.dm-ts { font-size: 12px; color: var(--soft); }
.dm-tile.good .dm-ts { color: var(--accent-text); font-weight: 600; }
.dm-streak { display: flex; flex-direction: column; gap: 8px; }
.dm-streak-top { display: flex; align-items: center; gap: 12px; }
.dm.studio .dm-flame { display: flex; }
.dm-streak-top b { font-family: var(--font-display); font-weight: 800; font-size: 56px; line-height: 1; }
.dm-streak-l { font-size: 15px; font-weight: 600; color: var(--soft); }
.dm.studio .dm-primary { border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent); }
.dm.studio .dm-primary:hover { background: var(--accent-hover); }
.dm.studio .dm-second { border-radius: 999px; background: transparent; border: 1px solid var(--line2); color: var(--text); }
.dm.studio .dm-second:hover { background: var(--panel2); }
/* Quest: the hex seal, rules kept, the streak and XP cards, chunky buttons */
.dm.quest { background: var(--panel); border: 1px solid var(--line); box-shadow: 0 5px 0 var(--lipc), 0 30px 80px color-mix(in srgb, var(--bg) 80%, transparent); }
.dm.quest .dm-chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-hi); font-weight: 800; font-size: 13px; }
.dm.quest .dm-sim { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 4px 10px; border-radius: 8px; border: 1.5px solid var(--line2); }
.dm.quest .dm-reveal { background: var(--panel2); border-top: 3px solid var(--accent); box-shadow: 0 4px 0 var(--lipc); }
.dm-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 210px; gap: 20px; align-items: center; }
.dm-row.two { grid-template-columns: 1fr 1fr; align-items: stretch; }
.dm-seal { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dm-hex { width: 96px; height: 106px; display: flex; align-items: center; justify-content: center; background: var(--panel2); color: var(--muted);
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); }
.dm-seal.on .dm-hex { background: linear-gradient(160deg, var(--accent-hi), var(--accent)); color: var(--accent-ink); animation: dm-pop .45s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes dm-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.dm-seal small { font-size: 13px; font-weight: 700; color: var(--accent-hi); }
.dm-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dm-big { font-family: var(--font-display); font-weight: 800; font-size: 44px; line-height: 1.1; }
.dm-big small { font-size: 18px; color: var(--muted); }
.dm-segs { display: flex; gap: 4px; margin: 6px 0; }
.dm-segs i { flex: 1; max-width: 30px; height: 8px; border-radius: 4px; background: var(--seg-off); }
.dm-segs i.on { background: var(--accent); }
.dm-list { display: flex; flex-direction: column; border-left: 1px dashed var(--line); padding-left: 18px; }
.dm-list > div { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.dm-list > div:last-child { border-bottom: 0; }
.dm-list small { display: block; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dm-list b { font-family: var(--font-display); font-size: 18px; }
.dm-card { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: 16px; background: var(--panel2); box-shadow: 0 4px 0 var(--lipc); }
.dm.quest .dm-flame { color: var(--flame); }
.dm.quest .dm-streak-top b { font-size: 48px; }
.dm.quest .dm-streak-l { font-size: 13px; line-height: 1.2; }
.dm.quest .dm-dot i { border-radius: 50%; }
.dm.quest .dm-dot.done i { background: var(--flame); }
.dm.quest .dm-dot.today small { color: var(--flame); }
.dm-xp { display: flex; flex-wrap: wrap; gap: 8px; }
.dm.quest .dm-primary { border: 0; border-radius: 14px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 0 var(--accent-lip); }
.dm.quest .dm-second { border-radius: 14px; background: var(--panel2); border: 2px solid var(--line2); color: var(--text); box-shadow: 0 3px 0 var(--lipc); }
.dm.quest .dm-primary:active, .dm.quest .dm-second:active { transform: translateY(3px); box-shadow: none; }
.dm.quest .dm-link { color: var(--accent-hi); }
@media (max-width: 800px) { .dm-grid, .dm-row { grid-template-columns: 1fr; } .dm-list { border-left: 0; padding-left: 0; } }
@media (prefers-reduced-motion: reduce) { .dm-date, .dm-seal.on .dm-hex { animation: none; } }

/* the streak flame (icons.js flame()) */
.flame { display: inline-flex; flex-shrink: 0; }
.flame svg { width: 100%; height: 100%; overflow: visible; }
.flame .f0 { stop-color: var(--red); } .flame .f1 { stop-color: var(--flame); } .flame .f2 { stop-color: var(--yellow); } .flame .f3 { stop-color: var(--text-hi); }
.flame.lit { filter: drop-shadow(0 4px 14px color-mix(in srgb, var(--flame) 45%, transparent)); }
.flame.lit svg { transform-origin: 50% 90%; animation: flicker 2.6s ease-in-out infinite; }
.flame.lit .core { transform-origin: 50% 95%; animation: flicker-core 1.7s ease-in-out infinite; }
.flame.out { filter: grayscale(1) opacity(.45); }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0deg); } 30% { transform: scale(1.03, .98) rotate(-1.5deg); } 60% { transform: scale(.98, 1.03) rotate(1deg); } }
@keyframes flicker-core { 0%, 100% { transform: scale(1); opacity: .95; } 50% { transform: scale(.9, 1.06); opacity: .8; } }
@media (prefers-reduced-motion: reduce) { .flame svg, .flame .core { animation: none !important; } }

/* buttons that were plain shapes before (streak days, quests, crest, rank chip) */
button.s-dot, button.qh-dot, button.qq-row, button.ab-crest { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
button.s-dot:hover .s-dot-in, button.qh-dot:hover .qd-in { transform: translateY(-2px); }
.s-dot-in, .qd-in { transition: transform .15s ease; }
button.qq-row { width: 100%; border-radius: 12px; padding: 4px 6px; margin: 0 -6px; transition: background-color .12s; }
button.qq-row:hover { background: var(--panel2); }
button.ab-crest { border-radius: 12px; padding: 2px 8px 2px 2px; }
button.ab-crest:hover { background: var(--panel); }
.ab-acct.static { cursor: pointer; } .ab-acct.static:hover { background: var(--panel2); }
.s-rank[role=button], .q-level[role=button] { cursor: pointer; transition: border-color .15s, transform .15s; }
.s-rank[role=button]:hover, .q-level[role=button]:hover { border-color: var(--accent-line); }
.day-pop { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; max-width: 280px; }
.day-pop b { font-family: var(--font-display); font-size: 15px; }
.day-pop p { margin: 0; color: var(--muted); font-size: 13px; }
.day-pop ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.day-pop li { display: flex; align-items: center; gap: 8px; } .day-pop li .icw { color: var(--accent); }

/* Your practice (Studio Home): squares like GitHub */
.hm-body { display: flex; gap: 24px; align-items: flex-start; container-type: inline-size; }
.hm-wrap { display: flex; flex-direction: column; gap: 6px; min-width: 0; --hm: clamp(8px, calc((100cqw - 180px) / 20 - 3px), 13px); }
.hm-months { display: grid; grid-template-columns: repeat(20, var(--hm, 13px)); gap: 3px; margin-left: 32px; font-size: 11px; color: var(--dim); height: 14px; white-space: nowrap; }
.hm-grid { display: flex; gap: 3px; }
.hm-rows { display: flex; flex-direction: column; gap: 3px; width: 29px; }
.hm-rows span { height: var(--hm, 13px); font-size: 10px; line-height: var(--hm, 13px); color: var(--dim); }
.hm-col { display: flex; flex-direction: column; gap: 3px; }
.hm-c { width: var(--hm, 13px); height: var(--hm, 13px); border-radius: 3px; border: 0; padding: 0; display: block; background: var(--seg-off); outline: 1px solid color-mix(in srgb, var(--text) 4%, transparent); outline-offset: -1px; cursor: pointer; transition: transform .12s; }
button.hm-c:hover { transform: scale(1.35); z-index: 1; position: relative; }
.hm-c.l1 { background: color-mix(in srgb, var(--accent) 28%, var(--seg-off)); }
.hm-c.l2 { background: color-mix(in srgb, var(--accent) 52%, var(--seg-off)); }
.hm-c.l3 { background: color-mix(in srgb, var(--accent) 76%, var(--seg-off)); }
.hm-c.l4 { background: var(--accent); }
.hm-c.today { outline: 2px solid var(--text); outline-offset: 1px; }
.hm-c.future { background: transparent; outline: 0; cursor: default; }
.hm-legend { display: flex; align-items: center; gap: 3px; margin: 6px 0 0 32px; font-size: 11px; color: var(--dim); }
.hm-legend .hm-c { cursor: default; } .hm-legend > i:first-of-type { margin-left: 4px; } .hm-legend > i:last-of-type { margin-right: 4px; }
.hm-side { display: flex; flex-direction: column; gap: 14px; min-width: 96px; padding-top: 18px; flex-shrink: 0; }
.hm-num { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1; }
.hm-num.small { font-size: 22px; }

/* Levels and ranks window */
.lv-wrap .modal { border-radius: 24px; }
.lv { display: flex; flex-direction: column; gap: 18px; }
.lv-top { display: flex; align-items: center; gap: 20px; padding: 18px 20px; border-radius: 18px; background: var(--lamp), var(--hero); border: 1px solid var(--hero-edge); }
.lv.quest .lv-top { background: radial-gradient(360px 200px at 90% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), var(--panel2); border: 0; box-shadow: 0 4px 0 var(--lipc); }
.lv-top-t { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.lv-kicker { font-size: 12px; font-weight: 700; color: var(--accent-text); text-transform: uppercase; letter-spacing: .06em; }
.lv.quest .lv-kicker { color: var(--accent-hi); }
.lv-name { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1.1; }
.lv-line { font-style: italic; color: var(--soft); }
.lv-sub { font-size: 12px; color: var(--muted); }
.lv-bar { height: 6px; border-radius: 99px; background: var(--seg-off); overflow: hidden; width: 100%; min-width: 80px; }
.lv-bar.big { height: 10px; margin-top: 8px; }
.lv-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-hi)); }
.lv-cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; }
.lv h4 { margin: 0 0 10px; }
.lv-ranks { display: flex; flex-direction: column; gap: 6px; }
.lv-rank { display: grid; grid-template-columns: 34px minmax(0, 1fr) 120px; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid transparent; color: var(--muted); }
.lv-rank b { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.lv-rank-t { display: flex; flex-direction: column; min-width: 0; font-size: 12px; }
.lv-rank-t span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-rank-r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 11.5px; }
.lv-rank-r .icw { color: var(--accent); }
.lv-rank.now { border-color: var(--accent); background: var(--accent-soft); color: var(--soft); }
.lv-rank:not(.done):not(.now) { opacity: .6; }
.lv-you { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.lv-earn { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; font-size: 13px; }
.lv-earn > div { display: flex; align-items: center; gap: 10px; }
.lv-earn .xp-pill { min-width: 48px; justify-content: center; }
.lv-lvls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.lv-lvl { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 12px; background: var(--panel2); font-size: 12px; color: var(--muted); }
.lv-lvl b { font-family: var(--font-mono); font-size: 11px; color: var(--text); }
.lv-ms { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lv-m { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 5px 6px; border-radius: 10px; }
.lv-m.done { color: var(--text); background: var(--accent-soft); }
.lv-m-mark { width: 34px; height: 30px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; border-radius: 8px; background: var(--seg-off); color: var(--muted); }
.lv.quest .lv-m-mark { clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); border-radius: 0; width: 30px; height: 32px; }
.lv-m.done .lv-m-mark { background: var(--accent); color: var(--accent-ink); }
.lv-note { margin: 0; font-size: 12px; color: var(--dim); text-align: center; }
.lv-emblem .rank-glyph circle, .lv-big-emblem .rank-glyph circle { stroke-width: 2.2; }
@media (max-width: 760px) { .lv-cols { grid-template-columns: 1fr; } }

/* pages fade in (on Home only below the top bar, which stays still from page to page) */
.home.styled > .home-body, .ws.styled { animation: page-in .28s ease-out both; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .home.styled > .home-body, .ws.styled { animation: none; } }
.greet-name, .greet-ask { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.greet-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.greet-ask { margin-left: 6px; font-weight: 500; opacity: .7; }
.greet-ask:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.hm-side { min-width: 116px; }
.hm-side .s-link { white-space: nowrap; }

/* Home comes alive: cards rise in one after another, meters and bars fill, big numbers count up (stylehome.js countUp) */
.s-main > *, .s-list, .q-home > .q-card { animation: card-in .5s cubic-bezier(.2, .8, .2, 1) both; }
.s-main > :nth-child(2) { animation-delay: .06s; } .s-main > :nth-child(3) { animation-delay: .12s; } .s-list { animation-delay: .08s; }
.q-home > .q-card:nth-child(2) { animation-delay: .05s; } .q-home > .q-card:nth-child(3) { animation-delay: .1s; } .q-home > .q-card:nth-child(4) { animation-delay: .13s; }
.q-home > .q-card:nth-child(5) { animation-delay: .16s; } .q-home > .q-card:nth-child(6) { animation-delay: .19s; } .q-home > .q-card:nth-child(7) { animation-delay: .22s; }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.mtr i.on { animation: seg-in .32s ease-out both; animation-delay: calc(var(--i, 0) * 16ms + .2s); }
@keyframes seg-in { from { background: var(--seg-off); transform: scaleY(.5); } to { transform: none; } }
.rk-bar span, .q-bar span, .lv-bar i, .sand-bar span, .ms-bar span { animation: bar-in .9s cubic-bezier(.2, .8, .2, 1) .15s both; }
@keyframes bar-in { from { width: 0; } }
.day-ring .arc.on { stroke-dasharray: 200; animation: arc-in .8s ease-out .2s both; }
@keyframes arc-in { from { stroke-dashoffset: 200; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .s-main > *, .s-list, .q-home > .q-card, .mtr i.on, .rk-bar span, .q-bar span, .lv-bar i, .sand-bar span, .day-ring .arc.on { animation: none !important; } }

/* ---------- the trade panel, like the designs ---------- */
/* rules checklist: a card, "setup · 3 of 4", a segmented bar, one row per rule with a tick that draws its check */
:root:is([data-style="studio"], [data-style="nebula"], [data-style="clarity"], [data-style="dojo"]) .rules-check.styled, :root[data-style="quest"] .rules-check.styled { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 18px; background: var(--panel2); border: 1px solid var(--line); }
.rules-check.styled .rules-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rules-check.styled .rules-head b { font-size: 15px; font-weight: 600; }
.rules-check.styled .rules-count { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.rules-check.styled .rules-bar { display: flex; gap: 4px; height: 6px; margin: 2px 0 4px; }
.rules-check.styled .rules-bar span { flex: 1; border-radius: 3px; background: var(--seg-off); transition: background-color .25s; }
.rules-check.styled .rules-bar span.on { background: var(--accent); }
.rules-check.styled.complete .rules-count { color: var(--accent-text); }
:root:is([data-style="studio"], [data-style="nebula"], [data-style="clarity"], [data-style="dojo"]) .rule-row, :root[data-style="quest"] .rule-row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 13.5px; transition: border-color .15s, background-color .15s; }
:root:is([data-style="studio"], [data-style="nebula"], [data-style="clarity"], [data-style="dojo"]) .rule-row:hover, :root[data-style="quest"] .rule-row:hover { border-color: var(--line2); }
:root:is([data-style="studio"], [data-style="nebula"], [data-style="clarity"], [data-style="dojo"]) .rule-row input, :root[data-style="quest"] .rule-row input { position: absolute; opacity: 0; pointer-events: none; }
:root:is([data-style="studio"], [data-style="nebula"], [data-style="clarity"], [data-style="dojo"]) .rule-row .tick, :root[data-style="quest"] .rule-row .tick { display: flex; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; border: 2px dashed var(--line2); align-items: center; justify-content: center;
  color: var(--accent-ink); transition: background-color .18s, border-color .18s, transform .18s cubic-bezier(.2, 1.6, .4, 1); }
.rule-row .tick svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 20; }
:root[data-style] .rule-row.on .tick { background: var(--accent); border: 2px solid var(--accent); transform: scale(1.06); }
.rule-row.on .tick svg { animation: tick-draw .22s ease-out .04s forwards; }
@keyframes tick-draw { to { stroke-dashoffset: 0; } }
.rule-row .rule-t { flex: 1; min-width: 0; }
.rule-row input:focus-visible + .tick { outline: 2px solid var(--accent); outline-offset: 2px; }
:root[data-style="quest"] .rule-row { border-radius: 12px; min-height: 38px; border-width: 0; background: transparent; padding: 6px 8px; }
:root[data-style="quest"] .rule-row:hover { background: var(--panel); }
:root[data-style="quest"] .rule-row .tick { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line2); }
:root[data-style="quest"] .rule-row.on .tick { box-shadow: 0 2px 0 var(--accent-lip); }
:root[data-style="quest"] .rules-check.styled { background: var(--panel); border: 0; box-shadow: 0 3px 0 var(--lipc); }
:root[data-style="quest"] .rules-check.styled .rules-bar span { max-width: 26px; }
@media (prefers-reduced-motion: reduce) { .rule-row .tick svg { animation: none !important; stroke-dashoffset: 0; } }

/* Buy / Sell with the price under the name */
.ws.styled .side-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.1; }
.ws.styled .side-btn b { font-family: var(--font-display); font-weight: 800; font-size: 17px; }
.side-px { font-family: var(--font-mono); font-size: 11px; font-weight: 500; opacity: .85; }
/* Place: plain until every rule is ticked, then it warms up */
.ws.styled .place { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.15; transition: background-color .24s ease-out, color .24s, box-shadow .24s; }
.ws.styled .place small { font-size: 11.5px; font-weight: 500; opacity: .8; }
.ws.styled .place.ready { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent); }
.ws.styled .place.ready:hover:not(:disabled) { background: var(--accent-hover); }
.ws.styled .place.pending { background: var(--panel2); border: 1px solid var(--line2); color: var(--soft); box-shadow: none; }
.ws.styled .place.pending small { color: var(--dim); opacity: 1; }
.ws.styled .place.warm { animation: place-warm .5s ease-out; }
@keyframes place-warm { 0% { transform: scale(.98); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); } 60% { transform: scale(1.02); box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 0%, transparent); } 100% { transform: none; } }
.ws.styled.quest .place.ready { border-radius: 14px; box-shadow: 0 4px 0 var(--accent-lip), 0 0 24px color-mix(in srgb, var(--accent) 35%, transparent); }
.place-note { text-align: center; font-size: 13px; font-style: italic; color: var(--muted); min-height: 1em; }
.place-note:empty { display: none; }

/* the trade that just closed, at the top of the Trade tab */
.last-trade { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 20px; background: var(--panel2); border: 1px solid var(--line); animation: card-in .4s ease-out both; }
.lt-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.lt-head b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-time { font-family: var(--font-mono); font-size: 12px; color: var(--dim); white-space: nowrap; }
.lt-res { display: flex; align-items: baseline; gap: 10px; font-size: 13px; color: var(--muted); }
.lt-big { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1.1; }
.last-trade.win .lt-big { color: var(--up-text); } .last-trade.loss .lt-big { color: var(--down-text); }
.lt-rules { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.lt-rules.ok { color: var(--accent-text); }
.lt-seal { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; animation: seal-stamp .35s cubic-bezier(.2, 1.6, .4, 1) .15s both; }
:root[data-style="quest"] .lt-seal { border-radius: 0; clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); width: 20px; height: 22px; }
@keyframes seal-stamp { from { transform: scale(1.6); opacity: 0; } to { transform: none; opacity: 1; } }
.lt-rate { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.lt-rate .link-btn { margin-left: auto; font-size: 12.5px; }
:root[data-style="quest"] .last-trade { border-radius: 16px; border: 0; box-shadow: 0 4px 0 var(--lipc); }

/* the result rising from the exit price */
.fx-in.fx-res { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none !important; box-shadow: none; animation: res-rise 2.6s cubic-bezier(.2, .8, .2, 1) forwards; }
.fx-pill-main { display: inline-flex; align-items: baseline; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line2); box-shadow: 0 6px 20px color-mix(in srgb, var(--bg) 70%, transparent); line-height: 30px; }
.fx-pill-main b { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.fx-r { font-family: var(--font-mono); font-size: 13px; color: var(--soft); }
.fx-res.up b { color: var(--up-text); } .fx-res.down b { color: var(--down-text); }
.fx-seal { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 3px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font: 600 12px var(--font-body); animation: seal-stamp .32s cubic-bezier(.2, 1.6, .4, 1) .14s both; }
.fx-seal i { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; }
.fx-seal svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
:root[data-style="quest"] .fx-seal i { border-radius: 0; clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); height: 22px; }
.fx-note { height: 26px; padding: 0 10px; border-radius: 999px; background: var(--panel2); color: var(--muted); font: 500 12px/26px var(--font-body); }
@keyframes res-rise { 0% { opacity: 0; transform: translateY(0) scale(.92); } 8% { opacity: 1; transform: translateY(-4px) scale(1); } 75% { opacity: 1; transform: translateY(-28px); } 100% { opacity: 0; transform: translateY(-34px); } }
@media (prefers-reduced-motion: reduce) { .fx-in.fx-res { animation: fx-fade 2.6s linear forwards; } .fx-seal { animation: none; } }
/* "Plan followed · 5 in a row" at the top right of the chart */
.plan-chip { position: absolute; top: 34px; z-index: 5; display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 4px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line2);
  font-size: 13px; color: var(--soft); pointer-events: none; animation: card-in .35s ease-out both; }
.plan-chip b { display: inline-block; color: var(--text); }
.plan-chip b.bump { animation: num-slide .4s ease-out; }
@keyframes num-slide { from { transform: translateY(60%); opacity: 0; } to { transform: none; opacity: 1; } }
.pc-seal { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; }
:root[data-style="quest"] .pc-seal { border-radius: 0; clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); height: 26px; }
.ws.styled .chart-cell { position: relative; }

/* the trades strip: one line, Show trades opens the table upward */
.ws.styled .bottom-head { gap: 10px; }
.ts-seal { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1.5px dashed var(--line2); color: transparent; }
.ts-seal.on { background: var(--accent); border: 0; color: var(--accent-ink); }
:root[data-style="quest"] .ts-seal { border-radius: 7px; }
.ts-ok { color: var(--accent-text); }
.ts-sim { font-family: var(--font-mono); font-size: 11px; color: var(--dim); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
.ts-all { color: var(--dim); }
.ts-toggle { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 14px; border-radius: 999px; border: 0; background: transparent; color: var(--accent-text); font-weight: 600; font-size: 13px; cursor: pointer; }
.ts-toggle:hover { background: var(--panel2); }
:root[data-style="quest"] .ts-toggle { color: var(--accent-hi); border-radius: 10px; }
/* Quest's strip in a narrow window: the backtest's trade count gives way first (the table has it), then the XP pill */
.ws.styled.quest .bottom > .bottom-head { container: qstrip / inline-size; }
@container qstrip (max-width: 660px) { .ws.styled.quest .bottom-head .ts-all { display: none; } }
@container qstrip (max-width: 540px) { .ws.styled.quest .bottom-head .xp-pill { display: none; } }
.ws.styled .bottom { transition: height .25s ease-out; }
.ws.styled .bottom.collapsed .bottom-grip { display: none; }

/* sessions on the day line */
.dl-sess { position: absolute; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; box-shadow: 0 0 0 2px var(--dl-ring, var(--panel)); z-index: 1; }
.dl-sess.asia { background: var(--sess-asia); } .dl-sess.london { background: var(--sess-london); } .dl-sess.ny { background: var(--sess-ny); }
.dl-tick.asia { color: var(--sess-asia); } .dl-tick.london { color: var(--sess-london); } .dl-tick.ny { color: var(--sess-ny); }
.dl-tick small { color: var(--dim); font-size: inherit; }
.dl-tick:first-child { transform: translateX(-50%); }
.dl-thumb { z-index: 2; }
:root:is([data-style="studio"], [data-style="nebula"], [data-style="clarity"], [data-style="dojo"]) .tile-value, :root[data-style="quest"] .tile-value { font-family: var(--font-display); font-weight: 700; }
:root:is([data-style="studio"], [data-style="nebula"], [data-style="clarity"], [data-style="dojo"]) .tile, :root[data-style="quest"] .tile { border-radius: 14px; }

/* the order and plan cards (Studio / Quest) */
.ticket.styled { gap: 12px; }
.tk-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 20px; background: var(--panel2); border: 1px solid var(--line); }
:root[data-style="quest"] .tk-card { border-radius: 16px; border: 0; background: var(--panel); box-shadow: 0 3px 0 var(--lipc); }
.ticket.styled .trow { display: flex; align-items: center; gap: 6px; min-height: 42px; padding: 3px 6px 3px 12px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--line); }
.ticket.styled .trow > label { width: auto; min-width: 58px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ticket.styled .trow input, .ticket.styled .trow select, .ticket.styled .tp-row input { height: 34px; background: transparent; border: 0; border-radius: 8px; font-family: var(--font-mono); font-size: 13.5px; }
.ticket.styled .trow input:focus, .ticket.styled .trow select:focus, .ticket.styled .tp-row input:focus { background: color-mix(in srgb, var(--text) 5%, transparent); outline: none; }
.ticket.styled .trow select { font-family: var(--font-body); font-size: 13px; }
.ticket.styled .tk-stop { background: var(--down-soft); border-color: var(--down-line); }
.ticket.styled .tk-stop > label, .ticket.styled .tk-stop input { color: var(--down-text); }
.ticket.styled .tk-stop.off { background: var(--sunken); border-color: var(--line); }
.ticket.styled .tk-stop.off input { opacity: .5; }
.ticket.styled .tp-row { min-height: 42px; padding: 3px 4px 3px 12px; border-radius: 12px; background: var(--up-soft); border: 1px solid var(--up-line); gap: 4px; }
.ticket.styled .tp-label { width: auto; min-width: 34px; color: var(--up-text); font-weight: 700; }
.ticket.styled .tp-row input { color: var(--up-text); }
.ticket.styled .tp-pct { width: 48px; text-align: right; }
/* a narrow side panel (a 960-1180 px window): the row gives room like Clarity's and Dojo's, so the target's price stays whole
   and the row's ✕ stays inside its card */
@media (max-width: 1280px) {
  .ticket.styled .tp-row { gap: 2px; padding-left: 10px; }
  .ticket.styled .tp-pct { width: 40px; }
  .ticket.styled .tp-row .tp-price { flex: 1 1 0; min-width: 82px; padding: 0 4px; }
}
.ticket.styled .tp-row input[type=number] { appearance: textfield; -moz-appearance: textfield; }
.ticket.styled .tp-row input::-webkit-inner-spin-button, .ticket.styled .tp-row input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ticket.styled .tp-row .muted.small { color: var(--up-text); opacity: .8; font-family: var(--font-mono); }
.ticket.styled .tp-block > .btn { align-self: flex-start; border-radius: 999px; border: 1px dashed var(--line2); background: transparent; }
.size-picks { display: flex; gap: 6px; flex-wrap: wrap; }
.size-picks .sp { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; color: var(--soft); font-family: var(--font-mono); font-size: 12px; cursor: pointer; transition: background-color .12s, border-color .12s; }
.size-picks .sp:hover { background: var(--panel); }
.size-picks .sp.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
:root[data-style="quest"] .size-picks .sp { border-radius: 10px; border-width: 2px; }
.ticket.styled .be-row { min-height: 0; padding: 4px 2px; background: none; border: 0; }
.ticket.styled .be-row input[type=checkbox], .ticket.styled .tk-pause input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--seg-off); position: relative; cursor: pointer; flex-shrink: 0; transition: background-color .18s; border: 0; margin: 0 6px 0 0; vertical-align: middle; }
.ticket.styled .be-row input[type=checkbox]::after, .ticket.styled .tk-pause input[type=checkbox]::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--soft); transition: transform .18s cubic-bezier(.2, 1.4, .4, 1), background-color .18s; }
.ticket.styled .be-row input[type=checkbox]:checked, .ticket.styled .tk-pause input[type=checkbox]:checked { background: var(--accent); }
.ticket.styled .be-row input[type=checkbox]:checked::after, .ticket.styled .tk-pause input[type=checkbox]:checked::after { transform: translateX(14px); background: var(--accent-ink); }
.ticket.styled .tk-plan { gap: 10px; }
.ticket.styled .tk-plan .rules-check.styled { padding: 0; background: none; border: 0; box-shadow: none; }
.ticket.styled .ticket-summary { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; padding: 0 4px; background: none; border: 0; font-size: 12px; color: var(--muted); }
.ticket.styled .tk-pause { color: var(--dim); display: flex; align-items: center; padding: 0 4px; }
.ticket.styled .tk-plan > .trow { background: var(--panel); }
.tk-plan .rules-check.styled .rules-head b { display: none; }
.tk-plan .rules-check.styled .rules-head > span:first-child { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ticket.styled .setup-sel { font-weight: 600; }
/* optional confluences: chips under the rules, a step quieter than them (dashed / flat when off) */
.conf-check.styled { gap: 8px; padding: 0; background: none; border: 0; }
.conf-check.styled .conf-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.conf-check.styled .conf-count { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--soft); }
.conf-check.styled .conf-chips { gap: 6px; }
.conf-check.styled .conf-chip { height: 30px; padding: 0 12px 0 9px; font-size: 12.5px; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s; }
:root:is([data-style="studio"], [data-style="nebula"], [data-style="clarity"], [data-style="dojo"]) .conf-check.styled .conf-chip { border-radius: 999px; border: 1px dashed var(--line2); background: transparent; }
:root:is([data-style="studio"], [data-style="nebula"], [data-style="clarity"], [data-style="dojo"]) .conf-check.styled .conf-chip:hover { border-color: var(--muted); }
:root:is([data-style="studio"], [data-style="nebula"], [data-style="clarity"], [data-style="dojo"]) .conf-check.styled .conf-chip.on { border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text); }
:root[data-style="quest"] .conf-check.styled .conf-chip { border-radius: 10px; border: 0; background: var(--panel2); font-weight: 600; box-shadow: 0 2px 0 var(--lipc); }
:root[data-style="quest"] .conf-check.styled .conf-chip:hover { background: color-mix(in srgb, var(--text) 6%, var(--panel2)); }
:root[data-style="quest"] .conf-check.styled .conf-chip.on { background: color-mix(in srgb, var(--accent) 22%, var(--panel2)); color: var(--accent-text); box-shadow: 0 2px 0 var(--accent-lip); }
:root[data-style="quest"] .conf-check.styled .conf-grade { border-radius: 6px; border-width: 2px; }
.ws.styled .lt-conf { padding-left: 2px; }
/* Place (and its note) sit in a footer drawn as the plan card's bottom: the card gives up its bottom edge and the
   footer carries it (same background, sides, corners). The footer is the ticket's own child, so it sticks to the bottom
   of the side panel's scroll area while any part of the ticket is on screen: long rules and confluences, or the last
   trade card above the ticket, never push Place out of view. Its background hides what scrolls under it; its negative
   bottom = the panel's bottom padding (sticky stops at the padding), so nothing shows below it; its negative top margin =
   the ticket's gap (.ws.styled .ticket, 10px) + the card's last 2px, which it covers so no hairline shows at the join. */
.ws.styled .ticket.styled > .tk-plan { border-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; padding-bottom: 2px; clip-path: inset(-40px -40px 0); }
.ws.styled .ticket.styled > .tk-foot { position: sticky; bottom: -12px; z-index: 2; display: flex; flex-direction: column; gap: 8px; margin-top: -12px; padding: 16px 14px 14px;
  background: var(--panel2); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 20px 20px; }
.ws.styled.quest .ticket.styled > .tk-plan { box-shadow: none; }
.ws.styled.quest .ticket.styled > .tk-foot { bottom: -14px; background: var(--panel); border: 0; border-radius: 0 0 16px 16px; box-shadow: 0 3px 0 var(--lipc); }
/* the footer's share of the plan card's glow (motion.css plan-glow, Nebula's gold) is drawn by ::before and cut off at
   its top, where it joins the card (clipping the footer itself would also cut Place's own glow there). The cut is 2px
   inside (where the card ends), so the glow above never leaks into the join as a hairline; the card's own glow is cut
   at its bottom (above), so the two meet without a brighter notch at the sides. */
.ws.styled .ticket.styled > .tk-foot::before { content: ""; position: absolute; inset: 0 -1px -1px; border-radius: inherit; pointer-events: none; z-index: -1; clip-path: inset(2px -40px -40px); }
.ws.styled.quest .ticket.styled > .tk-foot::before { inset: 0; }

.wt-finish { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--accent); background: transparent; color: var(--accent-text); font-weight: 600; cursor: pointer; flex-shrink: 0; }
.wt-finish:hover { background: var(--accent-soft); }
.wt-top.quest .wt-finish { height: 34px; border-radius: 10px; border-width: 2px; box-shadow: 0 2px 0 var(--lipc); }

/* open positions (Studio / Quest) */
.ws.styled .positions { display: flex; flex-direction: column; gap: 10px; }
.ws.styled .pos-card { border-radius: 18px; background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--green); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.ws.styled .pos-card.sell { border-left-color: var(--red); }
.ws.styled .pos-head b { font-family: var(--font-display); font-size: 14px; }
.ws.styled .pos-head .grow { font-family: var(--font-mono); font-weight: 600; font-size: 14px; }
.ws.styled .pos-card .trow { border-radius: 10px; background: var(--down-soft); border: 1px solid var(--down-line); padding: 2px 4px 2px 10px; min-height: 38px; display: flex; align-items: center; gap: 6px; }
.ws.styled .pos-card .trow > label { color: var(--down-text); font-weight: 600; width: auto; min-width: 36px; }
.ws.styled .pos-card .trow input { background: transparent; border: 0; font-family: var(--font-mono); color: var(--down-text); height: 32px; }
.ws.styled .pos-card .btn.small { border-radius: 999px; }
.ws.styled .tp-chip { border-radius: 999px; background: var(--up-soft); border: 1px solid var(--up-line); color: var(--up-text); }
:root[data-style="quest"] .ws.styled .pos-card, .ws.styled.quest .pos-card { border-radius: 14px; border-top: 0; border-right: 0; border-bottom: 0; box-shadow: 0 3px 0 var(--lipc); }
.ws.styled .positions { border-bottom: 0; padding-bottom: 0; }
.lt-rules .xp-pill { margin-left: auto; height: 22px; font-size: 11px; }
.bottom-head .xp-pill { height: 22px; font-size: 11px; }

/* checkboxes in Studio / Quest: a rounded box that fills with the accent and pops a check in */
:root:is([data-style="studio"], [data-style="nebula"], [data-style="clarity"], [data-style="dojo"]) input[type=checkbox]:not(.be-row *):not(.tk-pause *):not(.rule-row *):not(.conf-chip *),
:root[data-style="quest"] input[type=checkbox]:not(.be-row *):not(.tk-pause *):not(.rule-row *):not(.conf-chip *) {
  appearance: none; -webkit-appearance: none; width: 17px; height: 17px; margin: 0; flex-shrink: 0; border-radius: 5px; border: 1.5px solid var(--line2); background: var(--sunken);
  display: inline-grid; place-content: center; cursor: pointer; vertical-align: middle; transition: background-color .15s, border-color .15s; }
:root:is([data-style="studio"], [data-style="nebula"], [data-style="clarity"], [data-style="dojo"]) input[type=checkbox]:not(.be-row *):not(.tk-pause *):not(.rule-row *):not(.conf-chip *)::before,
:root[data-style="quest"] input[type=checkbox]:not(.be-row *):not(.tk-pause *):not(.rule-row *):not(.conf-chip *)::before {
  content: ""; width: 10px; height: 10px; background: var(--accent-ink); transform: scale(0); transition: transform .16s cubic-bezier(.2, 1.6, .4, 1);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); }
:root:is([data-style="studio"], [data-style="nebula"], [data-style="clarity"], [data-style="dojo"]) input[type=checkbox]:not(.be-row *):not(.tk-pause *):not(.rule-row *):not(.conf-chip *):checked,
:root[data-style="quest"] input[type=checkbox]:not(.be-row *):not(.tk-pause *):not(.rule-row *):not(.conf-chip *):checked { background: var(--accent); border-color: var(--accent); }
:root:is([data-style="studio"], [data-style="nebula"], [data-style="clarity"], [data-style="dojo"]) input[type=checkbox]:not(.be-row *):not(.tk-pause *):not(.rule-row *):not(.conf-chip *):checked::before,
:root[data-style="quest"] input[type=checkbox]:not(.be-row *):not(.tk-pause *):not(.rule-row *):not(.conf-chip *):checked::before { transform: scale(1); }
:root[data-style="quest"] input[type=checkbox]:not(.be-row *):not(.tk-pause *):not(.rule-row *):not(.conf-chip *) { border-radius: 6px; border-width: 2px; }
:root[data-style] input[type=checkbox]:disabled { opacity: .5; cursor: default; }
.ws.styled .day-tab .day-head b { font-family: var(--font-display); font-size: 16px; }
.ws.styled .side-body label.check { gap: 7px; }

/* Focus: the side panel hides and the chart takes the whole width (Workspace.setFocus) */
.ws.styled.focus .side { display: none; }
.ws.styled .focus-btn.on { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
/* Quest: the chart's screenshot and colours sit at the right end of the replay controls, next to Jump */
.q-transport .ctl.icon-only { width: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.q-transport > .transport { flex: 1 1 auto; min-width: 0; }
/* the controls row holds the screenshot, colours and Focus too: on narrower windows Next bar / Skip / Jump show only their icons */
@media (max-width: 1640px) { .q-transport .ctl:not(.ny):not(.day) > span:not(.icw) { display: none; } .q-transport .ctl.jump { padding: 0 8px; } }
.q-bar-tools { display: flex; gap: 6px; flex-shrink: 0; margin-left: auto; }
.q-col-tools { display: none; }
@media (max-width: 1500px) { .q-bar-tools { display: none; } .q-col-tools { display: contents; } }
/* Studio's drawing rail scrolls (no half-cut tool at the bottom) when the window is short */
.ws.styled.studio .toolbox { overflow-y: auto; scrollbar-width: none; }
.ws.styled.studio .toolbox::-webkit-scrollbar { display: none; }
/* the speaker on the replay's top bar (Workspace.toggleMute) */
.wt-top .wt-mute { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line2); background: transparent; color: var(--soft); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; flex-shrink: 0; }
.wt-top .wt-mute:hover { background: var(--panel2); color: var(--text); }
.wt-top .wt-mute.muted { color: var(--dim); }
.wt-top.quest .wt-mute { width: 36px; height: 36px; border-radius: 10px; border: 0; }
.wt-top.quest .wt-mute:hover { background: var(--panel); }
/* Studio (and Nebula): Did you know, under Your backtests */
.s-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 12px; align-self: start; min-width: 0; }
.s-side .s-list { position: static; }
.s-tip { display: flex; flex-direction: column; gap: 10px; }
.s-tip-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.s-tip-k { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--accent-text); }
.s-tip-next { font-size: 12.5px; }
.s-tip-t { margin: 0; font-size: 15px; line-height: 1.5; color: var(--soft); }
.s-tip-t b { color: var(--text); }
.s-tip-stat { margin: 0; font-size: 13px; color: var(--muted); }
.s-tip-stat b { color: var(--up-text); }
.s-tip-days { display: flex; gap: 5px; flex-wrap: wrap; }
.s-tip-days i { width: 12px; height: 12px; border-radius: 50%; background: var(--seg-off); }
.s-tip-days i.on { background: var(--accent); }
@media (max-width: 1280px) { .s-side { position: static; } }
/* a narrow day line keeps the session names and drops their times (they overlapped) */
@container (max-width: 330px) { .dl-tick small { display: none; } }

/* ---------- 0.13: Studio / Nebula replay: a smaller player bar, the day's trades in it ---------- */
/* the strip under the chart's bar: only when the bar has no room left for the day line (Workspace.placeDayLine, 0.17.0) */
.chart-card .cc-day, .q-main > .cc-day { position: relative; z-index: 4; display: flex; align-items: center; min-height: 24px; padding: 0 16px; flex-shrink: 0;
  border-bottom: 1px solid var(--line); background: var(--chrome); --dl-ring: var(--chrome); }
.chart-card .cc-day[hidden], .q-main > .cc-day[hidden] { display: none; }
/* Classic: the toolbar wraps, so the day line takes the next row instead of being squeezed out (0.17.0) */
.ws-toolbar .dl-slot { flex: 1 1 160px; }
.cc-day .day-line { padding: 3px 0; }
.chart-card .cc-day .dl-tick { z-index: 3; }
/* a session's callout drops under the line, onto the chart */
.dl-slot .dl-callout, .cc-day .dl-callout { bottom: auto; top: 10px; }
/* narrower windows: Layout and Indicators show only their icons, so the day line keeps its room (their names are in the tooltips) */
@media (max-width: 1499px) {
  .ws.styled .cc-head .ctl.cc-lbl > span:not(.icw) { display: none; }
  .ws.styled .cc-head .ctl.cc-lbl { width: 34px; padding: 0; }
}
/* The chart's bar never squeezes a button narrower than its icon: in a narrow chart the starred timeframes after the third
   step aside (the one you are on stays; the ▾ menu lists them all), and if many are starred the row of timeframes is cut
   at its right end with the ▾ menu kept in view. */
.chart-card .cc-head { container: cchead / inline-size; }
.chart-card .cc-head > :not(.dl-slot):not(.tf-group) { flex-shrink: 0; }
.chart-card .cc-head > .tf-group { flex: 0 1 auto; min-width: 0; overflow: hidden; }
.chart-card .cc-head .tf-group > .tf { flex-shrink: 0; }
.chart-card .cc-head .tf-group > .tf-more { position: sticky; right: 0; background: inherit; }
@container cchead (max-width: 760px) { .cc-head .tf-group > .tf:nth-child(n+4):not(.active):not(.tf-more) { display: none; } }
@container cchead (max-width: 640px) { .cc-head .tf-group > .tf:nth-child(n+3):not(.active):not(.tf-more) { display: none; } }
/* the player bar: 46 px, round icon buttons (their names are in the tooltips), a smaller play button */
.transport.studio { min-height: 46px; padding: 4px 10px; gap: 6px; }
.transport.studio .ctl { height: 32px; padding: 0 11px; font-size: 12.5px; }
.transport.studio .ctl:not(.ny):not(.day):not(.jump):not(.big-play) > span:not(.icw) { display: none; }
.transport.studio .ctl:not(.ny):not(.day):not(.jump):not(.big-play) { width: 32px; padding: 0; }
.transport.studio .ctl.big-play, .transport.studio .ctl.big-play.on { width: 40px; height: 40px; margin: 0 2px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent), 0 6px 16px color-mix(in srgb, var(--accent) 24%, transparent); }
.transport.studio .skip-n { width: 40px; height: 28px; font-size: 12px; }
.transport.studio .speed-seg { padding: 2px; }
.transport.studio .spd { height: 26px; min-width: 32px; font-size: 11.5px; }
.transport.studio .spd-more { width: 30px; }
.transport.studio .ctl.jump { padding: 0 10px 0 12px; }
/* the day's trades at the right end of the bar: a click opens the table under the chart */
.ws.styled .transport .bottom-head { min-height: 0; padding: 0; gap: 0; background: none; border: 0; font-size: 12.5px; }
.ts-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 5px; border-radius: 999px; border: 0; background: var(--panel2); color: var(--soft);
  font: inherit; font-size: 12.5px; white-space: nowrap; cursor: pointer; transition: background-color .15s, color .15s; }
.ts-chip:hover { background: color-mix(in srgb, var(--panel2) 80%, var(--accent)); color: var(--text); }
.ts-chip.open { background: var(--accent-soft); color: var(--text); }
.ts-chip .ts-seal { width: 22px; height: 22px; }
.ts-chip .ts-num { color: var(--text); }
.ts-chip .ts-l { color: var(--muted); }
.ts-chip .ts-rules { color: var(--muted); }
.ts-chip .ts-open { color: var(--muted); }
.ts-chip .icw { color: var(--accent-text); }
/* the trades table (only when open): the line that held the summary is gone */
.ws.styled.studio .bottom.collapsed { display: none; }
.ws.styled.studio .bottom:not(.collapsed) .trades { border-top: 0; }
@media (max-width: 1400px) { .ts-chip .ts-l, .ts-chip .ts-open { display: none; } }
@media (max-width: 1180px) { .ts-chip .ts-rules { display: none; } .transport.studio .speed-seg .spd:nth-child(2):not(.on) { display: none; } }
/* The player bar measures itself (Focus makes it wider). The Day and NY words stay as long as possible: Jump gives up its word
   first, then the 1× speed goes and the buttons get a little narrower. */
.transport.studio { container: player / inline-size; }
@container player (max-width: 740px) {
  .transport.studio .ctl.jump > span:not(.icw) { display: none; }
  .transport.studio .ctl.jump { width: 32px; padding: 0; }
}
@container player (max-width: 650px) {
  .transport.studio .speed-seg .spd:first-child:not(.on) { display: none; }
  .transport.studio .ctl.day, .transport.studio .ctl.ny { padding: 0 8px; }
  .ws.styled .transport.studio .ctl:not(.day):not(.ny):not(.big-play) { width: 28px; } /* (Clarity's and Dojo's buttons too) */
}
/* No button is ever squeezed narrower than its icon (they overlapped in a 960-1220 px window). Before that could happen, the
   day's trades button keeps only its count (the rest is in its tooltip), then only the speed you are on stays a button
   (» lists every speed), and the bar's gaps get smaller. */
.transport.studio > :not(.grow) { flex-shrink: 0; }
@container player (max-width: 870px) {
  .transport.studio .ts-chip > b:not(.ts-num), .transport.studio .ts-chip .ts-ok, .transport.studio .ts-chip .ts-rules { display: none; }
}
@container player (max-width: 700px) { .transport.studio .speed-seg .spd:not(.on) { display: none; } }
@container player (max-width: 640px) { .transport.studio .ctl.day, .transport.studio .ctl.ny { padding: 0 6px; } }
@media (max-width: 1060px) { .ws.styled .transport.studio { gap: 4px; padding-left: 8px; padding-right: 8px; } }
