:root {
  color-scheme: light;
  --bg: #f4f5ef;
  --bg-elevated: #ffffff;
  --bg-soft: #e9ece2;
  --ink: #182017;
  --muted: #697065;
  --faint: #8b9286;
  --line: #dce1d5;
  --accent: #59771a;
  --accent-bright: #d7fa72;
  --accent-soft: #eaf5d1;
  --orange: #b66024;
  --orange-soft: #fff0df;
  --red: #b54141;
  --shadow: 0 20px 60px rgba(31, 42, 25, .08);
  --header: rgba(244, 245, 239, .88);
}

html.dark {
  color-scheme: dark;
  --bg: #0e110e;
  --bg-elevated: #151a15;
  --bg-soft: #1c231b;
  --ink: #eef2e8;
  --muted: #a4ae9f;
  --faint: #778271;
  --line: #2b3429;
  --accent: #d7fa72;
  --accent-bright: #d7fa72;
  --accent-soft: #26331c;
  --orange: #f2ad72;
  --orange-soft: #33251b;
  --red: #ef8989;
  --shadow: 0 24px 70px rgba(0, 0, 0, .24);
  --header: rgba(14, 17, 14, .86);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.55; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
::selection { color: #111510; background: #d7fa72; }

.section-shell { width: min(1240px, calc(100% - 64px)); margin-inline: auto; }
.login-view { min-height: 100dvh; display: grid; place-items: center; padding: 32px; position: relative; overflow: hidden; background: #0e110e; color: #eef2e8; }
.login-view::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 75% 15%, rgba(215,250,114,.1), transparent 36%), linear-gradient(120deg, transparent 65%, rgba(255,255,255,.02)); }
.login-orbit { position: absolute; width: 720px; height: 720px; border: 1px solid #283021; border-radius: 50%; top: -320px; right: -160px; }
.login-orbit::before, .login-orbit::after { content: ""; position: absolute; border: 1px solid #20281d; border-radius: inherit; inset: 70px; }
.login-orbit::after { inset: 160px; }
.login-card { width: min(520px, 100%); position: relative; z-index: 1; padding: 48px; border: 1px solid #2b3429; border-radius: 28px; background: rgba(21,26,21,.88); box-shadow: 0 30px 100px rgba(0,0,0,.38); backdrop-filter: blur(16px); }
.brand-mark { display: inline-flex; align-items: end; gap: 5px; height: 40px; margin-bottom: 32px; }
.brand-mark span { display: block; width: 8px; border-radius: 8px; background: var(--accent-bright); }
.brand-mark span:nth-child(1) { height: 21px; }
.brand-mark span:nth-child(2) { height: 38px; }
.brand-mark span:nth-child(3) { height: 29px; }
.brand-mark.small { height: 30px; gap: 4px; margin: 0; }
.brand-mark.small span { width: 6px; }
.brand-mark.small span:nth-child(1) { height: 16px; }
.brand-mark.small span:nth-child(2) { height: 29px; }
.brand-mark.small span:nth-child(3) { height: 22px; }
.eyebrow { margin: 0 0 12px; color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 750; }
.login-card h1 { font-size: clamp(38px, 7vw, 56px); line-height: 1.03; letter-spacing: -.045em; margin: 0 0 18px; }
.login-lead { color: #a4ae9f; font-size: 17px; margin: 0 0 34px; max-width: 390px; }
.login-form label { display: block; color: #c4cdc0; font-size: 12px; font-weight: 650; margin-bottom: 9px; }
.password-row { display: flex; gap: 8px; }
.password-row input { width: 100%; min-width: 0; border: 1px solid #354030; border-radius: 12px; background: #0f130f; color: #eef2e8; outline: none; padding: 14px 15px; transition: border .2s, box-shadow .2s; }
.password-row input:focus { border-color: #d7fa72; box-shadow: 0 0 0 3px rgba(215,250,114,.1); }
.password-row button { flex: 0 0 auto; border: 0; border-radius: 12px; padding: 0 20px; background: #d7fa72; color: #111510; font-weight: 750; }
.password-row button:disabled { opacity: .55; cursor: wait; }
.form-error { color: #ef8989; margin: 10px 0 0; font-size: 13px; }
.login-note { display: flex; align-items: center; gap: 9px; color: #778271; font-size: 12px; margin: 28px 0 0; }
.lock-icon { width: 11px; height: 10px; border: 1px solid currentColor; border-radius: 2px; position: relative; }
.lock-icon::before { content: ""; position: absolute; width: 7px; height: 6px; border: 1px solid currentColor; border-bottom: 0; border-radius: 6px 6px 0 0; left: 0; right: 0; margin: auto; top: -7px; }

.site-header { height: 76px; position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 0 max(32px, calc((100vw - 1240px)/2)); border-bottom: 1px solid var(--line); background: var(--header); backdrop-filter: blur(16px); }
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; flex: 0 0 auto; }
.brand > span:last-child { display: grid; line-height: 1.15; }
.brand b { font-size: 15px; letter-spacing: .12em; }
.brand small { color: var(--muted); font-size: 10px; margin-top: 4px; }
.desktop-nav { display: flex; align-items: center; gap: 26px; }
.desktop-nav a { color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; transition: color .2s; }
.desktop-nav a:hover { color: var(--ink); }
.header-actions { display: flex; gap: 8px; align-items: center; }
.icon-button, .logout-button { border: 1px solid var(--line); background: var(--bg-elevated); color: var(--muted); border-radius: 10px; height: 38px; }
.icon-button { width: 38px; display: grid; place-items: center; }
.theme-symbol { width: 15px; height: 15px; border: 1.5px solid currentColor; border-radius: 50%; box-shadow: -5px 4px 0 -2px var(--bg-elevated); }
html:not(.dark) .theme-symbol { background: currentColor; box-shadow: none; }
.logout-button { padding: 0 13px; font-size: 12px; font-weight: 650; }
.page-loading { min-height: 60vh; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.loader { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero { padding-top: 74px; padding-bottom: 42px; }
.hero-topline { display: flex; justify-content: space-between; gap: 24px; align-items: start; margin-bottom: 36px; }
.hero-period { color: var(--muted); font-size: 13px; }
.coverage-badge { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 100px; padding: 7px 12px; color: var(--muted); background: var(--bg-elevated); font-size: 11px; white-space: nowrap; }
.coverage-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero h1 { margin: 0; max-width: 980px; font-size: clamp(46px, 7.5vw, 92px); line-height: .98; letter-spacing: -.06em; font-weight: 730; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-bottom { margin-top: 44px; display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hero-intro { padding: 24px 32px 24px 0; color: var(--muted); max-width: 470px; }
.hero-intro p { margin: 0; }
.hero-stat { padding: 24px; border-left: 1px solid var(--line); }
.hero-stat b { display: block; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.04em; line-height: 1.2; }
.hero-stat span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }

.summary-section { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; padding-block: 20px 70px; }
.total-card, .realized-card { border-radius: 22px; padding: 30px; }
.total-card { color: #111510; background: var(--accent-bright); position: relative; overflow: hidden; }
.total-card::after { content: ""; position: absolute; width: 240px; height: 240px; border: 1px solid rgba(17,21,16,.14); border-radius: 50%; right: -100px; top: -120px; box-shadow: 0 0 0 45px rgba(17,21,16,.035), 0 0 0 90px rgba(17,21,16,.025); }
.total-card .eyebrow { color: #435516; position: relative; z-index: 1; }
.total-card h2, .realized-card h2 { margin: 0 0 10px; font-size: 24px; letter-spacing: -.03em; position: relative; z-index: 1; }
.total-card > p, .realized-card > p { margin: 0; font-size: 13px; position: relative; z-index: 1; }
.total-values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 30px; position: relative; z-index: 1; }
.total-value { border-top: 1px solid rgba(17,21,16,.25); padding-top: 14px; }
.total-value b { display: block; font-size: clamp(20px, 2.6vw, 32px); line-height: 1.2; letter-spacing: -.04em; overflow-wrap: anywhere; }
.total-value span { font-size: 11px; opacity: .7; }
.realized-card { border: 1px solid var(--line); background: var(--bg-elevated); }
.realized-card > p, .card-note { color: var(--muted); }
.realized-list { margin-top: 22px; display: grid; gap: 12px; }
.realized-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.realized-row:last-child { border: 0; padding: 0; }
.realized-row span { color: var(--muted); font-size: 12px; }
.realized-row b { text-align: right; font-size: 17px; overflow-wrap: anywhere; }
.negative { color: var(--red) !important; }

.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.section-heading h2 { margin: 0; font-size: clamp(30px, 4vw, 46px); line-height: 1.1; letter-spacing: -.045em; }
.section-heading p { margin: 8px 0 0; color: var(--muted); max-width: 650px; }
.section-index { color: var(--faint); font-size: 12px; letter-spacing: .1em; }
.chart-section { padding-bottom: 84px; }
.chart-card { padding: 28px 28px 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--bg-elevated); overflow: hidden; }
.chart-legend { display: flex; gap: 18px; color: var(--muted); font-size: 11px; }
.chart-legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); margin-right: 7px; }
.chart-scroll { overflow-x: auto; scrollbar-width: thin; padding-top: 14px; }
.activity-chart { display: block; max-width: none; }
.bar-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 6; }
.bar-rect { fill: var(--accent); opacity: .76; transition: opacity .2s; }
.bar-svg-value { fill: var(--faint); font-size: 9px; opacity: 0; transition: opacity .2s; }
.bar-svg-label { fill: var(--faint); font-size: 9px; }
.bar-group:hover .bar-rect { opacity: 1; }
.bar-group:hover .bar-svg-value { opacity: 1; }

.months-section { padding-bottom: 88px; }
.month-story { border: 1px solid var(--line); border-radius: 26px; background: var(--bg-elevated); margin-bottom: 22px; overflow: hidden; box-shadow: var(--shadow); }
.month-story-header { display: grid; grid-template-columns: 1fr auto; gap: 30px; padding: 36px; }
.month-number { display: block; color: var(--accent); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 14px; }
.month-story h3 { font-size: clamp(34px, 5vw, 56px); line-height: 1; letter-spacing: -.05em; margin: 0 0 18px; }
.month-story-date { color: var(--faint); font-size: 12px; }
.month-story-lead { color: var(--muted); font-size: 16px; max-width: 740px; margin: 0; }
.month-story-metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.month-metric { padding: 22px 28px; border-right: 1px solid var(--line); }
.month-metric:last-child { border: 0; }
.month-metric b { display: block; font-size: 23px; letter-spacing: -.03em; overflow-wrap: anywhere; }
.month-metric span { color: var(--muted); font-size: 11px; }
.month-story-body { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; padding: 32px 36px 36px; }
.subheading { margin: 0 0 16px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.ranking { display: grid; gap: 9px; }
.ranking-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; }
.ranking-position { color: var(--faint); font-size: 11px; }
.ranking-name { font-weight: 700; text-transform: uppercase; }
.ranking-value { color: var(--muted); font-size: 12px; text-align: right; }
.strategy-note { border-left: 2px solid var(--accent); padding: 3px 0 3px 18px; color: var(--muted); }
.strategy-note p { margin: 0 0 14px; }
.strategy-note strong { color: var(--ink); }
.cross-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.cross-tag { background: var(--accent-soft); color: var(--accent); padding: 6px 9px; border-radius: 7px; font-size: 11px; font-weight: 650; text-transform: uppercase; }
.memory-note { margin-top: 20px; padding: 15px; border-radius: 12px; background: var(--orange-soft); color: var(--orange); font-size: 12px; }
.months-list { display: grid; gap: 10px; margin-top: 34px; }
.month-details { border: 1px solid var(--line); border-radius: 16px; background: var(--bg-elevated); overflow: hidden; }
.month-details summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1.4fr repeat(3, 1fr) 24px; gap: 18px; align-items: center; padding: 20px 22px; }
.month-details summary::-webkit-details-marker { display: none; }
.month-details summary::after { content: "+"; color: var(--muted); font-size: 22px; font-weight: 300; }
.month-details[open] summary::after { content: "−"; }
.month-summary-name { font-weight: 720; text-transform: capitalize; }
.month-summary-stat { color: var(--muted); font-size: 12px; }
.month-summary-stat b { display: block; color: var(--ink); font-size: 14px; }
.month-details-body { border-top: 1px solid var(--line); padding: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.turnover-list { display: grid; gap: 8px; }
.turnover-row { display: grid; grid-template-columns: 60px 1fr 1fr; gap: 10px; font-size: 12px; }
.turnover-row span { color: var(--muted); text-align: right; overflow-wrap: anywhere; }
.turnover-row b { text-transform: uppercase; }

.assets-section, .trades-section { padding-bottom: 88px; }
.table-card { border: 1px solid var(--line); border-radius: 20px; background: var(--bg-elevated); overflow: hidden; }
.table-toolbar { display: flex; flex-wrap: wrap; gap: 10px; padding: 18px; border-bottom: 1px solid var(--line); }
.field { display: grid; gap: 6px; }
.field label { color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.field input, .field select, .search-input { min-height: 40px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); padding: 8px 11px; outline: none; }
.field input:focus, .field select:focus, .search-input:focus { border-color: var(--accent); }
.search-input { width: min(340px, 100%); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; font-weight: 650; text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg-soft); }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.coin-cell { text-transform: uppercase; font-weight: 750; }
.pair-cell { text-transform: uppercase; font-weight: 650; }
.muted-cell { color: var(--muted); }
.side { display: inline-block; min-width: 54px; text-align: center; border-radius: 6px; padding: 3px 6px; font-size: 10px; font-weight: 750; }
.side.buy { background: var(--accent-soft); color: var(--accent); }
.side.sell { background: var(--orange-soft); color: var(--orange); }
.data-warning { color: var(--orange); font-size: 11px; }
.table-empty { padding: 42px 20px; text-align: center; color: var(--muted); }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 18px; border-top: 1px solid var(--line); }
.pagination span { color: var(--muted); font-size: 12px; }
.pagination-buttons { display: flex; gap: 8px; }
.pagination button, .secondary-button { border: 1px solid var(--line); border-radius: 8px; background: var(--bg-elevated); color: var(--ink); padding: 7px 12px; font-size: 12px; }
.pagination button:disabled { opacity: .4; cursor: default; }

.methodology-section { padding-bottom: 76px; }
.method-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; }
.method-card { border: 1px solid var(--line); border-radius: 20px; padding: 28px; background: var(--bg-elevated); }
.method-card h3 { margin: 0 0 18px; font-size: 18px; }
.method-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 15px; }
.method-list li { position: relative; padding-left: 20px; color: var(--muted); font-size: 13px; }
.method-list li::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.coverage-list { display: grid; gap: 12px; margin-bottom: 24px; }
.coverage-row { display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding-bottom: 10px; font-size: 12px; }
.coverage-row span { color: var(--muted); }
.coverage-row b { text-align: right; }
.source-links { display: grid; gap: 9px; }
.source-links a { color: var(--accent); font-size: 12px; text-decoration: none; overflow-wrap: anywhere; }
.source-links a:hover { text-decoration: underline; }
.warnings-details { margin-top: 20px; color: var(--muted); font-size: 12px; }
.warnings-details summary { cursor: pointer; }
.warnings-details ul { max-height: 220px; overflow: auto; padding-left: 18px; }
.site-footer { border-top: 1px solid var(--line); padding-block: 24px 34px; display: flex; justify-content: space-between; gap: 20px; color: var(--faint); font-size: 11px; }
.fatal-error { width: min(700px, calc(100% - 40px)); margin: 80px auto; padding: 24px; border: 1px solid var(--red); border-radius: 16px; color: var(--red); }

@media (max-width: 980px) {
  .desktop-nav { display: none; }
  .hero-bottom { grid-template-columns: repeat(3, 1fr); }
  .hero-intro { grid-column: 1 / -1; padding-right: 0; }
  .hero-stat:first-of-type { border-left: 0; padding-left: 0; }
  .summary-section { grid-template-columns: 1fr; }
  .month-story-metrics { grid-template-columns: repeat(2, 1fr); }
  .month-metric:nth-child(2) { border-right: 0; }
  .month-metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .month-story-body, .method-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .section-shell { width: min(100% - 32px, 1240px); }
  .login-view { padding: 16px; }
  .login-card { padding: 30px 24px; border-radius: 22px; }
  .password-row { display: grid; }
  .password-row button { min-height: 46px; }
  .site-header { height: 66px; padding-inline: 16px; gap: 12px; }
  .logout-button { padding-inline: 10px; }
  .hero { padding-top: 46px; }
  .hero-topline { display: grid; margin-bottom: 26px; }
  .hero h1 { font-size: clamp(43px, 14vw, 64px); }
  .hero-bottom { margin-top: 30px; grid-template-columns: 1fr 1fr; }
  .hero-stat { padding: 18px 12px; }
  .hero-stat:nth-of-type(3) { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .summary-section { padding-bottom: 58px; }
  .total-card, .realized-card { padding: 24px 20px; }
  .total-values { grid-template-columns: 1fr; gap: 16px; }
  .total-value b { font-size: 26px; }
  .section-heading { align-items: start; }
  .section-index { display: none; }
  .chart-card { padding: 20px 12px 14px; }
  .chart-legend { display: none; }
  .month-story-header { grid-template-columns: 1fr; padding: 26px 22px; gap: 14px; }
  .month-story-date { grid-row: 1; }
  .month-story-metrics { grid-template-columns: 1fr 1fr; }
  .month-metric { padding: 17px 16px; }
  .month-metric b { font-size: 18px; }
  .month-story-body { padding: 24px 22px; }
  .month-details summary { grid-template-columns: 1fr auto 20px; gap: 10px; padding: 18px; }
  .month-summary-stat:nth-of-type(3), .month-summary-stat:nth-of-type(4) { display: none; }
  .month-details-body { grid-template-columns: 1fr; padding: 20px 18px; }
  .table-toolbar { display: grid; grid-template-columns: 1fr 1fr; }
  .field input, .field select, .search-input { width: 100%; min-width: 0; }
  .search-field { grid-column: 1 / -1; }
  th, td { padding: 12px; }
  .site-footer { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


.weekly-metric-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.weekly-metric { padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-elevated); color: var(--muted); font-size: 12px; }
.weekly-metric.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.weekly-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.weekly-chart-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.weekly-chart-title span { color: var(--faint); font-size: 10px; text-align: right; }
.week-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.week-line.btc, .week-dot.btc { stroke: var(--orange); fill: var(--orange); }
.week-line.usd, .week-dot.usd { stroke: var(--accent); fill: var(--accent); }
.week-dot { stroke-width: 1; }
.week-zero { stroke: var(--line); stroke-width: 1; }
.week-axis-label, .week-axis-value { fill: var(--faint); font-size: 10px; font-variant-numeric: tabular-nums; }
.cashflow-breakdown { display: grid; gap: 7px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.cashflow-breakdown b { color: var(--ink); }
.cashflow-breakdown small { color: var(--faint); }
@media (max-width: 1000px) { .weekly-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .weekly-chart-title { display: grid; } .weekly-chart-title span { text-align: left; } .weekly-metric { padding: 8px 10px; font-size: 11px; } }
