:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #26272b;
  background: #fff;
  font-size: 14px;
  --muted: #727579;
  --line: #e7e8e8;
  --red: #e53946;
  --mint: #e5f4ed;
}
* {
  box-sizing: border-box;
  letter-spacing: 0;
}
body {
  margin: 0;
}
button,
a,
input,
textarea,
select {
  font: inherit;
}
button,
a {
  color: inherit;
}
button {
  cursor: pointer;
  border: 1px solid #dcdfdf;
  border-radius: 6px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 550;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover {
  background: #f2f3f3;
  border-color: #bfc3c3;
}
button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}
svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
button[aria-pressed="true"] {
  background: var(--mint);
  color: #22664b;
  border-color: #aad7c0;
}
.primary {
  background: var(--red);
  border-color: var(--red);
  color: white;
}
.primary:hover {
  background: #c92c3b;
  border-color: #c92c3b;
}
.secondary {
  background: #fff;
}
.text-button {
  background: none;
  border: 0;
  padding: 0;
  min-height: 25px;
  color: #bc2937;
  font-size: 12px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
[hidden] {
  display: none !important;
}
h1,
h2,
p {
  margin: 0;
}
header {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.brand {
  display: flex;
  align-items: baseline;
  text-decoration: none;
  font-size: 31px;
  font-weight: 850;
  color: var(--red);
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
}
.brand span {
  color: #26272b;
  font-size: 19px;
  font-weight: 700;
}
.header-label {
  border-left: 1px solid var(--line);
  padding-left: 22px;
  color: var(--muted);
  font-size: 12px;
}
.connection {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.connection::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b7bbba;
  flex-shrink: 0;
}
.connection.online::before {
  background: #37946a;
}
main {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  height: calc(100dvh - 72px);
  min-height: 600px;
}
.chat-panel {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 26px 22px 0;
  background: #fff;
}
.panel-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}
h1 {
  font-size: 20px;
  font-weight: 650;
  line-height: 1.4;
}
.model-label {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: center;
}
.model-label::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--red);
  border-radius: 50%;
}
.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}
.conversation {
  flex: 1;
  min-height: 100px;
  overflow: auto;
  padding: 24px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.message {
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.message.user {
  background: #f4f5f5;
  padding: 12px;
  border-radius: 6px;
}
.message.assistant {
  color: #555b59;
  padding: 0 2px;
}
.message-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 7px;
  color: #bd3441;
}
.message.user .message-label {
  color: #7b8080;
}
.suggestions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  margin-top: 2px;
}
.suggestions button {
  text-align: left;
  justify-content: space-between;
  line-height: 1.6;
  font-size: 12px;
  font-weight: 400;
  padding: 12px;
  color: #5d6262;
}
.suggestions button::after {
  content: "+";
  color: #a0a5a3;
  font-size: 18px;
  margin-left: 8px;
}
.error {
  color: #a52535;
  background: #fff0f1;
  border: 1px solid #f0c6ca;
  padding: 10px;
  margin: 10px 0;
  border-radius: 5px;
  line-height: 1.5;
  max-height: 110px;
  overflow: auto;
  overflow-wrap: anywhere;
}
#composer {
  border: 1px solid #d8dcda;
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  flex-shrink: 0;
  box-shadow: 0 3px 12px #17251d06;
}
#composer:focus-within {
  border-color: #e9757e;
  box-shadow: 0 0 0 3px #e5394609;
}
textarea {
  width: 100%;
  border: 0;
  resize: none;
  outline: none;
  background: transparent;
  color: #292d2b;
  font-size: 13px;
  line-height: 1.6;
  min-height: 80px;
}
textarea::placeholder {
  color: #8a908d;
}
.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.composer-footer > span {
  font-size: 10px;
  color: var(--muted);
}
.job-controls {
  min-height: 37px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}
.history-heading {
  border-top: 1px solid var(--line);
  padding: 16px 0 9px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}
.history-heading h2 {
  font-size: 11px;
  font-weight: 600;
}
.history-heading span {
  font-size: 11px;
}
.versions {
  max-height: 170px;
  min-height: 50px;
  overflow: auto;
  padding-bottom: 15px;
}
.versions:empty::after {
  content: "No versions yet";
  display: block;
  padding: 10px 0;
  font-size: 11px;
  color: #919794;
}
.version {
  width: 100%;
  background: none;
  border: 0;
  border-radius: 4px;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px;
  text-align: left;
  margin: 3px 0;
}
.version.active {
  background: var(--mint);
}
.version img {
  width: 42px;
  height: 32px;
  object-fit: cover;
  border-radius: 3px;
}
.version div {
  min-width: 0;
  flex: 1;
}
.version strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 550;
}
.version small,
.version .version-state {
  font-size: 10px;
  color: #6a7770;
}
.workspace {
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: #fafbfa;
}
.workspace-heading {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-shrink: 0;
}
.workspace-heading > div:first-child {
  min-width: 0;
}
.eyebrow {
  display: block;
  color: #888f8a;
  font-size: 9px;
  margin-bottom: 8px;
  font-weight: 600;
}
.workspace-heading h2 {
  font-size: 16px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-weight: 600;
}
.workspace-actions {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
}
#export {
  width: 36px;
  padding: 0;
}
.studio-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 18px;
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
  padding: 11px 0 14px;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.transfer-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
}
.transfer-heading strong {
  font-size: 12px;
  line-height: 1.4;
  color: #3f4742;
}
.transfer-heading button {
  margin-left: auto;
  width: 30px;
  min-height: 30px;
  height: 30px;
  padding: 0;
  flex-shrink: 0;
}
#transfer-indicator {
  width: 8px;
  height: 8px;
  border: 2px solid #a9b4ac;
  border-radius: 50%;
  flex-shrink: 0;
}
[data-tone="working"] #transfer-indicator {
  border-color: #ebc2c5;
  border-top-color: var(--red);
  animation: spin 0.8s linear infinite;
}
[data-tone="success"] #transfer-indicator {
  background: #37946a;
  border-color: #37946a;
}
[data-tone="waiting"] #transfer-indicator {
  background: #c69b34;
  border-color: #c69b34;
}
[data-tone="error"] #transfer-indicator {
  background: var(--red);
  border-color: var(--red);
}
[data-tone="error"] .transfer-heading strong {
  color: #b62a38;
}
#transfer-detail {
  line-height: 1.5;
  margin: 2px 0 0 16px;
  grid-column: 1;
}
#transfer-version {
  font-size: 10px;
  color: #6f7a72;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  grid-column: 1 / -1;
}
#transfer-version:empty {
  display: none;
}
#studio-context-status {
  grid-column: 1;
  margin: 5px 0 0 16px;
  font-size: 10px;
}
#clear-studio-context {
  grid-column: 2;
  grid-row: 3;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
}
.transfer-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-column: 1 / -1;
  list-style: none;
  gap: 8px;
  padding: 0;
  margin: 12px 0 0;
  font-size: 9px;
}
.transfer-steps li {
  border-top: 2px solid #dce3dd;
  padding-top: 5px;
  color: #77837a;
}
.transfer-steps li.complete {
  border-color: #64ad87;
}
.transfer-steps li.current {
  color: #99303a;
  border-color: var(--red);
}
[data-tone="success"] .transfer-steps li.current {
  border-color: #64ad87;
  color: #2e7351;
}
.viewport {
  position: relative;
  flex: 1;
  min-height: 250px;
  background: #edf0ed;
  overflow: hidden;
  border-radius: 0;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #59665d;
  pointer-events: none;
}
.empty-mark {
  margin-bottom: 18px;
  color: #cd535c;
}
.empty svg {
  width: 56px;
  height: 56px;
  stroke-width: 1;
}
.empty h2 {
  font-size: 19px;
  font-weight: 500;
  text-align: center;
  padding: 0 20px;
}
.viewer-tools {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 5px;
}
.viewer-tools button {
  background: #ffffffed;
  color: #506358;
  border-color: #dbe1dc;
  width: 36px;
  height: 36px;
  padding: 0;
}
.viewer-tools button[aria-pressed="true"] {
  background: #d7eee0;
  color: #215c3d;
}
.viewport-label {
  position: absolute;
  bottom: 17px;
  left: 18px;
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 10px;
  color: #596c5f;
}
.status-dot {
  width: 6px;
  height: 6px;
  background: #4b8965;
  border-radius: 50%;
}
.loading {
  position: absolute;
  bottom: 45px;
  right: 16px;
  left: 16px;
  width: fit-content;
  max-width: calc(100% - 32px);
  display: flex;
  align-items: center;
  gap: 9px;
  background: #262d29ef;
  padding: 10px 15px;
  border-radius: 5px;
  color: #fff;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.spinner {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 2px solid #788d7e;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.metrics {
  height: 68px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  flex-shrink: 0;
}
.metrics div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-left: 1px solid var(--line);
  padding-left: 20px;
}
.metrics div:first-child {
  padding-left: 0;
  border: 0;
}
.metrics span {
  font-size: 10px;
  color: var(--muted);
}
.metrics strong {
  font-size: 13px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}
dialog {
  background: #fff;
  color: #303733;
  border: 1px solid #dce1de;
  border-radius: 8px;
  width: 460px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 32px);
  padding: 24px;
  box-shadow: 0 20px 80px #1d30282b;
}
dialog::backdrop {
  background: #1d272466;
}
.dialog-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.dialog-title h2 {
  font-size: 19px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.dialog-title h2 svg {
  color: var(--red);
}
.dialog-title button {
  border: 0;
  background: none;
  padding: 5px;
  flex-shrink: 0;
}
.export-options,
.studio-setup {
  display: flex;
  flex-direction: column;
}
.studio-setup {
  gap: 12px;
}
.studio-setup label {
  display: block;
  font-size: 12px;
  margin-bottom: 8px;
}
.pair-row {
  display: flex;
  gap: 8px;
}
.pair-row input {
  min-width: 0;
  width: 100%;
  padding: 8px;
  background: #f8faf8;
  color: #29332d;
  border: 1px solid #cfd7d1;
  border-radius: 4px;
  font-size: 12px;
}
#confirm-send,
#copy-materials {
  width: 100%;
}
.export-option {
  padding: 15px 0;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.export-option:hover {
  color: #b93240;
}
.export-option div {
  flex: 1;
  min-width: 0;
}
.export-option strong {
  display: block;
  font-size: 14px;
  font-weight: 550;
}
.export-option span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
.export-note {
  color: #727d75;
  line-height: 1.6;
  font-size: 12px;
  margin: 16px 0;
  overflow-wrap: anywhere;
}
#coding-dialog {
  width: min(760px, calc(100vw - 24px));
}
#mixed-dialog { width: min(640px, calc(100vw - 24px)); }
#mixed-form label { display: block; font-size: 12px; margin: 16px 0 8px; }
#mixed-form textarea { border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: #fafbfa; }
.mixed-plan { padding-left: 20px; font-size: 12px; line-height: 1.8; }
#mixed-project { border-top: 1px solid var(--line); padding: 12px 0; font-size: 12px; flex-shrink: 0; }
#mixed-status { margin: 8px 0; line-height: 1.5; }
.workspace-actions { flex-wrap: wrap; max-width: 100%; }
.code-examples { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.code-examples button { font-size: 12px; }
#coding-advanced { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; margin-top: 16px; }
#coding-advanced > summary { cursor: pointer; font-size: 12px; color: var(--muted); }
#coding-connect { margin-bottom: 14px; }
#coding-estimate:empty { display: none; }
#coding-dialog label {
  font-size: 12px;
  display: block;
  margin: 12px 0 6px;
}
#coding-dialog input[type="checkbox"] {
  accent-color: var(--red);
}
#coding-prompt {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  border: 1px solid #d6dcd7;
  background: #fafbfa;
  border-radius: 6px;
  padding: 12px;
  margin: 4px 0 10px;
}
#coding-context-mode,
#coding-budget {
  display: block;
  width: 100%;
  min-height: 38px;
  margin: 6px 0 12px;
  background: #fafbfa;
  color: #303a33;
  border: 1px solid #d6dcd7;
  border-radius: 4px;
  padding: 6px 10px;
}
#studio-error-text {
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.code-proposal {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 20px;
}
.code-proposal h3 {
  font-size: 15px;
  overflow-wrap: anywhere;
}
.code-proposal pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 300px;
  overflow: auto;
  font-size: 12px;
  background: #f3f6f3;
  padding: 12px;
  border-radius: 4px;
}
.code-proposal summary {
  cursor: pointer;
  overflow-wrap: anywhere;
  padding: 10px 0;
  font-size: 12px;
}
.code-proposal p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
  font-size: 12px;
  margin-bottom: 12px;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 1100px) {
  main {
    grid-template-columns: 310px minmax(0, 1fr);
  }
  .chat-panel {
    padding: 22px 16px 0;
  }
  .workspace {
    padding: 0 18px;
  }
  .workspace-heading {
    padding: 16px 0;
    flex-wrap: wrap;
    gap: 12px;
  }
  .workspace-actions {
    margin-left: auto;
  }
  .header-label {
    display: none;
  }
}
@media (max-width: 700px) {
  header {
    height: 64px;
    padding: 0 16px;
    gap: 12px;
  }
  .brand {
    font-size: 26px;
  }
  .brand span {
    font-size: 16px;
  }
  .connection {
    font-size: 10px;
    max-width: 105px;
  }
  header button {
    font-size: 0;
    width: 36px;
    padding: 0;
    flex-shrink: 0;
  }
  main {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
  }
  .workspace {
    padding: 0 14px;
    height: 680px;
    min-height: 0;
  }
  .workspace-heading {
    min-height: 108px;
    gap: 10px;
  }
  .workspace-heading > div:first-child {
    width: 100%;
  }
  .workspace-heading h2 {
    font-size: 15px;
  }
  .workspace-actions {
    margin-left: 0;
  }
  .viewport {
    min-height: 280px;
  }
  .metrics {
    height: 64px;
  }
  .metrics div {
    padding-left: 10px;
  }
  .metrics span {
    font-size: 9px;
  }
  .metrics strong {
    font-size: 12px;
  }
  .chat-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 22px 18px 0;
    min-height: 470px;
  }
  .panel-heading {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  h1 {
    font-size: 18px;
  }
  .conversation {
    max-height: 270px;
  }
  .versions {
    max-height: 160px;
  }
  dialog {
    padding: 18px;
  }
}
