:root {
  --bg: #f4f3ef;
  --paper: #fff;
  --ink: #202d2c;
  --muted: #677571;
  --line: #dde3dc;
  --green: #245e4f;
  --soft: #e9f0e9;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.6 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
label.file-button {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #b79d4b;
  outline-offset: 3px;
}
aside {
  width: 235px;
  position: fixed;
  inset: 0 auto 0 0;
  background: #ebeee7;
  border-right: 1px solid var(--line);
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
}
.brand {
  color: var(--ink);
  text-decoration: none;
  font-weight: 750;
  font-size: 22px;
  letter-spacing: -0.7px;
}
.aside-note {
  color: var(--muted);
  font-size: 13px;
  margin: 22px 0 32px;
}
nav {
  display: grid;
  gap: 8px;
}
.nav {
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 13px 16px;
  color: var(--muted);
  font-weight: 600;
}
.nav.active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 1px 3px #19372e08;
}
.machine {
  margin-top: auto;
  padding-top: 24px;
  font-size: 12px;
  color: var(--muted);
}
.machine b {
  color: var(--ink);
  font-size: 13px;
}
.machine p {
  margin: 9px 0;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #438868;
  margin-right: 8px;
}
main {
  margin-left: 235px;
  padding: 45px 42px;
  max-width: 1640px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 30px;
}
h1 {
  font-size: 33px;
  line-height: 1.3;
  letter-spacing: -1px;
  margin: 8px 0 12px;
}
header p {
  margin: 0;
  color: var(--muted);
}
.eyebrow {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 2px;
  color: var(--green);
}
.local-badge {
  font-size: 10px;
  letter-spacing: 1px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 7px 12px;
  background: #fbfcfa;
  margin-top: 8px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 26px;
  box-shadow: 0 4px 20px #1d372505;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(270px, 1fr);
  gap: 22px;
}
.section-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
}
.section-top > span {
  font-size: 12px;
  color: var(--muted);
}
h2 {
  font-size: 17px;
  line-height: 1.4;
  margin: 0;
  font-weight: 700;
}
label {
  display: block;
  margin: 18px 0 7px;
  font-size: 12px;
  font-weight: 650;
  color: #45594f;
}
textarea,
select,
input[type="number"] {
  width: 100%;
  border: 1px solid #d9e1d9;
  background: #fafbf8;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
}
textarea {
  resize: vertical;
  min-height: 68px;
  line-height: 1.7;
}
textarea::placeholder {
  color: #8a958f;
}
select {
  height: 44px;
}
.hint {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  margin: 7px 0 13px;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
button,
.file-button {
  border-radius: 8px;
  padding: 10px 16px;
  border: 1px solid #ccd9cf;
  background: white;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.secondary {
  background: var(--soft);
  border: 1px solid #d9e7da;
  color: var(--green);
}
.full {
  width: 100%;
  margin-top: 20px;
  padding: 13px;
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px 8px;
  font-size: 12px;
}
.upload-area {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  flex-wrap: wrap;
}
.upload-area > span {
  color: var(--muted);
  font-size: 10px;
}
.file-button {
  display: inline-block;
  margin: 0;
  cursor: pointer;
}
#referencePreview {
  max-height: 220px;
  max-width: 100%;
  border-radius: 9px;
  object-fit: contain;
}
#analysis {
  padding: 16px 18px;
  border: 1px solid #dce8dc;
  background: #f3f8f0;
  border-radius: 10px;
  margin: 18px 0;
}
.analysis-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
}
#analysis p {
  font-size: 13px;
  white-space: pre-wrap;
}
.segmented {
  display: flex;
  background: #f1f4ef;
  border-radius: 9px;
  padding: 4px;
  gap: 3px;
}
.segmented button {
  flex: 1;
  background: transparent;
  border-color: transparent;
}
.segmented button.selected {
  background: white;
  border-color: #dce4da;
  box-shadow: 0 1px 3px #19372e0a;
  color: var(--green);
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}
audio {
  width: 100%;
  height: 38px;
  margin-top: 5px;
}
output {
  float: right;
}
.results {
  margin-top: 34px;
}
.empty {
  text-align: center;
  border: 1px dashed #ccd6cb;
  border-radius: 14px;
  color: var(--muted);
  padding: 45px;
}
.job {
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 22px;
  margin-bottom: 15px;
}
.job-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.job-title {
  font-weight: 650;
  font-size: 14px;
}
.job-stage {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0;
}
.job-stage.running {
  color: var(--green);
}
.job-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.media-grid img,
.media-grid video {
  width: 100%;
  max-height: 540px;
  object-fit: contain;
  border-radius: 8px;
  background: #f6f7f3;
}
.media-grid a {
  display: inline-block;
  color: var(--green);
  font-size: 12px;
  margin-top: 7px;
}
.citations details,
.metrics {
  border-top: 1px solid #e8eee5;
  margin-top: 14px;
  padding-top: 12px;
  font-size: 12px;
  color: var(--muted);
}
summary {
  cursor: pointer;
}
.citations p {
  white-space: pre-wrap;
  color: var(--ink);
}
.metrics pre {
  white-space: pre-wrap;
}
.error {
  color: #aa4135;
  white-space: pre-wrap;
  font-size: 12px;
}
.doc-row {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.doc-row b {
  font-size: 14px;
}
.doc-row small {
  display: block;
  color: var(--muted);
}
.document-choices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.document-choices label {
  border: 1px solid #dce4da;
  border-radius: 6px;
  background: #f9fbf6;
  padding: 6px 10px;
  margin: 0;
  font-size: 12px;
}
.document-choices input {
  accent-color: var(--green);
  margin-right: 7px;
}
.bubble {
  padding: 14px 18px;
  background: #f1f5ee;
  border-radius: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 12px 0;
  font-size: 14px;
}
.bubble.user {
  margin-left: 15%;
  background: #e8efe6;
}
.bubble.assistant {
  margin-right: 10%;
  background: #f6f7f3;
}
.chat-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 12px;
}
#notice {
  padding: 12px 18px;
  border: 1px solid #e1d3a9;
  background: #fff8e2;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 13px;
}
footer {
  font-size: 11px;
  color: #7c8780;
  margin-top: 30px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1100px) {
  aside {
    width: 195px;
    padding: 30px 18px;
  }
  main {
    margin-left: 195px;
    padding: 32px 25px;
  }
  .workspace {
    grid-template-columns: 1.2fr 1fr;
  }
  .card {
    padding: 20px;
  }
}
@media (max-width: 850px) {
  aside {
    position: static;
    width: auto;
    padding: 18px 22px;
    display: block;
  }
  .aside-note,
  .machine {
    display: none;
  }
  nav {
    display: flex;
    margin-top: 14px;
  }
  .nav {
    padding: 8px 12px;
  }
  main {
    margin: 0;
    padding: 28px 20px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .settings {
    display: block;
  }
  .local-badge {
    display: none;
  }
  h1 {
    font-size: 28px;
  }
  .chat-bottom {
    align-items: end;
  }
  .media-grid {
    grid-template-columns: 1fr;
  }
}
/* Conversation workspace: neutral canvas, compact sidebar, focused content. */
:root {
  --bg: #fff;
  --paper: #fff;
  --ink: #252525;
  --muted: #727272;
  --line: #e8e8e8;
  --green: #242424;
  --soft: #f4f4f4;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
aside {
  width: 248px;
  background: #f8f8f8;
  padding: 26px 18px;
  border-right: 1px solid #eeeeee;
}
.brand {
  font-size: 20px;
  padding: 0 12px;
  letter-spacing: -0.6px;
}
.new-work {
  margin: 25px 0 16px;
  background: #fff;
  text-align: left;
  border-color: #e5e5e5;
  border-radius: 10px;
  padding: 11px 13px;
}
.nav {
  padding: 9px 13px;
  color: #464646;
  font-weight: 500;
}
.nav.active {
  background: #eaeaea;
  color: #202020;
  box-shadow: none;
}
.history-label {
  font-size: 11px;
  color: #888;
  margin: 28px 12px 8px;
}
#taskHistory {
  overflow: auto;
  min-height: 80px;
}
.history-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  font-weight: 400;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #555;
}
.history-item:hover {
  background: #ececec;
}
.machine {
  border-top: 1px solid #e8e8e8;
  padding: 18px 10px 0;
}
.machine small {
  display: block;
  font-size: 11px;
}
.machine .text-button {
  font-size: 10px;
  padding: 8px 0;
  margin-right: 9px;
}
.dot {
  background: #687e6a;
}
main {
  margin-left: 248px;
  max-width: 1600px;
  padding: 34px 40px;
}
header {
  margin-bottom: 34px;
}
.eyebrow {
  letter-spacing: 1.5px;
  color: #888;
  font-size: 9px;
}
h1 {
  font-size: 29px;
  letter-spacing: -0.9px;
  font-weight: 650;
}
.local-badge {
  background: white;
  color: #888;
  font-size: 9px;
}
.workspace {
  grid-template-columns: minmax(0, 1.5fr) minmax(265px, 0.85fr);
  gap: 26px;
}
.card {
  box-shadow: none;
  border-radius: 16px;
  border-color: #e9e9e9;
}
.compose {
  padding: 28px;
}
.settings {
  background: #fcfcfc;
}
.section-top h2 {
  font-size: 15px;
  font-weight: 600;
}
.section-top > span {
  color: #a0a0a0;
}
label {
  color: #666;
  font-size: 11px;
  font-weight: 600;
}
textarea,
select,
input[type="number"],
input[type="password"],
input:not([type]) {
  background: #fafafa;
  border: 1px solid #e3e3e3;
  border-radius: 10px;
  padding: 11px 13px;
  width: 100%;
  color: #252525;
}
textarea::placeholder {
  color: #9a9a9a;
}
.primary {
  background: #242424;
  border-color: #242424;
}
.secondary {
  background: #f2f2f2;
  border-color: #e6e6e6;
  color: #333;
}
.segmented {
  background: #f0f0f0;
}
.segmented button.selected {
  color: #222;
  border-color: #ddd;
}
.file-button {
  font-size: 11px;
  border-color: #ddd;
  color: #555;
}
.hint {
  color: #8a8a8a;
}
.job {
  border-radius: 13px;
  border-color: #e8e8e8;
  padding: 22px 25px;
}
.job-stage.running {
  color: #5a6c5e;
}
.job-title {
  font-size: 13px;
}
.job-content {
  font-size: 14px;
  line-height: 1.9;
}
.bubble {
  border-radius: 16px;
  padding: 17px 20px;
  line-height: 1.8;
}
.bubble.user {
  background: #f1f1f1;
}
.bubble.assistant {
  background: white;
  border: 1px solid #ededed;
  margin: 12px 0;
}
#chatPanel {
  max-width: 1000px;
  margin: auto;
}
#chatPanel > .card {
  border: 0;
  padding: 0;
}
#chatPanel #messages {
  min-height: 180px;
}
#chatRequest {
  border-radius: 19px;
  background: #f8f8f8;
  min-height: 108px;
}
#chatModelSelect {
  width: 230px;
  font-size: 12px;
  border: 0;
  background: #f5f5f5;
}
.document-choices label {
  background: #f7f7f7;
  border-color: #e4e4e4;
  font-weight: 400;
}
#analysis {
  background: #f8faf8;
  border-color: #e0e6e0;
}
.analysis-title {
  color: #485d4b;
}
.code-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.3fr);
  gap: 24px;
}
.project-create {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.project-create input {
  min-width: 0;
  font-size: 12px;
}
.project-create button {
  white-space: nowrap;
}
#projectFiles {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-height: 140px;
  overflow: auto;
}
.file-item {
  font:
    11px ui-monospace,
    SFMono-Regular,
    monospace;
  background: #f6f6f6;
  border: 1px solid #e7e7e7;
  padding: 5px 8px;
}
#codeEditor {
  margin-top: 10px;
  font:
    12px/1.65 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  tab-size: 2;
  white-space: pre;
}
.code-diff,
.code-test {
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  font-size: 12px;
}
.code-diff pre,
.code-test pre {
  font:
    11px/1.65 ui-monospace,
    SFMono-Regular,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 420px;
  overflow: auto;
  background: #fafafa;
  padding: 14px;
  border-radius: 5px;
}
.code-diff summary {
  font-family: ui-monospace, SFMono-Regular, monospace;
}
.locked > aside,
.locked > main {
  display: none;
}
.locked > #loginScreen {
  display: grid !important;
  min-height: 100vh;
  place-items: center;
  background: #f7f7f7;
}
.login-card {
  width: min(400px, calc(100vw - 40px));
  padding: 35px;
  background: white;
  border: 1px solid #e6e6e6;
  border-radius: 18px;
}
.login-card h1 {
  font-size: 25px;
}
.login-card p {
  color: #777;
  font-size: 13px;
}
.login-card .hint {
  font-size: 10px;
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid #737b8a;
  outline-offset: 3px;
}
footer {
  color: #aaa;
}
.results {
  scroll-margin-top: 24px;
}
html {
  scroll-behavior: smooth;
}
@media (max-width: 1150px) {
  aside {
    width: 215px;
  }
  main {
    margin-left: 215px;
    padding: 30px 26px;
  }
  .workspace {
    grid-template-columns: 1.2fr 1fr;
  }
  .code-layout {
    grid-template-columns: 1fr;
  }
  .history-item {
    font-size: 11px;
  }
}
@media (max-width: 850px) {
  aside {
    position: static;
    width: auto;
    padding: 17px 18px;
  }
  .brand {
    padding: 0;
  }
  .new-work {
    float: right;
    margin: 0;
    padding: 6px 12px;
    font-size: 11px;
  }
  nav {
    display: flex;
    overflow-x: auto;
    margin-top: 16px;
    gap: 3px;
  }
  .nav {
    padding: 8px 10px;
    white-space: nowrap;
    font-size: 11px;
  }
  .history-label,
  #taskHistory,
  .machine {
    display: none;
  }
  main {
    margin: 0;
    padding: 27px 18px;
  }
  .workspace,
  .code-layout {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 22px;
  }
  h1 {
    font-size: 25px;
  }
  .job {
    padding: 18px;
  }
  .code-compose {
    padding: 20px;
  }
  .pair {
    gap: 8px;
  }
  header {
    margin-bottom: 25px;
  }
  .media-grid {
    grid-template-columns: 1fr;
  }
  .chat-bottom {
    gap: 10px;
  }
  .chat-bottom .hint {
    font-size: 10px;
  }
  .job-title {
    overflow-wrap: anywhere;
  }
  .job-head {
    gap: 8px;
  }
  #codeEditor {
    font-size: 11px;
  }
  .project-files {
    min-width: 0;
  }
}

.result-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}
.result-tools select {
  width: auto;
  height: 33px;
  padding: 3px 9px;
  font-size: 11px;
}
.result-tools span {
  font-size: 11px;
  color: #888;
}

#currentUser {
  display: block;
  margin: 0 0 6px;
}
.account-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid #ddd;
  border-radius: 16px;
  background: white;
}
.account-dialog::backdrop {
  background: rgba(0, 0, 0, 0.28);
}
.account-dialog h2 {
  margin-top: 0;
}
#loginForm .primary {
  margin-top: 20px;
}
#nameLogin label {
  margin-top: 16px;
}

@media (max-width: 850px) {
  aside .machine {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    padding-top: 10px;
  }
  aside .machine > :not(#currentUser):not(#accountSettings):not(#logout) {
    display: none;
  }
  aside #currentUser {
    margin: 0;
    font-size: 12px;
  }
  aside .machine .text-button {
    margin: 0;
    padding: 4px 0;
  }
}
