.serve-section {
  width: min(var(--maxw), calc(100% - 24px));
  margin: 0 auto;
  padding: 0 0 12px;
  scroll-margin-top: 64px;
}

.serve-section-header {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 12px;
  margin-bottom: 12px;
}

.serve-section-title,
.serve-section-copy {
  min-height: 250px;
  padding: clamp(22px, 3vw, 34px);
  background-color: var(--surface);
  background-image: var(--panel-sheen);
  transition: background-color .16s ease, color .16s ease;
}

.serve-section-title {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.serve-section-title .kicker {
  margin-bottom: 28px;
}

.serve-section-title h2 {
  flex: 0 0 auto;
  margin: auto 0 0;
  font-family: var(--display);
  font-size: clamp(38px, 4.7vw, 70px);
  font-weight: var(--display-weight);
  line-height: .9;
  letter-spacing: var(--display-tracking);
}

.serve-section-copy {
  display: flex;
  flex-direction: column;
  background-color: var(--raised);
}

.serve-section-copy > p {
  max-width: 65ch;
  margin: 0;
  color: var(--soft);
  font-family: var(--sans);
  font-size: clamp(14px, 1.08vw, 17px);
  line-height: 1.55;
}

.serve-principles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  color: var(--fg);
  font-family: var(--mono);
  list-style: none;
}

.serve-principles li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.serve-principles li::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--model-color);
  content: "";
}

.serve-section-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: auto;
  padding-top: 24px;
}

.serve-install-command {
  min-width: 0;
  min-height: 50px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 0;
  border-radius: 2px;
  background: #0d1217;
  color: #d1ebf7;
  cursor: pointer;
  font-family: var(--mono);
  text-align: left;
}

.serve-install-command code {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: var(--type-small);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.serve-install-command code b {
  color: #778792;
  font-weight: 400;
}

.serve-install-command .copy-label {
  color: #a7b9c3;
}

.serve-install-command.is-copied .copy-label {
  color: #72d798;
}

.serve-section-actions > a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--soft);
  font-family: var(--mono);
  text-decoration: none;
  white-space: nowrap;
}

.serve-section-actions > a:hover {
  color: var(--fg);
}

.serve-demo-card {
  --serve-bg: #202124;
  --serve-sidebar: #191a1d;
  --serve-raised: #2b2d32;
  --serve-hover: rgba(255, 255, 255, .065);
  --serve-selected: rgba(255, 255, 255, .105);
  --serve-line: rgba(255, 255, 255, .085);
  --serve-text: #ececef;
  --serve-soft: #b2b4ba;
  --serve-faint: #777a82;
  --serve-green: #52c77b;
  --serve-amber: #d9a557;
  --serve-focus: #7aa2f7;
  --serve-accent: #9f78e8;
  --serve-ui: var(--font-local-sans, "Local Grotesk", ui-sans-serif, system-ui, sans-serif);
  --serve-code: var(--font-local-mono, "Local Mono", ui-monospace, monospace);
  height: min(654px, max(480px, calc(100svh - 120px)));
  display: grid;
  grid-template-rows: 42px minmax(0, 1fr) 46px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--serve-bg);
  color: var(--serve-text);
  color-scheme: dark;
  font-family: var(--serve-ui);
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 18px 48px rgba(13, 18, 23, .16);
}

.serve-demo-card button,
.serve-demo-card textarea {
  color: inherit;
  font: inherit;
}

.serve-demo-card button {
  border: 0;
}

.serve-demo-card button:focus-visible,
.serve-demo-card textarea:focus-visible {
  outline: 2px solid var(--serve-focus);
  outline-offset: 2px;
}

.serve-browserbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 14px;
  border-bottom: 1px solid var(--serve-line);
  background: #141518;
  color: var(--serve-faint);
  font-family: var(--serve-code);
  font-size: 11px;
}

.serve-window-controls {
  display: flex;
  gap: 6px;
}

.serve-window-controls i {
  width: 7px;
  height: 7px;
  display: block;
  border-radius: 50%;
  background: #53565e;
}

.serve-window-controls i:nth-child(2) { opacity: .72; }
.serve-window-controls i:nth-child(3) { opacity: .48; }

.serve-loopback {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--serve-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .025);
}

.serve-loopback > i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--serve-green);
  box-shadow: 0 0 0 3px rgba(82, 199, 123, .11);
}

.serve-loopback code {
  color: var(--serve-text);
  font: inherit;
}

.serve-loopback span {
  color: var(--serve-soft);
}

.serve-browser-label {
  justify-self: end;
}

.serve-workbench {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 236px minmax(360px, 1fr) 306px;
  overflow: hidden;
}

.serve-sidebar {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--serve-line);
  background: var(--serve-sidebar);
}

.serve-sidebar-brand {
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 16px;
}

.serve-sidebar-brand strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.03em;
}

.serve-sidebar-brand span {
  color: var(--serve-faint);
  font-family: var(--serve-code);
  font-size: 10px;
}

.serve-new-session {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 9px 8px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--serve-selected);
  cursor: pointer;
  text-align: left;
}

.serve-new-session:hover {
  background: rgba(255, 255, 255, .14);
}

.serve-new-session > span {
  color: var(--serve-soft);
  font-size: 17px;
  line-height: 1;
}

.serve-sidebar-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 0 9px 10px;
  color: var(--serve-soft);
  font-size: 12px;
}

.serve-sidebar-tabs span {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 7px;
}

.serve-sidebar-tabs span:first-child {
  background: var(--serve-hover);
  color: var(--serve-text);
}

.serve-sidebar-heading {
  display: flex;
  justify-content: space-between;
  padding: 7px 15px 8px;
  color: var(--serve-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.serve-session-list {
  display: grid;
  gap: 3px;
  padding: 0 9px;
}

.serve-session-list button {
  min-width: 0;
  min-height: 54px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.serve-session-list button:hover {
  background: var(--serve-hover);
}

.serve-session-list button[aria-pressed="true"] {
  background: var(--serve-selected);
}

.serve-session-list button > i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--serve-faint);
}

.serve-session-list button[aria-pressed="true"] > i {
  background: var(--serve-accent);
  box-shadow: 0 0 0 3px rgba(159, 120, 232, .12);
}

.serve-session-list button > span {
  min-width: 0;
  overflow: hidden;
  color: var(--serve-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.serve-session-list button[aria-pressed="true"] > span {
  color: var(--serve-text);
}

.serve-session-list small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--serve-faint);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.serve-sidebar-footer {
  display: grid;
  gap: 1px;
  margin-top: auto;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--serve-line);
  color: var(--serve-soft);
}

.serve-sidebar-footer span {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 0 9px;
}

.serve-session-column {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--serve-bg);
}

.serve-session-header {
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--serve-line);
}

.serve-breadcrumb {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.serve-breadcrumb > span,
.serve-breadcrumb > i {
  flex: 0 0 auto;
  color: var(--serve-faint);
  font-style: normal;
}

.serve-breadcrumb strong {
  min-width: 0;
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.serve-session-status {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 7px;
  background: rgba(82, 199, 123, .08);
  color: var(--serve-green);
  font-size: 11px;
}

.serve-demo-card[data-demo-state="working"] .serve-session-status {
  background: rgba(217, 165, 87, .1);
  color: var(--serve-amber);
}

.serve-demo-card[data-demo-state="ready"] .serve-session-status {
  background: var(--serve-hover);
  color: var(--serve-soft);
}

.serve-simulation-label {
  min-height: 27px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  background: rgba(217, 165, 87, .09);
  color: #d9ad6b;
  font-size: 10px;
  text-align: center;
}

.serve-transcript {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 30px clamp(20px, 3vw, 42px) 20px;
  scrollbar-width: thin;
}

.serve-turn-part {
  animation: serve-turn-in .28s ease-out both;
}

.serve-demo-card.is-js .serve-turn-part:not(.is-visible) {
  display: none;
}

@keyframes serve-turn-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

.serve-user-message {
  width: fit-content;
  max-width: 78%;
  margin-left: auto;
  padding: 11px 14px;
  border-radius: 17px 17px 4px 17px;
  background: var(--serve-raised);
  color: var(--serve-text);
}

.serve-agent-lead,
.serve-agent-answer {
  max-width: 72ch;
  margin: 28px 0 0;
  color: #dadbe0;
  line-height: 1.55;
}

.serve-run-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  margin-top: 30px;
  color: var(--serve-soft);
}

.serve-run-row strong {
  font-weight: 450;
}

.serve-run-row > span:last-child {
  color: var(--serve-faint);
}

.serve-run-state {
  color: var(--serve-green);
  font-family: var(--serve-code);
}

.serve-run-state.is-running {
  width: 11px;
  height: 11px;
  display: block;
  border: 1px solid rgba(217, 165, 87, .26);
  border-top-color: var(--serve-amber);
  border-radius: 50%;
  color: transparent;
  animation: serve-spin .8s linear infinite;
}

@keyframes serve-spin { to { transform: rotate(360deg); } }

.serve-composer {
  min-height: 104px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  margin: 0 16px 16px;
  overflow: hidden;
  border: 1px solid var(--serve-line);
  border-radius: 12px;
  background: var(--serve-raised);
}

.serve-composer:focus-within {
  border-color: rgba(122, 162, 247, .48);
}

.serve-composer textarea {
  width: 100%;
  min-height: 56px;
  flex: 1 1 auto;
  resize: none;
  padding: 13px 15px 6px;
  border: 0;
  outline: 0;
  background: transparent;
  line-height: 1.45;
}

.serve-composer textarea::placeholder {
  color: var(--serve-faint);
}

.serve-composer textarea[readonly] {
  cursor: default;
}

.serve-composer-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 40px;
  padding: 4px 10px 8px 14px;
  color: var(--serve-faint);
  font-size: 10px;
  white-space: nowrap;
}

.serve-composer-meta [data-serve-model] {
  color: var(--serve-soft);
}

.serve-composer-meta [data-serve-budget] {
  margin-left: auto;
}

.serve-composer-meta button {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f4f4f5;
  color: #1c1d20;
  cursor: pointer;
  font-size: 16px;
}

.serve-composer-meta button:hover {
  background: #fff;
  transform: translateY(-1px);
}

.serve-composer-meta button:disabled {
  cursor: default;
  opacity: .38;
  transform: none;
}

.serve-activity {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-left: 1px solid var(--serve-line);
  background: #18191c;
  scrollbar-width: thin;
}

.serve-activity > header {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  border-bottom: 1px solid var(--serve-line);
}

.serve-activity > header strong {
  font-size: 13px;
}

.serve-activity > header span {
  color: var(--serve-faint);
  font-size: 10px;
}

.serve-activity section {
  padding: 16px 14px 3px;
}

.serve-activity h3 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 12px;
  font-size: 12px;
}

.serve-activity h3 span {
  color: var(--serve-faint);
  font-size: 10px;
  font-weight: 400;
}

.serve-progress {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  color: var(--serve-soft);
  list-style: none;
}

.serve-progress li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
}

.serve-progress i {
  color: var(--serve-faint);
  font-family: var(--serve-code);
  font-style: normal;
}

.serve-progress li.is-complete i {
  color: var(--serve-green);
}

.serve-progress li.is-running i {
  color: var(--serve-amber);
  animation: serve-pulse .9s ease-in-out infinite;
}

@keyframes serve-pulse { 50% { opacity: .32; } }

.serve-activity-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 0;
}

.serve-activity-item > i {
  color: var(--serve-soft);
  font-style: normal;
}

.serve-activity-item > span,
.serve-context-list > span {
  min-width: 0;
}

.serve-activity-item strong,
.serve-activity-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.serve-activity-item strong {
  font-weight: 450;
}

.serve-activity-item small {
  margin-top: 1px;
  color: var(--serve-faint);
  font-family: var(--serve-code);
  font-size: 9px;
}

.serve-context-list {
  display: grid;
  gap: 9px;
}

.serve-context-list > span {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
}

.serve-context-list i {
  color: var(--serve-faint);
  font-style: normal;
}

.serve-context-list b {
  overflow: hidden;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.serve-demo-footer {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 12px 0 15px;
  border-top: 1px solid var(--serve-line);
  background: #141518;
  color: var(--serve-faint);
  font-family: var(--serve-code);
  font-size: 10px;
}

.serve-demo-footer p {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.serve-demo-footer p > i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--serve-green);
}

.serve-demo-footer strong {
  color: var(--serve-soft);
  font-weight: 400;
}

.serve-demo-footer button {
  min-height: 32px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border-radius: 7px;
  background: var(--serve-hover);
  color: var(--serve-soft);
  cursor: pointer;
  font-family: var(--serve-code);
  font-size: 10px;
}

.serve-demo-footer button:hover {
  background: var(--serve-selected);
  color: var(--serve-text);
}

@media (max-width: 1120px) {
  .serve-workbench {
    grid-template-columns: 210px minmax(330px, 1fr) 270px;
  }
  .serve-composer-meta { gap: 10px; }
}

@media (max-width: 940px) {
  .serve-section-header {
    grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
  }
  .serve-workbench {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .serve-activity { display: none; }
}

@media (max-width: 700px) {
  .serve-section {
    width: auto;
    margin-right: max(6px, env(safe-area-inset-right));
    margin-left: max(6px, env(safe-area-inset-left));
  }
  .serve-section-header {
    grid-template-columns: minmax(0, 1fr);
  }
  .serve-section-title,
  .serve-section-copy {
    min-height: 210px;
    padding: 20px;
  }
  .serve-section-title h2 {
    font-size: clamp(38px, 11vw, 60px);
  }
  .serve-section-actions {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .serve-section-actions > a { justify-self: start; }
  .serve-demo-card { height: min(610px, max(430px, calc(100svh - 110px))); }
  .serve-workbench { grid-template-columns: 176px minmax(0, 1fr); }
  .serve-sidebar-brand { padding-left: 12px; }
  .serve-session-list { padding: 0 6px; }
  .serve-session-list button { padding-right: 6px; padding-left: 6px; }
  .serve-transcript { padding: 24px 18px 16px; }
  .serve-composer { margin-right: 10px; margin-left: 10px; }
  .serve-composer-meta > span:nth-of-type(3) { display: none; }
  .serve-demo-footer p { white-space: normal; }
  .serve-demo-footer p strong { display: none; }
}

@media (max-width: 540px) {
  .serve-demo-card { height: min(620px, max(410px, calc(100svh - 100px))); }
  .serve-browserbar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 0 10px;
  }
  .serve-window-controls { display: none; }
  .serve-loopback { justify-self: start; }
  .serve-browser-label { justify-self: end; }
  .serve-workbench { grid-template-columns: minmax(0, 1fr); }
  .serve-sidebar { display: none; }
  .serve-session-header { padding-left: 13px; }
  .serve-simulation-label { justify-content: flex-start; }
  .serve-user-message { max-width: 88%; }
  .serve-demo-footer { padding-left: 11px; }
}

@media (max-width: 420px) {
  .serve-section-title,
  .serve-section-copy { padding: 17px; }
  .serve-principles { gap: 5px; }
  .serve-principles li { padding: 6px 8px; }
  .serve-install-command { grid-template-columns: auto minmax(0, 1fr) auto; }
  .serve-browser-label { display: none; }
  .serve-browserbar { grid-template-columns: minmax(0, 1fr); }
  .serve-loopback { justify-self: center; }
  .serve-composer-meta > span:first-child,
  .serve-composer-meta > span:nth-of-type(3) { display: none; }
  .serve-breadcrumb > span,
  .serve-breadcrumb > i { display: none; }
  .serve-demo-footer p { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .serve-turn-part,
  .serve-run-state.is-running,
  .serve-progress li.is-running i {
    animation: none !important;
  }
}
