/* Beige Book Sector Monitor: "Ink & vermilion", matching the newsletter. */
:root {
  --ink: #111111;
  --ink-2: #333333;
  --muted: #6b6b6b;
  --accent: #E4572E;
  --paper: #F4F4F2;
  --card: #ffffff;
  --rule: #e4e4e0;
  --pos: #0F766E;
  --neg: #D9481F;
  --neu: #8f8f8f;
  --h2: #0F766E; --h1: #CDE9E5; --h0: #ececea; --hm1: #FAD5CB; --hm2: #E4572E;
  --sans: Helvetica, Arial, sans-serif;
  --wrap: 1200px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); }
a { color: var(--ink); }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--sans); font-weight: 700; letter-spacing: -.02em; margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.pos { color: var(--pos); } .neg { color: var(--neg); } .neu { color: var(--neu); }
.num { font-variant-numeric: tabular-nums; font-weight: 700; }
.nowrap { white-space: nowrap; }
.r { text-align: right; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* top strip + masthead */
.strip { background: var(--card); border-bottom: 1px solid var(--rule); font-size: 12px; color: var(--muted); }
.strip-in { display: flex; justify-content: space-between; gap: 12px; padding-top: 6px; padding-bottom: 6px; }
.strip a { color: var(--ink); font-weight: 700; }
.mast { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 5; }
.mast-in { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.mast-rule { height: 4px; background: var(--accent); }
.brand { display: flex; flex-direction: column; text-decoration: none; color: #fff; line-height: 1.15; }
.brand:hover { color: #fff; }
.brand-k { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.brand-n { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: #e6e6e6; text-decoration: none; font-size: 14px; font-weight: 700; padding: 8px 12px; border-bottom: 3px solid transparent; }
.nav a:hover { color: #fff; }
.nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--accent); }
.nav .btn-ghost { margin-left: 8px; border: 1px solid #555; border-radius: 4px; padding: 7px 12px; }
.nav .btn-ghost:hover { border-color: var(--accent); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid #555; color: #fff; font: 700 13px var(--sans); padding: 7px 12px; border-radius: 4px; cursor: pointer; }

/* buttons, pills, kickers */
.btn { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; padding: 10px 16px; border-radius: 4px; border: 1px solid var(--accent); }
.btn:hover { background: #c9441f; color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.mast .btn-ghost { color: #fff; }
.kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 8px; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; line-height: 16px; }
.sig-favorable { background: #0F766E; color: #fff; }
.sig-leaning-favorable { background: #CDE9E5; color: #0B5A54; }
.sig-neutral { background: #ececea; color: #4d4d4d; }
.sig-leaning-unfavorable { background: #FAD5CB; color: #9A3412; }
.sig-unfavorable { background: #E4572E; color: #fff; }
.tk { color: var(--muted); font-size: 12px; }
.lede { font-size: 18px; line-height: 1.5; color: var(--ink-2); max-width: 760px; margin: 12px 0 0; }
.note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

/* section headings: Economist-style rule above */
.sh { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-top: 3px solid var(--ink); padding-top: 10px; margin: 36px 0 16px; font-size: 20px; }
.sh a { font-size: 13px; font-weight: 700; text-decoration: none; color: var(--accent); white-space: nowrap; letter-spacing: 0; }

/* cover */
.cover { position: relative; display: flex; flex-direction: column; aspect-ratio: 3 / 4; background: var(--ink); color: #fff; text-decoration: none; padding: 14px 12px 12px; border-top: 6px solid var(--accent); overflow: hidden; }
.cover:hover { color: #fff; outline: 2px solid var(--accent); outline-offset: 2px; }
.cv-k { font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.cv-m { font-size: 24px; font-weight: 700; letter-spacing: -.03em; line-height: 1; margin-top: 8px; }
.cv-y { font-size: 24px; font-weight: 700; letter-spacing: -.03em; line-height: 1; color: #9a9a9a; }
.cv-bars { display: flex; gap: 2px; height: 34%; margin-top: auto; border-top: 1px solid #333; border-bottom: 1px solid #333; }
.cb { position: relative; flex: 1; }
.cb::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #444; }
.cb i { position: absolute; left: 0; right: 0; }
.cb i.up { bottom: 50%; background: #2bb3a3; }
.cb i.dn { top: 50%; background: var(--accent); }
.cv-t { font-size: 10px; color: #bdbdbd; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cover-lg { padding: 24px 22px 20px; border-top-width: 10px; }
.cover-lg .cv-k { font-size: 12px; }
.cover-lg .cv-m, .cover-lg .cv-y { font-size: 54px; }
.cover-lg .cv-t { font-size: 14px; }
.cover-lg .cv-bars { gap: 4px; }

/* home hero */
.hero { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 40px; padding-top: 36px; padding-bottom: 8px; align-items: start; }
.hero h1 { font-size: 40px; line-height: 1.1; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.kpis { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.kpis > div { background: var(--card); border: 1px solid var(--rule); border-radius: 6px; padding: 12px 14px; min-width: 150px; }
.kpis > div > span { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.kpis b { display: block; font-size: 28px; line-height: 1.2; margin-top: 4px; }
.kpis b.b-sm { font-size: 16px; line-height: 34px; }
.kpis small { font-size: 15px; color: var(--muted); }

.inside { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0; border-left: 1px solid var(--rule); counter-reset: s; }
.inside li { border-right: 1px solid var(--rule); counter-increment: s; }
.inside a { display: block; padding: 4px 16px 8px; text-decoration: none; }
.inside a::before { content: counter(s, decimal-leading-zero); display: block; color: var(--accent); font-weight: 700; font-size: 13px; }
.inside b { display: block; font-size: 16px; line-height: 1.25; }
.inside span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.inside a:hover b { color: var(--accent); }

.two { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; background: var(--card); font-size: 14px; }
.tbl th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--ink); background: var(--paper); }
.tbl th.r { text-align: right; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.tbl td a { font-weight: 700; text-decoration: none; }
.tbl td a:hover { text-decoration: underline; }
.spark { display: block; }
.spark-zero { stroke: #cfcfcc; stroke-width: 1; }
.spark-line { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.spark-dot { fill: var(--neu); } .spark-dot.pos { fill: var(--pos); } .spark-dot.neg { fill: var(--neg); }

.macs { background: var(--card); border: 1px solid var(--rule); }
.mac { display: flex; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--rule); font-size: 14px; }
.mac:last-child { border-bottom: 0; }
.mac b { font-variant-numeric: tabular-nums; }
.dists { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dist { display: block; background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--neu); padding: 8px 10px; text-decoration: none; }
.dist.pos { border-left-color: var(--pos); } .dist.neg { border-left-color: var(--neg); }
.dist b { display: block; font-size: 13px; color: var(--ink); }
.dist span { font-size: 12px; color: var(--muted); }

/* edition cards (archive, home) */
.ed-grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 24px 20px; }
.ed-card .cover { width: 100%; }
.ed-meta { padding-top: 10px; display: grid; gap: 2px; }
.ed-title { font-weight: 700; font-size: 15px; text-decoration: none; }
.ed-date { font-size: 12px; color: var(--muted); }
.ed-stats span { white-space: nowrap; }
.ed-stats { display: flex; flex-wrap: wrap; gap: 0 10px; font-size: 12px; color: var(--muted); }
.ed-stats b { color: var(--ink); }
.ed-stats b.pos { color: var(--pos); } .ed-stats b.neg { color: var(--neg); }
.ed-pdf { font-size: 12px; font-weight: 700; color: var(--accent); text-decoration: none; justify-self: start; }
.ed-pdf::before { content: "\2193  "; }
.dek { font-size: 13px; color: var(--ink-2); margin: 4px 0; }

/* page heads */
.page-head { padding-top: 32px; padding-bottom: 8px; }
.page-head + .wrap > .heat-wrap { margin-top: 24px; }
.page-head h1 { font-size: 40px; line-height: 1.1; }
.narrow { max-width: 820px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.chips a { font-size: 13px; font-weight: 700; text-decoration: none; padding: 5px 10px; border: 1px solid var(--rule); background: var(--card); border-radius: 14px; }
.chips a:hover { border-color: var(--ink); color: var(--ink); }
.chips a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.yr { scroll-margin-top: 90px; }
.prose { font-size: 16px; line-height: 1.65; padding-bottom: 24px; }
.prose h2 { font-size: 20px; margin: 28px 0 6px; }

/* edition page */
.ed-head { background: var(--card); border-bottom: 1px solid var(--rule); padding: 20px 0 22px; }
.ed-head-in { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.ed-head h1 { font-size: 40px; line-height: 1.05; }
.ed-sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.ed-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ed-grid { display: grid; grid-template-columns: 220px minmax(0, 680px); gap: 40px; justify-content: center; padding-top: 28px; padding-bottom: 40px; }
.rail-in { position: sticky; top: 92px; }
.rail-h { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--muted); border-top: 3px solid var(--ink); padding-top: 8px; margin: 0 0 6px; }
.toc { margin: 0 0 22px; padding: 0; list-style: none; counter-reset: t; }
.toc li { counter-increment: t; border-bottom: 1px solid var(--rule); }
.toc a { display: flex; gap: 8px; padding: 7px 0; font-size: 14px; font-weight: 700; text-decoration: none; line-height: 1.3; }
.toc:not(.toc-plain) a::before { content: counter(t); color: var(--accent); min-width: 14px; }
.toc a.on { color: var(--accent); }
.pnav { display: grid; gap: 8px; }
.pn { display: block; background: var(--card); border: 1px solid var(--rule); padding: 8px 10px; font-size: 13px; font-weight: 700; text-decoration: none; }
.pn span { display: block; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.pn.off { color: var(--muted); }
.paper { min-width: 0; }
.paper h2[id] { scroll-margin-top: 96px; }
.paper .container { border-radius: 0 !important; box-shadow: 0 1px 0 var(--rule); }
.paper .container > tbody > tr:first-child > td { border-radius: 0 !important; }

/* heat strips (sections) */
.heat-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--rule); padding: 12px; }
.heat { border-collapse: separate; border-spacing: 2px; font-size: 13px; }
.heat th { font-weight: 700; text-align: left; white-space: nowrap; padding: 0 10px 0 0; }
.heat thead th { font-size: 10px; color: var(--muted); text-align: center; padding: 0 0 4px; line-height: 1.1; font-weight: 700; }
.heat thead th small { font-weight: 400; }
.heat th a { text-decoration: none; }
.heat td { width: 24px; min-width: 24px; height: 26px; padding: 0; }
.heat td.r { width: auto; padding: 0 10px 0 0; }
.heat td a { display: block; width: 100%; height: 100%; }
.heat td a:hover { outline: 2px solid var(--ink); }
.hp2 { background: var(--h2); } .hp1 { background: var(--h1); } .hz { background: var(--h0); } .hn1 { background: var(--hm1); } .hn2 { background: var(--hm2); }
.legend { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend i { width: 22px; height: 12px; display: inline-block; }
.legend span:first-child { margin-right: 4px; }
.legend span:nth-child(7) { margin-left: 4px; }
.dcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding-bottom: 24px; }
.dcard { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; background: var(--card); border: 1px solid var(--rule); padding: 12px 14px; text-decoration: none; }
.dcard:hover { border-color: var(--ink); color: var(--ink); }
.dcard .q { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }

/* line chart */
.chart { position: relative; margin: 0; background: var(--card); border: 1px solid var(--rule); padding: 8px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: #ececea; stroke-width: 1; }
.chart .zero { stroke: #b9b9b5; stroke-width: 1; }
.chart .tick { stroke: #b9b9b5; }
.chart .ax { font: 12px var(--sans); fill: var(--muted); }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart .end { fill: var(--neu); stroke: #fff; stroke-width: 2; } .chart .end.pos { fill: var(--pos); } .chart .end.neg { fill: var(--neg); }
.chart .xhair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hdot { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.chart .hit { fill: transparent; cursor: crosshair; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 4px; white-space: nowrap; transform: translate(-50%, -100%); margin-top: -10px; }
.tip b { font-size: 14px; }

/* footer */
.foot { background: var(--ink); color: #bdbdbd; margin-top: 48px; border-top: 4px solid var(--accent); font-size: 13px; }
.foot-in { display: grid; grid-template-columns: 1fr auto; gap: 8px 40px; padding-top: 28px; padding-bottom: 28px; }
.foot p { margin: 6px 0 0; max-width: 520px; }
.foot a { color: #fff; }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.foot-links a { text-decoration: none; font-weight: 700; }
.foot .fine { grid-column: 1 / -1; font-size: 12px; color: #8f8f8f; max-width: none; border-top: 1px solid #333; padding-top: 12px; margin-top: 12px; }

@media (max-width: 960px) {
  .two { grid-template-columns: 1fr; gap: 0; }
  .ed-grid { grid-template-columns: minmax(0, 680px); }
  .rail-in { position: static; }
  .rail .toc:not(.toc-plain) { display: flex; overflow-x: auto; gap: 6px; border: 0; }
  .rail .toc:not(.toc-plain) li { border: 0; flex: none; }
  .rail .toc:not(.toc-plain) a { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 5px 10px; font-size: 13px; white-space: nowrap; }
  .rail .toc-plain, .rail .rail-h:nth-of-type(2) { display: none; }
  .pnav { grid-template-columns: 1fr 1fr; }
  .pn.nx { text-align: right; }
}
@media (max-width: 720px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .chart { overflow-x: auto; }
  .chart svg { min-width: 640px; }
  .strip-in span:first-child { display: none; }
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--ink); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; border-bottom: 4px solid var(--accent); }
  .nav.open { display: flex; }
  .nav a { border-bottom: 1px solid #333; }
  .nav .btn-ghost { margin: 10px 0 0; text-align: center; }
  .mast-in { position: relative; min-height: 56px; }
  .brand-n { font-size: 17px; }
  .hero { grid-template-columns: 1fr; gap: 20px; padding-top: 20px; }
  .hero-cover { max-width: 220px; }
  .hero h1, .page-head h1, .ed-head h1 { font-size: 30px; }
  .lede { font-size: 16px; }
  .kpis > div { min-width: 0; flex: 1 1 40%; }
  .kpis b { font-size: 22px; }
  .dists { grid-template-columns: repeat(2, 1fr); }
  .ed-grid-cards { grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }
  .cv-m, .cv-y { font-size: 20px; }
  .cover-lg .cv-m, .cover-lg .cv-y { font-size: 40px; }
  .hide-s { display: none; }
  .foot-in { grid-template-columns: 1fr; }
  .ed-grid { padding-left: 0; padding-right: 0; }
  .rail { padding: 0 16px; }
  .ed-head-in { align-items: flex-start; }
}
@media print {
  .mast, .strip, .rail, .foot, .ed-actions { display: none !important; }
  body { background: #fff; }
}
