/* 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; align-items: center; gap: 0.35rem; flex-wrap: wrap; font-size: 0.82rem; }
.sv-share > .muted { margin-right: 0.25rem; }
.sv-table-share { margin-top: 0.8rem; padding-top: 0.6rem; border-top: 1px solid var(--rule); }
.sv-share__icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; padding: 0; border-radius: 50%;
    color: var(--ink); background: none; border: 1px solid transparent; cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.sv-share__icon svg { width: 18px; height: 18px; }
.sv-share__icon:hover { border-color: var(--ink); }
.sv-share__icon:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sv-share__status { min-width: 4rem; }

/* 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-record__intro { margin: 0 0 0.9rem; font-size: 0.88rem; color: var(--muted); max-width: 62ch; }
.sv-record__score { margin: 0 0 0.5rem; font-size: 1.05rem; }
.sv-record__score strong { font-family: Fraunces, serif; font-size: 1.7rem; line-height: 1; font-variant-numeric: tabular-nums; }
.sv-record__sub { margin: 1rem 0 0.25rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.sv-record__note { margin: 0.8rem 0 0; font-size: 0.78rem; color: var(--muted); }

/* Form strip: latest results as marks, oldest on the left */
.sv-form { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 1rem; padding: 0; }
.sv-form__mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%; color: var(--paper); cursor: default;
}
.sv-form__mark svg { width: 15px; height: 15px; }
.sv-form__mark--right { background: var(--uk); }
.sv-form__mark--wrong { background: var(--us); }
.sv-form__mark--draw { background: transparent; color: var(--muted); border: 1.5px solid var(--muted); }

/* Today's call */
.sv-today {
    display: grid; gap: 0.15rem; padding: 0.75rem 0.9rem;
    border-radius: 10px; background: color-mix(in srgb, var(--ink) 5%, transparent);
}
.sv-today__label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.sv-today__call { margin: 0; font-weight: 600; font-size: 1rem; }
.sv-today__due { font-size: 0.8rem; color: var(--muted); }

/* Latest results */
.sv-results { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
.sv-results__row {
    display: grid; grid-template-columns: 5.2rem 1fr; gap: 0.6rem; align-items: start;
    padding: 0.55rem 0; border-top: 1px solid var(--rule);
}
.sv-results__badge {
    justify-self: start; padding: 0.12rem 0.55rem; border-radius: 999px;
    font-size: 0.75rem; font-weight: 700; color: var(--paper); white-space: nowrap;
}
.sv-results__badge--right { background: var(--uk); }
.sv-results__badge--wrong { background: var(--us); }
.sv-results__badge--draw { background: transparent; color: var(--muted); border: 1px solid var(--muted); }
.sv-results__text { display: grid; gap: 0.1rem; }
.sv-results__call { font-weight: 600; }
.sv-results__detail { color: var(--muted); font-size: 0.8rem; }
.sv-results__more {
    margin-top: 0.4rem; min-height: 40px; padding: 0; border: 0; background: none; font: inherit; font-size: 0.85rem;
    color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.sv-results__more:focus-visible { outline: 2px solid var(--uk); outline-offset: 2px; }
.sv-visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.sv-empty { margin: 0; font-size: 0.88rem; color: var(--muted); }
.sv-record .sv-empty { margin-top: 0.8rem; }

@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; }
    .sv-results__row { grid-template-columns: 1fr; gap: 0.3rem; }
    .sv-form { gap: 4px; }
    .sv-share { gap: 1px; }
    .sv-share > .muted { display: none; }
    .sv-share__icon { width: 36px; height: 36px; }
    .sv-form__mark { width: 26px; height: 26px; }
    .sv-form__mark svg { width: 14px; height: 14px; }
}
