/*
 * stats.css: styles for the logbook's Stats section (logbook.html only). Loaded AFTER styles.css, so it reuses its tokens (--ink,
 * --muted, --rule, --bg, --accent, --mono) and follows the visitor's light/dark setting with no JavaScript. No inline styles
 * anywhere (the page CSP allows only our own stylesheet): the charts are SVG shapes coloured by the classes below.
 */
.statgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px; }
.stat { border: 1px solid var(--rule); background: var(--bg); padding: 10px 12px; }
.stat .n { display: block; font: 700 26px var(--mono); color: var(--ink); }
.stat .l { display: block; font: 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.statline { grid-column: 1 / -1; margin: 0; font-size: 14px; color: var(--muted); }

.statcols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
#stats h3 { font-family: var(--serif); font-size: 18px; margin: 18px 0 6px; }
.schart, .heat { display: block; width: 100%; height: auto; }
.schart .bar { fill: var(--accent); }
.schart .lbl { fill: var(--ink); font: 12px var(--mono); }
.schart .num { fill: var(--muted); font: 12px var(--mono); }
.heat .lbl { fill: var(--muted); font: 10px var(--mono); }
.heatwrap { overflow-x: auto; }

/* activity calendar: five levels in the accent colour, quiet days in the rule colour, days after today only outlined */
.heat .h0 { fill: var(--rule); fill-opacity: .35; }
.heat .h1 { fill: var(--accent); fill-opacity: .3; }
.heat .h2 { fill: var(--accent); fill-opacity: .55; }
.heat .h3 { fill: var(--accent); fill-opacity: .8; }
.heat .h4 { fill: var(--accent); fill-opacity: 1; }
.heat .future { fill: none; stroke: var(--rule); stroke-opacity: .25; }
.heatkey { display: flex; align-items: center; gap: 3px; }
.heatkey .sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; background: var(--rule); opacity: .35; }
.heatkey .sw.h1 { background: var(--accent); opacity: .3; }
.heatkey .sw.h2 { background: var(--accent); opacity: .55; }
.heatkey .sw.h3 { background: var(--accent); opacity: .8; }
.heatkey .sw.h4 { background: var(--accent); opacity: 1; }

.countries { list-style: none; margin: 6px 0; padding: 0; columns: 3 220px; column-gap: 24px; }
.countries li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dotted var(--rule); break-inside: avoid; }
.countries .n { font: 12px var(--mono); color: var(--muted); }

/* states worked: the 50 postal codes, filled in once worked; grid squares as small tags with their count */
.states { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.states li { font: 600 12px var(--mono); padding: 3px 7px; border: 1px solid var(--rule); color: var(--muted); border-radius: 3px; }
.states li.worked { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.grids { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.grids li { display: flex; gap: 8px; align-items: baseline; padding: 3px 8px; border: 1px solid var(--rule); border-radius: 3px; }
.grids .g { font: 600 13px var(--mono); }
.grids .n { font: 12px var(--mono); color: var(--muted); }

@media (max-width: 640px) {
  .statgrid { grid-template-columns: 1fr 1fr; }
  .statcols { grid-template-columns: 1fr; }
  /* the charts are drawn on a fixed-width canvas that shrinks on a phone, so bigger text keeps the labels readable; the calendar keeps a readable width and scrolls */
  .schart .lbl, .schart .num { font-size: 16px; }
  .heat { min-width: 640px; }
}
