/* ============================================================
BDG Treasury page styles (css/treasury.css)
Loaded only by pages/treasury.html, after ../css/styles.css.
Every selector is prefixed tsy- or scoped under .tsy, the page's <main>.
============================================================ */
.tsy :focus-visible, .tsy-status :focus-visible { outline: 2px solid var(--bitcoin); outline-offset: 3px; border-radius: 2px; }
.tsy-hero .page-hero__desc { max-width: 680px; font-size: 1rem; line-height: 1.75; }
.tsy-hero .hero__subtitle { margin-left: auto; margin-right: auto; margin-bottom: 1.5rem; }

/* Status band: quiet "as of" strip directly under the page hero */
.tsy-status { border-bottom: 1px solid var(--border); padding: 0.85rem 0; }
.tsy-status__row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem 2rem; flex-wrap: wrap; }
.tsy-status__main { display: flex; align-items: center; gap: 0.5rem 1rem; flex-wrap: wrap; }
.tsy-pill { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; padding: 0.25rem 0.6rem; border-radius: 100px; border: 1px solid var(--border-accent); color: var(--text-secondary); }
.tsy-pill__mark { width: 6px; height: 6px; border-radius: 50%; background: var(--bitcoin); flex-shrink: 0; }
[data-state="current"] .tsy-pill__mark { animation: tsyPulse 2.4s ease-in-out infinite; }
[data-state="stale"] .tsy-pill { color: var(--text-primary); background: var(--bitcoin-glow); }
[data-state="stale"] .tsy-pill__mark { background: transparent; border: 1.5px solid var(--bitcoin); }
[data-state="unavailable"] .tsy-pill { border-color: rgba(255,255,255,0.18); }
[data-state="unavailable"] .tsy-pill__mark { background: var(--text-muted); border-radius: 1px; height: 2px; width: 8px; }
@keyframes tsyPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(247,147,26,0.4); } 50% { box-shadow: 0 0 0 4px rgba(247,147,26,0); } }
.tsy-status__time { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-primary); }
.tsy-status__time span { color: var(--text-muted); letter-spacing: 0.1em; margin-right: 0.5rem; text-transform: uppercase; font-size: 0.62rem; }
.tsy-sources { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem 0; }
.tsy-sources > .ticker-item { gap: 0.5rem; }
.tsy-sources > .ticker-item + .ticker-item::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--bitcoin); opacity: 0.5; margin: 0 1rem; }
.tsy-sources dd { margin: 0; }
.tsy-ledger { margin-top: 0.5rem; }
.tsy-ledger .ticker-item__value { color: var(--text-secondary); }
.tsy-status__note { font-size: 0.74rem; color: var(--text-muted); margin-top: 0.45rem; line-height: 1.55; }
.tsy-status__alert { display: none; font-size: 0.78rem; color: var(--text-primary); font-weight: 300; margin-top: 0.45rem; padding-left: 0.75rem; border-left: 2px solid var(--bitcoin); }
[data-state="stale"] .tsy-status__alert { display: block; }
[data-state="unavailable"] .tsy-sources .ticker-item__value { color: var(--text-muted); }

/* Section headers */
.tsy-header { max-width: 640px; margin: 0 auto 3.5rem; }
.tsy-header p { font-size: 0.98rem; line-height: 1.75; }
.tsy-header--sub { margin-top: 5rem; }
.tsy-header--sub h3 { font-size: clamp(1.6rem, 3vw, 2.4rem); }

/* Headline beside benchmark table */
.tsy-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.5rem; align-items: stretch; }
.tsy-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.tsy-headline { padding: 2.25rem 2rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; background: radial-gradient(ellipse 90% 70% at 0% 0%, rgba(247,147,26,0.08) 0%, transparent 65%), var(--bg-card); border-color: var(--border-accent); }
.tsy-headline__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.tsy-headline__value { font-family: var(--font-display); font-weight: 300; font-size: clamp(3.75rem, 8vw, 5.75rem); line-height: 0.95; letter-spacing: -0.02em; color: var(--text-primary); font-variant-numeric: lining-nums; }
.tsy-headline__value span { color: var(--bitcoin); }
.tsy-headline__since { font-size: 0.9rem; margin-top: 0.9rem; }
.tsy-headline__foot { font-size: 0.78rem; color: var(--text-muted); line-height: 1.65; border-top: 1px solid var(--border); padding-top: 1.25rem; }
.tsy .tag { flex-shrink: 0; white-space: nowrap; font-size: 0.58rem; }
.tsy .perf-card__label { margin-bottom: 0; }

/* Tables */
.tsy-table { width: 100%; border-collapse: collapse; }
.tsy-table caption { caption-side: top; text-align: left; padding: 1.5rem 2rem; border-bottom: 1px solid var(--border); }
.tsy-caption__label { display: block; font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.25rem; }
.tsy-caption__title { display: block; font-family: var(--font-display); font-size: 1.1rem; color: var(--text-primary); line-height: 1.3; }
.tsy-caption { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.tsy-table thead th { font-family: var(--font-mono); font-size: 0.65rem; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); text-align: right; padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--border); vertical-align: bottom; line-height: 1.5; }
.tsy-table thead th:first-child { text-align: left; padding-left: 2rem; }
.tsy-table thead th:last-child, .tsy-table td:last-child { padding-right: 2rem; }
.tsy-table tbody th, .tsy-table tfoot th { text-align: left; font-weight: 400; padding: 1.15rem 1.25rem 1.15rem 2rem; }
.tsy-table td { text-align: right; padding: 1.15rem 1.25rem; font-family: var(--font-mono); font-size: 0.95rem; color: var(--text-primary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tsy-table tbody tr { border-bottom: 1px solid var(--border); }
.tsy-table tbody tr:last-child { border-bottom: 0; }
.tsy-name { display: block; font-family: var(--font-body); font-size: 1rem; color: var(--text-primary); line-height: 1.35; }
.tsy-name abbr { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; color: var(--text-muted); margin-left: 0.5rem; text-decoration: none; }
.tsy-desc { display: block; font-family: var(--font-body); font-size: 0.8rem; font-weight: 300; color: var(--text-muted); line-height: 1.5; margin-top: 0.15rem; }
.tsy-row--bdg { background: var(--bitcoin-glow); box-shadow: inset 2px 0 0 var(--bitcoin); }
.tsy-row--bdg td:nth-child(2) { font-weight: 500; }
.tsy-table tfoot tr { border-top: 1px solid var(--border-accent); background: rgba(247,147,26,0.04); }
.tsy-row--total td:nth-child(4), .tsy-row--total td:nth-child(5) { color: var(--bitcoin); font-weight: 500; }
.tsy-row--total th .tsy-name { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-secondary); }
.tsy-cellnote { display: block; font-family: var(--font-body); font-size: 0.68rem; font-weight: 300; color: var(--text-muted); margin-top: 0.15rem; }
.tsy-ref { font-family: var(--font-body) !important; font-size: 0.8rem !important; font-weight: 300; color: var(--text-muted) !important; }
.tsy-dir { display: inline-block; font-size: 0.6rem; margin-right: 0.4rem; transform: translateY(-1px); color: var(--bitcoin); }
.tsy-dir--down { color: var(--text-secondary); }
.tsy-foot { padding: 1rem 2rem; border-top: 1px solid var(--border); background: rgba(255,255,255,0.02); font-size: 0.75rem; color: var(--text-muted); line-height: 1.6; }

/* ETH staking detail (component of the ETH row) */
.tsy-table tr.tsy-row--parent { border-bottom: 0; }
.tsy-table .tsy-subrow td { padding: 0 2rem 1.35rem; text-align: left; white-space: normal; font-family: var(--font-body); }
.tsy-staking { border-left: 1px solid var(--border-accent); padding: 0.2rem 0 0.2rem 1.25rem; display: grid; grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr)); gap: 1rem 1.5rem; align-items: start; }
.tsy-staking__title { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; }
.tsy-staking__title small { display: block; font-size: 0.74rem; font-weight: 300; color: var(--text-muted); }
.tsy-staking dl { display: contents; }
.tsy-staking dt { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.3rem; line-height: 1.5; }
.tsy-staking dd { font-family: var(--font-mono); font-size: 0.86rem; color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* Unavailable state */
.tsy-unavailable { display: none; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 3.5rem 2rem; text-align: center; }
.tsy-unavailable h3 { font-size: clamp(1.4rem, 2.5vw, 1.9rem); margin-bottom: 0.75rem; }
.tsy-unavailable p { max-width: 520px; margin: 0 auto; font-size: 0.95rem; }
[data-state="unavailable"] .tsy-unavailable { display: block; }
[data-state="unavailable"] .tsy-data { display: none; }

/* Framework (reuses the homepage thesis section pattern) */
.tsy-framework .thesis__header { max-width: 860px; }
.tsy-nowrap { white-space: nowrap; }
.tsy-arrow { color: var(--bitcoin); font-family: var(--font-body); font-weight: 300; font-size: 0.6em; margin: 0 0.35em; position: relative; top: -0.12em; }

/* Methodology and disclosures */
.tsy-method { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 4rem; align-items: start; }
.tsy-method .perf-disclaimer { padding-top: 1.5rem; }
.tsy-acc { border-top: 1px solid var(--border); }
.tsy-acc details { border-bottom: 1px solid var(--border); }
.tsy-acc summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 56px; padding: 1rem 0; font-family: var(--font-display); font-size: 1.3rem; line-height: 1.3; color: var(--text-primary); transition: color var(--transition); }
.tsy-acc summary::-webkit-details-marker { display: none; }
.tsy-acc summary:hover { color: var(--bitcoin); }
.tsy-acc summary::after { content: "+"; font-family: var(--font-mono); font-size: 1rem; color: var(--bitcoin); flex-shrink: 0; width: 1.5rem; text-align: center; }
.tsy-acc details[open] summary::after { content: "\2212"; }
.tsy-acc__body { padding: 0 0 1.5rem; max-width: 600px; }
.tsy-acc__body p { font-size: 0.9rem; line-height: 1.8; }
.tsy-acc__body p + p { margin-top: 0.9rem; }
.tsy-acc__body li { position: relative; padding-left: 1.25rem; font-size: 0.9rem; font-weight: 300; color: var(--text-secondary); line-height: 1.8; }
.tsy-acc__body li::before { content: "\2192"; position: absolute; left: 0; color: var(--bitcoin); font-size: 0.8rem; }

/* Responsive (breakpoints follow styles.css: 1024 / 768 / 480, plus two table breakpoints) */
@media (max-width: 1024px) {
.tsy-head { grid-template-columns: 1fr; }
.tsy-method { grid-template-columns: 1fr; gap: 3rem; }
}
@media (max-width: 820px) {
.tsy-table--assets, .tsy-table--assets tbody, .tsy-table--assets tfoot, .tsy-table--assets tr, .tsy-table--assets th, .tsy-table--assets td, .tsy-table--assets caption { display: block; }
.tsy-table--assets thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.tsy-table--assets tbody tr:not(.tsy-subrow), .tsy-table--assets tfoot tr { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem; padding: 1.35rem 1.5rem; }
.tsy-table--assets tbody th, .tsy-table--assets tfoot th { grid-column: 1 / -1; padding: 0; }
.tsy-table--assets td { padding: 0; text-align: left; white-space: normal; }
.tsy-table--assets td::before { content: attr(data-label); display: block; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.3rem; line-height: 1.5; }
.tsy-table--assets .tsy-subrow td { padding: 0 1.5rem 1.35rem; }
.tsy-table--assets .tsy-subrow td::before { content: none; }
.tsy-table--assets .tsy-cellnote { display: none; }
/* Keep values level across a card row when one label wraps to more lines than its neighbor */
.tsy-table--assets tbody tr:not(.tsy-subrow) td, .tsy-table--assets tfoot td, .tsy-staking dl > div { align-self: end; }
.tsy-staking { grid-template-columns: 1fr 1fr; }
.tsy-staking__title { grid-column: 1 / -1; }
.tsy-table caption { padding: 1.25rem 1.5rem; }
.tsy-foot { padding: 1rem 1.5rem; }
}
@media (max-width: 768px) {
.tsy-status__row { flex-direction: column; align-items: flex-start; }
.tsy-sources { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1.5rem; width: 100%; }
.tsy-sources > .ticker-item { flex-direction: column; align-items: flex-start; gap: 0.1rem; white-space: normal; }
.tsy-sources > .ticker-item + .ticker-item::before { content: none; }
.tsy-header--sub { margin-top: 4rem; }
}
@media (max-width: 600px) {
.tsy-headline { padding: 1.75rem 1.5rem; }
.tsy-table--bench, .tsy-table--bench tbody, .tsy-table--bench tr, .tsy-table--bench th, .tsy-table--bench td, .tsy-table--bench caption { display: block; }
.tsy-table--bench thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.tsy-table--bench tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem 1.25rem; padding: 1.35rem 1.5rem; }
.tsy-table--bench tbody th { grid-column: 1 / -1; padding: 0; }
.tsy-table--bench td { padding: 0; text-align: left; white-space: normal; align-self: end; }
.tsy-table--bench td::before { content: attr(data-label); display: block; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.3rem; line-height: 1.5; }
.tsy-acc summary { font-size: 1.15rem; }
.tsy-framework .thesis__card { padding: 2rem 1.75rem; }
}
@media (max-width: 480px) {
.tsy-table caption, .tsy-table--assets tbody tr:not(.tsy-subrow), .tsy-table--assets tfoot tr, .tsy-table--bench tbody tr { padding-left: 1.25rem; padding-right: 1.25rem; }
.tsy-table--assets .tsy-subrow td, .tsy-foot { padding-left: 1.25rem; padding-right: 1.25rem; }
.tsy-headline { padding: 1.5rem 1.25rem; }
.tsy .pullquote { padding: 1.5rem 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
html { scroll-behavior: auto; }
.tsy-pill__mark { animation: none !important; }
.tsy *, .tsy-status * { transition: none !important; }
}

/* Loading state: shown until the first response arrives */
[data-state="loading"] .tsy-data, [data-state="loading"] .tsy-sources .ticker-item__value { visibility: hidden; }
[data-state="loading"] .tsy-pill__mark { background: var(--text-muted); }

/* A figure the engine withheld (null in the public result) */
.tsy-na { font-family: var(--font-body); font-size: 0.8rem; font-weight: 300; color: var(--text-muted); }
.tsy-headline__value .tsy-na { font-family: var(--font-display); font-size: 0.5em; }
.tsy-strong { color: var(--text-secondary); font-weight: 400; }

/* Dummy-data tag: shown only in the local preview */
.tsy-demo-tag[hidden] { display: none; }
