:root {
  color-scheme: dark;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 80%;
  --twitch-purple: #9146ff;
  --twitch-shadow: rgba(145, 70, 255, 0.35);
  --kick-green: #53fc18;
  --kick-shadow: rgba(83, 252, 24, 0.35);
  --kick-text: #041400;
  --youtube-red: #ff2d1d;
  --youtube-shadow: rgba(255, 45, 29, 0.35);
  --danger-red: #ef4444;
  --danger-shadow: rgba(239, 68, 68, 0.35);
  --connect-blue: #2563eb;
  --connect-shadow: rgba(37, 99, 235, 0.35);
  --neutral-gray: #475569;
  --neutral-shadow: rgba(71, 85, 105, 0.35);
  --success-green: #22c55e;
  --status-muted: rgba(148, 163, 184, 0.55);
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  padding: 16px 16px 1px;
  background: #0e0e10;
  color: #efeff1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  overflow-x: hidden;
}

body.chat-only-mode {
  padding: 16px 0 5px;
}

body.chat-only-mode .container {
  gap: 0;
  min-height: 100vh;
}

body.chat-only-mode .auth-panel,
body.chat-only-mode #channelForm {
  display: none;
}

body.chat-only-mode .chat-area.chat-area--expanded {
  padding: 0 0 5px;
}

.container {
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 0px;
  flex: 1;
}

.auth-panel {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  background: #18181b;
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-panel__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 320px;
  min-width: 260px;
}

.panel-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f8fafc;
}

.auth-status {
  font-size: 0.9rem;
  color: rgba(207, 214, 255, 0.92);
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  flex: 0 0 auto;
  margin-left: auto;
}

.auth-actions button {
  padding: 12px 22px;
  font-size: 0.95rem;
  min-width: 150px;
  flex: 0 0 auto;
}

@media (max-width: 720px) {
  .auth-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-panel__header {
    flex: none;
    width: 100%;
  }

  .auth-actions {
    justify-content: flex-start;
    width: 100%;
    margin-left: 0;
    flex: none;
  }
}

h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
  background: #18181b;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

#channelForm {
  gap: 16px;
  align-items: flex-end;
  padding: 12px 16px;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  gap: 4px;
  min-width: 220px;
}

#channelForm label {
  flex: 1 1 280px;
  min-width: 260px;
  font-size: 0.95rem;
}

.channel-input__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: rgba(226, 232, 240, 0.84);
  font-weight: 500;
}

.channel-input__control {
  position: relative;
  display: flex;
  align-items: center;
}

.channel-input__control input {
  width: 100%;
}

.channel-input__overlay {
  position: absolute;
  inset: 0;
  padding: 12px 16px;
  font: inherit;
  line-height: inherit;
  color: inherit;
  pointer-events: none;
  white-space: pre;
  overflow: hidden;
  display: block;
}

.channel-input__control.has-decoration input[type="text"] {
  color: transparent;
  caret-color: #f8fafc;
}

.channel-input__control.has-decoration input[type="text"]::placeholder {
  color: transparent;
}

.channel-input__token {
  color: inherit;
  transition: color 0.2s ease;
}

.channel-input__token.is-connected {
  color: var(--success-green);
}

.channel-input__token.is-disconnected {
  color: var(--danger-red);
}

.channel-input__separator {
  color: rgba(226, 232, 240, 0.8);
}

input[type="text"] {
  padding: 8px 11px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.8);
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

input[type="text"].input--locked {
  cursor: not-allowed;
  border-color: rgba(148, 163, 184, 0.15);
  background: rgba(15, 23, 42, 0.5);
  color: rgba(226, 232, 240, 0.65);
}

#channelForm input[type="text"] {
  padding: 12px 16px;
  font-size: 1rem;
}

.form-actions {
  display: flex;
  gap: 14px;
  margin-left: auto;
  align-items: flex-end;
}

.form-actions button {
  min-width: 160px;
  padding: 12px 22px;
  font-size: 1rem;
  flex: 0 0 auto;
}

#twitchInput:not(.input--locked):is(:focus, :focus-visible) {
  border-color: var(--twitch-purple);
  box-shadow: 0 0 0 3px rgba(145, 70, 255, 0.2);
}

#kickInput:not(.input--locked):is(:focus, :focus-visible) {
  border-color: var(--kick-green);
  box-shadow: 0 0 0 3px rgba(83, 252, 24, 0.2);
}

button {
  --btn-bg: #6366f1;
  --btn-fg: #ffffff;
  --btn-shadow: rgba(99, 102, 241, 0.35);
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  position: relative;
  white-space: nowrap;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--btn-shadow, rgba(99, 102, 241, 0.35));
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button.is-busy {
  pointer-events: none;
  opacity: 0.85;
  padding-right: 28px;
}

button.is-busy::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: rgba(255, 255, 255, 0.2);
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  animation: button-spin 0.8s linear infinite;
  opacity: 0.9;
}

button.is-busy.button--kick::after {
  border-top-color: rgba(0, 0, 0, 0.2);
}

button.is-busy.button--neutral::after {
  border-top-color: rgba(255, 255, 255, 0.2);
}

button.is-busy.button--danger::after {
  border-top-color: rgba(255, 255, 255, 0.3);
}

button.is-busy.button--connect::after {
  border-top-color: rgba(255, 255, 255, 0.25);
}

.button--connect.is-active {
  --btn-bg: #16a34a;
  --btn-shadow: rgba(22, 163, 74, 0.35);
}

.button--connect.is-active::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
  width: 10px;
  height: 10px;
}

@keyframes button-spin {
  from {
    transform: translateY(-50%) rotate(0deg);
  }
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

.button--twitch {
  --btn-bg: var(--twitch-purple);
  --btn-shadow: var(--twitch-shadow);
}

.button--kick {
  --btn-bg: var(--kick-green);
  --btn-fg: var(--kick-text);
  --btn-shadow: var(--kick-shadow);
}

.button--youtube {
  --btn-bg: var(--youtube-red);
  --btn-shadow: var(--youtube-shadow);
}

.button--dual {
  --btn-bg: linear-gradient(135deg, #9146ff 0%, #53fc18 100%);
  --btn-shadow: rgba(145, 70, 255, 0.4);
}

.button--danger {
  --btn-bg: var(--danger-red);
  --btn-shadow: var(--danger-shadow);
}

.button--connect {
  --btn-bg: var(--connect-blue);
  --btn-shadow: var(--connect-shadow);
}

.button--neutral {
  --btn-bg: var(--neutral-gray);
  --btn-shadow: var(--neutral-shadow);
}

.button--connect,
#disconnectBtn {
  min-width: 160px;
}

.chat-area {
  --chat-font-scale: 1.2;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fullscreen-toggle {
  --btn-bg: transparent;
  --btn-shadow: none;
  padding: 0;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  display: grid;
  place-items: center;
  box-shadow: none;
  transform: none;
  z-index: 6;
  position: absolute;
  top: 12px;
  right: 14px;
  transition: color 0.15s ease, transform 0.12s ease;
}

.fullscreen-toggle:hover,
.fullscreen-toggle:focus-visible {
  background: transparent;
  box-shadow: none;
  color: #ffffff;
  transform: scale(1.08);
  outline: none;
}

.fullscreen-toggle svg {
  width: 32px;
  height: 32px;
  pointer-events: none;
}

.fullscreen-toggle.is-active {
  color: rgba(255, 255, 255, 0.3);
}

.fullscreen-toggle.is-active:hover,
.fullscreen-toggle.is-active:focus-visible {
  color: rgba(255, 255, 255, 0.6);
}

.chat-font-toggle {
  position: absolute;
  top: 58px;
  right: 19px;
  width: 30px;
  background: rgba(18, 19, 23, 0.92);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 6px 0;
  gap: 4px;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.3);
  z-index: 5;
}

.chat-font-toggle__button {
  all: unset;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  text-align: center;
  line-height: 1;
  cursor: pointer;
  padding: 3px 0;
  display: grid;
  place-items: center;
  box-shadow: none;
  transition: color 0.15s ease, transform 0.12s ease;
}

.chat-font-toggle__button:hover,
.chat-font-toggle__button:focus-visible {
  color: #ffffff;
  background: transparent;
  transform: scale(1.08);
  box-shadow: none;
  outline: none;
}

.chat-font-toggle__button[disabled] {
  opacity: 0.4;
  cursor: default;
}

.chat-font-toggle__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 5px;
}

#chat {
  position: relative;
  height: clamp(560px, 72vh, 900px);
  min-height: 360px;
  max-height: 90vh;
  resize: vertical;
  background: #0f0f11;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.0px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.chat-area.chat-area--expanded {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 14px 18px 18px;
  gap: 8px;
  background: #0f0f11;
  box-sizing: border-box;
}

.chat-area.chat-area--expanded #chat {
  flex: 1;
  height: auto;
  min-height: 0;
  max-height: none;
  resize: none;
  border-radius: 0;
  border-width: 0;
}

.chat-pause-banner {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(24, 24, 31, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 8px 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  z-index: 5;
  transition: opacity 0.15s ease;
}

.chat-pause-banner.hidden {
  display: none;
}

.chat-pause-banner__label {
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.92);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.chat-pause-banner__button {
  all: unset;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(145, 70, 255, 0.92);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.83rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  white-space: nowrap;
}

.chat-pause-banner__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(145, 70, 255, 0.45);
}

.chat-area .message-input-container {
  padding: 0 4px 4px;
}

.chat-area.chat-area--expanded .message-input-container {
  padding: 0;
}

.chat-pause-banner__button:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: calc(0.95rem * var(--chat-font-scale, 1));
  line-height: 1.4;
  padding: 4.8px 6.4px;
  word-break: break-word;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.message[data-message-id] {
  cursor: default;
}

.message[data-message-id] .content {
  cursor: pointer;
}

.message[data-message-id] .content:hover,
.message[data-message-id] .content:focus-within {
  text-decoration: underline;
}

.message.message--readonly .content,
.message.message--readonly .content:hover,
.message.message--readonly .content:focus-within {
  cursor: default;
  text-decoration: none;
}

.message[data-message-id] .badges,
.message[data-message-id] .badges *,
.message[data-message-id] .reply-context,
.message[data-message-id] .reply-context *,
.message[data-message-id] .name-group .separator {
  cursor: default;
  text-decoration: none;
}

.message:hover,
.message:focus-within {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.message .meta {
  flex: 1;
  min-width: 0;
  font-size: calc(0.9rem * var(--chat-font-scale, 1));
  color: #efeff1;
  word-break: break-word;
}

.message .meta .name-group {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  white-space: nowrap;
  margin-right: 6px;
  color: rgba(226, 232, 240, 0.96);
}

.message .meta .identity {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.message .meta .separator {
  opacity: 0.85;
  margin-right: 2px;
}

.message .meta .badges {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-right: 6px;
}

.message .meta .identity .badges {
  margin-right: 0;
  align-self: center;
}

.message .meta .badges img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.message .meta .badges .channel-avatar {
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.message .content {
  display: inline;
  font-size: inherit;
  color: inherit;
}

.message .content img.emote {
  height: calc(20px * var(--chat-font-scale, 1));
  width: calc(20px * var(--chat-font-scale, 1));
  vertical-align: middle;
  margin: 0 2px;
}

.mention {
  font-weight: 600;
}

.mention--self {
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  border-radius: 4px;
  padding: 0 4px;
}

.reply-preview__message img.emote {
  height: 20px;
  width: 20px;
  vertical-align: middle;
  margin: 0 2px;
}

.message .username {
  cursor: pointer;
  font-weight: 600;
}

.message .username.username--readonly {
  cursor: default;
  pointer-events: none;
  text-decoration: none;
}

.message .username:hover {
  text-decoration: underline;
}

.message .username.username--readonly:hover {
  text-decoration: none;
}

.message .reply-button {
  position: absolute;
  right: 12px;
  top: -14px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: rgba(30, 30, 36, 0.95);
  color: rgba(226, 232, 240, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
  opacity: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  z-index: 1;
}

.message .reply-button svg {
  width: 18px;
  height: 18px;
}

.message .reply-button svg path {
  stroke: rgba(226, 232, 240, 0.92);
}

.message .reply-button:hover {
  background: rgba(58, 64, 102, 0.95);
  transform: translateY(-1px);
}

.message .reply-button:focus-visible {
  outline: 2px solid rgba(129, 140, 248, 0.6);
  outline-offset: 2px;
  opacity: 1;
}

.message:hover .reply-button,
.message.message--reply-target .reply-button {
  opacity: 0.85;
}

.message.message--reply-target {
  border-color: rgba(129, 140, 248, 0.5);
  background: rgba(67, 56, 202, 0.18);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.35);
}

.message .reply-context {
  --reply-arrow-width: 1.1em;
  --reply-arrow-gap: calc(6px * var(--chat-font-scale, 1));
  display: flex;
  align-items: baseline;
  gap: var(--reply-arrow-gap);
  font-size: calc(0.78rem * var(--chat-font-scale, 1));
  color: rgba(203, 213, 225, 0.85);
  margin-bottom: calc(4px * var(--chat-font-scale, 1));
  letter-spacing: 0.01em;
}

.message .reply-context__icon {
  opacity: 0.8;
  flex: 0 0 auto;
  width: var(--reply-arrow-width);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: calc(0.9rem * var(--chat-font-scale, 1));
}

.message .reply-context__body {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: calc(-1 * (var(--reply-arrow-width) + var(--reply-arrow-gap)));
  text-indent: calc(var(--reply-arrow-width) + var(--reply-arrow-gap));
}

.message .reply-context__label {
  font-weight: 600;
  color: rgba(191, 219, 254, 0.95);
  font-size: calc(0.78rem * var(--chat-font-scale, 1));
  white-space: nowrap;
}

.message .reply-context__snippet {
  max-width: 100%;
  color: rgba(226, 232, 240, 0.9);
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 0;
}

.message .reply-context__snippet img.emote {
  height: calc(18px * var(--chat-font-scale, 1));
  width: calc(18px * var(--chat-font-scale, 1));
  vertical-align: middle;
  margin: 0 2px;
}

.platform-tag {
  font-size: 0.75rem;
  opacity: 0.8;
}

.platform-icon {
  width: 16px;
  height: 16px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.platform-icon.twitch {
  background-image: url('https://assets.twitch.tv/assets/favicon-32-e29e246c157142c94346.png');
}

.platform-icon.kick {
  background-image: url('https://kick.com/favicon.ico');
}

.platform-icon.youtube {
  background-image: url('https://www.google.com/s2/favicons?sz=64&domain=youtube.com');
}

.moderation-menu {
  position: fixed;
  background: #1f1f23;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  z-index: 1000;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
}

.moderation-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.moderation-menu__title {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
  padding: 0 2px;
}

.moderation-menu__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.moderation-menu__close {
  all: unset;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  cursor: pointer;
  color: rgba(248, 250, 252, 0.75);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.moderation-menu__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  transform: translateY(-1px);
}

.moderation-menu__close:focus-visible {
  outline: 2px solid rgba(129, 140, 248, 0.6);
  outline-offset: 2px;
}

.moderation-menu__button {
  all: unset;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  color: #f8fafc;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.16);
  transition: background 0.15s ease, transform 0.15s ease;
}

.moderation-menu__button:hover {
  background: rgba(129, 70, 255, 0.3);
  transform: translateY(-1px);
}

.moderation-menu__button:focus-visible {
  outline: 2px solid rgba(129, 140, 248, 0.6);
  outline-offset: 2px;
}

.moderation-menu__button--icon {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 1.2rem;
}

.moderation-menu__button--danger {
  background: rgba(248, 113, 113, 0.2);
}

.moderation-menu__button--danger:hover {
  background: rgba(248, 113, 113, 0.35);
}

.moderation-menu__button--muted {
  background: rgba(148, 163, 184, 0.16);
  color: rgba(226, 232, 240, 0.92);
}

.moderation-menu__button--muted:hover {
  background: rgba(148, 163, 184, 0.28);
}

.message.status {
  color: rgba(203, 213, 225, 0.85);
  font-style: italic;
}

.message.error {
  color: #f87171;
}

.reply-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1e1b4b;
  border: none;
  border-top: 1px solid rgba(129, 140, 248, 0.35);
  border-radius: 12px 12px 0 0;
  padding: 14px 16px;
  margin-top: auto;
  margin-bottom: -19px;
  color: rgba(226, 232, 240, 0.95);
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 2;
}

.reply-preview-spacer {
  flex-shrink: 0;
  height: 12px;
  pointer-events: none;
}

.reply-preview__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.reply-preview__icon svg {
  width: 20px;
  height: 20px;
}

.reply-preview__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reply-preview__label {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.reply-preview__message {
  font-size: 0.95rem;
  color: rgba(203, 213, 225, 0.9);
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.reply-preview__close {
  all: unset;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.1rem;
  color: rgba(226, 232, 240, 0.85);
  transition: background 0.15s ease, transform 0.15s ease;
}

.reply-preview__close:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.reply-preview__close:focus-visible {
  outline: 2px solid rgba(129, 140, 248, 0.6);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

#messageInput {
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #efeff1;
  font-size: 0.95rem;
  outline: none;
  flex: 1 1 160px;
  min-width: 0;
}

#messageInput:focus {
  outline: none;
}

#messageInput::placeholder {
  color: rgba(239, 239, 241, 0.5);
}

.message-input-container {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.message-input-field {
  display: flex;
  align-items: stretch;
  flex: 1 1 240px;
  min-width: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.8);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.message-input-field:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.message-input-field.message-input--twitch:focus-within {
  border-color: var(--twitch-purple);
  box-shadow: 0 0 0 3px var(--twitch-shadow);
}

.message-input-field.message-input--kick:focus-within {
  border-color: var(--kick-green);
  box-shadow: 0 0 0 3px var(--kick-shadow);
}

.message-input-field.message-input--youtube:focus-within {
  border-color: var(--youtube-red);
  box-shadow: 0 0 0 3px var(--youtube-shadow);
}

.message-input-field.is-disabled {
  opacity: 0.6;
}

#platformSelect {
  min-width: 150px;
  padding: 10px 36px 10px 12px;
  border: none;
  border-right: 1px solid rgba(148, 163, 184, 0.2);
  background-color: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  font-size: 0.95rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23f8fafc' d='M10.59.59 6 5.17 1.41.59 0 2l6 6 6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px;
  cursor: pointer;
}

#platformSelect::-ms-expand {
  display: none;
}

#platformSelect:disabled {
  cursor: not-allowed;
  color: rgba(148, 163, 184, 0.55);
  background-color: rgba(15, 23, 42, 0.6);
}

#platformSelect option {
  background-color: #0f172a;
  color: #f8fafc;
}

#platformSelect option:disabled {
  color: rgba(148, 163, 184, 0.55);
}

#sendButton {
  padding: 12px 20px;
  white-space: nowrap;
}

#sendButton:disabled {
  --btn-bg: #4b5563;
  --btn-fg: #d1d5db;
  --btn-shadow: rgba(75, 85, 99, 0.0);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
