:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #15181c;
  --muted: #5f6772;
  --border: #e0e4e9;
  /* twilight violet, flight-count's colour: --accent fills and underlines, --link the text links */
  --accent: #6b3fa0;
  --accent-text: #ffffff;
  --link: #5a2f8c;
  --track: #e8ebef;
  --radius: 12px;
  --map-0: #e9ebee; --map-1: #ece4f6; --map-2: #d3c1ea; --map-3: #b394da; --map-4: #8b62c2; --map-5: #5b3591;
  --map-sea: #eef3f8;
  /* airport dots: sized ones, and the five bands of a share or an average */
  --pt: #6b3fa0; --pt-sel: #e3d5f5;
  --rt-1: #e2d4f4; --rt-2: #bfa1e4; --rt-3: #9670cc; --rt-4: #6c42aa; --rt-5: #3f1d73;
  --bar: #8b62c2; --bar-2: #d3c1ea; --bar-3: #b394da; --up: #1f7a4d; --down: #b5432a;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1215; --surface: #181c21; --text: #e7eaee; --muted: #9aa2ad; --border: #2a3038;
  --accent: #b794f0; --accent-text: #160b26; --link: #c6a8f5; --track: #262c33;
  --map-0: #2c3038; --map-1: #2d2640; --map-2: #43345e; --map-3: #634a8c; --map-4: #8d6cc0; --map-5: #c3a6f2;
  --map-sea: #14171c;
  --pt: #b794f0; --pt-sel: #3a2559;
  --rt-1: #3d3157; --rt-2: #5d4787; --rt-3: #8a6bc0; --rt-4: #b597ea; --rt-5: #e6d7ff;
  --bar: #a582e0; --bar-2: #43345e; --bar-3: #634a8c; --up: #6fd99b; --down: #f6977a;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1215; --surface: #181c21; --text: #e7eaee; --muted: #9aa2ad; --border: #2a3038;
    --accent: #b794f0; --accent-text: #160b26; --link: #c6a8f5; --track: #262c33;
    --map-0: #2c3038; --map-1: #2d2640; --map-2: #43345e; --map-3: #634a8c; --map-4: #8d6cc0; --map-5: #c3a6f2;
    --map-sea: #14171c;
    --pt: #b794f0; --pt-sel: #3a2559;
    --rt-1: #3d3157; --rt-2: #5d4787; --rt-3: #8a6bc0; --rt-4: #b597ea; --rt-5: #e6d7ff;
    --bar: #a582e0; --bar-2: #43345e; --bar-3: #634a8c; --up: #6fd99b; --down: #f6977a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; }
a { color: var(--link); }
h1, h2, h3, p { margin: 0; }

main, .foot { max-width: 1200px; margin: 0 auto; padding: 0 16px; } /* 1200 as the sister projects, so the maps line up */
main { padding-top: 16px; min-height: 100vh; display: flex; flex-direction: column; gap: 16px; } /* always scrolls, as the sister pages do */
.muted { color: var(--muted); font-weight: 400; }

/* mathemantique bar above the top bar, as on the sister apps */
.site-bar { background: #007FFF; text-align: center; padding: .4rem 16px; padding-left: calc(16px + 100vw - 100%); } /* the scrollbar's width added on the left: the name sits at the window's centre */
.site-bar a { color: #fff; text-decoration: none; font-family: Georgia, 'Times New Roman', serif; font-size: 1.15rem; font-weight: bold; letter-spacing: .02em; }
.site-bar a:hover { text-decoration: underline; }

.topbar { display: flex; align-items: center; gap: .5rem 1rem; padding: .7rem 16px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: .01em; flex: 1; }
.brand .muted { font-weight: 400; margin-left: .4rem; }
.theme-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 2px; background: var(--bg); flex-shrink: 0; }
.theme-toggle button { font: inherit; font-size: .82rem; border: 0; background: transparent; color: var(--muted); padding: .25rem .65rem; border-radius: 999px; cursor: pointer; }
.theme-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--border); }
@media (max-width: 560px) { .brand .muted { display: block; margin-left: 0; } }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.panel h2 { font-size: 1.05rem; margin-bottom: .5rem; }
.panel h3, .side-head { font-size: .9rem; margin-bottom: .3rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 1.05rem; margin: 0 0 .6rem; }
.crumbs .sep { color: var(--muted); }
.crumbs .here { font-weight: 700; }
button.link { border: 0; background: none; padding: 0; font: inherit; color: var(--link); cursor: pointer; text-align: left; }
button.link:hover { text-decoration: underline; }

/* map with its filters on the left: the same layout as the sister projects */
.map-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.map-filters { display: flex; flex-direction: column; gap: .7rem; min-width: 0; font-size: .9rem; }
.map-filters label { display: flex; flex-direction: column; gap: .2rem; color: var(--muted); }
.map-filters select { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: .3rem .4rem; }
.map-main { min-width: 0; }
@media (max-width: 820px) { .map-layout { grid-template-columns: minmax(0, 1fr); } }
.summary { color: var(--muted); }
.note { color: var(--muted); font-size: .82rem; margin-top: .4rem; }

.periods { display: flex; flex-wrap: wrap; gap: 6px; }
.periods button { font: inherit; font-size: .85rem; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.periods button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }

.totals { width: 100%; border-collapse: collapse; font-size: .85rem; }
.totals td { padding: 3px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.totals td.n { text-align: right; font-variant-numeric: tabular-nums; padding-left: 8px; white-space: nowrap; }
.totals tr.on td { font-weight: 700; }
.totals tr.sub td:first-child { padding-left: .8rem; color: var(--muted); }

.ranks { margin: 0; padding-left: 1.5rem; font-size: .85rem; }
.ranks li { padding: 1px 0; }
.ranks .n { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: .3rem; white-space: nowrap; }

.worldmap { position: relative; }
.worldmap svg { display: block; width: 100%; height: auto; max-height: 72vh; background: var(--map-sea); border-radius: 8px; touch-action: auto; cursor: grab; }
.worldmap svg.zoomed { touch-action: none; }
.worldmap svg.dragging { cursor: grabbing; }
.worldmap .unit { stroke: var(--surface); stroke-width: .6; vector-effect: non-scaling-stroke; cursor: pointer; fill-rule: evenodd; }
.worldmap .unit.dot { stroke-width: 1; }
.worldmap .unit:hover, .worldmap .unit:focus { stroke: var(--text); stroke-width: 1.5; outline: none; }
.worldmap .unit.selected { stroke: var(--text); stroke-width: 2; }
.worldmap .inset { fill: none; stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.worldmap .pt { fill: var(--pt); fill-opacity: .72; stroke: var(--surface); stroke-width: .8; vector-effect: non-scaling-stroke; }
.worldmap .pt.off { opacity: .3; pointer-events: none; }
.worldmap .pt.on { cursor: pointer; }
.worldmap .pt.on:hover, .worldmap .pt.on:focus, .worldmap .pt.hover { stroke: var(--text); stroke-width: 1.8; fill-opacity: .9; outline: none; }
.worldmap .pt.sel { fill: var(--pt); fill-opacity: 1; stroke: var(--text); stroke-width: 2.2; }
.worldmap .hit { fill: transparent; pointer-events: all; cursor: pointer; }
.map-zoom { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 4px; }
.map-zoom button { font: inherit; min-width: 30px; height: 30px; padding: 0 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; font-size: 1rem; line-height: 1; }
.map-zoom button.reset { font-size: .7rem; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-c0 { fill: var(--map-0); background: var(--map-0); }
.map-c1 { fill: var(--map-1); background: var(--map-1); }
.map-c2 { fill: var(--map-2); background: var(--map-2); }
.map-c3 { fill: var(--map-3); background: var(--map-3); }
.map-c4 { fill: var(--map-4); background: var(--map-4); }
.map-c5 { fill: var(--map-5); background: var(--map-5); }
.map-legend { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: .3rem 1.2rem; margin-top: .5rem; font-size: .8rem; color: var(--muted); }
.map-legend .bubble { display: inline-flex; align-items: center; gap: .35rem; }
.map-legend svg { display: block; }
.map-legend circle { fill: var(--pt); fill-opacity: .72; stroke: var(--surface); }
.chart-tip { position: absolute; transform: translateX(-50%); pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .4rem .6rem; font-size: .82rem; box-shadow: 0 4px 14px rgba(0,0,0,.12); white-space: nowrap; color: var(--text); z-index: 5; }
.chart-tip .tip-head { font-weight: 600; margin-bottom: .15rem; }

/* the goods and partners of the place: bars in a list */
.detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; }
@media (max-width: 820px) { .detail { grid-template-columns: minmax(0, 1fr); } }
.bars { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 3px 0; }
.bars .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .n { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }
.bars .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.bars .bar i { display: block; height: 100%; background: var(--bar); border-radius: 3px; }
.bars button.link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars li.on .name, .bars li.on button.link { font-weight: 700; }

/* month by month */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 200px; }
.chart .bar { fill: var(--bar-2); }
.chart .bar.jan { fill: var(--bar-3); }
.chart .bar.on { fill: var(--bar); }
.chart .hit { fill: transparent; }
.chart .grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: .2rem; }
.download { font-size: .85rem; align-self: flex-start; margin-top: .4rem; }
.month-text { font-size: .95rem; line-height: 1.55; max-width: 70rem; }

/* the biggest changes */
.movers { margin: 0; padding-left: 1.5rem; font-size: .88rem; }
.movers li { padding: 2px 0; }
.movers .n { font-variant-numeric: tabular-nums; margin-left: .4rem; white-space: nowrap; }
.movers li.up .n { color: var(--up); }
.movers li.down .n { color: var(--down); }

.elsewhere { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; font-size: .9rem; }
.elsewhere .n { font-weight: 700; font-variant-numeric: tabular-nums; margin-left: .3rem; }

.foot { color: var(--muted); font-size: 0.8rem; padding-top: 16px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 6px; }

/* flight-count: dots coloured by a share or an average (five bands), the routes, airlines and causes in three columns */
.worldmap .pt.r1 { fill: var(--rt-1); fill-opacity: .9; }
.worldmap .pt.r2 { fill: var(--rt-2); fill-opacity: .9; }
.worldmap .pt.r3 { fill: var(--rt-3); fill-opacity: .9; }
.worldmap .pt.r4 { fill: var(--rt-4); fill-opacity: .9; }
.worldmap .pt.r5 { fill: var(--rt-5); fill-opacity: .9; }
.worldmap .pt.few { fill: var(--muted); fill-opacity: .35; }
.worldmap .pt { stroke: var(--text); stroke-opacity: .35; }
.map-legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: .3rem; vertical-align: -1px; border: 1px solid var(--border); }
.map-legend .sw.r1 { background: var(--rt-1); } .map-legend .sw.r2 { background: var(--rt-2); } .map-legend .sw.r3 { background: var(--rt-3); }
.map-legend .sw.r4 { background: var(--rt-4); } .map-legend .sw.r5 { background: var(--rt-5); } .map-legend .sw.few { background: var(--muted); opacity: .35; }
.detail.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .detail.three { grid-template-columns: minmax(0, 1fr); } }
.sub-head { margin-top: .9rem; }
.bars .n b { color: var(--text); font-weight: 600; }
.foot em { font-style: normal; color: var(--text); }
@media (max-width: 560px) { .bars li { grid-template-columns: minmax(0, 1fr); } .bars .n { font-size: .82rem; } }
.worldmap .pt.off { display: none; } /* airports without data for the measure chosen (T-100 brings many small ones) */
