:root {
  --bg: #f8fafc;
  --paper: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --soft: #f1f5f9;
  --ring: #0f766e;
  --agent: #2563eb;
  --agent-soft: #eff6ff;
  --task: #b45309;
  --task-soft: #fffbeb;
  --human: #be123c;
  --human-soft: #fff1f2;
  --data: #0f766e;
  --data-soft: #f0fdfa;
  --shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 28px 80px rgba(15, 23, 42, 0.14);
  --radius: 14px;
  --studio-rail-width: clamp(72px, 5.2vw, 88px);
  --studio-main-safe-gap: clamp(10px, 1.2vw, 18px);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", "Inter", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(248,250,252,.98)),
    linear-gradient(135deg, rgba(15, 118, 110, .06), transparent 32%),
    linear-gradient(315deg, rgba(37, 99, 235, .05), transparent 36%),
    var(--bg);
}

body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
}

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

button {
  border: 0;
  background: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}

button:active { transform: scale(.98); }

.desktop-stage {
  width: 100%;
  display: flex;
  justify-content: center;
}

.app-window {
  width: min(1880px, calc(100vw - 20px));
  min-height: calc(100vh - 32px);
  display: grid;
  grid-template-columns: var(--hubitos-sidebar-width) minmax(0, 1fr);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow-lg);
}

.studio-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--studio-rail-width);
  min-width: 0;
  align-items: start;
  isolation: isolate;
}

.studio-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 6px 16px;
  border-left: 1px solid var(--line);
  background: rgba(255,255,255,.68);
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  min-width: var(--studio-rail-width);
  width: var(--studio-rail-width);
  position: relative;
  z-index: 5;
}

.studio-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--ring), #0b5f59);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .04em;
}

.rail-btn,
.rail-link {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid transparent;
  color: var(--muted);
}

.rail-btn.active,
.rail-btn:hover,
.rail-link:hover {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.rail-spacer { flex: 1; }

.studio-main {
  grid-column: 1;
  grid-row: 1;
  padding: 22px calc(10px + var(--studio-main-safe-gap)) 22px 22px;
  min-width: 0;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.screen { display: none; min-width: 0; }
.screen.active { display: block; }

.home-layout,
.editor-layout,
.dashboard-bottom,
.dashboard-main {
  display: grid;
  gap: 16px;
}

.home-layout {
  grid-template-columns: 300px minmax(0, 1fr) 320px;
  align-items: start;
}

.home-card,
.work-package-card,
.chat-panel,
.board-shell,
.dashboard-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
}

.home-card,
.work-package-card,
.chat-panel,
.dashboard-card {
  padding: 18px;
}

.kicker,
.small-copy,
.status-label,
.metric-label {
  color: var(--muted);
  font-size: 12px;
}

.home-left h2,
.home-right h2,
.board-head h2,
.work-package-card h2,
.dashboard-top h1,
.dashboard-card h2 {
  margin: 10px 0 0;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.action-list,
.package-list,
.feed-list,
.copilot-thread,
.package-metrics,
.recommendation-grid,
.chat-messages,
.board-log-list,
.asset-list,
.record-list {
  display: grid;
  gap: 12px;
}

.action-row,
.package-row,
.feed-item,
.record-item,
.asset-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  text-align: left;
}

.action-row strong,
.package-row strong,
.feed-item strong,
.asset-item strong,
.record-item strong {
  display: block;
  font-size: 15px;
}

.action-row span span,
.package-row span span,
.feed-item span,
.asset-item span,
.record-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.action-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-weight: 700;
}

.action-icon.agent { color: var(--agent); background: var(--agent-soft); }
.action-icon.task { color: var(--task); background: var(--task-soft); }
.action-icon.data { color: var(--data); background: var(--data-soft); }

.home-stats,
.agent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.stat-card,
.agent-stat {
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
}

.stat-card strong,
.agent-stat strong {
  display: block;
  margin-top: 10px;
  font-size: 26px;
}

.copilot-head,
.panel-head,
.summary-head,
.package-top,
.board-head,
.dashboard-card-head,
.dashboard-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.copilot-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.copilot-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--agent), #1d4ed8);
  color: #fff;
  font-weight: 800;
}

.copilot-title strong {
  display: block;
  font-size: 16px;
}

.copilot-title span span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.live,
.status-pill.ready {
  color: var(--data);
  background: var(--data-soft);
}

.status-pill.idle {
  color: var(--muted);
  background: #eef2f7;
}

.status-pill.running {
  color: var(--agent);
  background: var(--agent-soft);
}

.home-msg,
.recommendation-card,
.log-row,
.record-item,
.asset-item {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.home-msg.user {
  background: var(--agent-soft);
}

.home-msg strong {
  display: block;
  font-size: 14px;
}

.home-msg span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.prompt-box,
.chat-compose {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.prompt-box textarea,
.chat-compose textarea {
  width: 100%;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  resize: vertical;
  outline: none;
}

.prompt-actions,
.package-actions,
.board-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(180deg, #0f766e 0%, #0b5f59 100%);
  box-shadow: 0 12px 20px rgba(15, 118, 110, 0.18);
}

.ghost-btn {
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
}

.editor-layout {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 18px;
}

.editor-side {
  display: grid;
  gap: 16px;
}

.editor-summary-top {
  width: 100%;
  grid-column: 1 / -1;
}

.board-shell {
  grid-column: 1 / -1;
}

.package-badge,
.lane-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--task-soft);
  color: var(--task);
  font-size: 12px;
  font-weight: 700;
}

.work-package-card p,
.dashboard-top p {
  color: var(--muted);
  line-height: 1.7;
}

.package-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.mini-metric {
  padding: 12px;
  border-radius: 14px;
  background: var(--soft);
}

.mini-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.recommendation-grid {
  margin-top: 16px;
}

.recommendation-card.wide {
  grid-column: 1 / -1;
}

.board-shell {
  padding: 18px;
  width: 100%;
  max-width: none;
}

.workflow-lane {
  margin-top: 14px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border: 1px dashed #cbd5e1;
}

.canvas-board {
  position: relative;
  width: 100%;
  max-width: none;
}

.workflow-detail-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

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

.workflow-restart-btn {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.7);
  background: rgba(255,255,255,.82);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.workflow-restart-icon {
  font-size: 16px;
  line-height: 1;
}

.node-detail-panel {
  min-width: 0;
}

.node-gallery-shell {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 14%, rgba(96, 165, 250, 0.14), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(45, 212, 191, 0.12), transparent 22%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
  box-shadow: var(--shadow);
}

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

.node-gallery-pod {
  position: relative;
}

.workflow-node-card {
  width: 100%;
  border-radius: 24px;
  box-shadow: var(--shadow);
  text-align: left;
}

.workflow-node-tab {
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
}

.workflow-node-tab.active {
  transform: translateX(8px);
}

.workflow-node-tab.active .node-surface {
  border-color: rgba(15, 118, 110, 0.34);
  box-shadow: 0 22px 54px rgba(15, 118, 110, 0.14);
}

.workflow-node-tab.active .node-step {
  background: rgba(15, 118, 110, 0.12);
  color: var(--ring);
}

.workflow-node-detail {
  width: 100%;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.node-surface {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.96);
  overflow: hidden;
}

.workflow-node-card[data-accent="agent"] .node-surface,
.workflow-node-detail[data-accent="agent"] .node-surface {
  background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
}

.workflow-node-card[data-accent="task"] .node-surface,
.workflow-node-detail[data-accent="task"] .node-surface {
  background: linear-gradient(180deg, #ffffff 0%, #fffaf1 100%);
}

.workflow-node-card[data-accent="data"] .node-surface,
.workflow-node-detail[data-accent="data"] .node-surface {
  background: linear-gradient(180deg, #ffffff 0%, #f3fffb 100%);
}

.workflow-node-card[data-accent="human"] .node-surface,
.workflow-node-detail[data-accent="human"] .node-surface {
  background: linear-gradient(180deg, #ffffff 0%, #fff4f7 100%);
}

.node-topline,
.node-header,
.node-section,
.node-copy,
.node-output-list {
  display: grid;
  gap: 10px;
}

.node-topline {
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding: 16px 18px 0;
}

.node-step {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.node-header {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  padding: 16px 18px 18px;
}

.node-badge {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #0f766e 0%, #0b5f59 100%);
}

.workflow-node-card[data-accent="task"] .node-badge,
.workflow-node-detail[data-accent="task"] .node-badge {
  background: linear-gradient(180deg, #b45309 0%, #92400e 100%);
}

.workflow-node-card[data-accent="data"] .node-badge,
.workflow-node-detail[data-accent="data"] .node-badge {
  background: linear-gradient(180deg, #0891b2 0%, #0f766e 100%);
}

.workflow-node-card[data-accent="human"] .node-badge,
.workflow-node-detail[data-accent="human"] .node-badge {
  background: linear-gradient(180deg, #e11d48 0%, #be123c 100%);
}

.node-header h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.node-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.node-payload {
  display: grid;
  gap: 16px;
  padding: 0 18px 18px;
}

.node-section {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255,255,255,.78);
}

.preference-shell {
  display: grid;
  gap: 12px;
}

.preference-form-shell {
  gap: 16px;
}

.preference-module {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
}

.preference-module-head span,
.preference-module-head strong {
  display: block;
}

.preference-module-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.preference-module-head strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.preference-field-block {
  display: grid;
  gap: 10px;
}

.preference-field-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.preference-choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.preference-option-chip {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(203, 213, 225, 0.96);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}

.preference-option-chip.active {
  border-color: rgba(15, 118, 110, 0.34);
  background: rgba(240, 253, 250, 0.96);
  color: var(--data);
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.08);
}

.preference-inline-input,
.preference-links-input {
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(203, 213, 225, 0.96);
  background: rgba(255,255,255,.98);
  color: var(--ink);
  font: inherit;
  outline: none;
}

.preference-links-input {
  min-height: 110px;
  resize: vertical;
}

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

.preference-card {
  display: grid;
  gap: 10px;
  min-height: 132px;
  padding: 22px;
  border-radius: 28px;
  border: 1px solid rgba(20, 83, 45, 0.16);
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(22, 32, 22, 0.96)),
    linear-gradient(180deg, rgba(34, 197, 94, 0.08), rgba(0,0,0,0));
  color: rgba(255,255,255,.96);
  text-align: left;
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.12);
}

.preference-card strong {
  font-size: 22px;
  line-height: 1.12;
  font-weight: 800;
}

.preference-card span {
  color: rgba(226, 232, 240, 0.6);
  font-size: 13px;
  line-height: 1.5;
}

.preference-card.active {
  border-color: rgba(34, 197, 94, 0.32);
  background:
    linear-gradient(90deg, rgba(18, 51, 36, 0.98), rgba(22, 42, 31, 0.98)),
    linear-gradient(180deg, rgba(74, 222, 128, 0.12), rgba(0,0,0,0));
  box-shadow: 0 22px 40px rgba(22, 101, 52, 0.18);
}

.node-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.node-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.node-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
}

.auth-input-panel,
.auth-input-row,
.auth-app-card,
.auth-app-meta {
  display: grid;
  gap: 10px;
}

.auth-app-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255,255,255,.92);
}

.auth-app-platform {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--agent-soft);
  color: var(--agent);
  font-size: 11px;
  font-weight: 700;
}

.auth-app-meta strong {
  font-size: 14px;
}

.auth-app-meta span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.auth-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.auth-status-pill.authorized {
  color: var(--data);
  background: var(--data-soft);
}

.auth-status-pill.unauthorized {
  color: var(--human);
  background: var(--human-soft);
}

.auth-input-row:last-child {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.auth-action-btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #0f766e 0%, #0b5f59 100%);
  color: #fff;
  box-shadow: 0 10px 18px rgba(15, 118, 110, 0.18);
}

.strategy-form,
.strategy-field {
  display: grid;
  gap: 8px;
}

.strategy-form {
  gap: 12px;
}

.strategy-image-preview {
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.96);
}

.strategy-image-preview img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

.strategy-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.strategy-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.strategy-field input,
.strategy-field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  resize: vertical;
  outline: none;
  font-size: 13px;
  line-height: 1.55;
}

.strategy-field input::placeholder,
.strategy-field textarea::placeholder {
  color: #94a3b8;
  font-size: 12px;
}

.strategy-attachment-box {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.92);
}

.strategy-attachment-box textarea {
  border: 0;
  padding: 0;
  border-radius: 0;
  min-height: 92px;
  background: transparent;
}

.strategy-attachment-toolbar,
.strategy-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.strategy-attach-btn,
.strategy-attachment-chip,
.field-generate-btn {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
}

.strategy-attach-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.field-generate-btn {
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: rgba(240, 253, 250, 0.95);
  color: var(--data);
}

.field-generate-btn.submit {
  border-color: rgba(15, 118, 110, 0.28);
  background: linear-gradient(180deg, #0f766e 0%, #0b5f59 100%);
  color: #fff;
}

.field-generate-btn.stop {
  border-color: rgba(190, 18, 60, 0.18);
  background: rgba(255, 241, 242, 0.92);
  color: var(--human);
}

.field-generate-btn.icon-only {
  min-width: 34px;
  width: 34px;
  padding: 0;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.strategy-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.content-generator-shell,
.generator-loading-stage,
.tweet-preview-grid,
.tweet-preview-card,
.tweet-post-shell {
  display: grid;
  gap: 14px;
}

.content-generator-shell {
  margin-top: 4px;
}

.generator-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.generator-header h4 {
  margin: 8px 0 0;
  font-size: 24px;
  line-height: 1.12;
}

.generator-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.generator-loading-stage {
  padding: 18px;
  border: 1px dashed #bfdbfe;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(239,246,255,.92), rgba(240,253,250,.88));
}

.generator-loading-cat {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.generator-loading-screen {
  width: 220px;
  min-height: 88px;
  border-radius: 20px;
}

.agent-mini-cat.working {
  animation: catTyping 0.45s ease-in-out infinite;
}

.generator-speed-lines {
  display: flex;
  gap: 8px;
}

.generator-speed-lines span {
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(56,189,248,0.14), rgba(56,189,248,0.98));
  animation: speedLine 0.55s linear infinite;
}

.generator-speed-lines span:nth-child(2) { width: 22px; animation-delay: 0.1s; }
.generator-speed-lines span:nth-child(3) { width: 18px; animation-delay: 0.2s; }
.generator-speed-lines span:nth-child(4) { width: 12px; animation-delay: 0.3s; }
}

.generator-loading-dots {
  display: flex;
  gap: 8px;
}

.generator-loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #38bdf8;
  animation: loadingDot 1s ease-in-out infinite;
}

.generator-loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.generator-loading-dots span:nth-child(3) { animation-delay: 0.3s; }

.tweet-preview-grid {
  position: relative;
  min-height: 430px;
}

.tweet-preview-card {
  position: absolute;
  inset: 0 auto auto 0;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  background: rgba(255,255,255,.96);
  box-shadow: 0 14px 28px rgba(148, 163, 184, 0.08);
  width: min(100%, 420px);
  transform: translate(calc(var(--stack-offset) * 2px), calc(var(--stack-offset) * 8px)) scale(calc(1 - (var(--stack-offset) * 0.015)));
  transform-origin: top center;
  transition: transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
}

.tweet-preview-card.top-card {
  position: relative;
  width: 100%;
}

.tweet-preview-card.swiping.right {
  transform: translate(120px, -10px) rotate(8deg);
  opacity: 0;
}

.tweet-preview-card.swiping.left {
  transform: translate(-120px, -10px) rotate(-8deg);
  opacity: 0;
}

.tweet-phone-frame {
  padding: 10px;
  border-radius: 28px;
  border: 1px solid #cbd5e1;
  background: linear-gradient(180deg, #f8fafc, #ffffff);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.8);
}

.tweet-preview-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 14px;
  align-items: start;
}

.tweet-phone-top {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
}

.tweet-phone-top span {
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: #cbd5e1;
}

.tweet-post-shell {
  min-height: 218px;
  padding: 14px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.tweet-post-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tweet-post-head strong,
.tweet-post-head span,
.tweet-post-shell p {
  display: block;
}

.tweet-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #0f172a, #1e293b);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.tweet-post-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.tweet-inline-editor,
.tweet-post-shell p {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
}

.tweet-preview-copy {
  white-space: pre-wrap;
}

.tweet-inline-editor {
  width: 100%;
  min-height: 152px;
  padding: 0;
  border: 0;
  background: transparent;
  resize: vertical;
  outline: none;
  font: inherit;
}

.tweet-option-editor {
  width: 100%;
  min-height: 180px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  background: #fff;
  color: var(--ink);
  font: inherit;
  line-height: 1.7;
  resize: vertical;
  outline: none;
}

.tweet-media-card {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #f8fafc;
}

.tweet-media-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.tweet-media-actions {
  padding: 0 12px 12px;
}

.tweet-option-panel,
.tweet-option-block,
.tweet-text-choice-list,
.tweet-image-choice-list {
  display: grid;
  gap: 12px;
}

.tweet-option-panel {
  align-content: start;
}

.tweet-option-block {
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: linear-gradient(180deg, rgba(248,250,252,.96), rgba(255,255,255,.96));
}

.tweet-option-head strong,
.tweet-option-head span {
  display: block;
}

.tweet-option-head strong {
  font-size: 14px;
  color: var(--ink);
}

.tweet-option-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.tweet-text-choice {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
  text-align: left;
}

.tweet-text-choice.active,
.tweet-image-choice.active {
  border-color: rgba(15, 118, 110, 0.34);
  box-shadow: 0 12px 26px rgba(15, 118, 110, 0.08);
  background: rgba(240, 253, 250, 0.94);
}

.tweet-image-choice-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tweet-image-choice {
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  background: #fff;
  text-align: left;
}

.tweet-image-choice img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
}

.tweet-image-choice span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tweet-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tweet-option-actions {
  display: flex;
  justify-content: flex-end;
}

.tweet-upload-input {
  display: none;
}

.tweet-card-actions {
  display: flex;
  gap: 10px;
}

.tweet-card-actions.hidden {
  visibility: hidden;
}

.tweet-action-btn {
  flex: 1;
  min-height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  background: rgba(248,250,252,.95);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.tweet-action-btn.active {
  border-color: rgba(15, 118, 110, 0.24);
  background: rgba(240, 253, 250, 0.96);
  color: var(--data);
}

.tweet-action-btn.ghost {
  color: var(--muted);
}

@keyframes catTyping {
  0%, 100% { transform: translateX(-50%) rotate(0deg) scale(1); }
  25% { transform: translateX(-50%) rotate(-7deg) scale(1.04); }
  75% { transform: translateX(-50%) rotate(7deg) scale(1.04); }
}

@keyframes loadingDot {
  0%, 100% { transform: translateY(0); opacity: 0.45; }
  50% { transform: translateY(-5px); opacity: 1; }
}

@keyframes speedLine {
  from { transform: translateX(0); opacity: 0.22; }
  to { transform: translateX(14px); opacity: 1; }
}

.planner-chat-shell,
.planner-thread,
.planner-message {
  display: grid;
  gap: 12px;
}

.planner-chat-shell {
  gap: 14px;
}

.planner-thread {
  gap: 14px;
}

.planner-message {
  position: relative;
  padding: 14px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 22px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 12px 28px rgba(148, 163, 184, 0.08);
}

.planner-message.user {
  border-bottom-left-radius: 10px;
}

.planner-message.assistant {
  border-bottom-right-radius: 10px;
}

.planner-message-label {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
}

.planner-topic-input,
.planner-result-output {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  resize: vertical;
  outline: none;
  padding: 0;
  font-size: 15px;
  line-height: 1.75;
  font-family: inherit;
}

.planner-topic-input {
  min-height: 58px;
  font-size: 18px;
}

.planner-result-output {
  min-height: 172px;
  font-size: 17px;
  font-weight: 600;
}

.planner-topic-input::placeholder,
.planner-result-output::placeholder {
  color: #cbd5e1;
}

.planner-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.planner-style-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.96);
  border: 1px solid rgba(226, 232, 240, 0.92);
  color: var(--muted);
  font-size: 12px;
}

.planner-continue-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 20px;
  background: rgba(244, 244, 245, 0.98);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.planner-attachment-list {
  margin-top: 4px;
}

.planner-actions {
  justify-content: space-between;
}

.planner-actions.single-submit {
  justify-content: flex-end;
}

.publish-preview-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.94);
}

.publish-preview-card.stopped {
  background: rgba(248, 250, 252, 0.96);
}

.publish-preview-image-btn {
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: #fff;
}

.publish-preview-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.publish-preview-card pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
  font-family: inherit;
}

.publish-preview-actions {
  display: flex;
  justify-content: flex-end;
}

.schedule-board,
.schedule-list,
.schedule-item-card,
.schedule-item-preview {
  display: grid;
  gap: 14px;
}

.schedule-board {
  gap: 16px;
}

.schedule-board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.schedule-board-head h4 {
  margin: 8px 0 0;
  font-size: 24px;
  line-height: 1.12;
}

.schedule-board-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.schedule-list {
  gap: 12px;
}

.schedule-item-card {
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255,255,255,.96);
}

.schedule-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.schedule-time-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.schedule-index {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.schedule-time-field {
  display: grid;
  gap: 6px;
  min-width: 240px;
}

.schedule-time-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.schedule-time-field input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.schedule-status-btn {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: rgba(240, 253, 250, 0.96);
  color: var(--data);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.schedule-status-btn.stopped {
  border-color: rgba(190, 18, 60, 0.16);
  background: rgba(255, 241, 242, 0.95);
  color: var(--human);
}

.schedule-item-preview {
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: start;
}

.schedule-item-phone {
  display: grid;
  gap: 10px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: #f8fafc;
}

.schedule-item-phone img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.schedule-item-preview p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}

.schedule-image-actions {
  padding: 0 10px 10px;
}

.schedule-text-editor {
  display: grid;
  gap: 8px;
}

.schedule-text-editor span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.schedule-text-editor textarea {
  width: 100%;
  min-height: 168px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  resize: vertical;
  outline: none;
  font: inherit;
  line-height: 1.7;
}

.schedule-empty-state {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed #cbd5e1;
  background: rgba(248,250,252,.96);
}

.schedule-empty-state strong {
  font-size: 15px;
}

.schedule-empty-state span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.metrics-dashboard,
.metrics-meta,
.comments-panel {
  display: grid;
  gap: 12px;
}

.metrics-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

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

.metric-card {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255,255,255,.94);
}

.metric-card strong {
  display: block;
  font-size: 18px;
  color: var(--ink);
}

.metric-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.comments-panel {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(248,250,252,.9);
}

.comments-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.comments-panel ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

.review-card {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255,255,255,.94);
}

.review-card.prompt {
  background: rgba(240, 253, 250, 0.92);
  border-color: rgba(15, 118, 110, 0.16);
}

.review-card p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.58);
  z-index: 30;
}

.image-lightbox-dialog {
  width: min(820px, calc(100vw - 48px));
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255,255,255,.98);
  box-shadow: var(--shadow-lg);
}

.image-lightbox-dialog img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
}

.image-lightbox-close {
  justify-self: end;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.strategy-attachment-chip {
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: var(--data-soft);
  color: var(--data);
}


.node-copy p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.node-output-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.node-card {
  position: absolute;
  width: 190px;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  cursor: grab;
  user-select: none;
}

.node-card.running {
  border-color: rgba(37, 99, 235, .38);
  box-shadow: 0 18px 42px rgba(37,99,235,.12);
}

.node-card.selected {
  border-color: rgba(15,118,110,.42);
  box-shadow: 0 18px 42px rgba(15,118,110,.16);
}

.node-card.dragging {
  cursor: grabbing;
  box-shadow: var(--shadow-lg);
  z-index: 3;
}

.node-card[data-type="agent"] { background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%); }
.node-card[data-type="task"] { background: linear-gradient(180deg, #ffffff 0%, #fffdf4 100%); }
.node-card[data-type="human"] { background: linear-gradient(180deg, #ffffff 0%, #fff7f9 100%); }
.node-card[data-type="data"] { background: linear-gradient(180deg, #ffffff 0%, #f4fffc 100%); }

.node-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-weight: 700;
}

.node-card[data-type="agent"] .node-icon { color: var(--agent); background: var(--agent-soft); }
.node-card[data-type="task"] .node-icon { color: var(--task); background: var(--task-soft); }
.node-card[data-type="human"] .node-icon { color: var(--human); background: var(--human-soft); }
.node-card[data-type="data"] .node-icon { color: var(--data); background: var(--data-soft); }

.node-card h3 {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.25;
}

.node-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.node-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-top h1 {
  max-width: 920px;
}

.agent-grid {
  margin-top: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.agent-pod {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 26%, rgba(15, 118, 110, 0.09), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.94));
  box-shadow: var(--shadow);
}

.agent-screen {
  width: 72%;
  margin: 0 auto;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #60a5fa, #3b82f6);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.agent-desk {
  position: relative;
  min-height: 190px;
}

.agent-monitor-glow {
  position: absolute;
  inset: 8px 18% auto;
  height: 86px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.14), transparent 70%);
  filter: blur(10px);
}

.agent-table {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 44px;
  height: 12px;
  border-radius: 999px;
  background: #dbe4ee;
  box-shadow:
    -130px 38px 0 -2px #e2e8f0,
    130px 38px 0 -2px #e2e8f0;
}

.agent-chair {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 74px;
  height: 92px;
  transform: translateX(-50%);
  border-radius: 26px 26px 18px 18px;
  background: linear-gradient(180deg, #ffffff, #eef2f7);
  box-shadow: inset 0 0 0 1px #e2e8f0;
}

.agent-chair::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 42px;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  border-top: 0;
}

.agent-cat {
  position: absolute;
  left: 50%;
  bottom: 56px;
  width: 92px;
  height: 104px;
  transform: translateX(-50%);
}

.agent-cat-body {
  position: absolute;
  inset: 20px 0 0;
  border-radius: 42px 42px 20px 20px;
  background: #05070b;
}

.agent-cat-ear {
  position: absolute;
  top: 6px;
  width: 24px;
  height: 24px;
  background: #05070b;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.agent-cat-ear.left {
  left: 12px;
  transform: rotate(-18deg);
}

.agent-cat-ear.right {
  right: 12px;
  transform: rotate(18deg);
}

.agent-cat-collar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 20px;
  height: 20px;
  border-radius: 8px;
}

.agent-pod-meta {
  display: grid;
  gap: 4px;
  text-align: center;
}

.agent-pod-meta strong {
  font-size: 15px;
}

.agent-pod-status,
.agent-pod-index {
  color: var(--muted);
  font-size: 12px;
}

.agent-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 18px;
  width: 100%;
}

.agent-mini-pod {
  display: grid;
  gap: 10px;
  padding: 18px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 22%, rgba(15, 118, 110, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
  min-height: 100%;
  animation: podFloat 3.8s ease-in-out infinite;
}

.agent-mini-screen {
  width: 68%;
  margin: 0 auto;
  min-height: 48px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #60a5fa, #3b82f6);
  overflow: hidden;
  animation: screenGlow 2.4s ease-in-out infinite;
}

.agent-screen-ui {
  display: grid;
  gap: 4px;
}

.agent-screen-ui .ui-line,
.agent-screen-ui .ui-chip,
.agent-screen-ui .ui-frame,
.agent-screen-ui .ui-swatch,
.agent-screen-ui .ui-col,
.agent-screen-ui .ui-dot {
  display: block;
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  opacity: 0.2;
  animation: screenLineReveal 2.8s ease-in-out infinite;
}

.agent-screen-ui > *:nth-child(1) { animation-delay: 0s; }
.agent-screen-ui > *:nth-child(2) { animation-delay: 0.18s; }
.agent-screen-ui > *:nth-child(3) { animation-delay: 0.36s; }
.agent-screen-ui > *:nth-child(4) { animation-delay: 0.54s; }
.agent-screen-ui > *:nth-child(5) { animation-delay: 0.72s; }

.agent-screen-ui .ui-line { height: 6px; }
.agent-screen-ui .ui-line.long { width: 100%; }
.agent-screen-ui .ui-line.short { width: 58%; }
.agent-screen-ui .ui-chip { width: 34%; height: 8px; }
.agent-screen-ui .ui-frame { width: 100%; height: 18px; border-radius: 8px; }
.agent-screen-ui .ui-swatch { width: 42%; height: 10px; background: rgba(251, 191, 36, 0.95); }
.agent-screen-ui.publish { grid-template-columns: repeat(3, 1fr); align-items: end; }
.agent-screen-ui.publish .ui-col { height: 18px; border-radius: 6px; }
.agent-screen-ui.publish .ui-col.active { height: 24px; background: rgba(250, 204, 21, 0.95); }
.agent-screen-ui.publish .ui-line { grid-column: 1 / -1; }
.agent-screen-ui.review .ui-dot { width: 12px; height: 12px; justify-self: end; background: rgba(34, 197, 94, 0.95); }

.agent-screen-ui .ui-dot,
.agent-screen-ui .ui-col.active,
.agent-screen-ui .ui-swatch {
  animation: screenPulse 1.8s ease-in-out infinite;
}

.agent-mini-desk {
  position: relative;
  min-height: 96px;
}

.agent-mini-desk::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 18px;
  height: 8px;
  border-radius: 999px;
  background: #dbe4ee;
}

.agent-mini-cat {
  position: absolute;
  left: 50%;
  bottom: 26px;
  width: 58px;
  height: 66px;
  transform: translateX(-50%);
  animation: catBreathe 2.6s ease-in-out infinite;
  transform-origin: center bottom;
}

.agent-mini-body {
  position: absolute;
  inset: 14px 0 0;
  border-radius: 26px 26px 16px 16px;
  background: #05070b;
}

.agent-mini-ear {
  position: absolute;
  top: 2px;
  width: 16px;
  height: 16px;
  background: #05070b;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.agent-mini-ear.left {
  left: 7px;
  transform: rotate(-18deg);
  transform-origin: bottom center;
  animation: earTwitchLeft 4.2s ease-in-out infinite;
}

.agent-mini-ear.right {
  right: 7px;
  transform: rotate(18deg);
  transform-origin: bottom center;
  animation: earTwitchRight 4.2s ease-in-out infinite;
}

.agent-mini-collar {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 12px;
  height: 14px;
  border-radius: 6px;
}

.agent-mini-meta {
  display: grid;
  gap: 3px;
  text-align: center;
}

.agent-mini-meta strong {
  font-size: 13px;
}

.agent-mini-meta span {
  color: var(--muted);
  font-size: 11px;
}

@keyframes podFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes screenGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(59, 130, 246, 0); }
  50% { box-shadow: 0 0 18px rgba(59, 130, 246, 0.22); }
}

@keyframes screenScroll {
  0%, 100% { transform: translateY(0); opacity: 0.96; }
  50% { transform: translateY(-3px); opacity: 1; }
}

@keyframes screenLineReveal {
  0%, 18% { opacity: 0.18; transform: translateX(-4px); }
  30%, 70% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0.28; transform: translateX(3px); }
}

@keyframes screenPulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

@keyframes catBreathe {
  0%, 100% { transform: translateX(-50%) scale(1) rotate(0deg); }
  50% { transform: translateX(-50%) scale(1.03) rotate(-1.2deg); }
}

@keyframes earTwitchLeft {
  0%, 84%, 100% { transform: rotate(-18deg); }
  88% { transform: rotate(-24deg); }
  92% { transform: rotate(-14deg); }
}

@keyframes earTwitchRight {
  0%, 84%, 100% { transform: rotate(18deg); }
  88% { transform: rotate(24deg); }
  92% { transform: rotate(14deg); }
}

.dashboard-main {
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
}

.dashboard-agent-row {
  margin-top: 16px;
}

.dashboard-card h2 {
  margin: 8px 0 0;
  font-size: 24px;
}

.dashboard-title-row,
.dashboard-filters,
.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-title-row {
  gap: 14px;
  justify-content: space-between;
  flex: 1;
}

.dashboard-title-copy {
  display: grid;
  gap: 6px;
}

.dashboard-filters {
  justify-content: flex-end;
}

.filter-pill {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.filter-pill.active {
  border-color: rgba(15, 118, 110, 0.2);
  background: rgba(240, 253, 250, 0.95);
  color: var(--data);
}

.timeline-chart,
.bar-chart {
  display: block;
  gap: 12px;
  margin-top: 14px;
}

.timeline-chart {
  min-height: 240px;
}

.line-chart-shell {
  width: 100%;
  min-height: 240px;
}

.line-chart-svg {
  display: block;
  width: 100%;
  height: 240px;
}

.line-chart-axis {
  stroke: #cbd5e1;
  stroke-width: 1.5;
}

.line-chart-grid {
  stroke: rgba(203, 213, 225, 0.5);
  stroke-width: 1;
}

.line-chart-line {
  fill: none;
  stroke: #0f766e;
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.line-chart-dot {
  fill: #fff;
  stroke: #0f766e;
  stroke-width: 3;
}

.line-chart-value,
.line-chart-label {
  fill: #64748b;
  font-size: 12px;
}

.line-chart-value {
  font-weight: 700;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
}

.record-item,
.asset-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.record-link {
  width: 100%;
  text-align: left;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(18px);
  min-width: 260px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1420px) {
  .home-layout,
  .dashboard-main,
  .dashboard-bottom,
  .agent-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1280px) {
  .studio-shell {
    grid-template-columns: 1fr;
  }

  .studio-main,
  .studio-rail {
    grid-column: 1;
  }

  .studio-main {
    grid-row: 2;
  }

  .studio-rail {
    grid-row: 1;
    flex-direction: row;
    justify-content: flex-start;
    padding: 14px 18px;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .rail-spacer { display: none; }
}

@media (max-width: 1100px) {
  body { padding: 0; }

  .app-window {
    width: 100vw;
    min-height: 100vh;
    border-radius: 0;
  }

  .studio-main {
    padding: 18px 18px 18px 18px;
  }

  .board-shell,
  .canvas-board {
    max-width: 100%;
  }

  .workflow-detail-layout,
  .home-layout,
  .editor-layout,
  .dashboard-main,
  .dashboard-bottom,
  .agent-grid,
  .timeline-chart {
    grid-template-columns: 1fr;
  }

  .workflow-detail-layout {
    grid-template-columns: 1fr;
  }

  .tweet-preview-grid {
    min-height: auto;
  }

  .tweet-preview-editor-layout,
  .tweet-image-choice-list {
    grid-template-columns: 1fr;
  }

  .tweet-preview-card {
    width: 100%;
  }

  .preference-grid {
    grid-template-columns: 1fr;
  }

  .schedule-item-top,
  .schedule-board-head,
  .schedule-item-preview {
    grid-template-columns: 1fr;
    display: grid;
  }

  .schedule-time-row {
    display: grid;
  }

  .schedule-time-field {
    min-width: 0;
  }

  .node-gallery-grid {
    grid-template-columns: 1fr;
  }
}
