/* Home: Markets today. Colours come from theme.css tokens (light and dark). */

/* ---------- masthead ---------- */
/* clear: the top bar's floated menu would otherwise squeeze the first row */
.hm-mast { clear: both; margin: 0 0 20px; padding: 14px 0 16px; border-bottom: 3px double var(--ink); }
.hm-mast-top { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 8px; }
.hm-dateline { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--claret); }
.hm-mast h1 { margin: 0 0 8px; font-size: 40px; line-height: 1.08; font-weight: 700; letter-spacing: -.015em; }
.right_col .hm-pulse { margin: 0; max-width: 960px; font-family: var(--serif); font-size: 17.5px; line-height: 1.5; color: var(--ink2); }
.hm-status { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink2);
    background: var(--chip); border-radius: 999px; padding: 4px 6px 4px 12px; }
.hm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.hm-dot.live { background: var(--pos); animation: hm-pulse 2s infinite; }
@keyframes hm-pulse { 0% { box-shadow: 0 0 0 0 rgba(11, 122, 62, .45); } 70% { box-shadow: 0 0 0 7px rgba(11, 122, 62, 0); } 100% { box-shadow: 0 0 0 0 rgba(11, 122, 62, 0); } }
@media (prefers-reduced-motion: reduce) { .hm-dot.live { animation: none; } }
.hm-refresh { border: 0; background: var(--surface); color: var(--ink2); width: 26px; height: 26px; border-radius: 50%; cursor: pointer; }
.hm-refresh:hover { color: var(--ink); }
.hm-refresh.spin i { animation: hm-spin .8s linear infinite; }
@keyframes hm-spin { to { transform: rotate(360deg); } }

/* ---------- section heads outside cards ---------- */
.hm-block { margin-bottom: 22px; }
.hm-block-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px 16px; flex-wrap: wrap;
    margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--axis); }
.hm-block-head h2 { margin: 0; font-size: 22px; }
.hm-note { font-size: 12px; color: var(--muted); }
.hm-range-wrap { display: inline-flex; align-items: center; gap: 8px; }
.hm-range button { min-width: 34px; }

/* ---------- India tiles ---------- */
.hm-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.hm-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 10px 12px 8px; min-width: 0; position: relative; overflow: hidden; }
.hm-tile .nm { font-size: 12px; color: var(--ink2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-tile .px { font-size: 20px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin-top: 1px; }
.hm-tile .ch { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hm-tile .hm-spark { display: block; width: 100%; height: 36px; margin-top: 4px; }
.hm-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--border); }
.hm-tile.up::before { background: var(--pos); }
.hm-tile.dn::before { background: var(--neg); }
.hm-tile .rets { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 6px; margin-top: 6px; padding-top: 5px;
    border-top: 1px solid var(--grid); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.hm-tile .rets span { display: flex; justify-content: space-between; gap: 4px; padding: 1px 4px; border-radius: 4px; white-space: nowrap; }
.hm-tile .rets span.on { background: var(--chip); }
.hm-tile .rets i { font-style: normal; color: var(--muted); }
.hm-tile .rets b { font-weight: 600; color: var(--ink); }

/* ---------- research desk ---------- */
.hm-features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1299px) { .hm-features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .hm-features { grid-template-columns: minmax(0, 1fr); } }
.hm-feature { display: flex; flex-direction: column; gap: 7px; min-width: 0; background: var(--surface); color: var(--ink);
    border: 1px solid var(--border); border-top: 3px solid var(--claret); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 13px 16px 14px; transition: transform .15s, box-shadow .15s; }
.hm-feature:hover, .hm-feature:focus-visible { color: var(--ink); text-decoration: none; transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(84, 52, 28, .13); }
.hm-feature:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hm-kicker { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--claret); }
.hm-feature h3 { margin: 0; font-family: var(--serif); font-size: 19.5px; line-height: 1.22; font-weight: 700; letter-spacing: 0; color: var(--ink); }
.hm-feature:hover h3 { color: var(--accent); }
.right_col .hm-dek { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink2); }
.right_col .hm-facts { margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.hm-cta { margin-top: auto; padding-top: 4px; font-size: 13px; font-weight: 600; color: var(--accent); }
.hm-feature:hover .hm-cta { text-decoration: underline; }
/* economy: top three themes */
.hm-brief { list-style: none; margin: 0; padding: 0; counter-reset: hm-b; }
.hm-brief:empty { display: none; }
.right_col .hm-brief li { position: relative; padding: 5px 0 5px 24px; border-top: 1px solid var(--grid); font-size: 13px; line-height: 1.35; font-weight: 600; color: var(--ink); }
.hm-brief li:first-child { border-top: 0; }
.hm-brief li::before { counter-increment: hm-b; content: counter(hm-b); position: absolute; left: 2px; top: 3px;
    font-family: var(--serif); font-size: 16px; font-weight: 700; color: var(--claret); }
/* sectors: trend bar */
.hm-trend { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--chip); margin: 2px 0 6px; }
.hm-trend span { display: block; height: 100%; }
.hm-trend span + span { border-left: 2px solid var(--surface); }
.hm-legend { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.hm-legend span { white-space: nowrap; }
.hm-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.hm-legend b { color: var(--ink); font-weight: 700; }
/* valuation: P/E against its range */
.hm-val-big { font-family: var(--serif); font-size: 32px; font-weight: 700; line-height: 1; color: var(--ink); font-variant-numeric: lining-nums; }
.hm-val-big small { font-family: var(--font); font-size: 12.5px; font-weight: 500; color: var(--ink2); margin-left: 6px; letter-spacing: 0; }
.hm-gauge { position: relative; height: 6px; margin: 28px 2px 22px; border-radius: 3px; background: var(--chip); }
.hm-gauge .med { position: absolute; top: -5px; width: 2px; height: 16px; margin-left: -1px; background: var(--ink2); }
.hm-gauge .now { position: absolute; top: -5px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%;
    background: var(--claret); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--claret); }
.hm-gauge .lo, .hm-gauge .hi { position: absolute; top: 10px; font-size: 10.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hm-gauge .lo { left: 0; }
.hm-gauge .hi { right: 0; }
.hm-gauge .ml { position: absolute; bottom: 10px; font-size: 10.5px; color: var(--ink2); white-space: nowrap; transform: translateX(-50%); }

/* ---------- main grid: markets left, movers and headlines right ---------- */
.hm-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 0 18px; align-items: start; }
@media (max-width: 1199px) {
    .hm-grid { grid-template-columns: minmax(0, 1fr); }
    .hm-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 18px; align-items: start; }
}
@media (max-width: 767px) { .hm-side { grid-template-columns: minmax(0, 1fr); } }
.hm-main, .hm-side { min-width: 0; }
.hm-card { padding-bottom: 12px; container-type: inline-size; }
.hm-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px 10px; margin-bottom: 8px; flex-wrap: wrap; }
.hm-card-head h2 { margin: 0; font-size: 19px; }
.hm-more { font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.right_col .hm-foot { font-size: 11.5px; color: var(--muted); margin: 10px 0 0; line-height: 1.45; }
.hm-empty { color: var(--muted); font-size: 12.5px; padding: 8px 0; list-style: none; margin: 0; }

/* ---------- world markets table ---------- */
.hm-tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hm-tbl { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.hm-tbl th, .hm-tbl td { padding: 6px 5px; border-top: 1px solid var(--grid); white-space: nowrap; text-align: right; vertical-align: middle; }
.hm-tbl thead th { border-top: 0; border-bottom: 1px solid var(--axis); font-size: 11.5px; font-weight: 600; color: var(--muted); padding-top: 4px; }
.hm-tbl thead th[data-r] { cursor: pointer; user-select: none; -webkit-user-select: none; }
.hm-tbl thead th[data-r]:hover { color: var(--accent); }
.hm-tbl thead th.sel { color: var(--ink); }
.hm-tbl .sel { background: var(--chip); }
.hm-tbl .nm { text-align: left; font-weight: 500; color: var(--ink); }
.hm-tbl tbody .nm { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.hm-tbl .nm small { color: var(--muted); font-size: 11px; margin-left: 5px; font-weight: 400; }
.hm-tbl .px { font-weight: 600; color: var(--ink); }
.hm-tbl .rt { font-weight: 500; min-width: 54px; }
.hm-tbl tr.hm-g th { text-align: left; padding: 16px 6px 5px; border-top: 0; font-family: var(--serif); font-size: 15.5px; font-weight: 700; color: var(--ink); white-space: normal; }
.hm-tbl tbody:first-of-type tr.hm-g th { padding-top: 8px; }
.hm-tbl tr.hm-g th small { font-family: var(--font); font-size: 11.5px; font-weight: 400; color: var(--muted); margin-left: 8px; }
.hm-tbl tbody tr:not(.hm-g):hover > * { background: var(--hover); }
.hm-tbl tbody tr:not(.hm-g):hover > .sel { background: var(--chip); }
.hm-c-chart { width: 104px; }
.hm-c-chart .hm-spark { display: block; width: 96px; height: 28px; margin-left: auto; }
.hm-c-52 { width: 92px; }
.hm-52 { position: relative; height: 4px; margin: 0 4px 0 10px; border-radius: 2px; background: var(--grid); }
.hm-52 i { position: absolute; top: -3px; width: 4px; height: 10px; margin-left: -2px; border-radius: 2px; background: var(--ink); }
.hm-live { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--pos); margin-right: 6px; vertical-align: 2px; }
@container (max-width: 700px) { .hm-c-52 { display: none; } }
/* phones: only the selected period's change, next to its chart (the period buttons sit above the table) */
@container (max-width: 600px) {
    .hm-tbl .rt:not(.sel), .hm-tbl thead th[data-r]:not(.sel) { display: none; }
    .hm-tbl .sel, .hm-tbl tbody tr:not(.hm-g):hover > .sel { background: transparent; }
    .hm-tbl th, .hm-tbl td { padding-left: 4px; padding-right: 4px; }
    .hm-c-chart { width: 68px; }
    .hm-c-chart .hm-spark { width: 64px; }
    .hm-tbl tbody .nm { max-width: 100px; }
    .hm-tbl .nm small { display: none; }
}

/* ---------- sector heat map ---------- */
.hm-heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(122px, 1fr)); gap: 6px; }
.hm-ht { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 58px; padding: 8px 10px;
    border-radius: 8px; border: 1px solid var(--border); color: var(--ink); }
.hm-ht:hover, .hm-ht:focus-visible { color: var(--ink); text-decoration: none; box-shadow: inset 0 0 0 2px var(--accent); }
.hm-ht span { font-size: 12px; font-weight: 600; line-height: 1.2; }
.hm-ht b { font-size: 15.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }

/* ---------- long-term returns ---------- */
.hm-ret { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.hm-ret th { font-size: 11.5px; color: var(--muted); font-weight: 600; text-align: right; padding: 4px 6px; border-bottom: 1px solid var(--axis); }
.hm-ret th:first-child, .hm-ret td:first-child { text-align: left; }
.hm-ret td { text-align: right; padding: 7px 6px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.hm-ret td:first-child { color: var(--ink); font-weight: 500; }
.hm-ret tr:last-child td { border-bottom: 0; }

/* ---------- NIFTY 50 movers ---------- */
.hm-breadth { margin: 2px 0 12px; }
.hm-breadth .bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--chip); }
.hm-breadth .bar span { display: block; height: 100%; }
.hm-breadth .lbl { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink2); margin-top: 5px; }
.hm-movers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hm-movers h3 { font-size: 11px; font-weight: 700; color: var(--ink2); margin: 0 0 4px; text-transform: uppercase; letter-spacing: .06em; }
.hm-mv { display: flex; justify-content: space-between; gap: 6px; padding: 5px 0; border-top: 1px solid var(--grid); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.hm-mv:first-child { border-top: 0; }
.hm-mv a { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hm-mv a:hover { color: var(--accent); }
.hm-mv b { white-space: nowrap; }
@media (max-width: 420px) { .hm-movers { grid-template-columns: 1fr; } }

/* ---------- headlines, grouped by paper ---------- */
.hm-paper + .hm-paper { margin-top: 16px; }
.right_col .hm-paper h3 { display: flex; align-items: baseline; gap: 8px; margin: 0; padding-bottom: 5px; border-bottom: 2px solid var(--ink);
    font-family: var(--serif); font-size: 15.5px; font-weight: 700; letter-spacing: 0; }
.hm-paper h3 .ed { font-family: var(--font); font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.hm-paper h3 a.ep { margin-left: auto; font-family: var(--font); font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.hm-paper h3 a.ep:hover { color: var(--accent-ink); }
.hm-paper .hm-empty { padding: 6px 0 0; }
.hm-paper h3 a { color: var(--ink); }
.hm-paper h3 a:hover { color: var(--accent); }
.hm-news { list-style: none; margin: 0; padding: 0; }
.right_col .hm-news li { padding: 7px 0; border-top: 1px solid var(--grid); }
.hm-news li:first-child { border-top: 0; }
.hm-news a { color: var(--ink); font-size: 13.5px; font-weight: 500; line-height: 1.38; }
.hm-news a:hover { color: var(--accent); }
.hm-news .meta { font-size: 11px; color: var(--muted); margin-left: 6px; white-space: nowrap; }

/* ---------- more research and tools ---------- */
.hm-more-block { margin-top: 8px; }
.hm-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.hm-link { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 14px; color: var(--ink);
    box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.hm-link:hover, .hm-link:focus { border-color: var(--accent); color: var(--ink); text-decoration: none; transform: translateY(-1px); }
.hm-link i { grid-row: 1 / 3; width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent);
    display: flex; align-items: center; justify-content: center; font-size: 15px; }
.hm-link b { font-size: 13.5px; font-weight: 600; }
.hm-link span { font-size: 12px; color: var(--ink2); line-height: 1.35; }
.hm-disclaimer { margin-top: 18px; }

@media (max-width: 767px) {
    .hm-mast h1 { font-size: 32px; }
    .right_col .hm-pulse { font-size: 16px; }
    .hm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hm-tile .px { font-size: 18px; }
    .hm-range-wrap .hm-note { display: none; }
}
