:root {
  color-scheme: light;
  --blue: #1f3f91;
  --ink: #192744;
  --muted: #53617a;
  --white: #fff;
  --display: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  --body: 'DM Sans', 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .75, .26, 1);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  min-height: 100svh;
  margin: 0;
  background: var(--blue);
  color: var(--white);
  font-family: var(--body);
  text-align: center;
  -webkit-font-smoothing: antialiased;
}
h1, h2, p { margin: 0; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #c6d6ff; outline-offset: 4px; }
dialog :focus-visible { outline-color: var(--blue); }

.icon-library, .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.icon {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.shell {
  width: min(100% - 36px, 490px);
  margin-inline: auto;
  padding-block: clamp(28px, 6vh, 58px) 28px;
}
.page-header { margin-bottom: 20px; }
h1 {
  display: inline-block;
  padding: 8px 16px 10px;
  border: 1px solid #ffffff48;
  border-radius: 16px;
  background: #122a681f;
  font: 800 clamp(24px, 6.9vw, 32px)/1.2 var(--display);
  letter-spacing: -.045em;
  text-wrap: balance;
}
.byline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 9px;
  color: #e4ebff;
  font-size: 15px;
  font-weight: 700;
}
.byline-check {
  display: grid;
  place-items: center;
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #2183e5;
  color: var(--white);
}
.byline-check .icon { width: 11px; height: 11px; stroke-width: 2.8; }
.channels { margin-top: 10px; }
.channel-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 120px));
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.group-menu .card { min-height: 65px; }
.group-menu, .category-view { animation: reveal-groups 240ms var(--ease); }
.category-view h2 {
  margin: 5px auto 16px;
  font: 800 clamp(21px, 5.7vw, 25px)/1.25 var(--display);
  letter-spacing: -.025em;
  text-wrap: balance;
}
.back-link, .analysis-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding-inline: 10px;
  border-radius: 999px;
  color: #e4ebff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.back-link .icon { transform: rotate(180deg); }
.back-link .icon, .analysis-link .icon { width: 17px; height: 17px; }
.analysis-link { margin-top: 12px; }
.platform-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid #ffffff55;
  border-radius: 999px;
  background: #122a6855;
}
.platform-tab {
  min-height: 46px;
  padding: 5px 7px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--white);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
  transition: color 180ms, background 180ms;
}
.platform-tab[aria-selected='true'] { background: var(--white); color: var(--blue); }
.platform-panel { margin-top: 14px; animation: reveal-groups 200ms var(--ease) both; }
@keyframes reveal-groups { from { opacity: .55; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.availability {
  margin-bottom: 16px;
  color: #e4ebff;
  font-size: 14px;
  line-height: 1.4;
}
.group-list {
  display: grid;
  gap: 11px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.card {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 61px;
  padding: 11px 16px;
  border: 1px solid #ffffffa6;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.24;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 220ms var(--ease), background 180ms, box-shadow 220ms;
}
.card.channel-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  height: 100%;
  min-height: 36px;
  padding: 4px 3px;
  font-size: 10.5px;
}
.channel-name { text-wrap: balance; }
.channel-count { color: var(--muted); font-size: 10px; font-weight: 500; }
.card-label {
  grid-column: 2;
  text-wrap: balance;
}
.label-note {
  display: block;
  margin-top: 4px;
  font: 600 14px/1.35 var(--body);
  letter-spacing: normal;
}
.card-label .label-note { color: var(--muted); }
.category-view .label-note { color: #e4ebff; }
.card-arrow {
  color: #596c98;
  transition: transform 220ms var(--ease);
}
.card:active { transform: scale(.975); background: #dce7ff; }
.card:active .card-arrow { transform: translateX(3px); }
a.card[target='_blank']:active .card-arrow { transform: translate(2px, -2px); }

footer {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 20px;
  color: #e4ebff;
  font-size: 14px;
}
.share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid #ffffff60;
  border-radius: 999px;
  background: transparent;
  color: var(--white);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms, transform 220ms var(--ease);
}
.share:active { transform: scale(.96); }
@media (hover: hover) {
  .back-link:hover, .analysis-link:hover { background: #ffffff15; color: var(--white); }
  .platform-tab[aria-selected='false']:hover { background: #ffffff15; }
  .card:hover { transform: translateY(-2px); background: #eef3ff; box-shadow: 0 7px 16px #102a6460; }
  .card:hover .card-arrow { transform: translateX(3px); }
  a.card[target='_blank']:hover .card-arrow { transform: translate(2px, -2px); }
  .card:hover:active { transform: scale(.975); background: #dce7ff; }
  .share:hover { background: #ffffff15; }
}

dialog {
  width: min(420px, calc(100% - 32px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 24px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 24px 65px #0c1b4a59;
}
dialog[open] { animation: reveal 300ms var(--ease) both; }
dialog::backdrop { background: #0b1a4ca8; backdrop-filter: blur(4px); animation: fade 220ms ease both; }
html:has(dialog[open]) { overflow: hidden; }
.dialog-content { position: relative; padding: 62px 20px 20px; }
.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #edf2ff;
  color: var(--blue);
  cursor: pointer;
}
.dialog-content h2 { font: 800 24px/1.2 var(--display); letter-spacing: -.04em; text-wrap: balance; }
.dialog-content p { margin-top: 9px; color: var(--muted); font-size: 16px; line-height: 1.45; }
.dialog-content p:empty { margin: 0; }
.dialog-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 51px;
  margin-top: 16px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: var(--white);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms, transform 220ms var(--ease);
}
.dialog-action:hover { background: #152e71; }
.dialog-action:active { transform: scale(.975); }
.share-url {
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  padding: 0 11px;
  border: 1px solid #cbd6ef;
  border-radius: 12px;
  background: #f4f6fd;
  color: var(--ink);
  font-size: 16px;
  text-align: center;
}
@keyframes reveal { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 650px) {
  dialog { position: fixed; inset: auto 0 0; width: min(100% - 16px, 444px); margin: auto auto max(8px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover, .card:active, .card .card-arrow, .share:active, .dialog-action:active { transform: none !important; }
}
