:root {
  --void: #6b7784;
  --void-2: #3d4650;
  --window: #17181a;
  --panel: #1d1e21;
  --field: #222427;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4f4f5;
  --muted: #8b8e93;
  --ok: #6fbf7a;
  --bad: #e06b5c;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: var(--window);
}

.viewport {
  min-height: 100vh;
  height: 100%;
}

.window {
  width: 100%;
  height: 100vh;
  background: var(--window);
  display: grid;
  grid-template-columns: 72px 1fr;
  overflow: hidden;
}

.window.has-drawer {
  grid-template-columns: 72px 300px 1fr;
}

.icons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 0;
  background: #141516;
  border-right: 1px solid var(--line);
}

.grow {
  flex: 1;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #d6d7d9;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn:hover,
.icon-btn.active {
  background: #2a2c2f;
  color: #fff;
}

.icon-btn.logo {
  background: #2a2c2f;
  border-radius: 999px;
  margin-bottom: 8px;
}

.drawer {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 28px 22px;
  overflow: auto;
}

.drawer[hidden] {
  display: none;
}

.panel h2 {
  margin: 0 0 18px;
  font-family: "Instrument Serif", serif;
  font-size: 28px;
  font-weight: 400;
}

.panel label,
.panel .label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.22);
}

button.primary,
button.ghost {
  margin-top: 12px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  cursor: pointer;
}

button.primary {
  background: #fff;
  color: #111;
  font-weight: 600;
}

button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.sites {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sites button {
  text-align: left;
  background: var(--field);
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
}

.sites button.active,
.sites button:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.sites small,
.sites .empty {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.connect {
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
}

.connect ol {
  padding-left: 18px;
}

.connect code,
code {
  font-size: 11px;
  color: #e8e8ea;
  word-break: break-all;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.list li[data-status="completed"] {
  color: var(--ok);
}

.list li[data-status="in_progress"] {
  color: #f2d083;
}

.health p {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #555;
}

.dot.on {
  background: var(--ok);
}

.dot.off {
  background: var(--bad);
}

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hero {
  margin: auto;
  width: min(720px, calc(100% - 80px));
  text-align: center;
  padding: 24px 0 80px;
}

.stage.is-chatting .hero {
  margin: 0 auto;
  padding: 28px 0 8px;
}

.hero h1 {
  margin: 0 0 28px;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(34px, 4.4vw, 52px);
  font-weight: 400;
  letter-spacing: -0.03em;
}

.composer {
  text-align: left;
  background: var(--field);
  border-radius: 22px;
  padding: 16px 16px 12px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.28);
}

.composer textarea {
  border: 0;
  background: transparent;
  min-height: 56px;
  resize: none;
  padding: 4px 6px 12px;
  font-size: 15px;
}

.composer textarea:focus {
  outline: none;
}

.composer-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.circle,
.send {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #2d2f33;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.circle svg,
.send svg {
  width: 18px;
  height: 18px;
}

.send {
  background: #3a3d42;
}

.model {
  color: var(--muted);
  font-size: 13px;
}

.model select {
  width: auto;
  border: 0;
  background: transparent;
  padding: 6px 4px;
  color: var(--muted);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%238b8e93' d='M1 1.2 6 6.2 11 1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  padding-right: 18px;
}

.log {
  flex: 1;
  overflow: auto;
  padding: 8px 56px 32px;
  display: none;
  flex-direction: column;
  gap: 16px;
}

.stage.is-chatting .log {
  display: flex;
}

.bubble {
  max-width: 68ch;
}

.bubble.user {
  margin-left: auto;
  background: var(--field);
  border-radius: 16px;
  padding: 12px 14px;
}

.bubble.status {
  color: var(--muted);
  font-size: 13px;
}

.bubble .who {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 6px;
}

.banner {
  margin: 16px 24px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(224, 107, 92, 0.12);
  color: #f0c2bc;
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.status {
  color: var(--ok);
}

@media (max-width: 820px) {
  .window,
  .window.has-drawer {
    grid-template-columns: 64px 1fr;
  }

  .drawer {
    position: absolute;
    inset: 0 0 0 64px;
    z-index: 2;
  }
}
