:root {
  color-scheme: dark;
  font-family: Inter, "Malgun Gothic", system-ui, sans-serif;
  color: #e8edf5;
  background: #10151c;
  --panel: #151d27;
  --line: #2b3849;
  --muted: #9eabbc;
  --accent: #89dfce;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
button { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.page-width { width: min(100% - 64px, 1580px); margin-inline: auto; }
.topbar { background: #131a23; border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand h1 { margin: 0; font-size: clamp(21px, 2.3vw, 27px); letter-spacing: -.045em; white-space: nowrap; }
.brand-mark {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  padding-bottom: 10px;
  border: 1px solid #32555a;
  border-radius: 9px;
  background: #1a3036;
}
.brand-mark i { width: 4px; height: 7px; background: var(--accent); border-radius: 1px; }
.brand-mark i:nth-child(2) { height: 12px; }
.brand-mark i:nth-child(3) { height: 17px; }
.market-notice {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid #355661;
  border-radius: 8px;
  background: #1c2b34;
  font-size: 12px;
}
.market-notice-title { flex: none; color: var(--accent); white-space: nowrap; }
.market-notice-new {
  display: inline-block;
  padding: 2px 4px;
  border-radius: 4px;
  background: #ffdb63;
  color: #241c07;
  font-size: 9px;
  line-height: 1.15;
}
.market-notice-text {
  flex: 1;
  min-width: 0;
  max-block-size: 2.9em;
  margin: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #e8edf5;
  line-height: 1.45;
  scrollbar-width: thin;
}
.market-notice-text:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.topbar-controls { display: flex; align-items: center; gap: 8px; }
.topbar-refresh {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #17222d;
  color: #d3deec;
  cursor: pointer;
  white-space: nowrap;
  font-size: 12px;
}
.topbar-refresh:hover { background: #223940; color: #b0eee3; }
.market-switch { display: flex; padding: 4px; gap: 4px; border: 1px solid var(--line); background: #101720; border-radius: 9px; }
.market-switch button {
  min-height: 35px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}
.market-switch button:hover { color: #eef8fa; }
.market-switch button[aria-pressed="true"] { color: #b0eee3; background: #223940; border-color: #375861; }

.desk { display: grid; grid-template-columns: minmax(192px, 268px) minmax(0, 1fr); gap: 16px; margin-top: 24px; align-items: start; }
.panel { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.watchlist { padding: 0 8px 8px; }
.watchlist-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 8px 13px; }
.watchlist-heading h2 { margin: 0; font-size: 14px; white-space: nowrap; }
.watchlist-heading > span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.catalog-controls { margin-bottom: 6px; }
.instrument-search { position: relative; margin: 0 3px; }
.instrument-search input {
  width: 100%;
  height: 38px;
  padding: 0 9px 0 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101720;
  color: #e8edf5;
  font: inherit;
  font-size: 12px;
}
.instrument-search input::placeholder { color: #a4afbf; }
.search-icon {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 12px;
  width: 10px;
  height: 10px;
  border: 1px solid #a4afbf;
  border-radius: 50%;
  pointer-events: none;
}
.search-icon::after {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 5px;
  border-top: 1px solid #a4afbf;
  content: '';
  transform: rotate(45deg);
}
.catalog-summary {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 5px;
  min-height: 26px;
  padding: 8px 7px 0;
  color: var(--muted);
  font-size: 10px;
}
.catalog-status { padding: 3px 7px; color: var(--muted); font-size: 11px; }
.retry-catalog {
  margin: 4px 7px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #101720;
  color: #b0eee3;
  cursor: pointer;
  font-size: 11px;
}
.instruments { display: grid; min-width: 0; gap: 4px; }
.instruments.catalog-list {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  max-height: clamp(285px, 65vh, 750px);
  overflow: hidden scroll;
  padding: 2px 5px 2px 2px;
  scrollbar-color: #4b6575 #111923;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}
.instrument-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  gap: 6px;
  padding: 6px 10px 6px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #d3deec;
  text-align: left;
  cursor: pointer;
}
.instrument-row:hover { background: #1d2937; }
.instrument-row[aria-pressed="true"] { background: #1d323c; border-color: #365762; color: #dbf5f2; }
.instrument-row-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.instrument-row-ticker { color: #a0aec2; font: 650 11px ui-monospace, monospace; letter-spacing: .025em; }
.instrument-row[aria-pressed="true"] .instrument-row-ticker { color: #a5e6da; }
.catalog-list .instrument-row {
  display: flex;
  min-height: 45px;
  padding: 5px 7px;
  background: #17212c;
}
.catalog-list .instrument-row:hover { background: #1d2937; }
.catalog-list .instrument-row[aria-pressed="true"] { background: #1d323c; }
.catalog-list .instrument-row:focus-visible { outline-offset: -2px; }
.instrument-row-identity { display: grid; min-width: 0; gap: 3px; }
.instrument-row-ticker-line { display: flex; align-items: center; min-width: 0; gap: 5px; }
.instrument-row-rank { flex: none; min-width: 25px; padding: 1px 3px; border-radius: 4px; background: #263c45; color: #a9e2d5; font-size: 10px; font-weight: 700; line-height: 1.2; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.catalog-list .instrument-row-name { overflow: hidden; font-size: 11px; font-weight: 500; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.catalog-list .instrument-row-ticker { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.instrument-row-volume { flex: none; color: #9cb5cb; font: 600 11px ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.instrument-list-empty { padding: 12px 7px; margin: 0; color: var(--muted); font-size: 12px; }

.chart { overflow: hidden; }
.chart-heading { min-height: 72px; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.chart-identity { min-width: 0; display: flex; align-items: center; gap: 12px; }
.chart-identity > div { min-width: 0; overflow-wrap: anywhere; }
.instrument-icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 37px;
  border: 1px solid #3d4d76;
  border-radius: 7px;
  background: #242e48;
  color: #bdccff;
  font: 700 10px ui-monospace, monospace;
}
.instrument-icon[data-market="crypto"] { border-color: #3b615e; background: #203a3d; color: #a7ead9; }
.instrument-icon[data-market="us-perp"] { border-color: #60517e; background: #352749; color: #e0c2ff; }
.chart-identity h2 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.chart-identity p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.public-chart-trade-price { display: inline-grid; flex: none; grid-template-columns: 11ch 1em; align-items: center; gap: 3px; color: #f5f7fa; font-size: clamp(14px, 1.3vw, 20px); font-weight: 650; font-variant-numeric: tabular-nums; text-align: end; white-space: nowrap; }
.public-chart-trade-price[data-direction="up"] { color: #00d5a6; }
.public-chart-trade-price[data-direction="down"] { color: #ff4866; }
.feed-badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 7px;
  background: #1b3433;
  border: 1px solid #365954;
  color: #a7e8d8;
  border-radius: 5px;
  padding: 6px 8px;
  font-size: 12px;
}
.feed-badge[data-delayed="true"] { background: #3a3021; border-color: #695534; color: #ffd19a; }
.feed-badge > span { width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.chart-surface { position: relative; height: clamp(470px, 71vh, 820px); height: clamp(470px, 71svh, 820px); background: #131821; }
.chart-host { width: 100%; height: 100%; }
.tradingview-widget-container { display: flex; flex-direction: column; width: 100%; height: 100%; }
.tradingview-widget-container__widget { min-height: 0; flex: 1; }
.tradingview-widget-container iframe { display: block; width: 100%; max-width: 100%; }
.tradingview-widget-container .tradingview-widget-copyright {
  min-height: 29px;
  flex: none;
  display: flex;
  align-items: center;
  gap: .3em;
  padding: 4px 12px;
  text-align: left;
  border-top: 1px solid #263245;
  background: #141c27;
  color: var(--muted);
  font-size: 11px;
}
.tradingview-widget-copyright a { color: #a8c6f6; }
.chart-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 16px;
  background: #131821;
  color: #b9c9dd;
  text-align: center;
}
.chart-status p { margin: 0; }
.chart-status button { padding: 7px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; color: #dceaff; cursor: pointer; }
.chart-surface noscript { position: absolute; inset: 0; display: grid; place-items: center; background: #131821; }
.signal-feed-note { margin: 0; padding: 8px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.public-market-tools { display: grid; align-items: start; gap: 10px; padding: 12px; border-top: 1px solid #293548; background: #151d27; }
.public-market-schedule { display: grid; gap: 8px; min-width: 0; padding: 10px; border: 1px solid #293a4e; border-radius: 7px; background: #121b25; color: #d4dfed; }
.public-market-schedule-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.public-market-schedule-heading h3 { margin: 0; font-size: 13px; }
.public-market-schedule-heading span { color: #a9bbd0; font-size: 11px; white-space: nowrap; }
.public-market-expiries { min-height: 75px; margin: 0; padding: 0; list-style: none; }
.public-market-expiries li { display: grid; grid-template-columns: minmax(0, 1fr) auto 4ch; gap: 8px; padding: 5px 0; border-top: 1px solid #253140; font-size: 11px; font-variant-numeric: tabular-nums; }
.public-market-expiries li strong { text-align: end; }
.public-market-expiries time, .public-market-expiries .public-market-expiry-status { color: #a9bbd0; }
.public-market-schedule-divider { width: 100%; margin: 3px 0; border: 0; border-top: 1px dashed #52647a; }
.public-economic-calendar { display: grid; gap: 8px; min-width: 0; }
.public-economic-days { display: flex; gap: 4px; flex: none; }
.public-economic-days button { min-height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; background: #18222e; color: #a9bbd0; font-size: 12px; cursor: pointer; }
.public-economic-days button[aria-selected="true"] { border-color: #375861; background: #223940; color: #b0eee3; }
.public-economic-viewport { max-height: 248px; min-height: 52px; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-gutter: stable; border: 1px solid #253140; border-radius: 6px; background: #101821; }
.public-economic-viewport:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.public-economic-status { margin: 0; padding: 10px; color: #a9bbd0; font-size: 12px; line-height: 1.4; }
.public-economic-events { margin: 0; padding: 0; list-style: none; }
.public-economic-events li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.public-economic-events li + li { border-top: 1px solid #253140; }
.public-economic-stars { flex: none; color: #ffcf80; letter-spacing: .06em; }
@media (min-width: 1380px) {
  .public-market-tools:has(> .public-trade-pane) { grid-template-columns: minmax(0, 2fr) minmax(480px, 1fr); }
}
.ad-slot {
  margin: 16px 0 0;
  border-radius: 8px;
  overflow: hidden;
  background: #121922;
}
.ad-slot picture,
.ad-slot img { display: block; width: 100%; }
.ad-slot img { height: auto; }
.ad-link { display: block; border-radius: inherit; cursor: pointer; }
.ad-link:hover img { filter: brightness(1.08); }
.ad-link:focus-visible { outline: 2px solid #7fd6e0; outline-offset: 2px; }
.page-footer { display: flex; justify-content: space-between; gap: 10px 18px; flex-wrap: wrap; padding-block: 16px 22px; color: var(--muted); font-size: 11px; }
.page-footer p { margin: 0; }
.chart-license summary { cursor: pointer; }
.chart-license[open] { flex-basis: 100%; }
.chart-license p { margin-block: 6px 4px; }
.chart-license a { color: inherit; margin-inline-end: 10px; }
.privacy-policy { min-width: 0; }
.privacy-policy[open] { flex-basis: 100%; }
.privacy-policy summary { color: #becfe1; cursor: pointer; }
.privacy-policy-body { max-width: 780px; padding: 14px 16px; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: #bfcede; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.privacy-policy-body h2 { margin: 0 0 3px; font-size: 17px; color: #e4edf6; }
.privacy-policy-body h3 { margin: 15px 0 4px; font-size: 14px; color: #e4edf6; }
.privacy-policy-body .privacy-date { color: var(--muted); font-size: 12px; }
.privacy-policy-body dl { display: grid; grid-template-columns: minmax(100px, max-content) minmax(0, 1fr); gap: 7px 12px; margin: 4px 0; }
.privacy-policy-body dt { font-weight: 600; }
.privacy-policy-body dd { margin: 0; }
.privacy-policy-body p + p { margin-top: 6px; }
.privacy-policy-body a { color: #9adbd5; }
@media (max-width: 600px) {
  .privacy-policy-body dl { display: block; }
  .privacy-policy-body dt:not(:first-child) { margin-top: 7px; }
}
.trading-disclaimer { flex-basis: 100%; padding-inline-end: 64px; }

@media (max-width: 955px) {
  .topbar-inner { flex-wrap: wrap; }
  .topbar-inner > .market-notice { order: 1; flex-basis: 100%; grid-area: 4 / 1 / 5 / 3; margin-bottom: 8px; }
  .topbar-with-stats > .market-notice { margin-bottom: 0; }
}

@media (max-width: 860px) {
  .page-width { width: min(100% - 28px, 1580px); }
  .desk { grid-template-columns: minmax(153px, 195px) minmax(0, 1fr); gap: 12px; margin-top: 16px; }
}

@media (max-width: 740px) {
  .page-width { width: calc(100% - 20px); }
  .topbar-inner { min-height: 65px; gap: 9px; }
  .brand { gap: 8px; }
  .brand h1 { font-size: 20px; }
  .brand-mark { width: 30px; height: 30px; padding-bottom: 6px; border-radius: 6px; }
  .topbar-controls { gap: 4px; }
  .topbar-refresh { min-height: 36px; padding-inline: 6px; font-size: 11px; }
  .market-switch { gap: 2px; }
  .market-switch button { padding: 0 9px; font-size: 12px; min-height: 30px; }
  .desk { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 10px; }
  .watchlist-heading { padding-block: 9px 7px; }
  .instrument-search input { font-size: 16px; }
  .instruments { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .instruments.catalog-list { max-height: 138px; }
  .instrument-row { display: grid; align-content: center; min-height: 44px; gap: 2px; padding: 6px 8px; background: #18222e; }
  .instrument-row-name { font-size: 12px; }
  .instrument-row-ticker { font-size: 10px; }
  .catalog-list .instrument-row { min-height: 42px; }
  .catalog-list .instrument-row-identity { display: flex; flex: 1; align-items: baseline; gap: 7px; }
  .chart-heading { display: grid; grid-template-columns: minmax(0, 1fr); padding: 9px 10px; gap: 7px; }
  .chart-identity { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; }
  .instrument-icon { width: 39px; height: 33px; font-size: 9px; }
  .chart-identity h2 { font-size: 15px; }
  .chart-identity p { font-size: 11px; }
  .public-chart-trade-price { grid-template-columns: minmax(0, auto) 1em; font-size: clamp(14px, 4vw, 18px); }
  .feed-badge { gap: 5px; padding: 5px 7px; font-size: 11px; }
  .chart-surface { height: clamp(380px, 58vh, 650px); height: clamp(380px, 58svh, 650px); }
}

@media (max-width: 360px) {
  .market-switch { padding: 3px; }
  .market-switch button { padding-inline: 5px; }
  .topbar-quick-actions .topbar-refresh { padding-inline: 5px; }
}

.topbar-refresh[data-update="new"] { border-color: #f0b35a; color: #ffe1ae; animation: topbar-refresh-pulse 1.6s ease-in-out infinite; }
.topbar-refresh-new { display: inline-block; margin-inline-start: 2px; padding: 1px 5px; border-radius: 999px; background: #f0b35a; color: #1a1205; font-size: 10px; font-weight: 800; letter-spacing: .04em; vertical-align: 1px; }
@keyframes topbar-refresh-pulse { 50% { box-shadow: 0 0 0 4px rgb(240 179 90 / .22); } }
@media (prefers-reduced-motion: reduce) { .topbar-refresh[data-update="new"] { animation: none; } }

/* Opening screen: hides the half-built page on first load and reveals it in one go. */
.opening {
  position: fixed; inset: 0; z-index: 2147483000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(120% 90% at 50% 38%, #18222e 0%, #10151c 62%);
  transition: opacity .35s ease, visibility 0s .35s;
  animation: opening-timeout .35s ease 8s forwards;
}
.opening.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.opening .brand-mark { width: 54px; height: 54px; gap: 4px; padding-bottom: 14px; border-radius: 14px; }
.opening strong { font-size: 24px; letter-spacing: -.045em; }
.opening-text { color: var(--muted); font-size: 14px; }
.opening-bar { width: 132px; height: 3px; margin-top: 6px; border-radius: 3px; background: #223040; overflow: hidden; }
.opening-bar i { display: block; width: 40%; height: 100%; border-radius: 3px; background: var(--accent); animation: opening-slide 1.15s ease-in-out infinite; }
@keyframes opening-slide { from { transform: translateX(-110%); } to { transform: translateX(260%); } }
@keyframes opening-timeout { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@media (prefers-reduced-motion: reduce) { .opening-bar i { animation: none; width: 100%; opacity: .5; } }

/* Site name: the short name with what it stands for underneath. */
.brand-name { display: flex; flex-direction: column; gap: 2px; line-height: 1.05; }
.brand-full { color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .14em; white-space: nowrap; }
.opening .brand-full { font-size: 12px; margin-top: -8px; }
@media (max-width: 740px) { .brand-full { font-size: 9.5px; letter-spacing: .08em; } }

/* Site mark: a wizard (마법의 타점) on the same dark tile as before. */
.brand-mark, .opening .brand-mark { align-items: center; padding: 0; }
.brand-mark svg { width: 82%; height: 82%; display: block; }
.wizard-hat { fill: var(--accent); }
.wizard-beard { fill: #e8edf5; }
.wizard-staff { fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; }
@media (max-width: 740px) { .brand-mark { padding: 0; } }

/* Today's visitor count beside the list title. */
.watchlist-heading > .visitors-today { display: inline-flex; align-items: baseline; gap: 3px; font-size: 11px; color: var(--muted); }
.visitors-today::before { content: ""; align-self: center; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: var(--accent); }
.visitors-today strong { color: #e8edf5; font-size: 13px; font-variant-numeric: tabular-nums; }
.brand-mark { flex: none; }
