/* ICOS download statistics -- the whole stylesheet.  No framework:
   a system font stack, the ICOS blue, white cards on a light ground,
   a sticky filter column on wide screens and one column below 900px. */

:root {
  --blue: #1b4f8a;
  --blue-dark: #143a66;
  --blue-light: #e8f0fa;
  --ink: #1f2933;
  --muted: #5f6b7a;
  --line: #dde3ea;
  --ground: #f4f6f8;
  --card: #ffffff;
  --accent: #2b7bbf;
  --accent-dark: #1b4f8a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 40, 70, .06), 0 4px 16px rgba(20, 40, 70, .05);
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--ground);
  line-height: 1.45;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { font-weight: 600; margin: 0; }
h2 { font-size: 1.05rem; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* header */
.top {
  display: flex; align-items: center; gap: 1.25rem;
  padding: .75rem 1.5rem; background: var(--card);
  border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 1.25rem; color: var(--blue-dark); flex: 1; }
.top .logo img { display: block; }
.views { display: flex; gap: .25rem; }
.views a {
  padding: .4rem .8rem; border-radius: 999px; color: var(--muted); font-weight: 500;
}
.views a:hover { background: var(--blue-light); text-decoration: none; }
.views a.on { background: var(--blue); color: #fff; }

/* layout */
.layout {
  display: grid; grid-template-columns: 320px minmax(0, 1fr);
  gap: 1.25rem; padding: 1.25rem 1.5rem; max-width: 1500px; margin: 0 auto;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 1rem; }
  .top { flex-wrap: wrap; }
}
.content { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }

/* cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem 1.25rem;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.card-foot { margin: .75rem 0 0; color: var(--muted); font-size: .92rem; }
.kicker { margin: 0 0 .5rem; font-size: .9rem; }
.object h2 { font-size: 1.2rem; word-break: break-all; }
.error { text-align: center; padding: 3rem 1rem; }

/* summary numbers */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .9rem 1.25rem; display: flex; flex-direction: column;
}
.stat .n { font-size: 1.75rem; font-weight: 600; color: var(--blue-dark); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .9rem; margin-top: .2rem; }

/* filters */
.filters { position: sticky; top: 1rem; align-self: start; max-height: calc(100vh - 2rem); overflow: auto; }
.filters form {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .75rem 1rem 1rem;
}
.filters-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: .5rem; }
.filters-head h2 { font-size: 1.05rem; }
.reset { font-size: .9rem; color: var(--muted); }
.facet { border-top: 1px solid var(--line); }
.facet summary {
  cursor: pointer; padding: .55rem 0; font-weight: 500; list-style: none; display: flex; align-items: center; gap: .5rem;
}
.facet summary::before { content: ""; width: .45rem; height: .45rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
.facet[open] summary::before { transform: rotate(45deg); }
.facet summary::-webkit-details-marker { display: none; }
.badge { background: var(--blue); color: #fff; border-radius: 999px; font-size: .75rem; padding: 0 .5rem; font-weight: 600; }
.facet-body { padding: 0 0 .6rem; }
.facet-filter { width: 100%; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 6px; margin-bottom: .4rem; font: inherit; }
.facet-list { max-height: 13rem; overflow: auto; display: flex; flex-direction: column; }
.facet-list label {
  display: flex; align-items: center; gap: .45rem; padding: .18rem .25rem; border-radius: 5px; cursor: pointer; font-size: .92rem;
}
.facet-list label:hover { background: var(--blue-light); }
.facet-list label.sel { background: var(--blue-light); }
.facet-list .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facet-list .cnt { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .85rem; }
.facet-list label[hidden] { display: none; }
.dates { display: flex; flex-direction: column; gap: .4rem; font-size: .92rem; }
.dates input { font: inherit; padding: .25rem .4rem; border: 1px solid var(--line); border-radius: 6px; margin-left: .3rem; }
.gray { display: flex; align-items: center; gap: .45rem; padding: .6rem 0; border-top: 1px solid var(--line); font-size: .92rem; }
.apply {
  width: 100%; padding: .55rem; background: var(--blue); color: #fff; border: 0; border-radius: 8px;
  font: inherit; font-weight: 600; cursor: pointer;
}
.apply:hover { background: var(--blue-dark); }
.js .apply { display: none; }
.js-only { display: none; }
.js .js-only { display: block; }

/* segmented control */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg a { padding: .3rem .8rem; color: var(--muted); font-size: .9rem; border-right: 1px solid var(--line); }
.seg a:last-child { border-right: 0; }
.seg a:hover { background: var(--blue-light); text-decoration: none; }
.seg a.on { background: var(--blue); color: #fff; }

/* chart */
.bars { width: 100%; height: auto; display: block; }
.bars .grid { stroke: #e6eaef; stroke-width: 1; }
.bars .axis { stroke: #b9c2cc; stroke-width: 1; }
.bars .bar { fill: var(--accent); }
.bars .bar:hover { fill: var(--accent-dark); }
.bars text { font-size: 11px; fill: var(--muted); }
.bars .empty { font-size: 14px; }
.csv::before { content: "\2193  "; }

/* map: an Equal Earth SVG, as wide as the card, the whole world at once */
#map { position: relative; border-radius: 8px; border: 1px solid var(--line); background: #fbfcfd; overflow: hidden; }
#map svg { width: 100%; height: auto; display: block; }
.sphere { fill: #eef4fa; stroke: #c3ccd6; stroke-width: .8; }
.graticule { fill: none; stroke: #dbe2e9; stroke-width: .5; }
.country { stroke: #8a94a0; stroke-width: .35; }
.country.hot { cursor: pointer; }
.country.hot:hover { stroke: #1b4f8a; stroke-width: 1.2; }
.maptip { position: absolute; display: none; pointer-events: none; background: #fff; border: 1px solid var(--line); padding: .3rem .55rem; border-radius: 6px; font-size: .85rem; line-height: 1.35; box-shadow: 0 2px 8px rgba(0,0,0,.12); white-space: nowrap; z-index: 2; }
.legend { position: absolute; right: .6rem; bottom: .6rem; background: rgba(255,255,255,.92); padding: .4rem .6rem; border-radius: 6px; font-size: .8rem; line-height: 1.5; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.legend i { display: inline-block; width: 1rem; height: .8rem; margin-right: .35rem; vertical-align: -1px; border: 1px solid rgba(0,0,0,.15); }
.table-details { margin-top: .6rem; }
.table-details summary { cursor: pointer; color: var(--muted); font-size: .9rem; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
td { padding: .45rem .5rem; border-bottom: 1px solid #eef1f4; vertical-align: top; }
tr:hover td { background: #f7f9fc; }
td.empty { color: var(--muted); text-align: center; padding: 1.5rem; }
.objs td:first-child { word-break: break-all; }
.ext::after { content: " \2197"; font-size: .8em; color: var(--muted); }
.countries { max-height: 20rem; overflow: auto; display: block; }

/* pager */
.pager { display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.pg { padding: .25rem .6rem; border: 1px solid var(--line); border-radius: 6px; }
.pg.off { color: #b9c2cc; }
.range { color: var(--muted); }

/* footer */
.foot { color: var(--muted); font-size: .85rem; text-align: center; padding: 1.5rem 1rem 2rem; }
.foot .build { opacity: .7; }

/* the choice lists of the Previews and Python-library views */
.choices {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .75rem 1rem 1rem; display: flex; flex-direction: column; gap: .25rem;
}
.choices h2 { font-size: 1.05rem; margin-bottom: .4rem; }
.choice { display: block; padding: .45rem .7rem; border-radius: 8px; color: var(--ink); }
.choice:hover { background: var(--blue-light); text-decoration: none; }
.choice.on { background: var(--blue); color: #fff; }
.subchoices { display: flex; gap: .25rem; padding: .1rem 0 .3rem .7rem; flex-wrap: wrap; }
.subchoices .choice { font-size: .88rem; padding: .25rem .6rem; border: 1px solid var(--line); }
.hint { color: var(--muted); font-size: .88rem; margin: .6rem 0 0; }
.problem { background: #fff4e5; border: 1px solid #f5d0a0; color: #7a4b00; padding: .6rem .8rem; border-radius: 8px; font-size: .9rem; }
.vars { margin-top: .25rem; font-size: .85rem; color: var(--muted); }
.vars summary { cursor: pointer; }
.vars ul { margin: .2rem 0 0; padding-left: 1.2rem; }

/* busy: the next page is on its way */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--blue); z-index: 99; opacity: 0; }
.busy .progress { width: 92%; opacity: 1; transition: width 6s cubic-bezier(.1,.7,.3,1), opacity .2s; }
.busy .summary, .busy .chart .bars, .busy .map svg, .busy .objects table { opacity: .45; filter: grayscale(1); transition: opacity .3s, filter .3s; }
.busy .stat .n { color: #9aa4ae; }
.busy .bars .bar { fill: #c9cfd6; }
.filters-head .spin { display: none; width: .9rem; height: .9rem; border: 2px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; margin-left: .5rem; vertical-align: middle; }
.busy .filters-head .spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }