:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #172033;
  --muted: #667085;
  --line: #e6eaf2;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #e8f0ff;
  --success: #0f9f6e;
  --warning: #c47a00;
  --radius: 18px;
  --shadow: 0 18px 45px rgba(20, 32, 56, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1080px;
  color: var(--text);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #ffffff;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
}

.main-nav {
  display: flex;
  gap: 8px;
}

.main-nav a {
  padding: 10px 14px;
  color: var(--muted);
  border-radius: 999px;
}

.main-nav a.active,
.main-nav a:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.page-root {
  padding: 28px 32px 44px;
}

.hero,
.panel,
.editor-shell,
.preview-stage {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  padding: 32px;
  overflow: hidden;
}

.hero h1,
.page-heading h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
}

.hero p,
.page-heading p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions,
.toolbar,
.card-actions,
.preview-actions,
.editor-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions {
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 16px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
}

.button.primary {
  color: #ffffff;
  border-color: var(--primary);
  background: var(--primary);
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sync-status {
  color: var(--muted);
  font-size: 13px;
}

.button.ghost {
  color: var(--primary);
  border-color: transparent;
  background: var(--primary-soft);
}

.hero-preview {
  padding: 22px;
  border-radius: 18px;
  background: linear-gradient(145deg, #eff6ff, #f5f3ff);
}

.mini-browser {
  padding: 18px;
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: 18px;
  background: #ffffff;
}

.mini-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}

.mini-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c7d2fe;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.platform-intro {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at top left, rgba(89, 124, 255, 0.16), transparent 32%),
    linear-gradient(135deg, #ffffff 0%, #f7f9ff 100%);
  box-shadow: var(--shadow);
}

.platform-intro-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.platform-copy {
  max-width: 720px;
}

.platform-copy h1,
.platform-copy p {
  margin: 0;
}

.platform-eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(54, 94, 255, 0.1);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.platform-copy h1 {
  max-width: 620px;
  color: var(--text);
  font-size: 36px;
  line-height: 1.18;
  letter-spacing: -0.04em;
}

.platform-copy p {
  max-width: 620px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.platform-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.platform-highlights span {
  padding: 8px 12px;
  border: 1px solid rgba(54, 94, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: #24324b;
  font-size: 13px;
  font-weight: 700;
}

.platform-intro-main > .button {
  flex: 0 0 auto;
  margin-top: 2px;
}

.platform-showcase {
  margin-top: 24px;
}

.platform-showcase .site-canvas {
  max-width: 760px;
  box-shadow: 0 14px 36px rgba(20, 32, 56, 0.08);
}

.platform-showcase .portal-background,
.platform-showcase .portal-content {
  min-height: 360px;
}

.platform-showcase .portal-avatar {
  width: 84px;
  height: 84px;
  margin-bottom: 14px;
  font-size: 44px;
}

.platform-showcase .portal-content h2 {
  margin-bottom: 16px;
  font-size: 28px;
}

.platform-showcase .portal-input {
  width: min(560px, 86%);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.guide-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.guide-card h3,
.guide-card p {
  margin: 0;
}

.guide-card p {
  color: var(--muted);
  line-height: 1.6;
}

.step-badge {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #ffffff;
  font-weight: 800;
  border-radius: 12px;
  background: var(--primary);
}

.metric-card,
.template-card,
.project-row,
.empty-state,
.form-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.metric-card {
  padding: 20px;
}

.metric-value {
  font-size: 30px;
  font-weight: 800;
}

.metric-label,
.muted {
  color: var(--muted);
}

.section {
  margin-top: 24px;
}

.section-title,
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.panel {
  padding: 22px;
}

.login-page {
  display: grid;
  min-height: calc(100vh - 140px);
  place-items: center;
}

.login-card {
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0 0 10px;
}

.login-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.7;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  border-radius: 14px;
  background: var(--panel-soft);
}

.auth-tabs button {
  min-height: 38px;
  color: var(--muted);
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

.auth-tabs button.active {
  color: var(--primary);
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(20, 32, 56, 0.08);
}

.project-list {
  display: grid;
  gap: 12px;
}

.project-row {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.8fr 0.8fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
}

.list-header {
  display: grid;
  gap: 16px;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.project-list-header {
  grid-template-columns: 1.3fr 0.8fr 0.8fr 0.8fr auto;
}

.project-list-header span:last-child,
.assistant-list-header span:last-child {
  min-width: 86px;
  text-align: center;
}

.status {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 999px;
  background: var(--panel-soft);
}

.status.draft {
  color: var(--warning);
  background: #fff7e6;
}

.status.waiting {
  color: var(--primary);
  background: var(--primary-soft);
}

.status.published {
  color: var(--success);
  background: #e8fff6;
}

.toolbar {
  justify-content: flex-start;
  margin-bottom: 16px;
}

.search-box,
.select-box,
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.search-box,
.select-box {
  min-height: 42px;
  padding: 0 12px;
}

.toolbar .search-box {
  flex: 0 1 280px;
  max-width: 280px;
}

.toolbar .select-box {
  flex: 0 0 180px;
}

.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.filter-chip {
  padding: 8px 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
}

.filter-chip.active {
  color: var(--primary);
  border-color: #bfdbfe;
  background: var(--primary-soft);
}

@media (max-width: 560px) {
  .toolbar .search-box,
  .toolbar .select-box {
    flex: 1 1 100%;
    max-width: none;
  }
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.template-card {
  padding: 18px;
}

.template-preview {
  display: grid;
  height: 160px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #e0f2fe, #ede9fe);
}

.template-card h3,
.form-card h3,
.panel h2 {
  margin: 0 0 8px;
}

.template-card p,
.form-card p,
.panel p {
  color: var(--muted);
  line-height: 1.6;
}

.editor-shell {
  overflow: hidden;
  height: calc(100vh - 124px);
  display: flex;
  flex-direction: column;
}

.editor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.editor-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
  flex: 1;
  padding: 16px;
  background: #f8fafc;
}

.editor-config {
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.editor-config-heading {
  margin-bottom: 14px;
}

.editor-config-heading h3,
.editor-config-card h4 {
  margin: 0;
}

.editor-config-card {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.editor-config-card h4 {
  margin-bottom: 12px;
}

.canvas-area {
  padding: 18px;
  background: #ffffff;
}

.editor-preview-pane {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
}

.preview-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 980px);
  margin: 0 auto 12px;
}

.preview-pane-header h3 {
  margin: 0;
}

.editor-preview-pane .site-canvas {
  width: min(100%, 980px);
  aspect-ratio: 16 / 9;
  max-width: 980px;
  box-shadow: 0 12px 30px rgba(20, 32, 56, 0.08);
}

.editor-preview-pane .portal-background,
.editor-preview-pane .portal-content {
  min-height: 100%;
  height: 100%;
}

.editor-preview-pane .portal-content {
  justify-content: center;
  padding: 36px 28px 46px;
}

.editor-preview-pane .portal-avatar {
  width: 92px;
  height: 92px;
  margin-bottom: 16px;
  font-size: 48px;
}

.editor-preview-pane .portal-content h2 {
  margin-bottom: 18px;
  font-size: 28px;
}

.editor-preview-pane .portal-input {
  width: min(600px, 82%);
}

.site-canvas {
  max-width: 920px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(20, 32, 56, 0.1);
}

.portal-canvas {
  border: 0;
  background: #eaf5ff;
}

.portal-background {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(25, 124, 238, 0.88) 0%, rgba(221, 239, 255, 0.66) 38%, rgba(255, 255, 255, 0.96) 76%),
    radial-gradient(circle at 50% 56%, rgba(255, 255, 255, 0.96) 0 12%, rgba(255, 255, 255, 0.5) 13% 24%, transparent 25%),
    linear-gradient(135deg, #2f8df2, #e8f5ff 58%, #ffffff);
  background-position: center;
  background-size: cover;
}

.portal-background::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.28;
  background:
    linear-gradient(90deg, transparent 0 7%, rgba(255, 255, 255, 0.7) 7% 8%, transparent 8% 15%) 0 150px / 170px 190px repeat-x,
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), transparent 55%);
}

.portal-background-custom::before {
  display: none;
}

.portal-skyline {
  position: absolute;
  right: 0;
  bottom: 130px;
  left: 0;
  height: 150px;
  opacity: 0.3;
  background:
    linear-gradient(90deg, transparent 0 8%, #7fb5e9 8% 14%, transparent 14% 19%, #82b9ef 19% 28%, transparent 28% 35%, #76aee8 35% 48%, transparent 48% 55%, #8dc0ef 55% 66%, transparent 66% 72%, #70a7df 72% 84%, transparent 84%),
    linear-gradient(180deg, transparent 0 35%, #b9d7f2 35% 50%, transparent 50%);
  filter: blur(1px);
}

.portal-background-custom .portal-skyline {
  display: none;
}

.portal-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 520px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 32px 74px;
  text-align: center;
}

.portal-avatar {
  display: grid;
  width: 118px;
  height: 118px;
  place-items: center;
  margin-bottom: 22px;
  font-size: 64px;
  border: 8px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 45px rgba(20, 70, 130, 0.22);
}

.portal-avatar-custom {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.portal-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.portal-content h2 {
  margin: 0 0 26px;
  color: var(--title-color);
  font-size: 32px;
  letter-spacing: 0.04em;
}

.portal-input {
  display: grid;
  width: min(620px, 92%);
  min-height: 56px;
  grid-template-columns: 44px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid rgba(119, 171, 217, 0.36);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 36px rgba(29, 91, 153, 0.16);
  backdrop-filter: blur(16px);
}

.portal-input span {
  overflow: hidden;
  color: #8a98a9;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-input input {
  width: 100%;
  min-width: 0;
  color: var(--text);
  border: 0;
  outline: 0;
  background: transparent;
}

.portal-input input::placeholder {
  color: #8a98a9;
}

.voice-button,
.send-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.voice-button {
  color: var(--send-color);
  background: var(--voice-color);
}

.send-button {
  color: #ffffff;
  background: var(--send-color);
  box-shadow: 0 10px 22px rgba(29, 161, 255, 0.28);
}

.send-icon {
  display: inline-block;
  color: #ffffff;
  line-height: 1;
  -webkit-text-fill-color: #ffffff;
  transform: rotate(-45deg);
}

.speech-hint,
.assistant-chip {
  margin-top: 16px;
  color: #5a6b82;
  font-size: 13px;
}

.assistant-chip {
  padding: 8px 12px;
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  min-height: 40px;
  padding: 10px 12px;
}

.field textarea {
  min-height: 76px;
  resize: vertical;
}

.color-control {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.color-control input[type="color"] {
  width: 56px;
  min-height: 40px;
  padding: 4px;
  cursor: pointer;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.asset-upload-button {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 36px;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
}

.asset-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.field-highlight {
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #eff6ff;
}

.field-error {
  padding: 12px;
  border: 1px solid #ef4444;
  border-radius: 14px;
  background: #fff1f2;
}

.field-error label,
.field-error .field-help {
  color: #b91c1c;
}

.field-error select {
  border-color: #ef4444;
}

.field-success {
  color: var(--success);
  font-size: 12px;
}

.preview-stage {
  padding: 22px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.preview-frame {
  padding: 26px;
  border: 1px dashed #b6c2d5;
  border-radius: 18px;
  background: var(--panel-soft);
}

.public-stage {
  max-width: 1080px;
  margin: 0 auto;
}

.public-chat-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 16px;
}

.public-chat-panel input {
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.public-chat-answer {
  min-height: 54px;
  margin-top: 14px;
  color: var(--text);
  line-height: 1.7;
}

.page-test-stage .preview-toolbar h2,
.page-test-stage .preview-toolbar p {
  margin: 0;
}

.portal-chat-test {
  position: relative;
  width: min(66vw, 960px);
  min-width: 720px;
  min-height: min(66vh, 640px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(20, 32, 56, 0.1);
}

.portal-chat-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
}

.portal-chat-back,
.portal-chat-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 22px rgba(20, 32, 56, 0.08);
}

.portal-chat-back {
  justify-content: center;
  width: 34px;
  color: var(--primary);
  font-size: 24px;
  text-decoration: none;
}

.portal-chat-pill {
  padding: 0 14px;
  color: var(--text);
  font-size: 13px;
}

.portal-chat-messages {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: calc(min(66vh, 640px) - 176px);
  max-height: calc(min(66vh, 640px) - 176px);
  flex-direction: column;
  gap: 18px;
  padding: 32px 10% 120px;
  overflow-y: auto;
  scrollbar-width: none;
}

.portal-chat-messages::-webkit-scrollbar {
  display: none;
}

.portal-chat-message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 72%;
}

.portal-chat-message.user {
  align-self: flex-end;
  justify-content: flex-end;
}

.portal-chat-message p {
  margin: 0;
  padding: 14px 18px;
  color: var(--text);
  line-height: 1.7;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 34px rgba(20, 32, 56, 0.1);
}

.portal-chat-message.user p {
  color: #ffffff;
  background: rgba(37, 99, 235, 0.78);
}

.portal-chat-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}

.portal-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-chat-input {
  position: absolute;
  right: 10%;
  bottom: 42px;
  left: 10%;
  z-index: 3;
  display: grid;
  min-height: 56px;
  grid-template-columns: 44px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid rgba(119, 171, 217, 0.36);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 36px rgba(29, 91, 153, 0.16);
  backdrop-filter: blur(16px);
}

.portal-chat-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.portal-chat-disclaimer {
  position: absolute;
  right: 0;
  bottom: 14px;
  left: 0;
  z-index: 3;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.mobile-preview {
  max-width: 390px;
  margin: 0 auto;
}

.assistant-placeholder,
.settings-placeholder {
  max-width: 860px;
}

.assistant-app-list {
  display: grid;
  gap: 14px;
}

.assistant-app-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.assistant-list-header {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr) auto;
}

.assistant-app-card h3,
.assistant-app-card p {
  margin: 0;
}

.assistant-app-card p {
  margin-top: 6px;
  color: var(--muted);
}

.assistant-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.assistant-workbench {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.assistant-editor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.assistant-workbench-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  --assistant-debug-height: clamp(442px, calc(133.333vh - 371px), 629px);
  align-items: start;
}

.assistant-orchestration {
  display: flex;
  min-height: var(--assistant-debug-height);
  flex-direction: column;
  padding: 14px;
  background: #f3f5f9;
  border-right: 1px solid var(--line);
}

.assistant-orchestration h2 {
  margin: 0 0 10px;
}

.assistant-section {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.assistant-section-highlight {
  margin-top: auto;
  margin-bottom: 0;
  border-color: #93c5fd;
  background: #f8fbff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

.guide-target {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.inline-guide-bubble {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 12px;
  padding: 8px 12px;
  color: var(--primary);
  font-weight: 700;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
}

.assistant-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.prompt-editor {
  width: 100%;
  min-height: 240px;
  padding: 10px 12px;
  line-height: 1.55;
  border: 1px solid #8bd4f0;
  border-radius: 14px;
  resize: vertical;
  background: #ffffff;
}

.knowledge-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.knowledge-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.uploaded-document-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.uploaded-document-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.uploaded-document-item > div {
  display: grid;
  gap: 4px;
}

.uploaded-document-item small {
  color: var(--muted);
}

.uploaded-document-item .upload-error {
  color: #b91c1c;
}

.assistant-capability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.assistant-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.assistant-toggle-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.toggle-on {
  padding: 6px 10px;
  color: var(--primary);
  border-radius: 999px;
  background: var(--primary-soft);
}

.assistant-debug {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-self: start;
  gap: 10px;
  height: var(--assistant-debug-height);
  max-height: var(--assistant-debug-height);
  min-height: 0;
  padding: 14px;
  overflow: hidden;
  background: #ffffff;
}

.debug-empty {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 0;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
}

.debug-chat-window {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  height: 100%;
  padding: 10px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
}

.debug-message {
  display: grid;
  gap: 4px;
  max-width: 86%;
}

.debug-message span {
  color: var(--muted);
  font-size: 12px;
}

.debug-message p {
  margin: 0;
  padding: 8px 10px;
  line-height: 1.5;
  border-radius: 14px;
  background: #ffffff;
}

.debug-message.user {
  align-self: flex-end;
}

.debug-message.user span {
  text-align: right;
}

.debug-message.user p {
  color: #ffffff;
  background: var(--primary);
}

.debug-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.debug-input textarea {
  min-height: 48px;
  max-height: 88px;
  padding: 8px 10px;
  line-height: 1.5;
  border: 1px solid var(--line);
  border-radius: 12px;
  resize: none;
}

.debug-input button {
  min-height: 48px;
  padding: 0 18px;
}

.empty-state {
  padding: 28px;
  text-align: center;
}
