.cloud-page {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface-page);
}
.cloud-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  min-height: 56px;
  padding: .5rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.cloud-brand { justify-self: start; color: var(--text-primary); text-decoration: none; font-size: 1.55rem; font-weight: 700; letter-spacing: -.055em; }
.cloud-brand span { margin-left: .18em; color: #aaa; font-size: .43em; vertical-align: .18em; }
.cloud-topbar-title { color: var(--text-primary); font-size: .875rem; font-weight: 550; }
.cloud-muted { color: var(--text-secondary); font-size: .9rem; line-height: 1.5; }
.cloud-button, .cloud-primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .25rem;
  min-height: var(--control-height);
  padding: .3rem .7rem;
  border: 1px solid var(--control-border);
  border-radius: var(--control-radius);
  background: var(--control-bg);
  color: var(--control-ink);
  font-size: .875rem;
  font-weight: 550;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.cloud-button:hover:not(:disabled) { background: var(--control-hover); }
.cloud-primary { color: #fff; background: #292929; border-color: #292929; }
.cloud-primary { min-height: 2.65rem; padding: .6rem 1rem; }
.cloud-primary:hover:not(:disabled) { background: #414141; }
.cloud-gate { display: grid; min-height: 0; }
.cloud-gate { flex: 1; }
.cloud-welcome { align-self: center; justify-self: center; margin: 1rem; padding: 2rem; max-width: 29rem; text-align: center; }
.cloud-welcome h1 { font-size: clamp(1.65rem, 3vw, 2.2rem); font-weight: 650; letter-spacing: -.04em; line-height: 1.2; }
.cloud-welcome p { margin-top: .65rem; }
.cloud-welcome :is(.cloud-primary, .cloud-button) { margin-top: 1.3rem; }
.cloud-primary:disabled:disabled { opacity: .55; }
.cloud-app { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* The hosted adapter supplies cloud chats inside the shared Bytes navigation. */
.cloud-shell { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.cloud-shell.workspace-open { grid-template-columns: var(--sidebar-w) minmax(0, 46fr) minmax(0, 54fr); }
.cloud-sidebar { overflow-y: auto; }
.cloud-sidebar > :not(#cloud-threads) { flex: none; }
.cloud-sidebar .sidebar-heading { justify-content: flex-start; }
.cloud-sidebar #cloud-new-chat { display: inline-flex; align-items: center; gap: 6px; width: auto; margin-right: auto; padding: 0 6px; font-size: 13px; white-space: nowrap; }
.cloud-sidebar #cloud-new-chat[aria-disabled="true"] { opacity: .5; }
.cloud-chats-label { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
#cloud-threads { min-height: min(6rem, 25vh); overflow-y: auto; }
#cloud-threads .agent-button { text-decoration: none; }
#cloud-list-status:empty { display: none; }
#cloud-main { grid-column: 2; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#cloud-conversation { min-height: 0; }
#cloud-conversation .agent-trigger { cursor: default; }
#cloud-conversation #agent-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#cloud-files { grid-column: 3; grid-row: 1; }
.cloud-shell.workspace-open > #cloud-files { display: flex; }
#cloud-files .workspace-tabs-cluster { min-width: 0; }
#cloud-file-control,
#cloud-files .cloud-file-list .secondary { width: auto; flex: none; text-decoration: none; }
#cloud-no-messages { margin: 1rem auto; text-align: center; }
#cloud-notice { color: var(--destructive); }
.cloud-notice { margin: .25rem 0 .5rem; padding: .5rem .65rem; color: var(--destructive); background: var(--bad-bg); border-radius: var(--control-radius); font-size: .9rem; }
.cloud-dialog { width: min(29rem, calc(100% - 2rem)); padding: 1.4rem; border: 1px solid var(--border-control); border-radius: 1rem; background: var(--surface-page); color: var(--text-primary); box-shadow: var(--shadow); }
.cloud-dialog::backdrop { background: rgb(0 0 0 / .28); }
.cloud-dialog h2 { margin-bottom: .7rem; font-size: 1.2rem; font-weight: 650; }
.cloud-dialog p + p { margin-top: .55rem; }
.cloud-dialog label { display: block; margin-bottom: .25rem; font-weight: 550; }
.cloud-dialog :is(input, textarea) { width: 100%; margin-bottom: .7rem; padding: .5rem .65rem; border: 1px solid var(--border-control); border-radius: var(--control-radius); background: var(--surface-page); font-size: max(16px, 1rem); }
.cloud-dialog textarea { display: block; resize: vertical; max-height: 33dvh; }
.cloud-dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
@media (max-width: 780px) {
  .cloud-shell, .cloud-shell.workspace-open { grid-template-columns: minmax(0, 1fr); }
  .cloud-shell.workspace-open { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
  #cloud-main { grid-column: 1; grid-row: 1; }
  #cloud-files { position: relative; inset: auto; width: auto; height: auto; grid-column: 1; grid-row: 2; margin: 0 10px 10px; }
  .cloud-shell.workspace-open .composer-wrap textarea { min-height: 38px; }
  .cloud-shell.show-agents #app-show-navigation { visibility: hidden; }
  .cloud-sidebar #cloud-new-chat, #cloud-refresh { min-height: 44px; }
  #cloud-refresh { width: 44px; }
}
@media (max-width: 480px) {
  .cloud-topbar { grid-template-columns: 1fr auto; padding-inline: .7rem; }
  .cloud-topbar-title { display: none; }
  .cloud-button { min-height: 2.45rem; }
}
