* {
  box-sizing: border-box;
  letter-spacing: 0;
}
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  background: #f5f8f6;
  color: #183128;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 3px;
}
button {
  cursor: pointer;
}
svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 28px;
  font-weight: 650;
  line-height: 1.2;
}
h2 {
  font-size: 21px;
  font-weight: 600;
}
h3 {
  font-size: 16px;
  font-weight: 600;
}
.muted,
small {
  color: #6b7d74;
}
small {
  font-size: 12px;
}
.ds-shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}
.ds-sidebar {
  background: #fff;
  border-right: 1px solid #d8e2dc;
  padding: 22px 17px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.ds-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  white-space: nowrap;
}
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #17694f;
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 6px;
}
.brand-mark svg {
  width: 25px;
  height: 25px;
}
.brand-caption {
  margin: 12px 0 24px;
  font-size: 10px;
}
.ds-sidebar nav {
  display: grid;
  gap: 5px;
  margin-top: 22px;
}
.ds-sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border-radius: 5px;
  color: #526b60;
}
.ds-sidebar nav a:hover,
.ds-sidebar nav .active {
  background: #e5f1ea;
  color: #13563e;
}
.sidebar-bottom {
  margin-top: auto;
  font-size: 12px;
}
.sidebar-bottom small {
  display: block;
  margin: 7px 0 0 12px;
  font-size: 10px;
}
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #21a16c;
  margin-right: 5px;
}
.ds-main {
  min-width: 0;
}
.ds-topbar {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #d8e2dc;
  background: white;
  padding: 0 27px;
  font-size: 12px;
}
.topbar-account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-account > span {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.icon-button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cddbd2;
  background: #fff;
  border-radius: 5px;
  color: #375c4b;
}
.button,
.pb-btn-primary,
.pb-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  min-height: 38px;
  border: 1px solid #cedbd3;
  border-radius: 5px;
  background: white;
  color: #244638;
  font-weight: 550;
  font-size: 13px;
  white-space: nowrap;
}
.primary,
.pb-btn-primary {
  background: #17694f;
  border-color: #17694f;
  color: white;
}
.button:hover,
.icon-button:hover {
  filter: brightness(0.96);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.danger {
  color: #a32f42;
  border-color: #dcb3bc;
}
.heading {
  padding: 30px 30px 22px;
  border-bottom: 1px solid #d8e2dc;
  background: #eef4f2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  color: #627e72;
  margin-bottom: 9px;
}
.heading h1 {
  margin-bottom: 8px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.page-body {
  padding: 24px 30px;
}
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 18px 30px 0;
}
.filter-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  background: white;
  padding: 7px 9px;
  border: 1px solid #d2e0d7;
  border-radius: 4px;
}
.filter-option input {
  accent-color: #17694f;
}
.searchbar {
  position: relative;
  display: flex;
  align-items: center;
  margin: 18px 30px 22px;
}
.searchbar svg {
  position: absolute;
  left: 13px;
  color: #627d6e;
}
.searchbar input {
  padding-left: 40px;
  background: #fff;
}
.searchbar small {
  position: absolute;
  right: 13px;
}
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.demo-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #d5e1d9;
  border-radius: 6px;
  background: white;
  overflow: hidden;
  min-width: 0;
  transition: border-color 0.15s;
}
.demo-card:hover {
  border-color: #6b9d87;
}
.demo-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-bottom: 1px solid #d5e1d9;
}
.demo-cover {
  aspect-ratio: 16/9;
  background: #e3efea;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #37735c;
}
.demo-cover svg {
  width: 54px;
  height: 54px;
}
.demo-card-body {
  padding: 19px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.demo-card-body h3 {
  font-size: 18px;
  line-height: 1.4;
  margin: 16px 0 12px;
}
.demo-card-body p {
  font-size: 13px;
  line-height: 1.7;
  color: #74897d;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: #698475;
}
.card-footer {
  border-top: 1px solid #e2ebe5;
  margin-top: auto;
  padding-top: 15px;
}
.badge {
  font-size: 10px;
  background: #eaf0ed;
  padding: 3px 6px;
  border-radius: 3px;
  color: #395e4d;
  text-transform: uppercase;
}
.form-page {
  max-width: 920px;
  margin: auto;
  padding: 30px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.field {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
}
.field > label {
  font-weight: 550;
  font-size: 13px;
}
input:not([type="checkbox"]):not([type="radio"]),
textarea,
select,
.pb-input {
  width: 100%;
  border: 1px solid #bacebf;
  border-radius: 4px;
  padding: 10px 12px;
  background: white;
  color: #183128;
  min-height: 40px;
}
textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #86bfa5;
  border-color: #17694f;
}
.form-section {
  padding: 20px 0;
  border-bottom: 1px solid #dce6df;
  margin-bottom: 18px;
}
.notice {
  padding: 12px 16px;
  background: #e7f2eb;
  border: 1px solid #c3d8cb;
  border-radius: 5px;
  font-size: 13px;
  line-height: 1.6;
}
.notice.error,
.errorlist {
  color: #922537;
  background: #fff0f2;
  border-color: #e5b9c3;
}
.messages {
  padding: 12px 30px;
  display: grid;
  gap: 8px;
}
.empty {
  padding: 70px 20px;
  text-align: center;
  color: #6d8577;
}
.auth-page .ds-shell {
  display: block;
}
.auth-page .ds-main {
  max-width: none;
}
.auth-page main,
.auth-page .max-w-md {
  width: 100%;
  max-width: 440px;
  margin: 70px auto;
  padding: 25px;
}
.auth-page .text-white {
  color: #183128;
}
.auth-page h1 {
  font-size: 26px;
}
.auth-page .pb-btn-primary {
  width: 100%;
}
[x-cloak],
[hidden] {
  display: none !important;
}
.nav-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}
.nav-collapsed .ds-sidebar {
  padding: 22px 13px;
}
.nav-collapsed .ds-sidebar strong,
.nav-collapsed .ds-sidebar small,
.nav-collapsed .ds-sidebar a span:not(.brand-mark),
.nav-collapsed .sidebar-bottom {
  display: none;
}
.nav-collapsed .brand-caption {
  margin-bottom: 25px;
}
.nav-collapsed .nav-create {
  margin-top: 25px;
  padding: 9px;
}
.nav-collapsed nav a {
  padding: 11px;
}
table {
  border-collapse: collapse;
  width: 100%;
}
td,
th {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #dce5df;
}
th {
  font-size: 12px;
  font-weight: 600;
}
dialog {
  border: 1px solid #c9dacf;
  border-radius: 7px;
  padding: 25px;
  max-width: 700px;
  width: calc(100vw - 36px);
}
dialog::backdrop {
  background: #18312860;
}
.form-help {
  font-size: 12px;
  color: #6b7d74;
  line-height: 1.5;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}
.tabs {
  display: flex;
  gap: 5px;
  border-bottom: 1px solid #d0dfd4;
  padding: 0 22px;
}
.tabs a {
  padding: 14px 16px;
  font-size: 13px;
}
.tabs .active {
  color: #17694f;
  border-bottom: 2px solid #17694f;
}
.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  height: calc(100vh - 64px);
}
.workspace-chat {
  border-right: 1px solid #d4e0d7;
  display: flex;
  flex-direction: column;
  background: white;
  min-width: 0;
}
.workspace-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.chat-events {
  flex: 1;
  overflow: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 200px;
}
.chat-message {
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.chat-message.user {
  background: #eaf3ed;
  padding: 12px;
  border-radius: 6px;
}
.chat-compose {
  padding: 15px;
  border-top: 1px solid #d9e5dd;
}
.chat-compose textarea {
  min-height: 90px;
  max-height: 220px;
}
.workspace-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 20px;
  border-bottom: 1px solid #d6e3da;
}
.workspace-title h1 {
  font-size: 20px;
  margin: 0;
  overflow-wrap: anywhere;
}
.workspace-pane {
  padding: 24px;
  min-width: 0;
  flex: 1;
}
.workspace-pane iframe {
  border: 1px solid #d7e3db;
  width: 100%;
  height: 70vh;
  background: white;
}
.code-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
}
.file-list {
  max-height: 68vh;
  overflow: auto;
}
.file-list button {
  display: block;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 7px;
  width: 100%;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.file-list button:hover,
.file-list button.active {
  background: #e3f1e9;
}
.code-editor {
  font-family: Consolas, monospace;
  min-height: 60vh;
  font-size: 12px;
  white-space: pre;
  tab-size: 2;
}
.runtime-log {
  font-family: Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  background: #172b23;
  color: #daece2;
  padding: 18px;
  border-radius: 5px;
  max-height: 55vh;
  overflow: auto;
}
.approval {
  border: 1px solid #e0c481;
  background: #fffbef;
  padding: 12px;
  border-radius: 5px;
  font-size: 12px;
}
.approval pre {
  max-height: 170px;
  overflow: auto;
  white-space: pre-wrap;
}
.activity-label {
  font-size: 11px;
  color: #6c8275;
}
.inline-error {
  color: #a53645;
  white-space: pre-wrap;
  padding: 10px 0;
}
.model-options {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 8px;
  margin: 9px 0;
}
.model-options select {
  font-size: 11px;
  padding: 6px;
  min-height: 32px;
}
.history-row {
  padding: 18px 0;
  border-bottom: 1px solid #d5e2d9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.params {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin: 20px 0;
}
.status-running {
  background: #e5eef8;
  color: #345d89;
}
.status-failed {
  background: #fae7eb;
  color: #9c374b;
}
.status-completed {
  background: #e4f3e9;
  color: #186144;
}
@media (min-width: 1600px) {
  .demo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1050px) {
  .ds-shell {
    grid-template-columns: 180px minmax(0, 1fr);
  }
  .workspace {
    grid-template-columns: 310px minmax(0, 1fr);
  }
  .ds-brand {
    font-size: 14px;
  }
  .heading,
  .page-body {
    padding: 22px;
  }
  .params,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .nav-collapsed {
    grid-template-columns: 72px minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .ds-shell,
  .nav-collapsed {
    display: block;
  }
  .ds-sidebar {
    position: static;
    height: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid #d5e2da;
  }
  .ds-brand strong {
    display: block !important;
  }
  .ds-sidebar nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    margin-top: 10px;
  }
  .ds-sidebar nav a {
    padding: 8px;
  }
  .brand-caption,
  .sidebar-bottom,
  .nav-create {
    display: none !important;
  }
  .ds-sidebar nav span {
    display: none;
  }
  .ds-topbar {
    padding: 0 15px;
    height: 52px;
  }
  .topbar-account > span {
    max-width: 120px;
    font-size: 10px;
  }
  #toggle-nav {
    display: none;
  }
  .heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .filters {
    padding: 15px 18px 0;
  }
  .searchbar {
    margin: 15px 18px;
  }
  .page-body,
  .form-page {
    padding: 18px;
  }
  .demo-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .workspace {
    display: flex;
    flex-direction: column;
    height: auto;
  }
  .workspace-chat {
    height: 520px;
    border-right: 0;
    border-bottom: 1px solid #d5e2da;
  }
  .workspace-main {
    overflow: visible;
  }
  .workspace-title {
    flex-wrap: wrap;
  }
  .workspace-title h1 {
    font-size: 18px;
  }
  .tabs {
    padding: 0 8px;
    overflow: auto;
  }
  .tabs a {
    padding: 12px;
    font-size: 12px;
  }
  .workspace-pane {
    padding: 15px;
  }
  .code-layout {
    grid-template-columns: 1fr;
  }
  .file-list {
    max-height: 150px;
  }
  .history-row {
    flex-wrap: wrap;
  }
  .auth-page .max-w-md {
    margin: 30px auto;
    padding: 24px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}
dialog.delete-dialog { border: 1px solid #cddbd6; border-radius: 8px; padding: 24px; width: min(520px, calc(100vw - 32px)); color: #18372e; }
dialog.delete-dialog::backdrop { background: #142d2466; }
dialog.delete-dialog p { line-height: 1.5; }
details { margin: 18px 0; }
summary { cursor: pointer; margin-bottom: 16px; }
