:root {
  color-scheme: dark;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --bg: #212121;
  --side: #171717;
  --card: #303030;
  --hover: #383838;
  --text: #f3f3f3;
  --muted: #b0b0b0;
  --border: #424242;
  --button: #f3f3f3;
  --button-text: #202020;
  --user: #303030;
  --accent: #b8cba7;
  --soft: #292929;
  --rail: 264px;
  --reading: 748px;
}
body.light {
  color-scheme: light;
  --bg: #ffffff;
  --side: #f7f7f7;
  --card: #ffffff;
  --hover: #eaeaea;
  --text: #242424;
  --muted: #656565;
  --border: #dddddd;
  --button: #242424;
  --button-text: #ffffff;
  --user: #f0f0f0;
  --accent: #526747;
  --soft: #f5f5f5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  transition:
    background 0.15s,
    color 0.15s,
    opacity 0.15s;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
a {
  color: inherit;
}
svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
[hidden] {
  display: none !important;
}
::selection {
  background: var(--accent);
  color: var(--bg);
}
.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--button);
  color: var(--button-text);
  border-radius: 8px;
}
.skip-link:focus {
  top: 12px;
}
#sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  padding: 22px 14px 14px;
  display: flex;
  flex-direction: column;
  background: var(--side);
  border-right: 1px solid var(--border);
  z-index: 20;
  transition: transform 0.2s;
}
.side-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 27px;
}
.brand {
  display: block;
  text-decoration: none;
}
.company-logo {
  display: block;
  width: 176px;
  height: 30px;
  background: url(/logo.png) center 49%/160% auto no-repeat;
  filter: invert(1) hue-rotate(180deg);
  mix-blend-mode: screen;
}
body.light .company-logo {
  filter: none;
  mix-blend-mode: multiply;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}
.icon-button:hover,
.nav-button:hover,
.history-item:hover,
.profile:hover {
  background: var(--hover);
}
.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  text-align: left;
  font-size: 14px;
  margin-bottom: 5px;
}
.nav-button span[data-icon] {
  display: flex;
}
#new-chat {
  border: 1px solid var(--border);
  background: var(--soft);
  margin-bottom: 8px;
}
.shortcut {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
}
.history-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  padding: 26px 12px 12px;
}
#history {
  overflow: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.history-group {
  margin: 18px 12px 6px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}
.history-group:first-child {
  margin-top: 4px;
}
.history-item {
  display: flex;
  align-items: center;
  border-radius: 8px;
  margin: 2px 0;
  min-width: 0;
}
.history-item.active {
  background: var(--hover);
}
.history-title {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}
.history-delete,
.history-rename {
  width: 27px;
  height: 30px;
  opacity: 0;
}
.history-item:hover .icon-button,
.history-item:focus-within .icon-button {
  opacity: 1;
}
.history-item .icon-button svg {
  width: 14px;
  height: 14px;
}
.history-empty {
  padding: 12px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.profile {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 8px 6px;
  text-align: left;
  border-top: 1px solid var(--border);
  margin-top: 18px;
}
.mascot {
  object-fit: cover;
  object-position: 50% 30%;
  background: #fafafa;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}
.profile strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
}
.profile small {
  font-size: 11px;
  color: var(--muted);
}
.profile > span:last-child {
  margin-left: auto;
  display: flex;
  color: var(--muted);
}
#search {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 13px;
}
#main {
  margin-left: var(--rail);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
header {
  height: 72px;
  padding: 15px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
  gap: 12px;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.model-button {
  display: block;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-left: auto;
  max-width: 45%;
  font-weight: 500;
  padding: 8px;
  border-radius: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-button svg {
  width: 13px;
  color: var(--muted);
}
#expand {
  display: none;
}
.badge {
  font-size: 10px;
  color: var(--muted);
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  white-space: nowrap;
}
.sidebar-closed #sidebar {
  transform: translateX(-100%);
}
.sidebar-closed #main {
  margin-left: 0;
}
.sidebar-closed #expand {
  display: grid;
}
#welcome {
  text-align: center;
  padding: 0 24px;
  margin: clamp(40px, 14vh, 140px) auto 28px;
  width: 100%;
}
.welcome-mascot {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin: 0;
}
.welcome-heading { display: flex; align-items: center; justify-content: center; gap: 16px; }
#conversation-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.16em;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 12px;
}
#welcome h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.2;
  margin: 0;
}
#welcome-description {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin: 14px auto 0;
  max-width: 440px;
}
#conversation {
  flex: 1;
  padding: 20px 32px 32px;
  width: 100%;
}
body.empty #conversation {
  display: none;
}
#messages {
  max-width: var(--reading);
  margin: auto;
}
.message {
  padding: 16px 0 28px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.message.user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 16px 0 28px;
}
.message.user .body {
  background: var(--user);
  padding: 12px 20px;
  border-radius: 20px 20px 6px 20px;
  max-width: 85%;
  white-space: pre-wrap;
  line-height: 1.6;
}
.message.assistant .body {
  padding: 0 2px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.75;
}
.message.assistant .code-head { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.assistant-mascot {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  margin: 0 0 15px;
}
.body p {
  margin: 0 0 16px;
  white-space: pre-wrap;
}
.body h2,
.body h3,
.body h4 {
  margin: 24px 0 12px;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 600;
}
.body h3 {
  font-size: 18px;
}
.body h4 {
  font-size: 16px;
}
.body ul,
.body ol {
  padding-left: 25px;
  margin: 10px 0 20px;
}
.body li {
  padding-left: 5px;
  margin: 5px 0;
}
.body blockquote {
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 18px;
  margin: 18px 0;
  color: var(--muted);
}
.body a {
  text-decoration-color: var(--muted);
  text-underline-offset: 3px;
}
.body code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  background: var(--user);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 0.87em;
}
.code-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 18px 0;
  background: var(--side);
}
.code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}
.code-head button {
  font-size: 11px;
  padding: 4px;
}
.body pre {
  margin: 0;
  padding: 18px;
  overflow: auto;
  line-height: 1.7;
}
.body pre code {
  padding: 0;
  background: none;
  font-size: 13px;
}
.message-actions {
  display: flex;
  gap: 3px;
  margin-top: 8px;
  color: var(--muted);
  align-items: center;
}
.message.user .message-actions {
  opacity: 0;
}
.message.user:hover .message-actions,
.message.user:focus-within .message-actions {
  opacity: 1;
}
.message-actions button {
  height: 30px;
  width: 30px;
}
.message-actions svg {
  width: 15px;
  height: 15px;
}
.message-meta {
  font-size: 11px;
  margin-left: 8px;
  color: var(--muted);
}
.message-note {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}
.typing {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}
#composer-area {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  padding: 12px 32px 16px;
  z-index: 5;
  width: 100%;
}
body.empty #composer-area {
  position: static;
  padding-top: 0;
}
#composer {
  max-width: var(--reading);
  margin: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px 10px;
  transition: border-color 0.2s;
}
#composer:focus-within {
  border-color: var(--muted);
}
#prompt {
  background: transparent;
  border: 0;
  resize: none;
  width: 100%;
  padding: 1px 3px;
  outline: none;
  line-height: 1.65;
  min-height: 32px;
  max-height: 220px;
  overflow-y: auto;
}
#prompt:focus-visible {
  outline: none;
}
#prompt::placeholder {
  color: var(--muted);
}
.composer-tools {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
}
.tool-button {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 6px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--muted);
}
.tool-button svg {
  width: 15px;
  height: 15px;
}
.tool-button:hover {
  background: var(--hover);
  color: var(--text);
}
.send-button {
  margin-left: 0;
  border-radius: 50%;
  background: var(--button);
  color: var(--button-text);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}
.send-button svg {
  width: 18px;
  stroke-width: 1.8;
}
#status {
  color: var(--muted);
  font-size: 11px;
}
.footnote {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 10px;
  color: var(--muted);
  margin: 12px 0 0;
}
#suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: calc(100% - 64px);
  max-width: var(--reading);
  margin: 6px auto 40px;
}
body:not(.empty) #suggestions {
  display: none;
}
.suggestion {
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 12px 18px;
  min-width: 0;
}
.suggestion:hover {
  background: var(--soft);
  border-color: var(--muted);
}
.suggestion svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
  display: none;
}
.suggestion strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
}
.suggestion small {
  display: none;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 5px;
}
#jump-latest {
  position: fixed;
  bottom: 204px;
  right: 30px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  z-index: 6;
}
#jump-latest svg {
  transform: rotate(180deg);
}
#error,
#connection {
  max-width: var(--reading);
  margin: 0 auto 12px;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  background: var(--soft);
}
#connection {
  margin-top: 10px;
}
dialog {
  width: min(500px, calc(100% - 32px));
  max-height: 85dvh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  color: var(--text);
  padding: 28px;
}
dialog::backdrop {
  background: #0009;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.dialog-head h2,
dialog h2 {
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
}
.dialog-head .eyebrow {
  margin-bottom: 6px;
}
dialog label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  font-size: 13px;
}
dialog input,
dialog select,
dialog textarea {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px;
  max-width: 190px;
}
dialog input {
  width: 100px;
}
dialog label.stacked {
  display: block;
}
dialog textarea,
#chat-title {
  display: block;
  width: 100%;
  max-width: none;
  margin-top: 9px;
  resize: vertical;
}
.setting-help,
#model-details {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
#model-details {
  padding: 14px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
}
.settings-section {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin: 20px 0 4px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.dialog-actions {
  display: flex;
  justify-content: space-between;
  padding-top: 22px;
}
.dialog-actions button {
  padding: 10px 17px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
}
.dialog-actions .primary {
  background: var(--button);
  color: var(--button-text);
  border-color: transparent;
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--button);
  color: var(--button-text);
  padding: 12px 18px;
  border-radius: 10px;
  z-index: 50;
  font-size: 13px;
  display: flex;
  gap: 18px;
  align-items: center;
}
#toast button {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#overlay {
  position: fixed;
  inset: 0;
  background: #0008;
  z-index: 15;
}
@media (max-width: 900px) {
  :root {
    --rail: 238px;
  }
  .company-logo {
    width: 151px;
  }
  #sidebar {
    padding-inline: 12px;
  }
  .badge {
    display: none;
  }
}
@media (max-width: 760px) {
  .welcome-heading { flex-direction: column; gap: 18px; }
  .tool-button { min-width: 44px; min-height: 44px; justify-content: center; }
  .message.assistant .body { font-size: 17px; }
  #sidebar {
    transform: translateX(-100%);
    width: 264px;
  }
  #main {
    margin-left: 0;
  }
  #expand {
    display: grid;
  }
  .mobile-open #sidebar {
    transform: none;
  }
  .mobile-open #overlay {
    display: block !important;
  }
  .company-logo {
    width: 176px;
  }
  header {
    height: 62px;
    padding: 10px 14px;
  }
  .model-button {
    font-size: 13px;
  }
  #welcome {
    margin-top: clamp(20px, 6vh, 60px);
    padding-inline: 20px;
  }
  .welcome-mascot {
    width: 60px;
    height: 60px;
    border-radius: 20px;
  }
  .eyebrow {
    font-size: 9px;
  }
  #welcome-description {
    font-size: 13px;
    max-width: 300px;
  }
  #composer-area {
    padding: 10px 16px max(12px, env(safe-area-inset-bottom));
  }
  #conversation {
    padding: 12px 20px 20px;
  }
  #suggestions {
    width: calc(100% - 32px);
    gap: 8px;
  }
  .suggestion {
    padding: 12px;
  }
  .suggestion small {
    display: none;
  }
  .suggestion strong {
    font-size: 11px;
  }
  .history-delete,
  .history-rename,
  .message.user .message-actions {
    opacity: 1;
  }
  .footnote {
    font-size: 9px;
    gap: 8px;
  }
  #jump-latest {
    right: 16px;
  }
  dialog {
    padding: 22px;
  }
}
@media (max-width: 380px) {
  .tool-button {
    font-size: 10px;
  }
  #status {
    font-size: 10px;
  }
  #suggestions {
    grid-template-columns: 1fr;
  }
  .suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .suggestion svg {
    margin: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Canvas and conversation branches share the app's quiet, bordered surfaces. */
.new-label {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-left: auto;
  border: 1px solid var(--border);
  padding: 2px 5px;
  border-radius: 4px;
}
#branch-banner {
  max-width: var(--reading);
  width: calc(100% - 64px);
  margin: 0 auto 8px;
  color: var(--muted);
  font-size: 11px;
}
#branch-banner button {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}
#branch-banner svg {
  width: 15px;
  height: 15px;
}
#map-dialog {
  width: min(700px, calc(100% - 32px));
}
.branch-node {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  column-gap: 10px;
  width: calc(100% - 100px);
  min-width: 180px;
  border: 1px solid var(--border);
  background: var(--soft);
  border-radius: 10px;
  padding: 14px;
  margin-top: 10px;
  text-align: left;
}
.branch-node:hover {
  border-color: var(--muted);
}
.branch-node.selected {
  border-color: var(--accent);
}
.branch-node strong {
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.branch-node small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}
.branch-node svg {
  grid-row: span 2;
  color: var(--accent);
  width: 16px;
}
.map-empty {
  padding: 32px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
#workshop {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(54vw, 900px);
  z-index: 25;
  background: var(--bg);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.workshop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}
.workshop-head h2 {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.025em;
  margin: 0;
}
.workshop-head .eyebrow {
  font-size: 9px;
  margin-bottom: 6px;
}
.workshop-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.workshop-toolbar [role="group"] {
  display: flex;
  gap: 3px;
  background: var(--side);
  padding: 3px;
  border-radius: 8px;
}
.workshop-toolbar button {
  padding: 7px 11px;
  border-radius: 6px;
}
.workshop-toolbar button[aria-pressed="true"] {
  background: var(--card);
  color: var(--text);
}
.workshop-toolbar button[aria-pressed="false"] {
  color: var(--muted);
}
#run-canvas {
  border: 1px solid var(--border);
}
#run-canvas span {
  margin-left: 8px;
  color: var(--muted);
  font-size: 10px;
}
#canvas-stage {
  flex: 1;
  min-height: 0;
  background: #faf8f5;
}
#canvas-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
}
#canvas-source {
  flex: 1;
  min-height: 0;
  resize: none;
  border: 0;
  background: var(--side);
  padding: 22px;
  font:
    13px/1.7 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  tab-size: 2;
  outline: none;
  white-space: pre;
  overflow: auto;
}
.canvas-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
#canvas-status {
  font-size: 10px;
  color: var(--muted);
  max-width: 65%;
  line-height: 1.5;
}
#download-canvas {
  font-size: 11px;
  white-space: nowrap;
  padding: 7px 0;
}
.canvas-open #main {
  margin-right: min(54vw, 900px);
}
.canvas-open #welcome h1 {
  font-size: 26px;
}
.canvas-open #suggestions {
  grid-template-columns: 1fr;
}
.canvas-open .suggestion {
  display: flex;
  gap: 12px;
  align-items: center;
}
.canvas-open .suggestion svg {
  margin: 0;
}
.canvas-open .suggestion small {
  display: none;
}
.canvas-open #welcome .eyebrow {
  display: none;
}
.canvas-open #main header {
  padding-inline: 14px;
}
.canvas-open #jump-latest {
  right: calc(min(54vw, 900px) + 16px);
}
@media (max-width: 1100px) {
  #workshop {
    width: 65vw;
  }
  .canvas-open #main {
    margin-right: 0;
  }
  .canvas-open #sidebar {
    transform: translateX(-100%);
  }
  .canvas-open #main {
    margin-left: 0;
  }
  .canvas-open #main::after {
    content: "";
    position: fixed;
    inset: 0;
    background: #0006;
    z-index: 24;
    pointer-events: none;
  }
}
@media (max-width: 760px) {
  .icon-button {
    min-width: 44px;
    min-height: 44px;
  }
  .history-rename,
  .history-delete {
    opacity: 1;
  }
  #workshop {
    width: 100%;
  }
  .workshop-head {
    padding: 18px;
  }
  .workshop-toolbar {
    padding: 10px 14px;
  }
  .canvas-footer {
    padding: 12px 14px;
  }
  #run-canvas span {
    display: none;
  }
  .branch-node {
    width: calc(100% - 40px);
  }
  #branch-banner {
    width: calc(100% - 40px);
  }
}

.canvas-open #sidebar {
  transform: translateX(-100%);
}
.canvas-open #main {
  margin-left: 0;
}

/* Short state transitions informed by Claude desktop; no token-by-token delays. */
:root { --motion-quick: 150ms; --motion-panel: 240ms; --motion-ease: cubic-bezier(.2,.8,.2,1); }
#sidebar { transition: transform var(--motion-panel) var(--motion-ease); }
#main { transition: margin-left var(--motion-panel) var(--motion-ease); }
#composer { transition: border-color var(--motion-quick), box-shadow var(--motion-quick); }
#composer:focus-within { box-shadow: 0 0 0 1px var(--border); }
#overlay { animation: surface-in 150ms ease-out; }
dialog[open] { animation: dialog-in 180ms var(--motion-ease); }
dialog::backdrop { animation: surface-in 150ms ease-out; }
.message-enter { animation: message-in 180ms var(--motion-ease); }
.response-arriving { animation: surface-in 180ms ease-out; }
.typing {
  width: 16px; height: 16px; border-radius: 50%; background: transparent;
  border: 2px solid var(--border); border-top-color: var(--text);
  animation: waiting-turn 1s linear infinite;
}
.message-actions { transition: opacity 150ms ease-out; }
@media (hover: hover) and (pointer: fine) {
  .message:not(:hover):not(:focus-within) .message-actions { opacity: 0; }
}
.generating #stop { animation: surface-in 120ms ease-out; }
@keyframes surface-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(6px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes message-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes waiting-turn { to { transform: rotate(360deg); } }
