/* The opening screen: a made-up trading terminal. Pick the stock, read the order book, buy one share, and the site opens.
   It only covers the page while <html> has .intro-open, so without scripts the site is simply there. */
.intro { display: none; }
html.intro-open { overflow: hidden; }
html.intro-open .intro { display: block; }
/* the site waits behind the terminal: hidden, with its entrance animations held at the start */
html.intro-hold .site-head, html.intro-hold main, html.intro-hold .site-foot { visibility: hidden; }
html.intro-hold .hero *, html.intro-hold .hero-art { animation-play-state: paused !important; }

.intro {
  --bg: #0A0F15;
  --pane: #101821;
  --pane-2: #0D141C;
  --hair: #1D2834;
  --text: #DDE5EC;
  --dim: #8291A0;
  --faint: #56636F;
  --rise: #F4525F;     /* red rises */
  --fall: #4B8DF8;     /* blue falls */
  --focus: #5CC0E6;
  --gold: #E8B74A;
  position: fixed; inset: 0; z-index: 100; overflow: auto;
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 13px; line-height: 1.45; font-variant-numeric: tabular-nums;
  word-break: keep-all;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.75, 0.2, 1);
}
.intro.is-leaving { opacity: 0; transform: scale(1.035); pointer-events: none; }
.intro button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.intro :focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.intro .up { color: var(--rise); }
.intro .down { color: var(--fall); }
.intro h2 { font-family: var(--sans); letter-spacing: 0; }

.hts { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 100%; height: 100%; }

/* ---------- top bar ---------- */
.hts-bar { display: flex; align-items: center; gap: 1.1rem; padding: 0 1rem; height: 44px; background: var(--pane); border-bottom: 1px solid var(--hair); white-space: nowrap; }
.hts-back { display: none; width: 28px; height: 28px; font-size: 16px; color: var(--dim); }
.hts-brand { font-weight: 800; letter-spacing: 0.02em; font-size: 14px; }
.hts-brand span { font-weight: 500; color: var(--dim); margin-left: 0.25em; }
.hts-ticker { display: flex; align-items: baseline; gap: 0.6rem; padding-left: 1.1rem; border-left: 1px solid var(--hair); }
.hts-ticker .t-name { color: var(--dim); }
.hts-ticker b { font-size: 14px; font-weight: 700; }
.hts-open { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; color: var(--dim); }
.hts-open i { width: 7px; height: 7px; border-radius: 50%; background: #3CCB7F; box-shadow: 0 0 0 0 rgb(60 203 127 / 0.6); animation: live 1.8s ease-out infinite; }
.hts-clock { color: var(--dim); min-width: 5.2em; text-align: right; }
.intro .lang { font-size: 12px; }
.intro .lang button { color: var(--dim); }
.intro .lang button[aria-pressed="true"] { color: var(--text); }
.intro .lang button + button::before { color: var(--faint); }
.hts-skip { padding: 0.4rem 0.8rem !important; border: 1px solid var(--hair) !important; border-radius: 999px; color: var(--dim) !important; }
.hts-skip:hover { color: var(--text) !important; border-color: var(--dim) !important; }
@keyframes live { to { box-shadow: 0 0 0 7px rgb(60 203 127 / 0); } }

/* ---------- panes ---------- */
.hts-body { display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(280px, 340px); gap: 1px; background: var(--hair); min-height: 0; }
.pane { position: relative; background: var(--pane-2); min-width: 0; min-height: 0; overflow: auto; }
.pane-h { margin: 0; padding: 0.7rem 1rem; font-size: 12px; font-weight: 700; color: var(--dim); border-bottom: 1px solid var(--hair); background: var(--pane); }
.pane-empty { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; margin: 0; padding: 2rem; text-align: center; color: var(--dim); font-weight: 600; }
.q-main { visibility: hidden; opacity: 0; }
/* before a stock is chosen the book is there but out of focus */
.b-main { opacity: 0.22; filter: blur(2.5px); pointer-events: none; }
.intro:not([data-step="list"]) .q-main { visibility: visible; opacity: 1; transition: opacity 0.35s ease; }
.intro:not([data-step="list"]) .b-main { opacity: 1; filter: none; pointer-events: auto; transition: opacity 0.35s ease, filter 0.35s ease; }
.intro:not([data-step="list"]) .pane-empty { display: none; }

/* ---------- watchlist ---------- */
.w-index { padding: 0.9rem 1rem 0.8rem; border-bottom: 1px solid var(--hair); }
.w-index-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.w-index-top span { color: var(--dim); }
.w-index-top b { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.w-index-chg { margin-top: 0.1rem; text-align: right; font-weight: 600; }
.w-spark { display: block; width: 100%; height: 44px; margin-top: 0.5rem; }
.w-spark path { fill: none; stroke: currentColor; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.w-spark .area { fill: currentColor; fill-opacity: 0.12; stroke: none; }
.w-index.up .w-spark { color: var(--rise); }
.w-index.down .w-spark { color: var(--fall); }
.w-index .w-index-top b { color: var(--text); }
.w-head, .w-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 4.6em; gap: 0.75rem; align-items: center; padding: 0 1rem; }
.w-head { height: 28px; font-size: 11px; color: var(--faint); border-bottom: 1px solid var(--hair); }
.w-head span:nth-child(n+2), .w-row span:nth-child(n+2) { text-align: right; }
.w-group { margin: 0; padding: 0.65rem 1rem 0.3rem; font-size: 11px; color: var(--faint); }
.w-row, .intro button.w-row { width: 100%; height: 40px; padding: 0 1rem; text-align: left; border-bottom: 1px solid rgb(29 40 52 / 0.6); }
.w-row .w-name { display: flex; align-items: baseline; gap: 0.45rem; min-width: 0; }
.w-row .w-name b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-row .w-name small { font-size: 10.5px; color: var(--faint); }
.w-row .w-last, .w-row .w-chg { font-weight: 600; }
.intro button.w-row { height: 52px; position: relative; background: rgb(92 192 230 / 0.07); box-shadow: inset 3px 0 0 var(--focus); }
button.w-row:hover { background: rgb(92 192 230 / 0.13); }
button.w-row .w-name b { font-size: 15px; font-weight: 700; }
button.w-row .w-last { font-size: 14px; }
.intro[data-step="list"] button.w-row { animation: nudge 1.8s ease-in-out infinite; }
.intro:not([data-step="list"]) button.w-row { background: rgb(92 192 230 / 0.16); }
.w-hint { margin: 0; padding: 0.5rem 1rem 0.2rem; color: var(--focus); font-size: 12px; font-weight: 600; }
.intro:not([data-step="list"]) .w-hint { visibility: hidden; }
@keyframes nudge { 50% { background: rgb(92 192 230 / 0.2); } }

/* ---------- quote ---------- */
.q-main { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; height: 100%; }
.q-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 0.2rem 1.5rem; padding: 1rem 1.25rem 0.9rem; border-bottom: 1px solid var(--hair); }
.q-name { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.q-name small { margin-left: 0.6rem; font-size: 12px; font-weight: 500; color: var(--dim); letter-spacing: 0; }
.q-price { grid-row: span 2; text-align: right; }
.q-price b { display: block; font-size: 34px; line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; }
.q-price b small { margin-left: 0.15em; font-size: 14px; font-weight: 600; letter-spacing: 0; }
.q-price span { font-weight: 700; }
.q-sub { margin: 0; color: var(--dim); }
.q-stats { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--hair); }
.q-stats div { padding: 0.55rem 1.25rem; border-left: 1px solid var(--hair); }
.q-stats div:first-child { border-left: 0; }
.q-stats dt { font-size: 11px; color: var(--faint); }
.q-stats dd { margin: 0; font-weight: 600; }
.q-chart-wrap { position: relative; min-height: 220px; }
.q-tabs { position: absolute; left: 1.25rem; top: 0.75rem; z-index: 1; display: flex; gap: 2px; font-size: 11px; }
.q-tabs span { padding: 0.2rem 0.55rem; border-radius: 4px; color: var(--dim); }
.q-tabs span.on { background: var(--hair); color: var(--text); font-weight: 700; }
.q-legend { position: absolute; left: 9.2rem; top: 0.95rem; z-index: 1; display: flex; gap: 0.9rem; font-size: 11px; color: var(--dim); }
.q-legend i { display: inline-block; width: 10px; height: 2px; margin-right: 0.35rem; vertical-align: middle; }
.q-chart { display: block; width: 100%; height: 100%; }
.q-chart text { font-family: var(--sans); font-size: 10.5px; fill: var(--faint); }
.q-chart .grid { stroke: var(--hair); stroke-width: 1; }
.q-chart .wick { stroke-width: 1; }
.q-chart .r { fill: var(--rise); stroke: var(--rise); }
.q-chart .f { fill: var(--fall); stroke: var(--fall); }
.q-chart .ma5 { fill: none; stroke: var(--gold); stroke-width: 1.2; opacity: 0.9; }
.q-chart .ma20 { fill: none; stroke: #A593FF; stroke-width: 1.2; opacity: 0.9; }
.q-chart .now { stroke: var(--rise); stroke-width: 1; stroke-dasharray: 3 3; }
.q-chart .tag rect { fill: var(--rise); }
.q-chart .tag text { fill: #fff; font-weight: 700; font-size: 11px; }
.q-info { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--hair); }
.q-info div { display: grid; grid-template-columns: 4.5em minmax(0, 1fr); gap: 0.75rem; padding: 0.6rem 1.25rem; border-bottom: 1px solid var(--hair); }
.q-info div:nth-child(odd) { border-right: 1px solid var(--hair); }
.q-info div:nth-last-child(-n+2) { border-bottom: 0; }
.q-info dt { color: var(--faint); }
.q-info dd { margin: 0; }

/* ---------- order book ---------- */
.b-main { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
.book { display: grid; align-content: center; padding: 0.25rem 0; }
.bk-head, .bk-row { display: grid; grid-template-columns: minmax(0, 1fr) 8.4em minmax(0, 1fr); align-items: center; }
.bk-head { height: 26px; font-size: 11px; color: var(--faint); text-align: center; }
.bk-row { width: 100%; height: 34px; position: relative; }
.bk-row .q { position: relative; height: 100%; display: flex; align-items: center; padding: 0 0.8rem; font-size: 12px; color: var(--dim); }
.bk-row .q.a { justify-content: flex-end; }
.bk-row .q i { position: absolute; top: 5px; bottom: 5px; border-radius: 2px; transition: width 0.4s ease; }
.bk-row .q.a i { right: 0; background: rgb(75 141 248 / 0.22); }
.bk-row .q.b i { left: 0; background: rgb(244 82 95 / 0.22); }
.bk-row .q span { position: relative; transition: color 0.3s; }
.bk-row .q.flash span { color: var(--text); }
.bk-row .p { height: 100%; display: grid; place-items: center; font-weight: 700; font-size: 13.5px; color: var(--rise); border-inline: 1px solid var(--hair); }
.bk-row.ask .p { background: rgb(75 141 248 / 0.07); }
.bk-row.bid .p { background: rgb(244 82 95 / 0.07); }
.bk-row:hover .p { background: rgb(255 255 255 / 0.08); }
.bk-row.is-picked .p { box-shadow: inset 0 0 0 1.5px var(--gold); }
.bk-row .p { position: relative; }
.bk-row.is-last .p::before { content: ""; position: absolute; left: 7px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--gold); }
.bk-mid { height: 1px; background: var(--hair); margin: 2px 0; }

.ticket { border-top: 1px solid var(--hair); background: var(--pane); padding: 0.75rem 1rem 1rem; }
.tk-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 0.7rem; }
.tk-tabs button { height: 30px; border-radius: 6px; font-weight: 700; color: var(--dim); background: var(--pane-2); }
.tk-tabs button.on { background: rgb(244 82 95 / 0.16); color: var(--rise); }
.tk-tabs button:disabled { cursor: not-allowed; opacity: 0.55; }
.tk-row { display: grid; grid-template-columns: 5em minmax(0, 1fr) 1.2em; align-items: center; gap: 0.5rem; height: 32px; }
.tk-row > span:first-child { color: var(--dim); }
.tk-row output { text-align: right; font-weight: 700; font-size: 14px; padding: 0.3rem 0.6rem; border-radius: 6px; background: var(--pane-2); border: 1px solid var(--hair); }
.tk-row.total output { background: none; border-color: transparent; font-size: 15px; }
.tk-row > span:last-child { color: var(--dim); }
html[data-lang="en"] .tk-row { grid-template-columns: 5em minmax(0, 1fr) 2.9em; }   /* "KRW" and "share" are wider than 원 and 주 */
.intro .tk-buy { width: 100%; height: 48px; margin-top: 0.7rem; border-radius: 8px; background: var(--rise); color: #fff; font-size: 16px; font-weight: 800; letter-spacing: 0.01em; box-shadow: 0 0 0 0 rgb(244 82 95 / 0.5); transition: filter 0.15s, transform 0.1s; }
.tk-buy:hover { filter: brightness(1.08); }
.tk-buy:active { transform: translateY(1px); }
.intro[data-step="quote"] .tk-buy { animation: call 2s ease-out 1.2s infinite; }
.tk-buy[disabled] { filter: grayscale(0.4) brightness(0.8); cursor: default; animation: none !important; }
.tk-msg { min-height: 1.5em; margin: 0.5rem 0 0; font-size: 12px; color: var(--gold); text-align: center; }
@keyframes call { to { box-shadow: 0 0 0 12px rgb(244 82 95 / 0); } }

/* ---------- status line ---------- */
.hts-status { display: flex; justify-content: space-between; gap: 1rem; padding: 0 1rem; height: 30px; align-items: center; background: var(--pane); border-top: 1px solid var(--hair); font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; }
.hts-status .guide { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.hts-status .guide em { font-style: normal; color: var(--focus); margin-right: 0.6em; }

/* ---------- filled ---------- */
.fill { position: fixed; inset: 0; z-index: 2; display: grid; place-items: center; background: rgb(10 15 21 / 0.72); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity 0.25s ease; }
.intro[data-step="filled"] .fill { opacity: 1; visibility: visible; }
.fill-card { min-width: min(22rem, 86vw); padding: 1.6rem 1.75rem 1.5rem; border-radius: 14px; background: var(--pane); border: 1px solid var(--hair); text-align: center; box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.8); transform: translateY(10px) scale(0.97); transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.intro[data-step="filled"] .fill-card { transform: none; }
.fill-check { width: 46px; height: 46px; margin: 0 auto 0.8rem; }
.fill-check circle { fill: none; stroke: var(--rise); stroke-width: 2; }
.fill-check path { fill: none; stroke: var(--rise); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; }
.intro[data-step="filled"] .fill-check path { animation: tick 0.45s 0.15s ease-out forwards; }
.fill-title { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.fill-line { margin: 0.5rem 0 0; color: var(--dim); }
.fill-line b { color: var(--text); font-weight: 700; }
.fill-next { margin: 0.9rem 0 0; font-size: 12px; color: var(--focus); }
@keyframes tick { to { stroke-dashoffset: 0; } }

/* candles and book rows come in one after another */
@media (prefers-reduced-motion: no-preference) {
  .intro[data-step="quote"] .q-chart .c { opacity: 0; animation: cin 0.3s calc(var(--i) * 14ms + 0.1s) ease-out forwards; }
  .intro[data-step="quote"] .q-chart .ma5, .intro[data-step="quote"] .q-chart .ma20 { opacity: 0; animation: cin 0.6s 0.9s ease-out forwards; }
  .intro[data-step="quote"] .bk-row { opacity: 0; animation: cin 0.3s calc(var(--i) * 35ms + 0.15s) ease-out forwards; }
  @keyframes cin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  .intro, .intro * { animation: none !important; transition: none !important; }
}

/* ---------- narrower: the same flow as a phone trading app, one screen at a time ---------- */
@media (max-width: 62rem) {
  .hts-body { grid-template-columns: minmax(230px, 280px) minmax(0, 1fr); }
  .p-book { grid-column: 1 / -1; }
  .intro { overflow: auto; }
  .hts { height: auto; min-height: 100%; }
  .p-quote, .p-book { overflow: visible; }
  .book { padding-block: 0.5rem; }
}
@media (max-width: 44rem) {
  .intro { font-size: 13.5px; }
  .hts-bar { gap: 0.7rem; padding: 0 0.75rem; height: 48px; }
  .hts-ticker, .hts-clock, .hts-open { display: none; }
  .hts-skip { margin-left: auto; }
  .intro .lang { margin-left: auto; }
  .intro .lang + .hts-skip { margin-left: 0; }
  .hts-body { display: block; background: none; }
  .pane { overflow: visible; }
  .pane-empty { display: none; }
  .intro[data-step="list"] .p-quote, .intro[data-step="list"] .p-book { display: none; }
  .intro:not([data-step="list"]) .p-watch { display: none; }
  .intro:not([data-step="list"]) .hts-back { display: block; }
  .w-index-top b { font-size: 24px; }
  .w-spark { height: 64px; }
  button.w-row { height: 60px; }
  .w-row { height: 46px; }
  .q-main, .b-main { height: auto; }
  .q-head { grid-template-columns: minmax(0, 1fr); padding: 1rem; }
  .q-price { grid-row: auto; text-align: left; margin-top: 0.35rem; }
  .q-price b { font-size: 32px; display: inline-block; margin-right: 0.6rem; }
  .q-sub { order: 3; margin-top: 0.4rem; }
  .q-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q-stats div { padding: 0.5rem 1rem; }
  .q-stats div:nth-child(3) { border-left: 0; border-top: 1px solid var(--hair); }
  .q-stats div:nth-child(4) { border-top: 1px solid var(--hair); }
  .q-chart-wrap { height: 250px; min-height: 0; }
  .q-info { grid-template-columns: minmax(0, 1fr); }
  .q-info div { border-right: 0 !important; border-bottom: 1px solid var(--hair) !important; padding-inline: 1rem; }
  .bk-row { height: 38px; }
  .ticket { position: sticky; bottom: 0; z-index: 1; padding-bottom: max(1rem, env(safe-area-inset-bottom)); box-shadow: 0 -14px 24px -12px rgb(0 0 0 / 0.7); }
  .tk-tabs { display: none; }
  .tk-row:not(.total) { display: none; }
  .tk-buy { margin-top: 0.4rem; height: 50px; }
  .hts-status { height: auto; padding: 0.6rem 0.9rem; white-space: normal; flex-direction: column; align-items: flex-start; gap: 0.2rem; }
  .intro:not([data-step="list"]) .hts-status { display: none; }
}

/* after the purchase: a line in the site footer */
.holding { display: none; }
html.has-share .holding { display: inline; }
.replay { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1.5px; text-underline-offset: 0.24em; }
.replay:hover { color: var(--line-text); }

/* ---------- before a stock is chosen: the index it belongs to ---------- */
.x-main { position: absolute; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.intro:not([data-step="list"]) .x-main { display: none; }
.x-chart-wrap { position: relative; min-height: 180px; }
.x-chart { display: block; width: 100%; height: 100%; }
.x-chart text { font-family: var(--sans); font-size: 10.5px; fill: var(--faint); }
.x-chart .grid { stroke: var(--hair); stroke-width: 1; }
.x-chart .base { stroke: var(--dim); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0.7; }
.x-chart { color: var(--rise); }
.x-chart.down { color: var(--fall); }
.x-chart .line { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.x-chart .area { fill: url(#x-fade); }
.x-chart .dot { fill: currentColor; }
.x-chart .halo { fill: currentColor; opacity: 0.25; animation: halo 1.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes halo { from { transform: scale(0.6); opacity: 0.5; } to { transform: scale(2.4); opacity: 0; } }
.x-list { border-top: 1px solid var(--hair); background: var(--pane); padding-bottom: 1rem; }
.intro button.x-card { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0.15rem 1.5rem; width: calc(100% - 2rem); margin: 0.2rem 1rem 0; padding: 0.95rem 1.2rem; text-align: left; border-radius: 10px; background: rgb(92 192 230 / 0.08); border: 1px solid rgb(92 192 230 / 0.45); transition: background 0.15s, transform 0.15s; }
.intro button.x-card:hover { background: rgb(92 192 230 / 0.16); transform: translateY(-1px); }
.intro[data-step="list"] button.x-card { animation: ring 2s ease-out infinite; }
.x-name b { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.x-name small { margin-left: 0.5rem; font-size: 11px; color: var(--dim); }
.x-sub { grid-column: 1; color: var(--dim); }
.x-last { grid-column: 2; grid-row: 1; text-align: right; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.x-last small { margin-left: 0.15em; font-size: 12px; font-weight: 600; }
.x-chg { grid-column: 2; grid-row: 2; text-align: right; font-weight: 700; }
.x-go { grid-column: 3; grid-row: 1 / span 2; padding: 0.55rem 0.9rem; border-radius: 999px; background: var(--focus); color: #06212C; font-weight: 800; white-space: nowrap; }
@keyframes ring { from { box-shadow: 0 0 0 0 rgb(92 192 230 / 0.45); } to { box-shadow: 0 0 0 12px rgb(92 192 230 / 0); } }
@media (max-width: 62rem) { .x-main { position: static; } .intro[data-step="list"] .q-main { display: none; } .x-chart-wrap { height: 240px; } }


/* the English name is longer: give it the room the ticker code took */
.w-row .w-name small { flex: none; white-space: nowrap; }
html[data-lang="en"] .intro button.w-row .w-name small { display: none; }
html[data-lang="en"] .intro button.w-row .w-name b { font-size: 14px; }

/* each of today's figures stands for something; pointing at it (or tapping) says what */
.q-stats div { position: relative; cursor: help; }
.q-stats dd > span { text-decoration: underline dotted var(--faint); text-underline-offset: 4px; }
.q-note { position: absolute; left: 1.25rem; top: calc(100% - 6px); z-index: 3; padding: 0.4rem 0.65rem; border-radius: 6px; background: #1B2632; border: 1px solid #2B3A49; color: var(--text); font-size: 11.5px; font-weight: 600; white-space: nowrap; box-shadow: 0 10px 24px -10px rgb(0 0 0 / 0.8); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity 0.15s, transform 0.15s; pointer-events: none; }
.q-stats div:hover .q-note, .q-stats div:focus .q-note { opacity: 1; visibility: visible; transform: none; }
.q-stats div:focus { outline: none; }
.q-stats div:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
@media (max-width: 44rem) { .q-note { left: 1rem; } }

/* the empty side of each order-book row names the record its size stands for */
.bk-note { padding: 0 0.7rem; font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity 0.15s; }
.bk-row.ask .bk-note { text-align: left; }
.bk-row.bid .bk-note { text-align: right; }
.bk-row:hover .bk-note, .bk-row:focus-visible .bk-note, .bk-row.is-picked .bk-note { opacity: 1; }
.x-level { position: relative; cursor: help; }
.x-level .q-note { left: auto; right: 0; top: calc(100% + 4px); }
.x-level:hover .q-note, .x-level:focus .q-note { opacity: 1; visibility: visible; transform: none; }
.x-level:focus { outline: none; }

/* the index chart is drawn as weekly candles, like the stock's own chart */
.x-chart .wick { stroke-width: 1; }
.x-chart .r { fill: var(--rise); stroke: var(--rise); }
.x-chart .f { fill: var(--fall); stroke: var(--fall); }
.x-chart .ma5 { fill: none; stroke: var(--gold); stroke-width: 1.2; opacity: 0.9; }
.x-chart .ma20 { fill: none; stroke: #A593FF; stroke-width: 1.2; opacity: 0.9; }
.x-chart .now { stroke-width: 1; stroke-dasharray: 3 3; fill: none; }
.x-chart .tag text { fill: #fff; font-weight: 700; font-size: 11px; stroke: none; }
.x-chart .halo { stroke: none; opacity: 0.3; }
.x-level { cursor: default; }

/* the Sell tab can be pressed; it just says no */
.tk-tabs button[data-sell]:hover { color: var(--fall); }
.tk-tabs button.nope { animation: nope 0.35s ease; color: var(--fall); }
@keyframes nope { 20% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 80% { transform: translateX(-2px); } }
/* on a phone the Buy and Sell tabs stay visible too, so the joke is not lost */
@media (max-width: 44rem) { .tk-tabs { display: grid; margin-bottom: 0.3rem; } .tk-tabs button { height: 28px; } }

/* what the index change is measured against */
.yx-basis { margin-left: 0.35em; font-size: 11px; font-weight: 500; color: var(--dim); letter-spacing: 0; }
.w-index-chg [data-yx-chg] { font-weight: 600; }
