@font-face {
  font-family: Geist;
  src: url("assets/geist-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Geist;
  src: url("assets/geist-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Exo 2";
  src: url("/assets/exo-2-logo.woff2") format("woff2");
  font-style: normal;
  font-weight: 650;
  font-display: swap;
  unicode-range: U+2E, U+64, U+68, U+6B, U+6F, U+72, U+75-76;
}

:root {
  color-scheme: light;
  --background: #f7f7fc;
  --surface: #fff;
  --surface-raised: #eeedf6;
  --ink: #1c1930;
  --muted: #5e5b73;
  --blue: #5a43c5;
  --blue-hover: #4831ad;
  --blue-dark: #4f38b3;
  --blue-light: #eeebff;
  --red: #a32843;
  --line: #dedbe9;
  --input-line: #88829e;
  --highlight-ink: #35217c;
  --highlight-line: #c8bff0;
  --hero-glow: #eae4ff;
  --button-ink: #fff;
  --selection: #dfd6ff;
  --shadow: #2a224127;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  font-family: Geist, Arial, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--background);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #11121a;
  --surface: #191b26;
  --surface-raised: #202331;
  --ink: #f5f5fb;
  --muted: #acb0c4;
  --blue: #9b91fa;
  --blue-hover: #b1a9ff;
  --blue-dark: #beb7ff;
  --blue-light: #24213b;
  --red: #ff939e;
  --line: #303244;
  --input-line: #6b6b87;
  --highlight-ink: #dfd9ff;
  --highlight-line: #48406c;
  --hero-glow: #292542;
  --button-ink: #16112d;
  --selection: #514587;
  --shadow: #08091099;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; }
h1, h2, p, dl, dd { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, summary { cursor: pointer; }
[hidden], .symbol-library { display: none !important; }
::selection { background: var(--selection); color: var(--ink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
h1:focus, main:focus { outline: none; }
.shell { width: min(calc(100% - 64px), 1160px); margin-inline: auto; }

.skip-link { position: fixed; top: 8px; left: 8px; z-index: 2; padding: 10px 14px; transform: translateY(calc(-100% - 16px)); background: var(--surface); }
.skip-link:focus { transform: none; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.site-header { position: sticky; top: 0; z-index: 1; padding-top: env(safe-area-inset-top); background: var(--background); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; min-height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: "Exo 2", Geist, Arial, sans-serif; font-size: 24px; font-weight: 650; letter-spacing: -.045em; }
.brand-domain, .header-link { color: var(--muted); }
.header-link, .text-link { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-size: 14px; font-weight: 650; }
.header-link[aria-current], .text-link { color: var(--blue-dark); }
.header-nav { display: flex; align-items: center; gap: 6px; }
.header-link { justify-content: center; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; white-space: nowrap; }
.header-link[href="/catalog"] { background: var(--surface-raised); }
.header-link[aria-current] { border-color: var(--input-line); }
.theme-toggle { flex: none; min-width: 34px; padding: 0; background: var(--background); font-size: 17px; line-height: 1; }
.text-link .icon { width: 17px; height: 17px; }

main:has(> .home:not([hidden])) { display: flex; flex-direction: column; }
.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(12px, 3dvh, 24px);
  padding-block: clamp(10px, 2dvh, 24px);
}
.calculator {
  padding: clamp(18px, 3.5dvh, 54px) clamp(20px, 5vw, 64px);
  background: radial-gradient(ellipse at 50% 0%, var(--hero-glow), transparent 76%), var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  text-align: center;
}
.calculator h1 {
  max-width: 940px;
  margin-inline: auto;
  font-size: clamp(36px, min(7vw, 10dvh), 84px);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.062em;
  text-wrap: balance;
}
.calculator h1 span { color: var(--blue-dark); white-space: nowrap; }
#channel-form { margin: clamp(14px, 3.5dvh, 35px) auto 0; max-width: 640px; text-align: left; }
.channel-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.overview > div { min-width: 0; padding: 15px 18px 22px; }
.overview > div + div { border-left: 1px solid var(--line); }
.overview dt { font-size: 16px; font-weight: 650; }
.overview dd { color: var(--muted); margin-top: 4px; font-size: 14px; line-height: 1.45; }
.link-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-inline: 15px;
  border: 1px solid var(--input-line);
  border-radius: 12px;
  background: var(--background);
  color: var(--muted);
}
.link-field:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.link-field:has([aria-invalid="true"]) { border-color: var(--red); }
.link-field input { width: 100%; min-width: 0; min-height: 55px; padding: 0; border: 0; outline: none; color: var(--ink); caret-color: var(--blue); background: none; font-size: 16px; }
.link-field input::placeholder { color: var(--muted); opacity: 1; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: var(--button-ink);
  font-size: 15px;
  font-weight: 650;
  transition: background-color 160ms ease, transform 140ms var(--ease-out);
}
.button:disabled { cursor: wait; opacity: .72; }
.button:active:not(:disabled) { transform: scale(.98); }
.form-error { margin-top: 11px; font-size: 14px; font-weight: 700; }
.form-error { color: var(--red); }
.muted { color: var(--muted); }
.analysis-progress {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--highlight-line);
  border-radius: 14px;
  background: var(--blue-light);
}
.analysis-progress-head { display: flex; align-items: center; gap: 10px; }
.analysis-indicator {
  flex: 0 0 22px;
  height: 22px;
  border: 2px solid var(--highlight-line);
  border-top-color: var(--blue-dark);
  border-radius: 50%;
  animation: analysis-spin 1s linear infinite;
}
@keyframes analysis-spin { to { transform: rotate(1turn); } }
#analysis-stage { color: var(--ink); font-size: 15px; font-weight: 650; line-height: 1.3; }
#analysis-detail { margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.analysis-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 0; margin: 12px 0 0; list-style: none; }
.analysis-steps li { padding-top: 4px; border-top: 3px solid var(--highlight-line); color: var(--muted); font-size: 12px; }
.analysis-steps li[data-reached] { border-top-color: var(--blue); }
.analysis-steps li[aria-current="step"] { color: var(--blue-dark); font-weight: 650; }
.analysis-return { margin-top: 9px; color: var(--muted); font-size: 12px; }
.home:has(.analysis-progress:not([hidden])) .overview { display: none; }

.report, .methodology { padding-block: 28px 65px; }
.back { margin-bottom: 18px; }
html:has(.report:not([hidden])) {
  --report-header-height: calc(69px + env(safe-area-inset-top));
  --report-nav-height: 65px;
  scroll-padding-top: calc(var(--report-header-height) + var(--report-nav-height) + 16px);
}
.report { --report-space: clamp(16px, 3.2vw, 36px); padding-top: 0; }
.report-nav {
  position: sticky;
  top: var(--report-header-height);
  z-index: 1;
  background: var(--background);
  border-bottom: 1px solid var(--line);
}
.report-nav-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: calc(var(--report-nav-height) - 1px);
}
.report-nav-channel { display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 44px; width: fit-content; max-width: 100%; border-radius: 8px; }
.report-nav .profile-mark { flex: none; width: 32px; border-radius: 8px; font-size: 16px; }
.report-nav-identity { display: grid; min-width: 0; line-height: 1.2; gap: 2px; }
.report-nav-caption, .report-nav-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-nav-caption { color: var(--muted); font-size: 11px; font-weight: 500; }
.report-nav-name { font-size: 14px; font-weight: 650; }
.report-nav-sections { display: flex; gap: 3px; min-width: 0; }
.report-nav-sections a {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding-inline: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.report-nav-sections a[aria-current="location"] { color: var(--highlight-ink); background: var(--blue-light); border-color: var(--highlight-line); }
#another-channel { justify-self: end; min-height: 44px; color: var(--muted); white-space: nowrap; }
.profile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 17px; margin-block: 27px; }
.profile-mark { position: relative; display: grid; place-items: center; width: 68px; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--highlight-line); border-radius: 15px; background: var(--blue-light); color: var(--blue-dark); font-size: 33px; font-weight: 650; }
.profile-mark img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.source-sup { margin-inline-start: .35em; color: var(--muted); font-size: .52em; letter-spacing: 0; font-weight: 600; }
.profile h1, .methodology h1 { font-size: clamp(30px, 4.3vw, 54px); line-height: 1.04; letter-spacing: -.05em; overflow-wrap: anywhere; }
.source-date { margin-top: 7px; color: var(--muted); font-size: 13px; }
.source-link { justify-self: end; min-height: 38px; padding-inline: 11px; border: 1px solid var(--line); border-radius: 8px; }

.report-overview { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.estimate { container-type: inline-size; min-width: 0; padding: var(--report-space); background: var(--blue-light); border: 1px solid var(--highlight-line); border-radius: 16px; }
.estimate h2 { color: var(--highlight-ink); font-size: 15px; font-weight: 600; }
.estimate-value {
  margin-block: 10px 4px;
  font-size: clamp(29px, 4.6vw, 62px);
  font-size: clamp(1.25rem, 8cqi, 3.875rem);
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
}
.income-context { display: grid; gap: 4px; margin-top: 20px; }
.estimate .muted { font-size: 13px; }
.estimate .text-link { width: fit-content; font-size: 13px; }
#income-base { margin-top: 10px; color: var(--highlight-ink); font-size: 15px; }

.limit-dialog {
  width: min(420px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: clamp(18px, 5vw, 28px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 14px 40px var(--shadow);
}
.limit-dialog::backdrop { background: rgb(13 12 24 / 58%); }
.limit-dialog h2 { font-size: 22px; line-height: 1.2; }
.limit-dialog p { margin-top: 10px; color: var(--muted); }
.limit-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 18px; }
.limit-actions button { background: transparent; border: 0; }

.metrics { display: grid; align-content: center; padding-inline: clamp(12px, 2.6vw, 28px); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.metrics > div { padding: 13px 0; }
.metrics > div + div { border-top: 1px solid var(--line); }
.metrics dt, .metrics .metric-note { font-size: 13px; color: var(--muted); }
.metrics dd { margin-top: 4px; font-size: clamp(23px, 3.3vw, 34px); font-weight: 650; line-height: 1.08; letter-spacing: -.04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metrics dd.metric-note { font-size: 12px; font-weight: 500; letter-spacing: 0; }
.history, .insights, .publications { margin-top: clamp(30px, 4vw, 52px); }
.history-layout { display: grid; gap: 17px; margin-top: 17px; }
.history-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 14px 24px; }
.history-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px var(--report-space); }
.history-grid h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.history-value { font-size: clamp(23px, 3vw, 32px); font-weight: 650; line-height: 1.13; letter-spacing: -.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.history-grid p + p { margin-top: 4px; }
.history-grid .muted { font-size: 13px; }
.history-change { color: var(--blue-dark); font-size: 14px; }
.insight-heading, .publications-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 11px; }
.insight h2, .publications h2, .history h2 { font-size: clamp(23px, 3vw, 32px); line-height: 1.14; letter-spacing: -.045em; font-weight: 650; }
.insight p { margin-top: 6px; line-height: 1.55; overflow-wrap: anywhere; }
.insight-label { color: var(--muted); font-size: 12px; font-weight: 550; }
.insight-help { display: inline-flex; flex: none; align-items: center; gap: 5px; min-height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--blue-dark); white-space: nowrap; }
.insight-help span { display: grid; place-items: center; width: 15px; height: 15px; border: 1px solid currentColor; border-radius: 50%; font-size: 10px; }
.insight-popover { position-area: block-end span-inline-end; position-try-fallbacks: flip-inline; inset: auto; width: min(290px, calc(100vw - 36px)); margin: 5px 0 0; padding: 12px; border: 1px solid var(--input-line); border-radius: 10px; background: var(--surface-raised); color: var(--ink); font-size: 13px; box-shadow: 0 10px 30px var(--shadow); }
.insight-popover p { margin: 0 0 8px; }
.insight-popover a { color: var(--blue-dark); text-decoration: underline; }
.insights { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; gap: var(--report-space); }
.insight { min-width: 0; border-top: 1px solid var(--line); padding-top: 17px; }
.channel-topics { display: flex; flex-wrap: wrap; gap: 5px 12px; list-style: none; padding: 0; margin: 12px 0 0; color: var(--blue-dark); font-size: 13px; }
#about-type, .audience-breakdowns .muted { font-size: 13px; }
.audience-breakdowns > div { border-top: 1px solid var(--line); padding-top: 15px; margin-top: 15px; }
.audience-breakdowns h3 { margin: 0; font-size: 15px; }
.audience-gender { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 10px; }
.audience-gender dt { color: var(--muted); font-size: 13px; }
.audience-gender dd { margin-top: 1px; font-size: 24px; letter-spacing: -.045em; font-variant-numeric: tabular-nums; font-weight: 650; }
.audience-table { margin-top: 8px; }
.audience-table th, .audience-table td { padding: 7px 6px; font-size: 13px; }
.audience-table th:first-child { width: auto; }
.audience-table th:first-child, .audience-table th:last-child, .audience-table td:last-child { padding-inline: 6px; }
.audience-table th:first-child, .audience-table tbody th { white-space: nowrap; }
.age-share { width: 56%; }
.age-share meter { width: calc(100% - 40px); margin-right: 7px; height: 6px; vertical-align: middle; appearance: none; border: 0; background: var(--blue-light); border-radius: 5px; }
.age-share span { display: inline-block; width: 33px; }
.age-share meter::-webkit-meter-bar { border: 0; border-radius: 5px; background: var(--blue-light); }
.age-share meter::-webkit-meter-optimum-value { background: var(--blue); border-radius: 5px; }
.age-share meter::-moz-meter-bar { background: var(--blue); border-radius: 5px; }
.audience-countries { list-style: none; padding: 0; margin: 7px 0 0; font-size: 14px; }
.audience-countries li:nth-child(n + 3) { padding-left: 12px; color: var(--muted); }

.publications-heading { margin-bottom: 14px; }
.result-count { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 14px; text-align: right; vertical-align: top; }
thead { background: var(--surface-raised); }
thead th { color: var(--muted); font-size: 12px; }
th:first-child { text-align: left; padding-left: clamp(12px, 2.4vw, 28px); width: 100%; }
th:last-child, td:last-child { padding-right: clamp(12px, 2.4vw, 28px); }
td, th:not(:first-child) { white-space: nowrap; }
tbody tr + tr { border-top: 1px solid var(--line); }
tbody th { font-weight: 650; }
tbody th a { display: inline-block; overflow-wrap: anywhere; text-decoration: underline; text-decoration-color: var(--blue-dark); text-underline-offset: 3px; }
.video-table th:first-child { padding-left: 12px; }
.video-table th:last-child, .video-table td:last-child { padding-right: 12px; }
.video-date { color: var(--muted); }
.video-metric-label { display: none; }

.method-intro { margin-top: 14px; max-width: 56ch; color: var(--muted); line-height: 1.6; }
.method-date { margin-top: 9px; color: var(--muted); font-size: 13px; }
.method-content { margin-top: 26px; }
.method-content section { border-top: 1px solid var(--line); padding-block: 21px; }
.method-content h2 { font-size: 22px; letter-spacing: -.025em; font-weight: 650; }
.method-content p { margin-top: 7px; max-width: 70ch; color: var(--muted); line-height: 1.55; }
.method-content .formula { box-sizing: border-box; width: fit-content; max-width: 100%; padding: 8px 12px; margin-top: 10px; border-radius: 8px; background: var(--blue-light); color: var(--blue-dark); font-variant-numeric: tabular-nums; font-weight: 650; }
.method-example { margin: 18px 0 12px; padding: clamp(12px, 3vw, 24px); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.method-example figcaption { margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.method-scenarios { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.method-scenarios strong { display: block; margin-top: 4px; font-size: clamp(18px, 3.8vw, 31px); letter-spacing: -.04em; }
.method-scenarios span { display: block; color: var(--muted); font-size: 13px; }
.method-sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px 24px; margin-top: 12px; }
.method-sources h3 { margin: 0; font-size: 16px; }
.method-details { margin-top: 16px; }
.method-details summary { color: var(--blue-dark); }
@media (min-width: 900px) {
  .method-calculation { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); }
  .method-calculation .method-example { margin-top: 0; }
}
.catalog { padding-block: clamp(25px, 5vw, 54px) 64px; }
.catalog-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; }
.catalog-heading h1 { font-size: clamp(32px, 4.4vw, 53px); line-height: 1.05; letter-spacing: -.05em; }
.catalog-intro { margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.catalog-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin-top: 22px;
  padding: clamp(12px, 2vw, 20px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.catalog-filters label { display: grid; min-width: 0; gap: 5px; color: var(--muted); font-size: 13px; }
.catalog-filters input, .catalog-filters select { width: 100%; min-width: 0; min-height: 40px; padding: 6px 8px; border: 1px solid var(--input-line); border-radius: 7px; background: var(--background); color: var(--ink); font: inherit; font-size: 16px; }
.catalog-filters .button { min-height: 40px; }
.catalog-select { position: relative; min-width: 0; color: var(--ink); }
.catalog-select select { display: block; appearance: none; padding-inline-end: 32px; }
.catalog-select::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-end: 14px;
  width: 7px;
  height: 7px;
  margin-block: auto;
  border-right: 1.5px solid;
  border-bottom: 1.5px solid;
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}
.catalog-legacy-note, .catalog-total { color: var(--muted); font-size: 14px; }
.catalog-legacy-note { margin: 12px 0 0; }
.catalog-results, .catalog-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }
.catalog-results { justify-content: space-between; margin-block: 12px 8px; }
.catalog-total { margin: 0; }
.catalog-table-wrap {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
.catalog-table { table-layout: fixed; }
.catalog-table th, .catalog-table td { padding: 12px 8px; vertical-align: middle; }
.catalog-table th.catalog-channel { width: 29%; padding-inline-start: clamp(14px, 2vw, 22px); }
.catalog-table th:last-child, .catalog-table td:last-child { padding-inline-end: clamp(14px, 2vw, 22px); }
.catalog-table thead { background: var(--surface-raised); border-bottom: 1px solid var(--line); }
.catalog-table thead th { color: var(--ink); font-weight: 650; line-height: 1.3; white-space: normal; }
.catalog-table thead span { display: block; margin-top: 2px; color: var(--muted); font-weight: 500; }
.catalog-table thead .catalog-income { width: 19%; }
.catalog-table thead .catalog-followers { width: 13%; }
.catalog-table thead .catalog-date { width: 12%; }
.catalog-table thead th[aria-sort="descending"] { color: var(--blue-dark); }
.catalog-table thead th[aria-sort="descending"] span::after { content: "↓" / ""; margin-inline-start: 4px; color: var(--blue-dark); }
.catalog-table tbody td { white-space: normal; overflow-wrap: anywhere; }
.catalog-table tbody tr:focus-within { background: var(--surface-raised); }
.catalog-channel-info {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.catalog-channel-link {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
  text-decoration: none;
}
.catalog-channel-link:hover { color: var(--blue-dark); }
.catalog-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 10px;
  color: var(--blue-dark);
  background: var(--blue-light);
}
.catalog-avatar img { position: absolute; inset: 0; object-fit: cover; color: transparent; }
.catalog-channel-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.catalog-platform { white-space: nowrap; }
.catalog-topics::before { content: "·" / ""; margin-inline: 3px 5px; }
.catalog-table td.catalog-income { color: var(--blue-dark); font-weight: 700; }
.catalog-income > span:not(.catalog-metric) { white-space: nowrap; }
.catalog-table time { color: var(--muted); font-size: 12px; }
.catalog-metric { display: none; }
.catalog-pages { justify-content: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.catalog-empty { padding-block: 18px; color: var(--muted); }
@media (max-width: 880px) {
  .catalog-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 16px; }
  .catalog-search { grid-column: 1 / -1; }
  .catalog-filters .button { grid-column: 1 / -1; justify-self: end; }
  .catalog-table-wrap { overflow: visible; border: 0; border-radius: 0; background: transparent; }
  .catalog-table { display: block; }
  .catalog-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .catalog-table tbody { display: grid; gap: 10px; }
  .catalog-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 10px 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
  }
  .catalog-table tbody td { padding: 0; text-align: left; }
  .catalog-table tbody th.catalog-channel {
    grid-column: 1 / -1;
    width: auto;
    padding: 0 0 11px;
    border-bottom: 1px solid var(--line);
  }
  .catalog-table td.catalog-income { font-size: 15px; }
  .catalog-metric { display: block; margin-bottom: 3px; color: var(--muted); font-size: 12px; font-weight: 500; }
}
@media (min-width: 620px) and (max-width: 880px) {
  .catalog-table tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.cookie-banner {
  position: fixed;
  z-index: 3;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: grid;
  gap: 7px;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 9px 11px;
  border: 1px solid var(--input-line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 6px 30px var(--shadow);
  font-size: 13px;
  line-height: 1.35;
}
body:has(.home:not([hidden])) .cookie-banner {
  position: static;
  align-self: flex-end;
  margin: 0 max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) 0;
}
.cookie-actions { display: flex; justify-content: flex-end; gap: 6px; }
.cookie-actions button { min-width: 44px; min-height: 40px; padding-inline: 9px; border: 1px solid var(--input-line); border-radius: 7px; background: var(--surface-raised); color: var(--ink); }
.cookie-settings { padding: 0; border: 0; background: transparent; }
@media (hover: hover) and (pointer: fine) {
  .button:not(:disabled):hover { background: var(--blue-hover); }
  .header-link:hover, .insight-help:hover, .cookie-actions button:hover { border-color: var(--blue); }
  a:hover { text-decoration: underline; text-underline-offset: 3px; }
  .report-nav-channel:hover { text-decoration: none; }
  .report-nav-channel:hover .report-nav-name { color: var(--blue-dark); }
  tbody tr:hover { background: var(--surface-raised); }
}

@media (max-width: 700px) {
  .shell { width: auto; margin-inline: max(18px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-right)); }
  .calculator { padding-inline: clamp(21px, 5.7vw, 42px); }
  .calculator h1 { font-size: clamp(31px, min(8.4vw, 10dvh), 59px); }
  html:has(.report:not([hidden])) {
    --report-nav-height: 105px;
    --report-nav-offset: calc(var(--report-nav-height) + env(safe-area-inset-bottom));
    scroll-padding-top: 16px;
    scroll-padding-bottom: calc(var(--report-nav-offset) + 12px);
  }
  body:has(.report:not([hidden])) .site-header { position: static; }
  body:has(.report:not([hidden])) .cookie-banner { bottom: calc(var(--report-nav-offset) + 12px); }
  .report { padding-bottom: calc(var(--report-nav-offset) + 16px); }
  .report-nav {
    position: fixed;
    inset: auto 0 0;
    padding: 5px max(12px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: 0 -6px 22px var(--shadow);
  }
  .report-nav-inner { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 46px auto; gap: 4px 10px; min-height: 0; }
  .report-nav-channel { margin-inline: 6px; max-width: calc(100% - 12px); }
  .report-nav-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; overflow-wrap: anywhere; line-height: 15px; }
  #another-channel { grid-column: 2; grid-row: 1; font-size: 13px; }
  .report-nav-sections { grid-column: 1 / -1; grid-row: 2; }
  .report-nav-sections a { flex: 1 1 0; padding-inline: 4px; }
  .report-nav a:focus-visible { outline-offset: -2px; }
  .report-overview, .history-charts, .insights { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: stretch; padding-inline: 0; }
  .metrics > div { display: grid; grid-template-rows: subgrid; grid-row: span 3; min-width: 0; padding: 12px; }
  .metrics > div + div { border-top: 0; border-left: 1px solid var(--line); }
  .video-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .video-table, .video-table tbody { display: block; }
  .video-table tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px 8px; padding: 13px 0; }
  .video-table tbody tr:first-child { border-top: 1px solid var(--line); }
  .video-table tbody tr > * { padding: 0; text-align: left; }
  .video-table tbody th, .video-date { grid-column: 1 / -1; }
  .video-table tbody th:first-child, .video-table td:last-child { padding: 0; }
  .video-table tbody th a { line-height: 1.4; }
  .video-date { font-size: 12px; }
  .video-metric-label { display: block; margin-bottom: 1px; color: var(--muted); font-size: 12px; }
}

@media (max-width: 500px) {
  .header-inner { min-height: 58px; gap: 6px 8px; padding-block: 7px; }
  .header-nav { gap: 4px; }
  .header-link { min-height: 44px; padding-inline: 7px; font-size: 12px; }
  .theme-toggle { min-width: 44px; padding: 0; font-size: 17px; }
  .home { gap: 12px; }
  .calculator { padding-block: clamp(16px, 3dvh, 30px); border-radius: 18px; }
  .overview { grid-template-columns: 1fr; }
  .overview > div { padding: 6px 3px; }
  .overview > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .brand { gap: 7px; font-size: 20px; }
  .brand img { width: 26px; height: 26px; }
  .channel-controls { grid-template-columns: 1fr; gap: 9px; }
  .channel-controls .button { justify-content: space-between; }
  .link-field input { min-height: 49px; }
  .profile { grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; margin-block: 19px; }
  .profile-mark { width: 46px; border-radius: 11px; font-size: 23px; }
  .source-date { margin-top: 4px; font-size: 12px; }
  .source-link { grid-column: 2; justify-self: start; min-height: 34px; padding: 0; border: 0; }
  .report-overview { gap: 10px; }
  .metrics > div { padding: 10px 8px; }
  .metrics dt, .metrics dd.metric-note { font-size: 11px; }
  .metrics dd { font-size: clamp(17px, 4.8vw, 23px); }
  .income-context { margin-top: 14px; }
}

@media (max-width: 440px) {
  .header-link-detail { display: none; }
}

@media (max-height: 820px) {
  .home .overview { display: none; }
}

@media (max-height: 540px) {
  .calculator { padding: 12px 16px; }
  .calculator h1 { font-size: clamp(26px, min(7vw, 8dvh), 38px); }
  #channel-form { margin-top: 12px; }
  .channel-controls { gap: 6px; }
  .link-field input { min-height: 42px; }
}

@media (max-height: 540px) and (min-width: 465px) {
  body:has(.home:not([hidden])) .header-inner { min-height: 50px; }
  body:has(.home:not([hidden])):has(.cookie-banner:not([hidden])) {
    display: grid;
    grid-template: auto 1fr / minmax(0, 1fr) auto;
    grid-template-areas: "header header" "main cookie";
  }
  body:has(.home:not([hidden])) .site-header { grid-area: header; }
  main:has(> .home:not([hidden])) { grid-area: main; }
  body:has(.home:not([hidden])) .cookie-banner { grid-area: cookie; }
  .channel-controls { grid-template-columns: minmax(0, 1fr) auto; }
  .channel-controls .button { padding-inline: 12px; }
}

@media (max-height: 540px) and (min-width: 465px) and (max-width: 550px) {
  .channel-controls .icon { display: none; }
  .link-field { padding-inline: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition-property: background-color; }
  .button:active:not(:disabled) { transform: none; }
  .analysis-indicator { animation: none; }
}

.history-trend { min-width: 0; border-top: 1px solid var(--line); padding-top: 13px; }
.history-grid:not(:has(> div:not([hidden]))) { display: none; }
.history-chart-header { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 9px 15px; }
.history-trend h3 { margin: 0; font-size: 16px; font-weight: 650; }
.history-period-picker { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; }
.history-period-picker button { min-height: 36px; padding: 4px 10px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 13px; }
.history-period-picker button[aria-pressed="true"] { background: var(--blue-light); color: var(--blue-dark); }
.history-chart-summary { margin-top: 7px; font-size: 13px; }
.history-plot { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 9px; margin-top: 8px; }
.history-plot svg { display: block; width: 100%; height: clamp(102px, 16vw, 170px); border-block: 1px solid var(--line); overflow: visible; }
.history-plot polyline { fill: none; stroke: var(--blue); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.history-plot ellipse { fill: var(--blue-dark); }
.history-plot rect { fill: var(--blue); }
.history-scale, .history-axis { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.history-scale { flex-direction: column; text-align: right; }
.history-axis { grid-column: 2; margin-top: 5px; }
.history-trend details { margin-top: 12px; font-size: 13px; }
.history-trend summary { color: var(--blue-dark); width: fit-content; }
.history-points { list-style: none; padding: 0; margin-block: 9px 0; max-height: 15rem; overflow-y: auto; }
.history-points li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
