/* Swiss Economy Live: editorial look (design direction from Waspes) */
:root {
  --bg: #f6f4ee;
  --paper: #ffffff;
  --ink: #111111;
  --ink-2: #3d3d3d;
  --ink-3: #767676;
  --rule: #e2ded4;
  --grid: #ece9e2;
  --card: #ffffff;
  --red: #d52b1e;
  --indigo: #1f5a96;
  --coral: #d52b1e;
  --teal: #1f5a96;
  --band: rgba(31, 90, 150, 0.08);
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121211;
  --paper: #1b1a18;
  --ink: #f1eee6;
  --ink-2: #cfcbc1;
  --ink-3: #98948a;
  --rule: #2f2d29;
  --grid: #2a2926;
  --card: #1b1a18;
  --indigo: #5b8fd1;
  --coral: #e2554a;
  --teal: #5b8fd1;
  --band: rgba(91, 143, 209, 0.12);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.6; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; letter-spacing: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 28px; }

/* Masthead */
.masthead { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.masthead-row { display: flex; align-items: center; gap: 32px; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.cross { position: relative; width: 30px; height: 30px; background: var(--red); flex: none; }
.cross::before, .cross::after { content: ""; position: absolute; background: #fff; }
.cross::before { left: 12px; top: 6px; width: 6px; height: 18px; }
.cross::after { left: 6px; top: 12px; width: 18px; height: 6px; }
.brand-name { font-weight: 700; font-size: 17px; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a { text-decoration: none; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); border-bottom-color: var(--red); }
.theme { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--rule); background: transparent; cursor: pointer; flex: none; }
.theme:hover { border-color: var(--ink); }
.theme svg { width: 17px; height: 17px; fill: var(--ink-2); }

.ticker { background: #111; color: #f1eee6; font-size: 12.5px; letter-spacing: .04em; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.ticker::-webkit-scrollbar { display: none; }
:root[data-theme="dark"] .ticker { background: #000; border-top: 1px solid var(--rule); }
.ticker-row { display: flex; justify-content: center; gap: 0; padding: 9px 28px; min-width: max-content; margin: 0 auto; }
.ticker span { padding: 0 18px; }
.ticker span + span { border-left: 1px solid #3a3a3a; }
.ticker b { font-weight: 600; text-transform: uppercase; color: #a9a59b; margin-right: 8px; font-size: 11.5px; letter-spacing: .1em; }
.ticker > span { display: block; padding: 9px 28px; text-align: center; color: #a9a59b; }

/* Lead */
.lead { background: var(--paper); border-bottom: 1px solid var(--rule); position: relative; overflow: hidden; }
.lead-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 56px; align-items: center; padding-top: 64px; padding-bottom: 36px; }
.lead-text { border-left: 8px solid var(--red); padding-left: 32px; }
.dateline { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); }
.dateline i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none; animation: blink 2.4s ease-in-out infinite; }
.dateline.error i { animation: none; background: var(--ink-3); }
@keyframes blink { 50% { opacity: .25; } }
.lead h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(36px, 5.2vw, 66px); line-height: 1.04; }
.summary { margin: 22px 0 0; font-size: 19px; line-height: 1.6; color: var(--ink-2); max-width: 40em; }
.lead-figure { border-top: 3px solid var(--ink); padding-top: 18px; }
.kicker { margin: 0; font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); }
.big { margin: 4px 0 6px; font-family: var(--sans); font-weight: 700; font-size: clamp(72px, 9vw, 112px); line-height: 1; }
.caption { margin: 0; font-size: 15px; color: var(--ink-2); border-top: 1px solid var(--rule); padding-top: 10px; }
.alps-wrap { height: 70px; }
.alps { display: block; width: 100%; height: 70px; }
.alps .far { fill: none; stroke: var(--ink-3); stroke-width: 1; opacity: .35; vector-effect: non-scaling-stroke; }
.alps .near { fill: none; stroke: var(--ink); stroke-width: 1.25; opacity: .9; vector-effect: non-scaling-stroke; }
.alps-caption { margin: 0; padding-top: 10px; padding-bottom: 14px; font-size: 12.5px; font-style: italic; color: var(--ink-3); text-align: right; }

/* Key figures */
.figures { border-bottom: 1px solid var(--rule); }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding-top: 34px; padding-bottom: 34px; }
.tile { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6px 18px; text-decoration: none; color: inherit; min-width: 0; }
.tile + .tile { border-left: 1px solid var(--rule); }
.tile-value { order: 1; font-size: 34px; font-weight: 700; line-height: 1.1; }
.tile-label { order: 2; margin-top: 6px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tile-delta { order: 3; margin-top: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tile svg { order: 4; width: 80%; height: 24px; margin-top: 10px; overflow: visible; }
.tile:hover .tile-value { color: var(--red); }

/* Charts */
.charts { padding: 64px 0 72px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; padding-bottom: 16px; border-bottom: 3px solid var(--ink); }
.section-head h2 { font-family: var(--serif); font-weight: 800; font-size: clamp(30px, 3.6vw, 42px); line-height: 1.1; }
.range { display: flex; border: 1px solid var(--ink); }
.range button { padding: 7px 16px; border: 0; background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; letter-spacing: .06em; }
.range button + button { border-left: 1px solid var(--ink); }
.range button:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.range button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.chart-card { background: var(--paper); border: 1px solid var(--rule); padding: 26px 28px 24px; display: flex; flex-direction: column; min-width: 0; scroll-margin-top: 120px; }
.chart-card.four { grid-column: span 2; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.chart-head h2 { font-family: var(--serif); font-weight: 800; font-size: 26px; line-height: 1.15; }
.chart-head .sub { margin: 4px 0 0; font-size: 14px; color: var(--ink-3); }
.view-btn { flex: none; padding: 4px 0; border: 0; border-bottom: 1px solid var(--ink-3); background: transparent; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.view-btn:hover { color: var(--red); border-bottom-color: var(--red); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.legend .key { width: 18px; height: 2px; }
.legend .key.box { width: 10px; height: 10px; }
.plot { position: relative; margin-top: 10px; outline: none; }
.plot:focus-visible { box-shadow: 0 0 0 2px var(--ink); }
.plot svg { display: block; width: 100%; overflow: visible; }
.plot text { font-family: var(--sans); font-size: 12px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.plot .end-label { fill: var(--ink); font-weight: 600; }
.plot .note { fill: var(--ink-2); font-size: 11.5px; }
.table-wrap { margin-top: 12px; max-height: 260px; overflow: auto; border-top: 1px solid var(--ink); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table-wrap th, .table-wrap td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.table-wrap th:first-child, .table-wrap td:first-child { text-align: left; }
.table-wrap th { position: sticky; top: 0; background: var(--paper); font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); font-weight: 600; }
.ib { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 15.5px; line-height: 1.65; color: var(--ink-2); }
.ib::before { content: "What this means"; display: block; margin-bottom: 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--red); }
.ib p { margin: 0 0 10px; }
.ib p:last-child { margin-bottom: 0; }
.ib strong { color: var(--ink); font-weight: 600; }
.chart-card.four .ib { columns: 2; column-gap: 40px; }
.chart-card.four .ib::before { column-span: all; }
.chart-card.four .ib p { break-inside: avoid; }
.empty { padding: 40px 10px; text-align: center; color: var(--ink-3); font-size: 14px; }

.tooltip { position: fixed; z-index: 50; pointer-events: none; min-width: 140px; padding: 9px 12px; font-size: 13px; background: var(--paper); color: var(--ink); border: 1px solid var(--ink); box-shadow: 4px 4px 0 color-mix(in srgb, var(--ink) 12%, transparent); }
.tooltip .t-date { color: var(--ink-3); margin-bottom: 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; }
.tooltip .t-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tooltip .t-row b { font-variant-numeric: tabular-nums; }
.tooltip .t-row .k { width: 12px; height: 2px; flex: none; }
.tooltip .t-row span:last-child { color: var(--ink-3); }

/* Footer */
.footer { background: #111; color: #a9a59b; font-size: 14px; padding: 48px 0 56px; }
:root[data-theme="dark"] .footer { background: #000; border-top: 1px solid var(--rule); }
.footer-grid { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 48px; }
.footer h4 { color: #f1eee6; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 12px; }
.footer p { margin: 0 0 8px; line-height: 1.65; }
.footer a { color: #f1eee6; }
.footer .small { font-size: 12.5px; color: #7d7a72; }

@media (max-width: 980px) {
  .lead-grid { grid-template-columns: 1fr; gap: 32px; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 26px; }
  .tile:nth-child(4) { border-left: 0; }
  .grid { grid-template-columns: 1fr; }
  .chart-card.four { grid-column: auto; }
  .chart-card.four .ib { columns: 1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .wrap { padding: 0 18px; }
  .masthead-row { gap: 14px; height: 58px; }
  .nav { display: none; }
  .theme { margin-left: auto; }
  .brand-name { font-size: 15px; }
  .ticker-row { justify-content: flex-start; padding: 9px 18px; }
  .lead-grid { padding-top: 40px; }
  .lead-text { padding-left: 20px; border-left-width: 6px; }
  .summary { font-size: 17px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile:nth-child(odd) { border-left: 0; }
  .tile:nth-child(4) { border-left: 1px solid var(--rule); }
  .tile:last-child { grid-column: span 2; }
  .tile-value { font-size: 28px; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .chart-card { padding: 20px 18px; }
  .chart-head h2 { font-size: 22px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (prefers-reduced-motion: reduce) { .dateline i { animation: none; } html { scroll-behavior: auto; } }
