/* SMSLab — unified AI agent card preview system v2 */

:root {
  --ap-violet: #7c3aed;
  --ap-violet-dark: #6d28d9;
  --ap-violet-soft: rgba(124, 58, 237, 0.14);
  --ap-violet-glow: rgba(124, 58, 237, 0.28);
  --ap-bg: #f7f7fa;
  --ap-ink: #1e2540;
  --ap-muted: #6b7280;
  --ap-line: rgba(10, 14, 26, 0.12);
  --ap-green: #16a34a;
  --ap-amber: #d97706;
}

.card-preview--agent {
  aspect-ratio: 16 / 9;
  background: var(--ap-bg);
  border-bottom: 1px solid var(--ap-line);
  flex-shrink: 0;
  min-height: 0;
  overflow: hidden;
}

.card-preview--agent .ap-frame {
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 0;
  box-sizing: border-box;
}

.card-preview--agent .ap-canvas,
.card-preview--agent .ap-brand-processgraph,
.card-preview--agent .ap-brand-contentstrateg,
.card-preview--agent .ap-brand-trendscout {
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

.card-preview--agent .ap-scene-main,
.card-preview--agent [class*="ap-scene-main--"] {
  padding: 0 !important;
}

.card-preview--agent .ap-ui {
  height: 100%;
  min-height: 0;
}

.ap-frame {
  width: 100%;
  height: 100%;
  padding: 5px 7px 6px;
}

.ap-canvas {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--ap-line);
  box-shadow: 0 6px 20px rgba(10, 14, 26, 0.07);
  --ap-badge-from: var(--ap-violet);
  --ap-badge-to: var(--ap-violet-dark);
  --ap-badge-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.ap-ui {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 132px;
  color: var(--ap-ink);
}

.ap-scene-main {
  flex: 1;
  min-height: 0;
  padding: 8px 10px 6px;
  overflow: visible;
}

.ap-ai-bar {
  flex-shrink: 0;
  margin: 0 8px 8px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--ap-violet-dark);
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.16), rgba(124, 58, 237, 0.05));
  border: 1px solid rgba(124, 58, 237, 0.22);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.12);
}

.ap-ai-spark {
  color: var(--ap-violet);
  font-weight: 800;
}

.ap-mono {
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.02em;
}

.ap-glass {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--ap-line);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(10, 14, 26, 0.05);
}

.ap-hot-text { color: var(--ap-violet-dark); font-weight: 700; }

.ap-arrow { color: var(--ap-muted); font-size: 11px; line-height: 1; }
.ap-flow-arrow { color: var(--ap-violet); font-size: 12px; font-weight: 700; text-align: center; line-height: 1; }
.ap-flow-arrow.big { font-size: 16px; }

.ap-pulse { animation: ap-pulse 2.2s ease-in-out infinite; }
.ap-flow { stroke-dasharray: 6 6; animation: ap-flow 1.5s linear infinite; }
.ap-d1 { animation-delay: 0.25s; }
.ap-d2 { animation-delay: 0.5s; }
.ap-d3 { animation-delay: 0.75s; }

.card-agent:hover .ap-flow { animation-duration: 0.9s; }

@keyframes ap-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes ap-flow { to { stroke-dashoffset: -24; } }

@keyframes ap-scan {
  0%, 100% { top: 6%; opacity: 0.25; }
  50% { top: 90%; opacity: 0.9; }
}

.ap-scan {
  position: absolute;
  left: 6%;
  right: 6%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ap-violet), transparent);
  animation: ap-scan 2.6s ease-in-out infinite;
  z-index: 3;
  pointer-events: none;
}

/* Shared components */
.ap-side-panel {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 72px;
}

.ap-stat-val {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--ap-violet);
  line-height: 1;
}

.ap-stat-lbl {
  font-size: 8px;
  color: var(--ap-muted);
  line-height: 1.2;
}

.ap-chip {
  display: block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 600;
  background: var(--ap-violet-soft);
  color: var(--ap-violet-dark);
  border: 1px solid rgba(124, 58, 237, 0.15);
}

.ap-chip-green {
  background: rgba(22, 163, 74, 0.12);
  color: var(--ap-green);
  border-color: rgba(22, 163, 74, 0.2);
}

/* ── ProcessGraph (reference layout) ── */
.ap-scene-main--pg {
  padding: 6px 8px 8px !important;
}

.ap-pg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}

.ap-pg-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--ap-badge-from), var(--ap-badge-to));
  box-shadow: var(--ap-badge-shadow);
  white-space: nowrap;
}

.ap-pg-spark {
  font-weight: 800;
  margin-right: 2px;
}

.ap-pg-inner {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}

.ap-pg-map {
  position: relative;
  min-height: 96px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.55), rgba(247, 247, 250, 0.85));
  border-radius: 10px;
  border: 1px solid rgba(10, 14, 26, 0.06);
}

.ap-pg-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ap-pg-node {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 6px 11px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  color: var(--ap-violet-dark);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(6px);
  border: 2px solid rgba(124, 58, 237, 0.42);
  box-shadow: 0 4px 16px rgba(10, 14, 26, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  z-index: 2;
}

.ap-pg-node-green {
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.55);
  background: rgba(240, 253, 244, 0.95);
}

.ap-pg-pos-zayavka { left: 14%; top: 26%; }
.ap-pg-pos-kval { left: 36%; top: 26%; }
.ap-pg-pos-prod { left: 57%; top: 26%; }
.ap-pg-pos-dog { left: 78%; top: 26%; }
.ap-pg-pos-opl { left: 78%; top: 72%; }
.ap-pg-pos-isp { left: 26%; top: 72%; }

.ap-pg-auto {
  position: absolute;
  left: 78%;
  top: 48%;
  transform: translate(-50%, -50%);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 8px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.45);
  white-space: nowrap;
  z-index: 3;
}

.ap-pg-float {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(10, 14, 26, 0.08);
  box-shadow: 0 3px 10px rgba(10, 14, 26, 0.06);
  z-index: 1;
}

.ap-pg-float-pin { left: 36%; top: 6%; transform: translate(-50%, 0); }
.ap-pg-float-user { left: 92%; top: 10%; transform: translate(-100%, 0); background: rgba(220, 252, 231, 0.9); border-color: rgba(22, 163, 74, 0.25); }
.ap-pg-float-gear { left: 12%; top: 58%; transform: none; font-size: 10px; width: 20px; height: 20px; }
.ap-pg-float-clock { left: 52%; top: 50%; transform: translate(-50%, -50%); opacity: 0.75; border-radius: 50%; }
.ap-pg-float-cloud { left: 66%; top: 56%; transform: none; opacity: 0.6; font-size: 10px; width: 18px; height: 18px; background: rgba(237, 233, 254, 0.9); }

.ap-pg-stats {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  min-width: 74px;
  backdrop-filter: blur(8px);
}

.ap-pg-stat-num {
  display: block;
  font-size: 18px;
  font-weight: 900;
  color: var(--ap-violet-dark);
  line-height: 1;
}

.ap-pg-stat-lbl {
  display: block;
  font-size: 8px;
  font-weight: 600;
  color: var(--ap-muted);
  line-height: 1.2;
}

/* legacy process styles (other agents) */
.ap-process-v {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  height: 100%;
  align-items: stretch;
}

.ap-process-map {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  align-items: center;
}

.ap-flow-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.ap-flow-node {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  background: #fff;
  border: 2px solid var(--ap-line);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(10, 14, 26, 0.04);
}

.ap-flow-node-hot {
  border-color: var(--ap-violet);
  background: var(--ap-violet-soft);
  color: var(--ap-violet-dark);
  box-shadow: 0 0 0 3px var(--ap-violet-soft), 0 4px 12px var(--ap-violet-glow);
}

.ap-flow-branches {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding-left: 4px;
  border-left: 2px dashed var(--ap-line);
}

.ap-branch-line {
  font-size: 9px;
  font-weight: 600;
  color: var(--ap-muted);
  white-space: nowrap;
}

.ap-branch-line.ap-hot {
  color: var(--ap-violet-dark);
  font-size: 10px;
}

/* ── Content Matrix (reference layout) ── */
.ap-scene-main--mx {
  padding: 6px 8px 8px !important;
}

.ap-mx {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}

.ap-mx-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--ap-badge-from), var(--ap-badge-to));
  box-shadow: var(--ap-badge-shadow);
  white-space: nowrap;
}

.ap-mx-spark {
  font-weight: 800;
  margin-right: 2px;
}

.ap-mx-table-wrap {
  flex: 1;
  min-height: 0;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.ap-mx-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 0.7fr 1.2fr;
  gap: 3px;
  align-items: stretch;
}

.ap-mx-row-head {
  margin-bottom: 1px;
}

.ap-mx-head {
  font-size: 8px;
  font-weight: 800;
  color: #475569;
  text-align: left;
  padding: 0 2px 2px;
}

.ap-mx-cell {
  min-height: 22px;
  padding: 3px 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(10, 14, 26, 0.06);
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.ap-mx-cell-tag {
  padding: 2px 3px;
}

.ap-mx-cell-cta .ap-mx-txt {
  font-size: 6.5px;
  line-height: 1.15;
}

.ap-mx-txt {
  font-size: 7.5px;
  font-weight: 600;
  color: var(--ap-ink);
  line-height: 1.2;
}

.ap-mx-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.ap-mx-tag-ico {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
}

.ap-mx-tag-txt {
  font-size: 7.5px;
  font-weight: 700;
  color: var(--ap-ink);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ap-mx-c-orange { background: #ffedd5; color: #ea580c; border: 1px solid rgba(234, 88, 12, 0.2); }
.ap-mx-c-blue { background: #dbeafe; color: #2563eb; border: 1px solid rgba(37, 99, 235, 0.2); }
.ap-mx-c-green { background: #dcfce7; color: #16a34a; border: 1px solid rgba(22, 163, 74, 0.2); }
.ap-mx-c-tan { background: #fef3c7; color: #b45309; border: 1px solid rgba(180, 83, 9, 0.2); }
.ap-mx-c-purple { background: #ede9fe; color: #7c3aed; border: 1px solid rgba(124, 58, 237, 0.2); }
.ap-mx-c-red { background: #ffe4e6; color: #e11d48; border: 1px solid rgba(225, 29, 72, 0.2); }

.ap-mx-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: nowrap;
  padding-top: 2px;
}

.ap-mx-flow-arrow {
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.ap-mx-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1.5px solid;
  background: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

.ap-mx-step-ico {
  width: 14px;
  height: 14px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 800;
}

.ap-mx-step-txt {
  font-size: 8px;
  font-weight: 700;
  color: var(--ap-ink);
}

.ap-mx-step-reach { border-color: rgba(37, 99, 235, 0.35); background: rgba(239, 246, 255, 0.9); }
.ap-mx-step-trust { border-color: rgba(37, 99, 235, 0.5); background: rgba(219, 234, 254, 0.85); }
.ap-mx-step-warm { border-color: rgba(225, 29, 72, 0.35); background: rgba(255, 241, 242, 0.9); }
.ap-mx-step-sale { border-color: rgba(22, 163, 74, 0.45); background: rgba(220, 252, 231, 0.9); }

/* legacy matrix styles */
.ap-matrix-v {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.ap-mx-table { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.ap-mx-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.ap-mx-head {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ap-muted);
  text-align: center;
  padding: 3px 0;
}

.ap-mx-cell {
  min-height: 32px;
  padding: 4px;
  border-radius: 6px;
  background: #f3f4f6;
  border: 1px solid var(--ap-line);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ap-mx-cell-hot {
  border: 2px solid var(--ap-violet);
  background: var(--ap-violet-soft);
  box-shadow: 0 0 0 2px var(--ap-violet-soft);
}

.ap-mx-val {
  font-size: 8px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  color: var(--ap-ink);
}

.ap-mx-path {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 9px;
  font-weight: 600;
  color: var(--ap-muted);
}

/* ── Content Plan / Calendar (reference layout) ── */
.ap-scene-main--cal {
  padding: 6px 8px 8px !important;
}

.ap-cal {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}

.ap-cal-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--ap-badge-from), var(--ap-badge-to));
  box-shadow: var(--ap-badge-shadow);
  white-space: nowrap;
}

.ap-cal-spark {
  font-weight: 800;
  margin-right: 2px;
}

.ap-cal-inner {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: stretch;
}

.ap-cal-board {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 7px;
  min-width: 0;
}

.ap-cal-head {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #334155;
}

.ap-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  flex: 1;
}

.ap-cal-day {
  position: relative;
  aspect-ratio: 1;
  min-height: 0;
  border-radius: 5px;
  border: 1px solid rgba(10, 14, 26, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.75);
}

.ap-cal-day-num {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 5.5px;
  font-weight: 800;
  color: #64748b;
  line-height: 1;
}

.ap-cal-day-ico {
  font-size: 8px;
  line-height: 1;
  font-weight: 700;
}

.ap-cal-day-active {
  border: 2px solid var(--ap-violet);
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.15), 0 3px 10px rgba(124, 58, 237, 0.25);
  background: rgba(237, 233, 254, 0.9);
}

.ap-cal-day-active .ap-cal-day-num {
  color: var(--ap-violet-dark);
}

.ap-cal-day-active .ap-cal-day-ico {
  font-size: 10px;
  color: var(--ap-violet-dark);
}

.ap-cal-f-blue { background: rgba(219, 234, 254, 0.65); }
.ap-cal-f-blue .ap-cal-day-ico { color: #2563eb; }
.ap-cal-f-purple { background: rgba(237, 233, 254, 0.65); }
.ap-cal-f-purple .ap-cal-day-ico { color: #7c3aed; }
.ap-cal-f-violet { background: rgba(221, 214, 254, 0.65); }
.ap-cal-f-violet .ap-cal-day-ico { color: #6d28d9; }
.ap-cal-f-orange { background: rgba(255, 237, 213, 0.65); }
.ap-cal-f-orange .ap-cal-day-ico { color: #ea580c; }
.ap-cal-f-sky { background: rgba(224, 242, 254, 0.65); }
.ap-cal-f-sky .ap-cal-day-ico { color: #0284c7; }
.ap-cal-f-indigo { background: rgba(224, 231, 255, 0.65); }
.ap-cal-f-indigo .ap-cal-day-ico { color: #4f46e5; }

.ap-cal-foot {
  font-size: 7px;
  font-weight: 600;
  color: var(--ap-muted);
  text-align: center;
  padding-top: 2px;
}

.ap-cal-side {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px 8px;
  min-width: 62px;
}

.ap-cal-side-title {
  font-size: 8px;
  font-weight: 800;
  color: #334155;
}

.ap-cal-leg {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ap-cal-leg-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ap-cal-leg-ico {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 800;
  border: 1px solid rgba(10, 14, 26, 0.06);
}

.ap-cal-leg-txt {
  font-size: 7px;
  font-weight: 600;
  color: var(--ap-ink);
  line-height: 1.1;
}

/* legacy calendar styles */
.ap-calendar-v {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}

.ap-cal-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--ap-violet);
}

.ap-cal-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  flex: 1;
}

.ap-cal-card {
  border-radius: 6px;
  padding: 4px 5px;
  background: #f3f4f6;
  border: 1px solid var(--ap-line);
  min-height: 36px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ap-cal-card-hot {
  background: var(--ap-violet-soft);
  border: 2px solid var(--ap-violet);
  box-shadow: 0 2px 8px var(--ap-violet-glow);
}

.ap-cal-card-dim { opacity: 0.45; min-height: 24px; }

.ap-cal-num { font-size: 9px; font-weight: 800; color: var(--ap-violet-dark); }
.ap-cal-icon { font-size: 10px; line-height: 1; }
.ap-cal-type { font-size: 7px; font-weight: 600; color: var(--ap-ink); line-height: 1.15; }

.ap-cal-foot {
  font-size: 9px;
  font-weight: 600;
  color: var(--ap-muted);
  text-align: center;
}

/* ── Content Strategy (reference layout) ── */
.ap-scene-main--st {
  padding: 6px 8px 8px !important;
}

.ap-st {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}

.ap-st-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--ap-badge-from), var(--ap-badge-to));
  box-shadow: var(--ap-badge-shadow);
  white-space: nowrap;
}

.ap-st-spark {
  font-weight: 800;
  margin-right: 2px;
}

.ap-st-inner {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: stretch;
}

.ap-st-map {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: 1fr auto 1fr;
  gap: 3px;
  align-items: center;
  justify-items: center;
  min-width: 0;
}

.ap-st-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.ap-st-hub {
  grid-area: 2 / 2 / 3 / 3;
  z-index: 2;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 7px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}

.ap-st-card {
  z-index: 1;
  width: 100%;
  max-width: 88px;
  padding: 4px 5px;
  min-width: 0;
}

.ap-st-tl { grid-area: 1 / 1 / 2 / 2; justify-self: end; }
.ap-st-tr { grid-area: 1 / 3 / 2 / 4; justify-self: start; }
.ap-st-bl { grid-area: 3 / 1 / 4 / 2; justify-self: end; }
.ap-st-br { grid-area: 3 / 3 / 4 / 4; justify-self: start; }

.ap-st-card-title {
  font-size: 7px;
  font-weight: 800;
  color: #334155;
  margin-bottom: 3px;
  line-height: 1.1;
}

.ap-st-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ap-st-li {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 1px 2px;
  border-radius: 4px;
}

.ap-st-li-active {
  background: rgba(124, 58, 237, 0.1);
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.15);
}

.ap-st-ico {
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 6px;
  font-weight: 800;
  line-height: 1;
}

.ap-st-txt {
  font-size: 6.5px;
  font-weight: 600;
  color: var(--ap-ink);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ap-st-c-orange { background: #ffedd5; color: #ea580c; }
.ap-st-c-green { background: #dcfce7; color: #16a34a; }
.ap-st-c-blue { background: #dbeafe; color: #2563eb; }
.ap-st-c-purple { background: #ede9fe; color: #7c3aed; }

.ap-st-detail {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px 8px;
  min-width: 58px;
}

.ap-st-detail-title {
  font-size: 9px;
  font-weight: 800;
  color: var(--ap-violet-dark);
  line-height: 1.1;
}

.ap-st-list-detail .ap-st-li {
  padding: 3px 4px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(10, 14, 26, 0.06);
  border-radius: 5px;
}

.ap-st-list-detail .ap-st-txt {
  font-size: 7px;
}

/* legacy strategy styles */
.ap-strategy-v {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  height: 100%;
  align-items: center;
}

.ap-strat-stack { display: flex; flex-direction: column; gap: 2px; }

.ap-strat-layer {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  background: #f3f4f6;
  border: 1px solid var(--ap-line);
  letter-spacing: 0.04em;
}

.ap-strat-hot {
  background: var(--ap-violet-soft);
  border-color: var(--ap-violet);
  color: var(--ap-violet-dark);
}

.ap-strat-branch {
  padding: 8px;
  font-size: 8px;
  line-height: 1.4;
  max-width: 88px;
}

/* ── Content Funnel (reference layout) ── */
.ap-scene-main--fn {
  padding: 6px 8px 8px !important;
}

.ap-fn {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}

.ap-fn-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--ap-badge-from), var(--ap-badge-to));
  box-shadow: var(--ap-badge-shadow);
  white-space: nowrap;
}

.ap-fn-spark {
  font-weight: 800;
  margin-right: 2px;
}

.ap-fn-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ap-fn-gap-svg {
  position: absolute;
  right: 0;
  top: 28%;
  width: 72px;
  height: 48px;
  pointer-events: none;
  z-index: 2;
}

.ap-fn-rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  padding-right: 68px;
}

.ap-fn-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}

.ap-fn-row-gap {
  grid-template-columns: 1fr auto auto;
}

.ap-fn-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px 4px 5px;
  border-radius: 8px;
  border: 1px solid rgba(10, 14, 26, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  min-width: 0;
}

.ap-fn-bar-purple { background: linear-gradient(90deg, #ede9fe, #f5f3ff); }
.ap-fn-bar-blue { background: linear-gradient(90deg, #dbeafe, #eff6ff); }
.ap-fn-bar-cyan { background: linear-gradient(90deg, #cffafe, #ecfeff); }
.ap-fn-bar-hot {
  background: linear-gradient(90deg, #c4b5fd, #ddd6fe);
  border: 2px solid var(--ap-violet);
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.12), 0 3px 10px rgba(124, 58, 237, 0.2);
}
.ap-fn-bar-green { background: linear-gradient(90deg, #dcfce7, #f0fdf4); }
.ap-fn-bar-orange { background: linear-gradient(90deg, #ffedd5, #fff7ed); }

.ap-fn-ico {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(10, 14, 26, 0.06);
}

.ap-fn-name {
  font-size: 8px;
  font-weight: 700;
  color: #334155;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ap-fn-label {
  font-size: 7px;
  font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
  line-height: 1.1;
}

.ap-fn-label-hot {
  font-weight: 800;
  color: #334155;
}

.ap-fn-alert {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2), 0 2px 8px rgba(239, 68, 68, 0.35);
  flex-shrink: 0;
}

.ap-fn-gap-box {
  position: absolute;
  right: 2px;
  bottom: 22%;
  padding: 4px 7px;
  font-size: 7px;
  font-weight: 700;
  color: var(--ap-violet-dark);
  white-space: nowrap;
  z-index: 3;
}

/* legacy funnel styles */
.ap-funnel-v {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  height: 100%;
  align-items: center;
}

.ap-funnel-col { display: flex; flex-direction: column; gap: 3px; }

.ap-funnel-step {
  margin: 0 auto;
  padding: 4px 10px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--ap-violet), #6d28d9);
  color: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ap-funnel-step:nth-child(odd) { background: linear-gradient(135deg, #4f46e5, var(--ap-violet)); }
.ap-funnel-step:nth-child(3) { background: linear-gradient(135deg, #0891b2, #0e7490); }

.ap-funnel-gap {
  outline: 3px solid #f59e0b;
  outline-offset: 1px;
}

.ap-funnel-name { font-size: 9px; font-weight: 700; }
.ap-funnel-type { font-size: 7px; opacity: 0.85; }

.ap-funnel-note {
  padding: 8px;
  font-size: 8px;
  line-height: 1.35;
  max-width: 80px;
}

/* ── SMM Strategy (reference layout) ── */
.ap-scene-main--smm {
  padding: 6px 8px 8px !important;
}

.ap-smm {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}

.ap-smm-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--ap-badge-from), var(--ap-badge-to));
  box-shadow: var(--ap-badge-shadow);
  white-space: nowrap;
  letter-spacing: 0;
  line-height: 1.1;
}

.ap-smm-spark {
  font-weight: 800;
  margin-right: 2px;
}

.ap-smm-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: stretch;
}

.ap-smm-map {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto auto auto;
  gap: 3px 4px;
  align-items: center;
  justify-items: center;
  min-width: 0;
}

.ap-smm-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: calc(100% - 30px);
  pointer-events: none;
  z-index: 0;
}

.ap-smm-hub {
  grid-area: 2 / 2 / 3 / 3;
  z-index: 2;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6px;
  font-weight: 800;
  line-height: 1.12;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.45);
}

.ap-smm-node {
  z-index: 1;
  width: 100%;
  max-width: 78px;
  padding: 4px 5px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}

.ap-smm-n-tl { grid-area: 1 / 1; justify-self: end; }
.ap-smm-n-tr { grid-area: 1 / 3; justify-self: start; }
.ap-smm-n-ml { grid-area: 2 / 1; justify-self: end; }
.ap-smm-n-mr { grid-area: 2 / 3; justify-self: start; }
.ap-smm-n-bc { grid-area: 3 / 2; justify-self: center; }

.ap-smm-n-ico-wrap {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #7c3aed;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ap-smm-ico-svg {
  width: 11px;
  height: 11px;
  display: block;
}

.ap-smm-n-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.ap-smm-n-title {
  font-size: 6.5px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.1;
}

.ap-smm-n-sub {
  font-size: 5.5px;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.1;
}

.ap-smm-metrics {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 100%;
  padding-top: 3px;
}

.ap-smm-metric {
  padding: 4px 5px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ap-smm-metric-name {
  font-size: 5.5px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.1;
}

.ap-smm-metric-pct {
  font-size: 7px;
  font-weight: 800;
  color: var(--ap-violet-dark);
  line-height: 1;
  margin-bottom: 2px;
}

.ap-smm-spark {
  width: 100%;
  height: 14px;
  display: block;
  margin-top: auto;
}

.ap-smm-aside {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 70px;
  flex-shrink: 0;
}

.ap-smm-socials {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px 6px;
  align-items: center;
  border-radius: 999px;
}

.ap-smm-soc {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 6px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.ap-smm-soc-ig { background: linear-gradient(135deg, #f97316, #ec4899); }
.ap-smm-soc-vk { background: #0077ff; }
.ap-smm-soc-tg { background: #229ed9; }
.ap-smm-soc-yt { background: #ef4444; }
.ap-smm-soc-tt { background: #111827; }

.ap-smm-format {
  padding: 7px 8px;
  flex: 1;
}

.ap-smm-format-title {
  font-size: 5.5px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.2;
  margin-bottom: 5px;
  white-space: nowrap;
}

.ap-smm-format-val {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  font-weight: 700;
  color: var(--ap-ink);
  margin-bottom: 5px;
}

.ap-smm-format-ico {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: #ede9fe;
  color: #7c3aed;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ap-smm-format-ico .ap-smm-ico-svg {
  width: 10px;
  height: 10px;
}

.ap-smm-format-val b {
  color: var(--ap-violet-dark);
}

.ap-smm-format-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.1);
  overflow: hidden;
}

.ap-smm-format-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

/* legacy SMM styles */
.ap-smm-v {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: center;
}

.ap-smm-v .ap-smm-hub {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  color: var(--ap-violet-dark);
  background: var(--ap-violet-soft);
  border: 2px solid var(--ap-violet);
  box-shadow: none;
}

.ap-smm-spokes {
  display: flex;
  gap: 10px;
  font-size: 9px;
  font-weight: 600;
  color: var(--ap-muted);
}

.ap-smm-screens { display: flex; gap: 6px; }

.ap-smm-screen {
  width: 36px;
  height: 28px;
  border-radius: 5px;
  background: #fff;
  border: 2px solid var(--ap-line);
}

.ap-smm-screen-hot {
  border-color: var(--ap-violet);
  box-shadow: 0 0 10px var(--ap-violet-glow);
}

.ap-smm-tip { font-size: 9px; }

/* ── Content Launch (reference layout) ── */
.ap-scene-main--ln {
  padding: 6px 8px 8px !important;
}

.ap-ln {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}

.ap-ln-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--ap-badge-from), var(--ap-badge-to));
  box-shadow: var(--ap-badge-shadow);
  white-space: nowrap;
}

.ap-ln-spark {
  font-weight: 800;
  margin-right: 2px;
}

.ap-ln-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  justify-content: center;
  padding: 2px 0;
}

.ap-ln-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.ap-ln-top {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  width: 100%;
}

.ap-ln-hub {
  position: relative;
  z-index: 2;
  padding: 7px 24px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 55%, #4c1d95 100%);
  box-shadow:
    0 4px 18px rgba(91, 33, 182, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.ap-ln-bottom {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 0.9fr 1.4fr 0.9fr;
  gap: 4px;
  width: 100%;
  align-items: stretch;
}

.ap-ln-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 3px 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(10, 14, 26, 0.06);
  box-shadow: 0 2px 10px rgba(10, 14, 26, 0.06);
  min-width: 0;
}

.ap-ln-card-hot {
  background: linear-gradient(180deg, #fffbeb 0%, #fef9c3 100%);
  border-color: rgba(245, 158, 11, 0.28);
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.1),
    0 3px 12px rgba(245, 158, 11, 0.18);
}

.ap-ln-ico-wrap {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ap-ln-ico-svg {
  width: 12px;
  height: 12px;
  display: block;
}

.ap-ln-ico-wrap-purple { background: #ede9fe; color: #7c3aed; }
.ap-ln-ico-wrap-blue { background: #dbeafe; color: #2563eb; }
.ap-ln-ico-wrap-violet { background: #ede9fe; color: #6d28d9; }
.ap-ln-ico-wrap-green { background: #dcfce7; color: #16a34a; }
.ap-ln-ico-wrap-orange { background: #ffedd5; color: #ea580c; }

.ap-ln-c-purple .ap-ln-ico-wrap { background: #ede9fe; color: #7c3aed; }
.ap-ln-c-blue .ap-ln-ico-wrap { background: #dbeafe; color: #2563eb; }
.ap-ln-c-violet .ap-ln-ico-wrap { background: #e0e7ff; color: #4f46e5; }
.ap-ln-c-green .ap-ln-ico-wrap { background: #dcfce7; color: #16a34a; }
.ap-ln-c-orange .ap-ln-ico-wrap { background: #ffedd5; color: #ea580c; }

.ap-ln-title {
  font-size: 7px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.1;
  text-align: center;
}

.ap-ln-sub {
  font-size: 6px;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.1;
  text-align: center;
  font-style: italic;
}

.ap-ln-seq {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 6px 8px;
}

.ap-ln-seq-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.ap-ln-seq-title {
  font-size: 6.5px;
  font-weight: 700;
  color: #64748b;
  line-height: 1.1;
}

.ap-ln-seq-pcts {
  display: flex;
  gap: 8px;
  font-size: 6px;
  font-weight: 800;
  color: var(--ap-violet-dark);
  line-height: 1;
}

.ap-ln-seq-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.1);
  overflow: hidden;
}

.ap-ln-seq-bar-thin {
  height: 3px;
  background: rgba(124, 58, 237, 0.08);
}

.ap-ln-seq-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.ap-ln-seq-bar-thin span {
  min-width: 3px;
}

/* legacy launch styles */
.ap-launch-v {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  justify-content: center;
}

.ap-tl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

.ap-tl-pill {
  font-size: 8px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--ap-muted);
  border: 1px solid var(--ap-line);
}

.ap-tl-done {
  background: rgba(245, 158, 11, 0.15);
  color: #c2410c;
  border-color: rgba(245, 158, 11, 0.3);
}

.ap-launch-center { text-align: center; }

.ap-launch-badge {
  display: inline-block;
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

.ap-progress {
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.ap-progress-fill {
  height: 100%;
  width: 72%;
  background: linear-gradient(90deg, #f59e0b, #ea580c);
  border-radius: inherit;
}

/* ── Trend Scout (reference layout) ── */
.ap-scene-main--tr {
  padding: 6px 8px 8px !important;
}

.ap-tr {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}

.ap-tr-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--ap-badge-from), var(--ap-badge-to));
  box-shadow: var(--ap-badge-shadow);
  white-space: nowrap;
}

.ap-tr-spark {
  font-weight: 800;
  margin-right: 2px;
}

.ap-tr-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 6px;
  align-items: stretch;
}

.ap-tr-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.ap-tr-chart {
  position: relative;
  padding: 5px 6px 6px;
  min-height: 58px;
}

.ap-tr-chart svg {
  width: 100%;
  height: 54px;
  display: block;
}

.ap-tr-grid line {
  stroke: rgba(148, 163, 184, 0.35);
  stroke-width: 0.6;
}

.ap-tr-callout {
  position: absolute;
  top: 4px;
  right: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  pointer-events: none;
}

.ap-tr-pct {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 7px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  line-height: 1;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

.ap-tr-callout-lbl {
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 6px;
  font-weight: 600;
  color: #64748b;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(10, 14, 26, 0.06);
  line-height: 1.1;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.ap-tr-queries {
  flex: 1;
  padding: 6px 7px;
  min-height: 0;
  overflow: hidden;
}

.ap-tr-q-title {
  font-size: 7px;
  font-weight: 800;
  color: #334155;
  margin-bottom: 4px;
}

.ap-tr-q-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.ap-tr-q-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 5px;
  align-items: center;
  font-size: 6.5px;
  line-height: 1.2;
  padding: 3px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.ap-tr-q-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ap-tr-q-num {
  font-weight: 800;
  color: var(--ap-violet);
  min-width: 9px;
}

.ap-tr-q-txt {
  font-weight: 600;
  color: var(--ap-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ap-tr-q-pct {
  font-weight: 800;
  color: var(--ap-violet-dark);
  white-space: nowrap;
}

.ap-tr-right {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.ap-tr-map {
  flex: 1.2;
  padding: 4px 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(248, 247, 255, 0.95), rgba(237, 233, 254, 0.55));
}

.ap-tr-map-svg {
  width: 100%;
  height: auto;
  min-height: 68px;
  display: block;
}

.ap-tr-eu {
  stroke: #c4b5fd;
  stroke-width: 0.55;
  stroke-linejoin: round;
}

.ap-tr-eu-0 { fill: #f5f3ff; }
.ap-tr-eu-1 { fill: #ede9fe; }
.ap-tr-eu-2 { fill: #ddd6fe; }
.ap-tr-eu-3 { fill: #c4b5fd; }

.ap-tr-opp {
  flex: 0.8;
  padding: 6px 7px;
  position: relative;
  min-height: 0;
}

.ap-tr-opp-head {
  font-size: 7px;
  font-weight: 800;
  color: var(--ap-violet-dark);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ap-tr-opp-ico {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

.ap-tr-opp-text {
  font-size: 6.5px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.25;
  padding-right: 30px;
}

.ap-tr-opp-spark {
  position: absolute;
  right: 7px;
  bottom: 6px;
  width: 28px;
  height: 12px;
}

/* legacy trend styles */
.ap-trend-v {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  height: 100%;
  align-items: stretch;
}

.ap-trend-chart {
  position: relative;
  min-height: 0;
}

.ap-trend-chart svg { width: 100%; height: 100%; min-height: 70px; }

.ap-trend-tag {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 10px;
  font-weight: 800;
}

.ap-trend-side {
  padding: 8px;
  font-size: 9px;
  line-height: 1.4;
  min-width: 68px;
}

.ap-trend-kw { color: var(--ap-muted); margin-bottom: 4px; }

/* ── Niche Analysis (reference layout) ── */
.ap-scene-main--ni {
  padding: 6px 8px 8px !important;
}

.ap-ni {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}

.ap-ni-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--ap-badge-from), var(--ap-badge-to));
  box-shadow: var(--ap-badge-shadow);
  white-space: nowrap;
}

.ap-ni-spark {
  font-weight: 800;
  margin-right: 2px;
}

.ap-ni-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ap-ni-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 5px;
  align-items: stretch;
}

.ap-ni-radar {
  position: relative;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  height: 100%;
  overflow: hidden;
}

.ap-ni-radar svg {
  width: 100%;
  height: 100%;
  min-height: 96px;
  max-height: 100%;
  display: block;
  transform: scale(1.08);
  transform-origin: center 52%;
}

.ap-ni-score {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  pointer-events: none;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  box-shadow: 0 3px 12px rgba(91, 33, 182, 0.4);
}

.ap-ni-score-num {
  display: block;
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.ap-ni-score-max {
  display: block;
  font-size: 6px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
  margin-top: 1px;
}

.ap-ni-demand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 7px;
  min-height: 0;
}

.ap-ni-demand-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 7px;
  font-weight: 800;
  color: #334155;
  line-height: 1.1;
}

.ap-ni-demand-pct {
  font-size: 8px;
  font-weight: 900;
  color: #1e293b;
  line-height: 1;
  white-space: nowrap;
}

.ap-ni-demand svg {
  flex: 1;
  width: 100%;
  min-height: 36px;
}

.ap-ni-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.ap-ni-sum {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 6px;
  min-width: 0;
}

.ap-ni-sum-ico {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ap-ni-ico-svg {
  width: 10px;
  height: 10px;
  display: block;
}

.ap-ni-sum-txt {
  font-size: 6px;
  font-weight: 700;
  line-height: 1.15;
}

.ap-ni-sum-green .ap-ni-sum-ico { background: #dcfce7; color: #16a34a; }
.ap-ni-sum-green .ap-ni-sum-txt { color: #15803d; }
.ap-ni-sum-blue .ap-ni-sum-ico { background: #dbeafe; color: #2563eb; }
.ap-ni-sum-blue .ap-ni-sum-txt { color: #1e40af; }
.ap-ni-sum-purple .ap-ni-sum-ico { background: #ede9fe; color: #7c3aed; }
.ap-ni-sum-purple .ap-ni-sum-txt { color: #6d28d9; }

/* legacy niche styles */
.ap-niche-v {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  height: 100%;
  align-items: center;
}

.ap-radar-v {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
}

.ap-radar-ring {
  position: absolute;
  border: 2px solid var(--ap-line);
  border-radius: 50%;
}

.ap-radar-core {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--ap-violet-soft);
  border: 3px solid var(--ap-violet);
  z-index: 1;
}

.ap-radar-score {
  font-size: 18px;
  font-weight: 900;
  color: var(--ap-violet-dark);
  line-height: 1;
}

.ap-radar-lbl {
  font-size: 6px;
  font-weight: 700;
  color: var(--ap-muted);
  letter-spacing: 0.04em;
}

.ap-niche-side { display: flex; flex-direction: column; gap: 4px; }

/* ── Semantics (reference layout) ── */
.ap-scene-main--se {
  padding: 6px 8px 8px !important;
}

.ap-se {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}

.ap-se-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--ap-badge-from), var(--ap-badge-to));
  box-shadow: var(--ap-badge-shadow);
  white-space: nowrap;
}

.ap-se-spark {
  font-weight: 800;
  margin-right: 2px;
}

.ap-se-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 0.95fr 58px 1.2fr;
  gap: 2px;
  align-items: center;
}

.ap-se-cloud {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 4px 2px 4px 4px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.ap-se-lines {
  position: absolute;
  inset: 2px 4px 20px 2px;
  width: calc(100% - 6px);
  height: calc(100% - 22px);
  pointer-events: none;
  z-index: 0;
}

.ap-se-kws {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 82px;
}

.ap-se-kw {
  position: absolute;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 7px;
  font-weight: 600;
  color: #475569;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(203, 213, 225, 0.65);
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.ap-se-kw-1 { left: 2%; top: 4%; }
.ap-se-kw-2 { left: 34%; top: 0; }
.ap-se-kw-3 { right: 2%; top: 8%; }
.ap-se-kw-4 { left: 0; top: 32%; }
.ap-se-kw-5 { left: 30%; top: 28%; }
.ap-se-kw-6 { right: 0; top: 34%; }
.ap-se-kw-7 { left: 4%; top: 52%; }
.ap-se-kw-8 { left: 32%; top: 56%; }

.ap-se-total {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  margin-top: auto;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 7px;
  font-weight: 700;
  color: #64748b;
  background: rgba(248, 250, 252, 0.98);
  border: 1px solid rgba(203, 213, 225, 0.55);
}

.ap-se-bridge {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2px;
  position: relative;
  min-width: 0;
  align-self: center;
}

.ap-se-ai-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ap-se-ai-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(124, 58, 237, 0.2);
  pointer-events: none;
}

.ap-se-ai-ring-1 {
  inset: 0;
}

.ap-se-ai-ring-2 {
  inset: -8px;
  opacity: 0.5;
}

.ap-se-ai {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.45);
}

.ap-se-arrow {
  font-size: 18px;
  font-weight: 800;
  color: #7c3aed;
  line-height: 1;
  margin-left: -2px;
}

.ap-se-clusters {
  display: flex;
  flex-direction: column;
  padding: 8px 9px;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  justify-content: center;
}

.ap-se-cluster-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
}

.ap-se-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px;
  align-items: center;
  padding: 5px 2px;
}

.ap-se-row + .ap-se-row {
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.ap-se-row-ico {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ap-se-ico-svg {
  width: 12px;
  height: 12px;
  display: block;
}

.ap-se-row-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.ap-se-row-name {
  font-size: 7.5px;
  font-weight: 800;
  color: var(--ap-ink);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ap-se-row-count {
  font-size: 6.5px;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
  line-height: 1.1;
}

.ap-se-c-green .ap-se-row-ico { background: #dcfce7; color: #16a34a; }
.ap-se-c-blue .ap-se-row-ico { background: #dbeafe; color: #2563eb; }
.ap-se-c-purple .ap-se-row-ico { background: #ede9fe; color: #7c3aed; }
.ap-se-c-violet .ap-se-row-ico { background: #ddd6fe; color: #6d28d9; }
.ap-se-c-indigo .ap-se-row-ico { background: #e0e7ff; color: #4338ca; }

/* legacy semantics styles */
.ap-semantics-v {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 6px;
  height: 100%;
  align-items: center;
}

.ap-sem-word {
  font-size: 9px;
  font-weight: 600;
  padding: 4px 0;
  color: var(--ap-ink);
  line-height: 1.2;
  border-bottom: 1px solid #f3f4f6;
}

.ap-sem-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.ap-sem-ai {
  font-size: 11px;
  font-weight: 900;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--ap-violet-soft);
  border: 2px solid var(--ap-violet);
}

.ap-sem-divider {
  width: 2px;
  height: 24px;
  background: var(--ap-line);
}

.ap-sem-group {
  padding: 6px 8px;
  margin-bottom: 4px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(135deg, var(--ap-violet), #6d28d9);
}

.ap-sem-group:nth-child(2) { background: linear-gradient(135deg, #4f46e5, var(--ap-violet)); }
.ap-sem-group:nth-child(3) { background: linear-gradient(135deg, #0891b2, #0e7490); }
.ap-sem-group:nth-child(4) { background: linear-gradient(135deg, #16a34a, #15803d); }

/* ── SEO Strategy / Site tree (reference layout) ── */
.ap-scene-main--sx {
  padding: 6px 8px 8px !important;
}

.ap-sx {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}

.ap-sx-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--ap-badge-from), var(--ap-badge-to));
  box-shadow: var(--ap-badge-shadow);
  white-space: nowrap;
}

.ap-sx-spark {
  font-weight: 800;
  margin-right: 2px;
}

.ap-sx-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.45fr 0.55fr;
  gap: 7px;
  align-items: stretch;
}

.ap-sx-map {
  position: relative;
  padding: 8px 10px 10px;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ap-sx-tree {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  height: 100%;
  min-height: 0;
  width: 100%;
}

.ap-sx-svg {
  display: block;
  width: 100%;
  max-width: 210px;
  height: 26px;
  margin: 0 auto;
  flex-shrink: 0;
  pointer-events: none;
}

.ap-sx-root {
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  box-shadow: 0 3px 14px rgba(124, 58, 237, 0.42);
  white-space: nowrap;
}

.ap-sx-row {
  display: grid;
  grid-template-columns: 1.35fr 0.8fr 0.8fr;
  gap: 5px;
  width: 100%;
  align-items: start;
  margin-top: 1px;
}

.ap-sx-node {
  padding: 6px 7px;
  border-radius: 10px;
  min-width: 0;
}

.ap-sx-node-wide {
  min-height: 54px;
}

.ap-sx-node-title {
  font-size: 7.5px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.15;
}

.ap-sx-sub {
  list-style: none;
  margin: 5px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ap-sx-sub li {
  font-size: 6.5px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.2;
  padding-left: 0;
  position: relative;
}

.ap-sx-sub li::before {
  content: none;
}

.ap-sx-add {
  align-self: flex-start;
  margin-top: auto;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 7.5px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  box-shadow: 0 3px 14px rgba(124, 58, 237, 0.38);
  white-space: nowrap;
}

.ap-sx-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 10px;
  min-width: 0;
  justify-content: center;
}

.ap-sx-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.ap-sx-stat-main {
  font-size: 7.5px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.2;
}

.ap-sx-stat-num {
  display: block;
  font-size: 20px;
  font-weight: 900;
  color: var(--ap-violet-dark);
  line-height: 1;
  margin-bottom: 2px;
}

.ap-sx-stat-sub {
  font-size: 7px;
  font-weight: 700;
  color: #64748b;
  line-height: 1.25;
  padding-left: 1px;
}

.ap-sx-rec-title {
  font-size: 7.5px;
  font-weight: 800;
  color: #334155;
}

.ap-sx-rec {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ap-sx-rec li {
  font-size: 6.5px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.25;
  padding-left: 9px;
  position: relative;
}

.ap-sx-rec li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--ap-violet);
  font-weight: 900;
}

/* legacy SEO tree styles */
.ap-seo-v {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  height: 100%;
}

.ap-tree-v { font-size: 9px; line-height: 1.5; font-weight: 600; }

.ap-tree-root {
  font-size: 11px;
  font-weight: 800;
  color: var(--ap-violet-dark);
  margin-bottom: 4px;
}

.ap-tree-branch { color: var(--ap-ink); padding-left: 4px; }

.ap-tree-add {
  margin-top: 6px;
  font-size: 9px;
}

/* ── Marketing Plan (reference layout) ── */
.ap-scene-main--cp {
  padding: 6px 8px 8px !important;
}

.ap-cp {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}

.ap-cp-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--ap-badge-from), var(--ap-badge-to));
  box-shadow: var(--ap-badge-shadow);
  white-space: nowrap;
}

.ap-cp-spark {
  font-weight: 800;
  margin-right: 2px;
}

.ap-cp-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 6px;
  align-items: stretch;
}

.ap-cp-left {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  min-width: 0;
  min-height: 0;
}

.ap-cp-chart {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  width: 100%;
  align-items: center;
}

.ap-cp-donut-wrap {
  position: relative;
  width: 100%;
  max-width: 92px;
  aspect-ratio: 1;
  margin: 0 auto;
  flex-shrink: 0;
}

.ap-cp-donut {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    #7c3aed 0deg 126deg,
    #2563eb 126deg 216deg,
    #14b8a6 216deg 270deg,
    #f59e0b 270deg 324deg,
    #ef4444 324deg 360deg
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.ap-cp-donut-center {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.05;
  box-shadow: 0 1px 6px rgba(10, 14, 26, 0.08);
  padding: 2px;
}

.ap-cp-budget-lbl {
  font-size: 6px;
  font-weight: 700;
  color: #94a3b8;
}

.ap-cp-budget-val {
  font-size: 7px;
  font-weight: 900;
  color: var(--ap-violet-dark);
  line-height: 1.1;
}

.ap-cp-legend {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ap-cp-leg {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px;
  align-items: center;
  font-size: 6.5px;
  line-height: 1.1;
}

.ap-cp-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ap-cp-c-purple { background: #7c3aed; }
.ap-cp-c-blue { background: #2563eb; }
.ap-cp-c-teal { background: #14b8a6; }
.ap-cp-c-amber { background: #f59e0b; }
.ap-cp-c-red { background: #ef4444; }

.ap-cp-leg-name {
  font-weight: 600;
  color: #64748b;
}

.ap-cp-leg-pct {
  font-weight: 800;
  color: var(--ap-ink);
}

.ap-cp-side {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px 8px;
  justify-content: center;
  min-width: 0;
}

.ap-cp-field {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px;
  align-items: flex-start;
}

.ap-cp-field-ico {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: #ede9fe;
  color: #7c3aed;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ap-cp-ico-svg {
  width: 10px;
  height: 10px;
  display: block;
}

.ap-cp-field-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.ap-cp-field-lbl {
  font-size: 6px;
  font-weight: 800;
  color: #334155;
  line-height: 1.1;
}

.ap-cp-field-val {
  font-size: 6px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.2;
}

.ap-cp-rec {
  margin-top: 2px;
  padding: 5px 7px;
  border-radius: 8px;
  font-size: 6px;
  font-weight: 700;
  color: var(--ap-violet-dark);
  background: rgba(237, 233, 254, 0.95);
  border: 1px solid rgba(124, 58, 237, 0.22);
  line-height: 1.25;
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.ap-cp-rec-ico {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  color: #7c3aed;
}

.ap-cp-timeline-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ap-cp-timeline-head {
  font-size: 7px;
  font-weight: 800;
  color: var(--ap-violet-dark);
  line-height: 1;
  padding-bottom: 2px;
  border-bottom: 2px solid rgba(124, 58, 237, 0.35);
  align-self: flex-start;
}

.ap-cp-timeline-head span {
  color: #94a3b8;
  font-weight: 700;
}

.ap-cp-timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  position: relative;
  padding-top: 2px;
}

.ap-cp-timeline::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: linear-gradient(90deg, #7c3aed 0%, #7c3aed 35%, #22c55e 35%, #22c55e 55%, #e2e8f0 55%);
  border-radius: 999px;
  z-index: 0;
}

.ap-cp-step {
  position: relative;
  z-index: 1;
  text-align: center;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.ap-cp-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.ap-cp-step-done .ap-cp-step-dot {
  background: #7c3aed;
}

.ap-cp-step-active .ap-cp-step-dot {
  background: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35);
}

.ap-cp-step:nth-child(3) .ap-cp-step-dot {
  background: #2563eb;
}

.ap-cp-step:nth-child(4) .ap-cp-step-dot {
  background: #7c3aed;
}

.ap-cp-step-name {
  display: block;
  font-size: 6px;
  font-weight: 700;
  color: #94a3b8;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.ap-cp-step-active .ap-cp-step-name {
  color: #16a34a;
  font-weight: 800;
}

.ap-cp-step-done .ap-cp-step-name {
  color: var(--ap-violet-dark);
}

/* legacy campaign styles */
.ap-campaign-v {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: 1fr auto;
  gap: 6px;
  height: 100%;
}

.ap-camp-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 100%;
  padding-bottom: 2px;
}

.ap-camp-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  height: 100%;
  justify-content: flex-end;
}

.ap-camp-bar {
  width: 100%;
  max-width: 32px;
  border-radius: 5px 5px 3px 3px;
  background: linear-gradient(180deg, var(--ap-violet), #6d28d9);
  min-height: 24%;
}

.ap-camp-bar-wrap:nth-child(2) .ap-camp-bar { background: linear-gradient(180deg, #4f46e5, var(--ap-violet)); }
.ap-camp-bar-wrap:nth-child(3) .ap-camp-bar { background: linear-gradient(180deg, #0891b2, #0e7490); }
.ap-camp-bar-wrap:nth-child(4) .ap-camp-bar { background: linear-gradient(180deg, #f59e0b, #ea580c); }

.ap-camp-bar-lbl { font-size: 7px; font-weight: 700; color: var(--ap-muted); }

.ap-camp-side {
  padding: 8px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.04em;
}

.ap-camp-tl {
  grid-column: 1 / -1;
  font-size: 8px;
  font-weight: 600;
  color: var(--ap-muted);
  text-align: center;
}

/* ── SEO/GEO Audit (reference layout) ── */
.ap-scene-main--au {
  padding: 6px 8px 8px !important;
}

.ap-au {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}

.ap-au-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  --ap-badge-from: #2563eb;
  --ap-badge-to: #1d4ed8;
  --ap-badge-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  background: linear-gradient(135deg, var(--ap-badge-from), var(--ap-badge-to));
  box-shadow: var(--ap-badge-shadow);
  white-space: nowrap;
}

.ap-au-spark {
  font-weight: 800;
  margin-right: 2px;
}

.ap-au-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 6px;
  align-items: stretch;
}

.ap-au-cats {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  min-width: 0;
  overflow: hidden;
}

.ap-au-winbar {
  display: flex;
  gap: 3px;
  padding: 5px 8px 4px;
  border-bottom: 1px solid rgba(10, 14, 26, 0.06);
  background: rgba(248, 250, 252, 0.8);
}

.ap-au-win-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.ap-au-win-dot-r { background: #f87171; }
.ap-au-win-dot-y { background: #fbbf24; }
.ap-au-win-dot-g { background: #4ade80; }

.ap-au-cat-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 5px 7px 6px;
  justify-content: center;
  flex: 1;
}

.ap-au-cat {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 5px;
  align-items: center;
  padding: 4px 2px;
  border-bottom: 1px solid rgba(10, 14, 26, 0.05);
}

.ap-au-cat:last-child {
  border-bottom: none;
}

.ap-au-ico {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ap-au-ico-svg {
  width: 10px;
  height: 10px;
  display: block;
}

.ap-au-ico-green { background: #dcfce7; color: #16a34a; }
.ap-au-ico-purple { background: #ede9fe; color: #7c3aed; }
.ap-au-ico-amber { background: #fef3c7; color: #d97706; }
.ap-au-ico-red { background: #fee2e2; color: #dc2626; }
.ap-au-ico-orange { background: #ffedd5; color: #ea580c; }
.ap-au-ico-teal { background: #ccfbf1; color: #0d9488; }

.ap-au-cat-name {
  font-size: 7px;
  font-weight: 700;
  color: #334155;
  line-height: 1.1;
}

.ap-au-scores {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.ap-au-card {
  flex: 1;
  padding: 7px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 0;
}

.ap-au-card-geo {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.ap-au-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ap-au-card-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ap-au-card-title {
  font-size: 8px;
  font-weight: 800;
  color: #334155;
  line-height: 1;
}

.ap-au-ring {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  display: block;
}

.ap-au-card-score {
  font-size: 8px;
  font-weight: 600;
  color: #64748b;
  line-height: 1;
}

.ap-au-card-score b {
  font-size: 18px;
  font-weight: 900;
  color: #16a34a;
  line-height: 1;
}

.ap-au-card-geo .ap-au-card-score b {
  color: #7c3aed;
}

.ap-au-problems-title {
  font-size: 6.5px;
  font-weight: 800;
  color: #64748b;
  line-height: 1.1;
}

.ap-au-problems {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ap-au-problems li {
  font-size: 6px;
  font-weight: 600;
  color: #dc2626;
  line-height: 1.2;
  padding-left: 7px;
  position: relative;
}

.ap-au-problems li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #ef4444;
}

/* legacy audit styles */
.ap-audit-v {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  height: 100%;
  position: relative;
  align-items: start;
}

.ap-site-mini {
  width: 52px;
  height: 64px;
  border-radius: 8px;
  background: linear-gradient(180deg, #eef2ff, #fff);
  border: 2px solid var(--ap-line);
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.08);
}

.ap-audit-scores {
  display: flex;
  gap: 12px;
  margin-bottom: 6px;
}

.ap-score {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.ap-score small {
  font-size: 8px;
  font-weight: 600;
  color: var(--ap-muted);
}

.ap-score-seo { color: var(--ap-violet); }
.ap-score-geo { color: #0891b2; }

.ap-audit-item {
  font-size: 9px;
  font-weight: 600;
  margin-bottom: 3px;
}

.ap-mark-ok { color: var(--ap-green); }
.ap-mark-warn { color: var(--ap-amber); }
.ap-mark-bad { color: #dc2626; }

/* ── Geo Analytics (reference layout) ── */
.ap-scene-main--ge {
  padding: 6px 8px 8px !important;
}

.ap-ge {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}

.ap-ge-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--ap-badge-from), var(--ap-badge-to));
  box-shadow: var(--ap-badge-shadow);
  white-space: nowrap;
}

.ap-ge-spark {
  font-weight: 800;
  margin-right: 2px;
}

.ap-ge-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 6px;
  align-items: stretch;
}

.ap-ge-map {
  position: relative;
  min-height: 102px;
  padding: 2px 4px 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(248, 247, 255, 0.9), rgba(237, 233, 254, 0.5));
}

.ap-ge-svg {
  width: 100%;
  height: auto;
  min-height: 96px;
  display: block;
}

.ap-ge-land {
  fill: #ede9fe;
  stroke: #a78bfa;
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.ap-ge-kal {
  stroke-width: 0.9;
}

.ap-ge-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 72px;
}

.ap-ge-panel {
  flex: 1;
  padding: 5px 6px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ap-ge-panel-title {
  font-size: 7px;
  font-weight: 800;
  color: #334155;
  line-height: 1.1;
}

.ap-ge-top {
  margin: 0;
  padding-left: 12px;
  font-size: 6.5px;
  font-weight: 600;
  color: var(--ap-ink);
  line-height: 1.25;
}

.ap-ge-top li {
  padding: 1px 0;
}

.ap-ge-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
  flex: 1;
}

.ap-ge-bar {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
  min-width: 12px;
}

/* legacy geo styles */
.ap-geo-v {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  height: 100%;
}

.ap-geo-map {
  position: relative;
  border-radius: 8px;
  min-height: 0;
  background:
    radial-gradient(circle at 42% 40%, rgba(124, 58, 237, 0.35), transparent 50%),
    radial-gradient(circle at 62% 55%, rgba(8, 145, 178, 0.25), transparent 45%),
    #f0f4ff;
  border: 1px solid var(--ap-line);
}

.ap-geo-pin {
  position: absolute;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  background: var(--ap-violet);
  box-shadow: 0 2px 8px var(--ap-violet-glow);
  white-space: nowrap;
}

.ap-geo-side {
  padding: 8px;
  font-size: 9px;
  line-height: 1.5;
  min-width: 72px;
}

.ap-geo-side ol {
  margin: 4px 0 0;
  padding-left: 16px;
}

.ap-geo-side li span {
  color: var(--ap-green);
  font-weight: 700;
}

/* ── TrendScout brand (трендскаут.рф) ── */
.card-agent--trendscout {
  --ap-violet: #0f9f6e;
  --ap-violet-dark: #0c7a55;
  --ap-violet-soft: rgba(15, 159, 110, 0.14);
  --ap-violet-glow: rgba(15, 159, 110, 0.28);
  --ap-bg: #f3f7f5;
  --ap-ink: #0c1e28;
  --ap-muted: #5d7582;
  --ap-line: rgba(12, 48, 40, 0.12);
  --ts-mint: #0f9f6e;
  --ts-mint-bright: #14c489;
  --ts-mint-dim: #0c7a55;
}

.card-agent--trendscout .card-preview--agent,
.card-preview--trendscout {
  background: linear-gradient(180deg, #f3f7f5 0%, #e6f4ef 100%);
  border-bottom-color: rgba(12, 48, 40, 0.1);
}

.ap-brand-trendscout {
  background: #f8fbfa;
  border-color: rgba(12, 48, 40, 0.12);
  box-shadow: 0 6px 20px rgba(12, 48, 40, 0.06);
  --ap-badge-from: var(--ts-mint);
  --ap-badge-to: var(--ts-mint-dim);
  --ap-badge-shadow: 0 4px 14px rgba(15, 159, 110, 0.32);
}

.ap-brand-trendscout .ap-hot-text,
.ap-brand-trendscout .ap-flow-arrow {
  color: var(--ts-mint-dim);
}

/* Badges & primary CTAs */
.ap-brand-trendscout .ap-tr-badge,
.ap-brand-trendscout .ap-ni-badge,
.ap-brand-trendscout .ap-se-badge,
.ap-brand-trendscout .ap-sx-badge,
.ap-brand-trendscout .ap-cp-badge,
.ap-brand-trendscout .ap-au-badge,
.ap-brand-trendscout .ap-ge-badge,
.card-agent--trendscout .ap-tr-badge,
.card-agent--trendscout .ap-ni-badge,
.card-agent--trendscout .ap-se-badge,
.card-agent--trendscout .ap-sx-badge,
.card-agent--trendscout .ap-cp-badge,
.card-agent--trendscout .ap-au-badge,
.card-agent--trendscout .ap-ge-badge {
  background: linear-gradient(135deg, var(--ts-mint), var(--ts-mint-dim)) !important;
  box-shadow: 0 4px 14px rgba(15, 159, 110, 0.32) !important;
}

.ap-brand-trendscout .ap-sx-root,
.ap-brand-trendscout .ap-sx-add,
.ap-brand-trendscout .ap-se-ai,
.ap-brand-trendscout .ap-ni-score,
.ap-brand-trendscout .ap-tr-pct,
.ap-brand-trendscout .ap-tr-opp-ico {
  background: linear-gradient(135deg, var(--ts-mint), var(--ts-mint-dim)) !important;
  box-shadow: 0 4px 14px rgba(15, 159, 110, 0.32) !important;
}

.ap-brand-trendscout .ap-se-ai-ring {
  border-color: rgba(15, 159, 110, 0.28);
}

.ap-brand-trendscout .ap-se-arrow {
  color: var(--ts-mint);
}

.ap-brand-trendscout .ap-tr-callout {
  border-color: rgba(15, 159, 110, 0.22);
}

.ap-brand-trendscout .ap-tr-q-pct,
.ap-brand-trendscout .ap-sx-stat-num,
.ap-brand-trendscout .ap-cp-budget-val,
.ap-brand-trendscout .ap-au-score-val,
.ap-brand-trendscout .ap-ge-bar-val {
  color: var(--ts-mint-dim);
}

.ap-brand-trendscout .ap-sx-rec li::before {
  color: var(--ts-mint);
}

.ap-brand-trendscout .ap-ni-sum-purple .ap-ni-sum-ico {
  background: #d1fae5;
  color: var(--ts-mint);
}

.ap-brand-trendscout .ap-ni-sum-purple .ap-ni-sum-txt {
  color: var(--ts-mint-dim);
}

.ap-brand-trendscout .ap-se-c-purple .ap-se-row-ico {
  background: #d1fae5;
  color: var(--ts-mint);
}

.ap-brand-trendscout .ap-se-c-violet .ap-se-row-ico {
  background: #ecfdf5;
  color: var(--ts-mint-dim);
}

.ap-brand-trendscout .ap-au-ico-purple {
  background: #d1fae5;
  color: var(--ts-mint);
}

/* Europe heatmap */
.ap-brand-trendscout .ap-tr-eu-0 { fill: #ecfdf5; }
.ap-brand-trendscout .ap-tr-eu-1 { fill: #d1fae5; }
.ap-brand-trendscout .ap-tr-eu-2 { fill: #86efac; }
.ap-brand-trendscout .ap-tr-eu-3 { fill: #14c489; }

/* Russia map */
.ap-brand-trendscout .ap-ge-map {
  background: linear-gradient(180deg, rgba(243, 247, 245, 0.95), rgba(209, 250, 229, 0.45));
}

.ap-brand-trendscout .ap-ge-land {
  fill: #d1fae5;
  stroke: #14c489;
}

.ap-brand-trendscout #ge-h1 stop {
  stop-color: #14c489;
}

/* Campaign donut — mint as primary slice */
.ap-brand-trendscout .ap-cp-donut {
  background: conic-gradient(
    var(--ts-mint) 0deg 126deg,
    #2563eb 126deg 216deg,
    #14b8a6 216deg 270deg,
    #f59e0b 270deg 324deg,
    #ef4444 324deg 360deg
  );
}

.ap-brand-trendscout .ap-cp-c-purple {
  background: var(--ts-mint);
}

.ap-brand-trendscout .ap-cp-tl-dot {
  background: var(--ts-mint);
}

.ap-brand-trendscout .ap-cp-timeline-bar {
  background: linear-gradient(90deg, var(--ts-mint) 0%, var(--ts-mint) 35%, #22c55e 35%, #22c55e 55%, #e2e8f0 55%);
}

/* Inline SVG accents */
.ap-brand-trendscout svg [stroke="#7c3aed"],
.ap-brand-trendscout svg [stroke="#6366f1"] {
  stroke: var(--ts-mint);
}

.ap-brand-trendscout svg [fill="#7c3aed"],
.ap-brand-trendscout svg [fill="#6366f1"] {
  fill: var(--ts-mint);
}

.ap-brand-trendscout svg [stroke="#c4b5fd"],
.ap-brand-trendscout svg [stroke="#ddd6fe"],
.ap-brand-trendscout svg [stroke="#a78bfa"] {
  stroke: rgba(15, 159, 110, 0.45);
}

.ap-brand-trendscout svg stop[stop-color="#7c3aed"],
.ap-brand-trendscout svg stop[stop-color="#8b5cf6"] {
  stop-color: var(--ts-mint-bright);
}

/* ── ProcessGraph brand (процессграф.рф) ── */
.card-agent--processgraph {
  --pg-bg: #070b1b;
  --pg-panel: #10172d;
  --pg-accent: #70d7ff;
  --pg-accent-deep: #5969e8;
  --pg-text: #f7f8ff;
  --pg-muted: #a9b3d0;
  --pg-border: rgba(170, 194, 255, 0.18);
  --pg-gradient: linear-gradient(135deg, #65d9ff 0%, #687cff 52%, #aa70ff 100%);
  --ap-violet: #70d7ff;
  --ap-violet-dark: #5969e8;
  --ap-violet-soft: rgba(112, 215, 255, 0.14);
  --ap-violet-glow: rgba(104, 124, 255, 0.28);
  --ap-bg: #070b1b;
  --ap-ink: #f7f8ff;
  --ap-muted: #a9b3d0;
  --ap-line: rgba(170, 194, 255, 0.18);
}

.card-agent--processgraph .card-preview--agent,
.card-preview--processgraph {
  background: linear-gradient(180deg, #0a1024 0%, #070b1b 100%);
  border-bottom-color: rgba(170, 194, 255, 0.12);
}

.ap-brand-processgraph {
  background: linear-gradient(145deg, #182248 0%, #080d23 100%);
  border-color: rgba(159, 184, 255, 0.28);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07), 0 6px 20px rgba(0, 0, 0, 0.35);
  color: var(--pg-text);
  --ap-badge-from: #65d9ff;
  --ap-badge-to: #687cff;
  --ap-badge-shadow: 0 4px 14px rgba(104, 124, 255, 0.35);
}

.ap-brand-processgraph .ap-pg-badge,
.card-agent--processgraph .ap-pg-badge {
  background: var(--pg-gradient) !important;
  box-shadow: 0 4px 14px rgba(104, 124, 255, 0.35) !important;
  color: #fff;
  text-shadow: 0 1px 2px rgba(25, 27, 78, 0.45);
}

.ap-brand-processgraph .ap-pg-map {
  background: linear-gradient(145deg, rgba(24, 34, 72, 0.96), rgba(8, 13, 35, 0.96));
  border-color: rgba(159, 184, 255, 0.22);
}

.ap-brand-processgraph .ap-pg-node {
  color: #f7f8ff;
  background: rgba(16, 23, 45, 0.92);
  border-color: rgba(134, 160, 180, 0.45);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ap-brand-processgraph .ap-pg-node-green {
  color: #70d7ff;
  border-color: rgba(255, 210, 139, 0.65);
  background: rgba(112, 215, 255, 0.12);
}

.ap-brand-processgraph .ap-pg-auto {
  background: var(--pg-gradient);
  box-shadow: 0 4px 16px rgba(104, 124, 255, 0.45);
  color: #fff;
}

.ap-brand-processgraph .ap-pg-stats {
  background: rgba(16, 23, 45, 0.88) !important;
  border-color: rgba(170, 194, 255, 0.18) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06), 0 4px 14px rgba(0, 0, 0, 0.2) !important;
}

.ap-brand-processgraph .ap-pg-stat-num {
  color: #70d7ff;
}

.ap-brand-processgraph .ap-pg-stat-lbl {
  color: #a9b3d0;
}

.ap-brand-processgraph .ap-pg-float {
  background: rgba(16, 23, 45, 0.9);
  border-color: rgba(170, 194, 255, 0.18);
}

.ap-brand-processgraph .ap-pg-float-user {
  background: rgba(112, 215, 255, 0.15);
  border-color: rgba(255, 210, 139, 0.35);
}

.ap-brand-processgraph .ap-pg-float-cloud {
  background: rgba(104, 124, 255, 0.18);
}

.ap-brand-processgraph .ap-pg-svg [stroke="#94a3b8"] {
  stroke: #86a0b4;
}

.ap-brand-processgraph .ap-pg-svg [fill="#94a3b8"] {
  fill: #86a0b4;
}

/* ── Content Strateg brand (контентстратег.рф) ── */
.card-agent--contentstrateg {
  --cs-accent: #0f766e;
  --cs-accent-deep: #0b4f4a;
  --cs-warm: #c2410c;
  --cs-gradient: linear-gradient(120deg, #0b4f4a, #0f766e 55%, #c2410c);
  --ap-violet: #0f766e;
  --ap-violet-dark: #0b4f4a;
  --ap-violet-soft: rgba(15, 118, 110, 0.14);
  --ap-violet-glow: rgba(15, 118, 110, 0.28);
  --ap-bg: #eef3f6;
  --ap-ink: #10212b;
  --ap-muted: #5a6f7c;
  --ap-line: rgba(16, 33, 43, 0.1);
}

.card-agent--contentstrateg .card-preview--agent,
.card-preview--contentstrateg {
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(15, 118, 110, 0.18), transparent 55%),
    radial-gradient(800px 380px at 100% 10%, rgba(194, 65, 12, 0.12), transparent 50%),
    #eef3f6;
  border-bottom-color: rgba(16, 33, 43, 0.08);
}

.ap-brand-contentstrateg {
  background: #f8fafb;
  border-color: rgba(16, 33, 43, 0.1);
  box-shadow: 0 6px 20px rgba(16, 33, 43, 0.06);
  color: var(--ap-ink);
  --ap-badge-from: #0b4f4a;
  --ap-badge-to: #0f766e;
  --ap-badge-shadow: 0 4px 14px rgba(15, 118, 110, 0.32);
}

.ap-brand-contentstrateg .ap-mx-badge,
.ap-brand-contentstrateg .ap-cal-badge,
.ap-brand-contentstrateg .ap-st-badge,
.ap-brand-contentstrateg .ap-fn-badge,
.ap-brand-contentstrateg .ap-smm-badge,
.ap-brand-contentstrateg .ap-ln-badge,
.card-agent--contentstrateg .ap-mx-badge,
.card-agent--contentstrateg .ap-cal-badge,
.card-agent--contentstrateg .ap-st-badge,
.card-agent--contentstrateg .ap-fn-badge,
.card-agent--contentstrateg .ap-smm-badge,
.card-agent--contentstrateg .ap-ln-badge {
  background: linear-gradient(120deg, #0b4f4a, #0f766e 55%, #c2410c) !important;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.32) !important;
  color: #fff;
}

.ap-brand-contentstrateg .ap-hot-text,
.ap-brand-contentstrateg .ap-flow-arrow,
.ap-brand-contentstrateg .ap-mx-flow-arrow {
  color: var(--cs-accent-deep);
}

.ap-brand-contentstrateg .ap-mx-c-purple {
  background: rgba(15, 118, 110, 0.12);
  color: var(--cs-accent);
  border-color: rgba(15, 118, 110, 0.22);
}

.ap-brand-contentstrateg .ap-cal-f-purple {
  background: rgba(15, 118, 110, 0.1);
}

.ap-brand-contentstrateg .ap-cal-f-purple .ap-cal-day-ico {
  color: var(--cs-accent);
}

.ap-brand-contentstrateg .ap-cal-stat-num,
.ap-brand-contentstrateg .ap-st-stack-num {
  color: var(--cs-accent-deep);
}

.ap-brand-contentstrateg .ap-st-c-purple {
  background: rgba(15, 118, 110, 0.12);
  color: var(--cs-accent);
}

.ap-brand-contentstrateg .ap-st-root,
.ap-brand-contentstrateg .ap-fn-label-hot,
.ap-brand-contentstrateg .ap-ln-hub,
.ap-brand-contentstrateg .ap-smm-hub,
.ap-brand-contentstrateg .ap-smm-format-bar span {
  background: var(--cs-gradient) !important;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.32) !important;
  color: #fff;
}

.ap-brand-contentstrateg .ap-fn-bar-hot {
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.35), rgba(194, 65, 12, 0.2)) !important;
  border-color: rgba(15, 118, 110, 0.35);
}

.ap-brand-contentstrateg .ap-ln-tl-dot-active,
.ap-brand-contentstrateg .ap-ln-progress-fill {
  background: var(--cs-accent);
}

.ap-brand-contentstrateg .ap-smm-format-ico {
  background: rgba(15, 118, 110, 0.12);
  color: var(--cs-accent);
}

.ap-brand-contentstrateg svg [stroke="#7c3aed"],
.ap-brand-contentstrateg svg [stroke="#6366f1"] {
  stroke: var(--cs-accent);
}

.ap-brand-contentstrateg svg [fill="#7c3aed"],
.ap-brand-contentstrateg svg [fill="#6366f1"] {
  fill: var(--cs-accent);
}

.ap-brand-contentstrateg svg stop[stop-color="#7c3aed"],
.ap-brand-contentstrateg svg stop[stop-color="#8b5cf6"] {
  stop-color: var(--cs-accent);
}

@media (prefers-reduced-motion: reduce) {
  .ap-pulse, .ap-flow, .ap-scan { animation: none !important; }
}
