:root {
  color-scheme: dark;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  font-synthesis: none;
  color: #fff;
  background: #080808;
  --line: #ffffff19;
  --control-line: #383838;
  --muted: #aaa;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
select {
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  min-height: 40px;
}
button,
summary {
  cursor: pointer;
}
button,
select,
a,
summary {
  touch-action: manipulation;
}
button:disabled,
select:disabled {
  opacity: 0.45;
  cursor: default;
}
button:hover:not(:disabled),
select:hover:not(:disabled) {
  background: #ffffff14;
}
button:active {
  transform: scale(0.97);
}
a {
  color: inherit;
  text-decoration: none;
}
:focus-visible {
  outline: 2px solid #64e4e5;
  outline-offset: 4px;
}
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #111;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 650;
  min-height: 44px;
  white-space: nowrap;
}
.primary:hover:not(:disabled) {
  background: #e5e5e5;
}
.top {
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -1.2px;
}
.brand span {
  font-weight: 400;
  color: var(--muted);
  letter-spacing: -0.5px;
}
.project-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-right: auto;
}
#sessions {
  max-width: 240px;
  min-width: 0;
  color: var(--muted);
}
#new-chat {
  color: var(--muted);
}
.studio {
  height: calc(100dvh - 64px);
  min-height: 420px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
}
.preview {
  min-width: 0;
  min-height: 0;
  background: #111;
}
#preview-area {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#preview-area iframe {
  position: absolute;
  border: 0;
  width: 100%;
  height: 100%;
  background: #fff;
}
#preview-area.phone iframe {
  width: min(390px, 100%);
  height: min(844px, 100%);
}
.preview-empty {
  font-size: 14px;
  color: #777;
  margin: 0;
  padding: 24px;
  text-align: center;
}
.conversation {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 20px 16px 12px;
}
.messages {
  overflow: auto;
  flex: 1;
  min-height: 80px;
  padding: 0 4px 16px;
  scrollbar-width: thin;
}
#composer {
  border: 1px solid var(--control-line);
  border-radius: 10px;
  background: #151515;
  overflow: hidden;
  flex-shrink: 0;
}
#composer:focus-within {
  border-color: #777;
}
textarea {
  display: block;
  width: 100%;
  resize: none;
  min-height: 100px;
  max-height: 220px;
  padding: 14px;
  color: #fff;
  background: transparent;
  border: 0;
  font-size: 14px;
  line-height: 1.6;
}
textarea:focus-visible {
  outline: none;
}
textarea::placeholder {
  color: #aaa;
}
.composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 10px 10px;
}
#stop {
  color: #fff;
}
.settings-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}
#settings-model {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings {
  width: min(480px, calc(100vw - 32px));
  max-height: 85dvh;
  margin: auto;
  padding: 24px;
  background: #111;
  color: #fff;
  border: 1px solid var(--control-line);
  border-radius: 14px;
  font-size: 14px;
}
.settings::backdrop {
  background: #0009;
}
.settings-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.settings-heading h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.settings-panel {
  padding: 0;
  scrollbar-width: thin;
}
.advanced-settings {
  margin-top: 24px;
  color: var(--muted);
}
/* Keep a rendered intersection: fully offscreen frames suspend image-capture animation frames. */
.studio-test-area {
  position: fixed;
  left: 0;
  top: 0;
  opacity: 0;
  transform: scale(0.01);
  transform-origin: top left;
  pointer-events: none;
  overflow: hidden;
}
.studio-test-area iframe {
  border: 0;
  display: block;
}
.connection {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  line-height: 1.6;
}
.connection span {
  color: var(--muted);
  flex: 1;
  min-width: 150px;
}
.connection button,
#key-form button {
  border-color: var(--control-line);
  font-size: 12px;
}
.model-setting,
.preview-setting,
#versions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
}
.model-setting label,
.preview-setting label,
#versions-bar label {
  color: var(--muted);
  white-space: nowrap;
}
#provider,
#model,
#versions {
  min-width: 0;
  flex: 1;
  font-size: 12px;
  background: #151515;
  border-color: var(--control-line);
}
#preview-size {
  margin-left: auto;
}
#key-option {
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
}
#key-form {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
#api-key {
  min-width: 0;
  flex: 1;
  background: #151515;
  color: #fff;
  border: 1px solid var(--control-line);
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
}
#key-option p,
.privacy {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}
#key-option a {
  text-decoration: underline;
}
.privacy {
  margin: 18px 0 0;
}
.status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 4px 2px 0;
  overflow-wrap: anywhere;
}
.status:empty {
  display: none;
}
.status.error {
  color: #ffaba9;
}
.message {
  margin: 0 0 24px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.7;
}
.message .who {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.message.user {
  background: #1b1b1b;
  padding: 12px 14px;
  border-radius: 10px;
}
.message.error {
  color: #ffaba9;
}
.message.pending {
  color: var(--muted);
}
.glop-stopped {
  max-width: 400px;
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.mobile-views {
  display: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1500px) {
  .studio {
    grid-template-columns: minmax(0, 1fr) 400px;
  }
}
@media (max-width: 900px) and (min-width: 701px) {
  .studio {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}
@media (max-width: 700px) {
  .top {
    height: 60px;
    padding: 0 14px;
    gap: 12px;
  }
  .brand {
    font-size: 23px;
    line-height: 1.05;
  }
  .brand span {
    display: block;
    font-size: 12px;
    letter-spacing: 0;
    margin-top: 3px;
  }
  .project-switcher {
    gap: 0;
    flex: 1;
  }
  #sessions {
    width: 100%;
    font-size: 12px;
    padding: 8px 4px;
  }
  #new-chat {
    padding: 8px;
  }
  #review,
  #sign-in,
  #account {
    font-size: 12px;
    padding: 8px 10px;
  }
  .mobile-views {
    display: flex;
    justify-content: center;
    gap: 32px;
    height: 44px;
    border-bottom: 1px solid var(--line);
  }
  .mobile-views button {
    color: var(--muted);
    border-radius: 0;
    padding: 8px 0;
  }
  .mobile-views button[aria-pressed='true'] {
    color: #fff;
    border-bottom: 2px solid #fff;
  }
  .studio {
    display: block;
    height: calc(100dvh - 104px);
    min-height: 360px;
  }
  .preview,
  .conversation {
    height: 100%;
  }
  .conversation {
    border: 0;
    padding: 16px 14px max(12px, env(safe-area-inset-bottom));
  }
  body[data-view='chat'] .preview,
  body[data-view='preview'] .conversation {
    display: none;
  }
  textarea {
    font-size: 16px;
  }
  .settings {
    padding: 20px;
  }
}

.agent-activity {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 20px;
  padding: 12px;
  background: #151515;
  border-radius: 8px;
}
.agent-activity summary {
  cursor: pointer;
  color: #ddd;
}
.agent-activity ol {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}
.agent-activity li {
  display: flex;
  gap: 10px;
  padding: 3px 0;
  overflow-wrap: anywhere;
}
.activity-time {
  flex: 0 0 32px;
  text-align: right;
  color: #777;
  font-variant-numeric: tabular-nums;
}

.agent-activity li > div {
  min-width: 0;
  flex: 1;
}
.agent-activity strong {
  display: block;
  color: #ddd;
  font:
    600 12px ui-monospace,
    monospace;
}
.agent-activity strong:empty {
  display: none;
}
.agent-activity pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    12px/1.6 ui-monospace,
    monospace;
  color: #ccc;
  max-height: 12rem;
  overflow: auto;
}
