/* vynik: the statistics' own pages. No script; light and dark by the reader's system. */
:root {
  color-scheme: light dark;
  --bg: #f6f7f9; --card: #ffffff; --text: #1d2430; --muted: #5d6675; --line: #dfe3e8;
  --accent: #2f6db5; --bar: #4f8fd6; --mark: #d9822b; --here: #e8f0fa;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14181f; --card: #1c222b; --text: #e6e9ee; --muted: #9aa3b1; --line: #2e3642;
    --accent: #7fb0ec; --bar: #5b9be0; --mark: #f0a35c; --here: #233247; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0 0 1rem; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
button, .button, input { font: inherit; }
button, .button { background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: .45rem .9rem; cursor: pointer; display: inline-block; }
button.quiet { background: none; color: var(--muted); padding: .2rem .4rem; }
.top { display: flex; justify-content: space-between; align-items: center; padding: .7rem 1.2rem; background: var(--card); border-bottom: 1px solid var(--line); }
.top form { margin: 0; }
.brand { font-weight: 600; color: var(--text); }
.brand span { color: var(--muted); font-weight: 400; }
.frame { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 1.2rem; padding: 1.2rem; max-width: 84rem; margin: 0 auto; }
.menu { display: flex; flex-direction: column; gap: .1rem; position: sticky; top: 1rem; align-self: start; }
.menu a { padding: .35rem .6rem; border-radius: 6px; color: var(--text); }
.menu a[aria-current] { background: var(--here); color: var(--accent); font-weight: 600; }
.menu a:nth-child(2) { margin-bottom: .6rem; }
main { min-width: 0; }
main.alone { max-width: 34rem; margin: 4rem auto; background: var(--card); padding: 2rem; border-radius: 10px; border: 1px solid var(--line); }
.period { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; margin-bottom: 1.2rem; color: var(--muted); }
.period .choices a { margin-right: .7rem; }
.period .choices a[aria-current] { font-weight: 600; color: var(--text); }
.period .range { display: flex; gap: .5rem; align-items: center; margin: 0; }
.period input { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: .25rem .4rem; }
section, .totals, .visits > li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
section { padding: 1rem 1.1rem; margin-bottom: 1.2rem; }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); margin: 0 0 1.2rem; padding: .4rem; }
.totals div { padding: .6rem .8rem; }
.totals dt { color: var(--muted); font-size: .85rem; }
.totals dd { margin: .2rem 0 0; font-size: 1.6rem; font-weight: 600; }
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--bar); }
.chart .mark { fill: var(--mark); }
.chart .hit { fill: transparent; }
.chart g:hover .bar { fill: var(--accent); }
.chart .axis, .chart .grid { stroke: var(--line); }
.chart .tick { fill: var(--muted); font-size: 11px; }
.tops { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 0 1.2rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .35rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; font-weight: 400; }
thead th { color: var(--muted); font-size: .85rem; }
tbody th { word-break: break-word; }
.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
meter { display: block; width: 100%; height: .3rem; margin-top: .25rem; }
.more { margin: .6rem 0 0; text-align: right; }
.empty { color: var(--muted); }
.error { color: #b3261e; }
.visits { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.visits summary { display: grid; grid-template-columns: 9rem minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: .8rem; padding: .55rem .9rem; cursor: pointer; }
.visits .when { color: var(--muted); font-variant-numeric: tabular-nums; }
.visits .count { text-align: right; white-space: nowrap; }
.visits .inside { padding: 0 .9rem .7rem 2rem; }
.visits .ref { color: var(--muted); margin: 0 0 .4rem; word-break: break-all; }
.requests { margin: 0; padding-left: 1.2rem; }
.requests .at { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .frame { grid-template-columns: 1fr; padding: .8rem; }
  .menu { position: static; flex-direction: row; flex-wrap: wrap; }
  .menu a:nth-child(2) { margin-bottom: 0; }
  .visits summary { grid-template-columns: 1fr; gap: .1rem; }
  .visits .count { text-align: left; }
  .tops { grid-template-columns: 1fr; }
}
