* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.14), transparent 34%),
    radial-gradient(circle at top right, rgba(239, 68, 68, 0.08), transparent 28%),
    #11131a;
  color: #f4f4f6;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: rgba(17, 19, 26, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

h1 { margin: 0; font-size: 22px; }
p { margin: 4px 0 0; opacity: 0.66; }

.right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.channel-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255,255,255,0.045);
}

.channel-picker span {
  padding-left: 8px;
  font-size: 13px;
  opacity: 0.72;
}

.channel-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.channel-button {
  border: 1px solid rgba(255,255,255,0.12);
  background: #242a38;
  color: #fff;
  padding: 9px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

.channel-button.active {
  background: #7c3aed;
  border-color: rgba(255,255,255,0.25);
  box-shadow: 0 0 0 2px rgba(124,58,237,0.22);
}

.login, .logout {
  text-decoration: none;
  color: #fff;
  border: 0;
  background: #7c3aed;
  padding: 10px 13px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.logout { background: #303647; }
.hidden { display: none !important; }

.auth, .status, .mini-status {
  align-self: center;
  padding: 9px 11px;
  border-radius: 999px;
  background: #2b2f3d;
  font-size: 13px;
  white-space: nowrap;
}

.auth.ok, .status.ok, .mini-status.ok { background: #183c2d; }
.auth.bad, .status.bad, .mini-status.bad { background: #4a1d25; }

.platform-twitch { background: rgba(124, 58, 237, 0.25); color: #e7d7ff; }
.platform-vk { background: rgba(59, 130, 246, 0.25); color: #d9e9ff; }

.layout {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 390px;
  gap: 14px;
  padding: 14px;
  height: calc(100vh - 89px);
  min-height: 680px;
}

.main-workspace {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  min-width: 0;
}

.side-chats {
  display: grid;
  grid-template-rows: 1fr 1.25fr 0.85fr;
  gap: 14px;
  min-width: 0;
}

.panel {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  background: rgba(24, 27, 36, 0.96);
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0,0,0,0.18);
  min-height: 0;
}

.panel h2 {
  margin: 0;
  font-size: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255,255,255,0.035);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.stream-preview-panel {
  min-height: 178px;
}

.preview-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
}

.preview-box.main-preview {
  width: 280px;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #0f1118;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.08);
}

.preview-box iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.offline {
  width: 100%;
  height: 100%;
  min-height: 120px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  background: radial-gradient(circle at top, #273044, #11131a 70%);
  color: #d6d9e4;
  font-weight: 700;
}

.preview-note {
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.78;
}

.main-chat-panel {
  min-height: 0;
}

.messages {
  overflow-y: auto;
  padding: 12px;
}

.main-messages {
  height: calc(100vh - 355px);
  min-height: 430px;
}

.compact-chat {
  min-height: 0;
}

.compact-messages {
  height: calc(100% - 50px);
  min-height: 120px;
}

.youtube-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.youtube-form input {
  width: 100%;
  padding: 10px 11px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #202532;
  color: #fff;
  outline: none;
}

.youtube-form button {
  background: #7c3aed;
}

.youtube-compact {
  height: calc(100% - 191px);
  min-height: 130px;
}

.advanced-youtube {
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
  padding: 8px;
}

.advanced-youtube summary {
  cursor: pointer;
  color: #cfd3dc;
  font-size: 13px;
  padding: 4px;
}

.advanced-youtube input {
  margin-top: 8px;
}

.placeholder { padding: 16px; opacity: 0.55; }

.message {
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #222632;
  border: 1px solid rgba(255,255,255,0.06);
  transition: 0.18s ease;
}

.message.twitch {
  border-left: 5px solid #9146ff;
  background: linear-gradient(90deg, rgba(145,70,255,0.16), rgba(34,38,50,1) 28%);
}

.message.youtube {
  border-left: 5px solid #ff0033;
  background: linear-gradient(90deg, rgba(255,0,51,0.15), rgba(34,38,50,1) 28%);
}

.message.vkplay {
  border-left: 5px solid #2688eb;
  background: linear-gradient(90deg, rgba(38,136,235,0.15), rgba(34,38,50,1) 28%);
}

.message.system {
  background: #20283a;
  border-color: rgba(120, 160, 255, 0.22);
  border-left: 5px solid rgba(120, 160, 255, 0.5);
}

.message.history {
  border-color: rgba(255,255,255,0.03);
  opacity: 0.82;
}

.message.moderated {
  opacity: 0.42;
  filter: grayscale(0.55);
  background: #171a22;
  border-color: rgba(255,255,255,0.035);
}

.message.moderated .text {
  text-decoration: line-through;
  opacity: 0.76;
}

.message-head {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: #cfd3dc;
}

.platform {
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  font-size: 11px;
  background: #343949;
}

.message.twitch .platform {
  background: rgba(145, 70, 255, 0.28);
  color: #eadcff;
}

.message.youtube .platform {
  background: rgba(255, 0, 51, 0.24);
  color: #ffd9df;
}

.message.vkplay .platform {
  background: rgba(38, 136, 235, 0.25);
  color: #d9ebff;
}

.badge, .history-badge {
  display: none;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
}

.badge {
  background: #3a2c18;
  color: #f6c56a;
}

.history-badge {
  background: #263245;
  color: #b6caed;
}

.message.moderated .badge,
.message.history .history-badge {
  display: inline-block;
}

.author { color: #fff; }
time { margin-left: auto; opacity: 0.55; }

.text {
  margin: 8px 0 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.message.system .actions,
.message.moderated .actions,
.message.vkplay .actions {
  display: none;
}

button {
  border: 0;
  border-radius: 9px;
  padding: 7px 9px;
  background: #303647;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}

button.delete { background: #31415f; }
button.mute { background: #5a3f19; }
button.danger { background: #5b1d2a; }
button:disabled { opacity: 0.45; cursor: wait; }
button:hover:not(:disabled), .login:hover { filter: brightness(1.12); }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #20283a;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 14px 40px rgba(0,0,0,0.35);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.bad { background: #4a1d25; }

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .side-chats {
    grid-template-rows: none;
    grid-template-columns: 1fr;
  }

  .main-messages,
  .compact-messages,
  .youtube-compact {
    height: 420px;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .right {
    justify-content: flex-start;
    width: 100%;
  }

  .channel-picker {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
    border-radius: 18px;
  }

  .channel-button {
    flex: 1 1 100%;
  }

  .preview-row,
  .dual-preview-row {
    grid-template-columns: 1fr;
  }

  .preview-box.main-preview {
    width: 100%;
  }
}


/* Compact side chats: fit 4-ish messages per platform column without touching main chat */
.layout {
  height: calc(100vh - 89px);
  min-height: 0;
}

.side-chats {
  grid-template-rows: 1fr 1.25fr 0.85fr;
  min-height: 0;
  height: 100%;
}

.compact-chat {
  min-height: 0;
}

.compact-chat .panel-head {
  padding: 9px 12px;
}

.compact-chat .panel-head h2 {
  font-size: 14px;
}

.compact-chat .mini-status {
  padding: 6px 8px;
  font-size: 11px;
}

.compact-messages {
  height: calc(100% - 42px);
  min-height: 0;
  padding: 8px;
}

.youtube-form {
  padding: 8px;
  gap: 6px;
}

.youtube-form input {
  padding: 8px 9px;
  font-size: 12px;
}

.youtube-form button {
  padding: 7px 9px;
  font-size: 12px;
}

.advanced-youtube {
  padding: 6px;
}

.advanced-youtube summary {
  font-size: 12px;
}

.youtube-compact {
  height: calc(100% - 164px);
  min-height: 0;
}

.compact-chat .message {
  margin-bottom: 7px;
  padding: 8px;
  border-radius: 11px;
}

.compact-chat .message-head {
  gap: 6px;
  font-size: 11px;
}

.compact-chat .platform {
  padding: 1px 6px;
  font-size: 10px;
}

.compact-chat .author {
  max-width: 135px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-chat time {
  font-size: 10px;
}

.compact-chat .text {
  margin: 6px 0 7px;
  font-size: 12px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.compact-chat .actions {
  gap: 4px;
}

.compact-chat .actions button {
  padding: 5px 6px;
  font-size: 11px;
  border-radius: 7px;
}

@media (max-width: 1200px) {
  .side-chats {
    height: auto;
  }

  .compact-messages,
  .youtube-compact {
    height: 260px;
  }
}


.youtube-login {
  background: #ff0033;
}

.message.youtube .actions button.delete {
  background: #7a1f2e;
}

.message.youtube .actions button.mute {
  background: #6a3a16;
}

.message.youtube .actions button.danger {
  background: #7a1021;
}



.youtube-send-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(255, 0, 51, 0.055);
}

.youtube-send-form input {
  width: 100%;
  padding: 9px 10px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #202532;
  color: #fff;
  outline: none;
}

.youtube-send-form button {
  background: #ff0033;
  padding: 9px 12px;
}

.message.youtube.outgoing {
  border-left-color: #ff6b81;
  background: linear-gradient(90deg, rgba(255,0,51,0.26), rgba(34,38,50,1) 34%);
}

.message.youtube.outgoing .author::after {
  content: " отправлено";
  margin-left: 6px;
  color: #ffb7c2;
  font-size: 11px;
  font-weight: 500;
}

.youtube-panel .youtube-compact {
  height: calc(100% - 214px);
}

@media (max-width: 1200px) {
  .youtube-panel .youtube-compact {
    height: 260px;
  }
}

.dual-preview-row {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  align-items: stretch;
}

.preview-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 8px;
}

.preview-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  opacity: 0.82;
}

.dual-preview-row .preview-box.main-preview {
  width: 100%;
}

.youtube-preview-card .preview-title {
  color: #ffb7c2;
}

.youtube-preview-box {
  box-shadow: inset 0 0 0 1px rgba(255, 0, 51, 0.18);
}

@media (max-width: 720px) {
  .dual-preview-row {
    grid-template-columns: 1fr;
  }
}

/* UI v2: mobile drawer, foldable panels, iPhone PWA comfort */
html {
  min-height: 100%;
  background: #11131a;
}

body {
  min-height: 100%;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-tap-highlight-color: transparent;
}

.brand-block {
  min-width: 0;
}

.topbar {
  align-items: center;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.menu-button,
.icon-button,
.collapse-toggle {
  border: 1px solid rgba(255,255,255,0.12);
  background: #242a38;
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.menu-button {
  padding: 10px 14px;
  font-weight: 800;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(0,0,0,0.48);
  backdrop-filter: blur(3px);
}

.control-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 40;
  width: min(430px, calc(100vw - 18px));
  height: 100dvh;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  background: rgba(17, 19, 26, 0.98);
  border-left: 1px solid rgba(255,255,255,0.1);
  box-shadow: -22px 0 70px rgba(0,0,0,0.42);
  transform: translateX(105%);
  transition: transform 0.22s ease;
  overflow-y: auto;
}

.control-drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.drawer-head h2 {
  margin: 0;
  font-size: 20px;
}

.drawer-head p {
  margin-top: 5px;
  font-size: 13px;
}

.drawer-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.075);
}

.drawer-section-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  opacity: 0.66;
}

.drawer-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.drawer-buttons .login,
.drawer-buttons .logout {
  flex: 1 1 160px;
  text-align: center;
}

.drawer-picker {
  display: grid;
  align-items: stretch;
}

.drawer-hint {
  color: #cfd3dc;
  line-height: 1.35;
  font-size: 13px;
}

.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.collapse-toggle {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  transition: transform 0.18s ease, background 0.18s ease;
}

.collapsible-panel.collapsed > :not(.panel-head) {
  display: none !important;
}

.collapsible-panel.collapsed .collapse-toggle {
  transform: rotate(-90deg);
  background: #303647;
}

.collapsible-panel.collapsed {
  min-height: 0;
}

body.focus-mode .stream-preview-panel,
body.focus-mode .side-chats {
  display: none;
}

body.focus-mode .layout {
  grid-template-columns: 1fr;
}

body.focus-mode .main-messages {
  height: calc(100dvh - 170px);
  min-height: 420px;
}

@media (max-width: 1200px) {
  .layout {
    height: auto;
    min-height: 0;
  }

  .main-workspace,
  .side-chats {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  body {
    overflow-x: hidden;
  }

  .topbar {
    position: sticky;
    top: 0;
    flex-direction: row;
    align-items: center;
    padding: 12px 12px;
    gap: 10px;
  }

  h1 {
    font-size: 17px;
    line-height: 1.1;
  }

  p#channelLabel {
    max-width: 58vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-actions {
    gap: 6px;
  }

  .compact-status {
    display: none;
  }

  .menu-button {
    padding: 9px 11px;
    font-size: 13px;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    height: auto;
    min-height: calc(100dvh - 64px);
  }

  .main-workspace,
  .side-chats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .panel {
    border-radius: 16px;
  }

  .panel-head {
    position: sticky;
    top: 62px;
    z-index: 4;
    padding: 10px 12px;
  }

  .panel h2 {
    font-size: 15px;
  }

  .mini-status {
    padding: 6px 8px;
    font-size: 11px;
    max-width: 44vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .preview-row,
  .dual-preview-row {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 12px;
  }

  .preview-card {
    gap: 6px;
  }

  .main-messages {
    height: 56dvh;
    min-height: 340px;
  }

  .compact-messages,
  .youtube-compact,
  .youtube-panel .youtube-compact {
    height: 44dvh;
    min-height: 260px;
  }

  .youtube-form,
  .youtube-send-form {
    padding: 8px;
  }

  .youtube-send-form {
    grid-template-columns: 1fr;
  }

  .message {
    padding: 10px;
    border-radius: 13px;
  }

  .message-head {
    gap: 6px;
    font-size: 12px;
  }

  .author {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  time {
    font-size: 11px;
  }

  .actions {
    gap: 5px;
  }

  .actions button {
    flex: 1 1 calc(33.333% - 6px);
    padding: 8px 6px;
    font-size: 12px;
  }

  .toast {
    right: 10px;
    left: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    max-width: none;
  }

  .drawer-buttons .login,
  .drawer-buttons .logout {
    flex: 1 1 100%;
  }

  .channel-button {
    flex: 1 1 calc(50% - 6px);
    text-align: center;
  }
}


/* =========================================================
   HARD MOBILE FIX v3 - 2026-04-28
   Purpose: compact moderator UI for phones, visible change
   ========================================================= */

:root {
  --mobile-gap: 7px;
  --mobile-radius: 12px;
  --mobile-panel-bg: rgba(20, 23, 31, 0.98);
}

/* Desktop also gets slightly cleaner density */
.message {
  margin-bottom: 7px !important;
  padding: 8px !important;
  border-radius: 12px !important;
}

.text {
  margin: 6px 0 7px !important;
  line-height: 1.28 !important;
}

.actions {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 5px !important;
}

.actions button {
  min-width: 0 !important;
  padding: 6px 5px !important;
  font-size: 11px !important;
  border-radius: 8px !important;
  line-height: 1.1 !important;
}

.panel-head {
  padding: 9px 11px !important;
}

.panel h2 {
  font-size: 14px !important;
}

.mini-status {
  padding: 5px 7px !important;
  font-size: 11px !important;
}

.youtube-form,
.youtube-send-form {
  padding: 6px !important;
  gap: 5px !important;
}

.youtube-form input,
.youtube-send-form input {
  padding: 7px 8px !important;
  font-size: 12px !important;
  border-radius: 9px !important;
}

.youtube-form button,
.youtube-send-form button {
  padding: 7px 8px !important;
  font-size: 12px !important;
}

.advanced-youtube {
  padding: 5px !important;
  border-radius: 10px !important;
}

.advanced-youtube summary {
  font-size: 11px !important;
  padding: 2px !important;
}

.preview-row,
.dual-preview-row {
  padding: 8px !important;
  gap: 8px !important;
}

.preview-note {
  font-size: 11px !important;
  line-height: 1.25 !important;
}

.preview-title {
  font-size: 11px !important;
}

@media (max-width: 720px) {
  body {
    background: #0f1118 !important;
  }

  .topbar {
    padding: 7px 8px !important;
    gap: 6px !important;
    min-height: 50px !important;
  }

  h1 {
    font-size: 14px !important;
    letter-spacing: -0.02em !important;
  }

  p#channelLabel {
    font-size: 10px !important;
    max-width: 50vw !important;
    margin-top: 2px !important;
  }

  .topbar-actions {
    gap: 5px !important;
  }

  .menu-button {
    padding: 7px 9px !important;
    font-size: 11px !important;
    border-radius: 12px !important;
  }

  .icon-button {
    width: 31px !important;
    height: 31px !important;
    font-size: 14px !important;
  }

  .layout {
    padding: 6px !important;
    gap: var(--mobile-gap) !important;
    min-height: calc(100dvh - 50px) !important;
  }

  .main-workspace,
  .side-chats {
    gap: var(--mobile-gap) !important;
  }

  .panel {
    border-radius: var(--mobile-radius) !important;
    background: var(--mobile-panel-bg) !important;
    box-shadow: 0 8px 26px rgba(0,0,0,0.22) !important;
  }

  .panel-head {
    position: relative !important;
    top: auto !important;
    z-index: 1 !important;
    padding: 7px 8px !important;
    min-height: 35px !important;
  }

  .panel h2 {
    font-size: 13px !important;
  }

  .collapse-toggle {
    width: 25px !important;
    height: 25px !important;
    font-size: 14px !important;
  }

  .mini-status {
    max-width: 38vw !important;
    padding: 4px 6px !important;
    font-size: 10px !important;
  }

  .stream-preview-panel {
    min-height: 0 !important;
  }

  .preview-row,
  .dual-preview-row {
    padding: 6px !important;
    gap: 7px !important;
  }

  .preview-card {
    gap: 4px !important;
  }

  .preview-box.main-preview {
    border-radius: 10px !important;
  }

  .offline {
    min-height: 82px !important;
    padding: 10px !important;
    font-size: 12px !important;
  }

  .preview-note {
    display: none !important;
  }

  .main-messages {
    height: 45dvh !important;
    min-height: 260px !important;
    padding: 7px !important;
  }

  .compact-messages,
  .youtube-compact,
  .youtube-panel .youtube-compact {
    height: 31dvh !important;
    min-height: 190px !important;
    padding: 7px !important;
  }

  .youtube-form {
    grid-template-columns: 1fr auto !important;
    align-items: center !important;
  }

  .youtube-form input {
    min-width: 0 !important;
  }

  .advanced-youtube {
    display: none !important;
  }

  .youtube-form button {
    white-space: nowrap !important;
  }

  .youtube-send-form {
    grid-template-columns: 1fr auto !important;
  }

  .youtube-send-form input {
    min-width: 0 !important;
  }

  .message {
    margin-bottom: 6px !important;
    padding: 7px !important;
    border-radius: 10px !important;
    border-left-width: 3px !important;
  }

  .message-head {
    gap: 4px !important;
    font-size: 10px !important;
  }

  .platform {
    padding: 1px 5px !important;
    font-size: 9px !important;
  }

  .author {
    max-width: 40vw !important;
    font-size: 11px !important;
  }

  .history-badge,
  .badge {
    padding: 1px 5px !important;
    font-size: 9px !important;
  }

  time {
    font-size: 9px !important;
  }

  .text {
    margin: 5px 0 6px !important;
    font-size: 12px !important;
    line-height: 1.22 !important;
  }

  .actions {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
  }

  .actions button {
    padding: 5px 3px !important;
    font-size: 10px !important;
    border-radius: 7px !important;
    min-height: 25px !important;
  }

  .control-drawer {
    width: min(360px, calc(100vw - 10px)) !important;
    padding: calc(10px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom)) !important;
  }

  .drawer-head h2 {
    font-size: 16px !important;
  }

  .drawer-section {
    padding: 8px !important;
    margin-bottom: 8px !important;
    border-radius: 13px !important;
    gap: 7px !important;
  }

  .drawer-section-title {
    font-size: 10px !important;
  }

  .drawer-buttons {
    gap: 6px !important;
  }

  .drawer-buttons .login,
  .drawer-buttons .logout,
  .channel-button {
    padding: 8px 9px !important;
    font-size: 12px !important;
  }

  body.focus-mode .main-messages {
    height: calc(100dvh - 96px) !important;
    min-height: 520px !important;
  }

  .toast {
    font-size: 12px !important;
    padding: 9px 10px !important;
    border-radius: 11px !important;
  }
}

/* Ultra small phones */
@media (max-width: 390px) {
  .actions button {
    font-size: 9px !important;
  }

  .main-messages {
    height: 43dvh !important;
  }

  .compact-messages,
  .youtube-compact,
  .youtube-panel .youtube-compact {
    height: 29dvh !important;
  }
}
