.app-main {
  width: min(1520px, calc(100% - 3rem));
  margin: 0 auto;
  padding: clamp(1rem, 2.5vw, 1.7rem) 0;
}

.workspace-home,
.studio-shell,
.chat-room {
  display: grid;
  gap: 1rem;
}

.workspace-hero,
.studio-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: end;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--bg-border);
  border-radius: 8px;
  background: rgba(17, 17, 17, 0.88);
}

.workspace-hero h1,
.studio-head h1,
.chat-sidebar h1 {
  max-width: 900px;
  font-size: clamp(2.6rem, 6vw, 5.1rem);
}

.workspace-hero p,
.studio-head p,
.chat-sidebar p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: 1.08rem;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.room-card,
.workspace-feature-card {
  display: flex;
  flex-direction: column;
  min-height: 17rem;
  padding: 1.1rem;
  border: 1px solid var(--bg-border);
  border-radius: 8px;
  background: rgba(17, 17, 17, 0.9);
  color: var(--text-primary);
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.room-card:hover,
.room-card:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(202, 255, 51, 0.55);
  background: rgba(202, 255, 51, 0.08);
  box-shadow: 0 0 32px rgba(202, 255, 51, 0.16);
}

.room-card.primary {
  border-color: rgba(202, 255, 51, 0.4);
}

.room-card span,
.studio-stats span {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  margin-bottom: 1.4rem;
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--accent);
  font-family: var(--font-output);
  font-weight: 800;
}

.room-card strong {
  margin-bottom: 0.45rem;
  font-size: 1.2rem;
}

.room-card p {
  color: var(--text-secondary);
}

.room-card em {
  margin-top: auto;
  color: var(--accent);
  font-style: normal;
  font-weight: 800;
}

.workflow-band {
  display: grid;
  grid-template-columns: minmax(0, 0.55fr) minmax(0, 1fr);
  gap: 1rem;
  padding: clamp(1.2rem, 3vw, 1.75rem);
  border: 1px solid var(--bg-border);
  border-radius: 8px;
  background: rgba(17, 17, 17, 0.86);
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.workflow-steps article {
  padding: 1rem;
  border: 1px solid var(--bg-border);
  border-radius: 8px;
  background: var(--bg-elevated);
}

.workflow-steps span {
  color: var(--accent);
  font-family: var(--font-output);
  font-weight: 800;
}

.workflow-steps p {
  margin: 0.4rem 0 0;
  color: var(--text-secondary);
}

.studio-stats {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.studio-stats span {
  width: auto;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(202, 255, 51, 0.22);
  border-radius: 999px;
  background: rgba(202, 255, 51, 0.08);
}

.draft-layout {
  display: grid;
  grid-template-columns: minmax(21rem, 0.48fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.studio-panel,
.studio-output,
.chat-sidebar,
.chat-stage {
  border: 1px solid var(--bg-border);
  border-radius: 8px;
  background: rgba(17, 17, 17, 0.92);
}

.studio-panel {
  position: sticky;
  top: 5.5rem;
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.studio-output {
  min-height: calc(var(--app-vh) - 11rem);
  padding: 1rem;
}

.studio-output-head,
.platform-preview-head,
.chat-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bg-border);
}

.draft-empty {
  display: grid;
  place-content: center;
  min-height: 28rem;
  border: 1px dashed var(--bg-border);
  border-radius: 8px;
  color: var(--text-secondary);
  text-align: center;
}

.draft-preview {
  padding-top: 1rem;
}

.platform-preview {
  border: 1px solid var(--bg-border);
  border-radius: 8px;
  background: var(--bg-surface);
  overflow: hidden;
}

.platform-preview-head {
  padding: 1rem;
}

.video-meta.compact {
  padding: 0;
}

.tweet-thread,
.quote-bank,
.take-grid {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
}

.tweet-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--bg-border);
  border-radius: 8px;
  background: #050505;
}

.tweet-avatar,
.linkedin-author > div {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--text-on-accent);
  font-weight: 900;
}

.tweet-card span,
.tweet-card small,
.linkedin-author small,
.linkedin-actions {
  color: var(--text-secondary);
}

.tweet-card p {
  margin: 0.5rem 0;
  color: var(--text-primary);
  white-space: pre-wrap;
}

.linkedin-preview,
.blog-preview,
.newsletter-preview,
.youtube-description-preview,
.dm-preview,
.tldw-card {
  margin: 1rem;
  padding: 1rem;
  border: 1px solid var(--bg-border);
  border-radius: 8px;
  background: var(--bg-elevated);
  white-space: pre-wrap;
}

.linkedin-author {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.linkedin-author span,
.linkedin-author small {
  display: block;
}

.blog-preview {
  font-size: 1.02rem;
  line-height: 1.7;
}

.reddit-preview,
.reddit-comment-preview {
  display: grid;
  gap: 0.85rem;
  margin: 1rem;
  padding: 1rem;
  border: 1px solid var(--bg-border);
  border-radius: 8px;
  background: #070707;
  white-space: pre-wrap;
}

.reddit-preview {
  grid-template-columns: auto minmax(0, 1fr);
}

.reddit-vote {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.15rem;
  color: var(--text-secondary);
  font-family: var(--font-output);
}

.reddit-preview small,
.reddit-comment-preview small,
.reddit-actions {
  color: var(--text-secondary);
}

.reddit-preview h3 {
  margin: 0.2rem 0 0.55rem;
}

.reddit-preview p,
.reddit-comment-preview p {
  margin-bottom: 0.75rem;
}

.newsletter-preview,
.youtube-description-preview,
.dm-preview {
  line-height: 1.68;
}

.dm-preview {
  max-width: 38rem;
  border-radius: 18px 18px 18px 6px;
  background: rgba(202, 255, 51, 0.09);
}

.carousel-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  padding: 1rem;
}

.carousel-slide {
  min-height: 11rem;
  padding: 1rem;
  border: 1px solid var(--bg-border);
  border-radius: 8px;
  background: var(--bg-elevated);
}

.carousel-slide span {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.85rem;
  border-radius: 6px;
  background: var(--accent);
  color: var(--text-on-accent);
  font-family: var(--font-output);
  font-weight: 800;
}

.quote-bank {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quote-bank blockquote,
.take-card {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--bg-border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.chat-room {
  grid-template-columns: minmax(18rem, 0.34fr) minmax(0, 1fr);
  align-items: stretch;
  min-height: calc(var(--app-vh) - 6rem);
}

.chat-page {
  overflow: hidden;
}

.chat-page .app-main {
  height: calc(var(--app-vh) - 4.5rem);
  padding: 0.75rem 0;
}

.chat-page .chat-room {
  height: 100%;
  min-height: 0;
}

.chat-sidebar {
  display: grid;
  align-content: start;
  gap: 0.7rem;
  padding: 0.85rem;
  overflow: hidden;
}

.chat-sidebar h1 {
  max-width: 34rem;
  margin-bottom: 0.35rem;
  font-size: clamp(2rem, 4.1vw, 3.45rem);
  line-height: 0.98;
}

.chat-sidebar p {
  max-width: 31rem;
  font-size: 0.96rem;
}

.chat-source-form,
.prompt-bank {
  display: grid;
  gap: 0.55rem;
}

.chat-source-form input {
  height: 2.85rem;
}

.prompt-bank button {
  min-height: 2.35rem;
  padding: 0.48rem 0.62rem;
  border: 1px solid var(--bg-border);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  text-align: left;
  font-weight: 700;
}

.prompt-bank {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: clamp(1.25rem, 3vh, 2.4rem);
}

.prompt-bank .field-label {
  grid-column: 1 / -1;
}

.prompt-bank button:hover {
  border-color: var(--accent);
}

.chat-video-card {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--bg-border);
  border-radius: 8px;
  background: var(--bg-elevated);
}

.chat-video-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
}

.chat-video-card strong,
.chat-video-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-video-card span {
  color: var(--text-secondary);
}

.chat-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: calc(var(--app-vh) - 6rem);
  padding: 1rem;
}

.chat-page .chat-stage {
  min-height: 0;
  height: 100%;
}

.chat-stage-head h2 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 2.7vw, 2.35rem);
}

.large-chat-messages {
  display: grid;
  align-content: start;
  gap: 0.85rem;
  overflow: auto;
  padding: 0.85rem 0;
}

.large-chat-message {
  max-width: 76%;
  padding: 0.95rem 1rem;
  border: 1px solid var(--bg-border);
  border-radius: 8px;
  background: var(--bg-elevated);
  white-space: pre-wrap;
}

.large-chat-message.user {
  justify-self: end;
  border-color: rgba(202, 255, 51, 0.38);
  background: rgba(202, 255, 51, 0.1);
}

.large-chat-message.assistant {
  justify-self: start;
  font-family: var(--font-output);
}

.large-chat-message.formatted-answer {
  width: min(76%, 58rem);
  font-family: var(--font-body);
  line-height: 1.62;
}

.formatted-answer h3,
.formatted-answer h4 {
  margin: 0.95rem 0 0.45rem;
  font-family: var(--font-display);
  line-height: 1.08;
}

.formatted-answer h3:first-child,
.formatted-answer h4:first-child {
  margin-top: 0;
}

.formatted-answer h3 {
  color: var(--accent);
  font-size: 1.18rem;
}

.formatted-answer h4 {
  color: var(--text-primary);
  font-size: 1rem;
}

.formatted-answer p {
  margin: 0.45rem 0;
}

.formatted-answer ul,
.formatted-answer ol {
  display: grid;
  gap: 0.45rem;
  margin: 0.55rem 0 0.85rem;
  padding-left: 1.25rem;
}

.formatted-answer li::marker {
  color: var(--accent);
  font-weight: 800;
}

.formatted-answer strong {
  color: var(--text-primary);
}

.large-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
  padding-top: 0.75rem;
  border-top: 1px solid var(--bg-border);
}

.large-chat-form textarea {
  min-height: 4.5rem;
  max-height: 8rem;
}

.chat-console-page {
  overflow: hidden;
  overflow-x: clip;
  background: #202020;
}

.chat-console {
  display: grid;
  grid-template-columns: 20rem minmax(0, 1fr);
  min-width: 0;
  height: var(--app-vh);
  color: #f7f7f7;
}

.chat-rail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 0.9rem;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: #171717;
}

.chat-rail-brand {
  margin-bottom: 1rem;
}

.rail-action,
.rail-link,
.rail-chat {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2.65rem;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #f7f7f7;
  text-align: left;
  font-size: 0.94rem;
  font-weight: 700;
}

.rail-action {
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 0.4rem;
}

.rail-action span {
  display: inline-grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  color: var(--accent);
  font-size: 1.15rem;
  line-height: 1;
}

.rail-link {
  color: rgba(247, 247, 247, 0.86);
}

.rail-action:hover,
.rail-link:hover,
.rail-chat:hover,
.rail-chat.active {
  background: rgba(255, 255, 255, 0.08);
}

.rail-section {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  margin-top: 1.4rem;
}

.rail-chat-list {
  display: grid;
  gap: 0.15rem;
  min-height: 0;
  overflow: auto;
}

.rail-chat {
  display: grid;
  grid-template-columns: 3.35rem minmax(0, 1fr);
  gap: 0.6rem;
  min-height: 3.85rem;
}

.rail-chat img {
  width: 100%;
  aspect-ratio: 16 / 9;
  align-self: center;
  border-radius: 6px;
  background: #262626;
  object-fit: cover;
}

.rail-chat > span {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}

.rail-chat strong,
.rail-chat small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-chat strong {
  font-size: 0.92rem;
}

.rail-chat.rail-project {
  padding: 0;
  background: transparent;
  border: 0;
  grid-template-columns: 1fr auto;
  gap: 0;
  align-items: stretch;
  min-height: unset;
  overflow: hidden;
  border-radius: 8px;
  position: relative;
}

.rail-chat.rail-project:hover,
.rail-chat.rail-project.active {
  background: rgba(255, 255, 255, 0.06);
}

.rail-project-open {
  display: grid;
  grid-template-columns: 3.35rem minmax(0, 1fr);
  gap: 0.6rem;
  align-items: center;
  min-height: 3.85rem;
  padding: 0.55rem 0.5rem 0.55rem 0.6rem;
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  font: inherit;
}

.rail-project-open > span:not(.rail-project-icon) {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}

.rail-project-open strong,
.rail-project-open small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-project-open strong {
  font-size: 0.92rem;
}

.rail-project-open small {
  color: rgba(247, 247, 247, 0.56);
  font-size: 0.78rem;
}

.rail-project-delete {
  display: grid;
  place-items: center;
  width: 2rem;
  margin-right: 0.35rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: rgba(247, 247, 247, 0.42);
  cursor: pointer;
  opacity: 0;
  transition: opacity 140ms ease, color 140ms ease, background 140ms ease;
}

.rail-chat.rail-project:hover .rail-project-delete,
.rail-chat.rail-project:focus-within .rail-project-delete {
  opacity: 1;
}

.rail-project-delete:hover,
.rail-project-delete:focus-visible {
  color: #ff7a7a;
  background: rgba(255, 122, 122, 0.12);
  outline: none;
}

.rail-project-delete svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

@media (hover: none) {
  .rail-project-delete {
    opacity: 0.7;
  }
}

.rail-chat small,
.rail-empty {
  color: rgba(247, 247, 247, 0.56);
  font-size: 0.82rem;
}

.rail-empty {
  margin: 0.5rem 0 0;
}

.rail-footer {
  display: grid;
  gap: 0.55rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-workbench {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  background: #202020;
}

.chat-workbench-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  min-height: 4.35rem;
  padding: 0.75rem clamp(1rem, 3vw, 2.6rem);
}

.chat-workbench-head > div {
  min-width: 0;
}

.chat-workbench-head h1 {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.2rem;
  line-height: 1.2;
}

.project-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.project-title-row h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-title-input {
  width: min(28rem, 58vw);
  height: 2.15rem;
  padding: 0.25rem 0.45rem;
  border: 1px solid rgba(202, 255, 51, 0.35);
  border-radius: 7px;
  background: rgba(18, 18, 18, 0.92);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
}

.title-edit-button {
  display: grid;
  place-items: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.48rem;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(247, 247, 247, 0.72);
  font-size: 0.95rem;
  font-weight: 800;
}

.title-edit-button:hover,
.title-edit-button.saving-mode {
  border-color: rgba(202, 255, 51, 0.35);
  background: rgba(202, 255, 51, 0.1);
  color: var(--accent);
}

.chat-workbench-head .eyebrow {
  margin-bottom: 0.1rem;
  font-size: 0.68rem;
}

.chat-head-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.chat-scroll {
  min-height: 0;
  min-width: 0;
  overflow-x: clip;
  overflow-y: auto;
}

.chat-center {
  width: min(100%, 60rem);
  min-height: 100%;
  margin: 0 auto;
  padding: 0.35rem 1rem 2rem;
}

.video-source-bar,
.source-add-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
  margin: 0 auto 1rem;
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: #2b2b2b;
}

.video-source-bar {
  grid-template-columns: minmax(0, 1fr) auto;
}

.source-add-bar .field-error {
  grid-column: 1 / -1;
  margin: -0.25rem 0 0;
}

.source-add-bar input,
.video-source-bar input {
  height: 2.75rem;
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: #1f1f1f;
}

.source-add-bar input[type="file"] {
  padding: 0.42rem 0.48rem;
  color: rgba(247, 247, 247, 0.72);
  line-height: 1.8;
}

.source-add-bar input[type="file"]::file-selector-button {
  min-height: 1.9rem;
  margin-right: 0.65rem;
  padding: 0.35rem 0.72rem;
  border: 1px solid rgba(202, 255, 51, 0.28);
  border-radius: 7px;
  background: rgba(202, 255, 51, 0.1);
  color: var(--accent);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.source-add-bar input[type="file"]:hover::file-selector-button {
  border-color: rgba(202, 255, 51, 0.55);
  background: rgba(202, 255, 51, 0.16);
}

.source-add-bar input[type="file"]:focus-visible::file-selector-button {
  outline: 2px solid rgba(202, 255, 51, 0.35);
  outline-offset: 2px;
}

.source-add-bar .accent-button,
.video-source-bar .accent-button {
  min-height: 2.75rem;
  margin-bottom: 1.7rem;
}

.video-source-bar input.locked {
  color: rgba(247, 247, 247, 0.62);
  border-color: rgba(202, 255, 51, 0.16);
  background: rgba(31, 31, 31, 0.72);
}

.video-source-bar .accent-button.locked {
  color: var(--accent);
  border-color: rgba(202, 255, 51, 0.28);
  background: rgba(202, 255, 51, 0.08);
  opacity: 1;
}

.active-video-strip {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  border-radius: 14px;
  background: #2b2b2b;
}

.active-video-strip img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  object-fit: cover;
}

.active-video-strip span,
.active-video-strip p {
  margin: 0;
  color: rgba(247, 247, 247, 0.58);
  font-size: 0.82rem;
}

.active-video-strip strong {
  display: block;
  overflow: hidden;
  margin: 0.1rem 0;
  color: #fff;
  font-size: 0.98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-strip {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
  margin-bottom: 1.25rem;
  padding: 0.8rem;
  border-radius: 14px;
  background: #2b2b2b;
}

.source-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.source-strip-head span,
.source-chip small {
  color: rgba(247, 247, 247, 0.58);
  font-size: 0.82rem;
}

.source-strip-head strong {
  color: #fff;
  font-size: 0.86rem;
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.source-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.55rem;
  align-items: center;
  min-width: min(100%, 14rem);
  max-width: min(100%, 22rem);
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #242424;
}

.source-type,
.rail-project-icon {
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(202, 255, 51, 0.11);
  color: var(--accent);
  font-family: var(--font-output);
  font-size: 0.72rem;
  font-weight: 700;
}

.source-type {
  width: 2.15rem;
  height: 2.15rem;
}

.source-chip > span:last-child {
  min-width: 0;
}

.source-chip strong,
.source-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-chip strong {
  color: #fff;
  font-size: 0.9rem;
}

.rail-project-icon {
  width: 2.35rem;
  height: 2.35rem;
  align-self: center;
}

.chat-console .large-chat-messages {
  display: grid;
  gap: 1.15rem;
  overflow: visible;
  padding: 1rem 0 7rem;
}

.chat-console .large-chat-message {
  max-width: min(100%, 48rem);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 1rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.chat-console .large-chat-message.user {
  justify-self: end;
  max-width: min(82%, 42rem);
  padding: 0.7rem 1rem;
  border-radius: 20px;
  background: #303030;
}

.chat-console .large-chat-message.assistant {
  justify-self: start;
  font-family: var(--font-body);
}

.chat-console .large-chat-message.formatted-answer {
  width: min(100%, 48rem);
}

.chat-composer-wrap {
  width: min(100%, 60rem);
  margin: 0 auto;
  padding: 0 1rem 0.8rem;
}

.chat-composer {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: #2f2f2f;
}

.composer-tool-button {
  display: grid;
  place-items: center;
  width: 2.55rem;
  height: 2.55rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: #252525;
  color: rgba(247, 247, 247, 0.82);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

.composer-tool-button:hover,
.composer-tool-button:focus-visible {
  border-color: rgba(202, 255, 51, 0.32);
  background: rgba(202, 255, 51, 0.1);
  color: var(--accent);
}

.composer-tool-button.loading-button {
  color: transparent;
  pointer-events: none;
}

.composer-tool-button.loading-button > span {
  visibility: hidden;
  padding-left: 0;
}

.composer-tool-button.loading-button::before {
  top: 50%;
  left: 50%;
  width: 1.05rem;
  height: 1.05rem;
  margin: -0.525rem 0 0 -0.525rem;
  border-width: 2px;
}

.chat-composer textarea {
  min-height: 2.55rem;
  max-height: 8rem;
  padding: 0.65rem 0.75rem;
  border: 0;
  background: transparent;
  font-size: 1rem;
  line-height: 1.45;
  resize: none;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(247, 247, 247, 0.32) transparent;
}

.chat-composer textarea::-webkit-scrollbar {
  width: 0.45rem;
}

.chat-composer textarea::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(247, 247, 247, 0.32);
}

.chat-composer textarea:focus {
  box-shadow: none;
}

.chat-composer .accent-button {
  align-self: center;
  min-height: 2.55rem;
  border-radius: 12px;
}

.prompt-bank.compact {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.55rem;
}

.prompt-bank.compact button {
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: #252525;
  font-size: 0.82rem;
}

@media (max-width: 980px) {
  .chat-page {
    overflow: auto;
  }

  .chat-console-page {
    overflow-x: clip;
    overflow-y: auto;
  }

  .chat-console {
    grid-template-columns: 1fr;
    width: 100%;
    height: auto;
    min-height: var(--app-vh);
    overflow-x: clip;
  }

  .chat-rail {
    position: static;
    width: 100%;
    max-height: none;
  }

  .chat-workbench {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  .rail-section {
    max-height: 14rem;
  }

  .chat-page .app-main,
  .chat-page .chat-room,
  .chat-page .chat-stage {
    height: auto;
  }

  .room-grid,
  .workflow-band,
  .workflow-steps,
  .draft-layout,
  .chat-room,
  .workspace-hero,
  .studio-head {
    grid-template-columns: 1fr;
  }

  .studio-panel {
    position: static;
  }
}

@media (max-width: 860px) {
  .chat-rail {
    padding: 0.75rem;
  }

  .chat-stage {
    padding: 0.75rem;
  }

  .source-add-bar {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .source-add-bar input[type="url"],
  .chat-composer textarea,
  .large-chat-question {
    font-size: 16px;
  }

  .prompt-bank.compact {
    flex-wrap: wrap;
  }
}

@media (max-width: 620px) {
  .app-main {
    width: min(100% - 1rem, 1520px);
  }

  .quote-bank,
  .carousel-preview,
  .large-chat-form,
  .source-add-bar {
    grid-template-columns: 1fr;
  }

  .source-add-bar .accent-button {
    margin-bottom: 0;
  }

  .chat-composer {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.4rem;
  }

  .chat-workbench-head {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem;
  }

  .chat-head-actions {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .chat-head-actions .cost-badge {
    max-width: 100%;
    white-space: normal;
  }

  .project-title-row h1 {
    min-width: 0;
  }

  .large-chat-message {
    max-width: 100%;
  }

  .chat-room {
    padding: 0.5rem;
  }

  .project-title {
    font-size: 1.05rem;
  }
}
