.hf, .hf button, .hf select, .hf input { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; }
.hf { color: #e6e8f0; font-size: 13px; font-variant-numeric: tabular-nums; }
/* The page title is the indicator's full name: scaled with the window so it stays clear of the site search. */
.header .header-left .dashboard_bar { font-size: clamp(1rem, 1.6vw, 1.75rem); white-space: nowrap; }
.hf label {
    display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 11px; font-weight: 600;
    letter-spacing: .04em; text-transform: uppercase; color: #8a90a8;
}
.hf button:focus-visible, .hf select:focus-visible, .hf input:focus-visible { outline: 2px solid #a78bfa; outline-offset: 1px; }
.hf select, .hf input[type=number], .hf input[type=date], .hf input[type=search] {
    background: #171a2e; color: #e6e8f0; border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 9px; padding: 5px 8px; font-size: 12px; font-weight: 600; color-scheme: dark; height: 32px;
}
.hf input[type=number] { width: 78px; }
.hf button { font: inherit; cursor: pointer; }
.hf-card, .hf-main, .hf-head {
    background: #21243b; border: 1px solid rgba(139, 92, 246, .2); border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.hf-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; padding: 14px 22px; margin-bottom: 14px; }
.hf .hf-head h2 { margin: 0; font-size: 28px; font-weight: 800; color: #a78bfa !important; letter-spacing: -.01em; line-height: 1.1; }
.hf-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.hf-tabs button {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 9px;
    background: #171a2e; color: #aab0c5; border: 1px solid rgba(255, 255, 255, .1); font-size: 12px; font-weight: 600;
}
.hf-tabs button:hover { color: #fff; border-color: rgba(167, 139, 250, .6); }
.hf-tabs button.on { background: #8b5cf6; color: #fff; border-color: #8b5cf6; }
.hf-tabs .x { opacity: .6; font-size: 13px; line-height: 1; }

.hf-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: stretch; }
.hf-main { padding: 14px; min-width: 0; display: flex; flex-direction: column; }
.hf-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hf-side .hf-lists { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.hf-data { grid-column: 1 / -1; min-width: 0; }

.hf-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; margin-bottom: 12px; }
.hf-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hf-settings { flex-basis: 100%; gap: 8px 16px; }
.hf-seg { display: inline-flex; border-radius: 9px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .15); }
.hf-seg button { background: #171a2e; color: #aab0c5; border: 0; height: 30px; padding: 0 11px; font-size: 12px; font-weight: 600; }
.hf-seg button:hover { color: #fff; }
.hf-seg button.on { background: #8b5cf6; color: #fff; }
.hf-toggle, .hf-btn {
    background: #171a2e; color: #aab0c5; border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 9px; height: 32px; padding: 0 11px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.hf-toggle:hover, .hf-btn:hover { color: #fff; border-color: rgba(167, 139, 250, .6); }
.hf-toggle.on { background: rgba(139, 92, 246, .28); color: #e9e3ff; border-color: #8b5cf6; }

.hf-search { position: relative; }
.hf-search input { width: 190px; }
.hf-suggest {
    position: absolute; z-index: 2; top: 100%; right: 0; width: 260px; display: none; margin-top: 3px;
    background: #171a2e; border: 1px solid rgba(255, 255, 255, .15); border-radius: 8px; overflow: hidden;
}
.hf-suggest button { display: block; width: 100%; text-align: left; background: none; border: 0; color: #e6e8f0; padding: 6px 9px; font-size: 12px; }
.hf-suggest button:hover { background: rgba(139, 92, 246, .28); }
.hf-suggest span { color: #8a90a8; margin-left: 6px; }
.hf-suggest-head { padding: 6px 9px 2px; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #8a90a8; }

.hf-indicators { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px; margin-bottom: 8px; background: #171a2e; border-radius: 8px; }
.hf-indicators[hidden], .hf-dates[hidden] { display: none; }
.hf-ind-list { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
.hf-ind-list:empty { display: none; }
.hf-ind-list button { background: #21243b; color: #e6e8f0; border: 1px solid rgba(255, 255, 255, .15); border-radius: 7px; padding: 3px 8px; font-size: 11px; }

.hf-chart { position: relative; isolation: isolate; flex: 1 0 520px; background: #171a2e; border-radius: 14px; overflow: hidden; }
:fullscreen.hf-main { background: #171a2e; padding: 12px; overflow: auto; }
.hf-legend {
    position: absolute; top: 8px; left: 72px; right: 72px; z-index: 4; display: flex; flex-wrap: wrap; gap: 2px 12px;
    font-size: 12px; color: #aab0c5; pointer-events: none;
}
.hf-legend i { display: inline-block; width: 10px; height: 3px; margin-right: 5px; vertical-align: middle; border-radius: 2px; }
.hf-legend b { color: #e6e8f0; font-weight: 600; margin-left: 3px; }
.hf-lock {
    position: absolute; z-index: 4; bottom: 4px; width: 22px; height: 20px; padding: 0; font-size: 11px;
    background: #21243b; color: #aab0c5; border: 1px solid rgba(255, 255, 255, .15); border-radius: 5px;
}
#hfLockLeft { left: 4px; }
#hfLockRight { right: 4px; }
.hf-lock.on { background: #8b5cf6; color: #fff; }
.hf-empty { position: absolute; inset: 0; z-index: 3; display: none; align-items: center; justify-content: center; text-align: center; padding: 24px; color: #aab0c5; font-size: 14px; background: #171a2e; }
.hf-coverage { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; font-size: 12px; color: #aab0c5; }
.hf-coverage b { color: #e6e8f0; font-weight: 600; }

.hf-metrics { padding: 16px; }
.hf-metrics h3 { margin: 0 0 2px; font-size: 18px; font-weight: 800; color: #fff; text-align: left; }
.hf-skeleton {
    display: block; height: 16px; margin-bottom: 10px; border-radius: 6px;
    background: linear-gradient(90deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .11), rgba(255, 255, 255, .05));
    background-size: 200% 100%; animation: hf-shimmer 1.4s linear infinite;
}
@keyframes hf-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .hf-skeleton { animation: none; } }
.hf-metrics .sub { color: #8a90a8; font-size: 12px; margin-bottom: 8px; }
.hf-metrics dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 8px 0 0; }
.hf-metrics dt { color: #aab0c5; font-weight: 400; white-space: nowrap; }
.hf-metrics dd { margin: 0; text-align: right; font-weight: 600; color: #e6e8f0; }
.hf-pos { color: #34d399 !important; }
.hf-neg { color: #f87171 !important; }

.hf-gauge { position: relative; height: 10px; min-width: 110px; border-radius: 5px; background: rgba(255, 255, 255, .12); }
.hf-gauge i { position: absolute; top: 0; bottom: 0; border-radius: 5px; background: linear-gradient(90deg, #ef4444, #facc15, #22c55e); opacity: .8; }
.hf-gauge b { position: absolute; top: -3px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; border: 2px solid #171a2e; }
.hf-gauge b.pos { background: #22c55e; }
.hf-gauge b.neg { background: #ef4444; }
.hf-gauge b.neutral { background: #facc15; }
.hf-gauge b.open { background: #171a2e; }
.hf-gauge b.open.pos { border-color: #15803d; }
.hf-gauge b.open.neg { border-color: #b91c1c; }
.hf-gauge b.open.neutral { border-color: #a16207; }

.hf-subtabs { display: flex; gap: 4px; padding: 0 6px; }
.hf-subtabs button { background: none; border: 0; color: #aab0c5; padding: 12px 11px; font-size: 13px; font-weight: 600; border-bottom: 2px solid transparent; }
.hf-subtabs button:hover { color: #fff; }
.hf-subtabs button.on { color: #fff; border-bottom-color: #8b5cf6; }
.hf-badge { display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 8px; background: #ef4444; color: #fff; font-size: 10px; }
.hf-badge[hidden] { display: none; }
.hf-list-body { flex: 1; min-height: 200px; max-height: 360px; overflow: auto; padding: 0 10px 10px; }
.hf-item {
    display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; width: 100%; padding: 6px; text-align: left;
    background: none; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .06); color: #e6e8f0; font-size: 12px;
}
.hf-item:hover { background: rgba(139, 92, 246, .14); }
.hf-item small { color: #8a90a8; grid-column: 1 / -1; }
.hf-list-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 0; }
.hf-list-tools select, .hf-list-tools input { flex: 1; min-width: 0; }
.hf-muted { color: #8a90a8; padding: 10px 6px; font-size: 12px; }

.hf-data-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 12px 2px 4px; }
.hf-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 0; }
.hf-columns { position: relative; }
.hf-columns summary { cursor: pointer; font-size: 12px; font-weight: 600; color: #aab0c5; }
.hf-columns div { position: absolute; right: 0; z-index: 2; display: grid; gap: 5px; min-width: 130px; padding: 10px; background: #171a2e; border: 1px solid rgba(255, 255, 255, .15); border-radius: 10px; }
.hf-columns label { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12px; color: #e6e8f0; }
.hf-table-wrap { isolation: isolate; max-height: 380px; overflow: auto; border-radius: 0 0 14px 14px; }
.hf-data.max { position: fixed; inset: 10px; z-index: 1100; display: flex; flex-direction: column; background: #21243b; }
.hf-data.max .hf-table-wrap { max-height: none; flex: 1; }
.hf-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.hf-table th {
    position: sticky; top: 0; z-index: 2; background: #21243b; color: #aab0c5; font-weight: 500;
    text-align: right; padding: 6px 9px; white-space: nowrap; border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.hf-table td { padding: 5px 9px; text-align: right; white-space: nowrap; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.hf-table th:first-child, .hf-table td:first-child, .hf-table th:nth-child(2), .hf-table td:nth-child(2) { text-align: left; }
.hf-table .hf-gauge { min-width: 170px; }
.hf-table tbody tr.click { cursor: pointer; }
.hf-table tbody tr:hover { background: rgba(139, 92, 246, .12); }
.hf-note { margin: 12px 2px 0; font-size: 12px; color: #8a90a8; line-height: 1.5; }

@media (max-width: 1200px) {
    .hf-grid { grid-template-columns: minmax(0, 1fr); }
    .hf-side { flex-direction: row; }
    .hf-side > .hf-card { flex: 1; min-width: 0; }
    .hf-chart { flex-basis: 440px; }
}

@media (max-width: 760px) {
    .hf-head { padding: 12px 14px; }
    .hf .hf-head h2 { font-size: 22px; }
    .hf-search, .hf-search input { width: 100%; }
    .hf-suggest { left: 0; right: auto; width: 100%; }
    .hf-side { flex-direction: column; }
    .hf-main { padding: 10px; }
    .hf-chart { flex-basis: 360px; }
    .hf-legend { left: 62px; right: 62px; font-size: 11px; }
    .hf-coverage { font-size: 11px; }
    .hf-data-head { padding: 2px 10px; }
    .hf-bar { gap: 8px; }
    .hf-group, .hf-tabs { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .hf-group::-webkit-scrollbar, .hf-tabs::-webkit-scrollbar { display: none; }
    .hf-group > *, .hf-tabs > * { flex: none; }
}

/* Guide */
.hf-head .hf-guide-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.hf-guide.modal { z-index: 1200; } /* above the site's phone menu button (1100) */
.hf-guide .modal-content { background: #21243b; color: #c9cde0; border: 1px solid rgba(139, 92, 246, .3); border-radius: 20px; }
.hf-guide .modal-header { border-bottom: 1px solid rgba(255, 255, 255, .08); padding: 16px 22px; }
.hf-guide .modal-title { color: #e6e8f0; font-weight: 700; font-size: 20px; margin: 0; }
.hf-guide .modal-body { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; padding: 18px 22px 22px; font-size: 14px; line-height: 1.6; }
.hf-guide-nav { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.hf-guide-nav a { color: #aab0c5; text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 500; }
.hf-guide-nav a:hover, .hf-guide-nav a:focus-visible { background: rgba(139, 92, 246, .15); color: #e6e8f0; }
.hf-guide section { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid rgba(255, 255, 255, .06); scroll-margin-top: 8px; }
.hf-guide section:focus { outline: none; }
.hf-guide section:last-child { border-bottom: 0; margin-bottom: 0; }
.hf-guide h5 { color: #a78bfa; font-size: 16px; font-weight: 700; margin: 0 0 8px; text-align: left; }
.hf-guide p, .hf-guide ul, .hf-guide ol { margin: 0 0 10px; }
.hf-guide ul, .hf-guide ol { padding-left: 20px; }
.hf-guide ul { list-style: disc; }
.hf-guide ol { list-style: decimal; }
.hf-guide li { display: list-item; list-style: inherit; margin-bottom: 5px; }
.hf-guide li::marker { color: #8b5cf6; }
.hf-guide b { color: #e6e8f0; font-weight: 600; }
.hf-guide-table { width: 100%; border-collapse: collapse; margin: 0 0 10px; }
.hf-guide-table th, .hf-guide-table td { padding: 8px 10px; border-top: 1px solid rgba(255, 255, 255, .06); vertical-align: top; text-align: left; }
.hf-guide-table th { width: 32%; color: #e6e8f0; font-weight: 600; white-space: normal; }
.hf-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.hf-mark { margin-right: 4px; font-size: 11px; }
.hf-mark.up { color: #22c55e; }
.hf-mark.down { color: #ef4444; }
@media (max-width: 760px) {
    .hf-head .hf-guide-btn { margin-left: 0; }
    .hf-guide .modal-body { grid-template-columns: minmax(0, 1fr); padding: 14px; }
    .hf-guide-nav { position: static; flex-direction: row; flex-wrap: wrap; }
    .hf-guide-table th { width: 40%; }
}

/* Hints and early-history states */
.hf-table th.hint { text-decoration: underline dotted rgba(170, 176, 197, .5); text-underline-offset: 3px; cursor: help; }
.hf-metrics dt[title], .hf-coverage span[title] { cursor: help; }
.hf-warn { color: #facc15 !important; }
.hf-dim { color: #8a90a8; font-weight: 400; }
.hf-dim-gauge { opacity: .4; }
.hf-gauge-note { color: #8a90a8; font-size: 11px; margin-top: 6px; }

/* Loading: a spinner over the part being loaded, the old content faded behind it */
.hf-card { position: relative; }
.hf-busy::after {
    content: ''; position: absolute; left: 50%; top: 50%; z-index: 6; width: 28px; height: 28px; margin: -14px 0 0 -14px;
    border: 3px solid rgba(255, 255, 255, .15); border-top-color: #a78bfa; border-radius: 50%;
    animation: hf-spin .8s linear infinite; pointer-events: none;
}
.hf-chart.hf-busy > :not(.hf-empty), .hf-data.hf-busy .hf-table-wrap, #hfMetrics.hf-busy > * { opacity: .4; transition: opacity .15s; }
@keyframes hf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hf-busy::after { animation-duration: 2.4s; } }

/* Shared snapshot (hifro_snapshot.html): only the controls that work on the saved data. */
.hf[data-snapshot] .hf-search, .hf[data-snapshot] #hfAddTab, .hf[data-snapshot] .hf-tabs .x,
.hf[data-snapshot] [data-list=watchlists], .hf[data-snapshot] [data-scope],
.hf[data-snapshot] label:has(#hfDays), .hf[data-snapshot] #hfDates,
.hf[data-snapshot] #hfFilters > [data-for]:not([data-for=screener]):not(.hf-columns) { display: none !important; }
.hf-share { display: inline-flex; }
