/* JordinLaine Stream Search */

:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --radius: 14px;
  --radius-sm: 9px;
  --gutter: 16px;
  --topbar-h: 60px;
  --bottomnav-h: 64px;
  --maxw: 1220px;

  /* dark (default) */
  --bg: #0f0d15;
  --bg-elev: #15121d;
  --card: #1a1624;
  --card-2: #221d2f;
  --card-3: #2a2439;
  --line: #2e283c;
  --line-2: #3a3249;
  --text: #f2eff8;
  --text-2: #bbb3cb;
  --text-3: #8c839e;
  --accent: #b08cff;
  --accent-2: #8b5cf6;
  --accent-ink: #120c1f;
  --accent-soft: rgba(176, 140, 255, 0.14);
  --mark-bg: rgba(255, 207, 92, 0.24);
  --mark-text: #ffe08a;
  --twitch: #a970ff;
  --youtube: #ff5a52;
  --said: #b08cff;
  --chat: #5ccbff;
  --song: #ffb547;
  --moment: #ff7eb6;
  --event: #57d98a;
  --danger: #ff6b6b;
  --ok: #57d98a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --thumb-fade: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.75));
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f7f6fb;
  --bg-elev: #ffffff;
  --card: #ffffff;
  --card-2: #f3f1f8;
  --card-3: #ebe8f2;
  --line: #e6e2ef;
  --line-2: #d8d2e4;
  --text: #17131f;
  --text-2: #4c4560;
  --text-3: #776f8c;
  --accent: #7c3aed;
  --accent-2: #6d28d9;
  --accent-ink: #ffffff;
  --accent-soft: rgba(124, 58, 237, 0.1);
  --mark-bg: rgba(255, 196, 0, 0.32);
  --mark-text: #3b2a00;
  --twitch: #8a43f5;
  --youtube: #e1251b;
  --said: #7c3aed;
  --chat: #0377b8;
  --song: #b45309;
  --moment: #c42a72;
  --event: #138a46;
  --danger: #d92d2d;
  --ok: #138a46;
  --shadow: 0 10px 30px rgba(40, 20, 80, 0.1);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f6fb;
    --bg-elev: #ffffff;
    --card: #ffffff;
    --card-2: #f3f1f8;
    --card-3: #ebe8f2;
    --line: #e6e2ef;
    --line-2: #d8d2e4;
    --text: #17131f;
    --text-2: #4c4560;
    --text-3: #776f8c;
    --accent: #7c3aed;
    --accent-2: #6d28d9;
    --accent-ink: #ffffff;
    --accent-soft: rgba(124, 58, 237, 0.1);
    --mark-bg: rgba(255, 196, 0, 0.32);
    --mark-text: #3b2a00;
    --twitch: #8a43f5;
    --youtube: #e1251b;
    --said: #7c3aed;
    --chat: #0377b8;
    --song: #b45309;
    --moment: #c42a72;
    --event: #138a46;
    --danger: #d92d2d;
    --ok: #138a46;
    --shadow: 0 10px 30px rgba(40, 20, 80, 0.1);
    color-scheme: light;
  }
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: clamp(22px, 4vw, 30px); font-weight: 700; }
h2 { font-size: 19px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
mark, .hl { background: var(--mark-bg); color: var(--mark-text); border-radius: 4px; padding: 0 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .hide-sm { display: none; } }
.hide-desktop { display: none; }
@media (max-width: 760px) { .hide-desktop { display: inline; } }
.chatres .msg { padding: 0; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
svg.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
svg.icon.fill { fill: currentColor; stroke: none; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 48px 0; display: grid; place-items: center; }

/* ------------------------------------------------------------------ shell */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: var(--maxw); margin: 0 auto; height: 100%; padding: 0 var(--gutter); display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; letter-spacing: -0.02em; }
.brand-text small { display: block; font-weight: 500; font-size: 11px; color: var(--text-3); margin-top: -2px; }
.topsearch { flex: 1; max-width: 480px; position: relative; }
.topsearch input { width: 100%; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); padding: 0 14px 0 38px; outline: none; transition: border-color .15s, background .15s; }
.topsearch input:focus { border-color: var(--accent); background: var(--bg-elev); }
.topsearch .icon { position: absolute; left: 13px; top: 10px; color: var(--text-3); }
.topsearch kbd { position: absolute; right: 12px; top: 9px; font: 11px var(--mono); color: var(--text-3); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; }
.topnav { display: flex; gap: 2px; margin-left: auto; }
.topnav a { padding: 7px 11px; border-radius: 9px; color: var(--text-2); font-weight: 500; font-size: 14px; display: flex; gap: 7px; align-items: center; }
.topnav a:hover { background: var(--card); color: var(--text); }
.topnav a.active { background: var(--accent-soft); color: var(--accent); }
.iconbtn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text-2); display: grid; place-items: center; flex: none; }
.iconbtn:hover { background: var(--card); color: var(--text); }

.bottomnav { display: none; }
main.page { max-width: var(--maxw); margin: 0 auto; padding: 22px var(--gutter) 64px; min-height: calc(100vh - var(--topbar-h)); }
main.page.wide { max-width: 1480px; }

@media (max-width: 860px) {
  .topnav, .topsearch { display: none; }
  .topbar-inner { gap: 8px; }
  .topbar .actions { margin-left: auto; }
  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; z-index: 45; left: 0; right: 0; bottom: 0;
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--text-3); }
  .bottomnav a .icon { width: 21px; height: 21px; }
  .bottomnav a.active { color: var(--accent); }
  main.page { padding-bottom: calc(var(--bottomnav-h) + 40px + env(safe-area-inset-bottom)); padding-top: 16px; }
}

/* ------------------------------------------------------------------ primitives */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card.pad { padding: 16px; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.section-head a.more { margin-left: auto; font-size: 13px; color: var(--accent); font-weight: 600; }

.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); font-weight: 600; font-size: 14px; color: var(--text); white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--card-2); color: var(--text); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn[disabled] { opacity: .5; cursor: default; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--text-2); font-size: 13px; font-weight: 550; white-space: nowrap; }
button.chip:hover, a.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent); }
.chip .count { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.chip.on .count { color: inherit; opacity: .8; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650; background: var(--card-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.said { color: var(--said); }
.badge.chat { color: var(--chat); }
.badge.song { color: var(--song); }
.badge.moment { color: var(--moment); }
.badge.event { color: var(--event); }
.badge.tw { color: var(--twitch); }
.badge.yt { color: var(--youtube); }
.badge.warn { color: var(--danger); }

.timepill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: 600 12.5px var(--mono); border: 0; white-space: nowrap; }
.timepill:hover { background: var(--accent); color: var(--accent-ink); }
.timepill .icon { width: 13px; height: 13px; }

.input, .select { height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); padding: 0 12px; outline: none; min-width: 0; }
.input:focus, .select:focus { border-color: var(--accent); }
.select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c839e' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 16px; }
label.field { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-3); }
label.check { display: inline-flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
label.check input { accent-color: var(--accent); width: 16px; height: 16px; }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: none; border: 0; padding: 10px 12px; font-weight: 600; font-size: 14px; color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs .count { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--card-2); color: var(--text-3); }
.tabs button.on .count { background: var(--accent-soft); color: var(--accent); }

.empty { text-align: center; padding: 44px 16px; color: var(--text-2); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.error-box { padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--text); }

/* ------------------------------------------------------------------ stats tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { padding: 14px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.tile .v { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.tile .l { font-size: 12.5px; color: var(--text-3); font-weight: 550; margin-top: 2px; }
.tile .icon { color: var(--accent); width: 18px; height: 18px; margin-bottom: 6px; }
.tiles.six { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1000px) { .tiles.six { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .tiles, .tiles.six { grid-template-columns: repeat(2, 1fr); } .tile .v { font-size: 21px; } }

/* ------------------------------------------------------------------ home */
.hero { padding: 30px 0 8px; }
.hero h1 { font-size: clamp(26px, 5vw, 40px); letter-spacing: -0.025em; }
.hero h1 em { font-style: normal; background: linear-gradient(120deg, var(--accent), var(--moment)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--text-2); margin-top: 8px; font-size: 15.5px; }
.bigsearch { position: relative; margin-top: 20px; }
.bigsearch input { width: 100%; height: 56px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--card); padding: 0 120px 0 50px; font-size: 16.5px; outline: none; box-shadow: var(--shadow); }
.bigsearch input:focus { border-color: var(--accent); }
.bigsearch > .icon { position: absolute; left: 18px; top: 19px; color: var(--text-3); width: 19px; height: 19px; }
.bigsearch button { position: absolute; right: 7px; top: 7px; height: 42px; border-radius: 11px; }
.quick { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) {
  .bigsearch input { height: 52px; padding-right: 16px; font-size: 16px; }
  .bigsearch button { display: none; }
  .bigsearch > .icon { top: 17px; }
}

.feature { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0; overflow: hidden; }
.feature .thumb { aspect-ratio: 16 / 9; border-radius: 0; }
.feature .body { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 760px) { .feature { grid-template-columns: 1fr; } }

.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 960px) { .cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }

.ranklist { list-style: none; margin: 0; padding: 4px 0; }
.ranklist li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 14px; position: relative; }
.ranklist li + li { border-top: 1px solid var(--line); }
.ranklist .n { color: var(--text-3); font: 600 12px var(--mono); }
.ranklist .bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-soft); opacity: .55; pointer-events: none; }
.ranklist .main, .ranklist .val { position: relative; }
.ranklist .val { font: 600 13px var(--mono); color: var(--text-2); }

/* ------------------------------------------------------------------ stream cards */
.grid-streams { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.scard { display: flex; flex-direction: column; overflow: hidden; transition: transform .15s, border-color .15s; }
.scard:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); color: inherit; }
.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--card-2) center / cover no-repeat; border-radius: var(--radius-sm); overflow: hidden; }
.scard .thumb { border-radius: 0; }
.thumb::after { content: ""; position: absolute; inset: 0; background: var(--thumb-fade); }
.thumb .num { position: absolute; z-index: 1; left: 10px; top: 10px; background: rgba(0, 0, 0, .62); color: #fff; font: 700 12px var(--mono); padding: 3px 8px; border-radius: 7px; backdrop-filter: blur(6px); }
.thumb .dur { position: absolute; z-index: 1; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .7); color: #fff; font: 600 12px var(--mono); padding: 2px 7px; border-radius: 6px; }
.thumb .date { position: absolute; z-index: 1; left: 10px; bottom: 10px; color: #fff; font-weight: 600; font-size: 12.5px; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.scard .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.scard .title { font-weight: 650; font-size: 14.5px; }
.scard .headline { color: var(--text-2); font-size: 13.5px; }
.scard .meta { margin-top: auto; padding-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; color: var(--text-3); font-size: 12.5px; font-weight: 550; }
.scard .meta span { display: inline-flex; gap: 5px; align-items: center; }
.scard .meta .icon { width: 14px; height: 14px; }

/* ------------------------------------------------------------------ calendar */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cal-head h2 { min-width: 170px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding-bottom: 2px; }
.cal .day { min-height: 92px; border-radius: 11px; border: 1px solid var(--line); background: var(--card); padding: 6px; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.cal .day.out { background: transparent; border-color: transparent; }
.cal .day .d { font-size: 12px; font-weight: 650; color: var(--text-3); }
.cal .day.today .d { color: var(--accent); }
.cal .day.has { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.cal .ev { display: block; border-radius: 8px; overflow: hidden; background: var(--card-2); }
.cal .ev .thumb { border-radius: 0; aspect-ratio: 16/9; }
.cal .ev .t { font-size: 11.5px; font-weight: 600; padding: 3px 6px; }
.cal .ev:hover { outline: 2px solid var(--accent); color: inherit; }
@media (max-width: 700px) {
  .cal { gap: 3px; }
  .cal .day { min-height: 54px; padding: 3px; border-radius: 8px; }
  .cal .ev .thumb { display: none; }
  .cal .ev { background: var(--accent); color: var(--accent-ink); text-align: center; }
  .cal .ev .t { padding: 2px; font-size: 11px; }
  .cal .ev .t .long { display: none; }
}
.heat { display: flex; gap: 18px; flex-wrap: wrap; }
.heat-month h4 { font-size: 12px; color: var(--text-3); font-weight: 650; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.heat-grid { display: grid; grid-template-columns: repeat(7, 15px); gap: 3px; }
.heat-grid span, .heat-grid a { width: 15px; height: 15px; border-radius: 4px; background: var(--card-2); display: block; }
.heat-grid .blank { background: transparent; }
.heat-grid a.l1 { background: color-mix(in srgb, var(--accent) 35%, var(--card-2)); }
.heat-grid a.l2 { background: color-mix(in srgb, var(--accent) 60%, var(--card-2)); }
.heat-grid a.l3 { background: color-mix(in srgb, var(--accent) 85%, var(--card-2)); }
.heat-grid a.l4 { background: var(--accent); }
.heat-grid a:hover { outline: 2px solid var(--text); }

/* ------------------------------------------------------------------ search */
.searchbar { display: flex; gap: 8px; }
.searchbar .bigsearch { flex: 1; margin-top: 0; }
.searchbar .bigsearch input { height: 50px; box-shadow: none; padding-right: 16px; }
.searchbar .bigsearch > .icon { top: 16px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 14px; margin: 12px 0 4px; }
.filters .actions { display: flex; align-items: end; gap: 8px; }
.result-group + .result-group { margin-top: 26px; }
.result-group h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.results { display: flex; flex-direction: column; gap: 8px; }
.result { display: block; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line); cursor: pointer; transition: border-color .12s, background .12s; }
.result:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--bg-elev); color: inherit; }
.result .rhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; }
.result .rhead .stream { font-weight: 600; color: var(--text-2); }
.result .ctx { color: var(--text-3); }
.result .rbody { font-size: 14.5px; }
.result .yt { margin-left: auto; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.result .yt:hover { color: var(--youtube); }
.loadmore { display: flex; justify-content: center; margin-top: 16px; }
.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; text-align: left; margin-top: 18px; }
.tips div { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); }
.tips code { font-family: var(--mono); color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 5px; }

/* ------------------------------------------------------------------ chat lines */
.msg { position: relative; padding: 5px 10px 5px 8px; font-size: 14px; line-height: 1.55; word-wrap: break-word; overflow-wrap: anywhere; border-radius: 8px; }
.msg .ts { font: 500 11.5px var(--mono); color: var(--text-3); background: none; border: 0; padding: 0 4px 0 0; margin-right: 2px; white-space: nowrap; flex: none; }
.msg .ts:hover { color: var(--accent); }
.msg .plat { display: inline-flex; vertical-align: -3px; margin-right: 3px; }
.msg .plat .icon { width: 15px; height: 15px; }
.msg .plat.yt { color: var(--youtube); }
.msg .badges { display: inline-flex; gap: 3px; vertical-align: -3px; margin-right: 3px; }
.msg .badges img { width: 18px; height: 18px; border-radius: 3px; }
.msg .badges .ybadge { width: 16px; height: 16px; display: inline-grid; place-items: center; border-radius: 4px; color: #fff; }
.msg .badges .ybadge .icon { width: 12px; height: 12px; }
.msg .nm { font-weight: 700; }
.msg .nm:hover { text-decoration: underline; }
.msg .emote { height: 28px; width: auto; vertical-align: middle; margin: -4px 1px; }
.msg .estack { display: inline-grid; vertical-align: middle; margin: -4px 1px; }
.msg .estack > .emote { grid-area: 1 / 1; margin: 0; justify-self: center; align-self: center; }
.msg .mention { font-weight: 650; color: var(--text); background: var(--card-2); border-radius: 4px; padding: 0 3px; }
.msg a.link { color: var(--chat); text-decoration: underline; text-underline-offset: 2px; }
.msg .reply { display: block; font-size: 12px; color: var(--text-3); margin: 0 0 1px 0; padding-left: 2px; }
.msg .reply .icon { width: 12px; height: 12px; }
.msg.notice { background: color-mix(in srgb, var(--accent) 9%, transparent); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding-left: 10px; margin: 3px 0; }
.msg.notice.k-raid { border-left-color: var(--event); background: color-mix(in srgb, var(--event) 10%, transparent); }
.msg.notice.k-sub, .msg.notice.k-resub { border-left-color: var(--accent); }
.msg.notice.k-subgift, .msg.notice.k-submysterygift, .msg.notice.k-gift { border-left-color: var(--moment); background: color-mix(in srgb, var(--moment) 9%, transparent); }
.msg.notice.k-superchat, .msg.notice.k-sticker, .msg.notice.k-member { border-left-color: var(--youtube); background: color-mix(in srgb, var(--youtube) 9%, transparent); }
.msg.notice .sys { font-weight: 600; font-size: 13.5px; display: flex; gap: 6px; align-items: baseline; }
.msg.notice .sys .icon { width: 14px; height: 14px; vertical-align: -2px; }
.msg.bits .tx::before { content: attr(data-bits); font: 700 11.5px var(--mono); color: #fff; background: #9b44ff; border-radius: 5px; padding: 1px 5px; margin-right: 5px; }
.msg.highlight { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.msg.first::after { content: "first message"; font-size: 10.5px; font-weight: 700; color: var(--event); border: 1px solid color-mix(in srgb, var(--event) 50%, transparent); border-radius: 999px; padding: 0 6px; margin-left: 6px; vertical-align: 1px; }
.msg.modded .tx { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 70%, transparent); color: var(--text-3); }
.msg .flag { display: inline-flex; gap: 4px; align-items: center; font-size: 11px; font-weight: 700; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); border-radius: 999px; padding: 0 7px; margin-left: 6px; vertical-align: 1px; }
.msg .flag.soft { color: var(--text-3); border-color: var(--line-2); }
.msg.current { background: var(--accent-soft); }
.msg .amount { font-weight: 700; color: var(--youtube); margin-left: 4px; }

/* ------------------------------------------------------------------ stream page */
.stream-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
.player-wrap { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player-wrap iframe, .player-wrap > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stream-head { margin: 16px 0 6px; }
.stream-head .eyebrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--text-3); font-size: 13px; font-weight: 550; margin-bottom: 6px; }
.stream-head h1 { font-size: clamp(20px, 3vw, 26px); }
.stream-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.side { position: sticky; top: calc(var(--topbar-h) + 14px); height: calc(100vh - var(--topbar-h) - 28px); display: flex; flex-direction: column; overflow: hidden; }
.side .tabs { margin: 0; padding: 0 8px; }
.side-tools { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.side-tools .input { height: 32px; flex: 1; font-size: 13px; }
.side-body { flex: 1; overflow-y: auto; padding: 6px 4px 10px; overscroll-behavior: contain; scroll-behavior: auto; }
.side-foot { padding: 8px 10px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.jump { position: absolute; left: 50%; transform: translateX(-50%); bottom: 58px; z-index: 2; box-shadow: var(--shadow); }
.side-wrap { position: relative; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.tline { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; padding: 5px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.tline:hover { background: var(--card-2); }
.tline .ts { font: 500 11.5px var(--mono); color: var(--text-3); padding-top: 3px; }
.tline.current { background: var(--accent-soft); }
.tline.current .ts { color: var(--accent); }
.tline.song-start { border-top: 1px dashed var(--line-2); margin-top: 6px; padding-top: 9px; }
.tline .songtag { display: block; font-size: 11.5px; font-weight: 700; color: var(--song); margin-bottom: 2px; }

.summary-text p + p { margin-top: 10px; }
.summary-text { color: var(--text); font-size: 15px; line-height: 1.65; }
.headline-big { font-size: 17px; font-weight: 650; line-height: 1.45; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline .ttl { font-weight: 650; }
.timeline .desc { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.setlist { list-style: none; margin: 0; padding: 0; counter-reset: song; }
.setlist li { display: grid; grid-template-columns: 26px auto minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); counter-increment: song; }
.setlist li:first-child { border-top: 0; }
.setlist li::before { content: counter(song); font: 700 12px var(--mono); color: var(--text-3); padding-top: 5px; text-align: right; }
.setlist .st { font-weight: 650; }
.setlist .sa { color: var(--text-2); }
.setlist .sm { font-size: 12.5px; color: var(--text-3); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kw { display: flex; flex-wrap: wrap; gap: 6px; }
.emote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.emote-grid div { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 10px; background: var(--card-2); font-size: 12px; }
.emote-grid img { height: 32px; }
.emote-grid b { font: 700 12px var(--mono); color: var(--text-2); }

.chart { width: 100%; height: auto; display: block; }
.chart .bar-tw { fill: var(--twitch); }
.chart .bar-yt { fill: var(--youtube); }
.chart .song-band { fill: var(--song); opacity: .12; }
.chart .marker { stroke: var(--moment); stroke-width: 1.5; }
.chart .axis { fill: var(--text-3); font: 10.5px var(--mono); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .cursor { stroke: var(--text); stroke-width: 1; opacity: .5; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

@media (max-width: 1100px) {
  .stream-layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: 70vh; min-height: 420px; }
}
@media (max-width: 860px) {
  main.page.stream-page { padding-top: 0; }
  .player-sticky { position: sticky; top: var(--topbar-h); z-index: 30; margin: 0 calc(-1 * var(--gutter)); background: #000; }
  .player-sticky .player-wrap { border-radius: 0; }
  .side { height: calc(100vh - var(--topbar-h) - 56.25vw - var(--bottomnav-h) - 60px); min-height: 320px; }
}

/* ------------------------------------------------------------------ tables / lists */
.list { display: flex; flex-direction: column; }
.list-row { display: grid; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
a.list-row:hover { background: var(--card-2); color: inherit; }
.songs-row { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) 70px 110px; }
.users-row { grid-template-columns: minmax(0, 2fr) 90px 80px 110px 80px; }
.list-head { font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; padding-top: 10px; padding-bottom: 10px; }
.num-col { text-align: right; font: 600 13px var(--mono); color: var(--text-2); }
@media (max-width: 760px) {
  .songs-row { grid-template-columns: minmax(0, 1fr) 54px; }
  .songs-row .c-artist, .songs-row .c-last { display: none; }
  .users-row { grid-template-columns: minmax(0, 1fr) 70px 60px; }
  .users-row .c-last, .users-row .c-req { display: none; }
}
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 14px 0; }
.toolbar .input { flex: 1; min-width: 180px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-2); }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--card); border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { background: var(--accent-soft); color: var(--accent); }

.user-hero { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.avatar { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; font-weight: 800; font-size: 24px; color: #fff; flex: none; }
.user-hero h1 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------------------------ login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
  radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--moment) 16%, transparent), transparent 60%), var(--bg); }
.login .card { width: min(400px, 100%); padding: 28px; box-shadow: var(--shadow); }
.login .brand-mark { width: 48px; height: 48px; border-radius: 14px; font-size: 19px; margin-bottom: 16px; }
.login h1 { font-size: 22px; }
.login p { color: var(--text-2); margin: 6px 0 20px; font-size: 14px; }
.login .input { width: 100%; height: 46px; font-size: 16px; }
.login .btn { width: 100%; height: 46px; justify-content: center; margin-top: 14px; font-size: 15px; }
.login .err { color: var(--danger); font-size: 13.5px; margin-top: 10px; min-height: 20px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 80; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; transition: all .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 860px) { .toast { bottom: calc(var(--bottomnav-h) + 20px); } }
