:root {
  color-scheme: light;
  --page: #f4f3f0; --surface: #fcfcfb; --line: #e3e2dd;
  --text: #0b0b0b; --text-2: #52514e; --muted: #8a8983;
  --s-instagram: #2a78d6; --s-youtube: #eb6834; --s-tiktok: #1baf7a;
  --good: #087a08; --warn-bg: #fff4d6; --warn-line: #e5b53a; --error: #b42323;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #111110; --surface: #1a1a19; --line: #33332f;
    --text: #f0efec; --text-2: #c3c2b7; --muted: #8f8e86;
    --s-instagram: #3987e5; --s-youtube: #d95926; --s-tiktok: #199e70;
    --good: #2fbf2f; --warn-bg: #3a2f10; --warn-line: #8a6a12; --error: #f08080;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 1280px; margin: 0 auto; padding: 20px 16px 48px; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
a { color: var(--s-instagram); }
code { background: var(--line); padding: 1px 5px; border-radius: 4px; }
.sprite { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.up { color: var(--good); }
.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.top { display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.top form { margin-left: auto; }
.brand { font-weight: 600; color: var(--text); text-decoration: none; }
.crumb::before { content: "/"; margin-right: 12px; color: var(--muted); }
button.link { background: none; border: 0; color: var(--text-2); cursor: pointer; font: inherit; padding: 4px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.scroll { overflow-x: auto; }
.head { margin-bottom: 16px; }
.head p { margin: 0; }
.warn { background: var(--warn-bg); border-color: var(--warn-line); padding: 12px 16px; margin-bottom: 16px; }
.warn ul { margin: 6px 0 0; padding-left: 20px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tile { padding: 14px 16px; }
.tile.sum { border-width: 2px; }
.tile .label { color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.tile .big { font-size: 30px; font-weight: 650; font-variant-numeric: tabular-nums; margin: 2px 0; }
.tile .sub { color: var(--text-2); font-size: 13px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.tile .dot { margin-right: 0; }
.s-instagram { background: var(--s-instagram); }
.s-youtube { background: var(--s-youtube); }
.s-tiktok { background: var(--s-tiktok); }

.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; margin-top: 12px; }
.chart { padding: 14px 16px; min-width: 0; }
.chart h2 { margin: 0 0 8px; font-size: 15px; }
.chart .canvas { position: relative; height: 260px; }
.chart details { margin-top: 8px; color: var(--text-2); }
.chart summary { cursor: pointer; font-size: 13px; }

table { border-collapse: collapse; width: 100%; }
th { font-weight: 600; color: var(--text-2); font-size: 13px; text-align: left; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td, tfoot td { border-bottom: 0; }
tfoot td { border-top: 2px solid var(--line); font-weight: 600; }
th.n { text-align: right; }
th.platform { text-align: center; border-left: 1px solid var(--line); white-space: nowrap; }
.videos .first { border-left: 1px solid var(--line); }
.videos td.thumb { width: 54px; padding-right: 0; }
.videos img, .nothumb { display: block; width: 54px; height: 96px; object-fit: cover; border-radius: 6px; background: var(--line); }
.videos .title { min-width: 180px; max-width: 320px; }
.videos .date { white-space: nowrap; }
.metrics + .metrics { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.metrics > div { line-height: 1.7; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.metrics > div:not(:has(.icon)) { justify-content: flex-end; }
.icon { width: 15px; height: 15px; flex: none;
  fill: none; stroke: var(--muted); stroke-width: 2; stroke-linejoin: round; }

.login { max-width: 340px; margin: 12vh auto 0; padding: 24px; display: grid; gap: 14px; }
.login h1 { margin: 0; }
.login label { display: grid; gap: 4px; color: var(--text-2); font-size: 13px; }
.login input { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--page); color: var(--text); }
.login button { font: inherit; font-weight: 600; padding: 10px; border: 0; border-radius: 6px;
  background: var(--s-instagram); color: #fff; cursor: pointer; }
.error { color: var(--error); margin: 0; }
