:root {
  --text: #241b1a;
  --muted: #796864;
  --brand: #d92d20;
  --line: rgba(235, 214, 209, 0.92);
  --panel: rgba(255, 255, 255, 0.94);
  --panel-soft: rgba(255, 248, 246, 0.94);
  --shadow: 0 28px 60px rgba(118, 39, 27, 0.12);
  --soft-shadow: 0 16px 34px rgba(171, 54, 35, 0.1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(217, 45, 32, 0.14), transparent 28%),
    radial-gradient(circle at bottom right, rgba(166, 27, 19, 0.16), transparent 26%),
    #160f0f;
}
body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
}
button, textarea, input, a { font: inherit; }
button { border: 0; }
.desktop-stage { width: 100%; display: flex; justify-content: center; }
.app-window {
  width: min(1680px, calc(100vw - 32px));
  height: auto;
  min-height: 860px;
  display: grid;
  grid-template-columns: var(--hubitos-sidebar-width) minmax(0, 1fr);
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(180deg, #fcfbf7 0%, #faf8f3 100%);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.workflow-shell { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto 1fr; overflow: visible; }
.workflow-shell {
  overflow-y: visible;
}
.workflow-insights {
  padding: 12px 24px 0;
}
.workflow-insights-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
}
.workflow-topbar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  padding: 22px 24px 18px; border-bottom: 1px solid rgba(235, 209, 204, 0.42);
  background: radial-gradient(circle at 16% 0%, rgba(217, 45, 32, 0.08), transparent 24%), rgba(255, 252, 251, 0.88);
}
.topbar-kicker, .panel-kicker, .drawer-kicker {
  color: var(--brand); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.running-panel {
  flex: 1 1 auto;
}
.running-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.workflow-topbar h1 { margin: 8px 0 10px; font-size: 34px; line-height: 1.08; letter-spacing: -0.04em; }
.topbar-copy { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.7; }
.running-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff1ed;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.running-stream {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.running-stream.single {
  grid-template-columns: 1fr;
}
.stream-card {
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(236,214,209,0.92);
  background: rgba(255,255,255,0.72);
}
.stream-title {
  color: #8a716c;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.stream-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.stream-marquee {
  max-height: 168px;
  overflow: hidden;
  position: relative;
}
.marquee-list {
  animation: workflow-marquee 16s linear infinite;
}
@keyframes workflow-marquee {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}
.stream-list li {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(236,214,209,0.86);
  color: #5f4744;
  font-size: 13px;
  line-height: 1.55;
}
.stream-item-source {
  display: block;
  margin-top: 6px;
  color: #8a716c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.stream-list.compact li {
  font-size: 12px;
}
.topbar-actions, .panel-head.split, .entry-rail, .result-columns, .drawer-actions, .side-panel-actions { display: flex; gap: 12px; }
.topbar-actions { align-items: center; }
.ghost-pill, .primary-pill, .subtle-btn, .entry-card, .workflow-action, .workflow-secondary, .icon-btn { border-radius: 999px; cursor: pointer; }
.ghost-pill, .subtle-btn, .workflow-secondary {
  display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 16px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.86); color: #6f5f5c; text-decoration: none;
}
.primary-pill, .workflow-action {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 18px;
  color: #fff; background: linear-gradient(180deg, #d92d20 0%, #bb180e 100%); box-shadow: 0 12px 20px rgba(217, 45, 32, 0.18); text-decoration: none;
}
.hero-grid, .content-grid { display: grid; gap: 18px; }
.hero-grid { grid-template-columns: 1.35fr 0.8fr; padding: 20px 24px 0; }
.content-grid { grid-template-columns: 1.2fr 0.95fr; padding: 14px 24px 24px; min-height: 0; }
.content-grid.single-column { grid-template-columns: 1fr; }
.hero-panel, .signal-panel, .panel { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--soft-shadow); }
.hero-panel { padding: 22px 24px; }
.hero-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px; background: #fff1ed; color: var(--brand); font-size: 12px; font-weight: 700; }
.hero-head { display: flex; justify-content: space-between; gap: 20px; margin-top: 14px; }
.hero-head h2 { margin: 0; font-size: 28px; line-height: 1.15; letter-spacing: -0.03em; }
.hero-copy { margin-top: 10px; color: var(--muted); line-height: 1.75; }
.hero-status { min-width: 220px; padding: 16px; border-radius: 22px; background: linear-gradient(180deg, #fff8f6 0%, #fff1ed 100%); border: 1px solid rgba(217, 45, 32, 0.12); }
.hero-status-label, .result-meta, .workflow-card-meta, .workflow-card-foot, .signal-note, .progress-meta { color: #876f6a; font-size: 12px; }
.hero-status-value { margin-top: 8px; font-size: 22px; font-weight: 700; }
.hero-status-note { margin-top: 6px; color: var(--muted); line-height: 1.6; font-size: 13px; }
.entry-rail { margin-top: 18px; flex-wrap: wrap; }
.entry-card {
  flex: 1 1 180px; min-height: 90px; padding: 16px 18px; border: 1px solid rgba(235, 214, 209, 0.95);
  border-radius: 22px; background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,247,245,0.94)); text-align: left; color: #503a37;
}
.entry-card strong, .workflow-card h3, .panel-head h3, .result-title, .drawer-head h3 { display: block; margin: 0 0 6px; font-size: 18px; letter-spacing: -0.02em; }
.entry-card span { display: block; color: var(--muted); line-height: 1.6; font-size: 13px; }
.signal-panel, .panel { padding: 20px; }
.execution-panel {
  min-height: 0;
  max-height: none;
  overflow-y: visible;
}
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.panel-copy { color: #8a716c; font-size: 13px; }
.signal-stack, .workflow-grid, .result-list, .form-body { display: grid; gap: 12px; }
.workflow-tabs {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.workflow-tab {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(236,214,209,0.92);
  background: rgba(255,255,255,0.82);
  color: #725f5b;
  cursor: pointer;
}
.workflow-tab.active {
  background: #fff1ed;
  color: var(--brand);
  border-color: rgba(217,45,32,0.22);
}
.ghost-pill.subtle {
  min-height: 34px;
  padding: 0 14px;
}
.signal-stack { margin-top: 16px; }
.signal-item { padding: 16px 16px 14px; border-radius: 22px; background: linear-gradient(180deg, #fff8f6 0%, #fffdfc 100%); border: 1px solid rgba(236, 214, 209, 0.92); }
.signal-label, .workflow-pill, .result-block-title { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #8a706b; }
.signal-value { margin-top: 8px; font-size: 26px; font-weight: 700; }
.activity-list {
  display: grid;
  gap: 11px;
}
.activity-item {
  padding: 13px 15px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff8f6 0%, #fffdfc 100%);
  border: 1px solid rgba(236, 214, 209, 0.92);
}
.activity-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.activity-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.activity-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff1ed;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
}
.activity-copy {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}
.activity-time {
  margin-top: 10px;
  color: #6a5956;
  font-size: 12px;
}
.workflow-grid { margin-top: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.workflow-card { padding: 16px; border-radius: 16px; border: 1px solid rgba(236, 214, 209, 0.92); background: var(--panel-soft); box-shadow: 0 14px 28px rgba(145, 54, 39, 0.08); display: grid; gap: 12px; }
.workflow-card-head, .workflow-card-actions, .result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.workflow-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff1ed;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.workflow-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; background: #f4ecea; }
.workflow-card p, .result-empty, .drawer-bubble, .drawer-answer { margin: 0; color: var(--muted); line-height: 1.65; font-size: 14px; }
.workflow-card-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.workflow-card-meta span { padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,0.72); border: 1px solid rgba(236,214,209,0.85); }
.workflow-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.workflow-card-actions { justify-content: flex-end; }
.result-empty { margin-top: 18px; padding: 24px; border-radius: 24px; border: 1px dashed rgba(217, 45, 32, 0.24); background: linear-gradient(180deg, #fff9f8 0%, #fffdfc 100%); }
.hidden { display: none !important; }
.form-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(236, 214, 209, 0.92);
  background: linear-gradient(180deg, #fffaf8 0%, #ffffff 100%);
}
.result-card { margin-top: 18px; padding: 18px; border-radius: 24px; border: 1px solid rgba(236, 214, 209, 0.92); background: linear-gradient(180deg, #fffaf8 0%, #ffffff 100%); }
.chat-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(236, 214, 209, 0.92);
  background: linear-gradient(180deg, #fffaf8 0%, #ffffff 100%);
}
.result-status { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; background: #fff1ed; color: var(--brand); font-size: 12px; font-weight: 700; }
.result-preview {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(236,214,209,0.92);
  background: linear-gradient(180deg, #fff3ef 0%, #fffdfb 100%);
}
.result-preview-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a706b;
}
.result-preview-title {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.result-preview-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}
.result-preview-list li + li {
  margin-top: 8px;
}
.result-preview-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 14px;
  gap: 10px;
  flex-wrap: wrap;
}
.result-columns { margin-top: 16px; }
.result-block { flex: 1 1 0; min-width: 0; }
.result-list { margin: 10px 0 0; padding: 0; list-style: none; }
.result-list li { padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,0.86); border: 1px solid rgba(236,214,209,0.88); }
.result-list.compact li { padding: 10px 12px; font-size: 13px; }
.icon-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.8); color: #604945; }
.form-progress { margin-bottom: 16px; }
.progress-track { width: 100%; height: 8px; border-radius: 999px; background: rgba(236,214,209,0.72); overflow: hidden; }
.progress-fill { display: block; width: 30%; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #d92d20 0%, #f08b7d 100%); }
@media (max-width: 1200px) {
  .workflow-insights-grid {
    grid-template-columns: 1fr;
  }
}
.form-body { overflow: auto; }
.drawer-bubble, .drawer-answer { max-width: 92%; padding: 12px 14px; border-radius: 18px; }
.drawer-bubble { background: rgba(255,255,255,0.92); border: 1px solid rgba(236,214,209,0.88); }
.drawer-answer { justify-self: end; background: linear-gradient(180deg, #fff1ed 0%, #ffe3dc 100%); border: 1px solid rgba(217,45,32,0.14); color: #5a3d39; }
.filled-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.filled-tags span { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; background: #ffffff; border: 1px solid rgba(236,214,209,0.86); color: #6f5f5c; font-size: 12px; }
.form-footer { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(236,214,209,0.85); }
.chat-thread {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}
.chat-bubble {
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 18px;
  line-height: 1.6;
  font-size: 14px;
}
.chat-bubble.system {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(236,214,209,0.88);
  color: #5f4744;
}
.chat-bubble.user {
  justify-self: end;
  background: linear-gradient(180deg, #fff1ed 0%, #ffe3dc 100%);
  border: 1px solid rgba(217,45,32,0.14);
  color: #5a3d39;
}
.chat-bubble-meta {
  display: block;
  margin-top: 6px;
  color: #8a716c;
  font-size: 11px;
  font-weight: 700;
}
.chat-composer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(236,214,209,0.85);
}
.chat-composer textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(236,214,209,0.95);
  background: rgba(255,255,255,0.96);
  color: var(--text);
  outline: none;
}
.chat-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}
.drawer-helper { color: #8a716c; line-height: 1.65; font-size: 13px; }
.drawer-actions { justify-content: flex-end; margin-top: 12px; }
.drawer-form {
  display: grid;
  gap: 16px;
}
.drawer-field {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(236,214,209,0.9);
  background: rgba(255,255,255,0.92);
}
.drawer-field-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.drawer-field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.drawer-field-question {
  margin-top: 6px;
  color: #5f4744;
  line-height: 1.65;
  font-size: 15px;
}
.drawer-auth-btn {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #d92d20 0%, #bb180e 100%);
  color: #fff;
  box-shadow: 0 12px 20px rgba(217, 45, 32, 0.14);
  flex: 0 0 auto;
}
.drawer-auth-btn.done {
  background: rgba(24, 140, 86, 0.12);
  color: #13814f;
  box-shadow: none;
}
.drawer-input,
.drawer-textarea {
  width: 100%;
  margin-top: 14px;
  border-radius: 18px;
  border: 1px solid rgba(236,214,209,0.95);
  background: rgba(255,255,255,0.96);
  color: var(--text);
  outline: none;
}
.drawer-input {
  min-height: 50px;
  padding: 0 14px;
}
.drawer-textarea {
  min-height: 124px;
  resize: vertical;
  padding: 12px 14px;
}
.drawer-field-meta {
  margin-top: 10px;
  color: #907873;
  font-size: 12px;
}
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(24px); padding: 10px 16px; border-radius: 999px;
  background: rgba(36, 27, 26, 0.92); color: #fff; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease; z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 1280px) { .hero-grid, .content-grid { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .workflow-topbar, .hero-head, .result-columns, .topbar-actions, .running-panel-head { flex-direction: column; }
  .workflow-grid { grid-template-columns: 1fr; }
  .running-stream { grid-template-columns: 1fr; }
}
