:root {
  --ink: #202824;
  --muted: #66716b;
  --line: #dfe5e1;
  --soft-line: #edf0ee;
  --accent: #08745e;
  --surface: #f5f7f6;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:disabled { opacity: .5; cursor: wait; }
[hidden] { display: none !important; }
main { max-width: 1304px; margin: 0 auto; padding: 0 32px 24px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px 0 18px; }
h1 { margin: 0; font-size: 21px; line-height: 1.4; font-weight: 600; letter-spacing: -.3px; }
h1 span { color: var(--accent); margin-inline-end: 10px; }
.refresh-button, .error-state button { min-height: 34px; padding: 6px 13px; color: var(--ink); background: #fff; border: 1px solid #cbd4ce; border-radius: 4px; white-space: nowrap; }
.refresh-button:hover, .error-state button:hover { background: var(--surface); }
.filters { display: flex; align-items: center; gap: 22px; padding-bottom: 19px; }
.periods { display: flex; border: 1px solid #cbd4ce; border-radius: 4px; overflow: hidden; }
.periods button { min-height: 34px; padding: 6px 13px; border: 0; border-inline-end: 1px solid #cbd4ce; color: #536057; background: #fff; }
.periods button:last-child { border-inline-end: 0; }
.periods button.selected { color: #fff; background: var(--accent); }
.periods button:not(.selected):hover { background: var(--surface); }
.version-filter { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.version-filter select { min-height: 34px; min-width: 138px; max-width: 205px; padding: 5px 25px 5px 10px; border: 1px solid #cbd4ce; border-radius: 4px; color: var(--ink); background: #fff; }
.updated { margin-inline-start: auto; font-size: 12px; color: var(--muted); }
#content[aria-busy=true] { opacity: .5; pointer-events: none; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); margin-bottom: 20px; }
.summary-card { padding: 17px 20px 16px; border-inline-end: 1px solid var(--line); }
.summary-card:first-child { padding-inline-start: 0; }
.summary-card:last-child { border-inline-end: 0; }
.card-label { color: #536057; font-size: 12px; }
.summary-card>strong { display: block; margin: 5px 0 3px; font-size: 29px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; }
.panel { min-width: 0; border-bottom: 1px solid var(--line); padding-bottom: 13px; margin-bottom: 23px; }
.panel-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 0 12px; }
h2 { margin: 0; font-size: 14px; font-weight: 600; }
.primary-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 30px; }
.secondary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
.legend { display: flex; gap: 18px; font-size: 11px; color: #536057; white-space: nowrap; }
.legend-line { display: inline-block; width: 17px; margin-inline-end: 6px; border-top: 2px solid var(--accent); vertical-align: middle; }
.session-line { border-top-color: #7b8981; border-top-style: dashed; }
.chart { display: flex; align-items: center; justify-content: center; height: 230px; padding: 0 2px; }
.chart svg { width: 100%; height: 230px; overflow: visible; }
.chart text { fill: var(--muted); font-size: 10px; font-family: inherit; }
.bar-list { padding-top: 4px; min-height: 230px; }
.bar-item { margin-bottom: 17px; }
.bar-item:last-child { margin-bottom: 0; }
.bar-line { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; color: #414d45; font-size: 12px; }
.bar-count { color: var(--muted); font-size: 11px; }
.bar-count b { color: #414d45; font-weight: 500; }
.bar-track { height: 5px; background: var(--soft-line); }
.bar-fill { height: 100%; background: var(--accent); }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: start; white-space: nowrap; font-size: 12px; }
th { border-block: 1px solid var(--line); background: var(--surface); color: #536057; padding: 8px 12px; font-size: 11px; font-weight: 500; }
td { padding: 10px 12px; border-bottom: 1px solid var(--soft-line); color: #3f4b43; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-inline-start: 10px; }
th:not(:first-child), td.numeric { text-align: end; font-variant-numeric: tabular-nums; }
.rate { color: var(--accent); font-weight: 500; }
.rate.dim { color: var(--muted); font-weight: 400; }
.cell-muted { color: var(--muted); font-size: 11px; }
.table-empty { padding: 29px 12px; color: var(--muted); font-size: 12px; line-height: 1.7; text-align: center; }
.retention-grid { display: grid; grid-template-columns: 1fr 1fr; padding: 3px 0 6px; }
.retention-box { padding: 0 15px; }
.retention-box:first-child { padding-inline-start: 0; border-inline-end: 1px solid var(--line); }
.retention-box span { display: block; color: #536057; font-size: 12px; }
.retention-box strong { display: block; margin: 6px 0 3px; color: var(--ink); font-size: 25px; font-weight: 500; font-variant-numeric: tabular-nums; }
.recommendations { padding: 0 0 16px; color: #536057; font-size: 12px; line-height: 1.7; }
.recommendations strong { margin-inline-start: 10px; color: var(--ink); font-size: 22px; font-weight: 500; }
.empty-state { padding: 12px 15px; border-inline-start: 3px solid var(--accent); background: var(--surface); margin-bottom: 18px; }
.empty-state strong { color: #3d4b42; font-size: 13px; font-weight: 500; }
.error-state { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 15px; padding: 12px 15px; color: #8d3329; background: #fdf5f3; border-inline-start: 3px solid #ab4e41; margin-bottom: 18px; font-size: 12px; }
.error-state strong { font-weight: 600; }
.error-state button { margin-inline-start: auto; }
.error-code { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 11px; }
@media (max-width: 1000px) {
  main { padding-inline: 24px; }
  .primary-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; }
  .secondary-grid { gap: 24px; }
  .summary-card { padding-inline: 16px; }
  .panel-header { flex-wrap: wrap; gap: 5px 10px; }
}
@media (max-width: 760px) {
  main { padding-inline: 20px; }
  .page-heading { padding-top: 20px; }
  .filters { flex-wrap: wrap; gap: 12px 18px; }
  .updated { width: 100%; margin-inline-start: 0; }
  .primary-grid, .secondary-grid { grid-template-columns: 1fr; gap: 0; }
  .bar-list { min-height: 0; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-card { padding: 14px 18px; }
  .summary-card:first-child { padding-inline-start: 18px; }
  .summary-card:nth-child(2) { border-inline-end: 0; }
  .summary-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .panel { margin-bottom: 21px; }
  .panel-header { flex-wrap: nowrap; }
}
@media (max-width: 480px) {
  main { padding-inline: 16px; }
  h1 { font-size: 18px; }
  h1 span { margin-inline-end: 6px; }
  .page-heading { gap: 10px; }
  .refresh-button { padding-inline: 10px; font-size: 12px; }
  .filters { gap: 10px 12px; padding-bottom: 15px; }
  .periods button { padding-inline: 10px; font-size: 12px; }
  .version-filter { gap: 6px; font-size: 11px; }
  .version-filter select { min-width: 112px; max-width: 145px; padding-inline-start: 7px; font-size: 12px; }
  .summary-card, .summary-card:first-child { padding-inline: 12px; }
  .summary-card>strong { font-size: 27px; }
  .panel-header { flex-wrap: wrap; }
  .chart { height: 215px; padding: 0; }
  .chart svg { height: 215px; }
  .legend { gap: 14px; }
  .retention-box { padding-inline-end: 0; }
  .error-state span { width: 100%; }
  .error-state button { margin-inline-start: 0; }
}
.catalog-link { display: inline-block; margin-bottom: 5px; color: var(--accent); font-size: 12px; text-decoration: none; }
.catalog-link:hover { text-decoration: underline; }
.catalog-meta { display: flex; justify-content: space-between; gap: 15px; padding: 2px 0 14px; font-size: 12px; color: var(--muted); }
.catalog-table { margin-top: 3px; }
.catalog-table td { padding-block: 17px; }
.catalog-table a { color: var(--accent); text-underline-offset: 3px; }
.catalog-table small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }

.header-controls { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.language-control { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.language-control select { min-height: 34px; max-width: 178px; padding: 5px 24px 5px 9px; border: 1px solid #cbd4ce; border-radius: 4px; color: var(--ink); background: #fff; font: inherit; }
h1 b { font-weight: inherit; }
[dir="rtl"] h1 { letter-spacing: normal; }
[dir="rtl"] .language-control select { padding-inline: 9px 24px; }
.numeric { unicode-bidi: plaintext; }
@media (max-width: 760px) {
  .page-heading { align-items: flex-start; flex-wrap: wrap; }
  .header-controls { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .page-heading { flex-direction: column; align-items: stretch; gap: 13px; }
  .header-controls { justify-content: space-between; gap: 10px; }
  .language-control select { max-width: 155px; }
}

.webstats { margin-top: 35px; border-top: 1px solid var(--line); padding-top: 22px; min-width: 0; }
.webstats-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 17px; }
.webstats-heading h2 { font-size: 17px; }
.webstats-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px 16px; padding-bottom: 20px; color: var(--muted); }
.webstats-total strong { font-size: 29px; line-height: 1.3; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.webstats-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; gap: 30px; }
.webstats-ranking { max-height: 360px; overflow: auto; overscroll-behavior: contain; }
.webstats-ranking:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.webstats-ranking th { position: sticky; top: 0; z-index: 1; }
.webstats h3 { margin: 0; font-size: 14px; font-weight: 600; }
.webstats-pages { table-layout: fixed; min-width: 0; }
.webstats-pages th, .webstats-pages td { white-space: normal; overflow-wrap: anywhere; }
.webstats-pages th:first-child, .webstats-pages td:first-child { width: 32%; }
.webstats-pages th:last-child, .webstats-pages td:last-child { width: 108px; }
.webstats-pages th:nth-child(2), .webstats-pages td:nth-child(2) { text-align: start; }
.webstats-pages bdi { display: block; direction: ltr; unicode-bidi: isolate; }
.webstats-pages td { vertical-align: top; }
@media (max-width: 1000px) { .webstats-grid { grid-template-columns: 1fr; gap: 0; } }
@media (max-width: 480px) { .webstats { margin-top: 26px; } .webstats-total .updated { width: 100%; } }
