@import url("./tokens.css");

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--pc-ink);
  color: var(--pc-text);
  font-family: var(--pc-font);
  -webkit-font-smoothing: antialiased;
}

body { overflow-x: hidden; }

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

a { color: inherit; }

[hidden] { display: none !important; }

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    var(--pc-glow),
    linear-gradient(180deg, #fafbff 0%, #f3f4fa 45%, #eef0f7 100%);
}

.parallax-layer {
  position: absolute;
  inset: -10%;
  will-change: transform;
  transition: transform 0.15s linear;
}
.layer-a {
  background:
    radial-gradient(circle at 80% 10%, rgba(91, 53, 245, 0.14), transparent 42%),
    radial-gradient(circle at 15% 30%, rgba(124, 92, 255, 0.1), transparent 38%);
}
.layer-b {
  background:
    radial-gradient(circle at 50% 90%, rgba(79, 70, 229, 0.08), transparent 45%);
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
}

.workspace {
  min-width: 0;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.1rem calc(var(--pc-nav-h) + 1.6rem);
}

/* Sidebar / hamburger */
.sidebar {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(var(--pc-sidebar-w), 86vw);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.96);
  border-right: 1px solid var(--pc-line);
  box-shadow: var(--pc-shadow-lg);
  transform: translateX(-105%);
  transition: transform 0.28s ease;
  backdrop-filter: blur(16px);
}
.sidebar.open { transform: translateX(0); }

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(15, 18, 33, 0.35);
  backdrop-filter: blur(2px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  padding: 0.45rem 0.55rem 1rem;
}
.sidebar-logo {
  width: min(100%, 176px);
  height: auto;
  max-height: 36px;
  object-fit: contain;
  object-position: left center;
  display: block;
}
.sidebar-meta {
  padding: 0.35rem 0.55rem 0.65rem;
}
.sidebar-user {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem 0.8rem;
  border-radius: 14px;
  background: var(--pc-surface-2);
  border: 1px solid var(--pc-line);
}
.sidebar-user-email,
.sidebar-user-status {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 650;
}
.sidebar-user-email { color: var(--pc-text); }
.sidebar-user-status { color: var(--pc-muted); font-weight: 600; }

.sidebar-nav,
.sidebar-foot {
  display: grid;
  gap: 0.35rem;
}
.sidebar-foot { margin-top: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--pc-text-soft);
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 600;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.nav-item:hover { background: var(--pc-surface-2); color: var(--pc-text); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(91, 53, 245, 0.12), rgba(124, 92, 255, 0.08));
  color: var(--pc-purple);
}
.nav-item.ghost { color: var(--pc-muted); font-weight: 500; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 -0.25rem 1.35rem;
  padding: 0.55rem 0.25rem 0.75rem;
  background: linear-gradient(180deg, rgba(246, 247, 251, 0.97) 55%, rgba(246, 247, 251, 0.88));
  backdrop-filter: blur(10px);
  animation: rise 0.55s ease both;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.topbar-mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
}
@media (min-width: 980px) {
  .topbar-mark { display: none; }
}

.view-title {
  margin: 0;
  font-family: var(--pc-display);
  font-size: clamp(1.45rem, 4.5vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--pc-text);
  line-height: 1.15;
  min-width: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}


.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--pc-radius-pill);
  border: 1px solid var(--pc-line);
  background: var(--pc-surface);
  color: var(--pc-text);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--pc-shadow);
  transition: transform 0.2s ease, background 0.2s ease;
}
.icon-btn:hover { transform: translateY(-1px); background: var(--pc-surface-2); }

.muted { color: var(--pc-muted); margin: 0.25rem 0 0; line-height: 1.5; font-size: 0.92rem; }

.section-head { margin: 0 0 0.9rem; }
.section-head h2 {
  margin: 0;
  font-family: var(--pc-display);
  font-size: 1.12rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.view { display: none; animation: rise 0.45s ease both; }
.view.active { display: block; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* Home */
.hero-panel {
  padding: 1.5rem 1.35rem;
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.95), rgba(246,247,251,0.9)),
    var(--pc-gradient);
  border: 1px solid var(--pc-line);
  box-shadow: var(--pc-shadow);
  margin-bottom: 1.15rem;
  position: relative;
  overflow: hidden;
}
.hero-panel::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 53, 245, 0.16), transparent 65%);
  pointer-events: none;
}
.hero-panel h2 {
  margin: 0.65rem 0 0;
  font-size: clamp(1.45rem, 4.5vw, 2rem);
  letter-spacing: -0.035em;
  line-height: 1.15;
  max-width: 18ch;
}
.hero-panel h2 em {
  font-style: normal;
  background: var(--pc-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.35rem 0.75rem;
  border-radius: var(--pc-radius-pill);
  background: rgba(91, 53, 245, 0.08);
  color: var(--pc-purple);
  font-size: 0.78rem;
  font-weight: 700;
}

.feature-grid {
  display: grid;
  gap: 0.85rem;
}
@media (min-width: 720px) {
  .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.feature-card {
  position: relative;
  z-index: 0;
  border: 1px solid var(--pc-line);
  background: var(--pc-surface);
  border-radius: var(--pc-radius);
  overflow: hidden;
  text-align: left;
  padding: 0;
  cursor: default;
  box-shadow: var(--pc-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: rise 0.5s ease both;
}
.feature-card.live { cursor: pointer; }
.feature-card.live:hover {
  transform: translateY(-3px);
  box-shadow: var(--pc-shadow-lg);
}
.feature-card.soon { opacity: 0.78; }
.feature-visual {
  height: 96px;
  display: grid;
  place-items: end stretch;
  padding: 0.85rem 1rem 0.5rem;
  color: rgba(255,255,255,0.9);
}
.gradient-a { background: linear-gradient(135deg, #8b6bff, #5b35f5); }
.gradient-b { background: linear-gradient(135deg, #f0abfc, #a78bfa); }
.gradient-c { background: linear-gradient(135deg, #93c5fd, #818cf8); }
.feature-body { padding: 1rem 1.05rem 1.15rem; }
.feature-body h3 { margin: 0.35rem 0 0.25rem; font-size: 1.05rem; letter-spacing: -0.02em; }
.feature-body p { margin: 0; color: var(--pc-muted); font-size: 0.88rem; line-height: 1.45; }
.feature-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--pc-success);
  background: var(--pc-success-bg);
  padding: 0.2rem 0.55rem;
  border-radius: var(--pc-radius-pill);
}
.muted-tag {
  color: var(--pc-muted);
  background: var(--pc-surface-2);
}

/* Sparklines */
.sparkline {
  width: 100%;
  height: 36px;
  color: inherit;
  overflow: visible;
}
.spark-path {
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  animation: drawSpark 1.35s ease forwards;
}
@keyframes drawSpark {
  to { stroke-dashoffset: 0; }
}
.view.active .spark-path {
  animation: drawSpark 1.35s ease forwards;
}

/* KPI */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}
@media (min-width: 800px) {
  .kpi-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.kpi-card {
  border: 1px solid var(--pc-line);
  background: var(--pc-surface);
  border-radius: var(--pc-radius);
  padding: 1rem 1rem 0.65rem;
  box-shadow: var(--pc-shadow);
  color: var(--pc-purple-soft);
  animation: rise 0.5s ease both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.kpi-head {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  color: var(--pc-muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.kpi-card strong {
  display: block;
  margin: 0.35rem 0 0.55rem;
  font-size: 1.55rem;
  color: var(--pc-text);
  letter-spacing: -0.03em;
}
.kpi-status { font-size: 1.05rem !important; }
.delta {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--pc-radius-pill);
  background: var(--pc-surface-2);
  color: var(--pc-muted);
}
.delta.up {
  background: var(--pc-success-bg);
  color: var(--pc-success);
}

.module-grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 900px) {
  .module-grid { grid-template-columns: 1.05fr 0.95fr; align-items: start; }
}

.module {
  border: 1px solid var(--pc-line);
  background: var(--pc-surface);
  border-radius: 24px;
  padding: 1.15rem 1.1rem 1.25rem;
  box-shadow: var(--pc-shadow);
  margin-bottom: 1rem;
}

/* Network tiles */
.net-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1rem 0 1.25rem;
}
@media (min-width: 560px) {
  .net-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.net-tile {
  position: relative;
  appearance: none;
  border: 1px solid var(--pc-line);
  background: var(--pc-surface-2);
  border-radius: var(--pc-radius);
  padding: 1rem 0.85rem;
  cursor: pointer;
  text-align: left;
  display: grid;
  gap: 0.55rem;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease, box-shadow 0.25s ease;
  animation: rise 0.5s ease both;
  animation-delay: calc(var(--i, 0) * 55ms);
}
.net-tile:hover { transform: translateY(-2px); background: #fff; box-shadow: var(--pc-shadow); }
.net-tile.selected {
  border-color: transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    var(--pc-gradient) border-box;
  border: 1px solid transparent;
  box-shadow: 0 10px 28px rgba(91, 53, 245, 0.16);
}
.net-tile .badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--pc-line);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--pc-purple);
  overflow: hidden;
}
.net-tile .badge.svg-badge {
  padding: 0;
  background: transparent;
  border: 0;
}
.net-tile .badge svg { width: 42px; height: 42px; display: block; }
.net-tile .label { font-weight: 700; font-size: 0.98rem; }
.net-tile .meta { font-size: 0.78rem; color: var(--pc-muted); }
.net-tile .check,
.net-tile .live-dot {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--pc-line);
  opacity: 0;
  transform: scale(0.7);
  transition: 0.2s ease;
}
.net-tile.selected .check {
  opacity: 1;
  transform: scale(1);
  background: var(--pc-gradient);
  border-color: transparent;
}
.net-tile .live-dot {
  opacity: 0;
  border: 0;
  background: var(--pc-success);
  box-shadow: 0 0 0 0 rgba(18, 183, 106, 0.55);
}
.net-tile.connected .live-dot {
  opacity: 1;
  transform: scale(1);
  animation: pulseOnline 1.6s ease-in-out infinite;
}
@keyframes pulseOnline {
  0% { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(18, 183, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0); }
}
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.brand-logo svg { width: 100%; height: 100%; display: block; }
.plat-badge {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.plat-badge svg { width: 100%; height: 100%; display: block; }

/* Account cards */
.account-slot,
.account-row {
  border: 1px solid var(--pc-line);
  background: var(--pc-surface-2);
  border-radius: var(--pc-radius);
  padding: 0.85rem 1rem;
}

.account-slot.empty { padding: 0; overflow: hidden; background: #fff; }

.account-cta {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 1.15rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  color: var(--pc-text);
  font-weight: 600;
}
.account-cta .plus,
.btn-outline-glow .plus {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(91, 53, 245, 0.1);
  border: 1px solid rgba(91, 53, 245, 0.18);
  color: var(--pc-purple);
  font-size: 1.1rem;
}

.account-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.65rem;
  background: #fff;
  animation: rise 0.4s ease both;
}
.account-row .avatar {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: var(--pc-gradient);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
}
.account-row .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.account-row .avatar .avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: var(--pc-gradient);
  color: #fff;
}
.account-row .avatar .plat {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px var(--pc-line);
  overflow: hidden;
}
.account-row .avatar .plat svg { width: 12px; height: 12px; display: block; }
.account-row .name { font-weight: 700; }
.account-row .meta-col { min-width: 0; }
.account-row .meta-col .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-row .warn {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  color: var(--pc-warn);
  font-size: 0.82rem;
  margin-top: 0.15rem;
}
.btn-mini {
  width: auto;
  min-height: 36px;
  padding: 0 0.9rem;
  border-radius: var(--pc-radius-pill);
  border: 1px solid transparent;
  background: var(--pc-gradient);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(91, 53, 245, 0.22);
}
.btn-mini.ghost {
  background: #fff;
  color: var(--pc-purple);
  border-color: rgba(91, 53, 245, 0.25);
  box-shadow: none;
}
.btn-mini:hover { transform: translateY(-1px); }

.account-stack { display: grid; gap: 0.15rem; margin-top: 0.75rem; }

.btn-gradient,
.btn-outline-glow,
.btn-ghost,
.btn-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 52px;
  border-radius: var(--pc-radius-pill);
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}
.btn-gradient:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-gradient:not(:disabled):hover,
.btn-outline-glow:hover,
.btn-ghost:hover,
.btn-soft:hover { transform: translateY(-1px); }

.btn-gradient {
  border: 0;
  color: white;
  background: var(--pc-gradient);
  box-shadow: 0 12px 28px rgba(91, 53, 245, 0.28);
}
.btn-outline-glow {
  margin-top: 0.85rem;
  border: 1px solid transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    var(--pc-gradient) border-box;
  color: var(--pc-text);
}
.btn-ghost {
  border: 1px solid var(--pc-line);
  background: transparent;
  color: var(--pc-text);
}
.btn-soft {
  width: auto;
  min-height: 42px;
  padding: 0 1rem;
  border: 1px solid var(--pc-line);
  background: #fff;
  border-radius: var(--pc-radius-pill);
  color: var(--pc-text);
  font-weight: 650;
}

.quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.pipeline-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}
.flag-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  border-radius: var(--pc-radius-pill);
  border: 1px solid var(--pc-line);
  background: var(--pc-surface-2);
  color: var(--pc-muted);
}
.flag-pill.ok { color: var(--pc-success); background: var(--pc-success-bg); border-color: transparent; }
.flag-pill.warn { color: #b54708; background: #fffaeb; border-color: transparent; }
.flag-pill.bad { color: #b42318; background: #fef3f2; border-color: transparent; }

.live-activity { display: grid; gap: 0.85rem; }
.live-card {
  border: 1px solid var(--pc-line);
  border-radius: var(--pc-radius);
  padding: 1rem 1.05rem;
  background: linear-gradient(180deg, #faf9ff, #fff);
  animation: rise 0.45s ease both;
}
.live-card .eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pc-purple);
  font-weight: 700;
}
.live-card h3 {
  margin: 0.35rem 0 0.25rem;
  font-family: var(--pc-display);
  font-size: 1.05rem;
  line-height: 1.3;
}
.live-media {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 0.85rem;
  align-items: start;
  margin-top: 0.75rem;
}
@media (max-width: 420px) {
  .live-media { grid-template-columns: 1fr; }
}
.live-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 9 / 14;
  max-height: 168px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(145deg, #2a1b4d, #5b35f5);
  box-shadow: var(--pc-shadow);
  text-decoration: none;
}
.live-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.live-thumb .thumb-dur,
.feed-thumb .thumb-dur {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  background: rgba(10, 12, 24, 0.72);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.live-thumb .play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 18, 33, 0.28);
  color: #fff;
}
.live-when { margin: 0 0 0.2rem; font-size: 0.78rem; color: var(--pc-muted); }
.eng-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  margin-top: 0.55rem;
}
.eng-item {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--pc-text);
}
.eng-ico {
  display: inline-grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  color: var(--pc-text-soft);
  flex: 0 0 auto;
}
.eng-ico svg {
  width: 14px;
  height: 14px;
  display: block;
}
.eng-item[data-metric="likes"] .eng-ico { color: #e11d48; }
.eng-item[data-metric="comments"] .eng-ico { color: #2563eb; }
.eng-item[data-metric="shares"] .eng-ico { color: #0f766e; }
.eng-item[data-metric="views"] .eng-ico { color: #6b7289; }
.btn-analyze-ai {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  margin-top: 0.85rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(105deg, #7c3aed, #db2777, #f97316) border-box;
  color: var(--pc-text) !important;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-analyze-ai:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.12);
  color: var(--pc-text) !important;
}
.btn-analyze-ai:disabled,
.btn-analyze-ai.is-loading {
  opacity: 0.75;
  cursor: wait;
  transform: none;
  color: var(--pc-text) !important;
}
.btn-analyze-ai .ai-ico {
  color: var(--pc-purple);
  font-size: 0.95rem;
}
.feed-card-post .title,
.live-copy h3 {
  color: var(--pc-text);
}
.feed-card-post .meta {
  color: var(--pc-muted);
}
.analysis-sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  background: rgba(15, 18, 33, 0.5);
}
.analysis-sheet[hidden] { display: none !important; }
.analysis-card {
  width: min(560px, 100%);
  max-height: min(86dvh, 720px);
  overflow: auto;
  border-radius: 20px;
  background: #fff;
  color: var(--pc-text);
  border: 1px solid var(--pc-line);
  box-shadow: var(--pc-shadow-lg);
  padding: 1.15rem 1.2rem 1.3rem;
}
.analysis-card h3 {
  margin: 0 0 0.85rem;
  font-size: 1.12rem;
  color: var(--pc-text);
}
.analysis-card .analysis-body {
  display: grid;
  gap: 0.95rem;
  color: var(--pc-text);
  font-size: 0.92rem;
  line-height: 1.5;
}
.analysis-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.score-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--pc-surface-2);
  border: 1px solid var(--pc-line);
  color: var(--pc-text);
  font-size: 0.78rem;
}
.score-chip strong { font-size: 0.82rem; color: var(--pc-purple); }
.score-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.analysis-block h4 {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pc-muted);
  font-weight: 800;
}
.analysis-block p {
  margin: 0;
  color: var(--pc-text);
}
.analysis-block ol {
  margin: 0.2rem 0 0;
  padding-left: 1.15rem;
  color: var(--pc-text);
}
.analysis-block.muted-block p { color: var(--pc-muted); font-size: 0.84rem; }
.analysis-card .analysis-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.1rem;
}
.analysis-card .analysis-actions button {
  border: 1px solid var(--pc-line);
  background: var(--pc-surface-2);
  color: var(--pc-text);
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.viral-form { margin-top: 0.35rem; }
.viral-status { margin: 0.55rem 0 0; color: var(--pc-muted); font-size: 0.88rem; }
.viral-result {
  margin-top: 1rem;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border: 1px solid var(--pc-line);
  background: #fff;
  color: var(--pc-text);
  display: grid;
  gap: 0.95rem;
}
.viral-result .analysis-block h4 {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pc-muted);
  font-weight: 800;
}
.viral-result .analysis-block p,
.viral-result .analysis-block li {
  color: var(--pc-text);
}
.viral-result .muted-block p { color: var(--pc-muted); font-size: 0.84rem; }
.live-thumb .play span {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  color: var(--pc-purple);
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 800;
  padding-left: 2px;
}
.live-copy { min-width: 0; }
.watch-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.55rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--pc-radius-pill);
  background: rgba(91, 53, 245, 0.08);
  color: var(--pc-purple);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}
.watch-link:hover { background: rgba(91, 53, 245, 0.14); }
.dest-status-row .watch-mini {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--pc-purple);
  text-decoration: none;
  margin-left: 0.35rem;
}
.dest-status-list { display: grid; gap: 0.45rem; margin-top: 0.9rem; }
.dest-status-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  border: 1px solid var(--pc-line);
  background: #fff;
}
.dest-status-row .left { display: flex; gap: 0.55rem; align-items: center; }
.dest-status-row .dot {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(91, 53, 245, 0.1);
  color: var(--pc-purple);
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--pc-line);
  color: var(--pc-muted);
  white-space: nowrap;
  background: #fff;
}
.status-chip.published { color: var(--pc-success); border-color: rgba(18, 183, 106, 0.35); background: var(--pc-success-bg); }
.status-chip.processing { color: #b54708; border-color: rgba(247, 144, 9, 0.35); background: #fffaeb; animation: pulseSoft 1.4s ease-in-out infinite; }
.status-chip.pending { color: var(--pc-purple); border-color: rgba(91, 53, 245, 0.25); background: rgba(91, 53, 245, 0.06); }
.status-chip.failed { color: #b42318; border-color: rgba(240, 68, 56, 0.3); background: #fef3f2; }
@keyframes pulseSoft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* Notification bell — always above home cards/banners */
.notify-wrap {
  position: relative;
  z-index: 55;
  isolation: isolate;
}
.notify-bell { position: relative; z-index: 1; }
.notify-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--pc-danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
}
.notify-panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  width: min(360px, calc(100vw - 1.5rem));
  max-height: min(420px, 70dvh);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid var(--pc-line);
  background: #fff;
  box-shadow: var(--pc-shadow-lg);
  z-index: 60;
  overflow: hidden;
}
.notify-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--pc-line);
}
.notify-panel-head .linkish {
  border: 0;
  background: none;
  color: var(--pc-purple);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 650;
}
.notify-list {
  overflow: auto;
  padding: 0.35rem;
  display: grid;
  gap: 0.25rem;
}
.notify-empty {
  padding: 1.25rem 1rem;
  text-align: center;
  margin: 0;
}
.notify-item {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  cursor: pointer;
  display: grid;
  gap: 0.2rem;
  width: 100%;
}
.notify-item:hover { background: var(--pc-surface-2); }
.notify-item.unread { background: rgba(91, 53, 245, 0.06); }
.notify-item strong { font-size: 0.9rem; }
.notify-item p { margin: 0; color: var(--pc-muted); font-size: 0.82rem; line-height: 1.4; }
.notify-item .when { font-size: 0.72rem; color: var(--pc-muted); }

/* After first paint, stop re-animating on data polls (kills the blink). */
html.ui-settled .view,
html.ui-settled .kpi-card,
html.ui-settled .feed-card,
html.ui-settled .account-row,
html.ui-settled .live-card,
html.ui-settled .net-tile,
html.ui-settled .feature-card {
  animation: none !important;
}
html.ui-settled .spark-path {
  animation: none !important;
  stroke-dashoffset: 0 !important;
}

.compose-card {
  display: grid;
  gap: 0.9rem;
  padding: 0;
  border: 0;
  background: transparent;
}
.field { display: grid; gap: 0.4rem; font-size: 0.92rem; }
.field span, .field legend { color: var(--pc-muted); font-weight: 650; }
.field input, .field textarea, .field select {
  width: 100%;
  border-radius: var(--pc-radius-sm);
  border: 1px solid var(--pc-line);
  background: #fff;
  padding: 0.75rem 0.85rem;
  color: var(--pc-text);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: rgba(91, 53, 245, 0.45);
  box-shadow: 0 0 0 3px rgba(91, 53, 245, 0.12);
}
.compose-dest-field { min-width: 0; }
.compose-dests {
  display: grid;
  gap: 0.45rem;
  width: 100%;
  min-width: 0;
}
.compose-dests label {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--pc-line);
  background: var(--pc-surface-2);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  cursor: pointer;
}
.compose-dests input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--pc-purple);
}
.compose-dests .dest-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 0.1rem;
}
.compose-dests .dest-copy strong,
.compose-dests .dest-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--pc-text);
  font-weight: 700;
  font-size: 0.9rem;
}
.compose-dests .dest-copy span {
  color: var(--pc-muted);
  font-weight: 500;
  font-size: 0.78rem;
}

.result-banner,
.result-box {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--pc-radius-sm);
  border: 1px solid var(--pc-line);
  background: var(--pc-surface-2);
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--pc-text-soft);
}
.result-banner.ok {
  background: var(--pc-success-bg);
  color: #027a48;
  border-color: transparent;
}
.result-banner.err {
  background: #fef3f2;
  color: #b42318;
  border-color: transparent;
}

.tabs-mini { display: flex; gap: 0.45rem; margin-bottom: 0.85rem; }
.chip {
  border: 1px solid var(--pc-line);
  background: #fff;
  color: var(--pc-muted);
  border-radius: var(--pc-radius-pill);
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  font-weight: 650;
}
.chip.active {
  color: #fff;
  background: var(--pc-gradient);
  border-color: transparent;
}

.feed { display: grid; gap: 0.7rem; }
.feed-card {
  border: 1px solid var(--pc-line);
  background: #fff;
  border-radius: var(--pc-radius);
  padding: 0.95rem 1rem;
  animation: rise 0.4s ease both;
}
.feed-card .when { font-size: 0.78rem; color: var(--pc-muted); }
.feed-card .title { margin: 0.35rem 0 0; font-weight: 700; }
.feed-card .meta { margin-top: 0.35rem; font-size: 0.82rem; color: var(--pc-muted); }
.feed-post-body {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.75rem;
  align-items: start;
  margin-top: 0.45rem;
}
.feed-post-body.no-thumb { grid-template-columns: 1fr; }
.feed-thumb {
  position: relative;
  display: block;
  width: 72px;
  aspect-ratio: 9 / 14;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(145deg, #2a1b4d, #5b35f5);
  text-decoration: none;
}
.feed-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.feed-post-copy { min-width: 0; }
.feed-card-post .btn-analyze-ai {
  margin-top: 0.7rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.82rem;
}
@media (max-width: 420px) {
  .feed-post-body { grid-template-columns: 64px 1fr; }
}

/* Profile */
.profile-layout {
  display: grid;
  gap: 1rem;
}
@media (min-width: 860px) {
  .profile-layout {
    grid-template-columns: 0.9fr 1.1fr;
  }
  .profile-layout .module:last-child {
    grid-column: 1 / -1;
  }
}

.profile-hero-card {
  text-align: center;
  display: grid;
  justify-items: center;
}
.profile-photo-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 0.85rem;
}
.profile-photo,
.profile-photo-fallback {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: var(--pc-shadow);
}
.profile-photo-fallback {
  display: grid;
  place-items: center;
  background: var(--pc-gradient);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 800;
}
.photo-edit {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--pc-line);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--pc-purple);
  box-shadow: var(--pc-shadow);
}
.profile-hero-card h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  width: 100%;
  margin-top: 1.1rem;
}
.stat-row strong { display: block; font-size: 1.15rem; }
.stat-row span { font-size: 0.75rem; color: var(--pc-muted); }

/* Dock */
.dock {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(0.85rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(460px, calc(100% - 1.2rem));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.1rem;
  padding: 0.45rem 0.3rem 0.55rem;
  border-radius: var(--pc-radius-pill);
  border: 1px solid var(--pc-line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  box-shadow: var(--pc-shadow-lg);
}
.dock button {
  border: 0;
  background: transparent;
  color: var(--pc-muted);
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0.2rem;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 650;
}
.dock button.active { color: var(--pc-purple); }
.dock-orb {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(91, 53, 245, 0.1);
}
.dock button.active .dock-orb,
.dock button.active > svg {
  background: rgba(91, 53, 245, 0.14);
  border-radius: 999px;
  color: var(--pc-purple);
}
.dock button.active > svg { padding: 7px; width: 36px; height: 36px; box-sizing: border-box; }

/* Onboarding */
.onboarding {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 18, 33, 0.45);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.onboarding-panel {
  position: relative;
  width: min(440px, 100%);
  max-height: min(92dvh, 820px);
  overflow: auto;
  padding: 1.35rem 1.2rem 1.3rem;
  border-radius: 28px;
  border: 1px solid var(--pc-line);
  background: #fff;
  box-shadow: var(--pc-shadow-lg);
  animation: rise 0.45s ease both;
}

.onboarding-skip { position: absolute; top: 0.85rem; left: 0.85rem; }

.onboarding-hero { text-align: center; padding: 0.5rem 0.4rem 0.2rem; }
.sync-orb {
  width: 72px;
  height: 72px;
  margin: 0.2rem auto 0.85rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--pc-purple);
  border: 1px solid var(--pc-line);
  background: rgba(91, 53, 245, 0.06);
  animation: spinSoft 8s linear infinite;
}
@keyframes spinSoft {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.brand-mark {
  height: 28px;
  width: auto;
  margin-bottom: 0.85rem;
}
.onboarding-hero h1,
.ob-step h2 {
  margin: 0;
  font-family: var(--pc-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: clamp(1.35rem, 4.5vw, 1.7rem);
  line-height: 1.15;
}
.ob-step h2 { text-align: left; margin-bottom: 0.25rem; }
.ob-step { display: none; }
.ob-step.active { display: block; animation: rise 0.4s ease both; }

.steps-rail {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin: 1rem 0 1.1rem;
}
.step-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(15, 18, 33, 0.12);
  transition: 0.25s ease;
}
.step-dot.active {
  width: 22px;
  background: var(--pc-gradient);
}

.tutorial-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.tutorial-list li {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 1px solid var(--pc-line);
  background: var(--pc-surface-2);
  animation: rise 0.45s ease both;
  animation-delay: calc(var(--i) * 70ms);
  font-weight: 600;
}
.tutorial-list .num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--pc-line);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--pc-purple);
  flex: 0 0 auto;
}

.connect-queue { display: grid; gap: 0.55rem; margin: 1rem 0 1.1rem; }
.connect-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--pc-line);
  background: var(--pc-surface-2);
}
.connect-item a.btn-soft { text-decoration: none; }

/* Sheet */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  align-items: end;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 33, 0.4);
}
.sheet-panel {
  position: relative;
  z-index: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 0.75rem 1.1rem 1.4rem;
  border-radius: 24px 24px 0 0;
  background: #fff;
  border: 1px solid var(--pc-line);
  border-bottom: 0;
  animation: sheetUp 0.3s ease;
}
@keyframes sheetUp {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}
.sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: rgba(15, 18, 33, 0.15);
  margin: 0.2rem auto 0.9rem;
}

/* Auth */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  overflow: auto;
  background:
    radial-gradient(ellipse 80% 50% at 80% -10%, rgba(91, 53, 245, 0.16), transparent 55%),
    radial-gradient(ellipse 50% 35% at 10% 0%, rgba(124, 92, 255, 0.1), transparent 50%),
    #f6f7fb;
}
.auth-panel {
  width: min(420px, 100%);
  padding: 1.5rem 1.25rem 1.35rem;
  border-radius: 24px;
  border: 1px solid var(--pc-line);
  background: #fff;
  box-shadow: var(--pc-shadow-lg);
  animation: rise 0.55s ease both;
  text-align: center;
}
.auth-panel .brand-mark {
  width: min(200px, 64%);
  margin: 0 auto 0.85rem;
  display: block;
}
.auth-panel h1 {
  margin: 0 0 0.35rem;
  font-family: var(--pc-display);
  font-size: clamp(1.25rem, 5vw, 1.45rem);
  letter-spacing: -0.02em;
}
.auth-block { margin-top: 0.85rem; }
.auth-form {
  text-align: left;
  display: grid;
  gap: 0.7rem;
}
.auth-form .btn-gradient { width: 100%; margin-top: 0.25rem; }
.auth-error {
  margin: 0;
  color: #b42318;
  font-size: 0.88rem;
}
.btn-google {
  width: 100%;
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border-radius: var(--pc-radius-pill);
  border: 1px solid var(--pc-line);
  background: #fff;
  color: var(--pc-text);
  font-weight: 650;
}
.btn-google:active { transform: scale(0.98); }
.auth-block .btn-ghost {
  width: 100%;
  margin-top: 0.65rem;
}

body.auth-locked .app-shell,
body.auth-locked #onboarding,
body.auth-locked #sheet,
body.auth-locked .dock {
  display: none !important;
}

/* Desktop shell */
@media (min-width: 980px) {
  .app-shell {
    grid-template-columns: var(--pc-sidebar-w) 1fr;
  }
  .sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    transform: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.72);
  }
  .sidebar-backdrop,
  .hamburger,
  .dock { display: none !important; }
  .workspace {
    padding: 1.6rem 1.75rem 2rem;
    max-width: none;
  }
}

/* —— Dashboard —— */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}
.demo-card {
  border: 1px solid var(--pc-line);
  border-radius: 16px;
  padding: 0.95rem 1rem 1.05rem;
  background: #fff;
  overflow: visible;
}
.demo-card h3 {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
}
.demo-canvas-wrap {
  position: relative;
  width: 100%;
  overflow: visible;
}
.demo-canvas-wrap.pie { height: 210px; }
.demo-canvas-wrap.bars { height: 220px; }
.demo-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.55rem;
}
.chart-filter {
  min-width: 200px;
  margin: 0;
}
.chart-filter select {
  width: 100%;
  border: 1px solid var(--pc-line);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  background: #fff;
  color: var(--pc-text);
  font: inherit;
}
.net-select { position: relative; }
.net-select-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: 1px solid var(--pc-line);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  background: #fff;
  color: var(--pc-text);
  font: inherit;
  cursor: pointer;
}
.net-select-current {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.net-select-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--pc-line);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 18, 33, 0.12);
  padding: 0.35rem;
  max-height: 260px;
  overflow: auto;
}
.net-opt {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  cursor: pointer;
  font: inherit;
  color: var(--pc-text);
  text-align: left;
}
.net-opt:hover, .net-opt.active { background: #f4f2ff; }
.net-opt-ico {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: none;
}
.net-opt-ico svg { width: 16px; height: 16px; }
.net-opt-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-net-legend { margin: 0.35rem 0 0.65rem; }
.chart-net-legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
}
.chart-net-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--pc-text);
  background: #fff;
  border: 1px solid var(--pc-line);
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
}
.chart-net-chip.muted { color: var(--pc-muted); }
.chart-net-chip i {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  display: inline-block;
}
.chart-net-chip .net-opt-ico { width: 14px; height: 14px; }
.chart-net-chip .net-opt-ico svg { width: 14px; height: 14px; }
.chart-wrap.pro {
  height: min(48vw, 320px);
  min-height: 260px;
  padding: 0.85rem 0.75rem 0.55rem;
  overflow: visible;
}
.chart-wrap.pro canvas {
  width: 100% !important;
  height: 100% !important;
}
@media (max-width: 980px) {
  .demo-grid { grid-template-columns: 1fr; }
  .demo-canvas-wrap.pie,
  .demo-canvas-wrap.bars { height: 230px; }
  .chart-wrap.pro { min-height: 240px; }
}

.dash-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  margin-bottom: 1.1rem;
}
.dash-title {
  margin: 0.35rem 0 0.25rem;
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  letter-spacing: -0.03em;
  color: var(--pc-text);
}
.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.dash-kpis { margin-bottom: 1rem; }
.dash-copilot {
  margin-bottom: 1rem;
  background:
    radial-gradient(circle at 0% 0%, rgba(91, 53, 245, 0.08), transparent 45%),
    #fff;
}
.copilot-body {
  display: grid;
  gap: 1.15rem;
  min-width: 0;
}
.copilot-hero {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}
.copilot-greeting {
  margin: 0;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--pc-text);
  overflow-wrap: anywhere;
}
.copilot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.copilot-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--pc-line);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--pc-text);
  white-space: nowrap;
}
.copilot-chip.muted {
  color: var(--pc-muted);
  font-weight: 500;
}
.copilot-chip .net-opt-ico {
  width: 14px;
  height: 14px;
  flex: none;
}
.copilot-chip .net-opt-ico svg {
  width: 14px;
  height: 14px;
}
.copilot-section {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}
.copilot-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pc-muted);
}
.copilot-prose {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
}
.copilot-prose p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--pc-text);
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}
.copilot-num {
  font-weight: 750;
  color: var(--pc-text);
  font-variant-numeric: tabular-nums;
}
.copilot-net {
  font-weight: 750;
  color: var(--pc-purple, #5b35f5);
}
.copilot-handle {
  font-weight: 650;
  color: var(--pc-text);
}
.copilot-callouts {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}
.copilot-callout {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  width: 100%;
  min-width: 0;
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--pc-line);
  background: #fff;
}
.copilot-callout p {
  margin: 0;
  min-width: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--pc-text);
  overflow-wrap: break-word;
  word-break: normal;
}
.copilot-callout-mark {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
  flex: none;
  background: #f3f4f8;
  color: var(--pc-muted);
}
.copilot-callout.warn {
  border-color: rgba(183, 121, 31, 0.28);
  background: linear-gradient(180deg, #fff9f1, #fff);
}
.copilot-callout.warn .copilot-callout-mark {
  background: #fff1dd;
  color: #b7791f;
}
.copilot-callout.ok {
  border-color: rgba(31, 157, 99, 0.28);
  background: linear-gradient(180deg, #f5fcf8, #fff);
}
.copilot-callout.ok .copilot-callout-mark {
  background: #e6f7ef;
  color: #1f9d63;
}
.copilot-callout.info {
  border-color: rgba(91, 53, 245, 0.18);
  background: linear-gradient(180deg, #f7f5ff, #fff);
}
.copilot-callout.info .copilot-callout-mark {
  background: #efeaff;
  color: #5b35f5;
}
.copilot-nets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 0.65rem;
}
.copilot-net-card {
  min-width: 0;
  border: 1px solid var(--pc-line);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  background: #fff;
  display: grid;
  gap: 0.45rem;
}
.copilot-net-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.copilot-net-head strong {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copilot-net-card p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--pc-text);
  overflow-wrap: break-word;
}
.copilot-bullets {
  margin: 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.25rem;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--pc-muted);
}
.copilot-plan {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}
.copilot-action {
  border: 1px solid var(--pc-line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: #fff;
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}
.copilot-action-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.copilot-step {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  background: #efeaff;
  color: #5b35f5;
  flex: none;
}
.copilot-prio {
  font-size: 0.7rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.copilot-action-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.45;
  color: var(--pc-text);
  overflow-wrap: break-word;
  word-break: normal;
}
.copilot-action-meta {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--pc-muted);
  overflow-wrap: break-word;
}
.copilot-action-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  font-size: 0.8rem;
  color: var(--pc-muted);
  line-height: 1.4;
}
.copilot-action-footer em {
  font-style: normal;
  font-weight: 700;
  color: var(--pc-text);
  margin-right: 0.25rem;
}
.priority-alta { color: var(--pc-danger, #c0392b); }
.priority-média, .priority-media { color: var(--pc-warn, #b7791f); }
.priority-baixa { color: var(--pc-muted); }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
  font-size: 0.78rem;
  color: var(--pc-muted);
  margin-bottom: 0.55rem;
}
.chart-legend i {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.lg-value { background: var(--pc-purple); }
.lg-mean { background: #0f1221; }
.lg-band { background: rgba(91, 53, 245, 0.28); height: 10px !important; border-radius: 3px; }

.chart-wrap {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--pc-line);
  background: linear-gradient(180deg, #fbfaff, #fff);
  overflow: visible;
}
.chart-stats {
  margin-top: 0.55rem;
  font-size: 0.84rem;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.dash-alerts {
  display: grid;
  gap: 0.55rem;
}
.dash-alert {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0.65rem;
  align-items: start;
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--pc-line);
  background: #fff;
}
.dash-alert .alert-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
  background: #f3f4f8;
  color: var(--pc-muted);
}
.dash-alert strong {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 0.15rem;
}
.dash-alert p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--pc-muted);
  line-height: 1.35;
}
.dash-alert.success {
  border-color: rgba(31, 157, 99, 0.28);
  background: linear-gradient(180deg, #f5fcf8, #fff);
}
.dash-alert.success .alert-icon { background: #e6f7ef; color: #1f9d63; }
.dash-alert.warning {
  border-color: rgba(183, 121, 31, 0.28);
  background: linear-gradient(180deg, #fff9f1, #fff);
}
.dash-alert.warning .alert-icon { background: #fff1dd; color: #b7791f; }

.dash-networks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.85rem;
}
.net-card {
  --net: var(--pc-purple);
  border: 1px solid var(--pc-line);
  border-radius: 16px;
  padding: 0.9rem 1rem 0.75rem;
  background: #fff;
  display: grid;
  gap: 0.65rem;
  overflow: hidden;
  min-width: 0;
}
.net-card-head {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 0.55rem;
  align-items: center;
  min-width: 0;
}
.net-card-head .badge { width: 28px; height: 28px; flex: none; }
.net-card-title { min-width: 0; }
.net-card h3 {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.2;
}
.net-handle {
  display: block;
  color: var(--pc-muted);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.net-pill {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--net);
  background: color-mix(in srgb, var(--net) 12%, white);
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
  white-space: nowrap;
}
.net-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.7rem;
  font-size: 0.78rem;
  color: var(--pc-muted);
}
.net-metrics strong {
  display: block;
  color: var(--pc-text);
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}
.net-spark-wrap {
  position: relative;
  height: 42px;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(180deg, #faf9ff, #fff);
  border: 1px solid rgba(15, 18, 33, 0.05);
}
.net-spark {
  width: 100%;
  height: 42px;
  display: block;
  color: var(--net);
}
.net-spark .spark-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  animation: spark-draw 1.1s ease forwards;
}
.net-spark .spark-area {
  fill: color-mix(in srgb, var(--net) 18%, transparent);
  stroke: none;
  opacity: 0;
  animation: spark-fade 0.8s ease 0.15s forwards;
}
.net-spark-tip {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  background: rgba(15, 18, 33, 0.92);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.net-spark-wrap:hover .net-spark-tip {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
@keyframes spark-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes spark-fade {
  to { opacity: 1; }
}

.dash-videos {
  display: grid;
  gap: 0.65rem;
}
.dash-video {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid var(--pc-line);
  border-radius: 14px;
  padding: 0.55rem 0.75rem;
  background: #fff;
}
.dash-video img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  background: #eee;
}
.dash-video h4 {
  margin: 0 0 0.2rem;
  font-size: 0.92rem;
}
.dash-video .meta {
  font-size: 0.8rem;
  color: var(--pc-muted);
}
.dash-video .score {
  font-weight: 800;
  color: var(--pc-purple);
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  .dash-video { grid-template-columns: 56px 1fr; }
  .dash-video .score { grid-column: 2; }
  .dash-actions { width: 100%; }
  .dash-actions .btn-gradient,
  .dash-actions .btn-soft { flex: 1; }
}
