:root {
  --ink: #0f172a;
  --muted: #718096;
  --soft: #f6f8fb;
  --paper: #ffffff;
  --line: #dce5ef;
  --dark: #101827;
  --dark-2: #0b111d;
  --teal: #15a69d;
  --teal-deep: #0f766e;
  --teal-soft: #e7faf7;
  --orange: #ff5a43;
  --orange-soft: #fff0ea;
  --purple: #7c3aed;
  --purple-soft: #f1e8ff;
  --gold: #f5b945;
  --shadow: 0 22px 60px rgba(15, 23, 42, 0.1);
  --shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 10%, rgba(124, 58, 237, 0.12), transparent 28%),
    radial-gradient(circle at 10% 18%, rgba(21, 166, 157, 0.12), transparent 24%),
    linear-gradient(180deg, #f9fbff 0%, #eef3f8 100%);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

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

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

.rail {
  display: none;
}

.workspace {
  min-width: 0;
  padding: 0 42px 72px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 86px;
  margin: 0 -42px;
  padding: 0 54px;
  background: rgba(16, 24, 39, 0.96);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 232px;
  font-size: 1.42rem;
  font-weight: 900;
  line-height: 1;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #e2e8f0;
  font-weight: 850;
  white-space: nowrap;
}

.nav-tab:hover,
.nav-tab.active {
  border-color: rgba(124, 58, 237, 0.42);
  background: rgba(124, 58, 237, 0.18);
  color: #fff;
}

.nav-menu-wrap {
  position: relative;
}

.create-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 12px);
  left: 0;
  display: none;
  width: 288px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 28px 68px rgba(15, 23, 42, 0.26);
}

.create-menu.open {
  display: grid;
  gap: 6px;
}

.create-menu button {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 52px;
  padding: 9px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  text-align: left;
  font-weight: 850;
}

.create-menu button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.create-menu span {
  color: #aeb9c8;
  font-size: 0.78rem;
  font-weight: 650;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 10px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 0.88rem;
  font-weight: 750;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(21, 166, 157, 0.16);
}

.home-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #c4b5fd, #6d28d9 64%, #4c1d95);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(109, 40, 217, 0.28);
}

.home-link:hover {
  filter: brightness(1.05);
}

.agent-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 34px;
  max-width: 1580px;
  margin: 30px auto 24px;
  padding: 38px;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(16, 24, 39, 0.94), rgba(15, 23, 42, 0.98)),
    radial-gradient(circle at 78% 26%, rgba(124, 58, 237, 0.34), transparent 34%),
    radial-gradient(circle at 18% 80%, rgba(21, 166, 157, 0.28), transparent 30%);
  color: #fff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.hero-kicker,
.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.88rem;
  font-weight: 900;
  text-transform: uppercase;
}

.agent-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 5.6rem);
  line-height: 1.02;
  font-weight: 950;
}

.agent-hero p {
  max-width: 820px;
  margin: 22px 0 0;
  color: #dbe5f0;
  font-size: clamp(1rem, 1.6vw, 1.28rem);
  line-height: 1.75;
  font-weight: 650;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.hero-button {
  min-width: 148px;
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-metrics span {
  min-height: 58px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-weight: 800;
}

.hero-metrics strong {
  display: block;
  color: #fff;
  font-size: 1.18rem;
}

.hero-visual {
  display: grid;
  align-content: center;
  justify-self: end;
  gap: 14px;
  width: min(100%, 420px);
  min-width: 0;
}

.hero-preview-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  min-height: 0;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #080c14;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}

.hero-preview-card img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  opacity: 0.92;
}

.hero-preview-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 44%, rgba(8, 12, 20, 0.88));
}

.hero-preview-badge,
.hero-preview-caption {
  position: absolute;
  z-index: 1;
}

.hero-preview-badge {
  top: 18px;
  left: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-weight: 900;
}

.hero-preview-caption {
  right: 18px;
  bottom: 18px;
  left: 18px;
  color: #fff;
  font-size: 1.02rem;
  font-weight: 900;
}

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

.hero-feature-grid span {
  min-height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 900;
}

.stage-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 1580px;
  margin: 0 auto 22px;
}

.stage-chip {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
}

.stage-chip.done {
  border-color: rgba(21, 166, 157, 0.34);
  color: var(--teal-deep);
}

.stage-chip.active {
  border-color: rgba(255, 90, 67, 0.26);
  background: var(--orange-soft);
  color: var(--orange);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.98fr) minmax(520px, 1.22fr) minmax(330px, 0.86fr);
  gap: 22px;
  max-width: 1580px;
  margin: 0 auto;
  align-items: start;
}

.left-stack,
.preview-column {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.left-stack .asset-panel {
  order: 1;
}

.left-stack .editor-panel {
  order: 2;
}

.left-stack .source-panel {
  order: 3;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.source-panel,
.editor-panel,
.preview-panel,
.asset-panel,
.compose-panel,
.job-panel {
  padding: 24px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-heading.tight {
  margin: 26px 0 14px;
}

.panel h2,
.topbar h1 {
  margin: 0;
  line-height: 1.15;
}

.panel h2 {
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 950;
}

.platform-pill,
.render-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.platform-pill.ready,
.render-state {
  background: var(--teal-soft);
  color: var(--teal-deep);
}

.render-state.running {
  background: #fff7db;
  color: #a16207;
}

.render-state.failed {
  background: #fff4f0;
  color: #c23b28;
}

label {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
}

input,
select {
  min-height: 50px;
  padding: 0 14px;
}

.provider-note {
  display: block;
  margin-top: 8px;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.55;
}

.provider-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.provider-status-grid span {
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid rgba(21, 166, 157, 0.22);
  border-radius: 16px;
  background: #f8fbff;
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.45;
}

.provider-status-grid strong {
  display: block;
  color: var(--ink);
  font-size: 0.92rem;
}

textarea {
  min-height: 124px;
  padding: 14px;
  resize: vertical;
  line-height: 1.65;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(21, 166, 157, 0.72);
  box-shadow: 0 0 0 4px rgba(21, 166, 157, 0.12);
}

.compact-textarea {
  min-height: 84px;
}

.script-editor {
  min-height: 280px;
}

.divider {
  height: 1px;
  margin: 24px -24px 0;
  background: var(--line);
}

.button-row,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button-row {
  margin-top: 14px;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font-weight: 950;
  white-space: nowrap;
}

.primary-button {
  background: linear-gradient(135deg, #19b9ad, #0f8f85);
  color: #fff;
  box-shadow: 0 16px 30px rgba(21, 166, 157, 0.18);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(21, 166, 157, 0.25);
}

.ghost-button {
  border: 1px solid rgba(21, 166, 157, 0.22);
  background: #f0fbf9;
  color: var(--teal-deep);
}

.ghost-button:hover,
.icon-button:hover {
  border-color: rgba(21, 166, 157, 0.38);
  background: var(--teal-soft);
}

.compact {
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.86rem;
}

.icon-button {
  display: inline-grid;
  width: 48px;
  min-width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 900;
}

.full {
  width: 100%;
  margin-top: 18px;
}

.asset-tabs,
.topic-tabs {
  display: flex;
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f7fafc;
}

.asset-tab,
.topic-tab {
  flex: 1 1 0;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #64748b;
  font-weight: 900;
}

.asset-tab.active,
.topic-tab.active,
.topic-tab:hover {
  background: #fff;
  color: var(--orange);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.asset-block {
  display: none;
}

.asset-block.active {
  display: block;
}

.asset-block input[type="file"] {
  padding: 13px;
  color: #64748b;
}

.asset-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 4px;
}

.asset-preview-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.asset-preview-media,
.voice-preview-box {
  position: relative;
  display: grid;
  min-height: 148px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(21, 166, 157, 0.34);
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fcff, #f1fbf8);
  color: #64748b;
  font-weight: 900;
  text-align: center;
}

.asset-preview-media img,
.asset-preview-media video {
  display: block;
  width: 100%;
  height: 148px;
  object-fit: cover;
}

.asset-preview-media.empty,
.voice-preview-box:not(.ready) {
  padding: 16px;
}

.voice-preview-box.ready {
  min-height: 74px;
  border-style: solid;
  background: var(--teal-soft);
  color: var(--teal-deep);
}

#voicePreviewAudio {
  width: 100%;
}

.asset-preview-meta {
  display: grid;
  gap: 3px;
}

.asset-preview-meta strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.asset-preview-meta small {
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.45;
}

.asset-api-status {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(21, 166, 157, 0.2);
  border-radius: 14px;
  background: #f0fbf9;
  color: #0f766e;
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1.6;
}

.asset-api-status.error {
  border-color: rgba(255, 80, 58, 0.22);
  background: #fff4f0;
  color: #c23b28;
}

.asset-api-status.ready {
  border-color: rgba(21, 166, 157, 0.3);
  background: #e8fbf7;
  color: #08776f;
}

.toggle-line {
  display: flex;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  color: #475569;
  font-weight: 750;
  line-height: 1.55;
}

.toggle-line input {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  margin-top: 2px;
  accent-color: var(--teal);
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.platform-choice {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: #64748b;
  font-weight: 900;
}

.platform-choice.active,
.platform-choice:hover {
  border-color: rgba(255, 90, 67, 0.28);
  background: var(--orange-soft);
  color: var(--orange);
}

.summary-list,
.delivery-summary {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.summary-list div,
.delivery-summary div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbfd;
}

.summary-list .summary-wide {
  grid-template-columns: 100px minmax(0, 1fr);
  align-items: start;
  min-height: unset;
}

.summary-list .summary-status {
  border-color: rgba(255, 90, 67, 0.22);
  background: rgba(255, 90, 67, 0.06);
}

.summary-list p,
.summary-list ul {
  margin: 0;
  color: var(--ink);
  font-weight: 760;
  line-height: 1.68;
}

.summary-list ul {
  display: grid;
  gap: 6px;
  padding-left: 18px;
}

.summary-list .share-compliance {
  border-color: rgba(20, 166, 154, 0.26);
  background: rgba(20, 166, 154, 0.08);
}

.summary-list .share-compliance p {
  color: #0f766e;
}

.primary-button.is-loading,
.ghost-button.is-loading {
  opacity: 0.72;
  cursor: progress;
}

.summary-list span,
.delivery-summary span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.summary-list strong,
.delivery-summary strong {
  min-width: 0;
  color: var(--ink);
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.topic-input label {
  margin: 0;
}

.topic-tab {
  display: grid;
  gap: 2px;
  min-height: 54px;
  text-align: left;
}

.topic-tab span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
}

.topic-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 430px;
  margin-top: 16px;
  overflow: auto;
  padding-right: 4px;
}

.topic-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.topic-card.active,
.topic-card:hover {
  border-color: rgba(21, 166, 157, 0.45);
  background: #f2fcfa;
  box-shadow: 0 10px 24px rgba(21, 166, 157, 0.1);
}

.topic-rank {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: var(--dark);
  color: #fff;
  font-weight: 950;
}

.topic-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.topic-main strong {
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.45;
}

.topic-main small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.topic-main small b {
  color: var(--teal-deep);
}

.topic-main em {
  color: #64748b;
  font-size: 0.82rem;
  font-style: normal;
  line-height: 1.45;
}

.copy-lab {
  margin-top: 28px;
  padding-top: 2px;
}

.script-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(150px, 0.8fr);
  gap: 12px;
}

.script-layout label {
  margin: 0;
}

.script-layout input[type="range"] {
  padding: 0;
  accent-color: var(--teal);
}

.element-cloud,
.variant-grid,
.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.element-tag,
.variant-button,
.avatar-choice {
  border: 1px solid var(--line);
  background: #fff;
  color: #475569;
  font-weight: 900;
}

.element-tag {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 999px;
}

.element-tag.active,
.element-tag:hover {
  border-color: rgba(124, 58, 237, 0.34);
  background: var(--purple-soft);
  color: var(--purple);
}

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

.variant-button {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 14px;
  border-radius: 18px;
  text-align: left;
}

.variant-button:hover {
  border-color: rgba(21, 166, 157, 0.4);
  background: #f2fcfa;
}

.variant-button strong {
  color: var(--teal-deep);
}

.variant-button span {
  color: #64748b;
  font-size: 0.86rem;
  line-height: 1.52;
}

.preview-column {
  position: sticky;
  top: 108px;
}

.phone-preview {
  position: relative;
  overflow: hidden;
  min-height: 480px;
  border-radius: 24px;
  background: #05070c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.phone-preview-media {
  width: 100%;
  height: 480px;
}

.phone-preview-media img,
.phone-preview-media video,
.phone-preview img {
  display: block;
  width: 100%;
  height: 480px;
  object-fit: cover;
}

.phone-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 7, 12, 0.04), rgba(5, 7, 12, 0.82));
}

.caption-overlay {
  position: absolute;
  z-index: 1;
  right: 18px;
  bottom: 68px;
  left: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.74);
  color: #fff;
  font-weight: 900;
  line-height: 1.55;
}

.preview-toolbar {
  position: absolute;
  z-index: 1;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.preview-toolbar span {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-weight: 950;
}

.avatar-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
}

.avatar-choice.active {
  border-color: rgba(21, 166, 157, 0.46);
  background: var(--teal-soft);
  color: var(--teal-deep);
}

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

.compose-grid article {
  display: grid;
  gap: 5px;
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.compose-grid span {
  color: var(--teal-deep);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.compose-grid strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
  line-height: 1.35;
}

.compose-grid small {
  color: #64748b;
  font-weight: 750;
  line-height: 1.45;
}

.compose-progress {
  height: 12px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.compose-progress div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--purple));
  transition: width 0.28s ease;
}

.compose-progress-text {
  margin: 10px 0 0;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.55;
}

.job-cards {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.job-empty,
.job-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.job-empty {
  padding: 16px;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 850;
  text-align: center;
}

.job-card {
  display: grid;
  gap: 7px;
  padding: 14px;
}

.job-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.job-card span,
.job-card small,
.job-card p {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 800;
}

.job-card strong {
  color: var(--teal-deep);
  font-size: 0.92rem;
}

.job-card p {
  margin: 0;
  color: #c23b28;
  line-height: 1.45;
}

.job-card a {
  justify-self: start;
  color: var(--purple);
  font-size: 0.86rem;
  font-weight: 950;
}

.job-card.status-failed {
  border-color: rgba(255, 80, 58, 0.28);
  background: #fff8f5;
}

.job-card.status-running,
.job-card.status-queued {
  border-color: rgba(139, 92, 246, 0.24);
  background: #fbf7ff;
}

.avatar-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.avatar-dot.coral {
  background: var(--orange);
}

.avatar-dot.teal {
  background: var(--teal);
}

.avatar-dot.gold {
  background: var(--gold);
}

.pipeline {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pipeline li {
  position: relative;
  min-height: 44px;
  padding: 11px 14px 11px 40px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: #64748b;
  font-weight: 900;
}

.pipeline li::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd5e1;
  transform: translateY(-50%);
}

.pipeline li.done {
  background: #f2fcfa;
  color: var(--teal-deep);
}

.pipeline li.done::before {
  background: var(--teal);
}

.pipeline li.active {
  border-color: rgba(255, 90, 67, 0.3);
  background: var(--orange-soft);
  color: var(--orange);
}

.pipeline li.active::before {
  background: var(--orange);
}

@media (max-width: 1280px) {
  .workspace {
    padding: 0 28px 64px;
  }

  .topbar {
    margin: 0 -28px;
    padding: 0 32px;
  }

  .agent-hero,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    justify-self: center;
  }

  .preview-column {
    position: static;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.6fr);
  }

  .phone-preview,
  .phone-preview-media,
  .phone-preview-media img,
  .phone-preview-media video,
  .phone-preview img {
    height: auto;
    min-height: 420px;
  }
}

@media (max-width: 900px) {
  .workspace {
    padding: 0 18px 52px;
  }

  .topbar {
    position: relative;
    flex-wrap: wrap;
    min-height: auto;
    margin: 0 -18px;
    padding: 18px;
  }

  .brand-link {
    width: 100%;
    min-width: 0;
  }

  .top-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .topbar-actions {
    margin-left: auto;
  }

  #saveStatus {
    display: none;
  }

  .agent-hero {
    padding: 24px;
    border-radius: 24px;
  }

  .hero-visual {
    width: min(100%, 360px);
  }

  .hero-preview-card {
    border-radius: 22px;
  }

  .hero-preview-card,
  .hero-preview-card img {
    min-height: 0;
  }

  .hero-feature-grid,
  .asset-preview-grid,
  .compose-grid,
  .provider-status-grid,
  .platform-grid,
  .script-layout,
  .variant-grid,
  .topic-list,
  .preview-column {
    grid-template-columns: 1fr;
  }

  .topic-input {
    grid-template-columns: 1fr;
  }

  .stage-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .stage-chip {
    flex: 0 0 auto;
  }
}

@media (max-width: 560px) {
  .agent-hero h1 {
    font-size: 2.24rem;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .home-link {
    flex: 1 1 auto;
    justify-content: center;
  }

  .asset-tabs,
  .topic-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .source-panel,
  .editor-panel,
  .preview-panel,
  .asset-panel,
  .compose-panel,
  .job-panel {
    padding: 18px;
  }

  .summary-list div,
  .delivery-summary div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
