/* Markets section (homepage). Data comes from /assets/data/sector_view.json */
.markets { padding-top: 0; }
.markets__body { display: grid; gap: 1rem; margin-top: 1rem; }
.markets .sv-card { padding: 1.25rem; }
.markets h3 { font-family: Fraunces, serif; margin: 0 0 0.5rem; }

.sv-notice {
    margin: 0;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--rule);
    border-radius: 0.75rem;
    font-size: 0.85rem;
    color: var(--muted);
}

/* Block 1: last session */
.sv-session__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.sv-session__label { font-weight: 700; font-size: 0.95rem; }
.sv-session__date { color: var(--muted); font-size: 0.82rem; }
.sv-indices { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0.9rem 0; }
.sv-index { display: grid; gap: 0.15rem; }
.sv-index__name { font-size: 0.8rem; font-weight: 700; }
.sv-index--uk .sv-index__name { color: var(--uk); }
.sv-index--us .sv-index__name { color: var(--us); }
.sv-index__value { font-family: Fraunces, serif; font-size: 2rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.sv-index__sub { font-size: 0.78rem; color: var(--muted); }
.sv-session p { margin: 0.25rem 0 0; font-size: 0.92rem; }

/* Block 2: the piece */
.sv-stance {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border: 1px solid var(--ink);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}
.sv-piece h3 { font-size: 1.5rem; line-height: 1.2; }
.sv-piece__body { margin: 0 0 0.6rem; line-height: 1.6; }
.sv-piece__change { margin: 0 0 0.6rem; font-style: italic; color: var(--muted); font-size: 0.92rem; }
.sv-piece__footer { margin: 0.75rem 0 0; font-size: 0.78rem; color: var(--muted); }

/* Votes */
.sv-vote { margin-top: 1rem; display: grid; gap: 0.6rem; }
.sv-vote__prompt { font-size: 0.85rem; font-weight: 700; margin: 0; }
.sv-vote__buttons { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.sv-btn {
    min-height: 44px;
    padding: 0.5rem 1.1rem;
    border: 1px solid var(--ink);
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}
.sv-btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.sv-btn:focus-visible { outline: 2px solid var(--uk); outline-offset: 2px; }
.sv-btn:disabled { cursor: default; opacity: 0.6; }
.sv-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); opacity: 1; }
.sv-result { display: grid; gap: 0.3rem; font-size: 0.82rem; color: var(--muted); }
.sv-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--rule); }
.sv-bar__a { background: var(--ink); }
.sv-bar__b { background: var(--muted); opacity: 0.45; }
.sv-share { display: flex; gap: 0.9rem; flex-wrap: wrap; font-size: 0.82rem; }
.sv-share a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* Block 3: sectors */
.sv-sectors__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.sv-sectors__head h3 { margin: 0; }
.sv-tabs { display: inline-flex; border: 1px solid var(--ink); border-radius: 999px; overflow: hidden; }
.sv-tab {
    min-height: 40px;
    padding: 0.35rem 0.95rem;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
}
.sv-tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.sv-tab:focus-visible { outline: 2px solid var(--uk); outline-offset: -2px; }
.sv-list { list-style: none; margin: 0; padding: 0; }
.sv-row { border-top: 1px solid var(--rule); }
.sv-row__main {
    display: grid;
    grid-template-columns: 1.6rem 1fr 84px 4.5rem 4.5rem;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 48px;
    padding: 0.4rem 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.sv-row__main:focus-visible { outline: 2px solid var(--uk); outline-offset: 2px; }
.sv-row__rank { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.sv-row__name { font-weight: 600; font-size: 0.92rem; }
.sv-row__ret, .sv-row__gap { text-align: right; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.sv-row__gap { color: var(--muted); font-size: 0.82rem; }
.sv-spark { width: 84px; height: 26px; display: block; }
.sv-spark polyline { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.sv-row__panel { padding: 0.25rem 0 0.9rem 2.2rem; display: grid; gap: 0.5rem; }
.sv-row__panel[hidden] { display: none; }
.sv-row__meta { margin: 0; font-size: 0.8rem; color: var(--muted); }
.sv-cols { display: grid; grid-template-columns: 1.6rem 1fr 84px 4.5rem 4.5rem; gap: 0.6rem; font-size: 0.72rem; color: var(--muted); padding-bottom: 0.3rem; }
.sv-cols span:nth-child(4), .sv-cols span:nth-child(5) { text-align: right; }

/* Block 4: track record */
.sv-tally { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 0.4rem 0 0.8rem; }
.sv-tally div { display: grid; }
.sv-tally strong { font-family: Fraunces, serif; font-size: 1.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.sv-tally span { font-size: 0.75rem; color: var(--muted); }
.sv-calls { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
.sv-calls li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-top: 1px solid var(--rule); }
.sv-calls__status { font-weight: 700; white-space: nowrap; }
.sv-empty { margin: 0; font-size: 0.88rem; color: var(--muted); }

@media (max-width: 560px) {
    .sv-index__value { font-size: 1.6rem; }
    .sv-row__main, .sv-cols { grid-template-columns: 1.4rem 1fr 60px 3.8rem; }
    .sv-row__gap, .sv-cols span:nth-child(5) { display: none; }
    .sv-spark { width: 60px; }
    .sv-row__panel { padding-left: 0; }
}
