/*
 * National STR Map — Budget Finder ("Screener").
 * Trading-terminal look: tabular/monospace numerals, tight rows, hairline dividers.
 * Everything is scoped under .sm-finder and uses the .sm design tokens.
 */
.sm-finder {
    --sf-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Segoe UI Mono', Consolas, monospace;
    --sf-up: #34D399;
    --sf-amber: #FBBF24;
    --sf-down: #F87171;
    --sf-info: #60A5FA;
    --sf-hair: rgba(38, 51, 76, .7);
    display: block;
}
.sm-finder:empty { display: none; }
.sm-finder *, .sm-finder *::before, .sm-finder *::after { box-sizing: border-box; }

.sf-wrap { max-width: 1880px; margin: 0 auto; padding: 14px 24px 0; }
.sf-panel {
    position: relative;
    background: var(--sm-panel); border: 1px solid var(--sm-line); border-radius: 16px;
    overflow: hidden; transition: border-color .25s ease, box-shadow .25s ease;
}
.sf-panel::before {            /* accent rail: lights up when the screener drives the map */
    content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; z-index: 5; pointer-events: none;
    background: var(--sm-line); transition: background .25s ease;
}
.sf-panel.is-active { border-color: rgba(52, 211, 153, .38); box-shadow: 0 0 0 1px rgba(52, 211, 153, .08), 0 12px 40px -24px rgba(52, 211, 153, .45); }
.sf-panel.is-active::before { background: linear-gradient(180deg, var(--sm-accent), var(--sm-accent-deep)); }
.sf-panel.is-zero { border-color: rgba(251, 191, 36, .4); box-shadow: none; }
.sf-panel.is-zero::before { background: var(--sf-amber); }

.sf-sr {
    position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---- Bar ------------------------------------------------ */
.sf-bar {
    display: grid; align-items: center; gap: 12px 22px;
    grid-template-columns: auto minmax(340px, 1fr) auto auto auto;
    grid-template-areas: "brand hero readout match actions";
    padding: 12px 16px 12px 19px;
}
.sf-brand { grid-area: brand; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; max-width: 150px; }
.sf-led {
    width: 8px; height: 8px; border-radius: 50%; background: var(--sm-faint); flex: 0 0 auto;
    transition: background .25s, box-shadow .25s;
}
.sf-panel.is-active .sf-led { background: var(--sm-accent); box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); animation: sf-pulse 2.4s ease-in-out infinite; }
.sf-panel.is-zero .sf-led { background: var(--sf-amber); box-shadow: 0 0 0 3px rgba(251, 191, 36, .16); animation: none; }
@keyframes sf-pulse { 50% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); } }
.sf-title {
    margin: 0; font-family: var(--sf-mono); font-size: .8rem; font-weight: 700; letter-spacing: .18em;
    text-transform: uppercase; color: #fff; line-height: 1;
}
.sf-tagline {
    flex-basis: 100%; padding-left: 17px; font-size: .68rem; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--sm-faint); line-height: 1;
}

.sf-hero { grid-area: hero; display: flex; align-items: center; gap: 12px; min-width: 0; }
.sf-mode {
    display: inline-flex; flex: 0 0 auto; background: var(--sm-bg); border: 1px solid var(--sm-line);
    border-radius: 9px; padding: 2px;
}
.sf-mode-btn {
    appearance: none; background: transparent; border: 0; border-radius: 7px; cursor: pointer;
    font: 600 .72rem/1 inherit; font-family: inherit; color: var(--sm-dim);
    padding: 7px 9px; white-space: nowrap; transition: background .15s, color .15s;
}
.sf-mode-btn:hover { color: #fff; }
.sf-mode-btn[aria-pressed="true"] { background: var(--sm-raise); color: #fff; box-shadow: inset 0 0 0 1px var(--sm-line); }

.sf-amount { display: flex; align-items: center; gap: 14px; flex: 1 1 auto; min-width: 0; }
.sf-money {
    display: flex; align-items: baseline; gap: 2px; flex: 0 0 auto; margin: 0; cursor: text;
    background: var(--sm-bg); border: 1px solid var(--sm-line); border-radius: 10px;
    padding: 5px 12px 6px; transition: border-color .15s, box-shadow .15s;
}
.sf-money:focus-within { border-color: var(--sm-accent); box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); }
.sf-cur { font-family: var(--sf-mono); font-size: 1.05rem; font-weight: 700; color: var(--sm-accent); }
.sf-money input {
    appearance: none; width: 9.6ch; min-width: 0; background: transparent; border: 0; outline: 0; padding: 0; margin: 0;
    font-family: var(--sf-mono); font-size: 1.42rem; font-weight: 800; letter-spacing: -.02em;
    font-variant-numeric: tabular-nums; color: #fff; line-height: 1.2; box-shadow: none;
}
.sm-finder .sf-money input, .sm-finder .sf-money input:focus, .sm-finder .sf-money input:focus-visible {
    outline: 0 !important; box-shadow: none !important; border: 0; background: transparent;
}
.sf-money input[aria-invalid="true"] { color: var(--sf-down); }
.sf-slide { flex: 1 1 140px; min-width: 110px; padding-top: 9px; }
.sf-ticks {
    display: flex; justify-content: space-between; margin-top: 3px;
    font-family: var(--sf-mono); font-size: .62rem; color: var(--sm-faint); font-variant-numeric: tabular-nums;
}

/* Range inputs — hairline track with an accent fill */
.sf-range {
    --sf-fill: 0%;
    appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 18px; margin: 0; padding: 0;
    background: transparent; border: 0; cursor: pointer; outline: 0;
}
.sf-range::-webkit-slider-runnable-track {
    height: 4px; border-radius: 2px;
    background: linear-gradient(90deg, var(--sm-accent-deep) 0, var(--sm-accent) var(--sf-fill), var(--sm-line) var(--sf-fill));
}
.sf-range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--sm-line); }
.sf-range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--sm-accent); }
.sf-range::-webkit-slider-thumb {
    -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%;
    background: #fff; border: 3px solid var(--sm-accent-deep); box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
    transition: transform .12s ease;
}
.sf-range::-moz-range-thumb {
    width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 3px solid var(--sm-accent-deep);
}
.sf-range:hover::-webkit-slider-thumb { transform: scale(1.12); }
.sf-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(52, 211, 153, .35); }
.sf-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(52, 211, 153, .35); }

/* Readout tiles: cash needed is the key number */
.sf-readout { grid-area: readout; display: flex; gap: 0; margin: 0; padding: 0; }
.sf-tile { margin: 0; padding: 0 16px; border-left: 1px solid var(--sf-hair); min-width: 0; }
.sf-tile dt {
    font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sm-faint);
    white-space: nowrap; margin: 0 0 3px;
}
.sf-tile dd { margin: 0; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.sf-tile dd b {
    font-family: var(--sf-mono); font-size: 1.12rem; font-weight: 800; letter-spacing: -.02em;
    font-variant-numeric: tabular-nums; color: var(--sm-text);
}
.sf-tile.is-key dd b { color: var(--sm-accent); }
.sf-tile dd small { font-size: .68rem; color: var(--sm-faint); font-variant-numeric: tabular-nums; }

/* Match badge — the tie between the budget and the map */
.sf-match {
    grid-area: match; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    padding: 6px 14px 7px; border-radius: 11px; min-width: 176px;
    background: var(--sm-bg); border: 1px solid var(--sm-line); transition: border-color .25s, background .25s;
}
.sf-panel.is-active .sf-match { border-color: rgba(52, 211, 153, .45); background: rgba(52, 211, 153, .07); }
.sf-panel.is-zero .sf-match { border-color: rgba(251, 191, 36, .45); background: rgba(251, 191, 36, .06); }
.sf-count { margin: 0; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; line-height: 1.1; }
.sf-count b {
    font-family: var(--sf-mono); font-size: 1.42rem; font-weight: 800; letter-spacing: -.03em;
    font-variant-numeric: tabular-nums; color: #fff;
}
.sf-panel.is-active .sf-count b { color: var(--sm-accent); }
.sf-panel.is-zero .sf-count b { color: var(--sf-amber); }
.sf-count span { font-size: .74rem; font-weight: 600; color: var(--sm-dim); }
.sf-match-sub { font-size: .64rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--sm-faint); white-space: nowrap; }
.sf-panel.is-active .sf-match-sub { color: var(--sm-accent); }
.sf-panel.is-zero .sf-match-sub { color: var(--sf-amber); }
.sf-match.is-tick .sf-count b { animation: sf-tick .45s ease; }
@keyframes sf-tick { 0% { opacity: .35; transform: translateY(-3px); } 100% { opacity: 1; transform: none; } }

.sf-actions { grid-area: actions; display: flex; gap: 8px; align-items: center; }
.sf-btn {
    appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    background: var(--sm-bg); border: 1px solid var(--sm-line); border-radius: 9px; cursor: pointer;
    color: var(--sm-text); font-family: inherit; font-size: .8rem; font-weight: 700; line-height: 1;
    padding: 10px 13px; white-space: nowrap; transition: border-color .15s, background .15s, color .15s;
}
.sf-btn:hover { border-color: var(--sm-faint); background: var(--sm-raise); }
.sf-btn[hidden] { display: none; }
.sf-btn-go { background: var(--sm-accent-deep); border-color: var(--sm-accent-deep); color: #05231A; }
.sf-btn-go:hover { background: var(--sm-accent); border-color: var(--sm-accent); }
.sf-btn-sm { padding: 7px 10px; font-size: .72rem; }
.sf-btn[aria-expanded="true"] { border-color: rgba(52, 211, 153, .45); color: #fff; }
.sf-caret {
    width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg); transition: transform .2s ease;
}
.sf-btn[aria-expanded="true"] .sf-caret { transform: translateY(1px) rotate(-135deg); }
.sf-nbadge {
    font-family: var(--sf-mono); font-size: .66rem; font-weight: 800; min-width: 17px; height: 17px; padding: 0 4px;
    display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
    background: var(--sm-accent); color: #05231A;
}
.sf-nbadge[hidden] { display: none; }

.sm-finder button:focus-visible, .sm-finder select:focus-visible, .sm-finder input[type="number"]:focus-visible,
.sf-scroll:focus-visible {
    outline: 2px solid rgba(52, 211, 153, .7); outline-offset: 2px;
}
.sf-seg-opt input:focus-visible + span, .sf-chipbox input:focus-visible + span { outline: 2px solid rgba(52, 211, 153, .7); outline-offset: 2px; }
.sf-check input:focus-visible { outline: 2px solid rgba(52, 211, 153, .7); outline-offset: 2px; }

/* ---- Smooth collapse (filters + results) ---------------- */
.sf-collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s cubic-bezier(.2, .7, .2, 1); }
.sf-collapse.is-open { grid-template-rows: 1fr; }
.sf-collapse-in { overflow: hidden; min-height: 0; visibility: hidden; transition: visibility 0s linear .3s; }
.sf-collapse.is-open > .sf-collapse-in { visibility: visible; transition-delay: 0s; }

/* ---- Filters -------------------------------------------- */
.sf-filters {
    display: grid; gap: 0; border-top: 1px solid var(--sm-line);
    grid-template-columns: minmax(200px, .9fr) minmax(210px, .9fr) minmax(370px, 1.7fr) minmax(170px, .8fr) minmax(220px, 1fr);
    background: linear-gradient(180deg, rgba(11, 18, 32, .55), rgba(11, 18, 32, .2));
}
.sf-group { min-width: 0; margin: 0; border: 0; border-right: 1px solid var(--sf-hair); padding: 13px 16px 14px; }
.sf-group:first-child { padding-left: 19px; }
.sf-g-yield { border-right: 0; }
.sf-g-geo { grid-column: 1 / -1; border-right: 0; border-top: 1px solid var(--sf-hair); padding-left: 19px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.sf-group legend {
    float: left; width: 100%;          /* floated so the legend obeys the fieldset padding instead of riding its top edge */
    padding: 0; margin: 0 0 9px; font-size: .68rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--sm-faint); line-height: 1.2;
}
.sf-group legend + * { clear: both; }
.sf-g-geo legend { width: auto; margin: 0 4px 0 0; }
.sf-g-geo legend + * { clear: none; }
.sf-group legend em { font-style: normal; font-weight: 600; letter-spacing: .04em; color: var(--sm-faint); opacity: .75; margin-left: 5px; text-transform: none; }
.sf-hint { margin: 8px 0 0; font-size: .7rem; line-height: 1.45; color: var(--sm-faint); }

.sf-seg { display: flex; background: var(--sm-bg); border: 1px solid var(--sm-line); border-radius: 9px; padding: 2px; gap: 2px; }
.sf-seg-opt { flex: 1 1 auto; margin: 0; cursor: pointer; position: relative; min-width: 0; }
.sf-seg-opt input { position: absolute; opacity: 0; width: 100%; height: 100%; inset: 0; margin: 0; cursor: pointer; }
.sf-seg-opt span {
    display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 7px; padding: 7px 8px;
    font-size: .74rem; font-weight: 600; color: var(--sm-dim); white-space: nowrap; line-height: 1;
    border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.sf-seg-opt span i {
    font-family: var(--sf-mono); font-style: normal; font-size: .64rem; font-weight: 800; color: var(--sm-faint);
    border: 1px solid var(--sm-line); border-radius: 4px; padding: 1px 4px; line-height: 1.2;
}
.sf-seg-opt:hover span { color: #fff; }
.sf-seg-opt.is-in span { background: rgba(52, 211, 153, .07); color: var(--sm-text); }
.sf-seg-opt input:checked + span { background: rgba(52, 211, 153, .16); border-color: rgba(52, 211, 153, .5); color: #fff; }
.sf-seg-opt input:checked + span i, .sf-seg-opt.is-in span i { color: var(--sm-accent); border-color: rgba(52, 211, 153, .4); }

.sf-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sf-field { display: block; margin: 0; min-width: 0; }
.sf-field > span:first-child { display: block; font-size: .7rem; font-weight: 600; color: var(--sm-dim); margin-bottom: 4px; }
.sf-unit {
    display: flex; align-items: center; background: var(--sm-bg); border: 1px solid var(--sm-line);
    border-radius: 8px; padding: 0 9px 0 0; transition: border-color .15s;
}
.sf-unit:focus-within { border-color: var(--sm-accent); }
.sf-unit input {
    appearance: textfield; -moz-appearance: textfield; width: 100%; min-width: 0; background: transparent; border: 0; outline: 0 !important;
    padding: 7px 4px 7px 10px; margin: 0; color: #fff; box-shadow: none;
    font-family: var(--sf-mono); font-size: .92rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.sf-unit input::-webkit-outer-spin-button, .sf-unit input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sf-unit i { font-style: normal; font-family: var(--sf-mono); font-size: .8rem; color: var(--sm-faint); }

.sf-sl { display: flex; align-items: center; gap: 12px; min-height: 33px; }
.sf-out {
    flex: 0 0 auto; min-width: 46px; text-align: right; font-family: var(--sf-mono); font-size: .92rem; font-weight: 800;
    font-variant-numeric: tabular-nums; color: var(--sm-accent);
}
.sf-check { display: flex; align-items: flex-start; gap: 8px; margin: 9px 0 0; cursor: pointer; font-size: .74rem; color: var(--sm-dim); line-height: 1.35; }
.sf-check input { accent-color: var(--sm-accent-deep); width: 14px; height: 14px; margin: 1px 0 0; flex: 0 0 auto; }
.sf-check em { font-style: normal; color: var(--sm-faint); font-variant-numeric: tabular-nums; }

.sf-chipset { display: flex; flex-wrap: wrap; gap: 6px; }
.sf-chipbox { margin: 0; cursor: pointer; position: relative; }
.sf-chipbox input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sf-chipbox span {
    display: block; font-size: .74rem; font-weight: 600; color: var(--sm-dim); line-height: 1;
    background: var(--sm-bg); border: 1px solid var(--sm-line); border-radius: 999px; padding: 7px 12px;
    transition: background .15s, color .15s, border-color .15s; white-space: nowrap;
}
.sf-chipbox:hover span { color: #fff; border-color: var(--sm-faint); }
.sf-chipbox input:checked + span { background: rgba(52, 211, 153, .16); border-color: rgba(52, 211, 153, .55); color: #fff; }
.sf-staterow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sf-statechips { display: inline-flex; flex-wrap: wrap; gap: 6px; }

.sf-select {
    appearance: none; -webkit-appearance: none; max-width: 100%;
    background: var(--sm-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2396A3BC' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
    border: 1px solid var(--sm-line); border-radius: 8px; color: var(--sm-text); cursor: pointer;
    font-family: inherit; font-size: .76rem; font-weight: 600; line-height: 1.2; padding: 7px 28px 7px 11px; margin: 0;
}
.sf-select:hover { border-color: var(--sm-faint); }
.sf-select:disabled { opacity: .45; cursor: default; }
.sf-select option { background: var(--sm-panel); color: var(--sm-text); }

/* ---- Active filter chips -------------------------------- */
.sf-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 9px 16px 9px 19px; border-top: 1px solid var(--sm-line); }
.sf-chips[hidden] { display: none; }
.sf-chips-l { font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sm-faint); margin-right: 4px; }
.sf-xchip {
    appearance: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-family: inherit;
    font-size: .72rem; font-weight: 600; line-height: 1; color: var(--sm-text);
    background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .4); border-radius: 999px; padding: 5px 8px 5px 10px;
    transition: background .15s, border-color .15s;
}
.sf-xchip i { font-style: normal; font-size: .9rem; line-height: .7; color: var(--sm-accent); }
.sf-xchip:hover { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .5); }
.sf-xchip:hover i { color: var(--sf-down); }

/* ---- Results -------------------------------------------- */
.sf-results { border-top: 1px solid var(--sm-line); }
.sf-res-head { display: flex; align-items: center; gap: 12px; padding: 9px 16px 9px 19px; }
.sf-res-title { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sm-faint); margin-right: auto; min-width: 0; }
.sf-res-title b { font-family: var(--sf-mono); font-size: .86rem; color: var(--sm-accent); letter-spacing: 0; }
.sf-res-title span { font-weight: 600; letter-spacing: .04em; text-transform: none; font-variant-numeric: tabular-nums; }
.sf-swipe { display: none; font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sm-faint); }
.sf-sort { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.sf-sort > span { font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sm-faint); }

.sf-scroll { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--sm-line); scrollbar-width: thin; scrollbar-color: var(--sm-line) transparent; }
.sf-scroll.is-all { max-height: min(70vh, 640px); overflow-y: auto; }
.sm-finder .sf-table { display: table; overflow: visible; max-width: none; }   /* the site's "main table" rule makes tables scrolling blocks */
.sf-table {
    width: 100%; min-width: 1000px; border-collapse: separate; border-spacing: 0; margin: 0;
    font-size: .8rem; color: var(--sm-text); background: transparent;
}
.sf-table th, .sf-table td {
    padding: 5px 12px; text-align: right; vertical-align: middle; white-space: nowrap;
    border: 0; border-bottom: 1px solid var(--sf-hair); background: var(--sf-rowbg, var(--sm-panel));
}
.sf-table thead th {
    position: sticky; top: 0; padding: 7px 12px; background: #101827;
    font-size: .63rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--sm-faint);
    border-bottom: 1px solid var(--sm-line);
}
.sf-th-btn {
    appearance: none; background: transparent; border: 0; padding: 0; margin: 0; cursor: pointer;
    font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
    display: inline-flex; align-items: center; gap: 4px;
}
.sf-th-btn i { font-style: normal; font-size: .5rem; opacity: 0; transition: opacity .15s; }
.sf-th-btn:hover { color: #fff; }
.sf-th-btn:hover i { opacity: .5; }
.sf-th-btn.is-on { color: var(--sm-accent); }
.sf-th-btn.is-on i { opacity: 1; }

.sf-row { cursor: pointer; --sf-rowbg: var(--sm-panel); }
.sf-row:nth-child(even) { --sf-rowbg: #151F31; }
.sf-row:hover, .sf-row:focus-within { --sf-rowbg: var(--sm-raise); }
.sf-row.is-open { --sf-rowbg: #15302F; }
.sf-row td, .sf-row th { transition: background .12s ease; }
.sf-row:last-child td, .sf-row:last-child th { border-bottom: 0; }

.sf-table .sf-c-rank {
    width: 40px; padding-left: 19px; padding-right: 4px; text-align: left;
    font-family: var(--sf-mono); font-size: .72rem; font-weight: 700; color: var(--sm-faint); font-variant-numeric: tabular-nums;
}
.sf-row.is-top .sf-c-rank { color: var(--sm-accent); }
.sf-row.is-open .sf-c-rank { box-shadow: inset 3px 0 0 var(--sm-accent); }
.sf-table .sf-c-mkt { text-align: left; font-weight: 400; min-width: 190px; width: 24%; }
.sf-table .sf-c-price { width: 17%; }
.sf-mkt {
    appearance: none; background: transparent; border: 0; padding: 0; margin: 0; cursor: pointer; font-family: inherit;
    display: inline-flex; align-items: baseline; gap: 7px; color: #fff; font-size: .84rem; font-weight: 700; line-height: 1.25; text-align: left;
}
.sf-row:hover .sf-city { color: var(--sm-accent); }
.sf-st {
    font-family: var(--sf-mono); font-size: .64rem; font-weight: 700; letter-spacing: .06em; color: var(--sm-dim);
    border: 1px solid var(--sm-line); border-radius: 4px; padding: 1px 4px; line-height: 1.2;
}
.sf-cnty { display: inline-block; margin-left: 10px; font-size: .68rem; color: var(--sm-faint); line-height: 1.25; }

.sf-num { font-family: var(--sf-mono); font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -.01em; }
.sf-nil { color: var(--sm-faint); opacity: .45; font-family: var(--sf-mono); }
.sf-c-price .sf-num { font-weight: 800; color: #fff; }
.sf-under { display: inline-block; margin-left: 8px; font-family: var(--sf-mono); font-size: .68rem; font-variant-numeric: tabular-nums; color: var(--sf-up); min-width: 84px; text-align: right; }
.sf-pbar, .sf-mbar { display: block; height: 2px; border-radius: 1px; background: var(--sm-line); margin-top: 4px; overflow: hidden; }
.sf-pbar i { display: block; height: 100%; background: var(--sf-info); opacity: .8; border-radius: 1px; }
.sf-mbar { width: 64px; margin-left: auto; }
.sf-mbar i { display: block; height: 100%; background: var(--sm-accent); border-radius: 1px; }
.sf-cash { color: var(--sm-accent); font-weight: 700; }
.sf-yield { color: var(--sm-text); font-weight: 700; }
.sf-score { font-size: .9rem; font-weight: 800; color: #fff; }
.sf-rw { color: var(--sf-amber); font-weight: 800; margin-left: 1px; }
.sf-tag {
    display: inline-block; margin-right: 7px; font-size: .58rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
    color: var(--sf-amber); border: 1px solid rgba(251, 191, 36, .4); border-radius: 4px; padding: 1px 4px; vertical-align: 1px;
}
.sf-table .sf-c-reg { text-align: left; padding-left: 20px; }
.sf-reg { display: inline-flex; align-items: center; gap: 7px; font-size: .76rem; font-weight: 600; color: var(--sm-dim); }
.sf-reg i { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.sf-reg-ok i { background: var(--sf-up); box-shadow: 0 0 0 3px rgba(52, 211, 153, .15); }
.sf-reg-mid i { background: var(--sf-amber); box-shadow: 0 0 0 3px rgba(251, 191, 36, .14); }
.sf-reg-bad i { background: var(--sf-down); box-shadow: 0 0 0 3px rgba(248, 113, 113, .14); }
.sf-table .sf-c-flag { width: 44px; padding-left: 0; padding-right: 16px; }
.sf-flag {
    appearance: none; width: 18px; height: 18px; border-radius: 5px; cursor: pointer; padding: 0; margin: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--sf-mono); font-size: .7rem; font-weight: 800; line-height: 1;
    color: var(--sf-amber); background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .45);
}
.sf-flag:hover, .sf-flag[aria-expanded="true"] { background: var(--sf-amber); color: #231A05; }
.sf-note-row td { padding: 0; text-align: left; white-space: normal; background: rgba(251, 191, 36, .05); }
.sf-note-in {
    position: sticky; left: 0; max-width: min(100%, calc(100vw - 50px)); padding: 8px 16px 9px 59px;
    font-size: .76rem; line-height: 1.5; color: var(--sm-dim); border-left: 3px solid var(--sf-amber);
}
.sf-note-in b { font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--sf-amber); margin-right: 6px; }

.sf-more {
    appearance: none; display: block; width: 100%; background: transparent; border: 0; border-top: 1px solid var(--sm-line);
    color: var(--sm-accent); font-family: inherit; font-size: .76rem; font-weight: 700; letter-spacing: .04em;
    padding: 10px; cursor: pointer; transition: background .15s;
}
.sf-more:hover { background: var(--sm-raise); }

.sf-zero {
    border-top: 1px solid var(--sm-line); padding: 16px 19px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
    background: rgba(251, 191, 36, .04);
}
.sf-zero-k {
    font-family: var(--sf-mono); font-size: .66rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
    color: var(--sf-amber); border: 1px solid rgba(251, 191, 36, .45); border-radius: 5px; padding: 3px 7px;
}
.sf-zero p { margin: 0; flex: 1 1 420px; font-size: .88rem; line-height: 1.55; color: var(--sm-dim); }
.sf-zero p b { color: #fff; font-variant-numeric: tabular-nums; }

.sf-formula, .sf-note { margin: 0; padding: 8px 19px; font-size: .7rem; line-height: 1.55; color: var(--sm-faint); border-top: 1px solid var(--sf-hair); }
.sf-formula[hidden] { display: none; }
.sf-formula b { color: var(--sm-dim); }
.sf-note { padding-bottom: 11px; }

/* ---- Responsive ----------------------------------------- */
@media (max-width: 1480px) {
    .sf-bar {
        grid-template-columns: auto 1fr auto auto;
        grid-template-areas: "brand readout match actions" "hero hero hero hero";
    }
    .sf-brand { max-width: none; }
    .sf-readout { justify-self: end; }
    .sf-filters { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .sf-g-price, .sf-g-fin { grid-column: span 3; }
    .sf-g-fin { border-right: 0; }
    .sf-g-reg, .sf-g-opp, .sf-g-yield { border-top: 1px solid var(--sf-hair); }
    .sf-g-reg { grid-column: span 6; border-right: 0; }
    .sf-g-opp, .sf-g-yield { grid-column: span 3; }
}
@media (max-width: 900px) {
    .sf-bar {
        grid-template-columns: 1fr auto;
        grid-template-areas: "brand match" "hero hero" "readout readout" "actions actions";
    }
    .sf-readout { justify-self: stretch; }
    .sf-tile { flex: 1 1 0; }
    .sf-tile:first-child { border-left: 0; padding-left: 0; }
    .sf-actions .sf-btn { flex: 1 1 0; }
}
@media (max-width: 720px) {
    .sf-wrap { padding: 12px 16px 0; }
    .sf-bar { padding: 12px 14px 13px 17px; gap: 12px; }
    .sf-hero { flex-direction: column; align-items: stretch; gap: 10px; }
    .sf-mode { display: flex; }
    .sf-mode-btn { flex: 1 1 0; padding: 9px 8px; }
    .sf-amount { flex-direction: column; align-items: stretch; gap: 4px; }
    .sf-money { padding: 7px 12px 8px; }
    .sf-money input { width: 100%; font-size: 1.6rem; }
    .sf-slide { flex: 0 0 auto; padding-top: 6px; }
    .sf-range { height: 26px; }
    .sf-match { min-width: 0; padding: 5px 11px 6px; }
    .sf-count b { font-size: 1.2rem; }
    .sf-count span { font-size: .68rem; }
    .sf-match-sub { font-size: .58rem; }
    .sf-tagline { display: none; }

    .sf-filters { grid-template-columns: minmax(0, 1fr); }
    .sf-group, .sf-group:first-child, .sf-g-geo { grid-column: 1 / -1; border-right: 0; border-top: 1px solid var(--sf-hair); padding: 13px 14px 14px 17px; }
    .sf-group:first-child { border-top: 0; }
    .sf-g-geo { display: block; }
    .sf-g-geo legend { float: none; margin: 0 0 9px; }
    .sf-staterow { margin-top: 8px; }
    .sf-seg-reg { flex-wrap: wrap; }
    .sf-seg-reg .sf-seg-opt { flex: 1 1 30%; }
    .sf-seg-opt span { padding: 9px 8px; }
    .sf-chipbox span { padding: 9px 12px; }

    .sf-chips { padding: 9px 14px 9px 17px; }
    .sf-res-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title swipe" "sort toggle"; padding: 9px 14px 10px 17px; gap: 8px 10px; }
    .sf-res-title { grid-area: title; margin: 0; }
    .sf-swipe { grid-area: swipe; align-self: center; }
    .sf-sort { grid-area: sort; justify-self: start; }
    #sf-list-toggle { grid-area: toggle; }

    /* The table scrolls sideways inside its own container; rank + market stay pinned. */
    .sf-table { min-width: 900px; font-size: .78rem; }
    .sf-table th, .sf-table td { padding: 6px 10px; }
    .sf-table .sf-c-rank { position: sticky; left: 0; z-index: 2; width: 30px; min-width: 30px; max-width: 30px; padding-left: 12px; padding-right: 0; font-size: .68rem; }
    .sf-table .sf-c-mkt { position: sticky; left: 30px; z-index: 2; min-width: 124px; max-width: 132px; padding-left: 6px; padding-right: 8px; box-shadow: 1px 0 0 var(--sm-line); }
    .sf-table thead .sf-c-rank, .sf-table thead .sf-c-mkt { z-index: 3; }
    .sf-table .sf-c-mkt { white-space: normal; width: auto; }
    .sf-table .sf-c-price { width: auto; }
    .sf-mkt { display: inline; white-space: normal; font-size: .78rem; line-height: 1.2; }
    .sf-mkt .sf-st { margin-left: 6px; white-space: nowrap; }
    .sf-cnty { display: block; margin: 1px 0 0; white-space: normal; font-size: .64rem; }
    .sf-swipe { display: inline; }
    .sf-sort { margin-right: 0; }
    .sf-note-in { padding-left: 17px; max-width: calc(100vw - 36px); }
    .sf-zero { padding: 14px 14px 16px 17px; }
    .sf-zero p { flex-basis: 100%; font-size: .84rem; }
    .sf-zero .sf-btn { width: 100%; }
    .sf-formula, .sf-note { padding-left: 17px; padding-right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .sf-collapse, .sf-collapse-in, .sf-panel, .sf-panel::before, .sf-row td, .sf-row th, .sf-range::-webkit-slider-thumb, .sf-caret { transition: none; }
    .sf-panel.is-active .sf-led, .sf-match.is-tick .sf-count b { animation: none; }
}
