:root {
  --ink: #173331;
  --muted: #687b76;
  --teal: #126b5c;
  --teal-dark: #103f3a;
  --cream: #f4f1e8;
  --paper: #fffef9;
  --line: #dce3dc;
  --soft: #eaf1ec;
  --danger: #a44132;
  font-family: Inter, "Avenir Next", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-size: 15px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea {
  font: inherit;
}
button,
a {
  color: inherit;
}
.app-shell {
  height: 100dvh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  overflow: hidden;
}
.sidebar {
  background: var(--teal-dark);
  color: #f7f3e9;
  padding: 22px 15px 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border: 1px solid #72a198;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 19px;
}
.brand strong,
.brand small {
  display: block;
}
.brand strong {
  letter-spacing: -0.3px;
}
.brand small {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #a9c2ba;
  margin-top: 2px;
}
.new-chat,
.nav-item {
  border: 0;
  background: transparent;
  color: inherit;
  width: 100%;
  text-align: left;
  border-radius: 9px;
  padding: 10px 12px;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  gap: 10px;
  align-items: center;
}
.new-chat {
  margin: 23px 0 12px;
  background: #f6f2e7;
  color: var(--teal-dark);
  font-weight: 700;
}
.side-nav {
  border-bottom: 1px solid #345a54;
  padding-bottom: 14px;
}
.nav-item {
  color: #bad0c9;
  margin: 3px 0;
}
.nav-item:hover,
.nav-item.active {
  background: #28534c;
  color: #fff;
}
.conversation-section {
  min-height: 0;
  overflow: auto;
  flex: 1;
  padding-top: 20px;
}
.section-label,
.eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  color: #7b8e87;
}
.section-label {
  color: #87aaa1;
  padding: 0 10px 8px;
}
.conversation-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #c5d7d1;
  text-align: left;
  border-radius: 8px;
  padding: 9px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.conversation-button:hover,
.conversation-button.active {
  background: #28534c;
  color: white;
}
.sidebar-foot {
  border-top: 1px solid #345a54;
  padding: 15px 5px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.user-chip > span {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #d9cda8;
  color: #234a43;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.user-chip strong,
.user-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 145px;
}
.user-chip small {
  font-size: 10px;
  color: #9ebbb3;
}
.icon-button {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
}
.workspace {
  background: var(--paper);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 64px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  font-size: 13px;
}
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #35a46f;
  border-radius: 50%;
  margin-right: 8px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.private-pill,
.tag {
  font-size: 11px;
  background: var(--soft);
  border-radius: 20px;
  padding: 7px 10px;
  color: #46635c;
}
.menu-button {
  display: none;
  border: 0;
  background: none;
  font-size: 20px;
}
.view {
  display: none;
  min-height: 0;
  flex: 1;
}
.view.active {
  display: flex;
}
.chat-view {
  flex-direction: column;
}
.messages {
  flex: 1;
  overflow: auto;
  padding: 30px max(28px, calc((100% - 820px) / 2));
}
.welcome {
  max-width: 780px;
  margin: 8vh auto 0;
  text-align: center;
}
.welcome-symbol {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  background: #e3eee8;
  color: var(--teal);
  font-family: Georgia, serif;
  font-size: 25px;
}
.welcome h1,
.page-heading h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -1.5px;
  margin: 10px 0;
}
.welcome > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  max-width: 620px;
  margin: 0 auto;
}
.suggestions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 32px;
}
.suggestion {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  min-height: 94px;
}
.suggestion:hover {
  border-color: #86aa9e;
  background: #fbfcf9;
}
.suggestion span,
.suggestion small {
  display: block;
}
.suggestion span {
  font-weight: 750;
  margin-bottom: 9px;
}
.suggestion small {
  color: var(--muted);
  line-height: 1.4;
}
.message {
  max-width: 760px;
  margin: 0 auto 25px;
}
.message.user {
  display: flex;
  justify-content: flex-end;
}
.bubble {
  background: #edf3ef;
  border-radius: 16px 16px 4px 16px;
  padding: 12px 16px;
  max-width: 80%;
  white-space: pre-wrap;
}
.assistant-head {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--teal);
  margin-bottom: 10px;
}
.markdown {
  line-height: 1.7;
}
.markdown p {
  margin: 0 0 12px;
}
.markdown h2,
.markdown h3 {
  font-family: Georgia, serif;
  font-weight: 500;
}
.markdown ul {
  padding-left: 20px;
}
.markdown a {
  color: var(--teal);
  text-decoration-thickness: 1px;
}
.tool-trace {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 10px 0;
  background: #fbfcf9;
}
.tool-trace summary {
  cursor: pointer;
  padding: 11px 13px;
  font-weight: 650;
  font-size: 13px;
}
.tool-detail {
  border-top: 1px solid var(--line);
  padding: 11px 13px;
  color: var(--muted);
  font-size: 12px;
  white-space: pre-wrap;
  overflow: auto;
}
.tool-state {
  float: right;
  color: #6a837c;
  font-weight: 500;
}
.thinking {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.thinking:before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}
.composer-wrap {
  padding: 12px max(24px, calc((100% - 820px) / 2)) 15px;
  background: linear-gradient(transparent, var(--paper) 15%);
}
.composer {
  border: 1px solid #b8c9c1;
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 7px 25px #17333112;
}
.composer textarea {
  border: 0;
  outline: 0;
  resize: none;
  width: 100%;
  min-height: 32px;
  max-height: 130px;
  padding: 5px;
  background: transparent;
  color: var(--ink);
}
.composer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}
.composer-actions > span {
  margin-right: auto;
  font-size: 10px;
  color: #8b9a95;
}
.send {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: var(--teal);
  color: white;
  font-size: 18px;
  cursor: pointer;
}
.send:disabled {
  opacity: 0.45;
}
.cancel {
  border: 0;
  background: #f5e5df;
  color: var(--danger);
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
}
.disclaimer {
  text-align: center;
  color: #899792;
  font-size: 10px;
  margin: 8px 0 0;
}
.inline-error,
.field-status {
  color: var(--danger);
  font-size: 13px;
}
.inline-error {
  background: #f9eae5;
  padding: 9px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
}
.workflows-view {
  overflow: auto;
  display: none !important;
  padding: 40px max(28px, calc((100% - 1050px) / 2));
  background: #f8f7f1;
}
.workflows-view.active {
  display: block !important;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.page-heading h1 {
  margin: 6px 0;
}
.page-heading p {
  color: var(--muted);
}
.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 30px 0;
}
.workflow-card {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 22px;
  border-radius: 14px;
  cursor: pointer;
  position: relative;
}
.workflow-card:hover,
.workflow-card.selected {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
}
.workflow-card.selected:after {
  content: "✓";
  position: absolute;
  right: 14px;
  top: 13px;
  color: var(--teal);
  font-weight: 800;
}
.card-index {
  font: italic 15px Georgia;
  color: #93a49d;
}
.workflow-card h2 {
  font: 500 21px Georgia;
  margin: 16px 0 10px;
}
.workflow-card p {
  color: var(--muted);
  line-height: 1.5;
  min-height: 45px;
}
.control-panel,
.runs-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 23px;
  margin-top: 16px;
}
.control-panel h2,
.runs-panel h2 {
  margin: 0 0 7px;
  font: 500 22px Georgia;
}
.upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.upload-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.file-button,
.ghost,
.primary,
.button-link {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
}
.file-button {
  color: var(--teal);
}
.ghost.compact {
  padding: 7px 10px;
  font-size: 12px;
}
.primary {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.primary.large {
  padding: 12px 18px;
}
.muted {
  color: var(--muted);
  line-height: 1.55;
}
.runs-list {
  display: grid;
  gap: 8px;
}
.run-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf0eb;
  background: transparent;
  padding: 12px 4px;
  display: flex;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
}
.run-row small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.badge {
  font-size: 11px;
  border-radius: 20px;
  padding: 6px 9px;
  background: #e8ece8;
  height: max-content;
}
.badge.success {
  background: #dceee4;
  color: #176342;
}
.badge.running {
  background: #fbefcf;
  color: #755d15;
}
.badge.failed,
.warning {
  background: #fae5df;
  color: #913829;
}
.result-drawer {
  position: fixed;
  z-index: 20;
  right: 0;
  top: 0;
  height: 100dvh;
  width: min(560px, 100%);
  background: var(--paper);
  box-shadow: -12px 0 40px #17333124;
  padding: 25px;
  overflow: auto;
  transform: translateX(105%);
  transition: transform 0.25s ease;
}
.result-drawer.open {
  transform: none;
}
.drawer-head,
.download-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer-head h2 {
  font: 500 28px Georgia;
  margin: 4px 0 18px;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin: 18px 0;
}
.metric {
  background: var(--soft);
  border-radius: 10px;
  padding: 13px;
}
.metric strong,
.metric small {
  display: block;
}
.metric small {
  color: var(--muted);
  margin-top: 5px;
}
.figure-grid {
  display: grid;
  gap: 13px;
}
.figure-grid figure {
  margin: 0;
}
.figure-grid img {
  width: 100%;
  border-radius: 9px;
  border: 1px solid var(--line);
}
.figure-grid figcaption {
  font-size: 11px;
  color: var(--muted);
}
.file-list {
  display: grid;
  gap: 6px;
}
.file-list a {
  padding: 9px;
  background: #f0f4ef;
  border-radius: 7px;
  color: var(--teal);
}
.admin-invite {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 10px 0 18px;
}
.admin-invite input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  color: var(--ink);
}
.admin-invite p {
  grid-column: 1 / -1;
  margin: 0;
}
.admin-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 11px 2px;
}
.admin-user strong,
.admin-user small {
  display: block;
}
.admin-user small {
  color: var(--muted);
  margin-top: 4px;
}
details {
  border-top: 1px solid var(--line);
  padding: 15px 0;
  margin-top: 15px;
}
summary {
  cursor: pointer;
}
pre {
  white-space: pre-wrap;
  font-size: 11px;
  background: #142f2d;
  color: #dcebe6;
  padding: 14px;
  border-radius: 9px;
  overflow: auto;
}
.scrim {
  position: fixed;
  inset: 0;
  background: #102d2a55;
  opacity: 0;
  pointer-events: none;
  z-index: 15;
  transition: opacity 0.2s;
}
.scrim.open {
  opacity: 1;
  pointer-events: auto;
}
.auth-page {
  min-height: 100vh;
  background: #e7ebe4;
}
.auth-shell {
  width: min(1000px, calc(100% - 40px));
  min-height: 620px;
  margin: clamp(20px, 8vh, 75px) auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--paper);
  box-shadow: 0 20px 70px #1437331f;
}
.auth-aside {
  background: var(--teal-dark);
  color: #f7f3e9;
  padding: 45px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-aside:after {
  content: "Ω";
  font: 360px Georgia;
  position: absolute;
  right: -85px;
  bottom: -145px;
  color: #ffffff08;
}
.auth-aside .brand {
  padding: 0;
}
.brand.light small {
  color: #a9c2ba;
}
.auth-aside h1 {
  font: 500 clamp(34px, 4vw, 50px)/1.1 Georgia;
  letter-spacing: -1.5px;
}
.auth-aside p {
  color: #b9cdc6;
  line-height: 1.7;
  max-width: 410px;
}
.auth-note {
  font-size: 11px;
  color: #91ada5;
}
.auth-card {
  padding: clamp(35px, 6vw, 70px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-card h2 {
  font: 500 38px Georgia;
  margin: 8px 0;
}
.auth-form {
  margin-top: 25px;
  display: grid;
  gap: 17px;
}
.auth-form label {
  font-size: 12px;
  font-weight: 750;
}
.auth-form input {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 12px;
  border: 1px solid #c5d1ca;
  border-radius: 8px;
  background: #fbfcf9;
}
.auth-form button {
  margin-top: 6px;
}
@media (max-width: 800px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    z-index: 30;
    width: 270px;
    height: 100%;
    transform: translateX(-105%);
    transition: transform 0.2s;
  }
  .sidebar.open {
    transform: none;
  }
  .menu-button {
    display: block;
  }
  .topbar {
    padding: 0 15px;
  }
  .private-pill {
    display: none;
  }
  .messages {
    padding: 22px 16px;
  }
  .welcome {
    margin-top: 4vh;
  }
  .suggestions,
  .workflow-grid {
    grid-template-columns: 1fr;
  }
  .suggestion {
    min-height: auto;
  }
  .composer-wrap {
    padding: 10px 12px;
  }
  .composer-actions > span {
    display: none;
  }
  .workflows-view {
    padding: 25px 15px;
  }
  .page-heading {
    display: block;
  }
  .auth-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    grid-template-columns: 1fr;
  }
  .auth-aside {
    min-height: 280px;
    padding: 28px;
  }
  .auth-aside h1 {
    font-size: 34px;
  }
  .auth-note {
    display: none;
  }
  .auth-card {
    padding: 35px 24px;
  }
}
