/* YouTube → Detailed analytics (js/views/ytstats.js) + the sidebar dropdown under YouTube + the many-lines chart
   (js/charts/multiline.js), 2026-10-27. */

/* sidebar: YouTube opens into Overview / Detailed analytics */
.sb__tree .sb__link { padding-right: 4px; }
.sb__caret { margin-left: auto; display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 6px; background: none; color: var(--muted); font: 600 12px/1 var(--f-body); cursor: pointer; transition: transform 0.18s var(--ease), background 0.15s; }
.sb__caret:hover { background: var(--hover); color: var(--ink); }
.sb__tree.is-open .sb__caret { transform: rotate(180deg); }
.sb__subs { display: none; margin: 2px 0 4px 19px; padding-left: 10px; border-left: 1px solid var(--line); }
.sb__tree.is-open .sb__subs { display: grid; gap: 2px; }
.sb__sublink { display: flex; align-items: center; height: 30px; padding: 0 10px; border-radius: 7px; color: var(--muted); text-decoration: none; font: 500 13px var(--f-body); white-space: nowrap; }
.sb__sublink:hover { background: var(--hover); color: var(--ink); }
.sb__sublink.is-on { background: var(--red-soft); color: var(--red-ink); font-weight: 600; }
.sb__link.is-parent { color: var(--ink); }
.shell.is-collapsed .sb__subs, .shell.is-collapsed .sb__caret { display: none; }

/* page */
.ys-view { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
.ys-view > * { min-width: 0; }
.ys-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ys-switch { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); }
.ys-switch__btn { border: 0; padding: 7px 12px; border-radius: 9px; background: none; color: var(--ink-2); font: 600 13px var(--f-body); cursor: pointer; }
.ys-switch__btn:hover { color: var(--ink); background: var(--hover); }
.ys-switch__btn.is-on { background: var(--paper); color: var(--red-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--line); }
.ys-switch__btn.is-pending { color: var(--muted); font-weight: 500; }
.ys-td--pending { color: var(--faint); font-size: 12px; font-style: italic; }
.ys-switch__btn:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }

.ys-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ys-kpi { min-width: 0; }
.ys-kpi .kpi__sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ys-kpi.kc--t-cash .kpi__label, .ys-kpi.kc--t-cash .kpi__value, .ys-kpi.kc--t-cash .kpi__sub { color: #fff; }

.ys-card { min-width: 0; }
.ys-thumb { flex: none; width: 64px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; }

/* ranked bars */
.ys-bar-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.ys-bar { display: grid; grid-template-columns: 22px 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.ys-bar__rank { font-size: 13px; font-weight: 700; color: var(--muted); text-align: right; }
.ys-bar:first-child .ys-bar__rank { color: var(--red); }
.ys-bar__body { display: grid; gap: 6px; min-width: 0; }
.ys-bar__title { font-size: 13.5px; font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ys-bar__title:hover { color: var(--red-ink); text-decoration: underline; }
.ys-bar__track { position: relative; height: 14px; border-radius: 99px; background: var(--track); }
.ys-bar__fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: linear-gradient(90deg, var(--red), var(--coral)); transition: width 0.6s var(--ease); }
.ys-bar--down .ys-bar__fill { background: linear-gradient(90deg, color-mix(in srgb, var(--slate) 75%, transparent), var(--slate)); }
.ys-bar__avg { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--ink); opacity: 0.55; }
.ys-bar__v { min-width: 64px; text-align: right; font-size: 15px; }

.ys-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: var(--gap); }

/* many lines */
.ml { position: relative; }
.ml__svg { display: block; width: 100%; height: auto; }
.ml__stroke { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.ml__area { opacity: 0.06; }
.ml__end { stroke: var(--paper); stroke-width: 2; }
.ml__line { transition: opacity 0.15s; }
.ml.is-focus .ml__line { opacity: 0.18; }
.ml.is-focus .ml__line.is-on { opacity: 1; }
.ml.is-focus .ml__line.is-on .ml__area { opacity: 0.14; }
.ml__legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ml__chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 5px 10px; border: 0; border-radius: 999px; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); font: 500 12.5px var(--f-body); cursor: default; }
.ml__chip.is-on { color: var(--ink); box-shadow: inset 0 0 0 2px var(--line-strong, var(--line)); }
.ml__chip:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
.ml__key { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ml__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* side by side */
.ys-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ys-table th, .ys-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: middle; }
.ys-table thead th { font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.ys-table thead th:first-child, .ys-vid { text-align: left; }
.ys-th { border: 0; background: none; padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; }
.ys-th:hover { color: var(--ink); }
.ys-table th.is-sort { color: var(--red-ink); }
.ys-table td.is-sort { background: color-mix(in srgb, var(--red-soft) 45%, transparent); }
.ys-vid { display: flex; align-items: center; gap: 10px; min-width: 240px; font-weight: 600; }
.ys-vid .ys-thumb { width: 52px; }
.ys-vid a { color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.ys-vid a:hover { color: var(--red-ink); text-decoration: underline; }
.ys-td { white-space: nowrap; }
.ys-td .mono { display: block; }
.ys-mini { display: block; height: 4px; margin: 4px 0 0 auto; width: 64px; border-radius: 99px; background: var(--track); overflow: hidden; }
.ys-mini span { display: block; height: 100%; border-radius: 99px; background: var(--red); }
.ys-td:not(.is-sort) .ys-mini span { background: var(--slate); }

@media (max-width: 1100px) { .ys-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .ys-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ys-bar { grid-template-columns: 18px 48px minmax(0, 1fr) auto; gap: 8px; }
  .ys-bar .ys-thumb { width: 48px; }
  .ys-bar__v { min-width: 48px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .ys-bar__fill, .sb__caret { transition: none; } }
