/* aariv.finance — clean, editorial, light/dark */
:root{
  --serif:'Newsreader',Georgia,serif;
  --sans:'Inter',system-ui,-apple-system,sans-serif;
  --mono:'JetBrains Mono',ui-monospace,monospace;
  --bg:#FCFCFC;--surface:#FFFFFF;--panel:#F5F5F4;--line:#E7E7E5;--line-2:#D6D6D3;
  --text:#141414;--muted:#6E6E6B;--dim:#9C9C98;
  --primary:#111827;--on-primary:#FFFFFF;
  --blue:#0091D5;--chart-in:#C4C4C0;--nav-bg:rgba(252,252,252,.82);
  --band:#0B0C0E;--band-text:#F2F2F0;--band-muted:#9A9A96;--band-line:#25272B;
  color-scheme:light;
}
:root[data-theme=dark]{
  --bg:#000000;--surface:#0D0E10;--panel:#121316;--line:#1E2024;--line-2:#2B2E33;
  --text:#EDEDEB;--muted:#9A9A96;--dim:#66666A;
  --primary:#F2F2F0;--on-primary:#0B0C0E;
  --blue:#00B4FF;--chart-in:#3A3D42;--nav-bg:rgba(0,0,0,.78);
  --band:#0D0E10;--band-text:#F2F2F0;--band-muted:#9A9A96;--band-line:#25272B;
  color-scheme:dark;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme]){
    --bg:#000000;--surface:#0D0E10;--panel:#121316;--line:#1E2024;--line-2:#2B2E33;
    --text:#EDEDEB;--muted:#9A9A96;--dim:#66666A;--primary:#F2F2F0;--on-primary:#0B0C0E;
    --blue:#00B4FF;--chart-in:#3A3D42;--nav-bg:rgba(0,0,0,.78);color-scheme:dark;
  }
}

*{box-sizing:border-box;margin:0;padding:0}
[hidden]{display:none!important}
html{scroll-behavior:smooth}
body{background:var(--bg);color:var(--text);font-family:var(--sans);font-size:16px;line-height:1.6;-webkit-font-smoothing:antialiased;transition:background-color .2s,color .2s}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}body{transition:none}}
a{color:inherit;text-decoration:none}
:focus-visible{outline:2px solid var(--blue);outline-offset:3px;border-radius:4px}
img{max-width:100%}

/* Logo variants */
.logo-l{display:none!important}
:root[data-theme=light] .logo-d{display:none!important}
:root[data-theme=light] .logo-l{display:block!important}

/* Layout */
.frame{display:block}
.block{max-width:1120px;margin:0 auto;padding:112px 24px}
.block + .block{border-top:1px solid var(--line)}

/* Ticker */
.ticker{height:44px;overflow:hidden;border-bottom:1px solid var(--line);background:var(--bg)}

/* Nav */
header.top{position:sticky;top:0;z-index:20;background:var(--nav-bg);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-bottom:1px solid var(--line)}
.nav{max-width:1240px;margin:0 auto;height:60px;padding:0 24px;display:flex;align-items:center;justify-content:space-between;gap:24px}
.brand{display:flex;align-items:center;gap:9px;font-family:var(--mono);font-weight:500;font-size:15px;letter-spacing:-.01em}
.brand img{width:24px;display:block}
.brand em{font-style:normal;color:var(--blue)}
.links{display:flex;gap:26px;font-size:14px;color:var(--muted);margin-left:auto}
.links a:hover,.links a[aria-current=page]{color:var(--text)}
.nav-cta{display:flex;align-items:center;gap:8px}

/* Buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;height:40px;padding:0 16px;border-radius:6px;font-size:15px;font-weight:500;white-space:nowrap;border:1px solid transparent;transition:background .15s,border-color .15s,opacity .15s}
.btn-sm{height:32px;padding:0 12px;font-size:14px}
.btn-white{background:var(--primary);color:var(--on-primary)}
.btn-white:hover{opacity:.88}
.btn-ghost{background:var(--surface);border-color:var(--line);color:var(--text)}
.btn-ghost:hover{border-color:var(--line-2)}
.theme-toggle{width:32px;height:32px;display:grid;place-items:center;border-radius:6px;border:1px solid transparent;background:none;color:var(--muted);cursor:pointer}
.theme-toggle:hover{color:var(--text);border-color:var(--line)}
.theme-toggle svg{width:16px;height:16px}
.theme-toggle .sun{display:none}
:root[data-theme=dark] .theme-toggle .sun{display:block}
:root[data-theme=dark] .theme-toggle .moon{display:none}

/* Type */
h1,h2{font-family:var(--serif);font-weight:400;letter-spacing:-.02em;text-wrap:balance}
h1{font-size:clamp(42px,6.4vw,72px);line-height:1.04}
h1 .sub,h2 .sub{display:block;color:var(--dim)}
h2{font-size:clamp(32px,4.4vw,52px);line-height:1.08;margin-bottom:14px}
h3{font-weight:600;letter-spacing:-.01em}

/* Hero */
.hero{text-align:center;padding:96px 24px 56px;border:0!important}
.status{display:inline-flex;align-items:center;gap:8px;font-size:14px;color:var(--muted);margin-bottom:28px}
.status img{width:18px}
.status b{color:var(--text);font-weight:500}
.hero h1{max-width:18ch;margin:0 auto 22px}
.lede{font-size:clamp(17px,2vw,19px);color:var(--muted);max-width:34em;margin:0 auto 32px}
.actions{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}

/* Showcase: product window on a blue backdrop */
.showcase{max-width:1120px;margin:0 auto;padding:0 24px 112px}
.stage{position:relative;border-radius:10px;overflow:hidden;padding:56px 7% 0;
  background:
    radial-gradient(120% 90% at 85% 0%,#4FD0FF 0%,rgba(79,208,255,0) 55%),
    radial-gradient(90% 80% at 0% 100%,#003A66 0%,rgba(0,58,102,0) 60%),
    linear-gradient(160deg,#0A7CC4 0%,#0062A8 45%,#00467F 100%)}
.stage::after{content:"";position:absolute;inset:0;pointer-events:none;
  background:repeating-linear-gradient(115deg,rgba(255,255,255,.07) 0 2px,transparent 2px 64px)}
.pills{position:relative;z-index:1;display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}
.pills button{font:inherit;font-size:14px;font-weight:500;color:#fff;background:rgba(255,255,255,.18);border:0;border-radius:999px;padding:7px 14px;cursor:pointer;backdrop-filter:blur(6px);transition:background .15s}
.pills button:hover{background:rgba(255,255,255,.28)}
.pills button[aria-selected=true]{background:#fff;color:#111827}
.window{position:relative;z-index:1;background:var(--surface);border-radius:8px 8px 0 0;overflow:hidden;box-shadow:0 -1px 0 rgba(255,255,255,.4),0 30px 80px -20px rgba(0,0,0,.35)}
.window-bar{display:flex;align-items:center;justify-content:space-between;height:40px;padding:0 14px;background:var(--panel);border-bottom:1px solid var(--line);font-size:13px;color:var(--muted)}
.window-bar .file{display:flex;align-items:center;gap:8px;background:var(--surface);height:40px;padding:0 14px;margin-left:-14px;border-right:1px solid var(--line);color:var(--text)}
.dots{display:flex;gap:6px}.dots i{width:9px;height:9px;border-radius:50%;background:var(--line-2)}
.tool{display:grid;grid-template-columns:280px 1fr}
.inputs{padding:28px;border-right:1px solid var(--line);display:flex;flex-direction:column;gap:24px}
.field label{display:flex;justify-content:space-between;font-size:14px;color:var(--muted);margin-bottom:10px}
.field output{font-family:var(--mono);font-size:13px;color:var(--text)}
input[type=range]{width:100%;accent-color:var(--blue);cursor:pointer}
.result{padding:28px 32px 24px}
.figures{display:flex;gap:40px;flex-wrap:wrap;margin-bottom:18px}
.fig small{display:block;font-size:13px;color:var(--muted)}
.fig strong{font-family:var(--mono);font-weight:500;font-size:clamp(22px,2.6vw,28px);letter-spacing:-.02em}
.fig.total strong{color:var(--blue)}
#chart{width:100%;height:210px;display:block}
.legend{display:flex;gap:18px;font-size:13px;color:var(--muted);margin-top:10px}
.legend span::before{content:"";display:inline-block;width:10px;height:2px;margin-right:8px;vertical-align:middle;background:var(--blue)}
.legend .b::before{background:var(--chart-in)}
.note{font-size:13px;color:var(--dim);margin-top:12px}
.markets{padding:16px 16px 14px}
.markets .note{padding:0 6px}
#tv-markets{height:420px}

/* Section heads */
.head{max-width:620px;margin-bottom:48px}
.head p{color:var(--muted);font-size:18px}

/* Steps */
.steps{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.step{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:28px;display:flex;flex-direction:column}
.step .n{font-family:var(--mono);font-size:12px;color:var(--dim);margin-bottom:28px}
.step h3{font-family:var(--serif);font-weight:400;font-size:26px;letter-spacing:-.01em;margin-bottom:8px}
.step p{color:var(--muted);margin-bottom:24px;flex:1}
.go,.more{font-size:15px;font-weight:500;color:var(--text);text-decoration:underline;text-decoration-color:var(--line-2);text-underline-offset:4px}
.go:hover,.more:hover{text-decoration-color:var(--text)}
.more{display:inline-block;margin-top:28px}

/* Topic cards */
.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.grid.three{grid-template-columns:repeat(3,1fr)}
.cell{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:26px}
.cell svg{width:20px;height:20px;color:var(--blue);margin-bottom:22px}
.cell h3{font-family:var(--serif);font-weight:400;font-size:24px;letter-spacing:-.01em;margin-bottom:6px}
.cell p{color:var(--muted);font-size:15px}

/* Platforms explorer */
.explorer{display:grid;grid-template-columns:1fr 1.15fr;gap:56px;align-items:start}
.tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.tiles button{font:inherit;height:64px;border-radius:6px;border:1px solid var(--line);background:var(--panel);color:var(--text);font-size:16px;font-weight:500;cursor:pointer;transition:border-color .15s,background .15s}
.tiles button:hover{border-color:var(--line-2)}
.tiles button[aria-selected=true]{background:var(--surface);border-color:var(--text)}
.detail h3{font-family:var(--serif);font-weight:400;font-size:34px;letter-spacing:-.015em;margin-bottom:6px}
.detail > p{color:var(--muted);margin-bottom:20px}
.kv{list-style:none;border-top:1px solid var(--line);margin-bottom:24px}
.kv li{display:flex;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid var(--line);font-size:15px}
.kv li span:last-child{color:var(--muted);text-align:right}

/* About band (always dark, like a feature band) */
.band{background:var(--band);color:var(--band-text)}
.band .block{border:0}
.about{display:grid;grid-template-columns:minmax(0,400px) 1fr;gap:64px;align-items:center}
.portrait{width:100%;height:auto;aspect-ratio:1;object-fit:cover;border-radius:8px;display:block}
.bio{color:var(--muted);font-size:18px;max-width:34em;margin-bottom:32px}
.band .bio{color:var(--band-muted)}
.stats{display:grid;grid-template-columns:repeat(3,1fr);border-top:1px solid var(--line)}
.band .stats{border-color:var(--band-line)}
.stat{padding:18px 18px 0 0}
.stat + .stat{padding-left:18px;border-left:1px solid var(--line)}
.band .stat + .stat{border-color:var(--band-line)}
.stat strong{display:block;font-family:var(--serif);font-weight:400;font-size:clamp(30px,3.4vw,40px);letter-spacing:-.02em;line-height:1.1}
.stat span{font-size:14px;color:var(--muted)}
.band .stat span{color:var(--band-muted)}
.band .more{color:var(--band-text);text-decoration-color:var(--band-line)}
.band .more:hover{text-decoration-color:var(--band-text)}

/* Split + checklist */
.split{display:grid;grid-template-columns:1fr 1.2fr;gap:64px;align-items:start}
.commit{list-style:none;border-top:1px solid var(--line)}
.commit li{display:grid;grid-template-columns:24px 1fr;gap:12px;padding:18px 0;border-bottom:1px solid var(--line)}
.commit svg{width:16px;height:16px;color:var(--blue);margin-top:4px}
.commit h3{font-size:16px;margin-bottom:2px}
.commit p{color:var(--muted);font-size:15px}

/* FAQ */
details{border-bottom:1px solid var(--line)}
details:first-of-type{border-top:1px solid var(--line)}
summary{list-style:none;cursor:pointer;display:flex;justify-content:space-between;align-items:center;gap:20px;padding:18px 0;font-size:16px;font-weight:500}
summary::-webkit-details-marker{display:none}
summary::after{content:"";width:11px;height:11px;flex:none;background:linear-gradient(var(--muted),var(--muted)) center/100% 1.5px no-repeat,linear-gradient(var(--muted),var(--muted)) center/1.5px 100% no-repeat;transition:transform .2s}
details[open] summary::after{transform:rotate(45deg)}
details p{color:var(--muted);padding:0 0 20px;max-width:46em}

/* Final CTA */
.final{text-align:center}
.final img{width:52px;margin:0 auto 24px;display:block}
.final h2{max-width:16ch;margin:0 auto 14px}
.final p{color:var(--muted);font-size:18px;margin-bottom:32px}

/* Inner page hero */
.page-hero{padding-top:96px;padding-bottom:64px}
.page-hero h1{margin:0 0 16px;max-width:16ch}
.page-hero .lede{margin:0;max-width:36em}

/* Rows (community, blog) */
.rows{border-top:1px solid var(--line)}
.row{display:grid;grid-template-columns:200px 1fr auto;gap:32px;align-items:center;padding:24px 0;border-bottom:1px solid var(--line)}
.row h3{font-family:var(--serif);font-weight:400;font-size:24px}
.row .meta{font-family:var(--mono);font-size:12px;color:var(--dim);margin-top:2px}
.row p{color:var(--muted);max-width:36em}
.row.post{grid-template-columns:130px 1fr auto}
.row.post h3{font-family:var(--sans);font-weight:600;font-size:17px;margin-bottom:2px}
.row.post time{font-family:var(--mono);font-size:12px;color:var(--dim)}
.featured{display:grid;grid-template-columns:1fr auto;gap:32px;align-items:center;border:1px solid var(--line);border-radius:8px;padding:36px;margin-bottom:56px;background:var(--surface)}
.featured p{color:var(--muted);font-size:17px;max-width:34em}
.featured .num{color:var(--text);font-weight:600}
.empty{color:var(--muted);padding:24px 0;border-bottom:1px solid var(--line)}
.subscribe{border:1px solid var(--line);border-radius:8px;overflow:hidden;background:#fff;max-width:520px}
.subscribe iframe{display:block;width:100%;height:320px;border:0}

/* Legal prose */
.prose{max-width:700px}
.prose h2{font-size:26px;margin:44px 0 10px}
.prose h2:first-child{margin-top:0}
.prose p,.prose li{color:var(--muted)}
.prose p+p{margin-top:14px}
.prose ul{padding-left:20px;margin:12px 0;display:grid;gap:8px}
.prose a{color:var(--text);text-decoration:underline;text-underline-offset:3px;text-decoration-color:var(--line-2)}
.prose strong{color:var(--text);font-weight:500}
.updated{font-family:var(--mono);font-size:12px;color:var(--dim);margin-top:18px}

/* Links page */
.lp{max-width:500px;margin:0 auto;padding:72px 24px 96px;text-align:center}
.lp-avatar{width:96px;height:96px;border-radius:50%;object-fit:cover;display:block;margin:0 auto 18px}
.lp h1{font-size:34px;margin:0 0 6px}
.lp .tag{color:var(--muted);margin-bottom:32px}
.lp-btn{display:flex;justify-content:space-between;align-items:center;gap:16px;background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:16px 18px;margin-bottom:10px;text-align:left;transition:border-color .15s}
.lp-btn:hover{border-color:var(--line-2)}
.lp-btn b{font-weight:500}
.lp-btn span{font-size:14px;color:var(--muted)}
.lp-btn.primary{background:var(--primary);border-color:var(--primary);color:var(--on-primary)}
.lp-btn.primary span{color:var(--on-primary);opacity:.7}
.lp .small{font-size:13px;color:var(--dim);margin-top:24px}

/* Footer */
footer{max-width:1120px;margin:0 auto;padding:64px 24px 48px;border-top:1px solid var(--line)}
.foot{display:grid;grid-template-columns:1.6fr 1fr 1fr 1fr;gap:40px;margin-bottom:48px}
.foot p{color:var(--muted);font-size:14px;margin-top:14px;max-width:24em}
.foot h4{font-size:13px;font-weight:500;color:var(--dim);margin-bottom:12px}
.foot ul{list-style:none;display:grid;gap:8px;font-size:14px;color:var(--muted)}
.foot ul a:hover{color:var(--text)}
.legal{border-top:1px solid var(--line);padding-top:24px;font-size:12.5px;line-height:1.65;color:var(--dim)}
.legal p+p{margin-top:8px}

@media (max-width:900px){
  .links{display:none}
  .block{padding:80px 20px}
  .hero{padding:64px 20px 40px}
  .showcase{padding:0 12px 80px}
  .stage{padding:28px 12px 0}
  .tool{grid-template-columns:1fr}
  .inputs{border-right:0;border-bottom:1px solid var(--line)}
  .steps,.grid,.grid.three{grid-template-columns:1fr}
  .explorer,.split,.about{grid-template-columns:1fr;gap:32px}
  .portrait{max-width:340px}
  .row,.row.post{grid-template-columns:1fr;gap:6px}
  .featured{grid-template-columns:1fr;padding:26px}
  .foot{grid-template-columns:1fr 1fr}
  .foot>div:first-child{grid-column:1/-1}
  .page-hero{padding-top:64px;padding-bottom:48px}
}
@media (max-width:480px){
  .nav-cta .btn-ghost{display:none}
  .tiles{grid-template-columns:repeat(2,1fr)}
  .stat{padding-right:10px}.stat + .stat{padding-left:10px}
  .window-bar .dots{display:none}
}

.tv-fallback{height:420px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;text-align:center;color:var(--muted);padding:24px}
.tv-fallback b{color:var(--text);font-weight:500}

/* About story + lessons empty state */
.story p{font-size:19px;color:var(--muted)}
.story p+p{margin-top:16px}
.empty{border:1px dashed var(--line-2);border-radius:8px;padding:44px;max-width:760px;background:var(--surface)}
.empty h3{font-family:var(--serif);font-weight:400;font-size:30px;letter-spacing:-.015em;margin-bottom:8px}
.empty p{color:var(--muted);margin-bottom:24px;max-width:36em}
.page-hero .about h1{margin-bottom:20px}
@media (max-width:900px){.empty{padding:28px 22px}}

/* Latest research note */
.note-card{padding:32px 36px 28px}
.nc-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:16px}
.nc-meta{display:flex;gap:14px;font-family:var(--mono);font-size:13px;color:var(--dim);margin-bottom:6px}
.nc-ticker{color:var(--blue);font-weight:500}
.nc-head h3{font-family:var(--serif);font-weight:400;font-size:clamp(26px,3vw,34px);letter-spacing:-.015em;line-height:1.15}
.nc-status{flex:none;font-size:13px;font-weight:500;border:1px solid var(--line-2);border-radius:999px;padding:4px 12px;color:var(--text)}
.nc-status::before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;background:#1FA463;margin-right:8px;vertical-align:1px}
.nc-thesis{font-size:19px;line-height:1.5;max-width:40em;margin-bottom:28px}
.nc-cases{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:24px}
.nc-case{border:1px solid var(--line);border-radius:6px;padding:20px 22px;background:var(--panel)}
.nc-case h4{font-size:14px;font-weight:600;margin-bottom:10px;display:flex;align-items:center;gap:8px}
.nc-case h4::before{content:"";width:8px;height:8px;border-radius:2px}
.nc-case.bull h4::before{background:#1FA463}
.nc-case.bear h4::before{background:#D9483B}
.nc-case ul{padding-left:18px;color:var(--muted);font-size:15px;display:grid;gap:6px}
.nc-foot{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:18px;font-size:14px;color:var(--muted)}
#tv-macro{height:440px}
@media (max-width:700px){.note-card{padding:22px 18px}.nc-cases{grid-template-columns:1fr}}

/* Live chart grid (same footprint as the topic cards) */
.charts{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.chart-card{background:var(--surface);border:1px solid var(--line);border-radius:8px;overflow:hidden;min-width:0}
.cc-head{display:flex;flex-direction:column;gap:2px;padding:20px 22px 8px}
.cc-head h3{font-family:var(--serif);font-weight:400;font-size:24px;letter-spacing:-.01em}
.cc-head span{font-size:13px;color:var(--dim)}
.cc-body{height:270px;padding:0 6px 6px}
.tv-fallback.small{height:100%;font-size:14px;gap:8px}
.pills{flex-wrap:wrap}
@media (max-width:900px){.charts{grid-template-columns:1fr}}
@media (min-width:901px) and (max-width:1100px){.charts{grid-template-columns:repeat(2,1fr)}}
.glance{padding:20px}
.glance .charts{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.glance .chart-card{background:var(--panel)}
.glance .cc-head{padding:16px 16px 6px}
.glance .cc-head h3{font-size:21px}
.glance .cc-body{height:240px}
.glance .note{margin-top:12px}
@media (max-width:1000px){.glance .charts{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:640px){.glance{padding:12px}.glance .charts{grid-template-columns:1fr}}

/* Latest Substack post */
.post-card{display:grid;grid-template-columns:1fr;gap:32px;padding:36px 40px 32px}
.post-card.has-cover{grid-template-columns:minmax(0,1fr) 300px;align-items:start}
.pc-meta{display:flex;gap:14px;font-family:var(--mono);font-size:13px;color:var(--dim);margin-bottom:10px}
.pc-src{color:var(--blue);font-weight:500}
.pc-text h3{font-family:var(--serif);font-weight:400;font-size:clamp(28px,3.4vw,40px);line-height:1.12;letter-spacing:-.02em;margin-bottom:10px;text-wrap:balance}
.pc-sub{font-size:18px;color:var(--muted);margin-bottom:20px;max-width:38em}
.pc-preview{max-height:10.5em;overflow:hidden;color:var(--text);font-size:16px;line-height:1.7;max-width:42em;
  -webkit-mask-image:linear-gradient(#000 30%,transparent);mask-image:linear-gradient(#000 30%,transparent)}
.pc-preview:empty{display:none}
.pc-preview p+p{margin-top:12px}
.pc-foot{display:flex;flex-wrap:wrap;align-items:center;gap:12px 20px;margin-top:20px;font-size:14px;color:var(--muted)}
.pc-foot a:not(.btn){text-decoration:underline;text-underline-offset:3px}
.pc-cover{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:6px;border:1px solid var(--line)}
@media (max-width:800px){.post-card,.post-card.has-cover{grid-template-columns:1fr;padding:24px 20px}.pc-cover{order:-1;aspect-ratio:16/9}}
/* Post card v2: title, fading preview, centred call to action */
.pc-text h3{margin-bottom:18px}
.pc-preview{max-height:12em;-webkit-mask-image:linear-gradient(#000 20%,transparent 92%);mask-image:linear-gradient(#000 20%,transparent 92%)}
.pc-foot{flex-direction:column;justify-content:center;text-align:center;margin-top:-8px;gap:10px}
.pc-preview:empty + .pc-foot{margin-top:12px}

/* FRED data charts */
.cc-body.fred{display:flex;align-items:center;justify-content:center;padding:0 10px}
.cc-body.fred img{width:100%;height:auto;display:block;border-radius:4px}
.cc-legend{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;padding:0 16px 14px;font-size:12px;color:var(--muted)}
.cc-legend i{display:inline-block;width:14px;height:0;border-top:2px solid var(--blue);margin-left:4px}
.cc-legend i:first-child{margin-left:0}
.cc-legend i.d{border-top:2px dashed var(--text)}
.cc-switch{display:inline-flex;gap:2px;background:var(--line);border-radius:6px;padding:2px;align-self:flex-start;margin-top:4px}
.cc-switch button{font:inherit;font-size:12px;border:0;background:none;color:var(--muted);padding:3px 9px;border-radius:4px;cursor:pointer}
.cc-switch button[aria-pressed=true]{background:var(--surface);color:var(--text)}

/* Pinned research post */
.pc-tag{font-family:var(--mono);font-size:12px;color:var(--text);border:1px solid var(--line-2);border-radius:999px;padding:0 8px}

/* Own market cards */
.chart-card.mk{display:flex;flex-direction:column;background:var(--panel)}
.mk-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;padding:16px 16px 4px}
.mk-head h3{font-family:var(--serif);font-weight:400;font-size:21px;letter-spacing:-.01em;line-height:1.1}
.mk-sub{display:block;font-size:12px;color:var(--dim);margin-top:3px}
.mk-val{text-align:right;font-family:var(--mono);font-size:17px;font-weight:500;letter-spacing:-.02em;line-height:1.25;font-variant-numeric:tabular-nums}
.mk-chg{display:block;font-size:12px;font-weight:400}
.mk-chg.up{color:#1FA463}.mk-chg.down{color:#D9483B}
.mk-pair{display:inline-flex;align-items:baseline;gap:4px;flex-wrap:wrap;justify-content:flex-end}
.mk-pair small{font-size:11px;color:var(--dim);font-weight:400;margin-left:6px}
.mk-pair small:first-child{margin-left:0}
.mk-chart{height:150px;margin:4px 6px 0;min-width:0}
.mk .cc-legend{padding:6px 16px 0}
.mk-next{display:flex;align-items:flex-start;gap:10px;margin-top:auto;padding:12px 16px 14px;border-top:1px solid var(--line);font-size:13px;color:var(--muted);line-height:1.45}
.mk .cc-legend + .mk-next{margin-top:10px}
.mk-chart + .mk-next{margin-top:10px}
.mk-next-label{flex:none;font-family:var(--mono);font-size:11px;color:var(--blue);padding-top:1px}
.mk-next-body{flex:1;min-width:0}
.mk-next b{color:var(--text);font-weight:600}
.mk-muted{color:var(--dim)}
.mk-src{flex:none;font-size:11px;color:var(--dim);text-decoration:underline;text-underline-offset:2px}
.mk-src:hover{color:var(--text)}
.chart-card.sk{min-height:300px;background:linear-gradient(90deg,var(--panel) 0%,var(--line) 50%,var(--panel) 100%) 0 0/200% 100%;animation:sk 1.4s linear infinite}
@keyframes sk{to{background-position:-200% 0}}
@media (prefers-reduced-motion:reduce){.chart-card.sk,.cal-sk{animation:none}}

/* Own economic calendar */
.calendar{padding:8px 24px 18px;min-height:440px}
#cal-list{max-height:460px;overflow-y:auto}
.cal-day{position:sticky;top:0;background:var(--surface);font-family:var(--mono);font-size:12px;font-weight:500;color:var(--dim);padding:14px 0 6px;border-bottom:1px solid var(--line);z-index:1}
.cal-row{display:grid;grid-template-columns:56px 30px 10px minmax(0,1fr) 72px 72px 72px;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--line);font-size:14px}
.cal-row.past{opacity:.45}
.cal-time,.cal-cc{font-family:var(--mono);font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.cal-cc{color:var(--text)}
.cal-imp{width:8px;height:8px;border-radius:50%}
.cal-imp.hi{background:#D9483B}.cal-imp.md{background:#E0A526}
.cal-title{font-weight:500}
.cal-num{font-family:var(--mono);font-size:13px;text-align:right;font-variant-numeric:tabular-nums}
.cal-num small{display:block;font-family:var(--sans);font-size:10px;color:var(--dim)}
.cal-empty{color:var(--muted);padding:40px 0;text-align:center}
.cal-sk{height:44px;margin-top:10px;border-radius:6px;background:linear-gradient(90deg,var(--panel) 0%,var(--line) 50%,var(--panel) 100%) 0 0/200% 100%;animation:sk 1.4s linear infinite}
.calendar .note{margin-top:12px}
@media (max-width:640px){
  .calendar{padding:4px 14px 14px}
  .cal-row{grid-template-columns:46px 26px 8px minmax(0,1fr);row-gap:4px}
  .cal-num{grid-column:4;text-align:left;display:inline}
  .cal-num small{display:inline;margin-right:6px}
}
/* stacked card values */
.mk-head{flex-direction:column;align-items:flex-start;gap:6px}
.mk-val{text-align:left;font-size:20px;display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 10px}
.mk-chg{display:inline;font-size:12px}
.mk-pair{justify-content:flex-start}
.mk-pair small{margin-left:10px}
.cal-num b{font-weight:600;color:var(--text)}
#cal-list{position:relative}
#cal-list{padding-right:14px;scrollbar-width:thin}

/* Fixed-height tool window */
#p-note,#p-glance,#p-cal{height:720px;overflow-y:auto}
.post-card{align-content:center}
.glance{padding:18px}
.glance .charts{gap:12px}
.mk-chart{height:140px}
#p-cal{display:flex;flex-direction:column;padding-bottom:16px;min-height:0}
#cal-list{max-height:none;flex:1;overflow-y:auto}
@media (max-width:900px){#p-note,#p-glance,#p-cal{height:640px}}

/* Flags */
.flag{display:inline-flex;width:20px;height:13px;border-radius:2px;overflow:hidden;box-shadow:0 0 0 1px var(--line-2);vertical-align:-1px;flex:none}
.flag svg{width:100%;height:100%;display:block}
.mk-pair .flag{margin-left:12px;margin-right:4px;align-self:center}
.mk-pair .flag:first-child{margin-left:0}
.cal-row{grid-template-columns:56px 26px 10px minmax(0,1fr) 80px 80px}
.cal-cc{display:flex;align-items:center}

/* Shopify logo tile */
.pc-logo{display:grid;place-items:center;aspect-ratio:4/3;border-radius:8px;background:#fff;border:1px solid var(--line);padding:18%}
.pc-logo img{width:100%;height:auto}
@media (max-width:800px){.pc-logo{order:-1;aspect-ratio:16/7;padding:8% 22%}}
#p-note,#p-glance,#p-cal{height:790px}
.mk-chart{height:130px}
.mk-next{padding:10px 16px 12px}
@media (max-width:900px){#p-note,#p-glance,#p-cal{height:640px}}

/* Back to the original box size: fixed height, three cards per tab */
#p-note,#p-glance,#p-cal{height:520px;overflow-y:auto}
.mk-chart{height:170px}
#p-cal{display:block;padding:18px}
#cal-cards{margin-bottom:8px}
#cal-list{overflow:visible;padding-right:0}
.cal-day{background:var(--surface)}
.chart-card.sk{min-height:400px}
@media (max-width:900px){#p-note,#p-glance,#p-cal{height:600px}}
#p-glance .mk-chart{height:250px}
