:root {
    --hd-ink: #17212e;
    --hd-subtle: #5a6778;
    --hd-line: #dfe5ec;
    --hd-wash: #f4f6f9;
    --hd-accent: #ffae45;
    --hd-link: #165b96;
    --hd-up: #ba2436;
    --hd-down: #135dac;
    --hd-max: 1224px;
}

.market-body { margin: 0; background: #fff; color: var(--hd-ink); }
.hd-wrap { width: min(calc(100% - 40px), var(--hd-max)); margin-inline: auto; }
.hd-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hd-skip { position: absolute; left: 12px; top: 12px; transform: translateY(-150%); background: #fff; padding: .5rem .8rem; z-index: 100; color: var(--hd-ink); }
.hd-skip:focus { transform: none; }
#hd-content:focus { outline: none; }
.hd-masthead, .hd-footer {
    box-sizing: border-box;
    font-family: system-ui, "Malgun Gothic", sans-serif;
    font-size: 14px;
    line-height: 1.4;
}
.hd-masthead { background: #19202b; color: #fff; }
.hd-masthead a { color: inherit; text-decoration: none; }
.hd-masthead a:hover { color: #ffcf8e; }
.hd-top {
    display: grid;
    grid-template-columns: max-content minmax(160px, 480px) minmax(max-content, 1fr);
    align-items: center;
    gap: clamp(14px, 3vw, 42px);
    min-height: 64px;
}
.hd-brand { display: inline-flex; align-items: center; gap: 9px; font-size: 23px; font-weight: 800; letter-spacing: -.045em; white-space: nowrap; }
.hd-brand-accent { margin-left: 4px; color: var(--hd-accent); }
.hd-brand-mark { display: inline-flex; align-items: end; gap: 3px; height: 22px; transform: skew(-12deg); }
.hd-brand-mark i { width: 4px; background: var(--hd-accent); }
.hd-brand-mark i:nth-child(1) { height: 7px; }
.hd-brand-mark i:nth-child(2) { height: 12px; }
.hd-brand-mark i:nth-child(3) { height: 18px; }
.hd-global-search { display: flex; align-items: stretch; min-width: 0; margin: 0; border: 1px solid #d4dbe6; background: #fff; color: #304052; border-radius: 5px; }
.hd-masthead .hd-global-search input {
    min-width: 0; width: 100%; min-height: 36px; padding: 0 11px; border: 0; border-radius: 5px 0 0 5px;
    color: var(--hd-ink); background: #fff; font: inherit; box-shadow: none;
}
.hd-global-search input::placeholder { color: #5e6a79; }
.hd-masthead .hd-global-search button {
    display: grid; place-items: center; width: 40px; flex: 0 0 40px; min-height: 36px;
    height: auto; margin: 0; padding: 0; border: 0; border-radius: 0 5px 5px 0;
    color: #344457; background: #fff; box-shadow: none; font: inherit;
}
.hd-masthead .hd-global-search button:hover { background: #f0f3f7; transform: none; }
.hd-account-links { display: flex; align-items: center; justify-content: flex-end; gap: 14px; font-weight: 650; white-space: nowrap; }
.hd-account-links form { margin: 0; }
.hd-masthead .hd-account-cta {
    border: 1px solid var(--hd-accent); background: var(--hd-accent); color: #202329; padding: 7px 12px; border-radius: 4px;
}
.hd-masthead .hd-account-cta:hover { background: #ffc97f; color: #202329; }
.hd-masthead .hd-logout { height: auto; width: auto; margin: 0; padding: 0; border: 0; background: transparent; color: #f4f5f7; font: inherit; box-shadow: none; }
.hd-masthead .hd-logout:hover { transform: none; color: #ffcf8e; }
.hd-main-nav { border-top: 1px solid #313c4b; background: #222b38; }
.hd-nav-items { display: flex; overflow-x: auto; scrollbar-width: thin; }
.hd-nav-items a {
    flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 43px; padding: 0 14px;
    border-bottom: 3px solid transparent; color: #e6eaf0; font-weight: 650; white-space: nowrap;
}
.hd-nav-items a:first-child { padding-left: 10px; }
.hd-nav-items a[aria-current="page"] { color: #fff; border-bottom-color: var(--hd-accent); background: #303b4b; }
.hd-masthead :is(a, button, input):focus-visible { outline: 2px solid var(--hd-accent); outline-offset: 2px; }
.hd-footer { margin-top: 36px; padding: 19px 0; border-top: 1px solid var(--hd-line); background: var(--hd-wash); color: var(--hd-subtle); }
.hd-footer-row, .hd-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.hd-footer-row { justify-content: space-between; }
.hd-footer a { color: var(--hd-link); text-decoration: none; }
.hd-footer a:hover { text-decoration: underline; }
.hd-footer-divider { color: #a4b0bf; margin-inline: 3px; }

.hd-page { width: min(calc(100% - 40px), var(--hd-max)); margin-inline: auto; padding: 24px 0 0; min-width: 0; }
.hd-crumb { margin: 0 0 10px; color: var(--hd-subtle); font-size: 12px; font-weight: 650; }
.hd-crumb a { color: var(--hd-link); text-decoration: none; }
.hd-crumb span { margin-inline: 5px; }
.hd-page-title { margin: 0 0 8px; font-size: clamp(25px, 3vw, 34px); line-height: 1.2; font-weight: 750; letter-spacing: -.035em; }
.hd-muted { color: var(--hd-subtle); }
.hd-up { color: var(--hd-up); font-weight: 650; }
.hd-down { color: var(--hd-down); font-weight: 650; }
.hd-panel { min-width: 0; border: 1px solid var(--hd-line); border-radius: 5px; background: #fff; }
.hd-panel-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--hd-line); }
.hd-panel-heading > :is(h2, h3) { margin: 0; font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
.hd-panel-heading a { color: var(--hd-link); font-size: 13px; text-decoration: none; }
.hd-panel-heading a:hover { text-decoration: underline; }
.hd-section-title { font-weight: 750; letter-spacing: -.02em; }
.hd-pill { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 4px; border: 1px solid var(--hd-line); color: var(--hd-subtle); background: var(--hd-wash); font-size: 12px; line-height: 1.4; white-space: nowrap; }
.hd-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(245px, .32fr); align-items: start; gap: 20px; }
.hd-grid > * { min-width: 0; }

.market-body .table { --bs-table-color: var(--hd-ink); --bs-table-border-color: var(--hd-line); --bs-table-hover-bg: #f2f7fc; margin-bottom: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.market-body .table-light { --bs-table-bg: var(--hd-wash); --bs-table-color: #364355; }
.market-body .table > :not(caption) > * > * { padding: .56rem .75rem; }
.market-body .table thead th { font-size: 12px; font-weight: 700; }
.market-body .table tbody tr:last-child > * { border-bottom-width: 0; }
.market-body .table a, .market-body .table .btn-link { color: var(--hd-link); font-weight: 650; text-decoration: none; }
.market-body .table a:hover, .market-body .table .btn-link:hover { text-decoration: underline; }
.market-body .btn-primary { --bs-btn-bg: #165b96; --bs-btn-border-color: #165b96; --bs-btn-hover-bg: #0e487a; --bs-btn-hover-border-color: #0e487a; --bs-btn-active-bg: #0c3d68; --bs-btn-active-border-color: #0c3d68; }
.market-body :is(.form-control, .form-select) { border-color: #cbd4df; }
.market-body :is(.form-control, .form-select):focus { border-color: #5487b4; box-shadow: 0 0 0 2px #dceaf7; }
.hd-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; border-bottom: 1px solid var(--hd-line); }
.hd-tabs .nav-link {
    flex: 0 0 auto; border: 0; border-radius: 0; border-bottom: 3px solid transparent;
    padding: 9px 14px; margin: 0; background: #fff; color: #465264; font-weight: 650; white-space: nowrap;
}
.hd-tabs .nav-link:hover { color: var(--hd-link); background: var(--hd-wash); }
.hd-tabs .nav-link.active { color: var(--hd-ink); border-bottom-color: #cf710d; background: #fff; }
.hd-toolbar {
    display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; padding: 10px 12px;
    border: 1px solid var(--hd-line); border-radius: 5px; background: var(--hd-wash); font-size: 14px;
}
.hd-toolbar .form-label { margin-bottom: 4px; font-size: 12px; font-weight: 650; color: #465264; }
.hd-chart-scroll { overflow-x: auto; }
.hd-chart-scroll svg { min-width: 560px; }
.hd-quote-head { border-bottom: 1px solid var(--hd-line); padding-bottom: 13px; margin-bottom: 12px; }
.hd-quote-price { margin-right: 8px; color: var(--hd-ink); font-size: clamp(25px, 4vw, 37px); font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.hd-price-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hd-price-grid div { padding: 8px 12px; border-right: 1px solid var(--hd-line); }
.hd-price-grid div:last-child { border-right: 0; }
.hd-price-grid dt { margin-bottom: 2px; font-size: 12px; font-weight: 600; color: var(--hd-subtle); }
.hd-price-grid dd { margin: 0; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hd-stat-list { padding: 0 14px; margin: 0; }
.hd-stat-list div { display: grid; gap: 3px; padding: 11px 0; border-bottom: 1px solid var(--hd-line); }
.hd-stat-list div:last-child { border-bottom: 0; }
.hd-stat-list dt { color: var(--hd-subtle); font-size: 12px; font-weight: 600; }
.hd-stat-list dd { margin: 0; font-size: 14px; }

@media (max-width: 860px) {
    .hd-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}
@media (max-width: 650px) {
    .hd-wrap, .hd-page { width: calc(100% - 24px); }
    .hd-top { grid-template-columns: auto 1fr; gap: 9px; padding-block: 10px; }
    .hd-brand { font-size: 19px; gap: 6px; }
    .hd-account-links { grid-column: 2; grid-row: 1; gap: 9px; font-size: 12px; }
    .hd-account-links .hd-admin-link { display: none; }
    .hd-global-search { grid-column: 1 / -1; }
    .hd-nav-items a { padding: 0 10px; min-height: 39px; font-size: 13px; }
    .hd-page { padding-top: 18px; }
    .hd-price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hd-price-grid div:nth-child(2) { border-right: 0; }
    .hd-price-grid div:nth-child(-n+2) { border-bottom: 1px solid var(--hd-line); }
}
