:root {
  color-scheme: dark;
  --page: #000;
  --window: #181818;
  --window-border: #3b3b3b;
  --bar: #1b1b1b;
  --bar-line: #2d2d2d;
  --text: #ececec;
  --muted: #a3a3a3;
  --dim: #707070;
  --bubble: #2a2a2a;
  --panel: #262626;
  --panel-2: #2d2d2d;
  --panel-3: #303030;
  --line: #343434;
  --link: #9ccaff;
  --green: #5ccc84;
  --red: #ff5b59;
  --blue: #93c9ff;
  --focus: #6aa6e8;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--page);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 15.5px;
  letter-spacing: 0;
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: var(--link);
  text-decoration: none;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.stage {
  min-height: 100vh;
  padding: clamp(18px, 3.6vh, 42px) clamp(14px, 4.5vw, 58px) clamp(20px, 6vh, 76px);
  display: grid;
  place-items: start center;
  background: #000;
}

.app-window {
  width: min(91vw, 1140px);
  height: min(90vh, 960px);
  min-height: 690px;
  position: relative;
  overflow: hidden;
  background: var(--window);
  border: 1px solid var(--window-border);
  border-radius: 18px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.46);
}

.topbar {
  height: 47px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bar);
  border-bottom: 1px solid var(--bar-line);
  user-select: none;
}

.traffic {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 5px;
}

.dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  display: inline-block;
}

.red {
  background: #ff5f57;
}

.yellow {
  background: #ffcc46;
}

.green {
  background: #63cf6d;
}

.nav-icons,
.window-actions {
  display: flex;
  align-items: center;
  gap: 13px;
}

.window-actions {
  gap: 16px;
}

.topbar h1 {
  margin: 0 0 0 8px;
  font-size: 15px;
  line-height: 1;
  font-weight: 600;
  color: #f4f4f4;
}

.more {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: #909090;
  display: grid;
  place-items: center;
  padding: 0;
  margin-left: 2px;
  cursor: pointer;
}

.spacer {
  flex: 1;
}

.icon-button {
  width: 18px;
  height: 18px;
  border: 0;
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
  color: #a7a7a7;
  cursor: pointer;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.icon-button.dim {
  color: #565656;
}

.icon-button:hover,
.more:hover {
  color: #e8e8e8;
}

.chat-scroller {
  position: absolute;
  inset: 47px 0 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #4a4a4a transparent;
}

.chat-scroller::-webkit-scrollbar {
  width: 10px;
}

.chat-scroller::-webkit-scrollbar-track {
  background: transparent;
}

.chat-scroller::-webkit-scrollbar-thumb {
  background: #3d3d3d;
  border-radius: 999px;
  border: 3px solid var(--window);
}

.thread {
  width: min(730px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 170px;
}

.bubble {
  width: fit-content;
  max-width: 570px;
  background: var(--bubble);
  border-radius: 17px;
  padding: 12px 16px;
  color: #f1f1f1;
  line-height: 1.36;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.015);
}

.bubble p {
  margin: 0;
}

.bubble.user {
  margin-left: auto;
}

.bubble.opening {
  margin-top: 0;
  margin-bottom: 45px;
}

.bubble.short {
  margin-top: 22px;
  margin-bottom: 50px;
}

.bubble.wide {
  margin-top: 45px;
  margin-bottom: 48px;
}

.assistant {
  color: #efefef;
}

.prose {
  line-height: 1.39;
  font-size: 15.5px;
}

.prose + .link-card,
.prose + .diff-card,
.link-card + .diff-card {
  margin-top: 12px;
}

.prose p,
.work-details p {
  margin: 0 0 16px;
}

.prose ul {
  margin: 0 0 19px 21px;
  padding: 0;
}

.prose li {
  margin: 8px 0;
  padding-left: 3px;
}

.intro-copy {
  margin-bottom: 44px;
}

code {
  display: inline-block;
  padding: 0 6px 1px;
  border-radius: 7px;
  background: #303030;
  color: #eeeeee;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.panel {
  position: relative;
  margin: 0 0 35px;
  background: var(--panel);
  border-radius: 13px;
  overflow: hidden;
}

.panel-header {
  height: 44px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header strong {
  font-size: 16px;
  font-weight: 650;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.plan-content {
  padding: 4px 16px 28px;
  line-height: 1.39;
}

.plan-content h2 {
  margin: 6px 0 20px;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0;
}

.plan-content h3 {
  margin: 22px 0 10px;
  font-size: 21px;
  line-height: 1.2;
}

.plan-content p {
  margin: 0 0 18px;
}

.plan-content ul {
  margin: 0 0 18px 20px;
  padding: 0;
}

.plan-content li {
  margin: 8px 0;
  padding-left: 3px;
}

.plan-content li ul {
  margin-top: 6px;
  margin-bottom: 0;
}

.plan-panel.collapsed {
  max-height: 355px;
}

.plan-panel.collapsed .plan-content {
  pointer-events: none;
}

.plan-panel:not(.collapsed) .plan-fade,
.plan-panel:not(.collapsed) .expand-plan {
  display: none;
}

.plan-panel:not(.collapsed) .toggle-plan svg {
  transform: rotate(180deg);
}

.plan-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 130px;
  background: linear-gradient(to bottom, rgba(38, 38, 38, 0), rgba(38, 38, 38, 0.95) 68%, rgba(38, 38, 38, 1));
}

.expand-plan {
  position: absolute;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 2px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #1b1b1b;
  cursor: pointer;
}

.expand-plan span:last-child {
  display: block;
  padding: 3px 12px 4px;
  border-radius: 999px;
  background: #f4f4f4;
  font-size: 14px;
  white-space: nowrap;
}

.round-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #454545;
  border-radius: 999px;
  background: #151515;
  color: #f4f4f4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.36);
}

.work-section {
  margin: 0 0 24px;
  padding-top: 0;
  border-bottom: 1px solid #2b2b2b;
}

.work-toggle {
  width: fit-content;
  min-height: 28px;
  margin: 0 0 8px;
  padding: 0 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 15.5px;
}

.work-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 150ms ease;
}

.work-toggle:hover {
  color: #dadada;
}

.work-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.work-section:not(.collapsed) .work-toggle svg {
  transform: rotate(90deg);
}

.work-details {
  padding: 14px 0 18px;
  display: block;
  color: #eeeeee;
  line-height: 1.39;
}

.work-section.collapsed .work-details {
  display: none;
}

.activity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #777;
  font-weight: 600;
}

.activity svg {
  width: 17px;
  height: 17px;
}

.file-list {
  list-style: disc;
}

.file-list a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a9d2ff;
  font-weight: 600;
}

.file-ico {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  color: #a9d2ff;
  font-size: 12px;
  line-height: 1;
}

.file-ico.hash {
  font-size: 16px;
}

.file-ico.js {
  min-width: 15px;
  height: 13px;
  border-radius: 3px;
  background: #9ccaff;
  color: #17334d;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  font-weight: 700;
}

.blue-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--link);
  font-weight: 600;
}

.link-card {
  min-height: 65px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #383838;
  border-radius: 10px;
  background: #232323;
}

.site-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #111;
  font-size: 21px;
}

.link-card strong {
  display: block;
  font-size: 16px;
}

.link-card span {
  display: block;
  margin-top: 2px;
  color: #a7a7a7;
}

.link-card button,
.diff-controls button,
.review {
  min-height: 30px;
  border: 1px solid #3f3f3f;
  border-radius: 10px;
  background: #252525;
  color: #efefef;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.link-card button svg {
  width: 14px;
  height: 14px;
}

.diff-card {
  overflow: hidden;
  border: 1px solid #383838;
  border-radius: 10px;
  background: #2b2b2b;
}

.diff-card + .bubble,
.diff-card + .work-section,
.diff-card + .prose,
.link-card + .bubble {
  margin-top: 46px;
}

.diff-head {
  min-height: 69px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
}

.diff-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #151515;
  color: #c9c9c9;
}

.diff-icon svg {
  width: 21px;
  height: 21px;
}

.diff-head strong {
  font-size: 16px;
}

.diff-head p {
  margin: 3px 0 0;
}

.add {
  color: var(--green);
}

.remove {
  color: var(--red);
}

.diff-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.diff-controls button:first-child {
  border-color: transparent;
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}

.diff-controls svg {
  width: 15px;
  height: 15px;
}

.file-row,
.details-row {
  width: 100%;
  min-height: 39px;
  border: 0;
  border-top: 1px solid #393939;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: transparent;
  color: #eeeeee;
  cursor: pointer;
  text-align: left;
}

.file-row:hover,
.details-row:hover {
  background: #303030;
}

.file-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.file-row i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--blue);
}

.file-row svg,
.details-row svg {
  width: 15px;
  height: 15px;
  color: #a8a8a8;
}

.diff-details {
  display: none;
  padding: 8px 12px 12px;
  border-top: 1px solid #393939;
  background: #242424;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
}

.diff-card.open .diff-details {
  display: block;
}

.diff-card.open .file-row svg,
.diff-card.open .details-row svg {
  transform: rotate(180deg);
}

.diff-card.compact .diff-head {
  min-height: 66px;
}

.diff-card.last {
  margin-bottom: 20px;
}

.code-block {
  position: relative;
  margin: 12px 0 12px;
  padding: 13px 12px 12px;
  border-radius: 8px;
  background: #2d2d2d;
  color: #f1f1f1;
  overflow-x: auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.code-block span {
  display: block;
  margin-bottom: 13px;
  color: #bbbbbb;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

.code-block code {
  display: block;
  padding: 0;
  border-radius: 0;
  background: transparent;
  white-space: pre;
  font-size: 15px;
}

.code-block em {
  color: #f1a430;
  font-style: normal;
}

.code-block b {
  color: #45b389;
  font-weight: 500;
}

.code-block button {
  position: absolute;
  right: 12px;
  top: 13px;
  width: 21px;
  height: 21px;
  border: 0;
  background: transparent;
  color: #bcbcbc;
  padding: 0;
  cursor: pointer;
}

.scroll-bottom {
  position: absolute;
  left: 50%;
  bottom: 126px;
  z-index: 5;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #363636;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.93);
  color: #f2f2f2;
  transform: translateX(-50%);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.38);
}

.scroll-bottom.hidden {
  opacity: 0;
  pointer-events: none;
}

.composer {
  position: absolute;
  left: 50%;
  bottom: 15px;
  z-index: 4;
  width: min(730px, calc(100% - 48px));
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 18px;
  background: #303030;
  transform: translateX(-50%);
  box-shadow: 0 -18px 42px rgba(24, 24, 24, 0.28);
}

.composer textarea {
  width: 100%;
  min-height: 45px;
  max-height: 150px;
  resize: none;
  border: 0;
  outline: none;
  padding: 14px 14px 2px;
  background: transparent;
  color: #f2f2f2;
  line-height: 1.35;
}

.composer textarea::placeholder {
  color: #888;
}

.composer-bar {
  min-height: 46px;
  padding: 0 8px 8px 12px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.left-tools,
.right-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tool-button,
.permission,
.model,
.send {
  border: 0;
  background: transparent;
  color: #b8b8b8;
  padding: 0;
  cursor: pointer;
}

.tool-button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.permission,
.model {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.permission svg,
.model svg {
  width: 15px;
  height: 15px;
}

.model {
  color: #eeeeee;
}

.send {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #b8b8b8;
  color: #2f2f2f;
}

.send svg {
  width: 19px;
  height: 19px;
}

.send.ready {
  background: #f2f2f2;
  color: #151515;
}

.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;
}

@media (max-width: 760px) {
  .stage {
    padding: 0;
  }

  .app-window {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .topbar {
    padding: 0 10px;
    gap: 9px;
  }

  .traffic {
    gap: 7px;
    margin-right: 1px;
  }

  .dot {
    width: 11px;
    height: 11px;
  }

  .nav-icons {
    gap: 8px;
  }

  .window-actions {
    display: none;
  }

  .topbar h1 {
    margin-left: 2px;
    font-size: 14px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .thread,
  .composer {
    width: calc(100% - 24px);
  }

  .thread {
    padding-top: 24px;
  }

  .bubble,
  .bubble.wide {
    max-width: 88%;
  }

  .panel-actions {
    gap: 10px;
  }

  .plan-content h2 {
    font-size: 21px;
  }

  .plan-content h3 {
    font-size: 18px;
  }

  .link-card {
    grid-template-columns: 36px 1fr;
  }

  .link-card button {
    grid-column: 1 / -1;
    width: fit-content;
    margin-left: 48px;
  }

  .diff-head {
    grid-template-columns: 40px 1fr;
  }

  .diff-controls {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .permission span {
    display: none;
  }

  .model {
    max-width: 124px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-height: 760px) {
  .app-window {
    min-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }

  .stage {
    padding-top: 0;
    padding-bottom: 0;
  }
}
