:root {
  --ink: #252421;
  --muted: #68665e;
  --line: #dfddd6;
  --paper: #f7f6f2;
  --sun: #ff8b6d;
  --surface: #fffefa;
  --rail: #222320;
  --rail-text: #efeee8;
  --rail-muted: #b2b3a9;
  --sans: "DM Sans", "Segoe UI", Arial, sans-serif;
  --display: "Instrument Serif", Georgia, serif;
  color: var(--ink);
  background: var(--paper);
  font: 15px var(--sans);
  -webkit-font-smoothing: antialiased;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a {
  color: inherit;
}
button {
  border: 0;
  background: none;
  cursor: pointer;
}
button:disabled {
  opacity: 0.46;
  cursor: default;
}
:focus-visible {
  outline: 2px solid #ab4932;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.sr-only,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.skip:focus {
  position: fixed;
  z-index: 20;
  top: 8px;
  left: 8px;
  padding: 8px;
  color: white;
  background: #222;
}
i[data-icon] {
  display: inline-flex;
  flex: none;
  width: 17px;
  height: 17px;
  align-items: center;
  justify-content: center;
}
i svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.shell {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  min-height: 100dvh;
}
body.rail-expanded .shell {
  grid-template-columns: 210px minmax(0, 1fr);
}
aside {
  background: var(--rail);
  color: var(--rail-text);
  height: 100dvh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  align-items: stretch;
  padding: 13px 10px;
  z-index: 7;
}
.brand-line {
  height: 43px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand {
  color: var(--rail-text);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 4px;
}
.mark {
  width: 25px;
  height: 25px;
  display: inline-block;
  flex: none;
  color: var(--sun);
  background: currentColor;
  mask: url("/favicon.svg") center / contain no-repeat;
}
.wordmark {
  font-size: 28px;
  font-weight: 680;
  letter-spacing: -0.075em;
  line-height: 1;
}
.brand-line .iconbutton {
  color: var(--rail-muted);
}
.new-project,
.nav-link,
.project-item,
#accountButton {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  min-height: 38px;
  border-radius: 7px;
  justify-content: center;
  font-size: 13px;
  line-height: 1.4;
}
.new-project {
  color: var(--ink);
  background: var(--sun);
  margin-bottom: 8px;
  font-weight: 650;
}
.new-project:hover {
  background: #ffa084;
}
.nav-link,
.project-item {
  color: var(--rail-muted);
}
.nav-link.selected,
.project-item.selected,
.nav-link:hover,
.project-item:hover {
  color: white;
  background: #353631;
}
.nav-caption {
  margin: 17px 5px 9px;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--rail-muted);
}
#projects {
  overflow: auto;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #41423b;
}
#projects button {
  margin-bottom: 3px;
}
.sidebar-empty {
  color: var(--rail-muted);
  font-size: 12px;
}
.project-item span,
.side-bottom button > span:not(.avatar) {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.side-bottom {
  margin-top: auto;
  border-top: 1px solid #41423b;
  padding-top: 10px;
}
.avatar {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dad5c6;
  color: #292720;
  font-size: 13px;
  font-weight: 650;
  flex: none;
}
body:not(.rail-expanded):not(.menu-open)
  :is(
    aside button span:not(.avatar),
    .wordmark,
    #railToggle,
    .nav-caption,
    .sidebar-empty,
    .side-bottom i
  ) {
  display: none;
}
.rail-expanded aside,
.menu-open aside {
  padding-inline: 14px;
}
:is(.rail-expanded, .menu-open) .brand-line {
  justify-content: space-between;
}
:is(.rail-expanded, .menu-open)
  :is(.new-project, .nav-link, .project-item, #accountButton) {
  justify-content: flex-start;
  gap: 10px;
  padding-inline: 10px;
}
:is(.rail-expanded, .menu-open) .side-bottom i {
  margin-left: auto;
}
:is(.rail-expanded, .menu-open) #projects {
  margin-top: 0;
  padding-top: 0;
  border: 0;
}
main {
  min-width: 0;
  position: relative;
}
.topbar,
.editor-head {
  height: 53px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.crumb,
.editor-name,
.editor-actions,
.top-actions,
.tabs,
.input-tools,
.device-tools,
#deviceGroup,
.panel-name,
.panel-title,
.mobile-panels,
.compose-bottom,
.chat-controls {
  display: flex;
  align-items: center;
}
.crumb,
.editor-name {
  gap: 10px;
  min-width: 0;
}
.crumb button,
.crumb strong {
  font-size: 13px;
}
.crumb strong {
  font-weight: 550;
}
.crumb span {
  color: #a5a197;
}
#crumbStudio {
  color: var(--muted);
  padding: 0;
}
.primary,
.outline,
.text-button,
.iconbutton,
.context-button,
.attach,
.model,
.tabs button,
.mobile-panels button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 550;
}
.primary,
.outline,
.attach,
.context-button,
.text-button,
.iconbutton {
  border-radius: 7px;
  min-height: 34px;
  padding: 7px 12px;
  line-height: 1.2;
  font-size: 13px;
}
.primary {
  background: var(--ink);
  border: 1px solid var(--ink);
  color: white;
}
.primary:hover {
  background: #464640;
}
.outline {
  background: var(--surface);
  border: 1px solid var(--line);
}
.outline:hover,
.context-button:hover,
.iconbutton:hover,
.attach:hover,
.text-button:hover,
.tabs button:hover {
  background: #efeee7;
}
.primary:focus-visible,
.new-project:focus-visible {
  outline-offset: 3px;
}
.iconbutton {
  padding: 0;
  width: 34px;
  height: 34px;
}
.small {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}
.home {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: clamp(32px, 5.5vh, 62px) clamp(20px, 5vw, 72px) 60px;
}
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 25px;
}
.hero-type {
  position: relative;
  z-index: 1;
}
.home-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #59564e;
  font-size: 12px;
  font-weight: 580;
}
.brand-seed {
  height: 8px;
  width: 8px;
  border-radius: 50%;
  background: #c95c43;
}
.hero h1 {
  font-size: clamp(52px, 6.35vw, 90px);
  line-height: 0.94;
  letter-spacing: -0.077em;
  font-weight: 510;
  margin: 15px 0;
}
.hero h1 em {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.077em;
}
.hero p {
  margin: 0;
  font-size: clamp(14px, 1.3vw, 17px);
  color: var(--muted);
}
.artwork {
  position: relative;
  width: clamp(135px, 22vw, 250px);
  aspect-ratio: 1.1;
  flex: none;
  overflow: hidden;
}
.art-inner {
  position: absolute;
  inset: 17% 15% 18% 9%;
  transform: rotate(-34deg);
}
.art-inner span {
  position: absolute;
  width: 74%;
  height: 70%;
  top: var(--t);
  left: var(--x);
  border-radius: 50%;
  transform: rotate(var(--spin));
  background: #fa8765;
  border: 1.4px solid #6d372b;
  box-shadow: inset 0 0 0 2px #ff9f80;
}
.composer,
.chat-form {
  border: 1px solid #cbc9c0;
  background: white;
  box-shadow: 0 3px 9px #22221d08;
}
.composer {
  padding: 18px 18px 15px;
  border-radius: 16px;
  box-shadow:
    0 5px 15px #22221d08,
    0 1px 2px #22221d0c;
}
.composer:focus-within,
.chat-form:focus-within,
.dragging {
  border-color: #98796b;
}
.dragging {
  outline: 2px dashed #ad503a;
}
.composer textarea,
.chat-form textarea {
  width: 100%;
  border: 0;
  outline: none;
  font: inherit;
  resize: vertical;
  background: transparent;
  color: var(--ink);
  display: block;
  padding: 0;
}
.composer textarea {
  font-size: 18px;
  min-height: 62px;
  max-height: 170px;
  line-height: 1.5;
}
textarea::placeholder {
  color: #807d74;
  opacity: 1;
}
.compose-bottom,
.chat-controls {
  justify-content: space-between;
  gap: 8px;
}
.input-tools {
  gap: 8px;
}
.attach {
  color: var(--ink);
  border: 1px solid var(--line);
  min-height: 30px;
  padding: 5px 9px;
}
.model {
  font-size: 12px;
  color: var(--muted);
}
.model i {
  color: #ac593d;
  width: 14px;
  height: 14px;
}
.templates-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: clamp(28px, 5vh, 50px) 0 12px;
}
.templates-head h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
  font-weight: 580;
  letter-spacing: -0.04em;
}
.text-button {
  color: #58564e;
  text-decoration: none;
  min-height: 30px;
  padding: 5px 7px;
  font-size: 12px;
}
.templates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}
.template {
  padding: 0;
  text-align: left;
  min-width: 0;
}
.poster {
  display: block;
  height: clamp(92px, 12.5vw, 163px);
  border-radius: 9px;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  transition:
    filter 0.2s,
    transform 0.2s;
}
.template:hover .poster {
  filter: brightness(1.04);
  transform: translateY(-2px);
}
.portfolio {
  background-color: #e4dcd1;
  background-image: url("/design-assets/studio-interior.webp");
}
.cafe {
  background-color: #333831;
  background-image:
    linear-gradient(90deg, #20181080, transparent),
    url("/design-assets/dining-room.webp");
}
.launch {
  background-color: #c4b9a8;
  background-image:
    linear-gradient(130deg, #36393b54, transparent),
    url("/design-assets/architecture.webp");
}
.poster-frame {
  position: absolute;
  inset: 0;
  padding: 12px;
  display: block;
}
.poster small {
  font-size: 7px;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.poster em {
  font: italic 400 clamp(25px, 3.1vw, 46px)/0.92 var(--display);
  position: absolute;
  bottom: 12px;
  left: 12px;
  letter-spacing: -0.065em;
}
.portfolio .poster-frame {
  top: auto;
  left: 7%;
  right: auto;
  bottom: 0;
  width: 49%;
  min-height: 79%;
  background: #f3eadc;
  color: #282923;
}
.cafe .poster-frame,
.launch .poster-frame {
  color: white;
}
.launch em {
  font-family: var(--sans);
  font-weight: 650;
  font-style: normal;
  font-size: clamp(23px, 3.5vw, 59px);
}
.template-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 9px 2px 0;
  font-size: 13px;
  font-weight: 570;
}
.template-text i {
  width: 14px;
  height: 14px;
  color: var(--muted);
}
.editing .topbar {
  display: none;
}
#editor {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
.editor-head {
  flex: none;
  padding: 0 15px;
}
.editor-name h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.032em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.editor-actions {
  flex: none;
  gap: 6px;
}
.editor-actions .primary {
  background: var(--sun);
  color: #382017;
  border-color: #f17f61;
}
.editor-actions .primary:hover {
  background: #ffa78f;
}
.live-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5f8266;
}
.live-link {
  color: #525c4f;
}
.mobile-panels {
  display: none;
}
.workbench {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: clamp(275px, 23vw, 365px) minmax(0, 1fr);
}
.chat-panel,
.preview-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.chat-panel {
  background: #fbfaf7;
  border-right: 1px solid var(--line);
}
.panel-title,
.preview-tools {
  height: 46px;
  flex: none;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}
.panel-title {
  padding: 0 13px 0 17px;
}
.panel-name {
  gap: 7px;
  font-size: 14px;
  font-weight: 630;
}
.context-button {
  color: var(--muted);
  min-height: 29px;
  padding: 4px 6px;
  font-size: 12px;
}
#referenceCount {
  min-width: 16px;
  font-size: 10px;
  padding: 1px 3px;
  background: #eaded5;
  border-radius: 4px;
}
.messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 19px;
  padding: 20px 14px;
}
.message {
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.message strong {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #625f56;
  font-weight: 600;
  font-size: 11px;
  margin: 0 0 5px;
}
.message.assistant strong:before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #dc795b;
}
.message.user {
  align-self: flex-end;
  padding: 10px 13px;
  background: #eae8e0;
  border-radius: 13px 13px 4px 13px;
  max-width: 94%;
}
.message.user strong {
  color: #676257;
}
.message p {
  margin: 0;
  white-space: pre-wrap;
}
.chat-form {
  margin: 10px;
  padding: 11px;
  border-radius: 12px;
}
.chat-form textarea {
  min-height: 50px;
  max-height: 22vh;
  font-size: 14px;
  line-height: 1.45;
}
.chat-controls .attach {
  width: 28px;
  height: 28px;
  min-height: 28px;
}
.chat-controls .primary {
  width: 31px;
  min-height: 31px;
  padding: 0;
}
.chat-panel > #editorDemo {
  align-self: flex-start;
  margin: 0 11px 7px;
}
.preview-panel {
  background: white;
}
.preview-tools {
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: var(--surface);
}
.tabs,
.device-tools {
  gap: 3px;
}
.tabs button,
.mobile-panels button {
  min-height: 30px;
  border-radius: 6px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 12px;
}
.tabs button.active,
.mobile-panels button[aria-pressed="true"],
#deviceGroup button.active {
  background: #eae8df;
  color: var(--ink);
}
.tabs i,
.context-button i {
  width: 14px;
  height: 14px;
}
#deviceGroup {
  gap: 1px;
  border-right: 1px solid var(--line);
  padding-right: 6px;
  margin-right: 4px;
}
#deviceGroup .iconbutton,
.device-tools > .iconbutton {
  height: 29px;
  min-height: 29px;
  width: 29px;
  color: #625f56;
}
.view {
  min-height: 0;
  min-width: 0;
  flex: 1;
  overflow: auto;
  position: relative;
}
#previewView {
  background: #eae8e2;
}
.view iframe {
  display: block;
  border: 0;
  width: 100%;
  height: 100%;
  background: white;
  margin: auto;
}
.phone-preview {
  padding: 14px 0;
}
.phone-preview iframe {
  width: min(390px, 100%);
  border-radius: 12px;
  outline: 1px solid #d0ccc0;
  box-shadow: 0 4px 12px #0001;
}
.view-empty {
  height: 100%;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background:
    radial-gradient(#cfcbc1 0.9px, transparent 1px) 0 0/17px 17px,
    #f6f5f0;
}
.view-empty i {
  width: 30px;
  height: 30px;
  color: #8b8274;
}
.view-empty h3 {
  margin: 12px 0 5px;
  font-size: 20px;
  font-weight: 570;
  letter-spacing: -0.04em;
}
.view-empty p,
.small-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}
#buildStatus {
  margin: 0 12px 2px;
  padding: 9px 11px;
  background: #f3e7df;
  color: #644331;
  border-radius: 6px;
}
.view pre {
  margin: 0;
  padding: 18px;
  min-height: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #ebeadf;
  background: #242622;
  font:
    12px/1.55 "IBM Plex Mono",
    Consolas,
    monospace;
}
#history,
#submissions {
  padding: 18px;
}
.history-row,
.data-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.data-row pre {
  min-height: unset;
  margin-top: 8px;
  border-radius: 6px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.chips:not(:empty) {
  padding: 5px 0 10px;
}
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 5px;
  background: #f4f2ec;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
}
.file-chip > span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.file-chip i {
  width: 12px;
  height: 12px;
}
.file-chip small {
  color: #8c472d;
  flex: none;
  font-size: 10px;
}
.chip-remove {
  flex: none;
  display: grid;
  place-items: center;
  height: 22px;
  width: 22px;
  padding: 0;
}
.embed-option {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.embed-option input {
  margin: 0;
  width: 13px;
  height: 13px;
  accent-color: var(--ink);
}
#status {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 9;
  background: #292925;
  color: white;
  padding: 12px 16px;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 5px 20px #0002;
  max-width: min(440px, calc(100vw - 32px));
}
dialog {
  width: min(435px, calc(100vw - 24px));
  max-height: 90dvh;
  overflow: auto;
  margin: auto;
  padding: 24px;
  border: 1px solid #ccc9bf;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 18px 70px #2223;
}
dialog::backdrop {
  background: #25252170;
  backdrop-filter: blur(3px);
}
.dialog-head,
.reference-heading,
.reference-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}
.dialog-head {
  margin-bottom: 14px;
}
.dialog-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #f3ded2;
  color: #653c2c;
}
dialog h2 {
  font-size: 25px;
  letter-spacing: -0.055em;
  margin: 0 0 5px;
}
dialog p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 14px;
}
dialog label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-top: 13px;
}
dialog input,
dialog select,
dialog textarea {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #c7c4ba;
  color: var(--ink);
  border-radius: 6px;
  background: white;
  margin-top: 6px;
}
dialog textarea {
  resize: vertical;
  min-height: 75px;
}
dialog summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 550;
  margin-top: 14px;
}
#projectNotes {
  white-space: pre-wrap;
  margin: 8px 0;
}
.full {
  width: 100%;
  margin-top: 13px;
}
.git-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.error {
  color: #ae4034;
  font-size: 13px;
  margin: 7px 0;
}
.error:empty {
  display: none;
}
#saveMemory {
  margin-top: 7px;
}
.reference-heading {
  margin: 16px 0 6px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.reference-heading h3 {
  font-size: 14px;
  margin: 0;
}
.reference-row {
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.reference-row a {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
#contextError:not(:empty) {
  margin-top: 11px;
}
@media (max-width: 1000px) {
  .tabs i {
    display: none;
  }
  .workbench {
    grid-template-columns: 265px minmax(0, 1fr);
  }
}
@media (max-width: 850px) {
  .shell,
  body.rail-expanded .shell {
    display: block;
  }
  aside {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    visibility: hidden;
    transform: translateX(-100%);
  }
  .menu-open aside {
    visibility: visible;
    transform: translateX(0);
  }
  #shade {
    position: fixed;
    inset: 0;
    z-index: 6;
    background: #16181366;
  }
  .topbar,
  .editor-head {
    padding-inline: 12px;
  }
  .workbench {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  .tabs button {
    padding-inline: 7px;
  }
}
@media (max-width: 680px) {
  .home {
    padding: 28px 18px 36px;
  }
  .hero {
    margin-bottom: 21px;
  }
  .hero h1 {
    font-size: clamp(47px, 11vw, 67px);
    margin: 10px 0;
  }
  .hero p {
    font-size: 13px;
  }
  .home-brand {
    font-size: 11px;
  }
  .artwork {
    width: clamp(75px, 22vw, 126px);
  }
  .composer {
    padding: 13px;
  }
  .composer textarea {
    font-size: 16px;
  }
  .templates {
    gap: 9px;
  }
  .poster {
    height: clamp(78px, 21vw, 128px);
  }
  .poster-frame {
    padding: 6px;
  }
  .poster em {
    font-size: clamp(18px, 5vw, 28px);
    left: 6px;
    bottom: 6px;
  }
  .poster small {
    font-size: 5px;
  }
  .portfolio .poster-frame {
    width: 57%;
  }
  .template-text {
    font-size: 12px;
    align-items: start;
  }
  .template-text i {
    display: none;
  }
  .editor-head {
    height: 46px;
    gap: 5px;
    padding-inline: 7px;
  }
  .editor-name {
    gap: 2px;
  }
  .editor-head h1 {
    font-size: 14px;
  }
  .editor-actions {
    gap: 4px;
  }
  .editor-actions .primary {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 12px;
  }
  .editor-actions .outline {
    min-height: 29px;
    width: 29px;
    padding: 0;
  }
  .editor-actions .outline span,
  .live-link > span:not(.live-dot) {
    display: none;
  }
  .live-link {
    gap: 3px;
    padding: 4px;
  }
  .mobile-panels {
    display: flex;
    height: 36px;
    flex: none;
    justify-content: center;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }
  .mobile-panels button {
    min-height: 26px;
    padding: 4px 14px;
  }
  .mobile-panels i {
    width: 13px;
    height: 13px;
  }
  .workbench {
    display: flex;
  }
  .chat-panel,
  .preview-panel {
    flex: 1;
  }
  #editor[data-panel="chat"] .preview-panel,
  #editor[data-panel="canvas"] .chat-panel {
    display: none;
  }
  .panel-title,
  .preview-tools {
    height: 39px;
  }
  .preview-tools {
    padding: 0 5px;
  }
  #deviceGroup {
    display: none;
  }
  .chat-panel {
    border: 0;
  }
  .phone-preview {
    padding: 0;
  }
  .phone-preview iframe {
    border-radius: 0;
    outline: 0;
    width: 100%;
  }
  .chat-form {
    margin: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.file-chip label {
  margin: 0;
  font-weight: 500;
}
.file-browser{display:grid;grid-template-columns:minmax(145px,22%) 1fr;min-height:100%;background:#242622;color:#faf8ef}.file-browser nav{background:#30332d;padding:15px 8px;display:flex;flex-direction:column;align-items:stretch;gap:3px}.file-browser nav strong,.file-browser article header{font:600 12px/1.5 system-ui;padding:8px 6px}.file-browser article{min-width:0}.file-browser article header{border-bottom:1px solid #45473e;padding-left:18px}.file-item{background:transparent;color:inherit;border:0;border-radius:4px;text-align:left;font:12px/1.5 monospace;padding:7px;overflow-wrap:anywhere}.file-item[aria-pressed=true]{background:#505449}.file-item:hover{background:#484b42}#fileImage,#visualResult{display:block;max-width:100%;max-height:65vh;object-fit:contain}#fileImage[hidden],#visualResult[hidden]{display:none}#activityLog{padding:3px 14px;font-size:12px;max-height:22vh;overflow:auto}#activityLog ol{padding-left:20px}#activityLog li{margin:5px 0}#scopeLabel{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:6px}#scopeLabel[hidden]{display:none}#scopeLabel select{max-width:82%;font:inherit;border:0;background:transparent;color:inherit}#imageOptions,#visualOptions{margin:14px 0}#imageOptions select,#imageOptions input{max-width:100%}#contextDialog{max-height:85dvh;overflow:auto}@media(max-width:640px){.file-browser{grid-template-columns:1fr;grid-template-rows:auto 1fr}.file-browser nav{display:flex;flex-direction:row;overflow:auto;align-items:center;padding:6px}.file-browser nav strong{display:none}.file-browser nav button{flex:none}}

.file-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.file-heading button{border:1px solid #62675f}

#photoSearch{margin:14px 0}#photoResult{display:grid;gap:8px;margin:10px 0}#photoResult img{max-width:100%;max-height:230px;object-fit:contain}#photoResult a{width:fit-content}

/* Project studio */
#editor{--ink:#f4f2ee;--muted:#a9aaa9;--surface:#202122;--line:#373839;--canvas:#141517;color:var(--ink);background:#191a1b;color-scheme:dark}
.editing aside{background:#161718;border-right:1px solid #303132}
.editor-head{height:58px;background:#191a1b;padding-inline:16px}
.project-identity{min-width:0}.project-identity small,.canvas-label,.build-card header small{font:600 10px/1.4 Consolas,monospace;letter-spacing:.13em;text-transform:uppercase}
.project-identity small{color:#b5b2ad;font-size:9px}.project-identity h1{margin-top:2px}
#editor .outline:hover,#editor .iconbutton:hover,#editor .context-button:hover,#editor .tabs button:hover,#editor .text-button:hover{background:#333537;color:#fff}
#editor .live-link{color:#c0dcbe}
#editor .workbench{grid-template-columns:clamp(315px,29vw,465px) minmax(0,1fr)}
#editor .chat-panel{background:#1c1d1e}
.panel-title,.preview-tools{height:45px}.panel-title{background:#1c1d1e}.panel-name i{color:#ebaa8c}
#conversation{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#474748 transparent;padding:20px clamp(12px,1.4vw,23px);overflow-wrap:anywhere}
#messages{padding:0;overflow:visible;gap:18px}
.message.user,#pendingRequest{border:1px solid #414144;background:#2c2d30;color:#f4f1ec}
.message strong,.message.user strong{color:#b8b7b4}
#pendingRequest{margin:0 0 20px auto;width:fit-content}
#messages:not(:empty)+#chatWelcome+#pendingRequest:not([hidden]){margin-top:20px}
#chatWelcome{margin:20px 3px}#chatWelcome>i{color:#ffa483;width:26px;height:26px}
#chatWelcome h3{font-size:18px;margin:10px 0 5px}#chatWelcome p{font-size:14px;line-height:1.55;color:var(--muted);margin:0;max-width:33ch}
#activityLog{padding:0;max-height:none;overflow:visible}
.build-byline,.version-card header,.build-card header,.version-actions,.run-details summary,.event-list li,#activityItems li{display:flex;align-items:center}
.build-byline{gap:8px;font-size:13px;font-weight:650;margin:0 0 12px}
.agent-mark,.phase-icon{display:grid;place-items:center;border-radius:8px;width:27px;height:27px;background:#49352e;color:#ffb99b}
.run-badge{margin-left:auto;font:550 11px var(--sans);color:#f0b394;display:flex;align-items:center;gap:6px}
.run-badge:before,#canvasPhase:before{content:"";width:6px;height:6px;border-radius:50%;background:#ffac88;display:inline-block}
#activityLog[data-state=working] .run-badge:before{animation:build-pulse 2s ease-in-out infinite}
@keyframes build-pulse{50%{box-shadow:0 0 0 4px #ffac8824}}
#buildPlan,.build-card,.version-card{border:1px solid #414143;border-radius:12px;overflow:hidden;background:#262729}
#buildPlan{margin-bottom:9px}
.run-details summary{cursor:pointer;list-style:none;gap:8px;padding:11px 13px;color:#e0ded9;font-size:12px;font-weight:600}
.run-details summary::-webkit-details-marker{display:none}
.run-details summary:after{content:"";width:6px;height:6px;border-right:1.5px solid #aaa;border-bottom:1.5px solid #aaa;transform:rotate(45deg);margin:-3px 3px 0 auto}
.run-details[open]>summary:after{transform:rotate(225deg);margin-top:3px}
#planCount{font-size:11px;font-weight:450;color:var(--muted)}
.run-details ul{margin:0;padding:0 17px 12px 31px;color:#cfccca;font-size:13px;line-height:1.5}
.run-details ul li{padding-left:3px;margin:5px 0}.run-details ul li::marker{color:#c3937b}
.build-card header{gap:11px;padding:15px}.phase-icon{width:35px;height:35px;flex:none;background:#41332f;border:1px solid #5c4238}
.build-card header small{color:#c09a86;font-size:9px}.build-card h3{font-size:15px;line-height:1.4;margin:3px 0 0;font-weight:600;letter-spacing:-.02em}
.build-card .run-details,.version-card .run-details,.version-actions{border-top:1px solid #393a3b}
#activityItems,.event-list,#activityLog ol{margin:0;padding:0 13px 12px;list-style:none}
#activityItems li,.event-list li{align-items:flex-start;gap:8px;margin:0;padding:5px 0;color:#c6c5c0;font:12px/1.5 var(--sans)}
#activityItems li i,.event-list li i{width:13px;height:13px;margin-top:3px;color:#ab9b91}
#buildStatus{margin:10px 0 0;background:#3b2d29;color:#ffc4a8}
.version-card{margin-top:12px}.version-card header{gap:8px;padding:12px;font-size:13px}.version-card header i{color:#c3d9b7}
.version-card time{margin-left:auto;font-size:10px;color:var(--muted)}.version-actions{gap:7px;padding:8px}
#editor .version-actions button{min-height:28px;font-size:12px;background:#303133;color:#dfdedb}
#chatForm{background:#292a2c;border:1px solid #48494b;box-shadow:0 4px 16px #0002;margin:10px 12px 12px;padding:13px;border-radius:15px}
#chatForm:focus-within{border-color:#ba8771}#chatPrompt{resize:none;min-height:54px}
#chatForm textarea::placeholder{color:#b0adab}.chat-controls .attach{width:auto;border:0;padding:3px 7px;color:#cfcdcb;background:transparent;font-size:12px}.chat-controls .send{background:#ffb092;color:#321e16;border:0;border-radius:50%}#scopeLabel{padding:2px 0 8px}#scopeLabel option{background:#242526}
#editor .file-chip,#referenceCount{background:#353637;color:#e1ddd6}
#editorDemo{color:var(--muted)}
#editor .preview-panel{background:#191a1b;padding:0 9px 9px;overflow:hidden}
#editor .preview-tools{background:transparent;border-bottom:0;padding:0 4px}
#editor .tabs .active,#editor .mobile-panels [aria-pressed=true],#editor #deviceGroup .active{background:#38393c;color:#fff}
#editor .device-tools .iconbutton{color:#bcbcb9}
#editor .view{border:1px solid #424346;border-radius:12px;background:#202123}
#editor .view-empty{background:radial-gradient(ellipse at 50% 48%,#26262755,transparent 56%),radial-gradient(#353639 0.8px,transparent 0.9px) center/19px 19px,var(--canvas);color:#f7f2ec}
.blueprint{padding:16px 20px;margin:0 0 20px;background:linear-gradient(90deg,transparent 19px,#414044 20px,transparent 21px,transparent calc(100% - 21px),#414044 calc(100% - 20px),transparent calc(100% - 19px)),linear-gradient(0deg,transparent 15px,#414044 16px,transparent 17px,transparent calc(100% - 17px),#414044 calc(100% - 16px),transparent calc(100% - 15px))}
.wire-window{width:188px;padding:0 10px 9px;border:1px solid #5a5553;border-radius:6px;background:#242527;box-shadow:0 12px 30px #0003}.wire-bar{display:flex;gap:3px;height:17px;align-items:center;border-bottom:1px solid #403f3e}.wire-bar b{width:3px;height:3px;border-radius:50%;background:#8b827d}
.wire-body,.wire-foot{display:flex;gap:7px}.wire-body{height:66px;padding:8px 0}.wire-copy{flex:1;display:grid;align-content:center;gap:4px}.wire-copy b,.wire-copy em,.wire-foot b{display:block;background:#505052;border-radius:2px;height:3px}.wire-copy b:first-child{width:77%;height:6px;background:#847b74}.wire-copy b:nth-child(3){width:65%}.wire-copy em{margin-top:3px;width:25px;height:7px;background:#977560}
.wire-art{width:63px;border-radius:3px;background:repeating-linear-gradient(-45deg,#332e2d,#332e2d 4px,#3b3430 5px,#332e2d 6px);border:1px solid #624b40;display:grid;place-items:center}.wire-art .mark{transform:scale(.7);color:#edab8e}.wire-foot b{flex:1;height:11px;background:#313234;border:1px solid #444446}
.canvas-label{color:#c09982;font-size:10px}#noPreview h3{font-size:clamp(22px,2.4vw,34px);margin:7px 0;font-weight:550}#noPreview p{max-width:42ch}
#canvasPhase{margin-top:16px;display:inline-flex;gap:8px;align-items:center;border-radius:20px;border:1px solid #55423a;padding:6px 11px;background:#302925;color:#f5b99e;font-size:12px}
#editor :focus-visible{outline-color:#ffbc9b}
@media(max-width:680px){#editor .preview-panel{padding:0 4px 4px}.editor-head{height:50px}.project-identity small{font-size:8px}#editor .panel-title,#editor .preview-tools{height:40px}#conversation{padding:16px}#chatForm{margin:8px}.blueprint{margin-bottom:12px}}
@media(prefers-reduced-motion:reduce){.run-badge:before{animation:none!important}}
#previewNotice{position:absolute;inset:auto auto 12px 50%;transform:translateX(-50%);z-index:1;max-width:95%;width:max-content;background:#262728;color:#f6f2ed;border:1px solid #545151;box-shadow:0 3px 10px #0003;border-radius:12px;display:flex;align-items:center;padding:7px 11px;gap:10px;font:12px/1.4 var(--sans)}#latestPreview{font-weight:600;color:#ffb79a}
.file-folder{display:flex;flex-direction:column}.file-folder summary{display:flex;align-items:center;gap:6px;padding:7px 4px;cursor:pointer;color:#c5bdb4;font-size:12px}.file-folder summary:before{content:"›"}.file-folder[open]>summary:before{transform:rotate(90deg)}.file-folder .file-item{margin-left:12px}.file-browser .file-item[data-name]{display:flex;align-items:center;gap:6px;width:fit-content}.file-browser nav i{width:13px;height:13px}.file-folder .file-item span{min-width:0}.file-browser nav{background:#252628}.file-browser,.file-browser pre{background:#1b1c1e}.file-browser .file-item[aria-pressed=true]{background:#443730;color:#ffcfb7}
@media(max-width:640px){.file-browser{display:flex;flex-direction:column;min-height:100%}.file-browser nav{max-height:25vh;overflow-y:auto;display:block}.file-browser nav .file-item{display:inline-flex}.file-browser article{flex:1}}
#sourcePulse{display:flex;align-items:center;gap:8px;padding:0 14px 12px;color:#c4b6ad;font:11px/1.5 var(--sans)}#sourcePulse>span:first-child{height:3px;width:34px;border-radius:2px;background:linear-gradient(90deg,#8f6a58,#ffc5a9,#8f6a58);background-size:200% 100%;animation:stream-flow 1.5s linear infinite}@keyframes stream-flow{to{background-position:200% 0}}@media(prefers-reduced-motion:reduce){#sourcePulse>span:first-child{animation:none}}

/* Document and source workspaces share a light reading surface. */
#editor #filesView,
#editor #codeView {
  color-scheme: light;
  color: #272823;
  background: #faf9f7;
  --line: #dddcd8;
  --ink: #272823;
  --muted: #62635e;
  --surface: #fff;
}
.library { padding: clamp(18px, 3vw, 48px); }
.library-header, .library-tools, .library-filters {
  display: flex;
  align-items: center;
  gap: 12px;
}
.library-header, .library-tools { justify-content: space-between; flex-wrap: wrap; }
.library-header h2 { margin: 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.045em; }
.library-header p, .library-empty p { color: #60615d; font-size: 14px; line-height: 1.5; }
.library-header p { margin: 6px 0 0; }
.library-tools { border-block: 1px solid #dfdeda; padding: 13px 0; margin: 26px 0 18px; }
.library-filters { gap: 3px; flex-wrap: wrap; }
.library-filters button { padding: 7px 10px; border-radius: 18px; font-size: 13px; }
.library-filters [aria-pressed=true] { background: #30332f; color: white; }
#findReference, #findSource { min-width: 0; border: 1px solid #d4d3ce; border-radius: 8px; background: white; color: #22251f; padding: 8px 10px; font-size: 13px; }
#libraryList { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(155px, 100%), 1fr)); }
.library-file { display: grid; gap: 5px; padding: 9px 9px 12px; border-radius: 12px; border: 1px solid #deddd8; color: inherit; background: white; text-decoration: none; min-width: 0; }
.library-file:hover { border-color: #a48370; }
.library-file b { font-size: 13px; overflow-wrap: anywhere; }
.library-file small { color: #62635e; font-size: 11px; }
.library-tile { display: grid; place-items: center; aspect-ratio: 1.65; overflow: hidden; border-radius: 6px; background: #f0ede8; margin-bottom: 4px; }
.library-tile img { width: 100%; height: 100%; object-fit: cover; }
.library-tile i { height: 28px; width: 28px; color: #816a59; }
.library-empty { grid-column: 1 / -1; display: grid; justify-items: center; text-align: center; padding: clamp(26px, 7vh, 72px) 15px; border: 1px dashed #cbc9c2; border-radius: 12px; }
.library-empty i { width: 28px; height: 28px; color: #88735f; }
.library-empty h3 { margin: 10px 0 0; font-size: 17px; }
.library-empty p { margin: 5px 0 0; }
#codeView .file-browser { height: 100%; min-height: 0; grid-template-columns: clamp(160px, 22%, 260px) minmax(0, 1fr); background: #fff; color: #29302c; }
.source-sidebar { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid #dddcd8; background: #f6f5f2; }
.source-sidebar > header { display: grid; gap: 10px; padding: 15px 10px 10px; font-size: 13px; }
.source-sidebar > button { margin: 9px; }
#codeView #projectFiles { overflow: auto; flex: 1; padding: 2px 6px 10px; background: transparent; }
#codeView .file-folder summary { color: #655f58; }
#codeView .file-item { color: #373834; }
#codeView .file-item:hover, #codeView .file-item[aria-pressed=true] { color: #402c20; background: #ebe3d9; }
.source-no-match { margin: 8px; color: #655f58; font-size: 12px; }
#codeView article { display: flex; flex-direction: column; min-height: 0; overflow: auto; }
#codeView .file-heading { position: sticky; top: 0; background: #fdfcfb; border-bottom: 1px solid #deded8; min-height: 43px; gap: 8px; padding: 7px 12px; }
#codeView .file-heading span { overflow-wrap: anywhere; }
#codeView .file-heading button { flex: none; border-color: #cccac4; }
#codeView pre { min-height: 0; background: #fff; color: #253b46; font: 13px/1.65 Consolas, monospace; tab-size: 2; }
#codeView #fileImage { align-self: center; margin: 12px 0; max-width: calc(100% - 24px); }
@media (min-width: 681px) {
  #editor.wide-workspace .workbench { grid-template-columns: minmax(0, 1fr); }
  #editor.wide-workspace .chat-panel { display: none; }
}
@media (max-width: 680px) {
  #focusWorkspace { display: none; }
  #editor .preview-tools { gap: 2px; }
  #editor .preview-tools .tabs { overflow-x: auto; min-width: 0; }
  #editor .tabs button { gap: 4px; padding: 5px 7px; }
  #editor .tabs button i { display: none; }
  #codeView .file-browser { display: flex; flex-direction: column; }
  .source-sidebar { flex: none; max-height: 38%; border-right: 0; border-bottom: 1px solid #deddd8; }
  .source-sidebar > header { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; }
  .source-sidebar > button { align-self: flex-start; margin: 3px 8px 6px; min-height: 24px; }
  #codeView article { flex: 1; }
  #findSource { max-width: 54%; }
  #findReference { width: 100%; }
}
