/* Maldives National Debt Clock: shared styles */
:root {
  --sky: #d7ecef; --sky-low: #eef6f4; --paper: #f3f8f8;
  --lagoon: #3fb8b0; --deep: #0b4f6c; --abyss: #072f40; --trench: #05222f;
  --sun: #f4c95d; --coral: #ff8a6b; --red: #ff5f56; --amber: #f2a541;
  --foam: #ffffff; --ink: #072f40; --mist: #a9cdd6; --muted: #4a6b78; --rule: #cfe0e3;
  --display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --gutter: max(1.25rem, env(safe-area-inset-left));
  --head-h: 3.6rem;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { scroll-padding-top: calc(var(--head-h) + 1rem); }
body { font-family: var(--body); color: var(--ink); background: var(--abyss); line-height: 1.5; -webkit-font-smoothing: antialiased; }
.num { font-variant-numeric: tabular-nums; }
a { color: var(--sun); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }

/* ---------- sticky site header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem 1.5rem;
  min-height: var(--head-h); padding: max(.5rem, env(safe-area-inset-top)) var(--gutter) .5rem;
  background: rgba(7, 47, 64, .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--foam); border-bottom: 1px solid rgba(169, 205, 214, .14);
}
.brand { font-family: var(--display); font-weight: 800; font-variation-settings: "wdth" 80; font-size: 1.15rem; color: var(--foam); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--sun); }
.site-nav { display: flex; gap: .25rem; flex: 1; min-width: 0; }
.site-nav a { color: var(--mist); text-decoration: none; font-weight: 700; font-size: .92rem; padding: .45rem .7rem; border-radius: 6px; white-space: nowrap; }
.site-nav a:hover { color: var(--foam); background: rgba(255,255,255,.06); }
.site-nav a[aria-current="page"] { color: var(--foam); box-shadow: inset 0 -2px 0 var(--sun); border-radius: 6px 6px 0 0; }
.prefs { display: flex; gap: .5rem; align-items: center; }

.toggle { display: inline-flex; background: rgba(255,255,255,.08); border-radius: 999px; padding: 3px; }
.toggle button { font: 700 .85rem var(--body); border: 0; background: transparent; color: var(--mist); padding: .4rem .8rem; border-radius: 999px; cursor: pointer; min-height: 2.1rem; white-space: nowrap; }
.toggle button[aria-pressed="true"] { background: var(--sun); color: var(--abyss); }
.toggle[hidden] { display: none; }

.site-head.tight { flex-wrap: wrap; row-gap: .2rem; padding-bottom: .3rem; }
.site-head.tight .brand { order: 1; flex: 1; } .site-head.tight .prefs { order: 2; }
.site-head.tight .site-nav { order: 3; flex-basis: 100%; flex-wrap: wrap; margin: 0 calc(-.7rem); }
@media (max-width: 860px) {
  :root { --head-h: 5.6rem; }
  .site-head { flex-wrap: wrap; row-gap: .35rem; padding-bottom: .35rem; }
  .brand { order: 1; flex: 1; }
  .prefs { order: 2; }
  .site-nav { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { font-size: .875rem; padding: .35rem .6rem; }
  /* every tab in view, no sideways scrolling: they wrap onto a second line where needed */
  .site-nav { flex-wrap: wrap; overflow: visible; }
  .toggle button { padding: .35rem .6rem; font-size: .8rem; min-height: 2rem; }
}
@media (max-width: 600px) {
  .site-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 .15rem; margin: 0 calc(-.5 * var(--gutter)); padding: 0; }
  .site-nav a { font-size: .8rem; padding: .4rem .15rem; text-align: center; }
}
@media (max-width: 520px) {
  .brand { font-size: .98rem; }
  .prefs { gap: .35rem; }
  .toggle button { padding: .3rem .5rem; font-size: .75rem; min-height: 1.9rem; }
}
@media (max-width: 350px) { .brand span { display: none; } }

/* banner shown when "Real" is on: lives inside the sticky header so it stays on screen */
.site-head { flex-wrap: wrap; }
.real-note { display: none; flex-basis: 100%; order: 10; margin: .45rem calc(-1 * var(--gutter)) -.5rem; background: var(--sun); color: var(--abyss); font-size: .875rem; font-weight: 700; padding: .4rem var(--gutter); text-align: center; line-height: 1.35; }
.real-note .short { display: none; }
body.is-real .real-note { display: block; }
@media (max-width: 860px) {
  .real-note { margin-top: .25rem; margin-bottom: -.35rem; font-size: .8rem; padding: .3rem var(--gutter); }
  .real-note .long { display: none; } .real-note .short { display: inline; }
}

/* ---------- dark content pages ---------- */
main.dark { color: var(--foam); background: var(--abyss); padding: 4rem var(--gutter) 3rem; }
.wrap { max-width: 72rem; margin: 0 auto; }
main.dark section { margin: 0 0 5rem; }
main.dark h1 { font-family: var(--display); font-weight: 800; font-variation-settings: "wdth" 72; font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1; margin: 0 0 1rem; }
main.dark h2 { font-family: var(--display); font-weight: 700; font-variation-settings: "wdth" 85; font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 1rem; line-height: 1.1; }
main.dark h3 { font: 700 1.05rem var(--body); margin: 2.5rem 0 1rem; }
main.dark p { max-width: 40rem; margin: 0 0 1rem; color: var(--mist); }
main.dark p b, main.dark p strong { color: var(--foam); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 2.5rem 3rem; }
.stat .n { font-family: var(--display); font-weight: 800; font-variation-settings: "wdth" 70; font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1; color: var(--foam); white-space: nowrap; }
.stat .n small { font-size: .55em; font-weight: 500; color: var(--mist); }
.stat .l { color: var(--mist); margin-top: .55rem; max-width: 22rem; }
.stat.hot .n { color: var(--sun); }
.stat.red .n { color: var(--red); }
.stat.warn .n { color: var(--coral); }

.callout { font-family: var(--display); font-variation-settings: "wdth" 85; font-weight: 500; font-size: clamp(1.25rem, 3vw, 1.75rem); line-height: 1.3; color: var(--foam); max-width: 46rem; margin: 0 0 1rem; }
.callout b { color: var(--sun); font-weight: 800; }
.callout b.red { color: var(--red); }

.chart-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.chart-box { position: relative; margin-top: 1.25rem; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart-box svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-box text { fill: var(--mist); font-family: var(--body); font-size: 12px; }
.chart-box text.band-label { font-size: 11px; font-weight: 700; }
.chart-box text.mark-label { fill: var(--foam); font-size: 12px; font-weight: 700; }
.tip { position: absolute; top: 0; z-index: 5; pointer-events: none; background: var(--foam); color: var(--ink); border-radius: 6px; padding: .6rem .8rem; font-size: .875rem; line-height: 1.35; min-width: 12rem; max-width: 17rem; box-shadow: 0 6px 24px rgba(0,0,0,.25); opacity: 0; transition: opacity .12s; }
.tip.on { opacity: 1; }
.tip b { display: block; font-size: .95rem; margin-bottom: .2rem; }
.tip .row { display: flex; justify-content: space-between; gap: 1rem; }
.tip .row span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.tip .tag { display: inline-block; margin-top: .35rem; padding: .05rem .4rem; border-radius: 3px; font-size: .8rem; font-weight: 700; color: #fff; }
.hint { font-size: .85rem; color: var(--mist); margin-top: .5rem; }
.key { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: .75rem; font-size: .875rem; color: var(--mist); }
.key i { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; margin-right: .4rem; transform: translateY(.1rem); }
.key i.line { height: 3px; transform: translateY(-.15rem); }

.subtoggle { display: inline-flex; background: rgba(255,255,255,.08); border-radius: 999px; padding: 3px; }
.subtoggle button { font: 700 .85rem var(--body); border: 0; background: transparent; color: var(--mist); padding: .4rem .85rem; border-radius: 999px; cursor: pointer; min-height: 2.1rem; }
.subtoggle button[aria-pressed="true"] { background: var(--foam); color: var(--abyss); }

.site-foot { color: var(--mist); font-size: .875rem; padding: 2rem var(--gutter) max(2rem, env(safe-area-inset-bottom)); background: var(--trench); }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; }
.site-foot a { color: var(--mist); }

@media (max-width: 600px) {
  main.dark { padding-top: 3rem; }
  main.dark section { margin-bottom: 3.5rem; }
  .stats { gap: 2rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.foot-links { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.stale-note { background: #ffe1d6; color: #5c1d0c; font-size: .9rem; padding: .5rem var(--gutter); text-align: center; }
.stale-note p { margin: .15rem auto; max-width: 60rem; color: inherit !important; }

/* ---------- small graphics inside stat cards ---------- */
.mini { margin-top: .95rem; max-width: 19rem; color: var(--lagoon); }
.mini .cap { display: flex; justify-content: space-between; gap: .75rem; font-size: .78rem; color: var(--mist); margin-top: .4rem; line-height: 1.3; }
.mini .cap b { color: var(--foam); }
.meter { position: relative; height: .6rem; background: rgba(255,255,255,.1); border-radius: 999px; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; background: currentColor; border-radius: 999px; }
.meter b { position: absolute; top: -.3rem; bottom: -.3rem; width: 2px; background: var(--foam); border-radius: 1px; }
.spark svg { display: block; width: 100%; height: 2.8rem; overflow: visible; }
.waffle { display: grid; grid-template-columns: repeat(20, 1fr); gap: 2px; }
.waffle i { aspect-ratio: 1; background: rgba(255,255,255,.12); border-radius: 1px; }
.waffle i.on { background: currentColor; }
.duo { display: grid; gap: .45rem; }
.duo div { display: grid; grid-template-columns: 1fr; gap: .2rem; }
.duo span { display: flex; justify-content: space-between; gap: .75rem; font-size: .78rem; color: var(--mist); }
.duo span b { color: var(--foam); }
.duo .t { height: .55rem; border-radius: 999px; background: rgba(255,255,255,.08); position: relative; }
.duo .t i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.mini-key { font-size: .82rem; color: var(--mist); margin-top: 1.5rem; display: flex; align-items: center; gap: .5rem; }
.mini-key b { display: inline-block; width: 2px; height: .9rem; background: var(--foam); }

/* ---------- interest ticker that follows the page ---------- */
.ticker { position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 60;
  display: flex; align-items: center; gap: .75rem; padding: .55rem .6rem .55rem .9rem; border-radius: 999px;
  background: rgba(5, 34, 47, .94); border: 1px solid rgba(255,138,107,.45); box-shadow: 0 8px 28px rgba(0,0,0,.35);
  color: #a9cdd6; font: .8rem/1.2 var(--body); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ticker { transition: opacity .3s, transform .3s; }
.ticker.away { opacity: 0; transform: translateY(1rem); pointer-events: none; }
.ticker .dot { width: .5rem; height: .5rem; border-radius: 50%; background: #ff8a6b; flex: none; }
.ticker .lbl { display: block; font-size: .75rem; margin-bottom: .15rem; }
.ticker .pair { display: flex; gap: 1.1rem; }
.ticker .item { display: block; }
.ticker .k { display: block; font-size: .72rem; color: #a9cdd6; }
.ticker .v.debt { color: #f4c95d; }
.ticker .now { display: block; margin-top: .3rem; padding-top: .3rem; border-top: 1px solid rgba(169,205,214,.18); font-size: .75rem; }
.ticker .now b { color: #fff; font-family: var(--display); font-weight: 800; font-variation-settings: "wdth" 72; font-size: 1.05rem; margin-left: .25rem; }
.ticker .v { display: block; font-family: var(--display); font-weight: 800; font-variation-settings: "wdth" 72; font-size: 1.25rem; color: #ff8a6b; font-variant-numeric: tabular-nums; }
.ticker a { color: inherit; text-decoration: none; }
.ticker button { border: 0; background: transparent; color: #a9cdd6; font-size: 1.1rem; line-height: 1; width: 1.9rem; height: 1.9rem; border-radius: 50%; cursor: pointer; flex: none; }
.ticker button:hover { background: rgba(255,255,255,.08); color: #fff; }
@keyframes pulse { 70% { box-shadow: 0 0 0 .5rem rgba(255,138,107,0); } 100% { box-shadow: 0 0 0 0 rgba(255,138,107,0); } }
@media (max-width: 520px) { .ticker { left: max(.75rem, env(safe-area-inset-left)); right: max(.75rem, env(safe-area-inset-right)); justify-content: space-between; } }
.site-foot { padding-bottom: max(5.5rem, env(safe-area-inset-bottom)); }

/* ---------- theme button ---------- */
.theme-btn { border: 0; background: rgba(255,255,255,.08); color: var(--mist); width: 2.4rem; height: 2.4rem; border-radius: 50%; cursor: pointer; display: inline-grid; place-items: center; flex: none; }
.theme-btn:hover { color: var(--foam); }
.theme-btn svg { width: 1.1rem; height: 1.1rem; }
@media (max-width: 520px) { .theme-btn { width: 2rem; height: 2rem; } }

/* ---------- themes ---------- */
html[data-theme="light"] {
  --abyss: #f4f8f8; --trench: #e3eef0; --foam: #072f40; --mist: #45646f;
  --sun: #9a6a00; --lagoon: #17807a; --coral: #c24e2c; --red: #c4362c; --amber: #a86400;
}
html[data-theme="light"] body { background: var(--abyss); }
html[data-theme="light"] .site-head { background: rgba(244, 248, 248, .95); border-bottom-color: rgba(7, 47, 64, .12); }
html[data-theme="light"] .site-nav a:hover { background: rgba(7, 47, 64, .06); }
html[data-theme="light"] :is(.toggle, .subtoggle, .theme-btn) { background: rgba(7, 47, 64, .08); }
html[data-theme="light"] .toggle button[aria-pressed="true"] { color: #fff; }
html[data-theme="light"] :is(select, .bar, .used, .used .t, .callout-line, .l12, .crisis, .bar-share, .cases-list .bar, .meter, .duo .t, .waffle i:not(.on), form) { background-color: rgba(7, 47, 64, .07); }
html[data-theme="light"] .tip { background: #fff; color: #072f40; border: 1px solid #cfe0e3; }
html[data-theme="light"] .chart-box text.mark-label { fill: #072f40; }
html[data-theme="light"] :is(.hero, .masthead) { --abyss: #072f40; --foam: #ffffff; --mist: #a9cdd6; --sun: #f4c95d; --lagoon: #3fb8b0; --coral: #ff8a6b; --red: #ff5f56; }
html[data-theme="light"] .masthead { background: #0b4f6c; }

html[data-theme="contrast"] {
  --abyss: #000; --trench: #000; --deep: #00222e; --foam: #fff; --mist: #e6f3f5;
  --sun: #ffdb4d; --lagoon: #4fe3d8; --coral: #ffa386; --red: #ff6f66; --amber: #ffbe55;
}
html[data-theme="contrast"] .site-head { background: rgba(0, 0, 0, .96); border-bottom-color: rgba(255,255,255,.35); }
html[data-theme="contrast"] .chart-box text { fill: #e6f3f5; }
html[data-theme="contrast"] :is(.hero, .masthead) { --abyss: #072f40; }

/* ---------- icons on headline figures ---------- */
.ico { display: inline-grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: 50%; background: rgba(255,255,255,.07); color: var(--mist); margin-bottom: .85rem; }
.ico svg { width: 1.55rem; height: 1.55rem; }
.stat.hot > .ico { color: var(--sun); } .stat.red > .ico { color: var(--red); } .stat.warn > .ico { color: var(--coral); } .stat.teal > .ico { color: var(--lagoon); }
html:is([data-theme="light"],[data-theme="sand"],[data-theme="lagoon"]) .ico { background: rgba(7,47,64,.07); }

/* ---------- freshness, last visit, period picker ---------- */
.fresh { display: flex; align-items: flex-start; gap: .6rem; flex-wrap: wrap; margin: 1.25rem 0 0; padding: .7rem .95rem; border-radius: 8px; background: rgba(255,255,255,.05); color: var(--mist); font-size: .9rem; line-height: 1.45; max-width: 52rem; }
.fresh b { color: var(--foam); }
.fresh .dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--mist); margin-top: .45rem; flex: none; }
.fresh.is-new .dot { background: var(--lagoon); }
.fresh .badge { font-size: .8rem; font-weight: 700; color: var(--lagoon); margin-top: .05rem; }
.fresh span:last-child { flex: 1; min-width: 14rem; }
.since { position: relative; margin: 0 0 2.5rem; padding: 1rem 3rem 1rem 1.2rem; border-radius: 10px; background: rgba(244,201,93,.12); border: 1px solid rgba(244,201,93,.35); color: var(--foam); max-width: 52rem; }
.since b { display: block; margin-bottom: .35rem; }
.since ul { margin: 0; padding-left: 1.1rem; color: var(--mist); }
.since li { margin: .15rem 0; }
.since li b { display: inline; margin: 0; color: var(--foam); }
.since button { position: absolute; top: .5rem; right: .5rem; border: 0; background: transparent; color: var(--mist); font-size: 1.2rem; width: 2rem; height: 2rem; border-radius: 50%; cursor: pointer; }
.period-pick { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-top: 1.25rem; }
.period-pick label { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--foam); }
.period-pick select { font: 700 .9rem var(--body); background: rgba(255,255,255,.08); color: var(--foam); border: 1px solid rgba(169,205,214,.3); border-radius: 6px; padding: .35rem .45rem; min-height: 2.2rem; max-width: 100%; }
.period-pick select option { color: #072f40; background: #fff; }
.period-pick .pill { font: 700 .85rem var(--body); border: 1px solid rgba(169,205,214,.35); background: transparent; color: var(--foam); padding: .35rem .75rem; border-radius: 999px; cursor: pointer; min-height: 2.1rem; }
.period-pick .hint-old { color: var(--sun); font-size: .9rem; font-weight: 700; }
html:is([data-theme="light"],[data-theme="sand"],[data-theme="lagoon"]) :is(.fresh, .period-pick select) { background-color: rgba(7,47,64,.06); }
html:is([data-theme="light"],[data-theme="sand"],[data-theme="lagoon"]) .since { background: rgba(166,108,0,.08); border-color: rgba(166,108,0,.3); }

/* ---------- pop-up explanations ---------- */
.explain { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 1.25rem; background: rgba(2, 20, 28, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.explain[hidden] { display: none !important; }
.explain-box { position: relative; max-width: 32rem; width: 100%; background: #fff; color: #072f40; border-radius: 14px; padding: 1.6rem 1.6rem 1.4rem; box-shadow: 0 20px 60px rgba(0,0,0,.4); font: 1rem/1.6 var(--body); }
.explain-box h3 { margin: 0 2rem .6rem 0; font-family: var(--display); font-size: 1.35rem; line-height: 1.2; color: #072f40; }
.explain-box p { margin: 0 0 1.1rem; color: #2f4f5a; }
.explain-box .more { color: #0b6f8a; font-weight: 700; }
.explain-box .x { position: absolute; top: .6rem; right: .6rem; width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 0; background: #eef4f5; color: #072f40; font-size: 1.3rem; cursor: pointer; }
[data-term] { cursor: help; }
.explain-box { max-height: calc(100vh - 2.5rem); overflow-y: auto; }
.explain-box .scale { list-style: none; margin: 0 0 .7rem; padding: 0; display: grid; gap: .2rem; }
.explain-box .scale li { display: grid; grid-template-columns: 7.2rem 1fr auto; gap: .6rem; align-items: center; padding: .32rem .6rem; border-radius: 7px; background: #f1f6f7; font-size: .9rem; line-height: 1.3; }
.explain-box .scale b { color: #072f40; } .explain-box .scale span { color: #2f4f5a; }
.explain-box .scale li.here { background: #072f40; } .explain-box .scale li.here b, .explain-box .scale li.here span { color: #fff; }
.explain-box .scale em { font: 800 .72rem var(--body); font-style: normal; text-transform: uppercase; letter-spacing: .05em; background: #f4c95d; color: #072f40; padding: .15rem .45rem; border-radius: 999px; }
.explain-box .scale li.scale-line { display: block; background: none; border-top: 2px dashed #9bb7bf; border-radius: 0; padding: .25rem 0 0; margin-top: .15rem; font-size: .75rem; color: #5a7882; }
.explain-box .scale-note { font-size: .9rem; margin: 0 0 .4rem; }
.explain-box .more[hidden] { display: none; }
.cm-body .term { border-bottom: 2px dotted var(--sun); cursor: help; }
.term { border-bottom: 2px dotted currentColor; text-decoration: none; color: inherit; }
.q { border: 1px solid rgba(169,205,214,.4); background: transparent; color: var(--mist); width: 1.7rem; height: 1.7rem; border-radius: 50%; font: 700 .85rem var(--body); cursor: pointer; flex: none; }
.q:hover { color: var(--foam); border-color: var(--foam); }
.ico svg { overflow: visible; }

/* ---------- updates feed ---------- */
.upd { display: grid; grid-template-columns: 2.9rem 1fr minmax(9rem, 13rem); gap: 1rem 1.25rem; padding: 1.15rem 1.2rem; border-radius: 10px; background: rgba(255,255,255,.045); }
.upd > .ico { color: var(--c); margin: 0; }
.upd h3 { margin: .2rem 0 .35rem; color: var(--foam); font-family: var(--display); font-size: clamp(1.1rem, 2.3vw, 1.35rem); line-height: 1.25; }
.upd p { margin: .2rem 0; color: var(--mist); font-size: .95rem; line-height: 1.5; max-width: 46rem; }
.upd-tag { display: flex; flex-wrap: wrap; gap: .25rem .75rem; font-size: .8rem; color: var(--mist); }
.upd-tag b { color: var(--c); text-transform: uppercase; letter-spacing: .06em; font-size: .74rem; }
.upd-go { display: inline-block; margin-top: .5rem; font-weight: 700; font-size: .9rem; color: var(--sun); text-decoration: none; }
.upd-go:hover { text-decoration: underline; }
.upd-list { display: grid; gap: .8rem; }
html:is([data-theme="light"],[data-theme="sand"],[data-theme="lagoon"]) .upd { background: rgba(7,47,64,.05); }

/* ---------- pickers that stay in view while the charts below them change ---------- */
.period-zone > .period-pick { position: sticky; top: var(--headH, 60px); z-index: 25; margin: 0 -1.25rem 2rem; padding: .7rem 1.25rem; background: color-mix(in srgb, var(--abyss) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid rgba(169,205,214,.18); }
.period-zone > .period-pick label span { color: var(--sun); }
.period-pick.sticky-only { position: sticky; top: var(--headH, 60px); z-index: 25; }

/* ---------- way back to the page the reader came from ---------- */
.back-to { position: fixed; left: max(1rem, env(safe-area-inset-left)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 55; background: var(--sun); color: #072f40; font: 700 .9rem var(--body); padding: .5rem .9rem; border-radius: 999px; text-decoration: none; box-shadow: 0 6px 20px rgba(0,0,0,.3); }

/* ---------- a small dot on Updates when there is something new since the last look ---------- */
.nav-new { display: inline-block; width: .4rem; height: .4rem; margin-left: .35rem; border-radius: 50%; background: var(--sun); vertical-align: .15em; }

.upd-viz { align-self: center; text-align: right; color: var(--c); }
.upd-big { font-family: var(--display); font-weight: 800; font-variation-settings: "wdth" 72; font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1; color: var(--c); white-space: nowrap; }
.upd-bl { font-size: .8rem; color: var(--mist); margin: .25rem 0 .5rem; }
.upd-viz .mini { max-width: none; margin-top: .3rem; }
.upd-viz .spark svg { height: 2.6rem; }
.upd .term { color: var(--foam); font-size: .88rem; }
@media (max-width: 640px) { .upd { grid-template-columns: 2.6rem 1fr; } .upd-viz { grid-column: 2; text-align: left; } }

@media (max-width: 520px) { .back-to { bottom: calc(max(.75rem, env(safe-area-inset-bottom)) + 4.2rem); } }

/* ---------- year shown, and stepping one period at a time ---------- */
.yr-chip { font-family: var(--display); font-weight: 800; font-variation-settings: "wdth" 75; font-size: 1.35rem; line-height: 1; color: #072f40; background: var(--sun); border-radius: 8px; padding: .35rem .6rem; }
.period-pick .step { font: 700 .88rem var(--body); border: 1px solid rgba(169,205,214,.4); background: rgba(255,255,255,.06); color: var(--foam); padding: .4rem .8rem; border-radius: 999px; cursor: pointer; min-height: 2.25rem; }
.period-pick .step:hover:not(:disabled) { border-color: var(--foam); }
.period-pick .step:disabled { opacity: .35; cursor: default; }
.cases-pick { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: 1.5rem 0 1rem; }
.cases-pick label { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--foam); }
.cases-pick label span { color: var(--sun); }
@media (max-width: 600px) { .period-pick .step { padding: .35rem .6rem; } .yr-chip { font-size: 1.15rem; } }

/* ---------- the notice about official sources, after a minute on the site ---------- */
.src-notice { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 1.25rem; background: rgba(2, 20, 28, .7); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: src-in .35s ease both; }
.src-notice.out { opacity: 0; transition: opacity .25s; }
.src-card { position: relative; max-width: 30rem; width: 100%; background: #072f40; color: #fff; border: 3px solid #f4c95d; border-radius: 16px; padding: 1.7rem 1.6rem 1.5rem; box-shadow: 0 0 0 6px rgba(244,201,93,.18), 0 24px 70px rgba(0,0,0,.5); text-align: center; animation: src-pop .45s cubic-bezier(.2,.8,.2,1.15) both; }
.src-ico { width: 3.2rem; height: 3.2rem; margin: 0 auto .8rem; border-radius: 50%; background: #f4c95d; color: #072f40; display: grid; place-items: center; font: 800 1.6rem var(--display); }
.src-card h3 { margin: 0 0 .7rem; font: 800 1.45rem/1.15 var(--display); font-variation-settings: "wdth" 80; color: #fff; }
.src-card p { margin: 0 0 .8rem; color: #cfe6ea; font-size: .98rem; line-height: 1.55; }
.src-card p b { color: #fff; }
.src-card .src-small { font-size: .85rem; color: #a9cdd6; }
.src-card .src-small a { color: #f4c95d; font-weight: 700; }
.src-card .x { position: absolute; top: .6rem; right: .6rem; width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #fff; font-size: 1.3rem; cursor: pointer; }
.src-ok { margin-top: .4rem; font: 800 1rem var(--body); background: #f4c95d; color: #072f40; border: 0; border-radius: 999px; padding: .7rem 2.2rem; cursor: pointer; }
.src-ok:hover { background: #ffd97a; }
@keyframes src-in { from { opacity: 0; } }
@keyframes src-pop { from { opacity: 0; transform: translateY(16px) scale(.94); } }
@media (prefers-reduced-motion: reduce) { .src-notice, .src-card { animation: none; } }


/* commentary: the ribbon under the menu, and the commentary page */
.cm-ribbon { position: relative; z-index: 40; display: flex; align-items: center; gap: .5rem; padding: .55rem var(--gutter); background: linear-gradient(90deg, #f4c95d, #f8d77f); color: #07303f; box-shadow: 0 4px 14px -8px rgba(0,0,0,.6); animation: cm-in .35s ease-out; }
@keyframes cm-in { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cm-ribbon { animation: none; } }
.cm-r-link { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; color: #07303f; text-decoration: none; max-width: 76rem; margin: 0 auto; }
.cm-r-tag { font: 800 .72rem var(--body); text-transform: uppercase; letter-spacing: .06em; background: #07303f; color: #f4c95d; padding: .2rem .55rem; border-radius: 999px; }
.cm-r-t { font: 700 .95rem var(--body); } .cm-r-go { font: 800 .92rem var(--body); text-decoration: underline; }
.cm-r-x { border: 0; background: rgba(7,48,63,.12); color: #07303f; width: 1.9rem; height: 1.9rem; border-radius: 50%; font-size: 1.15rem; cursor: pointer; flex: none; }
.cm-page { max-width: 46rem; }
.cm-intro { color: var(--mist); font-size: 1.02rem; }
.cm-post { margin: 1.6rem 0 2.4rem; padding: 1.4rem 1.5rem 1.2rem; border: 1px solid rgba(169,205,214,.25); border-radius: 14px; background: rgba(255,255,255,.035); }
.cm-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem; font-size: .85rem; color: var(--mist); margin: 0 0 .8rem; padding-bottom: .7rem; border-bottom: 1px solid rgba(169,205,214,.18); }
.cm-meta span { font-weight: 700; color: var(--foam); }
.cm-title { font: 800 1.35rem/1.3 var(--body); color: var(--foam); margin: 0 0 .8rem; }
.cm-body { font-size: 1.02rem; line-height: 1.65; }
main .cm-post .cm-body p, main .cm-post .cm-body li { color: var(--foam); }
.cm-body p { margin: 0 0 .85rem; } .cm-body ul { margin: -.4rem 0 .85rem; padding-left: 1.2rem; } .cm-body li { margin: .2rem 0; }
.cm-body a, .cm-src a { color: var(--sun); }
.cm-sign { margin: 1.1rem 0 0; font: 800 1.05rem var(--body); color: var(--foam); } .cm-sign a { display: block; font: 600 .85rem var(--body); color: var(--sun); margin-top: .1rem; }
.cm-label { font-size: .8rem; color: var(--mist); margin: .9rem 0 0; }
.cm-src { font-size: .8rem; color: var(--mist); margin: .4rem 0 0; }
main.dark .cm-post p { max-width: none; } main.dark .cm-post p.cm-meta { margin: 0 0 .8rem; color: var(--mist); } main.dark .cm-post .cm-body p { margin: 0 0 .85rem; }
main.dark .cm-post p.cm-sign { margin: 1.1rem 0 0; color: var(--foam); } main.dark .cm-post p.cm-label { margin: .9rem 0 0; } main.dark .cm-post p.cm-src { margin: .4rem 0 0; }
main.dark .cm-post { background: #fbf0cf; border-color: transparent; box-shadow: 0 10px 30px -12px rgba(0,0,0,.5); }
main.dark .cm-post .cm-title, main.dark .cm-post .cm-body p, main.dark .cm-post .cm-body li, main.dark .cm-post p.cm-sign { color: #0b2f3d; }
main.dark .cm-post p.cm-meta, main.dark .cm-post p.cm-label, main.dark .cm-post p.cm-src { color: #4d6a74; } main.dark .cm-post .cm-meta { border-color: rgba(7,47,64,.15); }
main.dark .cm-post a, main.dark .cm-post .cm-sign a { color: #0b6f8a; } main.dark .cm-post .cm-body .term { border-color: #0b6f8a; }
main.dark .cm-post .cm-acts button { color: #0b2f3d; border-color: rgba(7,47,64,.3); }
.cm-b { padding: .85rem 1rem .1rem; border-radius: 10px; margin: 0 0 .8rem; border-left: 4px solid; }
.cm-n { background: #fffdf7; border-color: #d8ccaa; } .cm-g { background: #dcf0df; border-color: #3f9a5c; } .cm-r { background: #f8dcd5; border-color: #cf634d; }
.cm-key { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; color: #4d6a74; }
.cm-key i { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-left: .45rem; border-left: 3px solid; }
.cm-key .k-n { background: #fffdf7; border-color: #d8ccaa; } .cm-key .k-g { background: #dcf0df; border-color: #3f9a5c; } .cm-key .k-r { background: #f8dcd5; border-color: #cf634d; }
main.dark .cm-post p.cm-meta { align-items: center; } main.dark .cm-post .cm-meta .cm-key { color: #4d6a74; font-weight: 600; }
.cm-acts { margin-top: 1rem; } .cm-acts button { border: 1px solid rgba(169,205,214,.4); background: transparent; color: var(--foam); border-radius: 999px; padding: .4rem .95rem; font: 700 .85rem var(--body); cursor: pointer; }

/* ---------- a weekly report Ministry of Finance replaced: badge and what changed ---------- */
.rev-badge { display: inline-flex; align-items: center; gap: .4rem; font: 700 .85rem var(--body); color: var(--abyss); background: var(--sun); border: 0; border-radius: 999px; padding: .32rem .75rem .32rem .55rem; cursor: pointer; line-height: 1.2; box-shadow: 0 0 0 3px rgba(244,201,93,.25); }
.rev-badge:not(.changed) { background: transparent; color: var(--sun); box-shadow: inset 0 0 0 1.5px var(--sun); }
.rev-badge .rev-ico { font-size: 1rem; line-height: 1; }
.rev-badge .rev-q { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; margin-left: .15rem; }
.rev-badge:hover, .rev-badge:focus-visible { outline: 2px solid var(--foam); outline-offset: 2px; }
.explain-box .rev-tbl { overflow-x: auto; margin: 0 0 .8rem; }
.explain-box .rev-tbl table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.explain-box .rev-tbl th { text-align: right; font-size: .75rem; color: #5a7882; text-transform: uppercase; letter-spacing: .04em; padding: .35rem .4rem; border-bottom: 1px solid #dbe6e8; }
.explain-box .rev-tbl th:first-child, .explain-box .rev-tbl td:first-child { text-align: left; }
.explain-box .rev-tbl td { padding: .45rem .4rem; border-bottom: 1px solid #eef3f4; text-align: right; color: #072f40; font-variant-numeric: tabular-nums; vertical-align: top; }
.explain-box .rev-tbl td small { display: block; color: #5a7882; font-size: .75rem; }
.explain-box .rev-more { font-size: .85rem; margin: 0 0 .6rem; }
.explain-box .rev-links { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .9rem; margin: 0; }
.explain-box .rev-links a { color: #0b6f8a; font-weight: 700; }
/* the new weekly figures ribbon: sky blue, so it reads apart from the yellow commentary ribbon and the teal sea */
.wfd-ribbon { background: linear-gradient(90deg, #5ea8e8, #8cc4f2); }
.wfd-ribbon .cm-r-tag { color: #8cc4f2; }
