/* The dark palette is painted below. Matching the embedded chat’s light canvas keeps its empty pixels transparent in Chromium. */
:root {
  color-scheme: only light;
  --text: #f5f3fa;
  --muted: #a6a5b2;
  --separator: #302f3c;
  --violet: #c0a2ff;
  --aqua: #65e4d8;
  font-family: Inter, Geist, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body {
  margin: 0;
  min-width: 280px;
  color: var(--text);
  background: radial-gradient(ellipse at 18% -12%, #33234590 0, transparent 45rem), #0c0c11;
}
button, a { -webkit-tap-highlight-color: transparent }
button { color: inherit; font: inherit; cursor: pointer }
a { color: inherit }
:focus-visible { outline: 2px solid var(--aqua); outline-offset: 4px }
.definitions { position: absolute; width: 0; height: 0; overflow: hidden }
.workspace {
  width: min(100%, 86rem);
  margin: auto;
  padding: clamp(1.5rem, 4.3vw, 4.1rem) clamp(1.15rem, 5vw, 4.5rem) 2.2rem;
}
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin-bottom: 2.35rem }
.identity { display: flex; gap: 1.1rem; align-items: center }
.brand-mark { width: clamp(3.65rem, 6vw, 4.65rem); height: auto; border-radius: 22%; flex: none }
.brand-caption { margin: 0 0 .13rem .12rem; font-weight: 750; font-size: .69rem; line-height: 1.3; letter-spacing: .19em; text-transform: uppercase; color: var(--violet) }
h1, h2, h3, p { margin: 0 }
h1 { font-size: clamp(2.55rem, 4.7vw, 4.4rem); line-height: .99; font-weight: 780; letter-spacing: -.07em }
.channels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem }
.channel {
  --accent: var(--violet);
  --icon-bg: #31243f;
  padding: .8rem 1rem .73rem;
  display: grid;
  grid-template-columns: 2.18rem minmax(0,auto);
  column-gap: .65rem; row-gap: .42rem;
  align-items: center;
  border: 1px solid #302d39;
  border-radius: .85rem;
  background-color: #17161c;
  min-width: 10.4rem;
}
.channel-tiktok { --accent: var(--aqua); --icon-bg: #193431 }
.channel-emblem { width: 2.18rem; height: 2.18rem; border-radius: .62rem; background: var(--icon-bg); color: var(--accent); display: grid; place-items: center }
.channel-emblem svg { width: 1.25rem; height: 1.25rem }
.channel-info { display: grid; align-content: center; gap: .08rem }
.channel-info a { text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; justify-self: start; border-radius: .16rem; position: relative }
.channel-info a::after { content: ""; position: absolute; inset: -.4rem -.25rem }
.channel-info a:hover { color: var(--accent) }
.channel-name { font-size: .88rem; font-weight: 700; line-height: 1.25 }
.external-icon, .chat-title-icon { fill: none; stroke: currentColor; stroke-linejoin: round; stroke-linecap: round; stroke-width: 1.65 }
.external-icon { width: .74rem; height: .74rem; color: #a29aa9 }
.channel-handle { color: var(--muted); font-size: .72rem; line-height: 1.3 }
.status { grid-column: 1 / -1; display: flex; align-items: baseline; gap: .4rem; font-size: .68rem; line-height: 1.35; color: #b6b4c0; max-width: 16rem; overflow-wrap: anywhere }
.status i { height: .41rem; width: .41rem; border-radius: 100%; flex: none; background-color: #8b8795; align-self: baseline }
.status[data-state="connecting"] i { background: #c5b486 }
.status[data-state="connected"] i { background: #6fdfb5; box-shadow: 0 0 8px #75dfb328 }
.status[data-state="error"] i { background: #f09c91 }
.chat-panel { display: flex; flex-direction: column; height: clamp(30rem, calc(100svh - 13.8rem), 66rem); border: 1px solid #35323f; border-radius: 1.35rem; overflow: hidden; background: #15141a; box-shadow: 0 1rem 4rem #0004 }
.panel-head, .panel-footer { display: flex; align-items: center; justify-content: space-between; flex: none; gap: .85rem }
.panel-head { padding: 1.04rem 1.55rem; border-bottom: 1px solid var(--separator); background: linear-gradient(105deg, #211d29, #1a1921 46%, #1a191f) }
h2 { display: flex; gap: .7rem; align-items: center; font-weight: 720; font-size: 1.22rem; letter-spacing: -.035em; line-height: 1.15 }
.chat-title-icon { height: 1.3rem; width: 1.3rem; color: var(--violet) }
.filters { display: flex; padding: .22rem; gap: .12rem; border: 1px solid #35333e; border-radius: .72rem; background: #111116 }
.filters button { display: flex; align-items: center; justify-content: center; gap: .38rem; padding: .45rem .76rem; font-size: .79rem; font-weight: 650; line-height: 1.2; border: 1px solid transparent; background: transparent; color: #b5b2be; border-radius: .5rem }
.filters button:hover { background: #25232c; color: #fff }
.filters button[aria-pressed="true"] { background: #393044; border-color: #584567; color: #f2e8ff }
.filters button:focus-visible { outline-offset: 0 }
.filters svg { height: .86rem; width: .86rem }
#chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #514959 #17151d; position: relative; background: radial-gradient(ellipse at 50% 47%, #1b172230, transparent 52%), #15141a }
#chat-scroll:focus-visible { outline-offset: -3px }
#message-list { list-style: none; padding: 0 1.6rem; margin: 0; }
.message-row { padding: .95rem 0; display: grid; grid-template-columns: 3.2rem minmax(0,1fr); gap: .75rem; align-items: baseline; border-bottom: 1px solid #292630 }
.message-row:last-child { border: 0 }
.message-time { font-size: .76rem; color: #aaa5b3; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.6 }
.message-content { min-width: 0; overflow-wrap: anywhere; line-height: 1.55 }
.message-platform { display: inline-flex; align-items: center; vertical-align: .06em; gap: .22rem; margin-right: .48rem; border-radius: .26rem; padding: .1rem .34rem; background: #32283f; color: #d0b1ff; font-size: .66rem; font-weight: 700; line-height: 1.4 }
.message-platform svg { width: .75rem; height: .75rem }
.message-row[data-platform="tiktok"] .message-platform { color: #88e7df; background: #203834 }
.message-user { font-size: .93rem; color: #edeaf0; font-weight: 700 }
.message-text { margin: .13rem 0 0; font-size: .97rem; line-height: 1.52; color: #d9d6df; white-space: pre-wrap }
#empty-state { min-height: 100%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2.2rem 1.2rem 3rem }
.empty-mark { width: 13rem; height: 7rem; display: grid; place-items: center; position: relative; margin-bottom: .85rem }
.empty-mark::before { content: ""; position: absolute; inset: -1.1rem -.75rem; background: radial-gradient(#88829460 .75px, transparent 1px) 50% / 12px 12px; mask-image: radial-gradient(ellipse, black 11%, transparent 72%); -webkit-mask-image: radial-gradient(ellipse, black 11%, transparent 72%) }
.empty-mark svg { position: relative; width: 5.8rem; height: 4.8rem; filter: drop-shadow(0 4px 14px #08070b88) }
.rear-bubble { fill: #1b3233; stroke: #65b3ae; stroke-width: 1.9; stroke-linejoin: round }
.front-bubble { fill: #30243f; stroke: #bd9bec; stroke-width: 2; stroke-linejoin: round }
.chat-dots { fill: #c9a4f5 }
#empty-title { font-size: clamp(1.2rem, 1.8vw, 1.48rem); font-weight: 680; letter-spacing: -.035em; line-height: 1.35 }
#empty-detail, .no-script { color: var(--muted); font-size: .87rem; line-height: 1.65; margin-top: .4rem; max-width: 35em }
.no-script { text-align: center; position: absolute; bottom: 1rem; width: 100%; max-width: none }
.panel-footer { min-height: 3.3rem; padding: .6rem 1.55rem; border-top: 1px solid var(--separator); background: #19181f; color: var(--muted); font-size: .76rem }
.counter strong { font-weight: 700; font-variant-numeric: tabular-nums; color: #e6e2eb }
#follow-latest { display: flex; align-items: center; gap: .53rem; border: 0; padding: .42rem 0; background: transparent; font-size: .76rem; border-radius: .18rem; color: #c9c5d0 }
#follow-latest:hover { color: #fff }
.switch { width: 1.72rem; height: .96rem; border-radius: 1rem; background: #43414c; border: 1px solid #615e6c; display: flex; align-items: center; padding: .12rem }
.switch::before { content: ""; width: .58rem; height: .58rem; border-radius: 100%; background: #d5d0dd }
#follow-latest[aria-pressed="true"] .switch { background: #8869b4; border-color: #b38bdc }
#follow-latest[aria-pressed="true"] .switch::before { transform: translateX(.68rem); background: #fff }
@media (max-width: 850px) {
  .workspace { padding-inline: 1.5rem }
  .masthead { gap: 1rem; margin-bottom: 1.75rem }
  .channel { min-width: 9rem; padding-inline: .75rem }
}
@media (max-width: 650px) {
  .workspace { padding: 1.55rem 1rem max(1rem, env(safe-area-inset-bottom)) }
  .masthead { flex-direction: column; align-items: stretch; margin-bottom: 1rem; gap: 1.25rem }
  .identity { gap: .8rem }
  .brand-mark { width: 3.35rem }
  .brand-caption { font-size: .59rem; margin-bottom: .12rem }
  h1 { font-size: 2.65rem }
  .channel { min-width: 0; padding: .65rem .8rem; row-gap: .35rem }
  .channels { gap: .55rem }
  .chat-panel { height: max(26rem, calc(100svh - 14rem)); border-radius: 1rem }
  .panel-head { padding: .8rem .95rem }
  h2 { font-size: 1.08rem; gap: .45rem }
  .chat-title-icon { width: 1.05rem; height: 1.05rem }
  .filters button { padding: .4rem .47rem; font-size: .72rem; min-height: 1.85rem }
  .filters svg { width: .75rem; height: .75rem }
  #message-list { padding: 0 1rem }
  .message-row { grid-template-columns: 2.65rem minmax(0, 1fr); gap: .45rem }
  .panel-footer { padding-inline: 1rem }
}
@media (max-width: 385px) {
  .panel-head { flex-wrap: wrap; gap: .55rem }
  .panel-head h2 { flex: 1 1 auto }
  .filters button { padding: .38rem .34rem }
  .filters button svg { display: none }
  .panel-footer { flex-wrap: wrap; gap: .15rem .6rem; padding-inline: .75rem }
  .channel { padding-inline: .58rem; column-gap: .4rem; grid-template-columns: 1.8rem minmax(0,auto) }
  .channel-emblem { width: 1.8rem; height: 1.8rem }
}
@media (prefers-reduced-motion: no-preference) {
  .filters button, .switch, .switch::before, .channel-info a { transition: color 120ms ease, background-color 120ms ease, transform 140ms ease }
}
#embedded-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #15141a }
.feed-instruction { padding: .9rem 1.55rem .28rem; color: var(--muted); font-size: .8rem; line-height: 1.55 }
#embedded-chat iframe { width: 100%; flex: 1; min-height: 0; border: 0; background: transparent; color-scheme: only light; padding: .3rem .65rem .65rem }
.detail-link, .expand-btn { color: #d3cbdc; font-size: .79rem; text-underline-offset: .2em }
.detail-link { text-decoration: none }
.detail-link:hover { text-decoration: underline; color: white }
.expand-btn { border: 1px solid #57505f; border-radius: .45rem; padding: .35rem .65rem; background: #231f29 }
.expand-btn:hover { background: #312a3b; color: white }
.chat-panel:fullscreen, .chat-panel.is-expanded { width: 100%; height: 100dvh; background: #15141a; border: 0; border-radius: 0; max-height: none }
.chat-panel.is-expanded { position: fixed; inset: 0; z-index: 5 }
body:has(.chat-panel.is-expanded) { overflow: hidden }
@media (max-width: 650px) { .feed-instruction { padding-inline: 1rem } #embedded-chat iframe { padding-inline: .25rem } }
.status-link { text-decoration: none }
.status-link:hover { color: #91f4ec; text-decoration: underline; text-underline-offset: .2em }

html { background-color: #0c0c11 }
.panel-actions, .overlay-heading, .overlay-choice, .overlay-actions { display: flex; align-items: center; gap: .65rem }
.panel-actions { flex-wrap: wrap; margin-left: auto }
#open-overlay-setup, #copy-overlay-url { border: 1px solid #69567d; border-radius: .48rem; padding: .38rem .7rem; background-color: #30263b; color: #eddcff; font-size: .8rem; font-weight: 650 }
#open-overlay-setup:hover, #copy-overlay-url:hover { background: #483454; border-color: #a387b8 }
#overlay-dialog { color-scheme: only light; width: min(32rem, calc(100% - 1.5rem)); max-height: calc(100dvh - 1.5rem); padding: 0; color: var(--text); background: #16151c; border: 1px solid #46404f; border-radius: 1rem; box-shadow: 0 1.2rem 4rem #0009 }
#overlay-dialog::backdrop { background-color: rgb(7 6 12 / 78%) }
.overlay-settings { padding: clamp(1.1rem, 4vw, 1.6rem) }
.overlay-heading { justify-content: space-between; margin-bottom: .6rem }
.overlay-heading h2 { font-size: 1.4rem }
.overlay-close { display: grid; place-items: center; height: 2rem; width: 2rem; border: 1px solid #403c48; background: #232129; border-radius: .45rem; font-size: 1.3rem; line-height: 1 }
#overlay-help, .overlay-note, .overlay-preview figcaption, #overlay-copy-status { line-height: 1.5; color: #bfb8ca; font-size: .86rem }
.overlay-choice { justify-content: space-between; flex-wrap: wrap; margin: 1.1rem 0 .45rem }
.overlay-choice label, .overlay-field-label { font-size: .88rem; font-weight: 650 }
#overlay-platform, #overlay-url { color: #f4effa; background-color: #24212b; border: 1px solid #514b5c; border-radius: .45rem; padding: .52rem .7rem; font: inherit; font-size: .87rem }
.overlay-note, .overlay-preview figcaption { color: #a9a4b4; font-size: .77rem }
.overlay-preview { margin: 1rem 0 1.1rem }
#overlay-preview-stage { height: clamp(6.5rem, 23vh, 11.5rem); overflow: hidden; border: 1px solid #47434f; border-radius: .55rem; background: repeating-conic-gradient(#25222d 0 25%, #3a3443 0 50%) 0 0 / 1.4rem 1.4rem }
#overlay-preview-stage iframe { display: block; border: 0; background: transparent; color-scheme: only light; width: 100%; height: 100% }
.overlay-preview figcaption { margin-top: .35rem }
.overlay-field-label { display: block; margin-bottom: .35rem }
#overlay-url { width: 100%; font-family: ui-monospace, monospace; background: #100f14 }
.overlay-actions { flex-wrap: wrap; margin-top: .75rem }
#copy-overlay-url { padding: .55rem .85rem; font-size: .86rem }
#open-overlay-url { padding: .5rem .25rem; color: #dec9fa; text-underline-offset: .2em; font-size: .84rem }
#overlay-copy-status:not(:empty) { margin-top: .6rem; color: #9de1d9 }
@media (max-width: 650px) { .panel-footer { flex-wrap: wrap; gap: .45rem .7rem } }

#overlay-platform, #overlay-url { color-scheme: dark }
