.landing { --landing-title-size: clamp(26px, 2.35vw, 32px); padding: 14px 0 10px; }
.landing h1 { max-width: 1000px; margin: 7px 0 9px; font-size: var(--landing-title-size); line-height: 1.1; letter-spacing: -.035em; }
.landing h1 a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .12em; }
.landing h1 a:hover { color: var(--orange); }
.landing .landing-motto { margin: 0 0 6px; font-size: max(var(--minimum-text-size), calc(var(--landing-title-size) + 2px)); font-weight: 800; line-height: 1.1; letter-spacing: -.025em; text-transform: none; }
.landing-lead { max-width: 1100px; margin:0;color: var(--secondary-ink); font-size: 15px; line-height: 1.5; }
.landing-actions, .project-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin: 12px 0; }
.landing-actions a { color: var(--ink); font-weight: 700; text-underline-offset: 5px; }
.landing-actions .landing-primary { border-radius: 7px; background: var(--orange); color: #15191c; padding: 9px 14px; text-decoration: none; }
.landing-actions{font-size:13px;}
.landing-actions .landing-more-toggle { display: inline-flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; padding: 5px 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.landing-more-toggle::before { content: ""; flex: 0 0 auto; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 6px solid currentColor; }
.landing-more-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.landing-more:not([hidden]) { padding-bottom: 16px; }
.landing-explanation{max-width:1000px;color:var(--muted);font-size:15px;line-height:1.6;}
.landing-note { max-width: 1100px; padding-left: 16px; border-left: 3px solid var(--orange); color: var(--muted); font-size: 14px; line-height: 1.65; }
.project-links { font-size: 14px; }
.section-guide { margin-top: 44px; border-top: 1px solid var(--line); padding-top: 30px; }
.section-guide > p { color: var(--muted); line-height: 1.5; }
.section-guide .guide-group-title { color: var(--secondary-ink); font-size: 15px; margin: 26px 0 12px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.guide-card { display: block; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 20px; background: var(--surface-raised); text-decoration: none; color: var(--ink); }
.guide-card h3 { margin: 0 0 10px; font-size: 17px; line-height: 1.4; }
.guide-card h3 span { color: var(--orange); }
.guide-card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.6; }
.guide-card:hover { border-color: var(--orange); background: var(--button-hover); }
.landing a:focus-visible, .landing-more-toggle:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
.landing-navigation-status { color: var(--muted); }
.landing-navigation-status:empty{display:none;}
:target, .section-destination, #transactions-section { scroll-margin-top: calc(var(--section-nav-height, 44px) + var(--mobile-toolbar-height, 0px) + 14px); }
.quick-navigation { position: sticky; top: var(--mobile-toolbar-height, 0px); z-index: 90; display: flex; align-items: center; gap: 5px; overflow-x: auto; padding: 6px 0; border-bottom: 1px solid var(--line); background: var(--page-bg); scrollbar-width: thin; }
.quick-navigation a { flex: 0 0 auto; padding: 7px 11px; color: var(--ink); font-size: 14px; text-decoration: none; border-radius: 4px; }
.quick-navigation a:hover { background: var(--surface-raised); color: var(--orange); }
.quick-navigation a:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.landing-actions .landing-secondary { padding: 8px 13px; border: 1px solid var(--line); border-radius: 7px; text-decoration: none; }
@media (max-width: 1100px) { .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .guide-grid { grid-template-columns: minmax(0, 1fr); } .guide-card { padding: 18px; } }

#deferred-analysis { display: none; }
body.is-overview #deferred-analysis { display: block; padding: 28px 20px; background: var(--surface-raised); border: 1px solid var(--line); }
/* Partial landing data must never be presented as whole-history totals. */
body.is-overview #dashboard > :not(#transactions-section):not(#landing-summary):not(#loan-monthly-section) { display: none !important; }
body.is-overview:not([data-cached-loan-chart]) #loan-monthly-chart-wrap,
body.is-overview:not([data-cached-loan-chart]) .loan-monthly-display-controls { display: none; }
.loan-monthly-cache-status { margin: 0 0 8px; color: var(--muted); }
.mobile-layout-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: calc(6px * var(--mobile-control-scale, 1)) calc(12px * var(--mobile-control-scale, 1)); padding: calc(8px * var(--mobile-control-scale, 1)); background: var(--surface-raised); border-bottom: 1px solid var(--orange); color: var(--muted); font-size: max(var(--minimum-text-size), calc(14px * var(--mobile-control-scale, 1))); }
.mobile-layout-toolbar[hidden] { display: none; }
/* Overlay in both layouts: hiding must leave neither a gap nor a scroll jump. */
.mobile-layout-toolbar[data-scrolled],
.mobile-layout-toolbar[data-auto-hidden] { visibility: hidden; pointer-events: none; }
/* The temporary wide-layout panel overlays the page, leaving no blank space
   or layout shift when it disappears after 1.5 seconds. */
.mobile-layout-toolbar { position: fixed; top: 0; left: 0; right: 0; z-index: 100; }
.mobile-layout-toolbar button { min-height: calc(44px * var(--mobile-control-scale, 1)); padding: calc(8px * var(--mobile-control-scale, 1)) calc(12px * var(--mobile-control-scale, 1)); color: var(--ink); border: 1px solid var(--orange); background: var(--surface); font: inherit; font-weight: 700; cursor: pointer; border-radius: 5px; }
.mobile-layout-toolbar button:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
html[data-mobile-layout="desktop"] body { min-width: 1360px; }
.landing-summary { padding: 10px 0 18px; }
.landing-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.landing-period-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.landing-period-controls > span { color: var(--muted); font-size: 13px; margin-right: 4px; }
.landing-period-controls button { padding: 5px 10px; min-height: 32px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-raised); color: var(--ink); cursor: pointer; font: inherit; font-size: 13px; }
.landing-period-controls button[aria-pressed="true"] { border-color: var(--orange); color: var(--orange); }
.landing-period-controls button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.landing-summary-grid.topup-summary-card { grid-template-columns: minmax(0, 420px); margin-bottom: 14px; }
.landing-summary-grid .landing-count-headline { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.landing-summary-grid .landing-count-unit { font-size: 14px; }
.landing-summary-grid article { position: relative; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-raised); text-align: left; }
.summary-card-link { display: block; padding-right: 24px; color: var(--muted); font-size: 16px; text-decoration: none; }
.summary-card-link::after { content: ''; position: absolute; inset: 0; border-radius: 6px; }
.summary-card-link:hover::after { box-shadow: inset 0 0 0 1px var(--orange); }
.summary-card-link:focus-visible { outline: 0; }
.summary-card-link:focus-visible::after { outline: 3px solid var(--orange); outline-offset: 2px; }
.summary-card-link[aria-busy="true"] { cursor: wait; }
.summary-card-help { position: static; }
.summary-card-help > summary { position: absolute; right: 7px; top: 7px; z-index: 2; display: grid; place-items: center; width: 32px; height: 32px; list-style: none; color: var(--muted); cursor: pointer; }
.summary-card-help > summary::-webkit-details-marker { display: none; }
.summary-card-help > summary:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.summary-card-help > div { position: absolute; z-index: 95; left: 8px; right: 8px; top: 44px; padding: 14px; border: 1px solid var(--orange); border-radius: 5px; background: var(--surface); color: var(--ink); box-shadow: 0 6px 24px #0005; font-size: 14px; line-height: 1.5; }
.summary-card-help small { margin-top: 8px; }
#dashboard > #landing-summary { padding: 8px 0 16px; }
#dashboard > #loan-monthly-section { margin-top: 12px; padding-top: 18px; }
.landing-summary-grid span, .landing-summary-grid small { display: block; color: var(--muted); }
.landing-summary-grid span { font-size: 16px; }
.landing-summary-grid strong { display: block; margin: 8px 0; font-size: max(var(--minimum-text-size), clamp(24px, 2.2vw, 38px)); line-height: 1.1; color: var(--ink); }
.landing-summary-grid small { font-size: 14px; line-height: 1.4; }
.landing-summary-value { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 8px 0; }
.landing-summary-grid .landing-summary-value strong { margin: 0; }
.landing-summary-grid .landing-summary-extra { font-size: 16px; line-height: 1.45; }
.landing-closed-summary { position: relative; z-index: 1; display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-top: 8px; padding: 4px 0; color: var(--muted); text-decoration: none; cursor: pointer; }
.landing-summary-grid .landing-closed-summary > strong { display: inline; margin: 0; font-size: max(var(--minimum-text-size), 20px); color: var(--blue); }
.landing-closed-summary:hover > span { text-decoration: underline; }
.landing-closed-summary:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; border-radius: 2px; }
.landing-closed-summary[aria-busy="true"] { cursor: wait; }
.landing-summary-grid .landing-period-row { display: block; line-height: 1.55; }
.landing-loan-flows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.landing-loan-flows > div { min-width: 0; }
.history-secondary-date { color: var(--muted); font-size: max(var(--minimum-text-size), .9em); }
.landing-summary-grid .landing-period-title { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.landing-summary-grid .closed-setup-number { display: inline; font-size: inherit; font-weight: 700; color: var(--blue); }
.landing-locked-headline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.landing-summary-grid .landing-escrow-ath { color: var(--green); font-size: 16px; font-weight: 700; }
.landing-summary-grid .landing-escrow-ath[hidden] { display: none; }
.landing-liquidation-amounts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.landing-summary-grid .landing-liquidation-amounts .landing-fiat-equivalent { font-size: 16px; }
.landing-summary-grid .landing-liquidation-amounts > span { white-space: nowrap; }
.landing-summary-grid .landing-fiat-equivalent { font-size: max(var(--minimum-text-size), clamp(18px, calc(1.1vw + 2px), 22px)); color: var(--ink); white-space: nowrap; }
.landing-summary-grid .landing-fiat-equivalent[hidden] { display: none; }
.landing-summary-grid .landing-summary-extra[hidden] { display: none; }
.landing-summary-grid #landing-locked-btc, .landing-summary-grid #landing-total-escrow, .landing-summary-grid .landing-btc-amount { color: var(--orange); }
.landing-summary-grid .landing-btc-amount { display: inline; font-size: inherit; font-weight: 600; }
.landing-summary-grid .rolling-metric { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rolling-metric .rolling-digit { display: inline-block; overflow: hidden; height: 1.1em; vertical-align: bottom; font: inherit; color: inherit; }
.rolling-metric .rolling-digit-track { display: block; position: relative; font: inherit; line-height: 1.1em; color: inherit; }
.rolling-digit-track::before { content: attr(data-previous); position: absolute; bottom: 100%; left: 0; }
.rolling-digit-track.is-rolling { animation: escrow-digit-roll 800ms cubic-bezier(.2,.65,.25,1) both; }
@keyframes escrow-digit-roll { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .rolling-digit-track.is-rolling { animation: none; } }
.landing-summary-grid #landing-pending-escrow[hidden] { display: none; }
.landing-summary-grid #landing-liquidations, .landing-summary-grid .liquidation-number { color: var(--red); }
.landing-summary-grid .liquidation-number { display: inline; font-size: inherit; font-weight: 700; }
.landing-summary-grid .new-setup-number { display: inline; font-size: inherit; font-weight: 700; color: var(--green); }
.landing-summary-grid #landing-topups { color: var(--blue); }
.landing-summary-grid .new-topup-number { display: inline; font-size: inherit; font-weight: 700; color: var(--green); }
.landing-summary-grid #landing-liquidations-btc { color: var(--red); font-size: 16px; font-weight: 600; }
.landing-summary-grid #landing-liquidations-btc[hidden], .landing-summary-grid #landing-liquidations-rate[hidden] { display: none; }
@media (min-width: 901px) and (max-width: 1199px) { .landing-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.firefish-fact.is-liquidation .fact-btc-amount, .firefish-fact .liquidation-number { color: var(--red); }
.fact-liquidation-loan { margin: 8px 0; font-size: 16px; line-height: 1.5; }
.fact-liquidation-loan small, .fact-liquidation-loan > span { display: block; color: var(--muted); }
.firefish-fact small { font-size: 14px; }
.fact-fee-excess { color: var(--red); font-size: 14px; line-height: 1.5; }
.fact-title-line { display: block; }
.closed-loan-cards { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.closed-loan-cards h3 { min-height: 2.5em; }
.is-liquidation-share > small { display: block; margin-top: 8px; }
@media (min-width: 851px) and (max-width: 1300px) { .closed-loan-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 850px) { .closed-loan-cards { grid-template-columns: minmax(0, 1fr); gap: 12px; } .closed-loan-cards h3 { min-height: 0; } }
.fact-cohort-link { padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--link); font: inherit; text-decoration: underline; text-underline-offset: .15em; cursor: pointer; }
.fact-cohort-link.is-default { color: var(--red); }
.is-closed-loans > strong, .is-closed-loans .fact-cohort-link { color: var(--green); }
.fact-cohort-link:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.fact-cohort-link:disabled { opacity: .6; cursor: wait; }
.history-closed-loan-filter { color: var(--muted); font-size: 13px; line-height: 1.5; }
.landing-summary > p { margin: 8px 0 0; }
@media (min-width: 601px) and (max-width: 900px) { .landing-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.loan-monthly-methodology { margin: 10px 0 14px; }
.loan-monthly-methodology > summary { width: fit-content; cursor: pointer; color: var(--muted); font-size: 13px; }
.loan-monthly-methodology > summary:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
#dashboard > #transactions-section { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
@media (max-width: 600px) {
  .landing-summary-grid { grid-template-columns: 1fr; gap: 8px; }
  .landing-summary-grid article { padding: 12px 16px; }
  .landing-summary-grid strong { margin: 5px 0; }
}
#full-analysis-status { display: block; margin-top: 12px; color: var(--muted); }
/* Keep the viewport at the reader's scroll offset while cached sections grow.
   Chrome must not choose a formerly focused methodology/footer as its anchor. */
html { overflow-anchor: none; }
body[data-initial-loading] #dashboard > :not(#landing-summary),
body[data-initial-loading] #donate,
body[data-initial-loading] #progress-percent,
body[data-initial-loading] .progress-track,
body[data-initial-loading][data-cached-summary] #progress-panel { display: none !important; }
body[data-initial-loading][data-cached-loan-chart] #dashboard > #loan-monthly-section { display: block !important; }

:root {
  --firefish-commission: var(--ink);
  color-scheme: light;
  --page-bg: #fff;
  --surface: #fff;
  --surface-subtle: #fafafa;
  --surface-raised: #fff;
  --ink: #202124;
  --muted: #6a6f75;
  --monthday-weekend: #6b21a8;
  --secondary-ink: #4e555b;
  --label-ink: #535960;
  --balance-ink: #172d3d;
  --line: #d8dadd;
  --soft-line: #e9eaec;
  --stripe: #f5f5f5;
  --field-bg: #fff;
  --field-border: #bfc3c7;
  --field-ink: #1c2933;
  --button-hover: #f3f6f8;
  --table-head-bg: #eceeef;
  --table-head-ink: #454a4f;
  --panel-bg: #f7fafc;
  --panel-border: #ced7df;
  --progress-track: #dce4ea;
  --tooltip-bg: rgba(255, 255, 255, .97);
  --tooltip-ink: #25282b;
  --tooltip-border: #8e969d;
  --canvas-bg: #fff;
  --canvas-filter: none;
  --chart-grid: #e5e7e9;
  --chart-grid-soft: #f0f1f2;
  --chart-text: #656a70;
  --chart-point: #fff;
  --chart-crosshair: rgba(60, 65, 70, .5);
  --chart-blue-rgb: 57,118,155;
  --chart-green-rgb: 79,138,85;
  --chart-red-rgb: 173,85,85;
  --heat-empty: #eef0f2;
  --loan-heat-empty: #edf0f2;
  --loan-interest-empty: #edf0f2;
  --loan-interest-small-sample: #77818a;
  --loan-heat-low: #d9e9f6;
  --loan-heat-mid-low: #79b9d4;
  --loan-heat-mid: #39a879;
  --loan-heat-mid-high: #d0c83d;
  --loan-heat-high: #e4572e;
  --blue: #39769b;
  --blue-dark: #255d80;
  --link: #337ab7;
  --active-bg: #255d80;
  --green: #4f8a55;
  --green-soft: #edf6ee;
  --red: #ad5555;
  --red-soft: #f9eeee;
  --error-border: #e2b4b4;
  --error-ink: #762b2b;
  --warning-bg: #fff8e8;
  --warning-ink: #684d14;
  --warning-border: #d29a29;
  --source-bg: #eff8f1;
  --source-border: #b9d8c1;
  --source-ink: #337044;
  --mixed-bg: #fff8e6;
  --mixed-ink: #7a5b20;
  --volume-bg: #e5f2e7;
  --privacy-ring: #e7f5eb;
  --orange: #f7931a;
  --gold: #d4a72c;
  --silver: #86909a;
  --bronze: #a96d42;
  --on-accent: #fff;
  --exact-bg: #eaf6f1;
  --exact-border: #9fcfbd;
  --exact-ink: #21664f;
  --rule-bg: #eef1fb;
  --rule-border: #b8c2e2;
  --rule-ink: #3b5192;
  --estimate-bg: #fff4dc;
  --estimate-border: #dfbd70;
  --estimate-ink: #75520d;
  --tenor-3: #4e79a7;
  --tenor-6: #17a2b8;
  --tenor-12: #59a14f;
  --tenor-18: #f28e2b;
  --tenor-24: #e15759;
  --official-users: #00a6a6;
  --official-loans: #d66be0;
  --onchain-loans: #3f8ee8;
  --milestone-blog: #7552c7;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #111417;
  --surface: #15191d;
  --surface-subtle: #191e23;
  --surface-raised: #1b2025;
  --ink: #e8eaed;
  --muted: #aeb4bb;
  --monthday-weekend: #e6b8ff;
  --secondary-ink: #b7bdc3;
  --label-ink: #c1c7cd;
  --balance-ink: #d9eef9;
  --line: #363c42;
  --soft-line: #2b3137;
  --stripe: #191e23;
  --field-bg: #12171b;
  --field-border: #4a535c;
  --field-ink: #f1f3f4;
  --button-hover: #252c32;
  --table-head-bg: #242a30;
  --table-head-ink: #d7dce0;
  --panel-bg: #182128;
  --panel-border: #3b4b57;
  --progress-track: #303b43;
  --tooltip-bg: rgba(25, 30, 35, .98);
  --tooltip-ink: #f1f3f4;
  --tooltip-border: #66727c;
  --canvas-bg: #11161a;
  --canvas-filter: none;
  --chart-grid: #343c44;
  --chart-grid-soft: #252c32;
  --chart-text: #aeb4bb;
  --chart-point: #15191d;
  --chart-crosshair: rgba(210, 220, 230, .55);
  --chart-blue-rgb: 101,173,212;
  --chart-green-rgb: 120,201,133;
  --chart-red-rgb: 225,132,132;
  --heat-empty: #2a3036;
  --loan-heat-empty: #252b31;
  --loan-interest-empty: #252b31;
  --loan-interest-small-sample: #77818a;
  --loan-heat-low: #243d55;
  --loan-heat-mid-low: #337fa1;
  --loan-heat-mid: #35966b;
  --loan-heat-mid-high: #b5ad35;
  --loan-heat-high: #e4572e;
  --blue: #65add4;
  --blue-dark: #79bde2;
  --link: #79bde2;
  --active-bg: #286b91;
  --green: #78c985;
  --green-soft: #183321;
  --red: #e18484;
  --red-soft: #3b2023;
  --error-border: #75454a;
  --error-ink: #f1b7bd;
  --warning-bg: #342a14;
  --warning-ink: #f1d391;
  --warning-border: #b9892e;
  --source-bg: #183322;
  --source-border: #3c704a;
  --source-ink: #99d6a4;
  --mixed-bg: #382f19;
  --mixed-ink: #f0cf83;
  --volume-bg: #203c28;
  --privacy-ring: #1c3824;
  --orange: #f79b25;
  --on-accent: #fff;
  --exact-bg: #18342b;
  --exact-border: #3d765f;
  --exact-ink: #9ad9bf;
  --rule-bg: #222b48;
  --rule-border: #485a91;
  --rule-ink: #b7c5f3;
  --estimate-bg: #382e18;
  --estimate-border: #80652e;
  --estimate-ink: #f0d38d;
  --official-users: #62d6d6;
  --official-loans: #ec8af3;
  --milestone-blog: #bda2ff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page-bg: #111417;
    --surface: #15191d;
    --surface-subtle: #191e23;
    --surface-raised: #1b2025;
    --ink: #e8eaed;
    --muted: #aeb4bb;
    --secondary-ink: #b7bdc3;
    --label-ink: #c1c7cd;
    --balance-ink: #d9eef9;
    --line: #363c42;
    --soft-line: #2b3137;
    --stripe: #191e23;
    --field-bg: #12171b;
    --field-border: #4a535c;
    --field-ink: #f1f3f4;
    --button-hover: #252c32;
    --table-head-bg: #242a30;
    --table-head-ink: #d7dce0;
    --panel-bg: #182128;
    --panel-border: #3b4b57;
    --progress-track: #303b43;
    --tooltip-bg: rgba(25, 30, 35, .98);
    --tooltip-ink: #f1f3f4;
    --tooltip-border: #66727c;
    --canvas-bg: #11161a;
    --canvas-filter: none;
    --chart-grid: #343c44;
    --chart-grid-soft: #252c32;
    --chart-text: #aeb4bb;
    --chart-point: #15191d;
    --chart-crosshair: rgba(210, 220, 230, .55);
    --chart-blue-rgb: 101,173,212;
    --chart-green-rgb: 120,201,133;
    --chart-red-rgb: 225,132,132;
    --heat-empty: #2a3036;
    --loan-heat-empty: #252b31;
    --loan-interest-empty: #252b31;
    --loan-interest-small-sample: #77818a;
    --loan-heat-low: #243d55;
    --loan-heat-mid-low: #337fa1;
    --loan-heat-mid: #35966b;
    --loan-heat-mid-high: #b5ad35;
    --loan-heat-high: #e4572e;
    --blue: #65add4;
    --blue-dark: #79bde2;
    --link: #79bde2;
    --active-bg: #286b91;
    --green: #78c985;
    --green-soft: #183321;
    --red: #e18484;
    --red-soft: #3b2023;
    --error-border: #75454a;
    --error-ink: #f1b7bd;
    --warning-bg: #342a14;
    --warning-ink: #f1d391;
    --warning-border: #b9892e;
    --source-bg: #183322;
    --source-border: #3c704a;
    --source-ink: #99d6a4;
    --mixed-bg: #382f19;
    --mixed-ink: #f0cf83;
    --volume-bg: #203c28;
    --privacy-ring: #1c3824;
    --orange: #f79b25;
    --on-accent: #fff;
    --exact-bg: #18342b;
    --exact-border: #3d765f;
    --exact-ink: #9ad9bf;
    --rule-bg: #222b48;
    --rule-border: #485a91;
    --rule-ink: #b7c5f3;
    --estimate-bg: #382e18;
    --estimate-border: #80652e;
    --estimate-ink: #f0d38d;
    --milestone-blog: #bda2ff;
  }
}

/* The smallest radar explanation was 9px; 13px is now the site-wide floor.
   Enforce it in component rules too, including relative sizes and mobile. */
:root { --minimum-text-size: 13px; }
* { box-sizing: border-box; }
small, sub, sup { font-size: max(var(--minimum-text-size), .85em); }

html { min-width: 320px; background: var(--page-bg); }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

/* At normal browser zoom, give desktop copy the same readable x-height it
   previously had around 125%. This deliberately adjusts glyph metrics only:
   zooming or scaling the document would desynchronise canvas hit-testing and
   make viewport-wide sections overflow. Tablet and mobile typography keeps
   its original sizing. */
@media (min-width: 1200px) {
  body { font-size-adjust: .65; }
  .brand { font-size-adjust: none; }
}

button, input, select { font: inherit; }
button { color: inherit; }
input::placeholder { color: var(--muted); opacity: 1; }

.shell {
  width: min(1680px, calc(100% - 32px));
  margin-inline: auto;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  overflow-x: hidden;
}

.topbar .shell {
  padding-inline: 0;
}

.topbar-inner {
  min-height: 66px;
  padding-block: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.brand {
  flex: 0 0 auto;
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-bitcoin-link {
  flex: 0 0 38px;
  display: block;
  border-radius: 50%;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: block;
  border-radius: 50%;
}

.brand-product {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}
.brand-firefish-link {
  flex: 0 0 auto;
  display: block;
  text-decoration: none;
}
.brand-firefish-word {
  flex: 0 0 auto;
  height: 36px;
  display: block;
  -webkit-mask-image: url("/firefish-logo.svg");
  -webkit-mask-size: 162px 36px;
  -webkit-mask-repeat: no-repeat;
  mask-image: url("/firefish-logo.svg");
  mask-size: 162px 36px;
  mask-repeat: no-repeat;
}
.brand-firefish-word {
  width: 102px;
  background: var(--ink);
  -webkit-mask-position: left center;
  mask-position: left center;
}
.brand-firefish-symbol {
  flex: 0 0 auto;
  width: 88px;
  height: 36px;
  display: block;
  object-fit: contain;
}
.brand-insight {
  margin-left: 7px;
  color: var(--ink);
  font-family: "Firefish Satoshi", Arial, sans-serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
}
.brand-bitcoin-link:focus-visible,
.brand-product:focus-visible,
.brand-firefish-link:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

.topbar-actions {
  /* Size the group from its real contents before deciding which row it
     belongs on. Font metrics, zoom and longer translated/data values must
     never squeeze it into the brand's space. */
  flex: 1 1 max-content;
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar-actions > * { flex-shrink: 0; max-width: 100%; }

.processed-btc {
  min-height: 34px;
  padding-right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-right: 1px solid var(--line);
  white-space: normal;
}

.processed-btc span {
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 700;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.processed-btc strong {
  color: var(--orange);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.processed-btc.current-escrow strong { color: var(--blue-dark); }
.processed-btc.current-escrow .current-escrow-ath {
  display: inline;
  margin-left: 3px;
  color: var(--green);
}

.collateral-history-section {
  min-width: 0;
}
.collateral-history-section[hidden] { display: none; }
.collateral-history-heading { align-items: flex-start; gap: 18px; }
.collateral-history-heading > div { flex: 1 1 auto; min-width: 0; }
.collateral-history-heading h2 { margin-bottom: 5px; }
.collateral-history-heading p:last-child {
  max-width: 78ch;
  margin: 0;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  line-height: 1.5;
}
.collateral-history-controls {
  margin: 14px 0 10px;
  padding: 8px 10px;
  border-top: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--soft-line);
  background: var(--surface-subtle);
}
.collateral-history-controls .time-zoom-hint { margin-left: auto; }
.collateral-history-stats {
  margin: 0 0 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--surface-subtle);
}
.collateral-history-stats > span {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}
.collateral-history-stats > span:last-child { border-right: 0; }
.collateral-history-stats small,
.collateral-history-stats strong { display: block; }
.collateral-history-stats small { color: var(--muted); font-size: 14px; font-weight: 700; text-transform: uppercase; }
.collateral-history-stats strong {
  margin-top: 5px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
#collateral-history-current,
#collateral-history-peak { color: var(--orange); }
.collateral-history-percent { color: var(--ink); }
#collateral-history-returned { color: var(--green); }
#collateral-history-liquidated { color: var(--red); }
#collateral-history-peak-date,
#collateral-history-liquidated-detail {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-transform: none;
}
#collateral-history-peak-date { font-size: 17px; }
#collateral-history-peak-date .collateral-history-peak-relative { color: var(--red); }
#collateral-history-peak-date .collateral-history-peak-relative.is-today { color: var(--green); }
.collateral-history-trend-panel {
  margin: -1px 0 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.collateral-history-trend-heading {
  min-width: 0;
  padding: 9px 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
}
.collateral-history-trend-heading strong { color: var(--ink); font-size: 14px; }
.collateral-history-trend-heading small {
  max-width: 780px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  line-height: 1.4;
  text-align: right;
}
.collateral-history-trends {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.collateral-history-trend-card {
  min-width: 0;
  padding: 10px 12px 11px;
  border-right: 1px solid var(--line);
}
.collateral-history-trend-card:last-child { border-right: 0; }
.collateral-history-trend-card > header {
  margin-bottom: 7px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.collateral-history-trend-card h3 { margin: 0; color: var(--ink); font-size: 15px; }
.collateral-history-trend-card > header small { color: var(--muted); font-size: var(--minimum-text-size); white-space: nowrap; }
.collateral-history-trend-card dl { margin: 0; }
.collateral-history-trend-row {
  min-width: 0;
  padding: 4px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  border-top: 1px solid var(--soft-line);
}
.collateral-history-trend-row:first-child { border-top: 0; }
.collateral-history-trend-row dt {
  min-width: 0;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.collateral-history-trend-row dd {
  min-width: 0;
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 2px 6px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.collateral-history-trend-row b { color: var(--ink); font-size: 13px; white-space: nowrap; }
.collateral-history-trend-row dd small {
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 600;
  text-transform: none;
  white-space: nowrap;
}
.collateral-history-trend-row.metric-locked b,
.collateral-history-trend-row.metric-peak b { color: var(--blue); }
.collateral-history-trend-row.metric-returned b { color: var(--green); }
.collateral-history-trend-row.metric-liquidated b { color: var(--red); }
.collateral-history-trend-row.metric-locked.is-negative b { color: var(--red); }
.collateral-history-trend-row.is-flat b,
.collateral-history-trend-row.is-unavailable b { color: var(--muted); }
.collateral-history-trends-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.collateral-history-wrap {
  position: relative;
  width: 100%;
  height: 410px;
  border: 1px solid var(--line);
  background: var(--canvas-bg);
}
#collateral-history-chart {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}
#collateral-history-chart.is-time-panning { cursor: grabbing; }
.collateral-history-tooltip { min-width: 270px; max-width: 390px; }
.collateral-history-legend {
  margin-top: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--secondary-ink);
  font-size: max(17px, var(--minimum-text-size));
}
.collateral-history-legend button {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px;
  background: transparent; color: var(--ink); font: inherit; cursor: pointer;
  text-align: left; max-width: 100%;
}
.collateral-history-legend button:hover { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 10%, transparent); }
.collateral-history-legend button:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.collateral-history-legend button[aria-pressed="false"] { color: var(--muted); border-style: dashed; text-decoration: line-through; }
.collateral-history-legend button[aria-pressed="false"] i { opacity: .35; }
.collateral-history-legend i { width: 20px; height: 7px; display: inline-block; }
.collateral-history-legend i.locked { border-top: 2px solid var(--blue); background: color-mix(in srgb, var(--blue) 22%, transparent); }
.collateral-history-legend i.loan-count { height: 0; border-top: 2px dashed var(--orange); }
.collateral-history-legend i.topup-count { height: 0; border-top: 2px dotted #8128e8; }
.collateral-history-legend i.returned { height: 0; border-top: 3px solid var(--green); }
.collateral-history-legend i.price-liquidated { height: 0; border-top: 3px solid var(--red); }
.collateral-history-legend i.default-liquidated { height: 0; border-top: 3px solid #d9822b; }
.collateral-history-legend i.other-liquidated { height: 0; border-top: 3px dashed var(--muted); }
.collateral-history-legend small { min-width: 0; margin-left: auto; color: var(--muted); overflow-wrap: anywhere; }
.collateral-history-note {
  margin: 10px 0 0;
  padding: 9px 11px;
  border-left: 3px solid var(--blue);
  background: var(--rule-bg);
  color: var(--rule-ink);
  font-size: var(--minimum-text-size);
  line-height: 1.5;
}
.collateral-history-evidence { margin: 9px 0 0; color: var(--muted); font-size: var(--minimum-text-size); line-height: 1.6; overflow-wrap: anywhere; }

.privacy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--secondary-ink);
  font-size: 13px;
}

.privacy-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #39a85a;
  box-shadow: 0 0 0 3px var(--privacy-ring);
}

.theme-toggle {
  min-height: 34px;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--field-border);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--ink);
  font-size: var(--minimum-text-size);
  cursor: pointer;
}

.language-control select {
  width: 122px;
  max-width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 24px 0 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

#app-version { color: var(--muted); }

.theme-toggle:hover { background: var(--button-hover); }
.theme-toggle:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.theme-toggle-icon { font-size: 17px; line-height: 1; }
.theme-toggle[aria-pressed="true"] .theme-toggle-icon { color: var(--orange); }

.market-control {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 5px 4px 10px;
  border: 1px solid var(--button-border);
  background: var(--button-bg);
}

.current-btc-price {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.current-btc-price[data-state="error"] { color: var(--red); }
.current-btc-price[data-stale="true"] { color: var(--orange); }
.current-btc-price[data-provisional="true"]::after { content: " •"; color: var(--orange); }

.market-control select {
  height: 25px;
  min-width: 68px;
  padding: 0 22px 0 7px;
  border: 1px solid var(--field-border);
  border-radius: 0;
  background: var(--field-bg);
  color: var(--field-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.market-control select:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.live-controls {
  min-height: 34px;
  padding: 3px 6px 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--button-border);
  background: var(--button-bg);
  white-space: nowrap;
}

.auto-refresh-indicator {
  min-width: 86px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#auto-refresh-status { display: inline-block; }

.auto-refresh-indicator i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #39a85a;
  box-shadow: 0 0 0 2px color-mix(in srgb, #39a85a 18%, transparent);
}

.auto-refresh-indicator[data-state="updating"] i { background: var(--orange); animation: live-pulse 1s ease-in-out infinite; }
.auto-refresh-indicator[data-state="paused"] i { background: #8a9098; box-shadow: none; }
.auto-refresh-indicator[data-state="error"] i { background: var(--red); box-shadow: none; }
.auto-refresh-indicator[data-state="new"] { color: var(--ink); }
.auto-refresh-indicator[data-state="new"] i { background: var(--blue); }

@keyframes live-pulse {
  50% { opacity: .35; transform: scale(.82); }
}

@media (prefers-reduced-motion: reduce) {
  .auto-refresh-indicator[data-state="updating"] i { animation: none; }
}

.mempool-sound-toggle {
  width: 25px;
  height: 25px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--field-border);
  border-radius: 3px;
  background: var(--surface-raised);
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.mempool-sound-toggle:hover { background: var(--button-hover); }
.mempool-sound-toggle:focus-visible,
.mempool-volume input:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.mempool-sound-toggle[aria-pressed="true"] { color: var(--muted); }

.mempool-volume {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mempool-volume input {
  width: 54px;
  height: 18px;
  margin: 0;
  accent-color: var(--orange);
  cursor: pointer;
}

.mempool-volume output {
  flex: 0 0 5ch;
  width: 5ch;
  white-space: nowrap;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.intro { padding: 34px 0 21px; text-align: center; }

.eyebrow {
  margin: 0 0 4px;
  color: var(--orange);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .13em;
}

.firefish-facts { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.firefish-facts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.firefish-fact { position: relative; min-width: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-raised); }
.fact-card-action { display: block; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: inherit; cursor: pointer; }
.firefish-fact .fact-primary-action { position: static; }
.fact-primary-action::after { content: ''; position: absolute; inset: 0; border-radius: 6px; }
.fact-primary-action:hover::after { box-shadow: inset 0 0 0 1px var(--orange); }
.fact-primary-action:focus-visible { outline: 0; }
.fact-primary-action:focus-visible::after { outline: 3px solid var(--orange); outline-offset: 2px; }
.fact-primary-action[aria-busy="true"] { cursor: wait; }
.firefish-fact .fact-details,
.firefish-fact a,
.firefish-fact button:not(.fact-primary-action) { position: relative; z-index: 2; }
.firefish-fact h3 { margin: 0 0 8px; font-size: 16px; color: var(--muted); }
.firefish-fact > strong { display: block; margin-bottom: 8px; font-size: max(var(--minimum-text-size), clamp(22px, 2.4vw, 32px)); letter-spacing: -.02em; overflow-wrap: anywhere; }
.fact-btc-amount { color: var(--orange); white-space: nowrap; }
.fact-loan-collateral, .fact-czk-equivalent { color: var(--ink); font-size: max(var(--minimum-text-size), .7em); font-weight: 600; margin-inline-start: .25em; }
.fact-loan-collateral { display: inline-block; }
.fact-czk-equivalent { display: inline-block; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.firefish-fact p, .facts-methodology p { margin: 8px 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.firefish-fact a { color: var(--blue); overflow-wrap: anywhere; }
.firefish-fact .fact-detail-link { display: block; width: fit-content; margin-top: 8px; font-size: 14px; }
.firefish-fact .txid-link { max-width: 100%; white-space: nowrap; font-size: 13px; }
.firefish-fact.is-fee-record { margin-top: 16px; padding: 16px 20px; border: 0; border-left: 3px solid var(--red); background: color-mix(in srgb, var(--red) 9%, var(--surface-raised)); }
.firefish-fact.is-fee-record h3, .firefish-fact.is-fee-record > strong { color: var(--red); }
.fact-details > summary, .facts-methodology > summary { width: fit-content; margin-top: 8px; color: var(--muted); font-size: 14px; cursor: pointer; }
.facts-methodology { margin: 0 0 14px; }
.summary-disclosure > summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); background: var(--surface-raised); cursor: pointer; list-style: none; }
.summary-disclosure > summary::-webkit-details-marker { display: none; }
.summary-disclosure > summary::before { content: "▶"; flex: 0 0 auto; color: var(--orange); font-size: var(--minimum-text-size); }
.summary-disclosure[open] > summary::before { transform: rotate(90deg); }
.summary-disclosure > summary h2 { margin: 0; }
.summary-disclosure > summary .eyebrow { display: block; }
.summary-disclosure > summary:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.summary-disclosure[open] > .current-period-summary { margin-top: 16px; }
.fact-details > summary:focus-visible, .facts-methodology > summary:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
@media (max-width: 620px) { .firefish-facts-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 460px) { #fact-total-collateral > strong { font-size: 24px; } }

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 6px;
  font-size: max(var(--minimum-text-size), clamp(21px, 3vw, 28px));
  line-height: 1.25;
}

#title-address {
  color: var(--blue-dark);
  overflow-wrap: anywhere;
}

.lead { margin-bottom: 22px; color: var(--muted); }

.address-form {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
}

.address-form input {
  min-width: 0;
  flex: 1;
  height: 46px;
  padding: 0 20px;
  border: 1px solid var(--field-border);
  border-right: 0;
  border-radius: 999px 0 0 999px;
  background: var(--field-bg);
  color: var(--field-ink);
  font-family: "DejaVu Sans Mono", Consolas, monospace;
  font-size: 14px;
  outline: 0;
}

.address-form input:focus { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }

.primary-button {
  min-width: 154px;
  border: 1px solid #d97800;
  border-radius: 0 999px 999px 0;
  background: var(--orange);
  color: var(--on-accent);
  font-weight: 700;
  cursor: pointer;
}

.primary-button:hover { background: #e78308; }
.primary-button:disabled { cursor: wait; opacity: .65; }

.search-meta {
  max-width: 870px;
  margin: 7px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  text-align: left;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  text-decoration: underline;
  cursor: pointer;
}

.progress-panel, .error-panel {
  max-width: 900px;
  margin: 8px auto 28px;
  padding: 16px 18px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
}

.progress-panel[hidden], .error-panel[hidden] { display: none; }

.progress-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.progress-heading strong, .progress-heading span { display: block; }
.progress-heading strong { font-size: 15px; }
.progress-heading div span { margin-top: 2px; color: var(--muted); font-size: 13px; }
#progress-percent { color: var(--blue-dark); font-weight: 700; font-variant-numeric: tabular-nums; }

.progress-track {
  height: 7px;
  margin: 12px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--progress-track);
}

#progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), #f6b14d);
  transition: width .25s ease;
}

#progress-note { margin: 0; color: var(--muted); font-size: var(--minimum-text-size); }

.progress-panel.is-manual-refresh {
  position: fixed;
  z-index: 80;
  top: 76px;
  right: max(16px, calc((100vw - 1120px) / 2));
  width: min(560px, calc(100vw - 32px));
  margin: 0;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .24);
}

.progress-job-details {
  margin: 10px 0 0;
  display: grid;
  gap: 6px;
}
.progress-job-details[hidden] { display: none; }
.progress-job-row {
  min-width: 0;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  background: var(--surface-raised);
}
.progress-job-row strong { min-width: 0; overflow-wrap: anywhere; font-size: var(--minimum-text-size); }
.progress-job-row span { min-width: 0; overflow-wrap: anywhere; color: var(--muted); font-size: var(--minimum-text-size); }
.progress-job-row b {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--blue-dark);
  font-size: var(--minimum-text-size);
  font-variant-numeric: tabular-nums;
}
.progress-job-row[data-stage="done"] strong { color: var(--green); }

.error-panel { border-color: var(--error-border); background: var(--red-soft); color: var(--error-ink); }
.error-panel strong, .error-panel span { display: block; }
.error-panel span { margin-top: 4px; }

#dashboard > section, #dashboard > details { padding: 29px 0 36px; border-top: 1px solid var(--line); }

.section-heading {
  margin-bottom: 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.transactions-tip-status {
  color: var(--muted);
  font-size: max(var(--minimum-text-size), 0.55em);
  font-weight: 600;
  white-space: normal;
}
.transactions-tip-status[data-state="behind"] { color: var(--orange); }
.fee-excess-inline { color: var(--red); }
.transactions-tip-current { color: var(--green); }
.section-note { color: var(--muted); font-size: var(--minimum-text-size); }

.source-status {
  padding: 4px 9px;
  border: 1px solid var(--source-border);
  border-radius: 3px;
  background: var(--source-bg);
  color: var(--source-ink);
  font-size: var(--minimum-text-size);
}

.summary-table {
  max-width: 720px;
  margin-inline: auto;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--surface);
}

.summary-row {
  min-height: 52px;
  padding: 9px 14px;
  display: grid;
  grid-template-columns: minmax(140px, .72fr) minmax(0, 1.28fr);
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.summary-row:nth-child(even) { background: var(--stripe); }
.summary-row > :first-child { color: var(--label-ink); font-weight: 700; }
.summary-row > :last-child { text-align: right; font-variant-numeric: tabular-nums; }
.summary-row small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--minimum-text-size); font-weight: 400; }
.balance-row { min-height: 65px; background: var(--surface-subtle); }
.balance-row strong { color: var(--balance-ink); font-size: max(var(--minimum-text-size), clamp(22px, 4vw, 31px)); }
.summary-balance-link {
  display: inline-block;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--balance-ink) 42%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.summary-balance-link:hover { color: var(--link); text-decoration-color: currentColor; }
.summary-balance-link:focus-visible {
  color: var(--link);
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 2px;
  text-decoration-color: currentColor;
}
#summary-received { color: var(--green); }
#summary-sent { color: var(--red); }

.history-heat-legend {
  display: flex;
  align-items: center;
  gap: 7px 12px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  flex-wrap: wrap;
}
.history-heat-legend strong { color: var(--ink); }
.history-heat-legend span { display: inline-flex; align-items: center; gap: 5px; }
.history-heat-swatch {
  width: 18px;
  height: 7px;
  border-radius: 999px;
  background: hsl(122 67% 49%);
}
.history-heat-swatch.middle { background: hsl(61 67% 49%); }
.history-heat-swatch.high { background: hsl(0 67% 49%); }
.history-heat-cell {
  background-image: linear-gradient(
    color-mix(in srgb, var(--history-heat-color) 22%, transparent),
    color-mix(in srgb, var(--history-heat-color) 12%, transparent)
  ) !important;
  box-shadow: inset 0 -2px var(--history-heat-color);
}

.current-period-summary {
  max-width: none;
  margin: 20px auto 0;
}

#dashboard > .transactions-section:first-child {
  padding-top: 18px;
  border-top: 0;
}

.current-period-summary-heading {
  margin-bottom: 9px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.current-period-summary-heading h3 { margin: 0; color: var(--ink); font-size: 16px; }
.current-period-summary-heading p { margin: 0; color: var(--muted); font-size: var(--minimum-text-size); text-align: right; }

.summary-overview-grid {
  font-size: 19px;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
}

.summary-overview-grid > .summary-table {
  max-width: none;
  height: 100%;
  margin: 0;
  display: grid;
  /* Size each row by its own content, not the tallest row in this card. */
  grid-template-rows: minmax(52px, auto) repeat(6, auto);
}

.summary-now { display: flex; flex-wrap: wrap; align-items: baseline; align-content: center; justify-content: center; gap: 4px 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--surface-subtle); text-align: center; }
.summary-now strong { font-size: 24px; }
.summary-now time { color: var(--muted); font-size: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.summary-overview-grid > .summary-table .summary-row > :last-child { font-size: 17px; }

.summary-overview-grid > .summary-table .summary-row {
  min-width: 0;
  min-height: 0;
  padding-block: 6px;
  padding-inline: 11px;
  grid-template-columns: minmax(92px, .82fr) minmax(0, 1.18fr);
  gap: 8px;
}

.summary-overview-grid > .summary-table .balance-row strong {
  font-size: max(var(--minimum-text-size), calc(clamp(19px, 1.65vw, 27px) - 2px));
}
.summary-overview-grid .summary-row small { font-size: 13px; }
/* The original responsive balance exceeds 20px above this breakpoint. */
@media (max-width: 1212.1212px) {
  .summary-overview-grid > .summary-table .balance-row strong {
    font-size: max(var(--minimum-text-size), calc(clamp(19px, 1.65vw, 27px) + 2px));
  }
}

.current-period-summary-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-column: span 3;
  align-items: stretch;
  gap: 10px;
}

.current-period-card {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr);
  border: 1px solid var(--line);
  background: var(--surface);
}

.current-period-card header {
  display: grid;
  grid-template-columns: max-content max-content;
  align-items: baseline;
  align-content: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  text-align: center;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
}

.current-period-card h4 { margin: 0; color: var(--ink); font-size: 24px; }
.current-period-card header span { color: var(--muted); font-size: 20px; }
.current-period-card dl {
  min-height: 0;
  margin: 0;
  display: grid;
  grid-template-rows: repeat(9, auto);
}
.current-period-card dl > div {
  min-width: 0;
  min-height: 0;
  padding: 5px 11px;
  display: grid;
  grid-template-columns: minmax(72px, .8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--soft-line);
}
.current-period-card dl > div:last-child { border-bottom: 0; }
.current-period-card dt { min-width: 0; color: var(--muted); font-size: 14px; }
.current-period-card dd { min-width: 0; margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.current-period-card dd strong { display: block; color: var(--ink); font-size: 16px; }
.current-period-card dd strong.positive { color: var(--green); }
.current-period-card dd strong.negative { color: var(--red); }
.current-liquidation-link { padding: 2px 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.current-liquidation-link:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.current-liquidation-link:disabled { cursor: default; text-decoration: none; }
.history-liquidation-period-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 13px; }
.history-liquidation-period-filter[hidden] { display: none; }
.history-liquidation-period-filter button { padding: 5px 10px; border: 1px solid var(--field-border); border-radius: 4px; background: var(--surface); color: var(--ink); cursor: pointer; }
.current-period-card .firefish-commission dd strong { color: var(--firefish-commission); }
.current-period-card dd small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }

@supports (grid-template-rows: subgrid) {
  .current-period-summary-grid {
    grid-template-rows: 52px repeat(9, minmax(min-content, auto));
    row-gap: 0;
  }

  .current-period-card {
    grid-row: 1 / span 10;
    grid-template-rows: subgrid;
  }

  .current-period-card dl {
    grid-row: 2 / span 9;
    grid-template-rows: subgrid;
  }
}

.warnings {
  max-width: 720px;
  margin: 10px auto 0;
  padding: 10px 12px;
  border-left: 3px solid var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning-ink);
  font-size: 13px;
}

.firefish-brand-panel {
  min-height: 76px;
  margin-bottom: 27px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid #292f33;
  border-left: 4px solid #e6413e;
  background: #0f1214;
  color: #f5f6f7;
}

.firefish-brand-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.firefish-brand-identity .brand { min-width: 0; flex-wrap: wrap; row-gap: 6px; }
.firefish-brand-identity .brand-product,
.firefish-brand-identity .brand-insight { color: inherit; }
.firefish-brand-identity .brand-firefish-word { background: currentColor; }

.firefish-brand-identity > img {
  width: 162px;
  height: 36px;
  display: block;
  flex: 0 0 auto;
}

.firefish-brand-identity > span {
  padding-left: 16px;
  border-left: 1px solid #42484c;
  color: #aeb5ba;
  font-size: var(--minimum-text-size);
  letter-spacing: .02em;
}

.value-kind-legend {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.value-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid;
  border-radius: 999px;
  font-size: var(--minimum-text-size);
  font-style: normal;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  vertical-align: middle;
}

.value-badge i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.value-exact { border-color: var(--exact-border); background: var(--exact-bg); color: var(--exact-ink); }
.value-rule { border-color: var(--rule-border); background: var(--rule-bg); color: var(--rule-ink); }
.value-estimate { border-color: var(--estimate-border); background: var(--estimate-bg); color: var(--estimate-ink); }

.firefish-brand-panel .value-exact { border-color: #386d5a; background: #142b24; color: #9dd9c1; }
.firefish-brand-panel .value-rule { border-color: #465a92; background: #1d2744; color: #bcc8ef; }
.firefish-brand-panel .value-estimate { border-color: #745f31; background: #302816; color: #efd28b; }

.firefish-heading { margin-bottom: 13px; }

.tracked-addresses {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.tracked-address-card {
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: minmax(360px, .9fr) 500px minmax(500px, 1.1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--surface-subtle);
}

.tracked-address-card + .tracked-address-card { border-top: 0; }

.tracked-address-identity {
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.tracked-address-purpose {
  min-width: 0;
  overflow: hidden;
  color: var(--secondary-ink);
  font-size: var(--minimum-text-size);
  font-weight: 600;
  text-overflow: ellipsis;
}
.address-role { color: var(--muted); font-size: var(--minimum-text-size); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

.tracked-address-card a {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  color: var(--link);
  text-decoration: none;
}

.tracked-address-card a:hover code { text-decoration: underline; }
.tracked-address-card a:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.tracked-address-card code { min-width: 0; font-size: var(--minimum-text-size); overflow-wrap: anywhere; }

.tracked-address-flow {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
}

.tracked-address-stat {
  min-width: 0;
  padding-inline: 9px;
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr);
  align-items: baseline;
  gap: 4px;
  font-size: var(--minimum-text-size);
  font-variant-numeric: tabular-nums;
}

.tracked-address-stat + .tracked-address-stat { border-left: 1px solid var(--line); }
.tracked-address-direction { color: var(--muted); font-weight: 700; text-transform: uppercase; }
.tracked-address-stat strong { color: var(--ink); font-size: var(--minimum-text-size); }
.tracked-address-stat i { color: var(--muted); font-style: normal; }
.tracked-address-stat b { min-width: 0; color: var(--secondary-ink); font-size: var(--minimum-text-size); text-align: right; }
.tracked-address-stat--incoming .tracked-address-direction,
.tracked-address-stat--incoming strong,
.tracked-address-stat--incoming b { color: var(--green); }
.tracked-address-stat--outgoing .tracked-address-direction,
.tracked-address-stat--outgoing strong,
.tracked-address-stat--outgoing b { color: var(--red); }

@media (min-width: 901px) {
  .tracked-address-card,
  .tracked-address-identity,
  .tracked-address-card a,
  .tracked-address-stat { white-space: nowrap; }
}

@media (min-width: 901px) and (max-width: 1500px) {
  .tracked-address-card { grid-template-columns: minmax(0, 1fr) minmax(500px, auto); }
  .tracked-address-flow { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .tracked-address-card { grid-template-columns: minmax(0, 1fr); }
  .tracked-address-card a, .tracked-address-flow { grid-column: 1; }
}

.fee-rate-card {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
}

.firefish-fees-section[hidden] { display: none; }
.firefish-fees-section .fee-rate-card { margin-bottom: 0; }

.fee-rate-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.fee-rate-heading h2 { margin: 3px 0 0; color: var(--ink); font-size: 22px; line-height: 1.2; }
.fee-rate-heading label { display: grid; flex: 0 0 190px; gap: 4px; color: var(--label-ink); font-size: var(--minimum-text-size); font-weight: 700; }
.fee-rate-heading select {
  width: 100%;
  height: 36px;
  padding: 0 30px 0 9px;
  border: 1px solid var(--field-border);
  border-radius: 4px;
  background: var(--field-bg);
  color: var(--field-ink);
  cursor: pointer;
}
.fee-rate-heading select:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.fee-rate-intro, .fee-rate-caveat { color: var(--muted); font-size: var(--minimum-text-size); line-height: 1.55; }
.fee-rate-intro { max-width: 980px; margin: 11px 0 13px; }
.fee-rate-intro strong { color: var(--ink); }
.fee-rate-caveat { margin: 11px 0 0; padding: 10px 12px; border-left: 3px solid var(--rule-border); background: var(--rule-bg); color: var(--rule-ink); }
.fee-rate-caveat strong { color: inherit; }

.fee-rate-summary-grid {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--surface);
}

.fee-rate-summary-grid article {
  position: relative;
  min-width: 0;
  padding: 11px 13px 12px 31px;
}
.fee-rate-summary-grid article:first-child { border-right: 1px solid var(--line); }
.fee-rate-summary-grid h4 { margin: 0 0 5px; color: var(--ink); font-size: var(--minimum-text-size); }
.fee-rate-summary-grid p { margin: 0; color: var(--muted); font-size: var(--minimum-text-size); line-height: 1.55; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fee-rate-series-dot { position: absolute; top: 14px; left: 13px; width: 9px; height: 9px; border-radius: 2px; }
.fee-rate-series-dot.funding { background: var(--blue); }
.fee-rate-series-dot.closing { background: var(--orange); }

.fee-rate-chart-wrap {
  position: relative;
  width: 100%;
  height: 340px;
  border: 1px solid var(--line);
  background: var(--canvas-bg);
}
#fee-rate-chart { width: 100%; height: 100%; display: block; cursor: default; touch-action: none; user-select: none; }
#fee-rate-chart.is-panning { cursor: grabbing !important; }
.fee-rate-tooltip { min-width: 225px; max-width: 290px; }

.fee-rate-legend {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 17px;
  flex-wrap: wrap;
  color: var(--secondary-ink);
  font-size: var(--minimum-text-size);
}
.fee-rate-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fee-rate-legend i { width: 18px; height: 7px; border-radius: 1px; }
.fee-rate-legend i.funding { background: var(--blue); }
.fee-rate-legend i.closing { background: var(--orange); }
.fee-rate-legend .muted { margin-left: auto; }

.fee-rate-interaction-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: var(--minimum-text-size);
}

.fee-rate-detail {
  width: 100%;
  min-width: 0;
  margin-top: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}
.fee-rate-detail[hidden] { display: none; }

.fee-rate-detail-heading {
  padding: 12px 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
}
.fee-rate-detail-heading > div { min-width: 0; }
.fee-rate-detail-heading h3 { margin: 0 0 3px; color: var(--ink); font-size: 15px; }
.fee-rate-detail-heading p { margin: 0; color: var(--muted); font-size: var(--minimum-text-size); line-height: 1.45; }

.fee-rate-detail-limit-control {
  flex: 0 0 112px;
  margin-left: auto;
  display: grid;
  gap: 4px;
  color: var(--label-ink);
  font-size: var(--minimum-text-size);
  font-weight: 700;
}
.fee-rate-detail-limit-control select {
  width: 100%;
  height: 34px;
  padding: 0 28px 0 8px;
  border: 1px solid var(--field-border);
  border-radius: 4px;
  background: var(--field-bg);
  color: var(--field-ink);
  cursor: pointer;
}
.fee-rate-detail-limit-control select:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.fee-rate-detail-series {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-size: var(--minimum-text-size);
  font-weight: 800;
  white-space: nowrap;
}
.fee-rate-detail-series.funding { color: var(--blue-dark); background: var(--exact-bg); }
.fee-rate-detail-series.closing { color: var(--estimate-ink); background: var(--estimate-bg); }

.fee-rate-detail-table-wrap { width: 100%; min-width: 0; overflow: hidden; }
.fee-rate-detail-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  color: var(--secondary-ink);
  font-size: var(--minimum-text-size);
  font-variant-numeric: tabular-nums;
}
.fee-rate-detail-table th,
.fee-rate-detail-table td {
  min-width: 0;
  padding: 6px 7px;
  border-bottom: 1px solid var(--soft-line);
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}
.fee-rate-detail-table th {
  background: var(--table-head-bg);
  color: var(--table-head-ink);
  font-size: var(--minimum-text-size);
  white-space: nowrap;
}
.fee-rate-detail-table th[data-sort-key] { position: relative; }
.fee-rate-detail-table .sort-button {
  width: 100%;
  padding: 2px 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-align: inherit;
  cursor: pointer;
}
.fee-rate-detail-table .sort-button:hover { color: var(--link); }
.fee-rate-detail-table .sort-button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.fee-rate-detail-table th[aria-sort]:not([aria-sort="none"]) .sort-indicator { color: var(--link); }
.fee-rate-detail-table th:nth-child(1) { width: 29%; }
.fee-rate-detail-table th:nth-child(2) { width: 9%; }
.fee-rate-detail-table th:nth-child(3) { width: 6%; }
.fee-rate-detail-table th:nth-child(4),
.fee-rate-detail-table th:nth-child(5),
.fee-rate-detail-table th:nth-child(6),
.fee-rate-detail-table th:nth-child(7),
.fee-rate-detail-table th:nth-child(8),
.fee-rate-detail-table th:nth-child(9) { width: 7%; }
.fee-rate-detail-table th:nth-child(10) { width: 14%; }
.fee-rate-detail-table th:nth-child(n + 3):nth-child(-n + 9),
.fee-rate-detail-table th:nth-child(n + 3):nth-child(-n + 9) .sort-button {
  text-align: right;
}
.fee-rate-detail-table th:nth-child(n + 3):nth-child(-n + 9) .sort-button { justify-content: flex-end; }
.fee-rate-detail-table tbody tr:nth-child(even) { background: var(--stripe); }
.fee-rate-detail-table tbody tr:last-child td { border-bottom: 0; }
.fee-rate-detail-table td.numeric { text-align: right; }
.fee-rate-detail-table td > strong,
.fee-rate-detail-table td > time,
.fee-rate-detail-table td > small { display: block; }
.fee-rate-detail-table td > strong { color: var(--ink); }
.fee-rate-detail-table td > small { margin-top: 3px; color: var(--muted); line-height: 1.35; }
.fee-rate-detail-table td:nth-child(1),
.fee-rate-detail-table td:nth-child(3),
.fee-rate-detail-table td:nth-child(4),
.fee-rate-detail-table td:nth-child(5),
.fee-rate-detail-table td:nth-child(6),
.fee-rate-detail-table td:nth-child(7),
.fee-rate-detail-table td:nth-child(8),
.fee-rate-detail-table td:nth-child(9) { white-space: nowrap; }
.fee-rate-high { color: var(--red); }
.fee-rate-legend .fee-rate-high-key { background: var(--red); }
.fee-deviation-audit { margin-block: 1rem; padding: 1rem; border: 1px solid var(--line, #343b42); border-left: 3px solid var(--red); }
.fee-deviation-audit p { color: var(--muted); line-height: 1.55; }
.fee-deviation-audit summary { cursor: pointer; }
.fee-deviation-audit .fee-deviation-period.has-anomalies strong { color: var(--red); }
.fee-deviation-period strong,
.fee-deviation-period span { display: block; }
.fee-deviation-period strong { font-size: max(var(--minimum-text-size), 1.05rem); }
.fee-compensation { margin-block: 1rem; padding: 1rem; border: 1px solid var(--red); background: var(--red-soft); }
.fee-compensation h4 { margin: 0; color: var(--red); font-size: max(var(--minimum-text-size), calc(1rem + 2px)); }
.fee-compensation > p { margin: .85rem 0 0; }
.fee-confirmation-scroll { margin-block: 1rem; }
.fee-confirmation-table { width: 100%; border-collapse: collapse; font-size: max(var(--minimum-text-size), .9rem); }
.fee-confirmation-table caption { text-align: center; padding-bottom: .65rem; color: var(--muted); }
.fee-confirmation-table th, .fee-confirmation-table td { padding: .75rem; border: 1px solid var(--line); }
.fee-confirmation-table th { text-align: center; vertical-align: middle; }
.fee-confirmation-summary th small { display: block; margin-top: 6px; font-size: max(var(--minimum-text-size), .78em); font-weight: 400; color: var(--muted); }
.fee-confirmation-table td { text-align: center; vertical-align: middle; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fee-confirmation-table .fee-excess { color: var(--red); font-weight: 700; }
.fee-scenario-content { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fee-scenario-label { min-width: 105px; max-width: 150px; }
.fee-scenario-illustration { display: block; flex: 0 0 auto; border-radius: 3px; }
.fee-scenario-illustration img { display: block; width: auto; height: 130px; max-width: none; }
.fee-scenario-illustration:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.fee-compensation > .fee-scenario-note { font-size: var(--minimum-text-size); color: var(--muted); }
.fee-confirmation-summary { min-width: 1120px; }
.fee-confirmation-summary small { display: block; font-size: max(var(--minimum-text-size), .75rem); color: var(--muted); margin-top: 5px; }
.fee-count-link { border: 0; background: transparent; padding: 4px; color: var(--link); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.fee-count-link:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.fee-count-link:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.fee-rate-detail { scroll-margin-top: 24px; }
.fee-rate-detail-series.excess { color: var(--red); background: var(--red-soft); }
.fee-comparison-note { font-size: max(var(--minimum-text-size), .85rem); }
.fee-excess-transactions { margin-block: 1rem; }
.fee-excess-transactions > summary { width: fit-content; max-width: 100%; color: var(--red); font-weight: 700; text-decoration: underline; text-underline-offset: .2em; }
.fee-excess-transactions > summary:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }
.fee-excess-transactions-table { min-width: 1400px; }
.fee-loan-terms { min-width: 130px; }
.fee-loan-term { min-height: 3.5em; padding-block: 5px; }
.fee-loan-term > .fact-cohort-link { display: block; margin: 4px auto 0; }
.fee-loan-term > small { display: block; }
.fee-excess-transactions-table th { white-space: nowrap; }
.fee-excess-transactions .pagination { gap: .75rem; flex-wrap: wrap; }
.fee-excess-transactions .pagination-controls { display: flex; flex-wrap: wrap; gap: .5rem; }
.fee-deviation-audit .fee-deviation-sources { font-size: max(var(--minimum-text-size), .85rem); }
.fee-rate-detail-table .fee-overpay-cell strong {
  color: var(--red);
  font-size: var(--minimum-text-size);
  line-height: 1.25;
}
.fee-rate-detail-table .block-minimum-cell { color: var(--blue-dark); text-align: right; }
.fee-rate-detail-table .block-minimum-cell strong { font-size: var(--minimum-text-size); line-height: 1.25; }
.fee-rate-detail-table .block-minimum-cell.is-empty-block small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  line-height: 1.2;
  white-space: normal;
}
.fee-rate-detail-table .txid-link {
  display: block;
  max-width: none;
  overflow: visible;
  font-size: var(--minimum-text-size);
  letter-spacing: -.02em;
  white-space: nowrap;
  word-break: normal;
  text-overflow: clip;
}

@media (min-width: 761px) and (max-width: 1279px) {
  .fee-rate-detail-table .txid-link {
    white-space: normal;
    word-break: break-all;
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .fee-rate-detail-table th { white-space: normal; }
  .fee-rate-detail-table th:nth-child(1) { width: 27%; }
  .fee-rate-detail-table th:nth-child(2) { width: 8%; }
  .fee-rate-detail-table th:nth-child(3) { width: 6%; }
  .fee-rate-detail-table th:nth-child(4),
  .fee-rate-detail-table th:nth-child(5),
  .fee-rate-detail-table th:nth-child(9) { width: 7%; }
  .fee-rate-detail-table th:nth-child(6),
  .fee-rate-detail-table th:nth-child(7),
  .fee-rate-detail-table th:nth-child(8) { width: 7.5%; }
  .fee-rate-detail-table th:nth-child(10) { width: 15%; }
  .fee-rate-detail-table td:nth-child(n + 3):nth-child(-n + 9) { white-space: normal; }
}

.firefish-model-card {
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
}

.model-card-heading {
  margin-bottom: 15px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.model-card-heading h3 { margin: 0 0 3px; font-size: 17px; }
.model-card-heading p { max-width: 720px; margin: 0; color: var(--muted); font-size: var(--minimum-text-size); }

.firefish-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.firefish-controls label { min-width: 0; }
.firefish-controls label[hidden] { display: none; }
.firefish-controls label > span, .cpfp-controls label { display: block; margin-bottom: 4px; color: var(--label-ink); font-size: var(--minimum-text-size); font-weight: 700; }

.firefish-controls select, .firefish-controls input, .cpfp-controls select {
  width: 100%;
  height: 38px;
  padding: 0 9px;
  border: 1px solid var(--field-border);
  border-radius: 4px;
  background-color: var(--field-bg);
  color: var(--field-ink);
}

.firefish-controls select, .cpfp-controls select {
  padding-right: 30px;
  cursor: pointer;
}

.firefish-controls select:focus-visible, .firefish-controls input:focus-visible, .cpfp-controls select:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.ff-fee-model-note {
  margin: 11px 0 0;
  padding: 9px 11px;
  border-left: 3px solid var(--rule-border);
  background: var(--rule-bg);
  color: var(--rule-ink);
  font-size: var(--minimum-text-size);
}

.ff-fee-model-note strong { color: inherit; }

.price-note {
  margin: 11px 0 12px;
  padding-left: 10px;
  border-left: 3px solid var(--estimate-border);
  color: var(--muted);
  font-size: var(--minimum-text-size);
}

.firefish-model-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--surface);
}

.firefish-model-summary > * {
  min-width: 0;
  min-height: 70px;
  padding: 11px 12px;
  border-right: 1px solid var(--line);
}

.firefish-model-summary > *:last-child { border-right: 0; }
.firefish-model-summary span { display: block; color: var(--muted); font-size: var(--minimum-text-size); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.firefish-model-summary strong { display: block; margin-top: 6px; color: var(--ink); font-size: 17px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.firefish-model-summary small { display: block; margin-top: 5px; color: var(--muted); font-size: var(--minimum-text-size); line-height: 1.35; }
.ff-model-stat.exact strong { color: var(--exact-ink); }
.ff-model-stat.estimate { background: var(--estimate-bg); }
.ff-model-stat.estimate strong { color: var(--estimate-ink); }

.methodology {
  border: 1px solid var(--line);
  background: var(--surface);
}

.methodology > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 17px;
  background: var(--surface-subtle);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.methodology > summary::-webkit-details-marker { display: none; }
.methodology > summary::after {
  content: attr(data-closed-label);
  color: var(--orange);
  font-size: var(--minimum-text-size);
  font-weight: 700;
  white-space: nowrap;
}
.methodology[open] > summary::after { content: attr(data-open-label); }

.methodology > summary:hover { background: var(--button-hover); }
.methodology > summary:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.methodology[open] > summary { border-bottom: 1px solid var(--line); }
.methodology-content { padding: 18px; }

.methodology-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 26px;
}

.methodology-grid article {
  min-width: 0;
  padding: 3px 0 16px;
  border-bottom: 1px solid var(--soft-line);
}

.methodology-grid article:nth-last-child(-n + 2) { border-bottom: 0; }
.methodology-grid h3, .source-box h3 { margin: 0 0 7px; font-size: 14px; }
.methodology-grid p { margin: 0 0 8px; color: var(--secondary-ink); font-size: var(--minimum-text-size); }
.methodology-grid p:last-child { margin-bottom: 0; }
.methodology-grid code, .formula-block code { overflow-wrap: anywhere; font-size: var(--minimum-text-size); }

.formula-block {
  margin: 8px 0;
  padding: 9px 10px;
  border-left: 3px solid var(--rule-border);
  background: var(--surface-subtle);
}

.formula-block code { display: block; color: var(--field-ink); line-height: 1.65; white-space: normal; }

.source-box {
  margin-top: 4px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(190px, .55fr) minmax(0, 1.45fr);
  gap: 20px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
}

.source-box p { margin: 0; color: var(--muted); font-size: var(--minimum-text-size); }
.source-links { display: flex; align-content: flex-start; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.source-links a, .section-address-link { color: var(--link); font-size: var(--minimum-text-size); text-decoration: underline; }
.source-links a { padding: 4px 7px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
.source-links a:hover { border-color: var(--link); text-decoration: underline; }
.source-links a:focus-visible, .section-address-link:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.independent-disclaimer {
  margin: 13px 0 0;
  padding: 11px 13px;
  border-left: 3px solid var(--field-border);
  background: var(--surface-subtle);
  color: var(--red);
  font-size: var(--minimum-text-size);
}

.protocol-transparency .protocol-emphasis { color: var(--red); font-weight: 600; }
.closed-period-controls { grid-column: 1 / -1; margin: 0; }
.closed-loan-cards .fact-cohort-link { text-decoration: none; }
.closed-loan-cards .rolling-metric { display: inline-block; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.closed-loan-cards .rolling-metric span { font: inherit; color: inherit; }

.loan-scatter-section[hidden] { display: none; }
.loan-scatter-heading { align-items: flex-start; }

.loan-scatter-explainer {
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--surface);
}

.loan-scatter-explainer > div {
  min-width: 0;
  min-height: 65px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-right: 1px solid var(--line);
}

.loan-scatter-explainer > div:last-child { border-right: 0; }
.loan-scatter-explainer p { margin: 0; color: var(--muted); font-size: var(--minimum-text-size); }
.loan-scatter-explainer strong { display: block; color: var(--ink); font-size: var(--minimum-text-size); }

.scatter-key {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--field-border);
  color: var(--on-accent);
  font-size: var(--minimum-text-size);
  font-weight: 700;
}

.scatter-key-x { background: var(--active-bg); }
.scatter-key-y { background: var(--red); }
.scatter-key-color { border-radius: 50%; background: linear-gradient(135deg, var(--tenor-3) 0 20%, var(--tenor-6) 20% 40%, var(--tenor-12) 40% 60%, var(--tenor-18) 60% 80%, var(--tenor-24) 80%); }
.scatter-key-size { width: 27px; height: 27px; border-radius: 50%; border: 2px solid var(--blue); background: color-mix(in srgb, var(--blue) 18%, transparent); }

.loan-scatter-scope {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
}

.loan-scatter-scope .value-badge { margin-right: 5px; }

.loan-filter-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  grid-template-areas: "filters key" "help key";
  gap: 8px 14px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
}
.loan-filter-panel > .loan-scatter-explainer { grid-area: key; grid-template-columns: 1fr; align-content: center; gap: 5px; margin: 0; padding: 0 0 0 12px; border: 0; border-left: 1px solid var(--line); background: transparent; }
.loan-filter-panel .loan-scatter-explainer > div { min-height: 30px; padding: 2px 0; gap: 8px; border: 0; }
/* Both X-axis labels share the same reserved space in Firefox and Chromium. */
#loan-scatter-x-label { min-height: 3lh; }
.loan-filter-panel .scatter-key { width: 22px; height: 22px; }
.loan-filter-panel > .loan-progress-filter-help { grid-area: help; margin: 0; }

.loan-filter-grid {
  grid-area: filters;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
}
.loan-principal-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-column: span 2; gap: 8px; min-width: 0; }

@media (min-width: 1500px) {
  .loan-filter-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (min-width: 761px) and (max-width: 1099px) {
  .loan-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 999px) {
  .loan-filter-panel { grid-template-columns: minmax(0, 1fr); grid-template-areas: "filters" "help" "key"; }
  .loan-filter-panel > .loan-scatter-explainer { grid-template-columns: repeat(2, minmax(0, 1fr)); border-left: 0; border-top: 1px solid var(--line); padding: 8px 0 0; }
}

.loan-filter-field { min-width: 0; }
.loan-filter-field > span { display: block; margin-bottom: 4px; color: var(--label-ink); font-size: var(--minimum-text-size); font-weight: 700; }

.loan-filter-field input, .loan-filter-field select {
  width: 100%;
  height: 34px;
  padding: 0 8px;
  font-size: var(--minimum-text-size);
  border: 1px solid var(--field-border);
  border-radius: 4px;
  background: var(--field-bg);
  color: var(--field-ink);
  outline: 0;
}

.loan-filter-field select { padding-right: 30px; cursor: pointer; }
.loan-checkbox-field {
  min-height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--field-border);
  border-radius: 4px;
  background: var(--field-bg);
  cursor: pointer;
}
.loan-checkbox-field input {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--orange);
}
.loan-checkbox-field > span { margin: 0; color: var(--field-ink); font-size: var(--minimum-text-size); }
.loan-filter-field input:focus, .loan-filter-field select:focus { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.loan-filter-field input:focus-visible, .loan-filter-field select:focus-visible, .loan-filter-reset:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.loan-progress-filter-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  line-height: 1.45;
}

.loan-filter-reset {
  min-height: 34px;
  padding: 5px 10px;
  font-size: var(--minimum-text-size);
  border: 1px solid var(--field-border);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.loan-filter-reset:hover { background: var(--button-hover); }

.loan-scatter-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.loan-scatter-axis-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--field-border);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--secondary-ink);
  font-size: var(--minimum-text-size);
  font-weight: 800;
  cursor: pointer;
}

.loan-scatter-axis-toggle:has(input:checked) {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 14%, var(--surface-raised));
  color: var(--ink);
}

.loan-scatter-axis-toggle input { accent-color: var(--blue); }

.loan-scatter-wrap {
  position: relative;
  width: 100%;
  height: 480px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  background: var(--canvas-bg);
  -webkit-overflow-scrolling: touch;
}
.loan-principal-stats-scroll{max-width:100%;overflow-x:auto;border:1px solid var(--line);border-top:0;background:var(--surface-subtle);}
.loan-principal-stats{display:grid;grid-template-columns:repeat(12,minmax(max-content,1fr));margin:0;min-width:100%;width:max-content;}
.loan-principal-stat{--percentile-hue:60;padding:12px 8px;text-align:center;border-right:1px solid var(--line);border-bottom:3px solid hsl(var(--percentile-hue) 55% 48%);font-variant-numeric:tabular-nums;}
.loan-principal-stat:last-child{border-right:0;background:var(--surface-raised);}
.loan-principal-stat dt{font-size: var(--minimum-text-size);font-weight:650;color:var(--muted);white-space:nowrap;}
.loan-principal-stat abbr[title]{cursor:help;text-decoration:underline dotted;text-underline-offset:3px;}
.loan-principal-stat dd{margin:6px 0 0;white-space:nowrap;font-size: var(--minimum-text-size);font-weight:750;color:color-mix(in srgb,hsl(var(--percentile-hue) 78% 47%) 78%,var(--ink));}
.loan-principal-stats-note{margin:7px 0;font-size: var(--minimum-text-size);line-height:1.5;color:var(--muted);}
.loan-principal-stats-scroll:focus-visible{outline:2px solid var(--orange);outline-offset:2px;}

#loan-scatter-chart {
  width: 100%;
  min-width: 0;
  height: 100%;
  display: block;
  background: var(--canvas-bg);
  cursor: grab;
  touch-action: pan-y;
}

#loan-scatter-chart.is-panning { cursor: grabbing !important; }

@media (max-width: 999px) {
  .loan-scatter-wrap { overflow-x: hidden; }
  .loan-principal-stats-scroll { overflow-x: visible; }
  .loan-principal-stats { width: 100%; min-width: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .loan-principal-stat { min-width: 0; }
  .loan-principal-stat dd { white-space: normal; overflow-wrap: anywhere; }
}

@media (max-width: 760px) {
  #transactions-body > tr { scroll-margin-top: calc(var(--section-nav-height, 44px) + 14px); }
}

.loan-scatter-tooltip {
  width: min(390px, calc(100% - 12px));
  min-width: 0;
  max-width: calc(100% - 12px);
  max-height: calc(100% - 12px);
  overflow-x: hidden;
  overflow-y: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.loan-scatter-tooltip.is-pinned {
  z-index: 8;
  padding-top: 27px;
  pointer-events: auto;
  user-select: text;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
}
.loan-scatter-tooltip.is-pinned .txid-link {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  white-space: normal;
  user-select: all;
}
.loan-scatter-tooltip .txid-link { overflow-wrap: anywhere; word-break: break-all; }
.loan-scatter-tooltip .tooltip-txid { margin: 4px 0; }
.loan-scatter-tooltip .escrow-duration-precise { color: var(--secondary-ink); font-weight: 800; }
.loan-scatter-tooltip .rpsn-proxy-tooltip {
  margin: 5px 0;
  padding: 5px 7px;
  border-left: 3px solid currentColor;
  background: color-mix(in srgb, currentColor 8%, transparent);
  font-weight: 800;
}
.loan-scatter-tooltip .rpsn-proxy-actual { color: var(--exact-ink); }
.loan-scatter-tooltip .rpsn-proxy-projected { color: var(--orange); }
.loan-scatter-tooltip .rpsn-proxy-unavailable { color: var(--muted); }
.loan-scatter-tooltip .loan-liquidation-tooltip {
  margin: 4px 0;
  padding: 5px 7px;
  border: 1px solid var(--red);
  background: color-mix(in srgb, var(--red) 16%, transparent);
  color: var(--red);
  font-weight: 900;
}
.loan-escrow-duration-progress {
  display: grid;
  gap: 4px;
  width: 100%;
  min-width: 0;
  margin: 6px 0 5px;
  padding: 6px 7px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  background: color-mix(in srgb, var(--surface-raised) 88%, transparent);
  color: var(--blue);
  box-sizing: border-box;
}
.loan-escrow-duration-progress[data-status="completed"] { color: var(--green); }
.loan-escrow-duration-progress[data-status="cancelled"] { color: var(--orange); }
.loan-escrow-duration-progress-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  color: var(--tooltip-ink);
  font-size: var(--minimum-text-size);
  line-height: 1.25;
}
.loan-escrow-duration-progress-heading > span {
  flex: 0 0 auto;
  color: var(--muted);
}
.loan-escrow-duration-progress-heading > strong {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
  font-size: var(--minimum-text-size);
  font-variant-numeric: tabular-nums;
}
.loan-escrow-duration-progress-track {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--progress-track);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tooltip-border) 35%, transparent);
}
.loan-escrow-duration-progress-track > span {
  display: block;
  width: var(--loan-escrow-duration-progress, 0%);
  max-width: 100%;
  height: 100%;
  border-radius: inherit;
  background: currentColor;
}
.scatter-tooltip-close {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 24px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--tooltip-border);
  background: var(--button-bg);
  color: var(--tooltip-ink);
  font-size: 18px;
  line-height: 18px;
  cursor: pointer;
}
.scatter-tooltip-close:hover { color: var(--orange); }
.scatter-tooltip-close:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }

.loan-scatter-legends { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 8px; }
.loan-scatter-legends > .loan-scatter-legend { flex: 1 1 auto; margin-top: 0; }
.loan-scatter-legend > .loan-scatter-lifecycle-legend { margin-top: 0; padding-top: 0; border-top: 0; }
.loan-scatter-legend {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 7px 13px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: var(--minimum-text-size);
}

.loan-scatter-legend > span,
.loan-scatter-legend > button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--scatter-color, currentColor) 55%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--scatter-color, transparent) 16%, transparent);
  white-space: nowrap;
}
.loan-scatter-legend-toggle {
  appearance: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.loan-scatter-legend-toggle:hover:not(:disabled) {
  border-color: var(--scatter-color, currentColor);
  color: var(--ink);
}
.loan-scatter-legend-toggle:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.loan-scatter-legend-toggle.is-hidden,
.loan-scatter-legend-toggle:disabled {
  opacity: .42;
  background: transparent;
  text-decoration: line-through;
}
.loan-scatter-legend-toggle.is-hidden { cursor: pointer; }
.loan-scatter-legend-toggle:disabled { cursor: not-allowed; }
.loan-scatter-legend-toggle[data-scatter-group="liquidated"] { --scatter-color: var(--red); }
.loan-scatter-legend i {
  width: 11px;
  height: 11px;
  display: inline-block;
  border: 1px solid color-mix(in srgb, var(--scatter-color, currentColor) 75%, white);
  border-radius: 50%;
  background: var(--scatter-color, currentColor);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--scatter-color, transparent) 18%, transparent);
}
.loan-scatter-legend i[data-tenor="3"] { background: var(--tenor-3); }
.loan-scatter-legend i[data-tenor="6"] { background: var(--tenor-6); }
.loan-scatter-legend i[data-tenor="12"] { background: var(--tenor-12); }
.loan-scatter-legend i[data-tenor="18"] { background: var(--tenor-18); }
.loan-scatter-legend i[data-tenor="24"] { background: var(--tenor-24); }
.loan-scatter-legend .scatter-size-note { margin-left: auto; }
.loan-scatter-legend .scatter-size-symbol { width: 15px; height: 15px; border: 2px solid var(--blue); background: color-mix(in srgb, var(--blue) 16%, transparent); }

.loan-scatter-lifecycle-legend {
  margin-top: 8px;
  padding-top: 8px;
  display: flex;
  align-items: center;
  gap: 7px 15px;
  flex-wrap: wrap;
  border-top: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: var(--minimum-text-size);
}
.loan-scatter-lifecycle-legend > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.loan-scatter-lifecycle-legend .scatter-lifecycle-title { color: var(--secondary-ink); font-weight: 800; }
.loan-scatter-lifecycle-filter {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.loan-scatter-lifecycle-filter:hover { border-color: color-mix(in srgb, var(--orange) 55%, transparent); color: var(--ink); }
.loan-scatter-lifecycle-filter:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.loan-scatter-lifecycle-filter.is-active {
  border-color: color-mix(in srgb, var(--orange) 65%, transparent);
  background: color-mix(in srgb, var(--orange) 14%, transparent);
  color: var(--ink);
}
.loan-scatter-lifecycle-filter strong {
  min-width: 1.8em;
  padding: 1px 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--orange) 18%, transparent);
  color: var(--secondary-ink);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.loan-scatter-lifecycle-legend i {
  width: 14px;
  height: 14px;
  display: inline-block;
  border: 2px solid var(--muted);
  border-radius: 50%;
  background: var(--surface);
}
.loan-scatter-lifecycle-legend .scatter-lifecycle-cancelled { border-color: var(--orange); border-style: dashed; }

.loan-monthly-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
#dashboard > #transactions-section { padding-bottom: 12px; }
#dashboard > #loan-monthly-section { margin-top: 0; padding-top: 16px; }
.loan-monthly-heading { align-items: flex-start; }
.loan-monthly-heading-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.loan-monthly-granularity-control {
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: var(--minimum-text-size);
  font-weight: 800;
}
.loan-monthly-granularity-control > span {
  color: var(--orange);
  white-space: nowrap;
}
.loan-monthly-granularity-control select {
  min-width: 0;
  flex: 0 1 auto;
  width: 180px;
  height: 35px;
  padding: 0 30px 0 9px;
  border: 1px solid var(--field-border);
  border-radius: 4px;
  background: var(--field-bg);
  color: var(--field-ink);
  cursor: pointer;
}
.loan-monthly-granularity-control select:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.loan-monthly-price-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 35px;
  color: var(--ink);
  font-size: var(--minimum-text-size);
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.loan-monthly-price-control input { margin: 0; accent-color: var(--ink); cursor: pointer; }
.loan-monthly-price-control input:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.loan-monthly-heading-meta #loan-monthly-smoothing { width: 215px; }
.loan-monthly-note {
  margin: 0 0 11px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  line-height: 1.5;
}
.loan-monthly-chart-wrap {
  position: relative;
  width: 100%;
  height: 408px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  background: var(--canvas-bg);
}
#loan-monthly-chart { width: 100%; min-width: 0; max-width: 100%; height: 100%; display: block; }
.loan-monthly-legend {
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: var(--minimum-text-size);
}
.loan-monthly-legend-toggle {
  appearance: none;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--loan-monthly-color, currentColor) 52%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--loan-monthly-color, transparent) 14%, transparent);
  color: var(--secondary-ink);
  font: inherit;
  cursor: pointer;
}
.loan-monthly-display-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 9px 0; }
.loan-monthly-display-controls .loan-monthly-legend { flex: 1 1 480px; margin-top: 0; }
.loan-monthly-heading-meta #loan-monthly-display { width: 200px; max-width: 100%; }
.loan-monthly-heading-meta #loan-monthly-count { font-size: 13px; }
.loan-monthly-legend-toggle:disabled { cursor: default; opacity: .35; }
.loan-monthly-legend-toggle:hover { border-color: var(--loan-monthly-color, currentColor); color: var(--ink); }
.loan-monthly-legend-toggle:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.loan-monthly-legend-toggle.is-hidden { opacity: .42; background: transparent; text-decoration: line-through; }
.loan-monthly-legend-swatch {
  position: relative;
  width: 19px;
  height: 12px;
  flex: 0 0 19px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(var(--loan-monthly-color, currentColor) 0 0) 1px 1px / 9px 11px no-repeat;
}
.loan-monthly-legend-swatch.has-apr-line::after {
  position: absolute;
  top: 5px;
  left: 0;
  width: 19px;
  border-top: 2px dashed var(--loan-monthly-color, currentColor);
  content: "";
}
.loan-monthly-price-legend {
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--secondary-ink);
  cursor: default;
}
.loan-monthly-price-legend[data-state="loading"],
.loan-monthly-price-legend[data-state="unavailable"] { opacity: .58; }
.loan-monthly-price-legend-swatch {
  width: 19px;
  flex: 0 0 19px;
  height: 3px;
  background: #000;
  box-shadow: 0 0 0 1px #fff9;
}
[data-theme="dark"] .loan-monthly-price-legend-swatch {
  background: #f2f4f7;
  box-shadow: 0 0 0 1px #0008;
}
.loan-monthly-tooltip-series {
  padding-inline-start: 6px;
  border-inline-start: 3px solid var(--loan-monthly-tooltip-color, currentColor);
}
.loan-monthly-tooltip-price {
  padding-inline-start: 6px;
  border-inline-start: 3px solid #000;
  color: var(--ink);
  font-weight: 800;
}
[data-theme="dark"] .loan-monthly-tooltip-price { border-inline-start-color: #f2f4f7; }
#loan-monthly-tooltip {
  font-size: 13px;
  width: max-content;
  min-width: 260px;
  max-width: calc(100% - 12px);
}
#loan-monthly-tooltip > span { white-space: nowrap; }

.loan-rate-history-heading {
  margin-top: 22px;
  padding-top: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
}
.loan-rate-history-heading h4 { margin: 2px 0 0; font-size: 18px; }
.loan-rate-history-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 700;
  text-transform: uppercase;
}
.loan-rate-history-meta strong {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--secondary-ink);
  font-size: var(--minimum-text-size);
}
.loan-rate-history-note {
  margin: 8px 0 9px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  line-height: 1.5;
}
.loan-rate-history-legend {
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.loan-rate-history-legend button {
  appearance: none;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--loan-rate-color, currentColor) 55%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--loan-rate-color, transparent) 12%, transparent);
  color: var(--secondary-ink);
  font: inherit;
  font-size: var(--minimum-text-size);
  cursor: pointer;
}
.loan-rate-history-legend button:hover { border-color: var(--loan-rate-color, currentColor); color: var(--ink); }
.loan-rate-history-legend button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.loan-rate-history-legend button.is-hidden { opacity: .42; background: transparent; text-decoration: line-through; }
.loan-rate-history-legend i {
  width: 18px;
  height: 0;
  flex: 0 0 18px;
  border-top: 3px solid var(--loan-rate-color, currentColor);
}
.loan-rate-history-chart-wrap {
  position: relative;
  width: 100%;
  height: 380px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--canvas-bg);
}
#loan-rate-history-chart {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
}
.loan-rate-history-tooltip { max-width: min(330px, calc(100% - 12px)); }
.loan-rate-history-tooltip .loan-rate-tooltip-series {
  padding-inline-start: 7px;
  border-inline-start: 3px solid var(--loan-rate-tooltip-color, currentColor);
}

.investor-rate-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.investor-rate-heading { align-items: flex-start; }
.investor-rate-note {
  max-width: 1280px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  line-height: 1.5;
}
.investor-control-panel {
  padding: 13px;
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, .5fr) minmax(0, 1.45fr) minmax(0, .65fr) minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
}
.investor-control-field { min-width: 0; }
.investor-control-field > span {
  display: block;
  margin-bottom: 5px;
  color: var(--label-ink);
  font-size: var(--minimum-text-size);
  font-weight: 800;
}
.investor-control-field > small {
  min-height: 2.7em;
  margin-top: 5px;
  display: block;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  line-height: 1.35;
}
.investor-control-field input,
.investor-control-field select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 38px;
  padding: 0 9px;
  border: 1px solid var(--field-border);
  border-radius: 4px;
  background: var(--field-bg);
  color: var(--field-ink);
  outline: 0;
}
.investor-control-field select { padding-right: 30px; cursor: pointer; }
.investor-control-field input:focus,
.investor-control-field select:focus { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.investor-control-field input:focus-visible,
.investor-control-field select:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.investor-chip-group {
  min-height: 38px;
  display: flex;
  align-items: stretch;
  gap: 4px;
}
.investor-chip-group button {
  min-width: 0;
  padding: 6px 8px;
  flex: 1 1 auto;
  border: 1px solid var(--field-border);
  border-radius: 999px;
  background: var(--field-bg);
  color: var(--secondary-ink);
  font-size: var(--minimum-text-size);
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
}
.investor-chip-group button:hover { border-color: var(--blue); color: var(--ink); }
.investor-chip-group button.is-active,
.investor-chip-group button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--orange) 72%, var(--field-border));
  background: color-mix(in srgb, var(--orange) 15%, var(--field-bg));
  color: var(--ink);
}
.investor-chip-group button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.investor-currency-guidance {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--red);
  font-size: 17px;
  line-height: 1.5;
}
.investor-optimal-rate-card {
  margin-top: 12px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(245px, .72fr) minmax(235px, .7fr) minmax(0, 1.58fr);
  gap: 12px 22px;
  border: 1px solid color-mix(in srgb, var(--orange) 62%, var(--line));
  border-inline-start: 4px solid var(--orange);
  background: linear-gradient(105deg, color-mix(in srgb, var(--orange) 10%, var(--surface-subtle)) 0, var(--surface-subtle) 42%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--orange) 6%, transparent);
}
.investor-optimal-rate-primary {
  align-self: center;
  min-width: 0;
}
.investor-optimal-rate-primary > strong {
  margin-top: 4px;
  display: block;
  color: var(--orange);
  font-size: 30px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}
.investor-optimal-rate-primary > small {
  margin-top: 6px;
  display: block;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  line-height: 1.35;
}
.investor-optimal-context {
  margin-top: 7px;
  display: block;
  color: var(--ink);
  font-size: var(--minimum-text-size);
  font-weight: 800;
  line-height: 1.3;
}
.investor-optimal-frequency {
  min-width: 0;
  padding: 12px 14px;
  align-self: stretch;
  border: 1px solid color-mix(in srgb, var(--investor-frequency-color, var(--loan-heat-empty)) 72%, var(--line));
  border-inline-start: 5px solid var(--investor-frequency-color, var(--loan-heat-empty));
  background: linear-gradient(130deg, color-mix(in srgb, var(--investor-frequency-color, var(--loan-heat-empty)) 24%, var(--surface-subtle)), var(--surface-subtle) 76%);
}
.investor-optimal-frequency > strong {
  margin-top: 8px;
  display: block;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.investor-optimal-frequency > small {
  margin-top: 7px;
  display: block;
  color: var(--secondary-ink);
  font-size: var(--minimum-text-size);
  line-height: 1.4;
}
.investor-band-note { margin: 8px 0 0; color: var(--secondary-ink); font-size: 13px; line-height: 1.5; }
.investor-optimal-rate-facts {
  min-width: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(105px, 1fr));
  align-content: center;
  gap: 0;
}
.investor-optimal-rate-facts > div {
  min-width: 0;
  padding: 5px 11px;
  border-inline-start: 1px solid var(--soft-line);
}
.investor-optimal-rate-facts dt {
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 800;
  letter-spacing: .045em;
  line-height: 1.25;
  text-transform: uppercase;
}
.investor-optimal-rate-facts dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: var(--minimum-text-size);
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.investor-optimal-rate-evidence {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 9px;
  border-top: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: var(--minimum-text-size);
  line-height: 1.4;
}
.investor-overview-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(0, 2.1fr);
  gap: 12px;
}
.investor-recommendation,
.investor-period-cards > article {
  border: 1px solid var(--line);
  background: var(--surface-subtle);
}
.investor-recommendation { padding: 13px 15px; }
.investor-card-label,
.investor-period-cards span {
  display: block;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.investor-recommendation strong {
  margin-top: 4px;
  display: block;
  color: var(--orange);
  font-size: 20px;
  line-height: 1.2;
}
.investor-recommendation p { margin: 6px 0 0; color: var(--muted); font-size: var(--minimum-text-size); line-height: 1.45; }
.investor-recommendation-optimum {
  margin-top: 7px;
  padding-top: 7px;
  display: block;
  border-top: 1px solid var(--soft-line);
  color: var(--green);
  font-size: var(--minimum-text-size);
  font-weight: 700;
  line-height: 1.4;
}
.investor-period-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.investor-period-cards > article { padding: 12px; }
.investor-period-cards strong,
.investor-period-cards small { display: block; }
.investor-period-cards strong { margin-top: 6px; color: var(--ink); font-size: 15px; }
.investor-period-cards small { margin-top: 4px; color: var(--muted); font-size: var(--minimum-text-size); }
.investor-rate-chart-wrap {
  position: relative;
  width: 100%;
  height: 390px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--canvas-bg);
}
#investor-rate-chart { width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: manipulation; }
.investor-rate-tooltip {
  width: max-content;
  min-width: 240px;
  max-width: min(480px, calc(100% - 12px));
}
.investor-wait-legend {
  min-height: 34px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  border: 1px solid var(--line);
  border-top: 0;
  color: var(--secondary-ink);
  font-size: var(--minimum-text-size);
}
.investor-wait-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.investor-wait-legend i { width: 24px; height: 7px; display: inline-block; border-radius: 999px; }
.investor-wait-legend i.is-poor { background: #ad5555; }
.investor-wait-legend i.is-balanced { background: #d0ad45; }
.investor-wait-legend i.is-optimal { background: #57a76b; }
.investor-wait-legend small { margin-left: auto; color: var(--muted); font-size: var(--minimum-text-size); }
@media (max-width: 1500px) {
  .investor-control-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .investor-tenor-field { grid-column: span 2; }
  .investor-optimal-rate-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .investor-optimal-rate-facts { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1000px) {
  .investor-control-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .investor-tenor-field { grid-column: 1 / -1; }
  .investor-optimal-rate-card { grid-template-columns: minmax(0, 1fr); }
  .investor-optimal-rate-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .investor-overview-grid { grid-template-columns: minmax(0, 1fr); }
}

.loan-activity-heatmaps {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.loan-activity-heading { align-items: flex-end; }
.loan-activity-controls {
  min-width: 190px;
  display: grid;
  gap: 4px;
}
.loan-activity-controls label {
  color: var(--label-ink);
  font-size: var(--minimum-text-size);
  font-weight: 800;
}
.loan-activity-controls select { width: 100%; }
.loan-activity-note {
  max-width: 1280px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  line-height: 1.5;
}
.loan-activity-summary {
  margin-bottom: 12px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 8px 18px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  background: var(--surface-subtle);
  color: var(--secondary-ink);
  font-size: var(--minimum-text-size);
}
.loan-activity-summary strong { color: var(--ink); }
#loan-business-hours-share { color: var(--orange); font-weight: 800; }
.loan-activity-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface-subtle);
}
.loan-activity-panel-heading {
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 20px;
}
.loan-activity-panel h4 { margin: 0; color: var(--ink); font-size: 15px; }
.loan-activity-panel p { margin: 3px 0 0; color: var(--muted); font-size: var(--minimum-text-size); line-height: 1.4; }
.loan-activity-heat-scale {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  flex: 0 1 auto;
  max-width: 100%;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}
.loan-activity-heat-scale .loan-activity-scale-bin {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.loan-activity-heat-scale i {
  width: 1.333333em;
  height: 1.333333em;
  flex: 0 0 auto;
  display: block;
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 2px;
}
.loan-activity-heat-scale i { background: var(--loan-heat-color, var(--loan-heat-empty)); }
.loan-activity-heat-scale i[data-level="1"] { --loan-heat-color: #5b3fc1; }
.loan-activity-heat-scale i[data-level="2"] { --loan-heat-color: #2f6fdb; }
.loan-activity-heat-scale i[data-level="3"] { --loan-heat-color: #1ca7a2; }
.loan-activity-heat-scale i[data-level="4"] { --loan-heat-color: #35ad5b; }
.loan-activity-heat-scale i[data-level="5"] { --loan-heat-color: #b7cf2f; }
.loan-activity-heat-scale i[data-level="6"] { --loan-heat-color: #f2b31c; }
.loan-activity-heat-scale i[data-level="7"] { --loan-heat-color: #f28e1c; }
.loan-activity-heat-scale i[data-level="8"] { --loan-heat-color: #e4572e; }
.loan-activity-heatmap-wrap {
  position: relative;
  z-index: 3;
  width: 100%;
  overflow: visible;
  background: var(--canvas-bg);
}
.loan-daily-heatmap-wrap { height: 150px; }
.loan-hourly-heatmap-wrap { height: 236px; }
.loan-interest-heatmap-heading { align-items: flex-start; }
.loan-interest-tenor-control { min-width: 210px; }
.loan-interest-heatmap-meta {
  margin: 6px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--secondary-ink);
  font-size: var(--minimum-text-size);
}
.loan-interest-heatmap-meta > strong { color: var(--ink); }
.loan-interest-heatmap-scale {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
}
.loan-interest-heatmap-scale > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.loan-interest-heatmap-scale i {
  width: 17px;
  height: 17px;
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 2px;
}
.loan-interest-heatmap-scale [data-rate-band="low"] { background: #4774cf; }
.loan-interest-heatmap-scale [data-rate-band="low-mid"] { background: #318f9a; }
.loan-interest-heatmap-scale [data-rate-band="mid"] { background: #5da66f; }
.loan-interest-heatmap-scale [data-rate-band="mid-high"] { background: #b5c445; }
.loan-interest-heatmap-scale [data-rate-band="high"] { background: #e5b33e; }
.loan-interest-heatmap-scale [data-rate-band="highest"] { background: #d96f38; }
.loan-interest-heatmap-scale [data-rate-band="insufficient"] { background: var(--loan-interest-small-sample, #68717a); }
.loan-interest-heatmap-wrap { height: 236px; }
.loan-interest-disclaimer { margin-top: 8px; }
.loan-business-hours-key { display: inline-flex; align-items: center; gap: 9px; margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.loan-business-hours-key::before { content: ""; width: 25px; height: 13px; border: 3px solid #fff; outline: 3px solid #111417; background: #111417; flex: 0 0 auto; margin: 3px; }
#loan-daily-heatmap,
#loan-hourly-heatmap,
#loan-interest-heatmap { width: 100%; height: 100%; display: block; }
.chart-tooltip.loan-activity-tooltip {
  width: max-content;
  min-width: 240px;
  max-width: min(920px, calc(100% - 12px));
  font-size: var(--minimum-text-size);
  pointer-events: none;
}
.chart-tooltip.loan-activity-tooltip > span {
  max-width: 100%;
  white-space: normal;
}
.chart-tooltip.loan-activity-tooltip > .loan-monthly-tooltip-series { white-space: nowrap; }

.rpsn-analysis {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.rpsn-heading { align-items: flex-start; }
.rpsn-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 14px;
  flex-wrap: wrap;
}
.rpsn-axis-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.rpsn-axis-label {
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 800;
  line-height: 1;
}
.rpsn-axis-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--field-border);
  border-radius: 999px;
  background: var(--field-bg);
}
.rpsn-axis-toggle button {
  min-height: 27px;
  padding: 3px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 800;
  cursor: pointer;
}
.rpsn-axis-toggle button[aria-pressed="true"] {
  background: var(--blue);
  color: var(--on-accent);
}
.rpsn-axis-toggle button:focus-visible,
.rpsn-timing-toggle:focus-visible,
.rpsn-zoom-reset:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.rpsn-zoom-reset {
  min-height: 35px;
  padding: 4px 10px;
  border: 1px solid var(--blue);
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 10%, var(--surface));
  color: var(--blue);
  font-size: var(--minimum-text-size);
  font-weight: 800;
  cursor: pointer;
}
.rpsn-zoom-reset:disabled {
  border-color: var(--field-border);
  background: transparent;
  color: var(--muted);
  cursor: not-allowed;
  opacity: .5;
}
.rpsn-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  line-height: 1.5;
}
.rpsn-note strong { color: var(--ink); }
.rpsn-chart-wrap {
  position: relative;
  width: 100%;
  height: 430px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  background: var(--canvas-bg);
  -webkit-overflow-scrolling: touch;
}
#rpsn-chart {
  width: 100%;
  min-width: 760px;
  height: 100%;
  display: block;
  background: var(--canvas-bg);
  touch-action: pan-y;
}
#rpsn-chart.is-panning { cursor: grabbing !important; user-select: none; }
.rpsn-tooltip {
  width: min(390px, calc(100% - 12px));
  min-width: 0;
  max-width: calc(100% - 12px);
  max-height: calc(100% - 12px);
  overflow-x: hidden;
  overflow-y: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.rpsn-tooltip.is-pinned {
  z-index: 8;
  padding-top: 27px;
  pointer-events: auto;
  user-select: text;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
}
.rpsn-tooltip .txid-link {
  display: block;
  margin-top: 5px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.rpsn-tooltip .escrow-duration-precise { color: var(--secondary-ink); font-weight: 800; }

@media (min-width: 761px) {
  .chart-tooltip.loan-scatter-tooltip {
    width: min(420px, calc(50% - 12px));
    max-width: min(420px, calc(50% - 12px));
    max-height: calc(100% - 12px);
    overflow-x: hidden;
    overflow-y: auto;
    font-size: var(--minimum-text-size);
    line-height: 1.22;
  }
  .chart-tooltip.rpsn-tooltip {
    width: min(440px, calc(50% - 12px));
    max-width: min(440px, calc(50% - 12px));
    max-height: calc(100% - 12px);
    overflow-x: hidden;
    overflow-y: auto;
    font-size: var(--minimum-text-size);
    line-height: 1.22;
  }
  .loan-scatter-tooltip .rpsn-proxy-tooltip { margin-block: 3px; padding: 3px 6px; }
  .loan-scatter-tooltip .loan-escrow-duration-progress {
    gap: 3px;
    margin-block: 4px;
    padding: 4px 6px;
  }
  .chart-tooltip.loan-scatter-tooltip.is-pinned {
    column-count: auto;
  }
}

.rpsn-legend {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: var(--minimum-text-size);
}
.rpsn-legend > span,
.rpsn-timing-toggle { display: inline-flex; align-items: center; gap: 6px; }
.rpsn-timing-toggle {
  appearance: none;
  padding: 4px 8px;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--secondary-ink);
  font: inherit;
  cursor: pointer;
}
.rpsn-timing-toggle:hover { border-color: var(--blue); color: var(--ink); }
.rpsn-timing-toggle[aria-pressed="false"] {
  opacity: .42;
  background: transparent;
  color: var(--muted);
  text-decoration: line-through;
}
.rpsn-timing-toggle strong {
  min-width: 1.8em;
  padding: 1px 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 13%, transparent);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.rpsn-legend i {
  width: 12px;
  height: 12px;
  display: inline-block;
  border: 2px solid var(--blue);
  border-radius: 50%;
}
.rpsn-point-completed { background: var(--blue); }
.rpsn-point-projected { background: var(--canvas-bg); }
.history-rpsn-cell > strong,
.history-rpsn-cell > small { display: block; }
.history-rpsn-cell > strong { color: var(--ink); font-size: 13px; }
.history-rpsn-cell > small { margin-top: 3px; color: var(--muted); font-size: var(--minimum-text-size); line-height: 1.3; }
.history-rpsn-cell .rpsn-timing-actual { color: var(--exact-ink); }
.history-rpsn-cell .rpsn-timing-projected { color: var(--orange); }
.rpsn-unavailable { color: var(--muted); font-weight: 800; }
.chart-heading { align-items: flex-start; }
.toolbar { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.segmented {
  display: inline-flex;
  border: 1px solid var(--field-border);
  border-radius: 5px;
  overflow: hidden;
}

.segmented button {
  min-height: 35px;
  padding: 6px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--surface-raised);
  cursor: pointer;
}

.segmented button:last-child { border-right: 0; }
.segmented button:hover { background: var(--button-hover); }
.segmented button.active { background: var(--active-bg); color: var(--on-accent); }
.segmented button[data-mode="incoming"] { color: var(--green); font-weight: 700; }
.segmented button[data-mode="outgoing"] { color: var(--red); font-weight: 700; }
.segmented button[data-mode="incoming"].active {
  background: var(--green-soft);
  color: var(--green);
  box-shadow: inset 0 -3px var(--green);
}
.segmented button[data-mode="outgoing"].active {
  background: var(--red-soft);
  color: var(--red);
  box-shadow: inset 0 -3px var(--red);
}
.segmented button:focus-visible, .range-buttons button:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--orange); outline-offset: -2px; }
.range-row {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
}

.range-buttons { display: flex; gap: 3px; }
.range-buttons button {
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--blue-dark);
  cursor: pointer;
}
.range-buttons button:hover, .range-buttons button.active { border-color: var(--field-border); background: var(--button-hover); }
.firefish-milestone-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--secondary-ink);
  cursor: pointer;
  font-size: var(--minimum-text-size);
  font-weight: 700;
  white-space: nowrap;
}
.firefish-milestone-toggle[hidden] { display: none; }
.firefish-milestone-toggle input { margin: 0; accent-color: var(--orange); cursor: pointer; }
.firefish-milestone-toggle:focus-within { outline: 2px solid var(--orange); outline-offset: 2px; }
.chart-count { margin-left: auto; }
.monthly-incomplete-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--orange);
  font-size: var(--minimum-text-size);
  font-weight: 700;
  white-space: nowrap;
}
.monthly-incomplete-status::before {
  width: 12px;
  height: 9px;
  border: 2px dashed currentColor;
  box-sizing: border-box;
  content: "";
}
.monthly-incomplete-status[hidden] { display: none; }
.chart-tooltip .monthly-incomplete-tooltip-line { color: var(--orange); font-weight: 750; }
.time-zoom-hint {
  color: var(--muted);
  font-size: var(--minimum-text-size);
  white-space: nowrap;
}
.time-zoom-reset {
  padding: 3px 8px;
  border: 1px solid var(--field-border);
  border-radius: 3px;
  background: transparent;
  color: var(--blue-dark);
  cursor: pointer;
  font-size: var(--minimum-text-size);
  white-space: nowrap;
}
.time-zoom-reset:hover:not(:disabled) { background: var(--button-hover); }
.time-zoom-reset:disabled { cursor: default; opacity: .42; }

.chart-wrap {
  position: relative;
  width: 100%;
  height: 420px;
  border-bottom: 1px solid var(--line);
  background: var(--canvas-bg);
}

#flow-chart, #heatmap-chart, #transaction-heatmap-chart {
  width: 100%;
  height: 100%;
  display: block;
  filter: var(--canvas-filter);
  cursor: grab;
  touch-action: pan-y;
}
#flow-chart.is-time-panning, #heatmap-chart.is-time-panning, #transaction-heatmap-chart.is-time-panning {
  cursor: grabbing;
}

.firefish-milestone-layer {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
}
.firefish-milestone-layer[hidden] { display: none; }
.official-growth-layer { position: absolute; z-index: 4; inset: 0; pointer-events: none; }
.official-growth-layer[hidden] { display: none; }
.official-growth-marker { position: absolute; width: 22px; height: 22px; padding: 0; transform: translate(-50%, -50%); border: 0; border-radius: 50%; background: transparent; cursor: pointer; pointer-events: auto; }
.official-growth-marker:hover, .official-growth-marker:focus-visible { outline: 2px solid var(--growth-accent); outline-offset: 1px; background: transparent; }
.firefish-milestone-marker {
  --milestone-accent: var(--orange);
  position: absolute;
  z-index: 1;
  width: 14px;
  height: 14px;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 1px solid color-mix(in srgb, var(--milestone-accent) 72%, var(--field-border));
  border-radius: 50%;
  background: var(--canvas-bg);
  color: var(--milestone-accent);
  font: 700 13px/18px Arial, sans-serif;
  cursor: pointer;
  opacity: .72;
  overflow: visible;
  pointer-events: auto;
}
.firefish-milestone-marker.is-blog { --milestone-accent: var(--milestone-blog); }
.firefish-milestone-marker.is-major {
  width: 20px;
  height: 20px;
  border-width: 2px;
  font-size: var(--minimum-text-size);
  line-height: 16px;
  opacity: 1;
}
.firefish-milestone-marker::before { content: "◆"; }
.firefish-milestone-axis-label {
  position: absolute;
  top: calc(50% + 10px + var(--milestone-label-length));
  left: calc(50% + 2px);
  width: var(--milestone-label-length);
  height: 18px;
  padding: 0 2px;
  transform: rotate(-90deg);
  transform-origin: 0 0;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--milestone-accent) 88%, var(--ink));
  cursor: pointer;
  font: 700 13px/18px Arial, sans-serif;
  letter-spacing: .015em;
  overflow: visible;
  pointer-events: auto;
  text-align: left;
  text-overflow: clip;
  text-shadow: 0 0 3px var(--canvas-bg), 0 0 3px var(--canvas-bg);
  white-space: nowrap;
}
.firefish-milestone-marker.is-major > .firefish-milestone-axis-label {
  top: calc(50% + 13px + var(--milestone-label-length));
  color: var(--milestone-accent);
  font-size: 14px;
  font-weight: 900;
  opacity: 1;
}
.firefish-milestone-marker.is-minor > .firefish-milestone-axis-label {
  font-size: var(--minimum-text-size);
  font-weight: 700;
  opacity: .88;
}
.firefish-milestone-marker:hover,
.firefish-milestone-marker:focus-visible,
.firefish-milestone-marker.is-active {
  z-index: 4;
  border-color: var(--milestone-accent);
  background: var(--milestone-accent);
  color: var(--on-accent);
  opacity: 1;
  outline: 0;
}
.firefish-milestone-marker:hover > .firefish-milestone-axis-label,
.firefish-milestone-marker:focus-visible > .firefish-milestone-axis-label,
.firefish-milestone-marker.is-active > .firefish-milestone-axis-label {
  color: var(--milestone-accent);
  opacity: 1;
  text-shadow: 0 0 3px var(--canvas-bg), 0 0 3px var(--canvas-bg);
}
.firefish-milestone-marker:focus-visible { box-shadow: 0 0 0 2px var(--canvas-bg), 0 0 0 4px var(--milestone-accent); }

.chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 210px;
  max-width: 310px;
  padding: 9px 11px;
  border: 1px solid var(--tooltip-border);
  border-radius: 3px;
  background: var(--tooltip-bg);
  color: var(--tooltip-ink);
  font-size: var(--minimum-text-size);
  line-height: 1.45;
  pointer-events: none;
}

.chart-tooltip.milestone-tooltip { --milestone-accent: var(--orange); max-width: 340px; }
.chart-tooltip.milestone-tooltip.is-blog { --milestone-accent: var(--milestone-blog); }
.chart-tooltip.milestone-tooltip.is-pinned { padding-top: 28px; pointer-events: auto; }
.chart-tooltip .milestone-importance {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 5px;
  padding: 1px 6px;
  border: 1px solid var(--milestone-accent);
  border-radius: 999px;
  color: var(--milestone-accent);
  font-size: var(--minimum-text-size);
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.5;
  text-transform: uppercase;
}
.chart-tooltip .milestone-importance.is-major { background: var(--milestone-accent); color: var(--on-accent); }
.chart-tooltip .milestone-source-kind {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 5px 4px;
  padding: 1px 6px;
  border: 1px solid var(--milestone-blog);
  border-radius: 999px;
  color: var(--milestone-blog);
  font-size: var(--minimum-text-size);
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.5;
  text-transform: uppercase;
}
.chart-tooltip .milestone-category {
  margin-bottom: 3px;
  color: var(--milestone-accent);
  font-size: var(--minimum-text-size);
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.chart-tooltip .milestone-description { margin-top: 5px; color: var(--tooltip-ink); }
.chart-tooltip .milestone-causality {
  margin-top: 7px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-style: italic;
}
.chart-tooltip .milestone-source {
  display: inline-block;
  margin-top: 8px;
  color: var(--link);
  font-weight: 700;
  text-decoration: underline;
}
.chart-tooltip.milestone-tooltip.is-blog .milestone-source { color: var(--milestone-blog); }
.chart-tooltip .milestone-source:focus-visible { outline: 2px solid var(--milestone-accent); outline-offset: 2px; }
.milestone-tooltip-close {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--tooltip-border);
  border-radius: 50%;
  background: transparent;
  color: var(--tooltip-ink);
  cursor: pointer;
  line-height: 20px;
}
.milestone-tooltip-close:hover { color: var(--orange); }
.milestone-tooltip-close:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }

.chart-tooltip strong, .chart-tooltip span { display: block; }
.chart-tooltip .positive { color: var(--green); }
.chart-tooltip .negative { color: var(--red); }
.chart-tooltip .collateral-amount { color: var(--orange); }
.chart-tooltip code { font-size: var(--minimum-text-size); overflow-wrap: anywhere; }

.chart-legend {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: var(--minimum-text-size);
}
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend [hidden] { display: none; }
.legend-line { width: 22px; height: 3px; background: var(--blue); }
.chart-section[data-mode="all"] .legend-line { background: linear-gradient(90deg, var(--green) 0 50%, var(--red) 50% 100%); }
.chart-section[data-mode="incoming"] .legend-line { background: var(--green); }
.chart-section[data-mode="outgoing"] .legend-line { background: var(--red); }
.chart-section[data-mode="incoming"] #series-label { color: var(--green); }
.chart-section[data-mode="outgoing"] #series-label { color: var(--red); }
.chart-section[data-mode="all"] #series-label { color: var(--ink); }
.firefish-milestone-legend { flex-wrap: wrap; justify-content: center; }
.firefish-milestone-legend .milestone-legend-item { gap: 4px; white-space: nowrap; }
.firefish-milestone-legend small { color: var(--muted); font-size: var(--minimum-text-size); white-space: nowrap; }
.official-growth-legend { flex-wrap: wrap; justify-content: center; min-width: 0; max-width: 100%; }
.official-growth-legend > span { gap: 5px; white-space: nowrap; }
.official-growth-legend small { color: var(--muted); font-size: var(--minimum-text-size); white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.official-growth-legend i {
  width: 22px;
  height: 0;
  display: inline-block;
  border-top: 2px solid;
}
.official-growth-legend .legend-official-users { border-color: var(--official-users); }
.official-growth-legend .legend-official-loans { border-color: var(--official-loans); border-top-style: dashed; }
.official-growth-legend .legend-onchain-loans { border-color: var(--onchain-loans); border-top-style: dotted; }
.official-growth-tooltip-line { color: var(--official-users); font-weight: 700; }
.onchain-growth-tooltip-line { color: var(--onchain-loans); font-weight: 700; }
.legend-milestone {
  position: relative;
  width: 14px;
  height: 13px;
  border-left: 2px dashed var(--orange);
}
.legend-milestone::after {
  position: absolute;
  top: -1px;
  left: -5px;
  color: var(--orange);
  content: "◆";
  font-size: var(--minimum-text-size);
  line-height: 10px;
}
.legend-milestone.is-minor {
  width: 10px;
  height: 11px;
  border-left-width: 1px;
  opacity: .52;
}
.legend-milestone.is-minor::after { top: 0; left: -4px; font-size: var(--minimum-text-size); }
.legend-milestone.is-blog { border-left-color: var(--milestone-blog); }
.legend-milestone.is-blog::after { color: var(--milestone-blog); }
.muted { color: var(--muted); }

.heatmap-heading {
  margin: 27px 0 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.heatmap-heading strong, .heatmap-heading span { display: block; }
.heatmap-heading span { margin-top: 2px; color: var(--muted); font-size: var(--minimum-text-size); }
.heatmap-heading-secondary { margin-top: 18px; }
.heat-scale { color: var(--muted); font-size: 16px; text-align: right; }
.heat-scale span { font-size: inherit; }
.heat-scale-title { margin-bottom: 4px; font-weight: 700; }
.heat-scale-items { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.heat-scale-items span { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.heat-scale-items i {
  width: .916667em;
  height: .916667em;
  flex: 0 0 auto;
  display: inline-block;
  border: 1px solid color-mix(in srgb, var(--heat-color) 72%, var(--ink));
  background: var(--heat-color);
}

.heatmap-wrap { position: relative; height: 66px; background: var(--canvas-bg); }
.heatmap-wrap .heat-tooltip { max-width: calc(100% - 6px); overflow-wrap: anywhere; }

.podium {
  max-width: 820px;
  min-height: 270px;
  margin: 8px auto 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
}

.podium-place {
  position: relative;
  min-height: 150px;
  padding: 80px 12px 14px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--medal);
  background: var(--surface-subtle);
  text-align: center;
}
.podium-place.place-1 { min-height: 205px; order: 2; }
.podium-place.place-2 { min-height: 176px; order: 1; }
.podium-place.place-3 { min-height: 155px; order: 3; }
.podium-place.place-1 { padding-top: 128px; --medal-light: #fff1a3; --medal-mid: #dcae31; --medal-shadow: #855408; --medal-ink: #443008; }
.podium-place.place-2 { padding-top: 104px; --medal-light: #ffffff; --medal-mid: #b7c3cc; --medal-shadow: #626f7a; --medal-ink: #26313b; }
.podium-place.place-3 { --medal-light: #f5c298; --medal-mid: #c38753; --medal-shadow: #703b23; --medal-ink: #38210f; }
.podium-rank {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 56px;
  height: 56px;
  box-sizing: border-box;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--medal);
  background: radial-gradient(circle at 30% 22%, #fff9, transparent 50%),
    linear-gradient(135deg, var(--medal-light), var(--medal-mid) 28%, var(--medal-light) 43%, var(--medal-mid) 60%, var(--medal-shadow));
  box-shadow: inset 0 1px 2px #fffc, inset 0 -2px 3px #0005, 0 3px 6px #0004;
  color: var(--medal-ink);
  text-shadow: 0 1px 1px #fff8;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
}
.podium-rank::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--medal-shadow); border-radius: 50%; box-shadow: inset 0 1px 1px #fff9, 0 1px 1px #fff6; pointer-events: none; }
.podium-place strong { display: block; font-size: 18px; }
.podium-place .podium-commission { margin-top: .4rem; font-size: max(var(--minimum-text-size), .8rem); font-weight: 500; color: var(--firefish-commission); }
.firefish-commission,
.firefish-commission strong,
.firefish-commission small,
.firefish-commission dt,
.firefish-commission dd,
.podium-place .firefish-commission,
.is-firefish-view [data-received-label],
.is-firefish-view [data-commission-balance-label],
.is-firefish-view #summary-balance-link,
.is-firefish-view #summary-received,
.is-firefish-view #monthly-body td:nth-child(3),
.is-firefish-view #monthly-body td:nth-child(3) > span { color: var(--firefish-commission); }
.podium-place b { display: block; margin-top: 8px; color: var(--green); font-size: 16px; font-variant-numeric: tabular-nums; }
.podium-place small { display: block; margin-top: 4px; color: var(--muted); }
[data-commission-sats] { cursor: help; }
[data-commission-sats]:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

.monthly-controls {
  margin: -10px 0 9px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
}

.monthly-controls select {
  min-width: 235px;
  height: 35px;
  padding: 0 30px 0 9px;
  border: 1px solid var(--field-border);
  border-radius: 4px;
  background-color: var(--field-bg);
  color: var(--field-ink);
  cursor: pointer;
}

.monthly-controls select:focus-visible,
.tx-search input:focus-visible,
.pagination button:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--line); background: var(--surface); -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 9px 10px; border-bottom: 1px solid var(--soft-line); text-align: left; white-space: nowrap; }
.data-table th { background: var(--table-head-bg); color: var(--table-head-ink); font-size: var(--minimum-text-size); letter-spacing: .02em; }
.data-table th[data-sort-key] { position: relative; }
.data-table .sort-button,
.data-table .sortable-button,
.data-table th[data-sort-key] > button {
  min-width: 100%;
  padding: 2px 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  letter-spacing: inherit;
  text-align: inherit;
  cursor: pointer;
}
.data-table th.numeric > button { justify-content: flex-end; }
.data-table th[data-sort-key] > button:hover { color: var(--link); }
.data-table th[data-sort-key] > button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.sort-indicator { width: 1em; color: var(--muted); text-align: center; }
.data-table th[aria-sort]:not([aria-sort="none"]) .sort-indicator { color: var(--link); }
.data-table tbody tr:nth-child(even) { background: var(--stripe); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .numeric { text-align: right; }
.data-table .positive { color: var(--green); font-weight: 700; }
.data-table .negative { color: var(--red); font-weight: 700; }

.month-cell { min-width: 180px; }
.month-name { position: relative; z-index: 1; font-weight: 700; }
.month-cell.is-current-month { min-width: 260px; }
.month-progress {
  position: relative;
  z-index: 1;
  width: min(230px, 100%);
  margin-top: 7px;
  display: grid;
  gap: 4px;
}
.month-progress-label {
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
}
.month-progress-track {
  height: 6px;
  display: block;
  overflow: hidden;
  border: 1px solid var(--field-border);
  border-radius: 999px;
  background: var(--progress-track);
}
.month-progress-fill {
  width: var(--month-progress, 0%);
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), #f6b14d);
}
.volume-meter { position: relative; min-width: 150px; }
.volume-meter::before {
  content: "";
  position: absolute;
  inset: 4px auto 4px 0;
  width: var(--volume-width, 0%);
  max-width: 100%;
  background: var(--volume-bg);
}
.volume-meter > * { position: relative; z-index: 1; }
.volume-meter > .firefish-commission {
  color: var(--firefish-commission);
  white-space: normal;
  min-width: 205px;
  font-size: var(--minimum-text-size);
}

.direction-badge { display: inline-block; min-width: 68px; padding: 2px 6px; border: 1px solid currentColor; border-radius: 3px; text-align: center; font-size: var(--minimum-text-size); }
.direction-incoming { color: var(--green); background: var(--green-soft); }
.direction-outgoing { color: var(--red); background: var(--red-soft); }
.direction-mixed { color: var(--mixed-ink); background: var(--mixed-bg); }

.confirmation-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: var(--minimum-text-size);
  font-weight: 700;
}
.confirmation-badge.unconfirmed { color: #fff; background: var(--red); }

.event-badge, .cpfp-status-badge, .firefish-badge {
  display: inline-block;
  min-width: 64px;
  padding: 2px 6px;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-size: var(--minimum-text-size);
  font-weight: 700;
  text-align: center;
}

.event-setup { color: var(--exact-ink); background: var(--exact-bg); }
.event-topup { color: var(--rule-ink); background: var(--rule-bg); }
.event-cpfp { color: var(--estimate-ink); background: var(--estimate-bg); }
.event-other { color: var(--muted); background: var(--surface-subtle); }
.cpfp-status-spent { color: var(--green); background: var(--green-soft); }
.cpfp-status-unspent { color: var(--mixed-ink); background: var(--mixed-bg); }
.firefish-setup { color: var(--exact-ink); background: var(--exact-bg); }
.firefish-topup { color: var(--rule-ink); background: var(--rule-bg); }
.firefish-anchor, .firefish-cpfp { color: var(--estimate-ink); background: var(--estimate-bg); }
.firefish-internal, .firefish-unknown { color: var(--muted); background: var(--surface-subtle); }
.firefish-accelerated { color: var(--green); background: var(--green-soft); }
.firefish-pending { color: var(--mixed-ink); background: var(--mixed-bg); }

.data-table td.exact-value, .data-table td[data-value-kind="exact"] { color: var(--exact-ink); font-weight: 700; }
.data-table td.rule-value, .data-table td[data-value-kind="rule"] { color: var(--rule-ink); font-weight: 700; }
.data-table td.estimate-value, .data-table td[data-value-kind="estimate"] { background: var(--estimate-bg); color: var(--estimate-ink); font-weight: 700; }
.data-table td.estimate-value.uncertain-estimate { background: var(--surface-subtle); color: var(--muted); }
.value-provenance, .scenario-cell small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--minimum-text-size); font-weight: 400; line-height: 1.25; }
.value-provenance.exact { color: var(--exact-ink); }
.value-provenance.estimate { color: var(--estimate-ink); }
.scenario-cell > span { display: block; color: var(--ink); font-weight: 700; }
.scenario-cell { color: var(--muted); font-size: var(--minimum-text-size); }
.transactions-table { min-width: 780px; }
.transactions-table.firefish-history-table {
  width: 100%;
  min-width: max(100%, calc(var(--history-visible-columns, 19) * 58px));
}

.transactions-table.firefish-history-table td { vertical-align: top; }
.history-marketplace-currency-model {
  display: block;
  margin-top: 3px;
  color: var(--estimate-ink);
  font-size: var(--minimum-text-size);
  font-weight: 600;
  line-height: 1.25;
}
.history-block-type-cell > strong,
.history-primary-detail,
.history-loan-terms,
.history-fee-line,
.history-return-line,
.history-tx-line { display: block; }
.history-block-type-cell > strong,
.history-loan-terms-cell > strong,
.history-escrow-amount { color: var(--ink); font-weight: 800; }
.history-block-type-cell .firefish-badge { margin-top: 8px; }
.history-primary-detail {
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 400;
  line-height: 1.35;
}
.history-loan-terms {
  margin-top: 4px;
  color: var(--ink);
  font-size: var(--minimum-text-size);
  font-weight: 700;
  line-height: 1.35;
}
.history-loan-terms-cell.uncertain-estimate { background-color: var(--surface-subtle); }
.history-fee-line,
.history-return-line {
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 400;
  line-height: 1.35;
}
.history-return-line { color: var(--exact-ink); }
.history-transactions-cell .txid-link {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.history-column-help {
  flex: 0 0 auto;
  color: var(--link);
  font-size: var(--minimum-text-size);
  cursor: help;
}
.history-uncertain-tenor-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: max-content;
  max-width: 100%;
  padding: 2px 7px;
  border: 1px dashed var(--muted);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  font: inherit;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
}
.history-uncertain-tenor-label { display: grid; line-height: 1.2; white-space: nowrap; }
.history-uncertain-tenor-label > span { display: block; }
.history-uncertain-tenor-button:hover,
.history-uncertain-tenor-button:focus-visible {
  border-color: var(--orange);
  color: var(--orange);
  outline: none;
}
.uncertain-tenor-dialog {
  width: min(940px, calc(100vw - 24px));
  max-height: min(720px, calc(100vh - 24px));
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 80px rgb(0 0 0 / .4);
}
.uncertain-tenor-dialog::backdrop { background: rgb(0 0 0 / .62); }
.uncertain-tenor-dialog > header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.uncertain-tenor-dialog > header small {
  display: block;
  margin-bottom: 4px;
  color: var(--orange);
  font-size: var(--minimum-text-size);
  font-weight: 800;
  letter-spacing: .12em;
}
.uncertain-tenor-dialog > header h3 { margin: 0; font-size: 22px; }
.uncertain-tenor-dialog-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: var(--surface-subtle);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.uncertain-tenor-dialog-close:hover,
.uncertain-tenor-dialog-close:focus-visible { border-color: var(--orange); outline: 2px solid transparent; }
.uncertain-tenor-dialog > p {
  margin: 0;
  padding: 14px 20px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  line-height: 1.55;
}
.uncertain-tenor-dialog > p.uncertain-tenor-warning {
  color: var(--ink);
  background: color-mix(in srgb, var(--orange) 10%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--orange) 35%, var(--line));
}
.uncertain-tenor-table-wrap { padding: 0 20px 16px; overflow-x: auto; }
.uncertain-tenor-table { width: 100%; border-collapse: collapse; font-size: var(--minimum-text-size); }
.uncertain-tenor-table th,
.uncertain-tenor-table td { padding: 10px 9px; border: 1px solid var(--line); text-align: left; white-space: nowrap; }
.uncertain-tenor-table thead th { color: var(--muted); background: var(--surface-subtle); font-size: var(--minimum-text-size); }
.uncertain-tenor-table tbody th { color: var(--ink); }
.uncertain-tenor-table .uncertain-tenor-probability { color: var(--orange); font-weight: 900; }
.uncertain-tenor-table .uncertain-tenor-closest { color: var(--orange); font-weight: 900; }
.uncertain-tenor-table tr.rejected:not(.unavailable) { background: color-mix(in srgb, var(--red) 5%, transparent); }
.uncertain-tenor-table tr.unavailable { opacity: .48; }
.uncertain-tenor-dialog > footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 13px 20px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--minimum-text-size);
  line-height: 1.45;
}
.uncertain-tenor-dialog > footer strong { color: var(--orange); white-space: nowrap; }

@media (max-width: 620px) {
  .uncertain-tenor-dialog > header { padding: 14px; }
  .uncertain-tenor-dialog > header h3 { font-size: 18px; }
  .uncertain-tenor-dialog > p { padding: 12px 14px; }
  .uncertain-tenor-table-wrap { padding: 0 14px 12px; }
  .uncertain-tenor-table th,
  .uncertain-tenor-table td { padding: 8px 6px; font-size: var(--minimum-text-size); }
  .uncertain-tenor-dialog > footer { grid-template-columns: 1fr; padding: 12px 14px 14px; }
}

/* Typ a on-chain výsledek jsou čitelné přes celý řádek. Poloprůhledná vrstva
   zachová podklad buněk s přesným/odhadovaným údajem i střídání řádků. */
.transactions-table.firefish-history-table tr.lifecycle-row > td {
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.transactions-table.firefish-history-table tr.lifecycle-row-active > td {
  background-image: linear-gradient(
    color-mix(in srgb, var(--green) 11%, transparent),
    color-mix(in srgb, var(--green) 11%, transparent)
  );
}
.transactions-table.firefish-history-table tr.lifecycle-row-returned > td {
  background-image: linear-gradient(
    color-mix(in srgb, var(--rule-ink) 12%, transparent),
    color-mix(in srgb, var(--rule-ink) 12%, transparent)
  );
}
.transactions-table.firefish-history-table tr.lifecycle-row-topup > td,
.transactions-table.firefish-history-table tr.lifecycle-row-mempool > td {
  background-image: linear-gradient(
    color-mix(in srgb, var(--link) 12%, transparent),
    color-mix(in srgb, var(--link) 12%, transparent)
  );
}
.transactions-table.firefish-history-table tr.lifecycle-row-liquidated > td {
  background-image: linear-gradient(
    color-mix(in srgb, var(--red) 12%, transparent),
    color-mix(in srgb, var(--red) 12%, transparent)
  );
}
.transactions-table.firefish-history-table tr.lifecycle-row-ambiguous > td {
  background-image: linear-gradient(
    color-mix(in srgb, var(--muted) 8%, transparent),
    color-mix(in srgb, var(--muted) 8%, transparent)
  );
}
.transactions-table.firefish-history-table tr.lifecycle-row-cancelled > td {
  background-image: linear-gradient(
    color-mix(in srgb, var(--orange) 12%, transparent),
    color-mix(in srgb, var(--orange) 12%, transparent)
  );
}
.transactions-table.firefish-history-table tr.lifecycle-row-active > td.history-first-visible-cell {
  box-shadow: inset 4px 0 0 var(--green);
}
.transactions-table.firefish-history-table tr.lifecycle-row-returned > td.history-first-visible-cell {
  box-shadow: inset 4px 0 0 var(--rule-ink);
}
.transactions-table.firefish-history-table tr.lifecycle-row-topup > td.history-first-visible-cell,
.transactions-table.firefish-history-table tr.lifecycle-row-mempool > td.history-first-visible-cell {
  box-shadow: inset 4px 0 0 var(--link);
}
.transactions-table.firefish-history-table tr.lifecycle-row-liquidated > td.history-first-visible-cell {
  box-shadow: inset 4px 0 0 var(--red);
}
.transactions-table.firefish-history-table tr.lifecycle-row-ambiguous > td.history-first-visible-cell {
  box-shadow: inset 4px 0 0 var(--muted);
}
.transactions-table.firefish-history-table tr.lifecycle-row-cancelled > td.history-first-visible-cell {
  box-shadow: inset 4px 0 0 var(--orange);
}

/* Historie se přizpůsobuje obsahu; celý údaj provize držíme pohromadě.
   Ostatní delší text lze zalomit, zkracují se pouze TXID. */
@media (min-width: 1000px) {
  .transactions-section {
    /* Share the dashboard shell edges with the summary and other tables. */
    width: 100%;
    min-width: 0;
    margin-inline: 0;
  }

  .transactions-section > .table-scroll { overflow-x: auto; }

  .transactions-table.firefish-history-table {
    width: 100%;
    table-layout: auto;
  }

  .transactions-table.firefish-history-table th,
  .transactions-table.firefish-history-table td {
    height: 30px;
    padding: 2px 4px;
    vertical-align: middle;
    white-space: normal;
    overflow: visible;
    overflow-wrap: normal;
    text-overflow: clip;
    line-height: 1.35;
  }

  .transactions-table.firefish-history-table th { font-size: var(--minimum-text-size); }
  .transactions-table.firefish-history-table td { font-size: var(--minimum-text-size); }
  .transactions-table.firefish-history-table tbody tr { height: 30px; }

  .transactions-table.firefish-history-table th.numeric,
  .transactions-table.firefish-history-table td.numeric { text-align: left; }
  .transactions-table.firefish-history-table th.numeric > button { justify-content: flex-start; }

  .transactions-table.firefish-history-table .history-compact-cell,
  .transactions-table.firefish-history-table .history-compact-cell > *,
  .transactions-table.firefish-history-table .firefish-badge,
  .transactions-table.firefish-history-table .lifecycle-badge {
    max-width: none;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .transactions-table.firefish-history-table .history-firefish-fee-cell {
    min-width: 155px;
    white-space: nowrap;
  }
  .transactions-table.firefish-history-table .history-miner-fee-cell { min-width: 135px; }
  .transactions-table.firefish-history-table .sort-label { white-space: normal; }

  .transactions-table.firefish-history-table .txid-link {
    max-width: 110px;
    overflow: hidden;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    text-overflow: ellipsis;
  }
}

#history-lifecycle-header[hidden] { display: none; }
.lifecycle-cell { min-width: 180px; max-width: 260px; vertical-align: top; white-space: normal; }

.lifecycle-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: var(--minimum-text-size);
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}

.lifecycle-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.lifecycle-badge.active { border-color: var(--source-border); background: var(--source-bg); color: var(--source-ink); }
.lifecycle-badge.completed { border-color: var(--rule-border); background: var(--rule-bg); color: var(--rule-ink); }
.lifecycle-badge.returned { border-color: var(--rule-border); background: var(--rule-bg); color: var(--rule-ink); }
.lifecycle-badge.cancelled { border-color: var(--warning-border); background: var(--warning-bg); color: var(--warning-ink); }
.lifecycle-badge.liquidated { border-color: var(--red); background: color-mix(in srgb, var(--red) 14%, var(--surface)); color: var(--red); }
.lifecycle-badge.ambiguous { border-color: var(--field-border); background: var(--surface-subtle); color: var(--muted); }
.lifecycle-badge.unknown { border-color: var(--field-border); background: var(--surface-subtle); color: var(--muted); }

.lifecycle-duration {
  display: grid;
  gap: 2px;
  margin-top: 6px;
  color: var(--ink);
  font-size: var(--minimum-text-size);
  line-height: 1.3;
}
.lifecycle-duration strong { font-size: var(--minimum-text-size); }
.lifecycle-duration span { color: var(--muted); }
.lifecycle-duration i {
  display: block;
  width: 100%;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--progress-track);
}
.lifecycle-duration i::before {
  content: "";
  display: block;
  width: var(--lifecycle-duration, 0%);
  height: 100%;
  background: currentColor;
}
.lifecycle-cancel-reason, .lifecycle-cancel-tooltip { color: var(--warning-ink); }
.lifecycle-return-evidence { color: var(--exact-ink); }

.lifecycle-detail, .topup-detail {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 400;
  line-height: 1.35;
  white-space: normal;
}

.topup-detail {
  padding-left: 7px;
  border-left: 2px solid var(--rule-border);
  color: var(--rule-ink);
}

.cpfp-details[hidden] { display: none; }
.topup-details[hidden] { display: none; }
.firefish-analysis-details[hidden] { display: none; }

.secondary-analyses[hidden] { display: none; }
.secondary-analyses-toggle {
  min-height: 68px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--field-border);
  border-radius: 6px;
  background: var(--surface-subtle);
  color: var(--ink);
  list-style: none;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.secondary-analyses-toggle::-webkit-details-marker { display: none; }
.secondary-analyses-toggle::before {
  content: "+";
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--orange);
  border-radius: 50%;
  color: var(--orange);
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
}
.secondary-analyses[open] > .secondary-analyses-toggle::before { content: "−"; }
.secondary-analyses-toggle:hover {
  border-color: var(--orange);
  background: var(--button-hover);
}
.secondary-analyses-toggle:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.secondary-analyses-toggle-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 3px;
}
.secondary-analyses-toggle-copy strong { font-size: 17px; line-height: 1.2; }
.secondary-analyses-toggle-copy small { color: var(--muted); font-size: var(--minimum-text-size); }
.secondary-analyses-toggle-action {
  flex: 0 0 auto;
  color: var(--blue-dark);
  font-size: var(--minimum-text-size);
  font-weight: 700;
}
.secondary-analyses-toggle-action .when-open { display: none; }
.secondary-analyses[open] > .secondary-analyses-toggle .when-closed { display: none; }
.secondary-analyses[open] > .secondary-analyses-toggle .when-open { display: inline; }
.secondary-analyses-content { margin-top: 14px; }
.secondary-analyses-content > .investor-rate-section { margin-top: 0; padding: 22px 0 28px; }
.secondary-analyses[open] > .secondary-analyses-content {
  animation: secondary-analyses-reveal .28s ease-out both;
}
.secondary-analyses-content > details {
  padding: 22px 0 28px;
  border-top: 1px solid var(--line);
}
.secondary-analyses-content > details:last-child { padding-bottom: 0; }

@keyframes secondary-analyses-reveal {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .secondary-analyses[open] > .secondary-analyses-content { animation: none; }
}

.cpfp-summary-toggle {
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--surface-subtle);
  color: var(--ink);
  list-style-position: inside;
  cursor: pointer;
}

.cpfp-summary-toggle::marker { color: var(--orange); font-size: max(var(--minimum-text-size), 1.05em); }
.cpfp-summary-toggle:hover { background: var(--button-hover); }
.cpfp-summary-toggle:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.cpfp-summary-row {
  width: calc(100% - 24px);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  vertical-align: middle;
}

.cpfp-summary-row .eyebrow { display: block; margin-bottom: 2px; }
.cpfp-summary-title { display: block; font-size: 20px; font-weight: 700; line-height: 1.2; }
.cpfp-summary-action { flex: 0 0 auto; color: var(--blue-dark); font-size: var(--minimum-text-size); font-weight: 700; }
.cpfp-summary-action .when-open { display: none; }
.cpfp-details[open] .cpfp-summary-action .when-closed { display: none; }
.cpfp-details[open] .cpfp-summary-action .when-open { display: inline; }
.firefish-analysis-details[open] .cpfp-summary-action .when-closed { display: none; }
.firefish-analysis-details[open] .cpfp-summary-action .when-open { display: inline; }
.topup-details[open] .topup-summary-action .when-closed { display: none; }
.topup-details[open] .topup-summary-action .when-open { display: inline; }

.cpfp-details-content {
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--surface);
}

.firefish-analysis-content {
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--surface);
}

.firefish-analysis-content .firefish-brand-panel { margin-bottom: 18px; }

.topup-details-content {
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--surface);
}

.topup-identity-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--exact-border);
  border-left: 3px solid var(--exact-border);
  background: var(--exact-bg);
  color: var(--ink);
  font-size: var(--minimum-text-size);
  line-height: 1.55;
}

.topup-identity-note .value-badge { margin-right: 6px; vertical-align: 1px; }

.topup-summary-grid {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--surface);
}

.topup-summary-grid > div {
  min-width: 0;
  min-height: 67px;
  padding: 10px 11px;
  border-right: 1px solid var(--line);
}

.topup-summary-grid > div:last-child { border-right: 0; }
.topup-summary-grid span { display: block; color: var(--muted); font-size: var(--minimum-text-size); font-weight: 700; text-transform: uppercase; }
.topup-summary-grid strong { display: block; margin-top: 6px; color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.topup-controls {
  margin-bottom: 9px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.topup-controls label,
.chart-style-control {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 700;
}

.topup-controls select,
.chart-style-control select {
  height: 35px;
  min-width: 190px;
  padding: 0 30px 0 9px;
  border: 1px solid var(--field-border);
  border-radius: 4px;
  background: var(--field-bg);
  color: var(--field-ink);
  cursor: pointer;
}

.topup-controls select:focus-visible,
.chart-style-control select:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.chart-style-control { align-self: flex-end; }
.chart-style-control select { min-width: 180px; }

.topup-chart-legend {
  margin: 0 0 7px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 18px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  flex-wrap: wrap;
}

.topup-chart-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.topup-chart-legend .topup-axis-mode-note { width: 100%; justify-content: flex-end; font-style: italic; }
.topup-legend-swatch { width: 24px; flex: 0 0 24px; }
.topup-legend-series { height: 3px; background: var(--orange); }
.topup-legend-price { height: 0; border-top: 3px dashed var(--blue); }

.topup-chart-wrap {
  position: relative;
  width: 100%;
  height: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--canvas-bg);
}

#topup-monthly-chart {
  width: 100%;
  min-width: 0;
  height: 100%;
  display: block;
  cursor: default;
  touch-action: none;
  user-select: none;
}
#topup-monthly-chart.is-panning { cursor: grabbing !important; }

.topup-chart-tooltip { min-width: 210px; }
.topup-chart-tooltip .topup-price-tooltip-line { color: var(--blue); font-weight: 700; }
.topup-stress-marker {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.topup-stress-line {
  position: absolute;
  left: var(--stress-x);
  top: var(--stress-top);
  height: var(--stress-height);
  border-left: 2px dashed var(--milestone-blog, #b696ef);
  opacity: .8;
}
#topup-stress-button {
  position: absolute;
  left: var(--stress-label-x);
  top: 5px;
  transform: translateX(-50%);
  pointer-events: auto;
  min-height: 30px;
  max-width: calc(100% - 12px);
  padding: 4px 9px;
  border: 1px solid var(--milestone-blog, #b696ef);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font-size: var(--minimum-text-size);
  font-weight: 700;
  white-space: nowrap;
}
#topup-stress-button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.topup-stress-popover {
  position: absolute;
  top: 43px;
  left: var(--stress-popover-left, 8px);
  z-index: 8;
  width: min(360px, calc(100% - 16px));
  box-sizing: border-box;
  padding: 14px;
  border: 1px solid var(--milestone-blog, #b696ef);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 5px 20px #0008;
  pointer-events: auto;
  font-size: 14px;
  line-height: 1.45;
}
.topup-stress-popover::before { content: ""; position: absolute; inset: -10px 0 auto; height: 10px; }
.topup-stress-popover > strong { display: block; padding-right: 24px; }
.topup-stress-popover > p { margin: 10px 0; }
.topup-stress-popover > a { display: block; }
.topup-stress-close { position: absolute; top: 3px; right: 3px; min-width: 30px; min-height: 30px; padding: 0; }
.topup-stress-detail {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--milestone-blog, #b696ef);
  border-radius: 8px;
  background: var(--surface);
}
.topup-stress-detail > summary { padding: 12px 14px; cursor: pointer; }
.topup-stress-detail > summary span { margin-left: 12px; color: var(--muted); font-size: var(--minimum-text-size); }
.topup-stress-content { padding: 0 14px 14px; font-size: var(--minimum-text-size); }
.topup-stress-content > p { margin: 0 0 12px; }
.topup-stress-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.topup-stress-stats > div { padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.topup-stress-stats dt, .topup-stress-stats small { color: var(--muted); }
.topup-stress-stats dd { margin: 5px 0; font-size: 21px; font-weight: 700; color: var(--ink); }
.topup-stress-onchain { padding: 9px 12px; border-left: 2px solid var(--orange); background: var(--canvas-bg); }
.topup-stress-onchain:empty { display: none; }
.topup-stress-note { color: var(--muted); }
.topup-stress-content a { color: var(--blue); }
.topup-subheading { margin: 20px 0 9px; color: var(--ink); font-size: 15px; }
.topup-podium { margin-top: 0; }
.topup-monthly-table { min-width: 800px; }

.cpfp-details-link-row {
  margin-bottom: 10px;
  display: flex;
  justify-content: flex-end;
}

.cpfp-progress {
  margin-bottom: 12px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  color: var(--muted);
  font-size: var(--minimum-text-size);
}

.cpfp-progress[hidden] { display: none; }
.cpfp-progress[data-state="ready"] { border-color: var(--source-border); background: var(--source-bg); color: var(--source-ink); }
.cpfp-progress[data-state="error"] { border-color: var(--error-border); background: var(--red-soft); color: var(--error-ink); }
.loading-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--orange); }

.cpfp-summary {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--surface);
}

.cpfp-summary > div {
  min-width: 0;
  min-height: 67px;
  padding: 10px 11px;
  border-right: 1px solid var(--line);
}

.cpfp-summary > div:last-child { border-right: 0; }
.cpfp-summary span { display: block; color: var(--muted); font-size: var(--minimum-text-size); font-weight: 700; text-transform: uppercase; }
.cpfp-summary strong { display: block; margin-top: 6px; font-size: 16px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.cpfp-controls {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.cpfp-controls label { margin: 0; }
.cpfp-controls select { width: 230px; height: 35px; }
.cpfp-table { min-width: 880px; }
.table-empty td { padding: 26px 12px; color: var(--muted); text-align: center; }

.txid-link {
  max-width: 150px;
  display: inline-block;
  overflow: hidden;
  color: var(--link);
  font-family: "DejaVu Sans Mono", Consolas, monospace;
  font-size: var(--minimum-text-size);
  text-decoration: underline;
  text-overflow: ellipsis;
  vertical-align: bottom;
}
.txid-link:hover { text-decoration-thickness: 2px; }
.txid-link:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.tx-search input {
  width: min(260px, 45vw);
  height: 35px;
  padding: 0 10px;
  border: 1px solid var(--field-border);
  border-radius: 4px;
  background: var(--field-bg);
  color: var(--field-ink);
  outline: 0;
}
.tx-search input:focus { border-color: var(--blue); }

.history-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
}
.history-term-toolbar .history-toolbar { display: contents; }
.history-term-toolbar .history-completed-control { min-width: 0; flex: 1 1 240px; }
.history-term-toolbar .history-completed-control select { width: 100%; min-width: 0; max-width: 360px; }
.history-term-toolbar .tx-search { flex: 1 1 180px; min-width: 0; }
.history-term-toolbar .tx-search input { width: 100%; }
.tx-search { display: grid; gap: 3px; }
.tx-search > label { color: var(--muted); font-size: var(--minimum-text-size); font-weight: 700; }
.tx-search-fields { display: flex; gap: 5px; }
.tx-search-fields input { min-width: 0; flex: 1; }
.tx-search-fields button { flex: 0 0 auto; }
.history-search-help { display: block; margin: 10px 0 14px; line-height: 1.5; color: var(--muted); }
.history-search-status { color: var(--muted); }

.history-type-control {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 700;
}

.history-type-control[hidden] { display: none; }
.history-type-control select {
  height: 35px;
  min-width: 190px;
  padding: 0 30px 0 9px;
  border: 1px solid var(--field-border);
  border-radius: 4px;
  background: var(--field-bg);
  color: var(--field-ink);
}

.history-type-control select:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.history-completed-control {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 700;
  white-space: nowrap;
}

.history-completed-control[hidden] { display: none; }
.history-completed-control select {
  height: 35px;
  min-width: 190px;
  padding: 0 30px 0 9px;
  border: 1px solid var(--field-border);
  border-radius: 4px;
  background: var(--field-bg);
  color: var(--field-ink);
  cursor: pointer;
}
.history-completed-control select:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.history-term-toolbar {
  margin: -2px 0 12px;
  padding: 10px;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  flex-wrap: wrap;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  background: var(--surface-subtle);
}
.history-term-toolbar[hidden] { display: none; }
.history-term-control,
.history-interest-control {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 700;
}
.history-term-control select,
.history-interest-range input {
  height: 38px;
  border: 1px solid var(--field-border);
  border-radius: 5px;
  background: var(--field-bg);
  color: var(--field-ink);
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 5%, transparent);
}
.history-term-control select {
  min-width: 176px;
  padding: 0 32px 0 10px;
  cursor: pointer;
}
.history-interest-range {
  display: flex;
  align-items: center;
  gap: 6px;
}
.history-interest-range input {
  width: 94px;
  padding: 0 10px;
  font-variant-numeric: tabular-nums;
}
.history-term-control select:focus,
.history-interest-range input:focus { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); outline: 0; }
.history-interest-range input[aria-invalid="true"] { border-color: var(--red); }
.history-interest-cell, th[data-column-key="interest"] { position: relative; padding-right: 24px; }
.loan-methodology-help { display: inline-flex; align-items: center; justify-content: center; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; border: 1px solid currentColor; border-radius: 50%; font-size: var(--minimum-text-size); text-decoration: none; color: var(--ink); opacity: 0; }
.history-interest-cell:hover .loan-methodology-help, th:hover > .loan-methodology-help, .loan-methodology-help:focus-visible { opacity: 1; }
.loan-methodology-help:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
th.has-loan-methodology-help { position: relative; padding-right: 24px; }
th.has-loan-methodology-help > .loan-methodology-help { opacity: 1; }
.loan-methodology-tooltip { position: fixed; z-index: 1500; width: 440px; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow: auto; padding: 14px 16px; border: 1px solid var(--orange); border-radius: 5px; background: var(--field-bg); color: var(--ink); font-size: 14px; line-height: 1.55; text-align: left; box-shadow: 0 5px 20px #0008; }
.loan-methodology-tooltip[hidden] { display: none; }
.chart-title-link { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.chart-title-link:hover { color: var(--link); }
.chart-title-link:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }
@media (hover: none) { .loan-methodology-help { opacity: 1; } }
.protocol-transparency { margin: 24px 0; padding: 20px; border: 1px solid var(--line); }
.protocol-transparency p { line-height: 1.6; margin: 14px 0; }
[data-lifecycle-cache-status] { color: var(--orange); font-size: 14px; }
.history-interest-help, .history-interest-error { flex: 1 0 100%; font-size: var(--minimum-text-size); }
.history-interest-help { color: var(--muted); }
.history-interest-error { color: var(--red); }
.history-term-control select:focus-visible,
.history-interest-range input:focus-visible,
.history-filter-reset:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.history-date-sort-control { margin-left: auto; }
.history-term-actions { display: flex; align-items: center; gap: 7px; }
.history-filter-reset {
  min-height: 38px;
  padding: 7px 13px;
  border-radius: 5px;
  font-weight: 800;
  cursor: pointer;
}
.history-filter-reset {
  border: 1px solid var(--field-border);
  background: var(--surface-raised);
  color: var(--ink);
}
.history-filter-reset:hover { background: var(--button-hover); }
.history-term-toolbar.has-active-filters {
  border-color: color-mix(in srgb, var(--orange) 55%, var(--soft-line));
  background: color-mix(in srgb, var(--orange) 5%, var(--surface-subtle));
}

.history-columns-control {
  position: relative;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 700;
}
.history-columns-control[hidden] { display: none; }
.history-columns-control > summary {
  min-width: 118px;
  height: 35px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  border: 1px solid var(--field-border);
  border-radius: 4px;
  background: var(--field-bg);
  color: var(--field-ink);
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.history-columns-control > summary::-webkit-details-marker { display: none; }
.history-columns-control > summary::after {
  content: "\25BE";
  margin-left: 2px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  transition: transform 120ms ease;
}
.history-columns-control[open] > summary::after { transform: rotate(180deg); }
.history-columns-control > summary:hover { border-color: var(--link); }
.history-columns-control > summary:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.history-columns-control > summary strong {
  margin-left: auto;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
}
.history-columns-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  right: 0;
  width: min(430px, calc(100vw - 24px));
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-raised);
  box-shadow: 0 16px 42px rgb(0 0 0 / .32);
}
.history-columns-menu-heading {
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.history-columns-menu-heading > strong { color: var(--ink); font-size: var(--minimum-text-size); }
.history-columns-menu-heading button {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--field-border);
  border-radius: 3px;
  background: var(--surface);
  color: var(--link);
  font: inherit;
  cursor: pointer;
}
.history-columns-menu-heading button:hover:not(:disabled) { border-color: var(--link); }
.history-columns-menu-heading button:disabled { opacity: .45; cursor: default; }
.history-columns-menu-heading button:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.history-columns-list {
  max-height: none;
  padding: 2px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
  overflow-y: visible;
}
.history-column-option {
  min-width: 0;
  min-height: 30px;
  padding: 5px 6px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 3px;
  color: var(--secondary-ink);
  cursor: pointer;
}
.history-column-option:hover { background: var(--button-hover); }
.history-column-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--orange);
}
.history-column-option input:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.history-column-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.history-columns-menu > small {
  margin-top: 9px;
  display: block;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 400;
  line-height: 1.4;
}

.history-liquidation-report {
  margin: 14px 0 12px;
  border: 1px solid color-mix(in srgb, var(--red) 42%, var(--line));
  background: color-mix(in srgb, var(--red-soft) 42%, var(--surface));
}
.history-liquidation-report[hidden] { display: none; }
.history-liquidation-report-heading {
  padding: 12px 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}
.history-liquidation-report-heading > div { min-width: 0; }
.history-liquidation-report-heading strong { display: block; margin-top: 3px; color: var(--ink); font-size: 16px; }
.history-liquidation-report-heading p { max-width: 720px; margin: 0; color: var(--muted); font-size: var(--minimum-text-size); line-height: 1.4; text-align: right; }
.history-liquidation-report-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.history-liquidation-report-grid > div { min-width: 0; min-height: 76px; padding: 11px 12px; border-right: 1px solid var(--line); }
.history-liquidation-report-grid > div:last-child { border-right: 0; }
.history-liquidation-report-grid span { display: block; color: var(--muted); font-size: var(--minimum-text-size); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.history-liquidation-report-grid strong { display: block; margin-top: 6px; color: var(--red); font-size: 17px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.history-liquidation-report-grid small { display: block; margin-top: 5px; color: var(--muted); font-size: var(--minimum-text-size); line-height: 1.35; }
.history-liquidation-report-grid > .exact strong { color: var(--exact-ink); }
.history-liquidation-report-grid > .estimate { background: color-mix(in srgb, var(--estimate-bg) 62%, transparent); }
.history-liquidation-report-grid > .estimate strong { color: var(--estimate-ink); }
.history-liquidation-report-note { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--minimum-text-size); line-height: 1.45; }
.history-liquidation-report-note strong { color: var(--ink); }

.pagination {
  padding: 10px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
}
.pagination button {
  min-width: 82px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid #a85c00;
  border-radius: 3px;
  background: var(--orange);
  color: #15191d;
  font-weight: 650;
  cursor: pointer;
}
.pagination button:hover:not(:disabled) { background: #ffb34d; }
.pagination button.pagination-first { background: #cdebd3; border-color: #86be90; color: #193d24; }
.pagination button.pagination-last { background: #f1c9c9; border-color: #ce8585; color: #572626; }
.pagination button.pagination-first:hover:not(:disabled) { background: #b4dfbd; }
.pagination button.pagination-last:hover:not(:disabled) { background: #eeb0b0; }
.pagination button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.pagination button:disabled {
  background: var(--surface-raised);
  border-color: var(--line);
  color: var(--muted);
  opacity: .45;
  cursor: default;
}

.pagination-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.page-size-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  white-space: nowrap;
}

.page-size-control select {
  height: 31px;
  min-width: 70px;
  padding: 0 24px 0 7px;
  border: 1px solid var(--field-border);
  border-radius: 3px;
  background: var(--field-bg);
  color: var(--field-ink);
  cursor: pointer;
}

.page-size-control select:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

footer { margin-top: 10px; padding: 20px 0 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--minimum-text-size); text-align: center; }
.site-footer .shell { display: grid; gap: 14px; }
.footer-divider {
  width: min(100%, 980px);
  margin: 10px auto;
  border: 0;
  border-top: 1px solid var(--line);
}
.site-footer-meta {
  --footer-meta-font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  text-align: center;
}
.data-disclaimer {
  width: fit-content;
  max-width: min(100%, 72ch);
  justify-self: center;
  margin-inline: auto;
  padding: 10px 16px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--orange);
  background: var(--surface-subtle);
  font-size: 16px;
  line-height: 1.45;
  text-align: center;
}
.data-disclaimer strong { color: var(--orange); font-size: inherit; letter-spacing: .07em; text-transform: uppercase; }
.data-disclaimer span { color: var(--muted); text-wrap: balance; }
.footer-source-status { display: inline-flex; align-items: center; justify-content: center; }
.site-footer-meta .source-status, .site-footer-meta .footer-contact,
.site-footer-meta .footer-contact > span, .site-footer-meta .footer-contact > a { font-size: var(--footer-meta-font-size); line-height: 1.4; }
.footer-software-version { white-space: nowrap; }
.footer-version {
  --source-border: var(--version-accent);
  --source-bg: color-mix(in srgb, var(--version-accent) 12%, var(--surface));
  --source-ink: var(--version-accent);
  white-space: nowrap;
}
.footer-version-insight { --version-accent: #e6413e; }
.footer-version-bitcoin { --version-accent: var(--orange); }
.footer-version-mempool { --version-accent: var(--blue); }

@media (max-width: 1199px) {
  .current-period-summary-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; row-gap: 10px; }
  .current-period-card { height: auto; grid-row: auto; grid-template-rows: 52px auto; }
  .current-period-card dl { display: block; grid-row: auto; }
}

.donate-section {
  width: min(100%, 980px);
  margin: 6px auto 0;
  padding: 24px 0 4px;
  color: var(--ink);
  text-align: center;
}

.donate-heading { margin-bottom: 12px; }
.donate-heading .eyebrow { display: block; margin-bottom: 3px; }
.donate-heading h2 { margin: 0; font-size: max(var(--minimum-text-size), clamp(22px, 3vw, 28px)); line-height: 1.15; }

.donate-support-copy {
  width: min(100%, 760px);
  margin: 0 auto 16px;
  padding: 9px 12px;
  border-left: 2px solid var(--blue);
  background: var(--surface-subtle);
  color: var(--muted);
  line-height: 1.45;
  text-align: left;
}

.donate-support-copy strong { display: block; color: var(--orange); font-size: 16px; }
.donate-support-copy p { margin: 2px 0 0; font-size: 16px; }
.donate-support-copy p + p { margin-top: 10px; }

.donate-payment-layout {
  width: min(100%, 760px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 324px minmax(0, 416px);
  justify-content: center;
  align-items: start;
  gap: 20px;
}

.donate-method-map {
  min-height: 412px;
  display: grid;
  grid-template-columns: 64px 48px minmax(0, 212px);
  align-items: start;
}

.donate-bitcoin-root {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  margin-top: 174px;
  color: inherit;
  cursor: default;
}

.donate-bitcoin-root img {
  width: 64px;
  height: 64px;
  display: block;
  filter: drop-shadow(0 5px 12px rgba(247, 147, 26, .25));
}

.donate-bitcoin-root strong {
  position: absolute;
  top: 69px;
  left: 50%;
  color: var(--orange);
  font-size: var(--minimum-text-size);
  letter-spacing: .04em;
  transform: translateX(-50%);
}

.donate-method-connectors {
  width: 48px;
  height: 412px;
  display: block;
  overflow: visible;
}

.donate-method-connectors path {
  fill: none;
  stroke: var(--donate-connection-color, var(--orange));
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.donate-connector-trunk { opacity: .95; }
.donate-connector-branch { opacity: .55; }
.donate-method-connectors[data-active-method="lightning"], [data-donate-connector="lightning"] { --donate-connection-color: #a66cff; }
.donate-method-connectors[data-active-method="arkade"], [data-donate-connector="arkade"] { --donate-connection-color: #608aff; }
.donate-method-connectors[data-active-method="ecash"], [data-donate-connector="ecash"] { --donate-connection-color: #bd914f; }
.donate-method-connectors[data-active-method="silent-payments"], [data-donate-connector="silent-payments"] { --donate-connection-color: #20ac96; }
.donate-method-connectors[data-active-method="onchain"], [data-donate-connector="onchain"] { --donate-connection-color: #f7931a; }
.donate-method-connectors[data-active-method="rootstock"], [data-donate-connector="rootstock"] { --donate-connection-color: #ed7051; }
.donate-method-connectors .donate-connector-branch.is-active {
  opacity: 1;
  stroke-width: 3.5;
  animation: donate-connection-pulse 2.4s ease-in-out infinite;
  animation-play-state: paused;
}
.donate-method-connectors.is-animating .donate-connector-branch.is-active { animation-play-state: running; }
@keyframes donate-connection-pulse {
  0%, 100% { opacity: .55; stroke-width: 2.25; }
  50% { opacity: 1; stroke-width: 4.5; }
}
@media (prefers-reduced-motion: reduce) {
  .donate-method-connectors .donate-connector-branch.is-active { animation: none; }
}
.donate-connector-disabled {
  stroke: var(--muted) !important;
  opacity: .52;
}

.donate-method-options { width: 100%; min-width: 0; }

.donate-method-tabs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  /* Auto rows let future verified methods extend the selector without a new
     desktop or mobile row-count rule; the SVG then only needs matching paths. */
  grid-auto-rows: 52px;
  gap: 8px;
}

.donate-method-tab {
  --donate-accent: var(--blue);
  width: 100%;
  max-width: none;
  min-height: 52px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--ink);
  font-size: var(--minimum-text-size);
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
}

#donate-tab-lightning { --donate-accent: #7b1cff; }
#donate-tab-arkade { --donate-accent: #4f2ab8; }
#donate-tab-ecash { --donate-accent: #b88a4a; }
#donate-tab-silent-payments { --donate-accent: #159b7e; }
#donate-tab-onchain { --donate-accent: #f7931a; }
#donate-tab-rootstock { --donate-accent: #ff931e; }
#donate-tab-liquid { --donate-accent: #7e8993; }

.donate-method-tab:hover:not([aria-disabled="true"]) {
  border-color: var(--donate-accent);
  background: var(--button-hover);
}

.donate-method-tab.is-active,
.donate-method-tab[aria-selected="true"] {
  border-color: var(--donate-accent);
  box-shadow: inset 0 -3px 0 var(--donate-accent);
  background: var(--surface-subtle);
}

.donate-method-tab-disabled,
.donate-method-tab[aria-disabled="true"] {
  border-style: dashed;
  background: var(--surface-subtle);
  color: var(--muted);
  cursor: help;
  opacity: .72;
}

.donate-method-tab:focus-visible,
.donate-panel:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.donate-method-icon {
  position: relative;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  object-fit: cover;
}

.donate-icon-lightning { border-radius: 50%; }
.donate-icon-onchain { border-radius: 50%; }
.donate-icon-rootstock {
  padding: 4px;
  background: #17191d;
  object-fit: contain;
}

.donate-icon-liquid {
  border: 1px solid var(--field-border);
  background: var(--stripe);
  color: var(--muted);
  font-size: var(--minimum-text-size);
  letter-spacing: -.03em;
}

.donate-method-option {
  position: relative;
  width: 100%;
  height: 52px;
}

.donate-method-option > .donate-method-tab { height: 100%; }

.donate-method-tooltip {
  position: absolute;
  z-index: 40;
  top: 0;
  right: calc(100% + 12px);
  left: auto;
  width: min(340px, calc(100vw - 28px));
  padding: 12px 14px;
  border: 1px solid var(--field-border);
  border-right: 3px solid var(--donate-accent, var(--orange));
  border-radius: 10px;
  background: var(--surface-raised);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .32);
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 550;
  line-height: 1.38;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease, visibility .14s;
}

#donate-tab-lightning + .donate-method-tooltip { --donate-accent: #7b1cff; }
#donate-tab-arkade + .donate-method-tooltip { --donate-accent: #4f2ab8; }
#donate-tab-ecash + .donate-method-tooltip { --donate-accent: #b88a4a; }
#donate-tab-silent-payments + .donate-method-tooltip { --donate-accent: #159b7e; }
#donate-tab-onchain + .donate-method-tooltip { --donate-accent: #f7931a; }
#donate-tab-rootstock + .donate-method-tooltip { --donate-accent: #ff931e; }
#donate-tab-liquid + .donate-method-tooltip { --donate-accent: #7e8993; }

.donate-method-option:nth-child(n + 5) > .donate-method-tooltip {
  top: auto;
  bottom: 0;
}

.donate-method-tooltip strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: var(--minimum-text-size);
  letter-spacing: .02em;
}

.donate-method-facts {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.donate-method-facts th,
.donate-method-facts td {
  padding: 4px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
  vertical-align: top;
}

.donate-method-facts tr:last-child th,
.donate-method-facts tr:last-child td { border-bottom: 0; }
.donate-method-facts th {
  width: 98px;
  padding-right: 10px;
  color: var(--ink);
  font-weight: 780;
  text-align: left;
}
.donate-method-facts td { color: var(--muted); font-weight: 620; }
.donate-method-facts .donate-fact-positive {
  color: color-mix(in srgb, var(--green) 90%, black);
}
.donate-method-facts .donate-fact-negative {
  color: color-mix(in srgb, var(--red) 90%, black);
}
.donate-method-tooltip p {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.donate-method-tooltip::after {
  position: absolute;
  top: 0;
  right: -12px;
  width: 12px;
  height: 100%;
  content: "";
}

.donate-method-tab:hover + .donate-method-tooltip,
.donate-method-tab:focus-visible + .donate-method-tooltip,
.donate-method-tooltip:hover,
.donate-method-tooltip:focus-within {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.donate-method-tooltip a {
  color: var(--link);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.donate-method-tooltip a:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.donate-panels { min-height: 364px; }

.donate-panel {
  width: min(100%, 416px);
  margin: 0 auto;
  padding: 18px;
  display: grid;
  justify-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-subtle);
}

.donate-panel[hidden] { display: none; }
.donate-qr-recovery[hidden] { display: none; }
.donate-qr-frame[hidden] { display: none; }
.donate-qr-recovery { max-width: 360px; text-align: center; }
.donate-qr-recovery p { color: var(--muted); line-height: 1.5; }

.donate-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.donate-actions button, .donate-actions a, .donate-qr-recovery button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--ink);
  font: inherit;
  font-size: var(--minimum-text-size);
  font-weight: 650;
  cursor: pointer;
}
.donate-actions a { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.donate-actions a:hover { border-color: var(--blue); background: var(--button-hover); }
.donate-actions a:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.donate-actions a[aria-disabled="true"] { opacity: .5; cursor: wait; }
.donate-wallet-help { max-width: 440px; margin: 2px 0 8px; color: var(--muted); font-size: var(--minimum-text-size); line-height: 1.5; text-align: center; }
.donate-actions button:hover:not(:disabled), .donate-qr-recovery button:hover { border-color: var(--blue); background: var(--button-hover); }
.donate-actions button:focus-visible, .donate-qr-recovery button:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.donate-actions button:disabled { opacity: .5; cursor: wait; }
.donate-actions button.is-copied,
.donate-actions button.is-copied:hover {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}
.donate-actions button.is-copied::before { content: "✓ "; }
.donate-actions [hidden], .donate-copy-value[hidden], .donate-copy-status[hidden] { display: none; }
.donate-copy-value {
  width: 100%;
  min-width: 0;
  min-height: 80px;
  padding: 10px;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--field-ink);
  font-size: 16px;
  overflow-wrap: anywhere;
  resize: vertical;
  user-select: text;
}
.donate-copy-status { margin: 0; color: var(--muted); font-size: var(--minimum-text-size); line-height: 1.5; }
.donate-copy-dialog {
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 20px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  text-align: center;
}
.donate-copy-dialog::backdrop { background: rgba(0, 0, 0, .75); }
.donate-copy-dialog h3 { margin: 0 0 16px; }
.donate-copy-dialog img { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto; border-radius: 10px; }
.donate-copy-dialog p { margin: 16px 0 8px; }
.donate-copy-dialog small { display: block; color: var(--muted); }
.donate-copy-dialog button { margin-top: 16px; min-height: 44px; padding: 8px 20px; }

.donate-qr-frame {
  position: relative;
  width: 252px;
  height: 252px;
  padding: 0;
  overflow: hidden;
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .2), 0 8px 24px rgba(0, 0, 0, .12);
  cursor: zoom-in;
  transition: box-shadow .16s ease;
}

.donate-qr-frame { outline: 5px solid var(--orange); outline-offset: 5px; margin: 18px 10px; }
.donate-qr-frame::before { content: "₿"; position: absolute; inset: auto 0 0 auto; z-index: 1; width: 22px; height: 22px; border-radius: 50%; background: var(--orange); color: #16191b; font: bold 17px/22px Arial; pointer-events: none; }
.donate-qr-frame:hover { box-shadow: 0 0 0 2px var(--blue), 0 10px 28px rgba(0, 0, 0, .2); }
.donate-qr-frame:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
.donate-qr-frame-dynamic:disabled {
  display: grid;
  place-items: center;
  border: 1px dashed var(--field-border);
  background: var(--surface-raised);
  box-shadow: none;
  cursor: wait;
}

.donate-qr-frame-dynamic:disabled::after {
  width: 28px;
  height: 28px;
  border: 3px solid var(--field-border);
  border-top-color: var(--orange);
  border-radius: 50%;
  content: "";
  animation: donate-qr-spin .8s linear infinite;
}

.donate-qr-frame-dynamic[aria-busy="false"]:disabled::after { display: none; }
@keyframes donate-qr-spin { to { transform: rotate(360deg); } }

.donate-qr-backdrop {
  position: fixed;
  z-index: 999;
  inset: 0;
  border: 0;
  background: rgba(4, 8, 12, .8);
  cursor: zoom-out;
  backdrop-filter: blur(2px);
}

.donate-qr-backdrop[hidden] { display: none; }
body.donate-qr-open { overflow: hidden; }

.donate-qr-frame.is-expanded {
  position: fixed;
  z-index: 1000;
  top: 50%;
  left: 50%;
  width: min(82vmin, 520px);
  height: min(82vmin, 520px);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 24px 80px rgba(0, 0, 0, .58);
  cursor: zoom-out;
}

.donate-qr-source {
  position: absolute;
  display: block;
  max-width: none;
  height: auto;
}

/* Clean QR-only SVGs. The motif sits outside their four-module quiet zone. */
.donate-qr-frame .donate-qr-source { inset: 10%; width: 80%; height: 80%; object-fit: contain; }
.donate-qr-lightning { inset: 0; width: 100%; height: 100%; object-fit: contain; }
.donate-qr-arkade { inset: 0; width: 100%; height: 100%; object-fit: contain; }
.donate-qr-ecash { inset: 0; width: 100%; height: 100%; object-fit: contain; }
.donate-qr-silent { inset: 0; width: 100%; height: 100%; object-fit: contain; }
.donate-qr-onchain { inset: 0; width: 100%; height: 100%; object-fit: contain; }
.donate-qr-rootstock { inset: 0; width: 100%; height: 100%; object-fit: contain; }

.donate-onchain-status {
  width: min(100%, 360px);
  margin: 0;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  font-weight: 650;
  line-height: 1.45;
  text-align: center;
}

.donate-onchain-status[hidden] { display: none; }

.donate-panel-note {
  width: min(100%, 440px);
  margin: 8px 0 0;
  color: var(--muted);
  font-size: var(--minimum-text-size);
  line-height: 1.5;
  text-align: center;
}

.donate-panel-note a {
  color: var(--link);
  font-weight: 700;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.donate-panel-note a:hover { text-decoration-thickness: 2px; }
.donate-panel-note a:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 700px) {
  .donate-section { padding-top: 20px; }
  .donate-payment-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .donate-method-map {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 10px;
  }
  .donate-bitcoin-root {
    width: auto;
    height: auto;
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  .donate-bitcoin-root img { width: 52px; height: 52px; }
  .donate-bitcoin-root strong { position: static; font-size: var(--minimum-text-size); transform: none; }
  .donate-method-connectors { display: none; }
  .donate-method-options { width: 100%; }
  .donate-method-tabs {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 52px;
    gap: 6px;
  }
  .donate-method-tab { min-width: 0; padding-inline: 8px; justify-content: center; }
  .donate-method-tooltip,
  .donate-method-option:nth-child(n + 5) > .donate-method-tooltip {
    top: calc(100% + 6px);
    right: auto;
    bottom: auto;
    left: 0;
    width: min(430px, calc(100vw - 34px));
  }
  .donate-method-option:nth-child(even) > .donate-method-tooltip {
    right: 0;
    left: auto;
  }
  .donate-method-tooltip::after {
    top: -6px;
    right: 0;
    width: 100%;
    height: 6px;
  }
  .donate-panel { width: 100%; padding-inline: 12px; }
  .donate-qr-frame.is-expanded { width: min(88vw, 480px); height: min(88vw, 480px); }
}

@media (min-width: 701px) and (max-width: 1049px) {
  .donate-method-tooltip,
  .donate-method-option:nth-child(n + 5) > .donate-method-tooltip {
    top: calc(100% + 6px);
    right: 0;
    bottom: auto;
    left: auto;
    width: min(340px, calc(100vw - 28px));
  }
  .donate-method-tooltip::after {
    top: -6px;
    right: 0;
    width: 100%;
    height: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .donate-qr-frame-dynamic:disabled::after { animation: none; }
  .donate-method-tooltip { transition: none; }
}

@media (max-width: 1799px) {
  .summary-overview-grid { grid-template-columns: minmax(0, 1fr); }
  .summary-overview-grid > .summary-table {
    width: min(100%, 720px);
    min-height: 0;
    margin-inline: auto;
  }
  .summary-overview-grid > .current-period-summary-grid { grid-column: auto; }
}

@media (max-width: 760px) {
  .shell { width: min(100% - 22px, 1120px); }
  .topbar-inner { min-height: 58px; }
  .progress-panel.is-manual-refresh { top: 66px; right: 11px; width: calc(100vw - 22px); }
  .privacy { font-size: 0; }
  .privacy-dot { width: 9px; height: 9px; }
  .processed-btc { padding-right: 8px; }
  .processed-btc span { display: none; }
  .intro { padding-top: 25px; }
  .address-form { display: grid; gap: 7px; }
  .address-form input, .primary-button { width: 100%; border: 1px solid var(--field-border); border-radius: 5px; }
  .primary-button { min-height: 44px; }
  .search-meta { align-items: flex-start; }
  .section-heading, .chart-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .toolbar { justify-content: flex-start; width: 100%; }
  .segmented:first-child { flex: 1; }
  .segmented:first-child button { flex: 1; padding-inline: 8px; }
  .range-row { flex-wrap: wrap; }
  .chart-count { width: 100%; margin-left: 0; }
  .chart-wrap { height: 330px; }
  .firefish-milestone-axis-label { height: 18px; padding-inline: 2px; font-size: var(--minimum-text-size); line-height: 18px; }
  .firefish-milestone-marker.is-major > .firefish-milestone-axis-label { font-size: 14px; }
  .chart-legend { align-items: flex-start; flex-direction: column; }
  .heatmap-heading { align-items: flex-start; flex-direction: column; }
  .heat-scale { width: 100%; text-align: left; }
  .heat-scale-items { justify-content: flex-start; }
  .podium { min-height: 185px; gap: 5px; }
  .podium-place { padding-inline: 6px; }
  .podium-place.place-1 { min-height: 185px; }
  .podium-place.place-2 { min-height: 160px; }
  .podium-place.place-3 { min-height: 145px; }
  .podium-place strong { font-size: 15px; }
  .podium-place b { font-size: var(--minimum-text-size); overflow-wrap: anywhere; }
  .summary-row { grid-template-columns: 120px minmax(0, 1fr); padding-inline: 10px; gap: 8px; }
  .current-period-summary-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .current-period-summary-heading p { text-align: left; }
  .current-period-summary-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    row-gap: 10px;
  }
  .current-period-card {
    height: auto;
    grid-row: auto;
    grid-template-rows: 52px auto;
  }
  .current-period-card dl {
    display: block;
    grid-row: auto;
  }
  .collateral-history-stats { grid-template-columns: 1fr; }
  .collateral-history-stats > span { border-right: 0; border-bottom: 1px solid var(--line); }
  .collateral-history-stats > span:last-child { border-bottom: 0; }
  .collateral-history-trend-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .collateral-history-trend-heading small { max-width: none; text-align: left; }
  .collateral-history-trends { grid-template-columns: minmax(0, 1fr); }
  .collateral-history-trend-card { border-right: 0; border-bottom: 1px solid var(--line); }
  .collateral-history-trend-card:last-child { border-bottom: 0; }
  .collateral-history-wrap { height: 330px; }
  .collateral-history-legend { align-items: flex-start; flex-direction: column; gap: 7px; }
  .collateral-history-legend small { margin-left: 0; }
  .firefish-brand-panel { align-items: flex-start; flex-direction: column; gap: 14px; }
  .value-kind-legend { justify-content: flex-start; }
  .tracked-addresses { grid-template-columns: 1fr; }
  .fee-rate-heading { align-items: flex-start; flex-direction: column; }
  .fee-rate-heading label { width: 100%; flex-basis: auto; }
  .fee-rate-summary-grid { grid-template-columns: 1fr; }
  .fee-rate-summary-grid article:first-child { border-right: 0; border-bottom: 1px solid var(--line); }
  .fee-rate-chart-wrap { height: 320px; }
  .fee-rate-legend .muted { width: 100%; margin-left: 0; }
  .fee-rate-detail-table thead { display: none; }
  .fee-rate-detail {
    width: 100%;
    left: auto;
    transform: none;
  }
  .fee-rate-detail-table,
  .fee-rate-detail-table tbody { display: block; width: 100%; }
  .fee-rate-detail-table tr {
    padding: 7px 9px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
    border-bottom: 1px solid var(--soft-line);
  }
  .fee-rate-detail-table tbody tr:last-child { border-bottom: 0; }
  .fee-rate-detail-table td,
  .fee-rate-detail-table td.numeric {
    width: auto;
    padding: 6px 0;
    display: block;
    border-bottom: 0;
    text-align: left;
  }
  .fee-rate-detail-table td:first-child {
    grid-column: 1 / -1;
    padding-bottom: 9px;
    border-bottom: 1px dashed var(--soft-line);
  }
  .fee-rate-detail-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: var(--minimum-text-size);
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .firefish-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .firefish-model-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .firefish-model-summary > *:nth-child(2) { border-right: 0; }
  .firefish-model-summary > *:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .methodology-grid { grid-template-columns: 1fr; }
  .methodology-grid article:nth-last-child(2) { border-bottom: 1px solid var(--soft-line); }
  .source-box { grid-template-columns: 1fr; gap: 10px; }
  .source-links { justify-content: flex-start; }
  .cpfp-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cpfp-summary > div:nth-child(2) { border-right: 0; }
  .cpfp-summary > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .topup-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topup-summary-grid > div:nth-child(2) { border-right: 0; }
  .topup-summary-grid > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .topup-controls { justify-content: flex-start; }
  .topup-controls label { flex: 1 1 190px; }
  .topup-controls select { width: 100%; min-width: 0; }
  .transactions-table { min-width: 780px; }
  .transactions-section > .table-scroll:has(.firefish-history-table) {
    overflow-x: visible;
    border: 0;
    background: transparent;
  }
  .transactions-table.firefish-history-table,
  .transactions-table.firefish-history-table tbody {
    width: 100%;
    min-width: 0;
    display: block;
  }
  .transactions-table.firefish-history-table thead { display: none; }
  .transactions-table.firefish-history-table tbody {
    display: grid;
    gap: 10px;
  }
  .transactions-table.firefish-history-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--line);
    background-color: var(--surface);
  }
  .transactions-table.firefish-history-table td,
  .transactions-table.firefish-history-table td.numeric {
    min-width: 0;
    padding: 10px;
    display: block;
    border-bottom: 1px solid var(--soft-line);
    white-space: normal;
    text-align: left;
    overflow-wrap: anywhere;
  }
  .transactions-table.firefish-history-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: var(--minimum-text-size);
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
  }
  .transactions-table.firefish-history-table .history-transactions-cell { grid-column: 1 / -1; }
  .transactions-table.firefish-history-table td:last-child { border-bottom: 0; }
  .transactions-table.firefish-history-table .txid-link {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-all;
  }
  .loan-scatter-explainer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loan-scatter-explainer > div:nth-child(2) { border-right: 0; }
  .loan-scatter-explainer > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .loan-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loan-scatter-wrap { height: 420px; }
  .loan-monthly-heading-meta { width: 100%; align-items: stretch; justify-content: flex-start; flex-direction: column; }
  .loan-monthly-granularity-control { width: 100%; }
  .loan-monthly-granularity-control select { width: 100%; }
  .loan-monthly-chart-wrap { height: 384px; }
  .loan-rate-history-chart-wrap { height: 330px; }
  .investor-control-panel { grid-template-columns: minmax(0, 1fr); }
  .investor-tenor-field { grid-column: auto; }
  .investor-chip-group { flex-wrap: wrap; }
  .investor-chip-group button { min-height: 34px; flex: 1 1 30%; }
  .investor-optimal-rate-card { padding: 13px; }
  .investor-optimal-rate-primary > strong { font-size: 26px; }
  .investor-optimal-rate-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .investor-optimal-rate-facts > div { padding: 7px 8px; }
  .investor-period-cards { grid-template-columns: minmax(0, 1fr); }
  .investor-rate-chart-wrap { height: 330px; }
  .loan-activity-controls { width: 100%; }
  .loan-activity-panel-heading { align-items: flex-start; flex-direction: column; }
  .loan-daily-heatmap-wrap { height: 146px; }
  .loan-hourly-heatmap-wrap { height: 224px; }
  .rpsn-chart-wrap { height: 390px; }
  .loan-scatter-legend .scatter-size-note { width: 100%; margin-left: 0; }
  .cpfp-summary-row { align-items: flex-start; }
  .chart-style-control { min-width: 180px; }
  .monthly-controls { margin-top: -4px; justify-content: flex-start; }
  .history-toolbar { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .history-type-control { flex: 1; }
  .history-type-control select { width: 100%; min-width: 0; }
  .history-completed-control { flex: 0 1 auto; }
  .history-term-toolbar { align-items: stretch; }
  .history-term-control { flex: 1 1 180px; }
  .history-term-control select { width: 100%; min-width: 0; }
  .history-date-sort-control { margin-left: 0; }
  .history-interest-control { flex: 1 1 210px; }
  .history-interest-range label { flex: 1; }
  .history-interest-range input { width: 100%; }
  .history-term-actions { flex: 1 1 100%; }
  .history-filter-reset { flex: 1; }
  .history-columns-control { flex: 1 1 100%; width: 100%; }
  .history-columns-control > summary { width: 100%; }
  .history-columns-menu {
    position: static;
    width: 100%;
    margin-top: 6px;
    box-shadow: none;
  }
  .tx-search { flex: 1 1 100%; }
  .tx-search input { width: 100%; }
  .history-liquidation-report-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .history-liquidation-report-heading p { max-width: none; text-align: left; }
  .history-liquidation-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-liquidation-report-grid > div:nth-child(2) { border-right: 0; }
  .history-liquidation-report-grid > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
}

/* The history toolbar must never squeeze its heading into a narrow side
   column. Below the desktop table breakpoint the title owns the full first
   row and all filters start on the following row. */
@media (max-width: 999px) {
  .transactions-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .transactions-heading > div:first-child { width: 100%; min-width: 0; }
  .transactions-heading .history-toolbar {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .history-date-sort-control { margin-left: 0; }
}

/* The three metrics are still fully readable through their values and
   tooltips. Hiding only their repeated captions keeps every topbar control
   on the desktop row after the current-escrow metric was added. */
@media (max-width: 2050px) {
  .processed-btc span { display: none; }
}

@media (max-width: 1600px) {
  .live-controls { gap: 4px; padding-inline: 5px; }
  .mempool-volume input { width: 44px; }
  .mempool-volume output { display: none; }
}

/* Prefer a full controls row at narrow widths. Above this breakpoint the
   intrinsic flex basis still wraps the group whenever its actual text does
   not fit; this breakpoint is not an overflow safety boundary. */
@media (max-width: 1440px) {
  .topbar-inner { flex-wrap: wrap; }
  .topbar-actions {
    flex: 1 1 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* On desktop the product mark belongs to the viewport edge, while wrapped
   controls retain a comfortable gutter on the row below it. */
@media (min-width: 761px) {
  .topbar .shell { padding-left: 0; }
}

@media (min-width: 761px) and (max-width: 1440px) {
  .topbar-actions { padding-left: 16px; }
}

@media (max-width: 480px) {
  .summary-overview-grid > .summary-table .summary-row { grid-template-columns: minmax(0, 1fr); }
  .summary-overview-grid > .summary-table .summary-row > :last-child { text-align: left; }
  #rpsn-chart { min-width: 0; }
  .chart-tooltip.loan-activity-tooltip > .loan-monthly-tooltip-series { white-space: normal; }
  .loan-activity-panel { padding: 8px; }
  .loan-activity-summary { align-items: flex-start; flex-direction: column; }
  .loan-activity-heat-scale { width: 100%; justify-content: flex-start; }
  .loan-daily-heatmap-wrap { height: 142px; }
  .loan-hourly-heatmap-wrap { height: 214px; }
  .transactions-table.firefish-history-table tr { grid-template-columns: minmax(0, 1fr); }
  .transactions-table.firefish-history-table td { grid-column: 1; }
  .history-columns-list { grid-template-columns: minmax(0, 1fr); }
  .history-liquidation-report-grid { grid-template-columns: minmax(0, 1fr); }
  .history-liquidation-report-grid > div,
  .history-liquidation-report-grid > div:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .history-liquidation-report-grid > div:last-child { border-bottom: 0; }
  .topbar-actions { gap: 8px; }
  .brand-firefish-word {
    height: 32px;
    -webkit-mask-size: 144px 32px;
    mask-size: 144px 32px;
  }
  .brand-firefish-word { width: 91px; }
  .brand-firefish-symbol { width: 78px; height: 32px; }
  .brand-insight { margin-left: 6px; font-size: 27px; }
  .theme-toggle { width: 34px; padding-inline: 0; justify-content: center; }
  #theme-toggle-label { display: none; }
  .privacy { display: none; }
  .market-control { gap: 5px; padding-left: 7px; }
  .current-btc-price { max-width: 112px; overflow: hidden; text-overflow: ellipsis; }
  h1 { font-size: 20px; }
  .lead { font-size: 13px; }
  .search-meta { flex-direction: column; gap: 3px; }
  .summary-row { grid-template-columns: 1fr; gap: 2px; }
  .summary-row > :last-child { text-align: left; }
  .firefish-brand-panel { padding: 16px 14px; }
  .firefish-brand-identity { width: 100%; align-items: flex-start; flex-direction: column; gap: 10px; }
  .firefish-brand-identity > span { padding: 8px 0 0; border-top: 1px solid #42484c; border-left: 0; }
  .firefish-brand-panel .value-kind-legend { display: grid; justify-content: stretch; }
  .firefish-brand-panel .value-badge { justify-content: center; }
  .tracked-address-card { grid-template-columns: minmax(0, 1fr); }
  .tracked-address-identity { align-items: flex-start; flex-direction: column; gap: 3px; }
  .tracked-address-card a, .tracked-address-flow { grid-column: 1; }
  .tracked-address-flow { grid-template-columns: minmax(0, 1fr); }
  .tracked-address-stat { padding: 4px 0; }
  .tracked-address-stat + .tracked-address-stat { border-top: 1px solid var(--line); border-left: 0; }
  .fee-rate-card { padding: 13px; }
  .fee-rate-chart-wrap { height: 290px; }
  .fee-rate-detail-heading { flex-direction: column; }
  .fee-rate-detail-limit-control { width: 100%; margin-left: 0; flex-basis: auto; }
  .fee-rate-detail-table tr { grid-template-columns: 1fr; }
  .fee-rate-detail-table td:first-child { grid-column: auto; }
  .model-card-heading { flex-direction: column; gap: 9px; }
  .firefish-controls, .firefish-model-summary, .cpfp-summary, .topup-summary-grid { grid-template-columns: 1fr; }
  .firefish-model-summary > *, .firefish-model-summary > *:nth-child(2),
  .cpfp-summary > div, .cpfp-summary > div:nth-child(2),
  .topup-summary-grid > div, .topup-summary-grid > div:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .firefish-model-summary > *:last-child, .cpfp-summary > div:last-child, .topup-summary-grid > div:last-child { border-bottom: 0; }
  .methodology-content { padding: 13px; }
  .source-links { align-items: stretch; flex-direction: column; }
  .source-links a { text-align: center; }
  .cpfp-controls { align-items: stretch; flex-direction: column; gap: 3px; }
  .cpfp-controls select { width: 100%; }
  .secondary-analyses-toggle { align-items: flex-start; justify-content: flex-start; flex-wrap: wrap; gap: 9px 12px; padding: 12px; }
  .secondary-analyses-toggle-action { width: 100%; padding-left: 40px; }
  .cpfp-summary-toggle { padding: 12px; }
  .cpfp-summary-row { width: calc(100% - 20px); align-items: flex-start; flex-direction: column; gap: 5px; }
  .cpfp-summary-title { font-size: 17px; }
  .cpfp-details-content, .topup-details-content { padding: 11px; }
  .cpfp-details-link-row { justify-content: flex-start; }
  .topup-controls { align-items: stretch; flex-direction: column; gap: 7px; }
  .topup-controls label { flex: 0 1 auto; width: 100%; }
  .topup-controls select { width: 100%; }
  .topup-chart-wrap { height: 360px; }
  .chart-style-control { width: 100%; }
  .chart-style-control select { width: 100%; min-width: 0; }
  .history-completed-control { width: 100%; justify-content: flex-start; }
  .pagination { align-items: flex-start; flex-direction: column; }
  .pagination-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .loan-scatter-explainer, .loan-filter-grid { grid-template-columns: 1fr; }
  .loan-principal-range { grid-column: auto; }
  .loan-scatter-explainer > div, .loan-scatter-explainer > div:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .loan-scatter-explainer > div:last-child { border-bottom: 0; }
  .loan-scatter-wrap { height: 360px; }
  .loan-monthly-chart-wrap { height: 356px; }
  .loan-rate-history-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .loan-rate-history-chart-wrap { height: 300px; }
  .segmented { width: 100%; }
  .range-buttons { width: 100%; }
  .range-buttons button { flex: 1; }
  .chart-wrap { height: 290px; }
  .podium { grid-template-columns: 1fr; align-items: stretch; }
  .podium-place, .podium-place.place-1, .podium-place.place-2, .podium-place.place-3 { min-height: 0; order: initial; }
  .podium-place.place-1 { order: 1; padding-top: 80px; }
  .podium-place.place-2 { order: 2; padding-top: 80px; }
  .podium-place.place-3 { order: 3; padding-top: 80px; }
  .monthly-controls { align-items: stretch; flex-direction: column; gap: 4px; }
  .monthly-controls select { width: 100%; min-width: 0; }
}

/* One plot: monthly labels sit directly below it, without a BTC sub-panel. */
@media (min-width: 481px) and (max-width: 643.99px) {
  .loan-monthly-chart-wrap { height: 384px; }
}

/* Desktop readability preset
   --------------------------
   A web page cannot set the browser's per-site zoom.  At 100% browser zoom,
   this preset reproduces the useful parts of a 125% view with normal layout
   dimensions instead: larger type above, roomier controls and vertical
   rhythm here, and taller (still full-width) chart canvases.  Deliberately do
   not use `zoom` or a transform on an ancestor: both make canvas coordinates
   and pointer hit-testing fragile.  Keeping the preset behind this desktop
   breakpoint leaves the tablet/mobile layout unchanged. */
@media (min-width: 1200px) {
  :root {
    --desktop-control-xs: 34px;
    --desktop-control-compact: 39px;
    --desktop-control-small: 42px;
    --desktop-control-medium: 44px;
    --desktop-control-default: 48px;
    --desktop-control-large: 58px;
    --desktop-space-small: 10px;
    --desktop-space-medium: 15px;
    --desktop-space-large: 20px;
    --desktop-space-section: 25px;
  }

  /* Keep the brand and the page content on the same left edge. A 1680 px layout
     seen at 125% occupies about 2100 physical pixels. This
     wider cap keeps chart panels broad instead of producing an artificial
     narrow column at normal browser zoom. */
  .shell { width: min(2100px, calc(100% - 40px)); }
  .topbar .shell { padding-inline: 0; }
  .topbar-inner { min-height: 82px; padding-block: 10px; gap: 12px; }
  .topbar-actions { gap: var(--desktop-space-small); }

  .intro { padding: 42px 0 26px; }
  #dashboard > section,
  #dashboard > details { padding: 36px 0 45px; }
  .section-heading { margin-bottom: var(--desktop-space-large); gap: var(--desktop-space-section); }
  .current-period-summary { margin-top: var(--desktop-space-section); }
  .loan-monthly-section,
  .loan-activity-heatmaps,
  .rpsn-analysis { margin-top: 30px; padding-top: 28px; }

  /* Compact top-bar and chart controls. */
  .processed-btc,
  .theme-toggle,
  .language-control select,
  .market-control,
  .live-controls,
  .loan-scatter-axis-toggle,
  .investor-wait-legend { min-height: var(--desktop-control-small); }
  .market-control select,
  .mempool-sound-toggle { width: 31px; height: 31px; }
  .market-control select { width: auto; min-width: 85px; }
  .rpsn-axis-toggle button { min-height: var(--desktop-control-xs); }
  .rpsn-zoom-reset { min-height: var(--desktop-control-small); }
  .page-size-control select { min-height: var(--desktop-control-compact); }

  /* Standard form controls.  Fixed heights are overridden explicitly so the
     larger glyphs never get clipped inside fields. */
  .segmented button,
  .monthly-controls select,
  .topup-controls select,
  .chart-style-control select,
  .cpfp-controls select,
  .tx-search input,
  .history-type-control select,
  .history-completed-control select,
  .history-columns-control > summary { height: var(--desktop-control-medium); }
  .fee-rate-heading select { height: 45px; }
  .fee-rate-detail-limit-control select { height: var(--desktop-control-small); }
  .firefish-controls select,
  .firefish-controls input,
  .loan-filter-field input,
  .loan-filter-field select,
  .investor-control-field input,
  .investor-control-field select,
  .history-term-control select,
  .history-interest-range input { height: var(--desktop-control-default); }
  .loan-checkbox-field,
  .loan-filter-reset,
  .investor-chip-group,
  .history-filter-reset { min-height: var(--desktop-control-default); }
  .loan-filter-panel .loan-filter-field input,
  .loan-filter-panel .loan-filter-field select { height: 40px; }
  .loan-filter-panel .loan-filter-reset { min-height: 40px; }
  .address-form input { height: var(--desktop-control-large); }

  /* Card and table rhythm follows the same preset while percentage/grid
     widths remain untouched. */
  .summary-row { min-height: 65px; padding: 11px 18px; gap: var(--desktop-space-large); }
  .balance-row { min-height: 81px; }
  .summary-overview-grid { gap: 13px; }
  .current-period-summary-grid { gap: 13px; }
  @supports not (grid-template-rows: subgrid) {
    .current-period-card { grid-template-rows: 52px minmax(0, 1fr); }
  }
  @supports (grid-template-rows: subgrid) {
    .current-period-summary-grid {
      grid-template-rows: 52px repeat(9, minmax(min-content, auto));
      column-gap: 13px;
      row-gap: 0;
    }
    .current-period-card { grid-template-rows: subgrid; }
  }
  .current-period-card header { padding: 6px 15px; }
  .current-period-card dl > div { padding: 5px 14px; gap: var(--desktop-space-small); }
  .firefish-brand-panel { min-height: 95px; margin-bottom: 34px; padding: 23px 25px; gap: 30px; }
  .tracked-address-card { min-height: 55px; padding: 10px 15px; gap: var(--desktop-space-medium); }
  .firefish-model-summary > * { min-height: 88px; padding: 14px 15px; }
  .loan-scatter-explainer > div { min-height: 81px; padding: 13px 15px; gap: 11px; }
  .data-table th,
  .data-table td { padding: 11px 13px; }
  .transactions-table.firefish-history-table th,
  .transactions-table.firefish-history-table td {
    height: 38px;
    padding: 3px 5px;
  }
  .transactions-table.firefish-history-table tbody tr { height: 38px; }
  .history-term-toolbar { margin-bottom: var(--desktop-space-medium); padding: 13px; gap: 11px; }
  .history-column-option { min-height: 38px; padding: 6px 8px; gap: 9px; }
  .history-liquidation-report-grid > div { min-height: 95px; padding: 14px 15px; }
  .pagination { padding: 13px 3px; gap: 23px; }
  .pagination button { min-height: 38px; padding: 8px 13px; }
  .pagination-actions { gap: 9px; }
  .investor-control-panel { padding: var(--desktop-space-large); gap: var(--desktop-space-medium); }
  .investor-optimal-rate-card {
    margin-top: var(--desktop-space-medium);
    padding: 18px 20px;
    gap: 15px 28px;
  }
  .investor-optimal-rate-facts > div { padding: 6px 14px; }
  .investor-optimal-rate-evidence { padding-top: 11px; }
  .investor-overview-grid { margin-top: var(--desktop-space-medium); gap: var(--desktop-space-medium); }
  .investor-recommendation { padding: 16px 19px; }
  .investor-period-cards { gap: var(--desktop-space-small); }
  .investor-period-cards > article { padding: var(--desktop-space-medium); }

  /* Only canvas container height changes.  Width stays at 100%, so the chart
     code receives honest DOM dimensions and pointer coordinates. */
  .collateral-history-wrap { height: 513px; }
  .fee-rate-chart-wrap { height: 425px; }
  .loan-scatter-wrap { height: 600px; }
  .loan-monthly-chart-wrap { height: 408px; }
  .loan-rate-history-chart-wrap { height: 475px; }
  .investor-rate-chart-wrap { height: 488px; }
  .loan-daily-heatmap-wrap { height: 150px; }
  .loan-hourly-heatmap-wrap { height: 295px; }
  .rpsn-chart-wrap { height: 538px; }
  .chart-wrap { height: 525px; }
  .heatmap-wrap { height: 68px; }
  .topup-chart-wrap { height: 450px; }
}

/* Larger summary type needs wider cards; retain one-line period headings. */
@media (min-width: 1200px) and (max-width: 1399px) {
  .current-period-summary-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; row-gap: 13px; }
  .current-period-card { height: auto; grid-row: auto; grid-template-rows: 52px auto; }
  .current-period-card dl { display: block; grid-row: auto; }
}
@media (max-width: 480px) {
  .current-period-card header { padding-inline: 6px; gap: 6px; }
}
.btc-price-source { color: #efce55; }
.refresh-feedback { max-width: 290px; font-size: var(--minimum-text-size); line-height: 1.4; color: var(--muted); }
.refresh-feedback[data-state="error"] { color: var(--red, #ed8580); }
.monthday-panel { margin-top: 18px; }
.monthday-controls { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:15px 0; }
.monthday-controls label { display:flex; align-items:center; gap:8px; font-size: var(--minimum-text-size); color:var(--muted); }
.monthday-controls select { max-width:260px; }
.monthday-controls select,.monthday-controls input[type="number"]{min-height:38px;border:1px solid var(--field-border);border-radius:7px;background:var(--field-bg);color:var(--field-ink);padding:7px 10px;font:inherit;}
.monthday-controls input[type="number"]{width:76px;}
.monthday-controls button { min-height:38px; padding:8px 12px; border:1px solid var(--line); border-radius:6px; background:var(--surface-subtle); color:var(--ink); cursor:pointer; }
.monthday-controls button:disabled { opacity:.45; cursor:default; }
.monthday-average:has(input:disabled){opacity:.6;cursor:help;}
.monthday-controls button[aria-pressed="true"] { border-color:var(--orange); color:var(--orange); }
.monthday-legend { display:flex; gap:12px; flex-wrap:wrap; color:var(--muted); font-size: var(--minimum-text-size); margin-bottom:8px; }
.monthday-legend span:first-child { color:var(--secondary-ink); }.monthday-legend span:nth-child(2) { color:#dfac64; }
#monthday-chart { display:block; width:100%; height:330px; background:var(--canvas-bg); }
.monthday-visual-scroll{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-gutter:stable;}
.monthday-visual{min-width:1240px;}
.monthday-plot{position:relative;}
.monthday-values{position:absolute;inset:0;pointer-events:none;}
.monthday-value{position:absolute;pointer-events:auto;border:1px solid var(--cell-heat);border-radius:4px;padding:2px 3px;background:var(--cell-heat);color:var(--value-ink);font:700 11px/14px system-ui;white-space:nowrap;font-variant-numeric:tabular-nums;cursor:pointer;}
.monthday-value:disabled{background:var(--canvas-bg);border-color:transparent;color:var(--muted);cursor:default;}
.monthday-value:hover:not(:disabled){outline:2px solid var(--ink);outline-offset:1px;}
.monthday-value.is-zero{background:var(--canvas-bg);color:var(--muted);border-style:dashed;}
.monthday-color-scale{justify-content:flex-end;flex-wrap:wrap;margin:0 0 12px;}
.monthday-hint { color:var(--muted); font-size: var(--minimum-text-size); line-height:1.5; }
.chart-tooltip.monthday-tooltip{position:fixed;z-index:1500;max-width:min(340px,calc(100vw - 16px));padding:15px;border-radius:10px;box-shadow:0 12px 40px #0005;pointer-events:none;}
.monthday-tooltip[hidden]{display:none;}.monthday-tooltip>strong{margin-bottom:9px;font-size:13px;}.monthday-tooltip table{width:100%;border-collapse:collapse;font-size: var(--minimum-text-size);}.monthday-tooltip th{font-weight:500;text-align:left;color:var(--muted);}.monthday-tooltip td{text-align:right;font-weight:650;white-space:nowrap;font-variant-numeric:tabular-nums;}.monthday-tooltip th,.monthday-tooltip td{padding:5px 6px;border-bottom:1px solid var(--line);}
.monthday-data{border:1px solid var(--line);border-radius:10px;background:var(--surface);overflow:hidden;margin-top:18px;}.monthday-data>summary{margin:0!important;padding:16px 18px;background:var(--surface-subtle);font-weight:650;color:var(--ink)!important;}.monthday-table-scroll{overflow:auto;max-height:620px;overscroll-behavior:contain;}
.monthday-table{border-collapse:separate;border-spacing:0;width:100%;min-width:620px;font-size:13px;font-variant-numeric:tabular-nums;}.monthday-table caption{text-align:left;padding:12px 18px;color:var(--muted);font-size: var(--minimum-text-size);}.monthday-table th,.monthday-table td{padding:12px 18px;text-align:right;border-bottom:1px solid var(--line);white-space:nowrap;}.monthday-table thead th{position:sticky;top:0;z-index:1;background:var(--table-head-bg);color:var(--table-head-ink);font-weight:650;font-size: var(--minimum-text-size);letter-spacing:.02em;}.monthday-table th:first-child{text-align:left;}.monthday-table tbody tr:nth-child(even){background:var(--stripe);}.monthday-table tbody tr:hover{background:var(--button-hover);}.monthday-table .monthday-count{font-weight:700;}.monthday-table .monthday-volume{color:var(--secondary-ink);}.monthday-table .monthday-observations,.monthday-table .monthday-average{color:var(--muted);}.monthday-table .monthday-missing{opacity:.45;}.monthday-day{display:inline-block;border-left:3px solid var(--day-color);padding:5px 9px;background:var(--surface-subtle);border-radius:3px;font-weight:650;}.monthday-meter{display:block;width:100%;min-width:65px;height:3px;background:var(--line);margin-top:7px;border-radius:3px;overflow:hidden;}.monthday-meter i{display:block;height:100%;background:#78b3d6;border-radius:3px;}.monthday-volume .monthday-meter i{background:#dfac64;}.monthday-table tfoot th,.monthday-table tfoot td{position:sticky;bottom:0;z-index:1;background:var(--table-head-bg);font-weight:750;border-top:2px solid var(--line);border-bottom:0;}
.monthday-panel :is(button,select,input,[tabindex]):focus-visible{outline:2px solid var(--orange);outline-offset:3px;}
.monthday-panel summary { cursor:pointer; color:var(--muted); font-size: var(--minimum-text-size); margin-top:12px; }
@media(max-width:600px){.monthday-controls>label:first-child {flex-basis:100%;}.monthday-controls select{max-width:calc(100vw - 130px);}.monthday-controls .monthday-average{flex-basis:100%;}.monthday-panel{padding:12px 8px;}}
@media(max-width:900px){.monthday-table th,.monthday-table td{padding:10px 12px;}}
