/* Heat of the Market.
   The page is a player: the heatmap fills the first view, between the header and the line that stays at the bottom.
   Color: the page is warm carbon, thus red and green belong only to the data.
   Amber is the position: the section in view, the time in view, the play control, the keyboard
   focus and a download in progress. The support links are amber also.
   A cool tint marks the group "Beyond markets": its data is not market prices.
   Type: IBM Plex Sans for text, IBM Plex Sans Condensed for titles, numbers and tile labels.
   Layout: all text starts at the left edge. No list scrolls sideways with no sign: a list that
   has no room for all its items wraps, or it shows a control with the number of the items that are not in view. */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("/fonts/ibm_plex_sans_400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("/fonts/ibm_plex_sans_500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("/fonts/ibm_plex_sans_600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Condensed"; font-weight: 500; font-display: swap; src: url("/fonts/ibm_plex_sans_condensed_500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Condensed"; font-weight: 600; font-display: swap; src: url("/fonts/ibm_plex_sans_condensed_600.woff2") format("woff2"); }

:root {
  --bg: #141312;        /* carbon */
  --surface: #1d1b19;
  --raised: #282522;
  --line: #34302c;
  --line_strong: #4d4741;
  --text: #f2ede6;
  --soft: #cfc8bd;
  --muted: #978f83;
  --loss: #e04848;
  --gain: #30b268;
  --gain_text: #4cc481;
  --loss_text: #f0625a;
  --amber: #f5a524;
  --amber_hi: #ffb53d;
  --amber_ink: #1d1204;   /* text on amber */
  --amber_wash: #2e2313;  /* amber at low strength on carbon */
  --amber_line: #79561b;
  --cool: #a8c0ea;        /* the group "Beyond markets" */
  --cool_surface: #1a1e26;
  --cool_line: #343c4c;
  --deep: #0c0b0a;        /* panels above the page */
  --ui: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --num: "IBM Plex Sans Condensed", "Arial Narrow", var(--ui);
  --pad: 16px;
  --pad: max(clamp(14px, 2.2vw, 32px), env(safe-area-inset-left), env(safe-area-inset-right));
  --top_h: 88px;    /* the script sets the measured height of the header */
  --stick_h: 88px;  /* the same, or 0 if the header moves with the page */
  --foot_h: 56px;   /* the script sets the measured height of the line at the bottom */
  --peek: 0px;      /* how much of the part below the player is in the first view */
  color-scheme: dark;
}
@media (min-height: 700px) { :root { --peek: 54px; } }
@media (min-height: 820px) { :root { --peek: 104px; } }
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--stick_h) + 8px); scroll-padding-bottom: calc(var(--foot_h) + 8px); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--ui);
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
p { margin: 0; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.grow { flex: 1; }
.up { color: var(--gain_text); }
.down { color: var(--loss_text); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 3px; }
main:focus { outline: none; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 30; background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: 6px; }
.skip:focus { top: 8px; }

/* ---------- header ----------
   Line 1: the brand, the search of all heatmaps, the Autoplay switch, the downloads, the support link.
   Line 2: all sections of the site, in their groups. Each group is one box with its sign and its name. */
.top { flex: none; background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.mast { display: flex; align-items: center; gap: 14px; height: 48px; padding: 0 var(--pad); }
.brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; flex: none;
  font: 600 19px/1 var(--num); letter-spacing: 0.01em;
}
.mark { width: 18px; height: 18px; border-radius: 3px; flex: none; }
/* The control that opens the list of all heatmaps. It has the look of a search field: a person knows what a search field does. */
.find {
  display: inline-flex; align-items: center; gap: 9px; flex: 0 1 330px; min-width: 0; height: 34px; padding: 0 7px 0 11px; margin-left: 8px; cursor: pointer;
  background: var(--surface); color: var(--soft); border: 1px solid var(--line_strong); border-radius: 8px; font: inherit; font-size: 14px; text-align: left; white-space: nowrap;
}
.find svg { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--amber); stroke-width: 1.7; stroke-linecap: round; }
.find_long { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.find_short { display: none; }
.find kbd { flex: none; font: 500 12px/1 var(--ui); color: var(--muted); border: 1px solid var(--line_strong); border-radius: 4px; padding: 3px 6px; }
.find:hover { background: var(--raised); border-color: var(--muted); color: var(--text); }

.kofi {
  display: inline-flex; align-items: center; gap: 7px; flex: none; text-decoration: none; white-space: nowrap;
  color: var(--amber); border: 1px solid var(--amber_line); border-radius: 8px; height: 34px; padding: 0 12px; font-size: 13.5px; font-weight: 500;
}
.kofi svg { width: 14px; height: 14px; }
.kofi i { font-style: normal; }
.kofi:hover { background: var(--amber_wash); border-color: var(--amber); }

/* The Autoplay switch, with its name. On: amber, with the play sign. Off: gray, with the pause sign. */
.auto {
  display: inline-flex; align-items: center; gap: 8px; flex: none; height: 34px; padding: 0 4px; cursor: pointer;
  background: none; border: 0; border-radius: 6px; color: var(--soft); font: inherit; font-size: 13.5px; white-space: nowrap;
}
.auto:hover { color: var(--text); }
.auto_track {
  position: relative; width: 36px; height: 20px; flex: none; border-radius: 10px;
  background: var(--raised); border: 1px solid var(--line_strong); transition: background 0.15s, border-color 0.15s;
}
.auto_knob {
  position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center;
  background: var(--muted); transition: transform 0.15s, background 0.15s;
}
.auto_knob svg { width: 6px; height: 7px; fill: var(--bg); }
.auto_knob .i_play { display: none; margin-left: 1px; }
.auto:hover .auto_track { border-color: var(--muted); }
.auto[aria-checked="true"] .auto_track { background: var(--amber_wash); border-color: var(--amber); }
.auto[aria-checked="true"] .auto_knob { transform: translateX(16px); background: var(--amber); }
.auto[aria-checked="true"] .i_play { display: block; }
.auto[aria-checked="true"] .i_pause { display: none; }

/* The downloads: a dot that pulses while the site gets new data, and a panel with the list. */
.status { position: relative; flex: none; }
.status_btn { width: 32px; height: 32px; display: grid; place-items: center; background: none; border: 0; border-radius: 6px; cursor: pointer; padding: 0; }
.status_btn:hover, .status_btn[aria-expanded="true"] { background: var(--raised); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line_strong); position: relative; }
.status.known .dot { background: var(--muted); }
.status.busy .dot { background: var(--amber); }
.status.busy .dot::after { content: ""; position: absolute; left: 0; top: 0; right: 0; bottom: 0; border-radius: 50%; background: var(--amber); animation: pulse 1.5s ease-out infinite; }
@keyframes pulse { from { transform: scale(1); opacity: 0.75; } to { transform: scale(3.1); opacity: 0; } }
.status_panel {
  position: absolute; right: -8px; top: calc(100% + 9px); z-index: 12; width: min(400px, calc(100vw - 16px)); max-height: calc(100vh - 140px); overflow-y: auto;
  background: var(--deep); border: 1px solid var(--line_strong); border-radius: 8px; padding: 14px 16px 12px; font-size: 13.5px;
}
.status_panel h2 { margin: 0 0 2px; font: 600 19px/1.2 var(--num); }
.status_panel h3 { margin: 12px 0 4px; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.status_panel ul { list-style: none; margin: 0; padding: 0; }
.status_panel li { display: grid; grid-template-columns: 1fr auto; gap: 0 14px; padding: 5px 0; border-top: 1px solid var(--line); }
.status_panel li b { font-weight: 500; }
.status_panel li span { color: var(--muted); grid-column: 1; }
.status_panel li time, .status_panel li i { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; color: var(--soft); white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.status_panel li.now b::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); margin-right: 8px; vertical-align: 1px; }
.status_panel li.now i { color: var(--amber); }
.status_panel .bar_line { grid-column: 1 / -1; height: 2px; background: var(--line); margin-top: 5px; }
.status_panel .bar_line > span { display: block; height: 100%; background: var(--amber); }
.status_panel p { color: var(--muted); }

/* The sections. A group is a box: its sign, its name, its sections. The section in view has the amber line.
   The script closes groups if the window has no room for all sections (.shut): a closed group shows
   its name, the number of its sections and an arrow, and it opens a list. The group of the section
   in view is never closed. On a narrow window (.stacked) all groups are in one line, and the
   sections of the group in view are in the line below it. */
.tabs { display: flex; align-items: center; gap: 5px; padding: 0 var(--pad) 8px; min-width: 0; overflow: hidden; }
.tgroup { display: flex; align-items: stretch; flex: none; height: 31px; padding: 0 3px 0 0; background: var(--surface); border: 1px solid transparent; border-radius: 8px; }
.tgroup.here { border-color: var(--line_strong); }
.tg_name, .tg_solo {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 6px 0 8px; cursor: pointer; white-space: nowrap;
  background: none; border: 0; border-radius: 7px; color: var(--soft); font: 600 13.5px/1 var(--num); letter-spacing: 0.02em; text-decoration: none;
}
.tg_solo { font: 400 14px/1 var(--ui); letter-spacing: 0; color: var(--muted); }
.tg_name:hover, .tg_solo:hover { color: var(--text); }
.tg_name[aria-expanded="true"] { color: var(--text); background: var(--raised); }
.tg_name:focus-visible, .tg_solo:focus-visible, .tg_tabs a:focus-visible { outline-offset: -2px; }
.glyph { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.glyph .fill { fill: currentColor; stroke: none; }
.tg_n { display: none; font: 500 12px/1 var(--num); font-style: normal; color: var(--muted); }
.caret { display: none; width: 10px; height: 10px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tg_short { display: none; }
.tg_tabs { display: flex; align-items: stretch; }
.tg_tabs a {
  position: relative; display: flex; align-items: center; gap: 5px; padding: 0 8px; text-decoration: none; white-space: nowrap;
  color: var(--muted); font-size: 14px; border-radius: 6px;
}
.tg_tabs a:hover { color: var(--text); }
.tg_tabs a.on, .tg_solo.on { color: var(--text); }
.tg_tabs a.on::after, .tg_solo.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 1px; height: 2px; border-radius: 1px; background: var(--amber); }
.tg_solo { position: relative; }
.tgroup.solo { padding: 0; }
/* The group "Beyond markets": a cool tint. */
.tgroup.cool { background: var(--cool_surface); }
.tgroup.cool.here { border-color: var(--cool_line); }
.tgroup.cool .tg_name { color: var(--cool); }
.tgroup.shut { padding: 0; }
.tgroup.shut .tg_tabs { display: none; }
.tgroup.shut .tg_n, .tgroup.shut .caret { display: block; }
.tgroup.shut .tg_name { padding-right: 9px; }
/* The story sections: a flame before the name, and the name is not dim. */
.flame { width: 12px; height: 14px; fill: var(--amber); flex: none; }
.tg_tabs a.flair { color: var(--text); }
.tg_tabs a.flair .flame { margin-top: -2px; transform-origin: 50% 100%; animation: flicker 0.7s ease-in-out 1.2s 3; }
.tg_tabs a.flair:hover .flame { animation: flicker_on 0.7s ease-in-out infinite; }
@keyframes flicker { 30% { transform: scale(1.12, 1.32) rotate(-5deg); } 65% { transform: scale(0.94, 1.14) rotate(4deg); } }
@keyframes flicker_on { 30% { transform: scale(1.12, 1.32) rotate(-5deg); } 65% { transform: scale(0.94, 1.14) rotate(4deg); } }

/* A narrow window: the header moves with the page, the groups are one line of equal controls,
   and the sections of the group in view are below them. All of them wrap: nothing is cut. */
.top.stacked { position: static; }
.top.stacked .tabs { flex-wrap: wrap; overflow: visible; gap: 5px; }
.top.stacked .tgroup { display: contents; }
.top.stacked .tg_name, .top.stacked .tg_solo {
  flex: 1 1 auto; justify-content: center; height: 34px; padding: 0 6px; background: var(--surface); border: 1px solid transparent; border-radius: 8px;
  font: 600 13.5px/1 var(--num); letter-spacing: 0.02em; color: var(--soft);
}
.top.stacked .tgroup.cool .tg_name { background: var(--cool_surface); color: var(--cool); }
.top.stacked .tgroup.here .tg_name, .top.stacked .tg_solo.on { border-color: var(--line_strong); color: var(--text); box-shadow: inset 0 -2px 0 var(--amber); }
.top.stacked .tg_solo.on::after { display: none; }
.top.stacked .tgroup.shut .tg_n, .top.stacked .tgroup.shut .caret { display: none; }
.top.stacked .tg_long { display: none; }
.top.stacked .tg_short { display: inline; }
.top.stacked .tgroup.here .tg_tabs { display: flex; flex-wrap: wrap; order: 2; flex: 0 0 100%; min-height: 34px; }
.top.stacked .tg_tabs a { height: 34px; padding: 0 9px; flex: 0 1 auto; }
.top.stacked .tg_tabs a.on::after { left: 9px; right: 9px; bottom: 3px; }

/* The list that a closed group opens, and the list of the heatmaps that the bar above the heatmap has no room for. */
.menu {
  position: fixed; z-index: 15; width: min(370px, calc(100vw - 16px)); overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--deep); border: 1px solid var(--line_strong); border-radius: 10px; padding: 6px; box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
}
.menu h3 { display: flex; align-items: center; gap: 8px; margin: 7px 10px 6px; font: 600 13.5px/1.2 var(--num); letter-spacing: 0.02em; color: var(--soft); }
.menu.cool h3 { color: var(--cool); }
.mi {
  display: grid; grid-template-columns: 1fr auto; gap: 1px 12px; align-items: center; width: 100%; padding: 8px 10px; cursor: pointer; text-align: left;
  background: none; border: 0; border-radius: 6px; color: var(--text); font: inherit; text-decoration: none;
}
.mi b { display: flex; align-items: center; gap: 6px; font: 600 17px/1.25 var(--num); }
.mi span { grid-column: 1; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.mi em { grid-column: 2; grid-row: 1 / span 2; min-width: 62px; padding: 5px 7px; border-radius: 3px; text-align: center; background: var(--raised); color: #fff; font: 600 14px/1 var(--num); font-style: normal; font-variant-numeric: tabular-nums; }
.mi:hover { background: var(--raised); }
.mi.on { background: var(--surface); box-shadow: inset 2px 0 0 var(--amber); }
.mi:focus-visible { outline-offset: -2px; }

main { flex: 1 0 auto; display: flex; flex-direction: column; min-width: 0; }
.boot { padding: 60px var(--pad); color: var(--muted); }

/* ---------- the player ----------
   Above the heatmap: what it shows (the heatmap and the time range), then how it shows it (the
   text of the data, and the size, the sort and the style of the tiles). Below the heatmap: the
   play controls only. The player is never shorter than its parts: nothing is cut. */
.deck { display: flex; flex-direction: column; }
.screen {
  display: flex; flex-direction: column; background: var(--bg);
  min-height: calc(100vh - var(--top_h) - var(--foot_h) - var(--peek));
  min-height: min(1250px, calc(100vh - var(--top_h) - var(--foot_h) - var(--peek)));
  min-height: min(1250px, calc(100dvh - var(--top_h) - var(--foot_h) - var(--peek)));
}
.screen:-webkit-full-screen { min-height: 0; height: 100%; width: 100%; }
.screen:fullscreen { min-height: 0; height: 100%; width: 100%; }
.bar { display: flex; align-items: center; gap: 6px 10px; padding: 8px var(--pad) 4px; flex: none; }
.chip_row { display: flex; align-items: center; gap: 8px; flex: 1 1 0; min-width: 0; }
.chips { display: flex; gap: 2px; flex: 0 1 auto; min-width: 0; overflow: hidden; }
.chips button {
  position: relative; display: inline-flex; align-items: center; gap: 7px; background: none; border: 0; color: var(--muted); padding: 7px 11px; font: inherit; font-size: 14px; line-height: 1.35; cursor: pointer;
  border-radius: 6px; white-space: nowrap; flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.chips button:hover { color: var(--text); }
.chips button.on { background: var(--text); color: var(--bg); font-weight: 500; }
.chips button:focus-visible, .chip_more:focus-visible { outline-offset: -2px; }
/* The change of each heatmap and of each time range, as a color: a small square before the name
   of a heatmap, a line below the name of a time range or of a story. */
.chips:not(.stories) button::before { content: ""; width: 9px; height: 9px; flex: none; border-radius: 2px; background: var(--heat, var(--line_strong)); }
.chips.stories button::after, .seg.pick button::after {
  content: ""; position: absolute; left: 6px; right: 6px; bottom: 3px; height: 3px; border-radius: 1.5px; background: var(--heat, transparent);
}
.chip_more {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 32px; padding: 0 10px; cursor: pointer; white-space: nowrap;
  background: var(--surface); color: var(--text); border: 1px solid var(--line_strong); border-radius: 6px; font: inherit; font-size: 13.5px; font-weight: 500;
}
.chip_more svg { width: 10px; height: 10px; fill: none; stroke: var(--amber); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chip_more:hover, .chip_more[aria-expanded="true"] { background: var(--raised); border-color: var(--muted); }
/* A section of stories: each chip is one story, with its years above its name. */
.chips.stories { gap: 3px; flex-wrap: wrap; overflow: visible; }
.chips.stories button { display: grid; gap: 1px; text-align: left; padding: 5px 14px 9px 12px; line-height: 1.2; background: var(--surface); color: var(--soft); border-radius: 3px; }
.chips.stories small { font: 500 12.5px/1.2 var(--num); letter-spacing: 0.02em; color: var(--muted); }
.chips.stories b { font-size: 14.5px; font-weight: 500; }
.chips.stories button:hover { background: var(--raised); color: var(--text); }
.chips.stories button.on { background: var(--text); color: var(--bg); }
.chips.stories button.on small { color: #5f584e; }
.chips.stories button::after { left: 12px; right: 14px; }
.seg.pick { flex: none; }
.seg.pick button { position: relative; padding: 5px 11px 9px; }

/* How the heatmap shows the data: the text of the data, then the size, the sort and the style of the tiles. */
.view { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 22px; padding: 3px var(--pad) 9px; flex: none; }
.note { color: var(--soft); font-size: 13px; line-height: 1.4; flex: 1 1 300px; min-width: 0; }
.opts { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; flex: 0 1 auto; min-width: 0; }
.opt { display: inline-flex; align-items: center; gap: 7px; flex: none; }
.lbl { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.alt { display: none; }

.stage { position: relative; flex: 1 0 300px; min-height: 0; background: var(--bg); }
.stage canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; transition: opacity 0.18s; touch-action: manipulation; }
/* New data is on its way: the last picture stays, dimmed, with a moving line at the top. */
.stage.loading canvas { opacity: 0.42; }
.stage.loading::before {
  content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 28%; background: var(--amber); z-index: 1;
  animation: slide 0.9s ease-in-out infinite alternate;
}
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(260%); } }

/* The play controls, directly below the heatmap: play, the position, the speed, the color scale, random, share, full screen. */
.transport { display: flex; align-items: center; gap: 8px 12px; padding: 8px var(--pad); flex: none; flex-wrap: wrap; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pp {
  width: 52px; height: 38px; padding: 0; display: grid; place-items: center; flex: none; cursor: pointer;
  background: var(--amber); color: var(--amber_ink); border: 0; border-radius: 6px;
}
.pp:hover { background: var(--amber_hi); }
.pp:focus-visible { outline-color: var(--text); }
.pp svg { width: 13px; height: 14px; fill: currentColor; }
.pp:disabled { background: var(--raised); color: var(--muted); cursor: default; }
.scrub { -webkit-appearance: none; appearance: none; flex: 1 1 160px; min-width: 80px; height: 30px; margin: 0; background: transparent; cursor: pointer; }
.scrub::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--amber) var(--p, 100%), var(--line_strong) var(--p, 100%)); }
.scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border: 0; border-radius: 50%; background: var(--amber); }
.scrub::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line_strong); }
.scrub::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--amber); }
.scrub::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--amber); }
.scrub:disabled { opacity: 0.35; cursor: default; }
.legend { display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 0 6px; color: var(--soft); font: 500 13px/1 var(--num); white-space: nowrap; }
.legend .lbar { width: 76px; height: 8px; border-radius: 2px; background: linear-gradient(90deg, var(--loss), #3e3a36 50%, var(--gain)); }
.tool {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; flex: none; cursor: pointer;
  background: none; color: var(--soft); border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 13.5px; white-space: nowrap;
}
.tool:hover { color: var(--text); border-color: var(--line_strong); background: var(--surface); }
.tool svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tool.square { width: 38px; padding: 0; justify-content: center; }

/* ---------- controls ---------- */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; flex: none; }
.seg button {
  background: none; border: 0; color: var(--muted); padding: 6px 11px; font: inherit; font-size: 13.5px; cursor: pointer;
  border-right: 1px solid var(--line); white-space: nowrap;
}
.seg > :last-child { border-right: 0; }
.seg button:hover { color: var(--text); }
.seg button:focus-visible { outline-offset: -2px; }
.seg .on { background: var(--raised); color: var(--text); font-weight: 500; }
.seg .on.bull { color: var(--gain_text); }
.seg .on.bear { color: var(--loss_text); }
select {
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 8px; font: inherit; font-size: 13.5px; max-width: 100%;
}
.btn {
  background: var(--raised); color: var(--text); border: 1px solid var(--line_strong); border-radius: 6px;
  padding: 6px 14px; font: inherit; font-size: 13.5px; cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.kofi_btn { background: var(--amber); border-color: var(--amber); color: var(--amber_ink); font-weight: 600; }
.btn.kofi_btn:hover { background: var(--amber_hi); border-color: var(--amber_hi); }
.btn.kofi_btn:focus-visible { outline-color: var(--text); }
.link { background: none; border: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; padding: 0; }

/* ---------- below the player ----------
   The title of the first part is in the first view, thus a person sees that the page goes on. */
.part { padding: 0 var(--pad); width: 100%; margin: 18px 0 0; }
.part + .part { margin-top: 40px; }
.part:last-child { padding-bottom: 56px; }
.part_head { display: flex; align-items: baseline; gap: 4px 18px; flex-wrap: wrap; margin-bottom: 14px; }
.part_head h2 { margin: 0; font: 600 23px/1.15 var(--num); }
.part_head h2:focus { outline: none; }
.part_head p { color: var(--muted); font-size: 14px; flex: 1 1 320px; max-width: 90ch; }
.part_head p.part_links { display: flex; gap: 4px 20px; flex-wrap: wrap; align-items: baseline; color: var(--soft); max-width: none; }
.part_links .link:hover { color: var(--text); }
.jump {
  display: inline-flex; align-items: center; gap: 7px; padding: 0; cursor: pointer;
  background: none; border: 0; color: var(--text); font: inherit; font-weight: 500; text-align: left;
}
.jump > svg { width: 12px; height: 12px; flex: none; fill: none; stroke: var(--amber); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.jump:hover > span { text-decoration: underline; text-underline-offset: 3px; }
/* The heatmap came to its end: the title of the part below it shows one time. */
.part_head.cue h2 { animation: glow 1.8s ease-out; }
.part_head.cue .jump > svg { animation: nudge 0.55s ease-in-out 3; }
@keyframes glow { from { color: var(--amber); } }
@keyframes nudge { 50% { transform: translateY(4px); } }

/* Watch next: tiles, as on the heatmap. The gap between the tiles is the page color. */
.reel { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 3px; }
.clip {
  display: grid; grid-template-columns: auto 1fr; gap: 3px 11px; align-content: center; min-height: 74px;
  padding: 12px 14px; background: var(--surface); text-decoration: none; border-radius: 3px;
}
.clip svg { width: 10px; height: 12px; fill: var(--muted); margin-top: 6px; }
.clip b { font: 600 18px/1.25 var(--num); letter-spacing: 0.003em; }
.clip span { grid-column: 2; color: var(--muted); font-size: 13px; line-height: 1.35; }
.clip:hover { background: var(--raised); }
.clip:hover svg { fill: var(--text); }
.clip.on { box-shadow: inset 3px 0 0 var(--amber); background: var(--raised); }
.clip.on svg { fill: var(--amber); }
.clip.story svg, .clip.story:hover svg { width: 11px; height: 13px; margin-top: 5px; fill: var(--amber); }
.clip:focus-visible { outline-offset: -2px; }

/* The table of a section: one row for each heatmap, one cell for each time range. Each cell has the
   name of its range, thus the cells can wrap on a narrow window: the table never scrolls sideways. */
.board { display: grid; gap: 3px; }
.brow { display: grid; grid-template-columns: 204px minmax(0, 1fr); gap: 3px 12px; align-items: stretch; }
.brow .mk { display: grid; align-content: center; color: var(--text); font-size: 15px; font-weight: 500; line-height: 1.25; text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.brow .mk:hover b { text-decoration: underline; text-underline-offset: 3px; }
.brow .mk b { font-weight: 500; }
.brow .mk small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.cells { display: grid; grid-template-columns: repeat(var(--cols, 7), minmax(0, 1fr)); gap: 3px; max-width: calc(var(--cols, 7) * 150px); }
.cell {
  display: grid; align-content: center; justify-items: center; gap: 3px; min-height: 48px; padding: 5px 2px; border-radius: 3px; min-width: 0;
  text-decoration: none; color: #fff; background: var(--surface);
}
.cell small { font: 500 12px/1 var(--num); letter-spacing: 0.02em; opacity: 0.82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cell b { font: 600 16.5px/1 var(--num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell.none { color: var(--muted); }
.cell.none b { font-weight: 500; font-size: 13px; }
.cell.gap { background: none; }
a.cell:hover { box-shadow: inset 0 0 0 2px var(--text); }
a.cell:focus-visible { outline-offset: -2px; outline-color: var(--text); }

/* ---------- tooltip, tile card, toast, dialogs ---------- */
.tip {
  position: fixed; z-index: 20; pointer-events: none; background: var(--deep); border: 1px solid var(--line_strong);
  border-radius: 6px; padding: 10px 12px; font-size: 13px; max-width: min(340px, calc(100vw - 16px));
}
.tip b { font: 600 17px/1.2 var(--num); }
.tip .nm { color: var(--muted); margin-bottom: 6px; }
.tip table { border-collapse: collapse; }
.tip td { padding: 1px 0; }
.tip td:first-child { color: var(--muted); padding-right: 16px; }
.tip td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.tip .hint { margin-top: 7px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
/* More about one tile: its values at the time in view, its values in the time range, facts, the values of its day, headlines and links. */
.card {
  position: fixed; z-index: 21; width: min(372px, calc(100vw - 16px)); max-height: min(700px, calc(100vh - var(--foot_h) - 24px)); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  background: var(--deep); border: 1px solid var(--line_strong); border-radius: 8px; padding: 13px 15px 12px; font-size: 13px; box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
}
.card .x { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; display: grid; place-items: center; background: none; border: 0; border-radius: 6px; color: var(--muted); cursor: pointer; }
.card .x:hover { color: var(--text); background: var(--raised); }
.card .x svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; fill: none; }
.card > b { font: 600 20px/1.2 var(--num); padding-right: 30px; display: block; overflow-wrap: anywhere; }
.card .nm { color: var(--muted); margin-bottom: 8px; padding-right: 26px; }
.card table { border-collapse: collapse; width: 100%; }
.card td { padding: 2px 0; vertical-align: baseline; }
.card td:first-child { color: var(--muted); padding-right: 16px; }
.card td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.card .more { border-top: 1px solid var(--line); margin-top: 9px; padding-top: 1px; }
.card .wait { color: var(--muted); padding-top: 8px; }
/* The values of the tile in the time range, as a line. The amber dot is the time in view. */
.spark { display: block; width: 100%; height: 46px; margin: 4px 0 5px; overflow: visible; }
.spark path { fill: none; stroke: var(--soft); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark .base { stroke: var(--line_strong); stroke-width: 1; stroke-dasharray: 2 3; }
.spark .now { stroke: var(--amber); stroke-width: 1; }
/* A range with the place of the price in it. */
.span_line { position: relative; height: 3px; border-radius: 2px; background: var(--line_strong); margin: 5px 0 3px; }
.span_line > i { position: absolute; top: -3px; width: 3px; height: 9px; margin-left: -1.5px; border-radius: 1px; background: var(--amber); }
.card h3 { margin: 12px 0 2px; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.card ul { list-style: none; margin: 0; padding: 0; }
.card li { padding: 7px 0 6px; border-top: 1px solid var(--line); }
.card li:first-child { border-top: 0; padding-top: 3px; }
.card li a { display: block; color: var(--text); font-size: 14px; line-height: 1.35; text-decoration: none; overflow-wrap: anywhere; }
.card li a:hover { text-decoration: underline; text-underline-offset: 3px; }
.card li span { color: var(--muted); font-size: 12.5px; }
.card ul.links li a { display: flex; align-items: baseline; gap: 7px; }
.card ul.links svg { width: 10px; height: 10px; flex: none; fill: none; stroke: var(--amber); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card .src { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.card .src a { color: var(--soft); text-underline-offset: 3px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--foot_h) + 14px); transform: translateX(-50%); z-index: 25; max-width: calc(100vw - 32px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: 500;
}
.dlg {
  background: var(--surface); color: var(--text); border: 1px solid var(--line_strong); border-radius: 10px;
  padding: 24px 26px; max-width: 760px; width: calc(100vw - 32px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.dlg.narrow { max-width: 470px; }
/* A browser with no dialog element: the dialog is a panel above the page. */
.no_dialog dialog { display: none; position: fixed; left: 8px; right: 8px; top: 8px; z-index: 40; margin: 0 auto; width: auto; }
.no_dialog dialog[open] { display: block; }
.dlg.wide { max-width: 1120px; }

/* ---------- all heatmaps: each heatmap is a tile with the color of its change ---------- */
.maps_head { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; }
.maps_head h2 { margin: 0; }
.maps_head form { margin-left: auto; }
.maps_count { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.maps_tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 8px; }
.maps_tools input {
  flex: 1 1 240px; min-width: 0; height: 40px; padding: 0 12px; background: var(--bg); color: var(--text);
  border: 1px solid var(--line_strong); border-radius: 6px; font: inherit; font-size: 16px;
}
.maps_tools input::placeholder { color: var(--muted); }
.maps_tools .btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; }
.maps_tools .btn svg { width: 15px; height: 15px; fill: none; stroke: var(--amber); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dlg p.maps_key { color: var(--muted); font-size: 13px; margin: 0 0 4px; }
.mgroup { margin-top: 20px; }
.dlg .mgroup h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; font: 600 14px/1.2 var(--num); letter-spacing: 0.02em; color: var(--soft); padding-bottom: 7px; border-bottom: 1px solid var(--line_strong); }
.dlg .mgroup.cool h3 { color: var(--cool); border-bottom-color: var(--cool_line); }
.mtab { display: grid; grid-template-columns: 190px 1fr; gap: 2px 18px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mtab h4 { margin: 0; font: 600 19px/1.2 var(--num); display: flex; align-items: center; gap: 6px; grid-column: 1; }
.dlg .mtab p { grid-column: 1; margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.mtiles { grid-column: 2; grid-row: 1 / span 2; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 3px; align-content: start; }
.mtile {
  display: grid; gap: 2px; align-content: center; min-height: 52px; padding: 7px 10px; border-radius: 3px;
  background: var(--raised); color: #fff; text-decoration: none; line-height: 1.2;
}
.mtile b { font: 600 16px/1.2 var(--num); letter-spacing: 0.003em; overflow-wrap: anywhere; }
.mtile span { font: 500 13px/1.2 var(--num); opacity: 0.86; font-variant-numeric: tabular-nums; min-height: 1.2em; }
.mtile:hover { box-shadow: inset 0 0 0 2px var(--text); }
.mtile.on { box-shadow: inset 0 0 0 2px var(--amber); }
.mtile:focus-visible { outline-offset: -2px; outline-color: var(--text); }
.dlg p.mnone { color: var(--soft); margin: 18px 0 6px; }
.dlg::backdrop { background: rgba(8, 7, 6, 0.74); }
.dlg h2 { margin: 0 0 12px; font: 600 25px/1.15 var(--num); }
.dlg h2:focus { outline: none; }
.dlg h3 { margin: 18px 0 4px; font-size: 15px; font-weight: 600; }
.dlg p { color: var(--soft); margin-bottom: 12px; max-width: 72ch; }
.dlg p.muted { color: var(--muted); font-size: 13.5px; }
.dlg ul { margin: 0 0 12px; padding-left: 18px; color: var(--soft); }
.dlg li { margin: 6px 0; max-width: 72ch; overflow-wrap: anywhere; }
.dlg .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.dlg form { margin: 0; }
.dlg > form { margin-top: 18px; }
.dlg[open] { animation: rise 0.16s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ---------- the line that stays at the bottom of the window ----------
   Its first part: the caveat and the terms. Its second part: the source of the heatmap in view,
   the list of all sources with the method, and the owner of the site. */
.foot {
  flex: none; position: sticky; bottom: 0; z-index: 9; background: var(--bg);
  display: flex; flex-wrap: wrap; gap: 3px 36px; align-items: baseline; justify-content: space-between;
  padding: 8px var(--pad) max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line_strong); color: var(--muted); font-size: 12.5px; line-height: 1.45;
}
.foot_legal, .foot_data { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 14px; min-width: 0; }
.caveat { color: var(--text); }
.foot .link { color: var(--soft); white-space: nowrap; }
.foot a { color: var(--soft); text-underline-offset: 3px; }
.foot a:hover, .foot .link:hover { color: var(--text); }
.foot_site { display: inline-flex; gap: 14px; white-space: nowrap; padding-left: 14px; border-left: 1px solid var(--line_strong); }
.foot_site span a { margin-left: 4px; }
.foot_site a { color: var(--muted); }
.colophon a.kofi_text { color: var(--amber); }
/* The end of the page on a narrow window: the owner of the site, the contact and the support link. */
.colophon { display: none; gap: 4px 20px; flex-wrap: wrap; padding: 30px var(--pad) 22px; color: var(--muted); font-size: 12.5px; }

/* ---------- windows that are not wide ---------- */
@media (max-width: 1400px) {
  .kofi i { display: none; }
}
/* The size and the sort are lists, not rows of controls: all options stay on the page in one line. */
@media (max-width: 1020px) {
  .opts .seg { display: none; }
  .alt { display: block; }
}
@media (max-width: 900px) {
  .mast { gap: 10px; }
  .find { flex: 0 1 auto; margin-left: 2px; }
  .find_long, .find kbd { display: none; }
  .find_short { display: inline; }
  .foot_site { display: none; }
  .colophon { display: flex; }
  .part:last-child { padding-bottom: 8px; }
  .tool.text span { display: none; }
  .tool.text { width: 38px; padding: 0; justify-content: center; }
  .bar { flex-wrap: wrap; }
  .chip_row { flex: 1 1 100%; }
  /* The table: the cells of a row wrap below the name of the heatmap. */
  .brow { grid-template-columns: minmax(0, 1fr); gap: 4px; padding-bottom: 12px; }
  .brow .mk { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; }
  .brow .mk small { display: inline; }
  .cells { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); max-width: none; }
  .cell.gap { display: none; }
}
@media (max-width: 640px) {
  :root { --peek: 0px; }
  .mast { gap: 6px; height: 46px; }
  .brand span { display: none; }
  .find { padding: 0 10px 0 9px; gap: 7px; margin-left: 4px; }
  .auto { gap: 6px; padding: 0 2px; }
  .kofi { padding: 0; width: 34px; justify-content: center; }
  .kofi span { display: none; }
  .status_panel { position: fixed; left: 8px; right: 8px; top: 54px; width: auto; }
  /* The tile card is a sheet above the line at the bottom. */
  .card { left: 8px !important; right: 8px; top: auto !important; bottom: calc(var(--foot_h) + 8px); width: auto; max-height: min(66vh, 520px); }
  .menu { left: 8px !important; right: 8px; width: auto; }
  /* The player: the heatmap has its own height, and the parts of the player are as high as they need. */
  .screen { min-height: 0; }
  .stage { flex: none; height: calc(100vh - var(--top_h) - var(--foot_h) - 182px); height: calc(100dvh - var(--top_h) - var(--foot_h) - 182px); min-height: 330px; max-height: 820px; }
  .screen:-webkit-full-screen .stage { flex: 1 0 200px; height: auto; }
  .screen:fullscreen .stage { flex: 1 0 200px; height: auto; }
  .bar { gap: 6px 8px; padding: 6px var(--pad) 6px; }
  .chips button { padding: 7px 9px; gap: 6px; }
  .top.stacked .tg_tabs { justify-content: space-between; }
  .top.stacked .tg_tabs a { padding: 0 6px; }
  .top.stacked .tg_tabs a.on::after { left: 6px; right: 6px; }
  .seg.pick { margin: 0; flex: 1 1 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .seg.pick button { padding: 7px 2px 10px; min-width: 0; overflow: hidden; text-overflow: clip; }
  .seg.pick button::after { left: 4px; right: 4px; }
  /* The text of the data and the options of the tiles come after the play controls. */
  .view { order: 5; padding: 9px var(--pad) 10px; gap: 8px 12px; }
  .note { flex: 1 1 100%; }
  .opts { flex: 1 1 100%; gap: 8px 10px; }
  .opt { flex: 1 1 auto; }
  .opt select { flex: 1 1 auto; min-width: 0; }
  .transport { gap: 8px; padding: 7px var(--pad); border-bottom: 0; }
  .scrub { flex: 1 1 0; min-width: 60px; }
  .pp { width: 50px; height: 40px; }
  .tool { height: 40px; }
  .tool.square, .tool.text { width: 40px; }
  .opt.speed .lbl { display: none; }
  .legend { order: 6; flex: 1 1 100%; justify-content: center; padding: 2px 0 0; }
  .part { margin-top: 22px; }
  .part + .part { margin-top: 32px; }
  .part_head h2 { font-size: 21px; flex: 1 1 100%; }
  .reel { grid-template-columns: 1fr 1fr; }
  .clip { min-height: 68px; padding: 10px 11px; gap: 3px 8px; }
  .clip b { font-size: 16.5px; overflow-wrap: anywhere; }
  .clip span { font-size: 12.5px; }
  .cells { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); }
  .cell { min-height: 44px; }
  .cell b { font-size: 14px; letter-spacing: -0.02em; }
  .foot { font-size: 11.5px; padding-top: 6px; gap: 2px 14px; line-height: 1.4; }
  .foot_legal, .foot_data { gap: 0 10px; }
  .dlg { padding: 20px 18px; width: calc(100vw - 16px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .mtab { grid-template-columns: 1fr; }
  .mtiles { grid-column: 1; grid-row: auto; margin-top: 6px; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .maps_head form { order: 3; }
}
/* A small phone: the names of the sections are a little smaller, thus the six sections of a group are one line. */
@media (max-width: 380px) {
  .top.stacked .tg_tabs a { font-size: 13.5px; padding: 0 5px; }
  .top.stacked .tg_tabs a.on::after { left: 5px; right: 5px; }
  .top.stacked .tg_name, .top.stacked .tg_solo { gap: 5px; padding: 0 4px; font-size: 13px; }
}
/* A very narrow phone: the name of the Autoplay switch has no room. Its sign and its label for screen readers stay. */
@media (max-width: 350px) {
  .auto_text { display: none; }
}
/* A window that is not high (a phone on its side): the heatmap keeps a height that a person can read. */
@media (max-height: 520px) {
  .top { position: static; }
  .stage { flex: 1 0 240px; }
}
@media (max-height: 520px) and (max-width: 640px) {
  .stage { flex: none; min-height: 240px; }
}
/* A touch screen: iOS makes the page larger when a control with small text gets the focus. */
@media (pointer: coarse) {
  select { font-size: 16px; padding: 7px 8px; }
  .find kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
