:root {
  --sans:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    sans-serif;
  --paper: #f6f6f2;
  --white: #fff;
  --ink: #262d29;
  --muted: #7b827c;
  --line: #e3e6df;
  --green: #355d55;
  --soft: #eaf0e9;
  --serif: Georgia, "Songti SC", "STSong", serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  font:
    14px/1.6 -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  background: var(--paper);
}
[hidden] {
  display: none !important;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.5;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}
input,
textarea,
select {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  width: 100%;
  outline: none;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px #355d5510;
}
textarea {
  resize: vertical;
}
button {
  border: 0;
  background: none;
  color: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
.primary,
.secondary {
  border-radius: 6px;
  padding: 10px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  white-space: nowrap;
  font-weight: 500;
  min-height: 42px;
}
.primary {
  background: var(--green);
  color: #fff;
}
.primary:hover {
  background: #294b44;
}
.secondary {
  background: var(--white);
  border: 1px solid var(--line);
}
.secondary:hover {
  background: #f1f3ed;
}
.full {
  width: 100%;
}
.text-button {
  color: var(--muted);
  font-size: 12px;
  padding: 6px 8px;
}
.text-button:hover {
  color: var(--green);
  background: var(--soft);
  border-radius: 4px;
}
.icon-button {
  font-size: 20px;
  color: var(--muted);
  padding: 0 5px;
}
.fine,
.muted {
  color: var(--muted);
  font-size: 12px;
}
.wordmark {
  font-family: var(--serif);
  font-size: 29px;
  letter-spacing: 3px;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.wordmark span {
  font:
    9px/1.5 -apple-system,
    sans-serif;
  letter-spacing: 2px;
  margin-top: 6px;
  color: var(--muted);
}
.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 218px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: #f0f1eb;
  padding: 32px 22px;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
}
.workspace-label {
  font-size: 11px;
  color: var(--muted);
  margin: 26px 0 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nav {
  text-align: left;
  padding: 10px 13px;
  color: #6d766e;
  border-radius: 5px;
  display: flex;
  justify-content: space-between;
}
.nav.active {
  background: #e1e8de;
  color: var(--green);
  font-weight: 600;
}
.nav span {
  font-size: 11px;
}
.sidebar-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
  margin: 32px 10px 12px;
  letter-spacing: 1px;
}
.project-list {
  overflow-y: auto;
  flex: 1;
}
.project-link {
  display: block;
  text-align: left;
  width: 100%;
  padding: 9px 12px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 4px;
  color: #656e65;
}
.project-link.selected {
  background: #e5e9e1;
  color: var(--green);
}
.sidebar-bottom {
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 3px;
}
.edition {
  font-size: 10px;
  color: #707a70;
  margin-right: auto;
}
.main-area {
  margin-left: 218px;
  min-width: 0;
  width: calc(100% - 218px);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-weight: 500;
}
h2 {
  font-size: 16px;
  font-weight: 500;
}
h3 {
  font-size: 13px;
  margin: 22px 0 10px;
  font-weight: 600;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 18px;
}
.dashboard,
.library-screen {
  padding: 54px 56px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 54px;
}
.page-heading h1 {
  font-family: var(--serif);
  font-size: 34px;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.page-heading p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 0;
}
.dashboard-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.dashboard-title h2 {
  margin: 0;
}
.dashboard-title span {
  font-size: 11px;
  color: var(--muted);
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 22px;
}
.project-card {
  text-align: left;
  padding: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  transition: transform 0.15s;
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: #abb9ab;
}
.project-cover {
  height: 210px;
  background: #eef0e9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
}
.project-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.project-cover.no-image {
  font: 58px var(--serif);
  color: #bec9bd;
}
.project-info {
  padding: 18px 18px 19px;
}
.project-info h3 {
  font-size: 14px;
  margin: 0 0 6px;
  font-weight: 500;
}
.project-info p {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  margin: 0;
}
.empty-grid {
  grid-column: 1/-1;
  padding: 72px 20px;
  border: 1px dashed #cfd6cb;
  text-align: center;
  color: var(--muted);
  border-radius: 8px;
}
.empty-grid h2 {
  color: var(--ink);
  font: 23px var(--serif);
}
.project-header {
  height: 79px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  gap: 20px;
  background: #fafaf7;
}
.project-breadcrumb,
.header-actions {
  display: flex;
  align-items: center;
  gap: 13px;
}
.project-breadcrumb h1 {
  font-size: 15px;
  margin: 0;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-breadcrumb > span {
  color: #bac0b5;
}
.status-tag {
  background: var(--soft);
  color: var(--green) !important;
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 3px;
  white-space: nowrap;
}
.header-actions .primary,
.header-actions .secondary {
  font-size: 12px;
  min-height: 35px;
  padding: 7px 12px;
}
.stagebar {
  display: flex;
  align-items: center;
  height: 70px;
  padding: 0 36px;
  border-bottom: 1px solid var(--line);
  gap: 14px;
  background: #fafaf7;
}
.stagebar button {
  font-size: 12px;
  color: var(--muted);
  padding: 10px 5px;
}
.stagebar button b {
  font: 11px Georgia;
  margin-right: 8px;
  color: #a3afa0;
}
.stagebar button.active {
  color: var(--green);
  font-weight: 600;
}
.stagebar button.active b {
  color: var(--green);
}
.stagebar i {
  width: 32px;
  height: 1px;
  background: var(--line);
}
.stagebar > span {
  margin-left: auto;
  font-size: 10px;
}
.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  height: calc(100vh - 149px);
  min-height: 620px;
}
.canvas-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #f0f1eb;
  position: relative;
}
.canvas-toolbar {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-size: 12px;
  gap: 10px;
}
.canvas-toolbar > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.canvas-area {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 240px;
  padding: 16px 40px 25px;
  overflow: hidden;
}
.image-stage {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  line-height: 0;
  display: flex;
  justify-content: center;
}
.image-stage img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 440px);
  object-fit: contain;
  min-height: 100px;
  box-shadow: 0 3px 16px #26362908;
}
.image-stage svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.image-stage.annotating {
  cursor: crosshair;
}
.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 35px 20px;
}
.empty-number {
  font: 64px var(--serif);
  color: #c6cfc2;
  display: block;
  margin-bottom: 16px;
}
.empty-state h2 {
  font: 24px var(--serif);
  color: #535e53;
}
.empty-state p {
  font-size: 12px;
  margin: 16px 0 24px;
}
.version-section {
  background: #f8f9f4;
  border-top: 1px solid var(--line);
  padding: 15px 24px 12px;
}
.section-label {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 11px;
}
.section-label span {
  letter-spacing: 0;
}
.revision-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  min-height: 85px;
}
.revision-card {
  flex: 0 0 83px;
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 5px;
  position: relative;
  text-align: left;
  background: #f0f2eb;
}
.revision-card.selected {
  border-color: var(--green);
  background: #e6eee3;
}
.revision-card img {
  width: 71px;
  height: 58px;
  object-fit: contain;
  display: block;
  background: white;
}
.revision-card span {
  font-size: 9px;
  color: #6c766b;
  display: block;
  margin-top: 4px;
}
.revision-card .final-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  color: var(--green);
  background: #fff;
  border-radius: 3px;
  font-size: 9px;
  padding: 0 3px;
}
.canvas-footer {
  padding: 9px 24px;
  background: #f8f9f4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
  min-height: 39px;
}
.assistant-pane {
  background: #fff;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.assistant-heading {
  padding: 20px 22px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.assistant-heading h2 {
  font-size: 13px;
  margin: 0;
}
.assistant-heading span {
  font-size: 10px;
  color: var(--muted);
}
.reference-section {
  padding: 0 22px 12px;
  border-bottom: 1px solid var(--line);
}
.reference-strip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  min-height: 10px;
}
.reference-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px;
  flex-shrink: 0;
  line-height: 0;
}
.reference-card.selected {
  border-color: var(--green);
  background: var(--soft);
}
.reference-card img {
  width: 48px;
  height: 48px;
  object-fit: cover;
}
.reference-placeholder {
  font-size: 11px;
  color: #9da59b;
  padding: 7px 0;
}
.reference-section > .text-button {
  padding-left: 0;
  margin-top: 5px;
  font-size: 10px;
}
.message-list {
  overflow-y: auto;
  flex: 1;
  padding: 20px 22px;
  min-height: 140px;
  scroll-behavior: smooth;
}
.message {
  margin-bottom: 20px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.9;
}
.message .role {
  display: block;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 7px;
}
.message.user {
  background: #f2f4ee;
  padding: 12px;
  border-radius: 6px;
}
.message p {
  margin: 0;
}
.message-empty {
  color: #929b8e;
  font-size: 12px;
  line-height: 2;
  margin-top: 10px;
}
.composer-wrap {
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
}
.stage-context {
  font-size: 10px;
  color: var(--green);
  margin-bottom: 8px;
}
.composer-wrap form {
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 10px;
}
.composer-wrap textarea {
  font-size: 12px;
  line-height: 1.7;
  border: 0;
  box-shadow: none;
  min-height: 90px;
  resize: vertical;
  max-height: 190px;
}
.composer-actions {
  padding: 0 7px 7px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.composer-actions .secondary {
  min-height: 29px;
  padding: 4px 11px;
  font-size: 11px;
}
.composer-actions .text-button {
  font-size: 10px;
  padding: 4px;
}
.composer-wrap .primary {
  min-height: 38px;
  font-size: 12px;
}
.composer-wrap > .fine {
  font-size: 9px;
  line-height: 1.6;
  margin: 9px 0 0;
}
.job-banner {
  margin: 0 24px 12px;
  background: #e2ebe0;
  border: 1px solid #d5dfd1;
  border-radius: 5px;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 11px;
}
.job-banner > .text-button {
  margin-left: auto;
}
.spinner {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid #b1c2ad;
  border-top-color: var(--green);
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.annotation-hint {
  padding: 10px 22px;
  font-size: 11px;
  background: #e8eee2;
  color: var(--green);
}
.annotation-hint button {
  font-size: 10px;
  min-height: 29px;
  padding: 5px 8px;
  margin-left: 8px;
}
.library-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
}
.library-toolbar input {
  max-width: 330px;
}
.library-toolbar select {
  max-width: 190px;
}
.library-toolbar .secondary {
  margin-left: auto;
  font-size: 12px;
}
.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}
.knowledge-card {
  text-align: left;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  overflow: hidden;
}
.knowledge-card img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  background: #f3f4ee;
  margin-bottom: 14px;
}
.knowledge-card h3 {
  margin: 9px 0;
  font-weight: 500;
  font-size: 14px;
}
.knowledge-card p {
  font-size: 12px;
  color: var(--muted);
  white-space: pre-line;
  max-height: 76px;
  overflow: hidden;
  margin-bottom: 10px;
}
.knowledge-card .tagline {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}
.knowledge-card .confirmed {
  color: var(--green);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  max-width: 620px;
  width: calc(100% - 36px);
  max-height: 90vh;
  overflow-y: auto;
  color: var(--ink);
  box-shadow: 0 20px 80px #17221a20;
}
dialog::backdrop {
  background: #15221b4a;
}
dialog label {
  display: block;
  font-size: 12px;
  margin-bottom: 14px;
}
dialog input,
dialog textarea,
dialog select {
  display: block;
  margin-top: 6px;
  font-size: 13px;
}
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.dialog-header h2 {
  font: 24px var(--serif);
  margin: 0;
}
.dialog-header button {
  font-size: 24px;
  color: var(--muted);
  line-height: 1;
}
.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.check {
  display: flex !important;
  gap: 9px;
  align-items: flex-start;
  line-height: 1.6;
}
.check input {
  width: auto;
  margin: 4px 0 0;
  accent-color: var(--green);
}
.dimension-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.knowledge-choices {
  max-height: 160px;
  overflow: auto;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 5px;
}
.knowledge-choices label {
  margin-bottom: 9px;
  font-size: 11px;
}
.export-options {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 20px 0;
}
.export-options button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 15px;
  text-align: left;
}
.export-options button:hover {
  background: var(--soft);
}
.export-options b {
  font-size: 13px;
  font-weight: 500;
  display: block;
}
.export-options span {
  font-size: 11px;
  color: var(--muted);
}
.oauth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  margin-top: 20px;
  gap: 12px;
}
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.auth-panel {
  width: 390px;
  padding: 35px;
}
.auth-panel h1 {
  font: 28px var(--serif);
  margin: 46px 0 12px;
}
.auth-panel p {
  color: var(--muted);
  font-size: 12px;
}
.auth-panel label {
  font-size: 12px;
  display: block;
  margin: 18px 0;
}
.auth-panel input {
  margin-top: 7px;
}
.auth-panel #auth-error {
  color: #a24b35;
  min-height: 18px;
}
.auth-panel > .fine {
  text-align: center;
  margin-top: 25px;
}
.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  max-width: min(90vw, 700px);
  border-radius: 6px;
  background: #263f36;
  color: white;
  font-size: 12px;
  z-index: 1000;
  box-shadow: 0 5px 20px #0002;
}
.toast.error {
  background: #824b3a;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (min-width: 1700px) {
  .studio-layout {
    grid-template-columns: minmax(0, 1fr) 380px;
  }
  .image-stage img {
    max-height: calc(100vh - 420px);
  }
}
@media (max-width: 1150px) {
  .sidebar {
    width: 180px;
    padding: 25px 16px;
  }
  .main-area {
    margin-left: 180px;
    width: calc(100% - 180px);
  }
  .studio-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .dashboard,
  .library-screen {
    padding: 35px 28px;
  }
  .project-header {
    padding: 0 20px;
  }
  .canvas-toolbar {
    padding: 0 15px;
  }
  .canvas-area {
    padding: 15px;
  }
  .stagebar {
    padding: 0 20px;
    gap: 8px;
  }
  .stagebar i {
    width: 15px;
  }
  .project-breadcrumb h1 {
    max-width: 160px;
  }
  .header-actions #save-state {
    display: none;
  }
  .assistant-heading,
  .reference-section,
  .message-list {
    padding-left: 16px;
    padding-right: 16px;
  }
}
@media (max-width: 850px) {
  .sidebar {
    width: 135px;
    padding: 22px 12px;
  }
  .main-area {
    margin-left: 135px;
    width: calc(100% - 135px);
  }
  .studio-layout {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
  }
  .canvas-area {
    min-height: 360px;
  }
  .image-stage img {
    max-height: 480px;
  }
  .assistant-pane {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .message-list {
    max-height: 350px;
    min-height: 120px;
  }
  .reference-section {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
  }
  .reference-section .section-label {
    width: 100%;
  }
  .composer-wrap {
    display: block;
  }
  .project-header {
    height: auto;
    min-height: 75px;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 14px 20px;
  }
  .project-breadcrumb h1 {
    max-width: 280px;
  }
  .header-actions {
    align-self: flex-end;
  }
  .stagebar > span {
    display: none;
  }
  .stagebar {
    height: 55px;
  }
  .page-heading {
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
  }
  .page-heading h1 {
    font-size: 27px;
  }
  .page-heading > .primary {
    font-size: 12px;
    padding: 9px;
  }
  .library-toolbar {
    flex-wrap: wrap;
  }
  .library-toolbar .secondary {
    margin: 0;
  }
  .sidebar-bottom {
    flex-wrap: wrap;
  }
  .sidebar-bottom .edition {
    width: 100%;
  }
  .sidebar-section {
    margin-top: 22px;
    font-size: 9px;
  }
}
@media (max-width: 540px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 14px 18px;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar .wordmark {
    font-size: 24px;
    flex-shrink: 0;
  }
  .sidebar .wordmark span,
  .workspace-label,
  .sidebar-section,
  .project-list,
  .sidebar-bottom .edition {
    display: none;
  }
  .sidebar nav {
    flex-direction: row;
    margin-left: auto;
    gap: 0;
  }
  .nav {
    font-size: 11px;
    padding: 7px 8px;
  }
  .nav span {
    display: none;
  }
  .sidebar-bottom {
    border: 0;
    padding: 0;
    gap: 0;
  }
  .sidebar-bottom .text-button {
    font-size: 10px;
    padding: 5px;
  }
  .sidebar-bottom #logout {
    display: none;
  }
  .main-area {
    margin: 0;
    width: 100%;
  }
  .dashboard,
  .library-screen {
    padding: 30px 20px;
  }
  .page-heading {
    flex-direction: column;
    gap: 18px;
  }
  .page-heading h1 {
    font-size: 29px;
  }
  .project-header {
    padding: 13px 16px;
  }
  .project-breadcrumb {
    gap: 6px;
  }
  .project-breadcrumb h1 {
    max-width: 190px;
  }
  .stagebar {
    padding: 0 10px;
    gap: 5px;
  }
  .stagebar button {
    font-size: 11px;
    padding: 8px 4px;
  }
  .stagebar button b {
    margin-right: 4px;
  }
  .stagebar i {
    width: 12px;
  }
  .canvas-toolbar {
    height: auto;
    min-height: 50px;
    flex-wrap: wrap;
    padding: 9px 15px;
  }
  .canvas-toolbar .text-button {
    font-size: 10px;
    padding: 4px;
  }
  .canvas-area {
    min-height: 300px;
    padding: 14px 20px;
  }
  .image-stage img {
    max-height: 430px;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
  .project-cover {
    height: 260px;
  }
  .dimension-grid {
    gap: 0 10px;
  }
  .library-toolbar input,
  .library-toolbar select {
    max-width: none;
  }
  .annotation-hint button {
    margin: 6px 5px 0 0;
  }
  .canvas-footer {
    padding: 9px 15px;
  }
  .version-section {
    padding-left: 15px;
    padding-right: 15px;
  }
  .job-banner {
    margin-left: 15px;
    margin-right: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* The image fits the available canvas, including short desktop windows. */
.image-stage {
  flex-shrink: 0;
  align-items: center;
}
.image-stage img {
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
}
@media (max-width: 850px) {
  .canvas-area {
    height: 460px;
    flex: none;
  }
  .image-stage img {
    max-height: 100%;
  }
}
@media (max-width: 540px) {
  .canvas-area {
    height: 380px;
  }
}
/* Restore the useful voice-first design interactions while keeping project persistence. */
.dashboard .page-heading {
  margin-bottom: 28px;
}
.start-design {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 30px;
  align-items: center;
  padding: 27px 30px;
  margin-bottom: 30px;
  border: 1px solid #dbe3d6;
  background: #edf2e8;
  border-radius: 12px;
}
.assistant-name {
  font-size: 11px;
  color: #42634c;
  letter-spacing: 0.5px;
}
.start-design-copy h2 {
  font-family: var(--serif);
  font-size: 24px;
  margin: 10px 0;
}
.start-design-copy p {
  font-size: 12px;
  color: #687a66;
  margin: 0;
}
.start-design form {
  background: white;
  border: 1px solid #d6dfce;
  border-radius: 8px;
  overflow: hidden;
}
.start-design textarea {
  border: 0;
  background: transparent;
  box-shadow: none;
  min-height: 78px;
  resize: vertical;
}
.workflow-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.workflow-heading h2 {
  font-size: 14px;
  margin: 0;
}
.workflow-heading span {
  font-size: 11px;
  color: var(--muted);
}
.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 35px;
}
.workflow-grid button {
  padding: 19px 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.workflow-grid button:hover {
  border-color: #aabd9c;
  background: #f7faf4;
}
.workflow-grid b {
  font: 12px var(--serif);
  color: #9ba98e;
  float: right;
}
.workflow-grid strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #344632;
  margin-bottom: 7px;
}
.workflow-grid span {
  font-size: 11px;
  color: #7c8876;
  display: block;
  line-height: 1.6;
}
.message-replay {
  font-size: 10px;
  color: #78916b;
  padding: 5px 0;
  margin-top: 7px;
}
.assistant-heading h2 {
  font-weight: 600;
  color: #3c5636;
}
.assistant-heading span {
  font-size: 9px;
}
.composer-wrap {
  flex-shrink: 0;
}
.project-mobile-tabs {
  display: none;
}
.composer-wrap .stage-context {
  font-size: 11px;
}
.auth-panel #auth-desc {
  line-height: 1.9;
}
.project-header {
  background: #f6f8f0;
}
.empty-state p {
  max-width: 360px;
  line-height: 1.9;
}
.message-list {
  min-height: 70px;
}
.assistant-pane {
  overflow-y: auto;
}
.assistant-heading,
.reference-section {
  flex-shrink: 0;
}
@media (min-width: 1001px) {
  .studio-layout {
    grid-template-columns: minmax(0, 1fr) 375px;
    height: calc(100vh - 149px);
    min-height: 780px;
  }
  .assistant-pane .composer-wrap {
    order: 1;
  }
  .assistant-pane .message-list {
    order: 0;
    flex: 1;
    min-height: 100px;
  }
  .assistant-pane .assistant-heading {
    order: -2;
  }
  .assistant-pane .reference-section {
    order: -1;
  }
}
@media (max-width: 1000px) {
  .start-design {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px;
  }
  .workflow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .project-mobile-tabs {
    display: flex;
    gap: 5px;
    padding: 8px 18px;
    border-bottom: 1px solid var(--line);
    background: #f8faf3;
  }
  .project-mobile-tabs button {
    flex: 1;
    padding: 9px 7px;
    font-size: 12px;
    color: #7b8872;
    border-radius: 6px;
  }
  .project-mobile-tabs button.active {
    background: #e4ecdc;
    color: #365734;
    font-weight: 600;
  }
  .studio-layout {
    display: block;
    height: auto;
    min-height: 0;
  }
  .project-screen[data-panel="voice"] .canvas-pane {
    display: none;
  }
  .project-screen[data-panel="canvas"] .assistant-pane {
    display: none;
  }
  .assistant-pane {
    border-left: 0;
    overflow: visible;
  }
  .assistant-heading {
    order: 0;
    padding: 18px 22px;
  }
  .reference-section {
    order: 2;
  }
  .message-list {
    order: 3;
    max-height: 440px;
    min-height: 120px;
  }
  .composer-wrap {
    order: 1;
    padding: 0 22px 20px;
    border-top: 0;
  }
  .speech-controls .check,
  .speech-controls .text-button {
    font-size: 11px;
  }
  .generation-note {
    font-size: 10px;
  }
  .canvas-area {
    height: 420px;
    flex: none;
  }
}
@media (max-width: 540px) {
  .dashboard .page-heading {
    margin-bottom: 22px;
  }
  .page-heading h1 {
    font-size: 29px;
  }
  .start-design {
    padding: 20px 16px;
    margin-bottom: 26px;
  }
  .start-design-copy h2 {
    font-size: 22px;
  }
  .workflow-grid {
    gap: 9px;
  }
  .workflow-grid button {
    padding: 16px 13px;
  }
  .workflow-grid strong {
    font-size: 13px;
  }
  .workflow-heading span {
    display: none;
  }
  .dashboard,
  .library-screen {
    padding: 26px 18px;
  }
  .sidebar .wordmark {
    font-size: 23px;
  }
  .composer-wrap {
    padding-left: 18px;
    padding-right: 18px;
  }
  .studio-layout {
    min-height: 0;
  }
  .project-header {
    padding: 14px 18px;
  }
  .canvas-area {
    height: 420px;
  }
}

.account-password {
  padding: 15px 0;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.account-password summary {
  cursor: pointer;
  color: var(--green);
  font-size: 13px;
}
.account-password form {
  margin-top: 15px;
}
/* Keep voice/text controls visible immediately, including short desktop windows. */
@media (min-width: 1001px) {
  .studio-layout {
    height: calc(100dvh - 149px);
    min-height: 560px;
  }
  .assistant-pane .assistant-heading {
    order: -2;
  }
  .assistant-pane .composer-wrap {
    order: -1;
    padding-top: 2px;
  }
  .assistant-pane .reference-section {
    order: 0;
  }
  .assistant-pane .message-list {
    order: 1;
    flex: 1;
    min-height: 65px;
  }
  .reference-section:has(.reference-placeholder) {
    padding-bottom: 6px;
  }
  .reference-section:has(.reference-placeholder) .reference-placeholder,
  .reference-section:has(.reference-placeholder) #analyze-reference {
    display: none;
  }
}
@media (min-width: 1001px) {
  .canvas-pane {
    min-height: 0;
    overflow: hidden;
  }
  .canvas-area {
    min-height: 180px;
    flex: 1 1 0;
  }
  .image-stage {
    min-height: 0;
  }
  .assistant-pane {
    min-height: 0;
  }
}

/* A single composer for typing, dictation and references. */
.start-design form.design-composer,
.composer-wrap form.design-composer {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  background: #fafbf8;
  border: 1px solid #d8ddd3;
  border-radius: 18px;
  padding: 5px;
  margin: 0;
  box-shadow: 0 2px 6px #24312405;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.design-composer:focus-within {
  border-color: #8d9f86 !important;
  box-shadow: 0 0 0 3px #5474460b !important;
}
.design-composer textarea {
  display: block;
  width: 100%;
  padding: 12px 12px 6px;
  font: 13px/1.75 var(--sans);
  border: 0;
  background: transparent;
  border-radius: 12px;
  min-height: 76px;
  max-height: 180px;
  resize: none;
  box-shadow: none;
  outline: none;
}
.design-composer textarea::placeholder {
  color: #90978c;
}
.design-composer textarea[readonly] {
  color: #7c8377;
}
.compose-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 6px;
}
.compose-spacer {
  flex: 1;
}
.compose-icon,
.compose-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  padding: 6px;
  border-radius: 50%;
  color: #5e6958;
  background: transparent;
  border: 0;
  font-size: 23px;
  line-height: 1;
}
.compose-icon:hover {
  background: #e9ede4;
}
.compose-icon:focus-visible,
.compose-send:focus-visible,
.compose-language-picker:focus-within {
  outline: 2px solid #56764b;
  outline-offset: 2px;
}
.compose-icon svg,
.compose-send svg {
  width: 20px;
  height: 20px;
}
.compose-mic[aria-pressed="true"] {
  color: #a34b3c;
  background: #f6e6e1;
}
.compose-send {
  background: #354d32;
  color: white;
  margin-left: 3px;
}
.compose-send:hover {
  background: #263e23;
}
.compose-send:disabled {
  background: #e2e7dc;
  color: #9ba590;
  opacity: 1;
}
.stop-square {
  display: none;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: currentColor;
}
.compose-send.is-stop svg {
  display: none;
}
.compose-send.is-stop .stop-square {
  display: block;
}
.compose-language-picker {
  display: inline-flex;
  border: 0;
  flex-shrink: 0;
  touch-action: manipulation;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 9px;
  color: #52624f;
  background: #ecefe7;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.compose-language-picker:hover {
  background: #e3e9df;
  color: #324a2d;
}
.compose-language-picker:focus-within {
  outline: 2px solid #56764b;
  outline-offset: 2px;
}
.compose-language-picker > svg:first-child {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}
.compose-language-picker [data-language-label] {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  pointer-events: none;
}
.compose-language-picker .language-chevron {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  opacity: 0.72;
  pointer-events: none;
}
.compose-language-picker > svg { pointer-events: none; }
.language-dialog {
  position: fixed;
  width: min(340px, calc(100% - 32px));
  padding: 20px;
  overscroll-behavior: contain;
}
.language-dialog .dialog-header { margin-bottom: 14px; }
.language-dialog .dialog-header h2 { font: 600 17px var(--sans); }
.language-options { display: grid; gap: 6px; }
.language-options button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  text-align: left;
  touch-action: manipulation;
}
.language-options button:hover { background: var(--soft); }
.language-options button[aria-pressed="true"] { background: var(--soft); color: var(--green); font-weight: 600; }
.language-options .language-check { visibility: hidden; }
.language-options button[aria-pressed="true"] .language-check { visibility: visible; }
.language-dialog > .fine { margin: 14px 0 0; }
@media (max-width: 600px) {
  .compose-language-picker { min-height: 44px; padding: 0 10px; }
  .language-dialog {
    inset: auto 0 0;
    margin: 0;
    width: 100%;
    max-width: none;
    max-height: 85vh;
    max-height: 85dvh;
    border-radius: 18px 18px 0 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  }
}
.compose-feedback {
  margin: 0;
  padding: 3px 12px 7px;
  font-size: 10px;
  line-height: 1.5;
  color: #92998b;
}
.compose-feedback.error {
  color: #a44935;
}
.dictation-panel {
  margin: 2px 6px 4px;
  padding: 8px 10px;
  background: #eef2e8;
  border-radius: 12px;
}
.dictation-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #66745b;
  font-variant-numeric: tabular-nums;
}
.recording-dot {
  width: 6px;
  height: 6px;
  background: #af5f4a;
  border-radius: 50%;
}
.dictation-top .compose-icon {
  width: 28px;
  height: 28px;
  font-size: 18px;
}
.confirm-dictation {
  background: #3f5836;
  color: white;
}
.confirm-dictation:hover {
  background: #2f4428;
}
.dictation-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  height: 22px;
}
.dictation-wave i {
  display: block;
  width: 3px;
  height: 6px;
  border-radius: 3px;
  background: #7f9571;
  transition: height 0.1s;
}
[data-phase="recording"] .dictation-wave i {
  height: calc(5px + var(--voice-level, 0.15) * 18px);
}
[data-phase="recording"] .dictation-wave i:nth-child(2n) {
  height: calc(4px + var(--voice-level, 0.15) * 10px);
}
.dictation-transcript {
  font-size: 12px;
  color: #526447;
  line-height: 1.6;
  max-height: 68px;
  overflow: auto;
  margin: 5px 0 0;
}
.dictation-transcript:empty {
  display: none;
}
.draft-attachments {
  padding: 3px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.draft-attachments button {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #dce4d5;
  border-radius: 7px;
  background: #eef3e9;
  padding: 5px 8px;
  font-size: 11px;
  color: #567148;
}
.speech-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 2px;
}
.speech-controls .check {
  margin: 0;
  font-size: 11px;
  color: #7b8672;
  display: flex;
  align-items: center;
  gap: 5px;
}
.speech-controls .check input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: #547446;
}
.speech-controls .text-button {
  padding: 2px 0;
  font-size: 11px;
  color: #7b8672;
}
.speech-controls #speak-last {
  margin-left: auto;
}
.speech-status {
  font-size: 10px;
  color: #6c805e;
  margin: 0 2px 10px;
}
.composer-wrap {
  padding: 14px 18px 16px;
}
#generate {
  background: #edf1e7;
  color: #526d43;
  border: 1px solid #e2e8db;
  box-shadow: none;
}
#generate:hover {
  background: #e4ebda;
}
@media (min-width: 1001px) {
  .studio-layout {
    grid-template-columns: minmax(0, 1fr) 390px;
    min-height: 510px;
  }
  .assistant-pane .assistant-heading {
    order: 0;
  }
  .assistant-pane .reference-section {
    order: 1;
  }
  .assistant-pane .message-list {
    order: 2;
    flex: 1;
    min-height: 100px;
  }
  .assistant-pane .composer-wrap {
    order: 3;
    padding-top: 12px;
  }
}
@media (max-width: 1000px) {
  .assistant-pane {
    min-height: calc(100dvh - 185px);
    display: flex;
  }
  .assistant-heading {
    order: 0;
  }
  .reference-section {
    order: 1;
  }
  .message-list {
    order: 2;
    flex: 1;
    min-height: 150px;
    max-height: none;
  }
  .composer-wrap {
    order: 3;
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid var(--line);
    padding-top: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}
@media (max-width: 540px) {
  .compose-icon,
  .compose-send {
    width: 38px;
    height: 38px;
  }
  .compose-language-picker { gap: 5px; padding: 0 7px; }
  .start-design .design-composer {
    min-width: 0;
  }
  .composer-wrap > .fine {
    font-size: 10px;
  }
}

/* A common icon language for navigation, actions and workflow states. */
.ui-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  vertical-align: middle;
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
}
.has-ui-icon { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.nav.has-ui-icon { justify-content: flex-start; }
.nav.has-ui-icon > span[id] { margin-left: auto; }
.ui-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 8px;
  border-radius: 8px;
}
button.ui-icon-only:hover { background: #355d5510; color: var(--green); }
button:not(:disabled):hover > .ui-icon { transform: translateY(-1px) scale(1.06); }
button:not(:disabled):active > .ui-icon { transform: scale(.92); }
.workflow-grid button { position: relative; padding: 20px 18px 20px 70px; min-height: 104px; transition: background 180ms, border-color 180ms, box-shadow 180ms, transform 180ms; }
.workflow-grid .workflow-icon {
  display: flex; align-items: center; justify-content: center;
  position: absolute; left: 18px; top: 20px;
  width: 36px; height: 36px; border-radius: 10px;
  background: #edf2e9; color: #52714b;
  transition: background 180ms, transform 180ms;
}
.workflow-icon .ui-icon { width: 22px; height: 22px; }
.workflow-grid button:hover { transform: translateY(-2px); box-shadow: 0 5px 16px #355d5509; }
.workflow-grid button:hover .workflow-icon { background: #e0eadb; transform: rotate(-5deg); }
.stagebar button { display: inline-flex; align-items: center; gap: 8px; }
.stagebar button b { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; }
.stagebar .ui-icon { width: 17px; height: 17px; }
.export-options button { position: relative; padding-left: 52px; }
.export-options button > .ui-icon { position: absolute; left: 18px; top: 19px; color: var(--green); }
.message-replay.has-ui-icon { justify-content: flex-start; gap: 5px; }
.message-replay .ui-icon { width: 14px; height: 14px; }
.is-working > .ui-icon { animation: action-pulse 1.4s ease-in-out infinite; }
@keyframes action-pulse { 0%,100% { opacity: .45; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.06); } }
@media (max-width: 600px) {
  .workflow-grid button { padding: 15px 12px 15px 54px; min-height: 96px; }
  .workflow-grid .workflow-icon { left: 12px; top: 15px; width: 30px; height: 30px; }
  .workflow-icon .ui-icon { width: 19px; height: 19px; }
  .stagebar button { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .ui-icon, .workflow-icon, .workflow-grid button { transition: none; animation: none; }
  button:not(:disabled):hover > .ui-icon, button:not(:disabled):active > .ui-icon,
  .workflow-grid button:hover, .workflow-grid button:hover .workflow-icon { transform: none; }
}
