/* US Markets — terminal board. Builds on screener.css for tokens / aurora. */

.us-page {
    max-width: 1440px;
    padding-top: 18px;
}

/* The page masthead already names the board; the leftover .top header
   was a second title sitting under the command bar. */
body:has(.us-page) header.top {
    display: none;
}

.us-page .hero,
.us-page .hero-title,
.us-page .hero-sub {
    display: none;
}

/* ---- masthead ---- */
.us-mast {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px 28px;
    margin: 0 0 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--card-brd);
}
.us-mast h1 {
    margin: 0;
    font-size: clamp(26px, 3.2vw, 38px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    background: linear-gradient(120deg, #fff 10%, #c4b5fd 55%, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.us-lede {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13.5px;
    max-width: 520px;
}

.us-session {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    justify-content: flex-end;
}
.us-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--card-brd);
    background: rgba(255, 255, 255, 0.03);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.us-pill i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #5a5f72;
}
.us-pill.on i {
    background: var(--up);
    box-shadow: 0 0 0 4px var(--up-soft);
    animation: usPulse 1.8s ease-out infinite;
}
.us-pill.pre i { background: var(--amber); box-shadow: 0 0 0 4px rgba(245, 182, 81, 0.18); }
.us-pill.after i { background: var(--violet); box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.18); }
.us-clock {
    font-family: "JetBrains Mono", monospace;
    font-size: 13px;
    color: var(--txt);
    letter-spacing: -0.02em;
}
.us-clock small {
    color: var(--faint);
    font-weight: 600;
    margin-left: 8px;
    font-family: Inter, system-ui, sans-serif;
    letter-spacing: 0.02em;
}

@keyframes usPulse {
    0% { box-shadow: 0 0 0 0 rgba(22, 209, 149, 0.55); }
    100% { box-shadow: 0 0 0 8px rgba(22, 209, 149, 0); }
}

/* ---- ticker ---- */
.us-ticker {
    position: relative;
    overflow: hidden;
    margin: 0 0 18px;
    border: 1px solid var(--card-brd);
    border-radius: 12px;
    background: rgba(12, 13, 24, 0.7);
    mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
.us-ticker-track {
    display: flex;
    gap: 0;
    width: max-content;
    animation: usMarquee 55s linear 4s infinite;
}
.us-ticker:hover .us-ticker-track { animation-play-state: paused; }
.us-tick {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 10px 18px;
    border-right: 1px solid var(--card-brd);
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    white-space: nowrap;
}
.us-tick:hover { background: rgba(99, 102, 241, 0.08); }
.us-tick .k {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--faint);
}
.us-tick .v {
    font-family: "JetBrains Mono", monospace;
    font-size: 12.5px;
    font-weight: 700;
}
.us-tick .p { font-size: 12px; font-weight: 700; }

@keyframes usMarquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.up { color: var(--up); }
.dn { color: var(--down); }

/* ---- entrance ---- */
.us-in {
    animation: usIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.us-in-2 { animation-delay: 0.05s; }
.us-in-3 { animation-delay: 0.1s; }
.us-in-4 { animation-delay: 0.15s; }
.us-in-5 { animation-delay: 0.2s; }

@keyframes usIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .us-in, .us-ticker-track, .us-pill.on i { animation: none !important; }
}

/* ---- panels ---- */
.us-panel {
    margin: 0 0 18px;
    padding: 16px 16px 14px;
    border-radius: 16px;
    border: 1px solid var(--card-brd);
    background: linear-gradient(180deg, rgba(22, 24, 40, 0.72), rgba(16, 18, 32, 0.55));
}
.us-panel-h {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 16px;
    margin: 0 0 14px;
}
.us-panel-h h2 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c9cde3;
}
.us-panel-h p {
    margin: 0;
    font-size: 12px;
    color: var(--faint);
}

.us-msg {
    text-align: center;
    color: var(--muted);
    padding: 28px 8px;
}

/* ---- KPIs ---- */
.us-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 18px;
}
.us-kpi {
    padding: 14px 14px 12px;
    border-radius: 14px;
    border: 1px solid var(--card-brd);
    background: rgba(22, 24, 40, 0.65);
    min-width: 0;
}
.us-kpi > span {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 6px;
}
.us-kpi b {
    display: block;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.us-breadth {
    display: flex;
    height: 5px;
    border-radius: 99px;
    overflow: hidden;
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.06);
}
.us-breadth i { display: block; height: 100%; }
.us-breadth .u { background: var(--up); }
.us-breadth .d { background: var(--down); }

/* ---- Mag 7 ---- */
.us-mag {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}
.us-mag a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 12px 12px;
    border-radius: 14px;
    border: 1px solid var(--card-brd);
    background: rgba(10, 11, 20, 0.45);
    text-decoration: none;
    color: inherit;
    min-width: 0;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.us-mag a::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--faint);
}
.us-mag a.is-up::before { background: var(--up); }
.us-mag a.is-dn::before { background: var(--down); }
.us-mag a:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(99, 102, 241, 0.08);
}
.us-mag .sym {
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.04em;
}
.us-mag .nm {
    font-size: 11px;
    color: var(--faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.us-mag .px {
    margin-top: 8px;
    font-family: "JetBrains Mono", monospace;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.03em;
}
.us-mag .chg {
    display: inline-flex;
    margin-top: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    width: fit-content;
}
.us-mag a.is-up .chg { background: var(--up-soft); }
.us-mag a.is-dn .chg { background: var(--down-soft); }

/* ---- split ---- */
.us-split {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 14px;
    margin: 0 0 18px;
}

.us-seg {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 3px;
    margin: 0 0 12px;
    border-radius: 11px;
    border: 1px solid var(--card-brd);
    background: rgba(255, 255, 255, 0.02);
    width: fit-content;
}
.us-seg button {
    padding: 6px 11px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.us-seg button:hover { color: var(--txt); }
.us-seg button.on {
    background: rgba(99, 102, 241, 0.92);
    color: #fff;
}

/* ---- hot list ---- */
.us-hot { width: 100%; border-collapse: collapse; font-size: 13px; }
.us-hot th {
    text-align: left;
    font-size: 10px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 700;
    padding: 0 8px 8px 0;
}
.us-hot td, .us-hot th:nth-child(n+3) { text-align: right; }
.us-hot th:first-child, .us-hot td:first-child,
.us-hot th:nth-child(2), .us-hot td:nth-child(2) { text-align: left; }
.us-hot td {
    padding: 8px 8px 8px 0;
    border-top: 1px solid var(--card-brd);
    white-space: nowrap;
}
.us-hot tbody tr {
    cursor: pointer;
    transition: background 0.12s ease;
}
.us-hot tbody tr:hover { background: rgba(99, 102, 241, 0.07); }
.us-hot .rk {
    color: var(--faint);
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    width: 22px;
}
.us-hot a { color: inherit; text-decoration: none; font-weight: 800; }
.us-hot a:hover { color: #c7d2fe; }
.us-hot .nm {
    display: block;
    font-weight: 500;
    color: var(--faint);
    font-size: 11px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.us-hot .chip {
    display: inline-block;
    min-width: 64px;
    padding: 2px 7px;
    border-radius: 6px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.us-hot .chip.up { background: var(--up-soft); }
.us-hot .chip.dn { background: var(--down-soft); }

/* ---- sector heat ---- */
.us-heat {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 7px;
}
.us-tile {
    padding: 10px 10px 9px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    min-height: 72px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.16s ease, filter 0.16s ease;
}
.us-tile:hover { transform: translateY(-2px); filter: brightness(1.08); }
.us-tile .n {
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.25;
}
.us-tile .p {
    font-family: "JetBrains Mono", monospace;
    font-size: 13px;
    font-weight: 800;
}
.us-tile .c { font-size: 10.5px; opacity: 0.8; }

/* ---- universe ---- */
.us-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 0 0 12px;
}
.us-search {
    flex: 1 1 240px;
    min-width: 180px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--card-brd);
    background: rgba(255, 255, 255, 0.03);
    color: var(--txt);
    font: inherit;
    font-size: 13.5px;
}
.us-search:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.7);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}
.us-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.us-chip {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--card-brd);
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.us-chip:hover { color: var(--txt); }
.us-chip.on {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.5);
    color: #c7d2fe;
}

.us-tablewrap { overflow-x: auto; }
.us-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.us-tbl th {
    text-align: right;
    font-size: 10px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 700;
    padding: 8px 10px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--card-brd);
}
.us-tbl th:first-child, .us-tbl td:first-child { text-align: left; padding-left: 4px; }
.us-tbl td {
    padding: 9px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.us-tbl tbody tr { cursor: pointer; transition: background 0.12s ease; }
.us-tbl tbody tr:hover { background: rgba(99, 102, 241, 0.08); }
.us-tbl .sym { font-weight: 800; letter-spacing: 0.02em; }
.us-tbl .co {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--faint);
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.us-more { display: flex; justify-content: center; padding: 14px 0 2px; }
.us-more button {
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid var(--card-brd);
    background: rgba(255, 255, 255, 0.03);
    color: var(--txt);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.us-more button:hover { border-color: rgba(99, 102, 241, 0.5); }

/* ---- news ---- */
.us-news {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
}
.us-n {
    display: block;
    padding: 11px 0;
    border-top: 1px solid var(--card-brd);
    text-decoration: none;
    color: inherit;
    transition: color 0.15s ease;
}
.us-n:hover .t { color: #c7d2fe; }
.us-n .t { font-weight: 650; font-size: 13.5px; line-height: 1.4; }
.us-n .m { margin-top: 4px; font-size: 11.5px; color: var(--faint); }

/* ---- research ---- */
.us-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 16px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.us-back:hover { color: var(--txt); }

.us-rh {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    align-items: flex-end;
    justify-content: space-between;
    margin: 0 0 16px;
}
.us-rh h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
}
.us-rh .co { margin-top: 6px; color: var(--muted); font-size: 13.5px; }
.us-quote .px {
    font-family: "JetBrains Mono", monospace;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
}
.us-quote .ch { margin-top: 6px; font-size: 16px; font-weight: 700; }

.us-research {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
    gap: 14px;
    margin: 0 0 18px;
}

.us-chart {
    position: relative;
    height: 360px;
    border-radius: 14px;
    border: 1px solid var(--card-brd);
    background:
        radial-gradient(80% 80% at 50% 0%, rgba(99, 102, 241, 0.08), transparent 60%),
        rgba(10, 11, 20, 0.55);
    overflow: hidden;
}
.us-chart canvas { width: 100%; height: 100%; display: block; }
.us-tip {
    position: absolute;
    pointer-events: none;
    padding: 7px 9px;
    border-radius: 8px;
    background: rgba(10, 11, 20, 0.94);
    border: 1px solid var(--card-brd);
    font-size: 11.5px;
    font-family: "JetBrains Mono", monospace;
    display: none;
    white-space: nowrap;
    z-index: 2;
}
.us-chart-empty,
.us-chart-load {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 13px;
    background: rgba(10, 11, 20, 0.35);
}
.us-chart-empty[hidden],
.us-chart-load[hidden] {
    display: none !important;
}
.us-spin {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-top-color: #a5b4fc;
    border-radius: 50%;
    animation: usSpin 0.7s linear infinite;
}
@keyframes usSpin { to { transform: rotate(360deg); } }

.us-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.us-kv {
    padding: 11px 12px;
    border-radius: 12px;
    border: 1px solid var(--card-brd);
    background: rgba(10, 11, 20, 0.4);
}
.us-kv span {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 4px;
}
.us-kv b { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }

.us-range { margin: 12px 0 0; }
.us-range .lab {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 6px;
}
.us-range .trk {
    height: 6px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--down), #f5b651, var(--up));
    position: relative;
}
.us-range .trk i {
    position: absolute;
    top: -5px;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4);
}

.us-note {
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid rgba(99, 102, 241, 0.28);
    background: rgba(99, 102, 241, 0.08);
    font-size: 13px;
    line-height: 1.5;
    color: #c9cde0;
    margin: 0 0 12px;
}
.us-note b { color: var(--txt); }

.us-rel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}
.us-rel a {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--card-brd);
    text-decoration: none;
    color: inherit;
    background: rgba(22, 24, 40, 0.5);
    transition: transform 0.16s ease, border-color 0.16s ease;
}
.us-rel a:hover { transform: translateY(-2px); border-color: rgba(99, 102, 241, 0.5); }

.us-stock-news { display: flex; flex-direction: column; gap: 0; }
.us-stock-news .us-n { grid-column: auto; }

@media (max-width: 1100px) {
    .us-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .us-mag { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .us-research { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .us-split { grid-template-columns: 1fr; }
    .us-news { grid-template-columns: 1fr; }
    .us-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .us-mag { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .us-chart { height: 260px; }
}
