html:root[data-platform="desktop"] body.nova-ready #chat #chatFeed .chat-message > div:last-child {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-content: start;
  align-items: start;
  column-gap: 12px;
  row-gap: 2px;
  min-width: 0;
}

html:root[data-platform="desktop"] body.nova-ready #chat #chatFeed .chat-message > div:last-child > div:first-child {
  display: contents !important;
}

html:root[data-platform="desktop"] body.nova-ready #chat #chatFeed .message-author-line {
  grid-column: 1;
  grid-row: 1;
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 7px;
  min-width: 0;
}

html:root[data-platform="desktop"] body.nova-ready #chat #chatFeed .message-author {
  max-width: min(38ch, 100%);
}

html:root[data-platform="desktop"] body.nova-ready #chat #chatFeed :is(.message-role-pills, .message-level-badges) {
  display: inline-flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

html:root[data-platform="desktop"] body.nova-ready #chat #chatFeed .message-level-badges[hidden],
html:root[data-platform="desktop"] body.nova-ready #chat #chatFeed .role-badges {
  display: none !important;
}

html:root[data-platform="desktop"] body.nova-ready #chat #chatFeed .message-role-pill {
  display: inline-flex;
}

html:root[data-platform="desktop"] body.nova-ready #chat #chatFeed .chat-message time {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  margin-top: 2px !important;
  color: var(--studio-content-muted) !important;
  font-size: 11px !important;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  white-space: nowrap;
}

html:root[data-platform="desktop"] body.nova-ready #chat #chatFeed .chat-message > div:last-child > p {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: 1px !important;
}

html:root[data-platform="desktop"] body.nova-ready #chat .desktop-viewer-scroll h3 {
  font-size: 11px;
}

html:root[data-platform="desktop"] body.nova-ready #chat .desktop-viewer-member b {
  font-size: 12px;
}

html:root[data-platform="desktop"] body.nova-ready #chat .desktop-viewer-member small,
html:root[data-platform="desktop"] body.nova-ready #chat .desktop-viewer-empty,
html:root[data-platform="desktop"] body.nova-ready #chat .desktop-viewer-scroll > footer {
  font-size: 11px;
}

html:root[data-platform="desktop"] body.nova-ready #chat .chat-tts-bar {
  flex: 0 0 58px !important;
  height: 58px !important;
  min-height: 58px !important;
  min-width: 0;
  gap: 8px !important;
  padding: 7px 10px !important;
  font-size: 12px;
}

html:root[data-platform="desktop"] body.nova-ready #chat .chat-tts-voice {
  min-width: 100px;
  flex: 1 1 165px;
}

html:root[data-platform="desktop"] body.nova-ready #chat .chat-tts-quotas {
  flex: 0 0 178px;
  width: 178px;
  gap: 2px;
}

html:root[data-platform="desktop"] body.nova-ready #chat .chat-tts-quotas > div {
  min-width: 0;
}

html:root[data-platform="desktop"] body.nova-ready #chat .chat-tts-quotas span {
  gap: 5px;
  font-size: 11px;
}

html:root[data-platform="desktop"] body.nova-ready #chat .chat-tts-quotas progress {
  height: 3px;
  margin-top: 2px;
}

@media (max-width: 1320px) {
  html:root[data-platform="desktop"] body.nova-ready #chat .chat-tts-bar {
    display: grid !important;
    grid-template-columns: auto minmax(110px, 1fr) 30px auto auto;
    grid-template-rows: 30px 28px;
    align-items: center;
    column-gap: 8px !important;
    row-gap: 3px !important;
    flex: 0 0 76px !important;
    height: 76px !important;
    min-height: 76px !important;
  }

  html:root[data-platform="desktop"] body.nova-ready #chat .chat-tts-reading { grid-column: 1; grid-row: 1; }
  html:root[data-platform="desktop"] body.nova-ready #chat .chat-tts-voice { grid-column: 2; grid-row: 1; width: 100%; min-width: 0; }
  html:root[data-platform="desktop"] body.nova-ready #chat .chat-tts-mute { grid-column: 3; grid-row: 1; }
  html:root[data-platform="desktop"] body.nova-ready #chat .chat-tts-volume { grid-column: 4; grid-row: 1; }
  html:root[data-platform="desktop"] body.nova-ready #chat .chat-tts-volume input { width: 62px; }
  html:root[data-platform="desktop"] body.nova-ready #chat .chat-tts-filter-separator { display: none; }
  html:root[data-platform="desktop"] body.nova-ready #chat .chat-tts-filter-button { grid-column: 5; grid-row: 1; }
  html:root[data-platform="desktop"] body.nova-ready #chat .chat-tts-quotas {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
  }
}

@media (max-width: 1180px) {
  html:root[data-platform="desktop"] body.nova-ready #chat .desktop-chat-layout[data-workspace="chat"] {
    position: relative;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html:root[data-platform="desktop"] body.nova-ready #chat .desktop-viewer-toggle {
    display: grid !important;
    place-items: center;
    flex: 0 0 36px !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
  }

  html:root[data-platform="desktop"] body.nova-ready #chat .desktop-viewer-toggle[aria-expanded="true"] {
    border-color: var(--studio-content-accent) !important;
    background: var(--studio-content-control) !important;
    color: var(--studio-content-accent) !important;
  }

  html:root[data-platform="desktop"] body.nova-ready #chat .desktop-viewer-drawer-backdrop {
    position: absolute;
    z-index: 48;
    inset: 0;
    display: block !important;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: #08080bc7;
  }

  html:root[data-platform="desktop"] body.nova-ready #chat .desktop-viewer-drawer-backdrop[hidden] {
    display: none !important;
  }

  html:root[data-platform="desktop"] body.nova-ready #chat .desktop-viewer-sidebar {
    position: absolute !important;
    z-index: 49;
    inset: 0 0 0 auto;
    grid-column: auto;
    width: min(320px, calc(100% - 24px));
    transform: translateX(calc(100% + 16px));
    visibility: hidden;
    pointer-events: none;
    border-left: 1px solid var(--studio-content-line) !important;
    box-shadow: -20px 0 52px #0008;
    transition: transform .2s ease, visibility .2s step-end;
  }

  html:root[data-platform="desktop"] body.nova-ready #chat .desktop-chat-layout.viewer-drawer-open .desktop-viewer-sidebar {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform .2s ease, visibility 0s;
  }

  html:root[data-platform="desktop"] body.nova-ready #chat #desktopViewerClose {
    display: grid !important;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--studio-content-line);
    border-radius: 6px;
    background: var(--studio-content-control);
    color: var(--studio-content-text);
  }
}
