:root {
  --bg: #fff8f6;
  --ink: #251832;
  --muted: #756b7f;
  --pink: #e91e63;
  --magenta: #c523d9;
  --orange: #ff6b35;
  --blue: #4169e1;
  --cyan: #9ec5ff;
  --glass: rgba(255, 255, 255, 0.64);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --line: rgba(111, 78, 138, 0.16);
  --shadow: 0 24px 80px rgba(89, 43, 112, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 86, 126, 0.2), transparent 32%),
    radial-gradient(circle at 82% 24%, rgba(84, 132, 255, 0.22), transparent 30%),
    radial-gradient(circle at 50% 90%, rgba(255, 122, 63, 0.16), transparent 38%),
    var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  min-height: 100vh;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
}

.shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.18)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.16) 0,
      rgba(255, 255, 255, 0.16) 1px,
      transparent 1px,
      transparent 16px
    );
  opacity: 0.76;
}

.hidden {
  display: none !important;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  padding: 4px;
  border: 1px solid rgba(255, 82, 132, 0.16);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(247, 250, 255, 0.72)),
    rgba(255, 255, 255, 0.66);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 14px 32px rgba(62, 73, 130, 0.08);
  backdrop-filter: blur(16px);
}

.language-switch button {
  min-width: 40px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #716b87;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
  transition:
    transform 180ms ease,
    color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.language-switch button:hover {
  transform: translateY(-1px);
  color: #18142c;
}

.language-switch button.active {
  color: #fff;
  background: linear-gradient(135deg, #ff4f78 0%, #dd2fb8 55%, #6f7bff 100%);
  box-shadow:
    0 10px 24px rgba(236, 44, 131, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.pricing-language,
.auth-language {
  margin-bottom: 16px;
}

.top-language {
  margin-right: 4px;
}

.glass {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.42)),
    var(--glass);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    var(--shadow);
  backdrop-filter: blur(22px) saturate(1.18);
}

.auth-view {
  min-height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: minmax(320px, 1.08fr) minmax(320px, 0.72fr);
  gap: 28px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.auth-visual {
  position: relative;
  min-height: 620px;
  border-radius: 40px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.auth-visual img {
  width: min(760px, 100%);
  max-height: 82vh;
  object-fit: contain;
  filter: drop-shadow(0 32px 80px rgba(87, 52, 116, 0.22));
  position: relative;
  z-index: 2;
}

.glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
}

.glow-a {
  width: 340px;
  height: 340px;
  left: 7%;
  top: 14%;
  background: rgba(255, 71, 125, 0.26);
}

.glow-b {
  width: 360px;
  height: 360px;
  right: 9%;
  bottom: 10%;
  background: rgba(80, 137, 255, 0.24);
}

.auth-panel {
  border-radius: 34px;
  padding: 34px;
  max-width: 780px;
  justify-self: center;
}

.pricing-panel {
  position: relative;
  overflow: hidden;
}

.pricing-panel > :not(.pricing-decor) {
  position: relative;
  z-index: 2;
}

.pricing-decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
}

.decor-icon {
  position: absolute;
  width: 116px;
  height: 116px;
  object-fit: contain;
  filter: drop-shadow(0 28px 42px rgba(83, 104, 174, 0.22));
  animation: floatIcon 7s ease-in-out infinite;
}

.decor-instagram {
  left: -22px;
  top: 118px;
  transform: rotate(-8deg);
}

.decor-ai {
  right: -30px;
  top: 78px;
  animation-delay: -1.5s;
}

.decor-chat {
  left: -18px;
  bottom: 140px;
  width: 92px;
  height: 92px;
  animation-delay: -3s;
}

.decor-tokens {
  right: -20px;
  bottom: 122px;
  width: 100px;
  height: 110px;
  animation-delay: -4.2s;
}

.step-label {
  margin: 24px 0 8px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 850;
}

.module-note,
.token-warning,
.fine-print {
  border-radius: 18px;
  padding: 13px 14px;
  color: #574b62;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.72);
}

.module-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  max-width: 560px;
}

.module-note img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(65, 105, 225, 0.18));
}

.token-warning {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 14px;
  color: #7a3651;
  background: rgba(255, 238, 244, 0.72);
  border-color: rgba(233, 30, 99, 0.16);
}

.token-warning img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(233, 30, 99, 0.16));
}

.token-warning svg {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: var(--blue);
}

.fine-print {
  margin: 14px 0 0;
  font-size: 13px;
}

.pricing-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 20px auto 12px;
  max-width: 610px;
}

.pricing-head span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.pricing-head strong {
  color: var(--pink);
  font-size: 14px;
  font-weight: 900;
}

.pricing-head.compact-head {
  margin-top: 14px;
}

.pricing-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  max-width: 980px;
  margin: 14px auto 16px;
}

.pricing-picker.compact {
  max-width: none;
  margin: 12px 0 4px;
}

button.subscription-plan,
.subscription-plan {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 292px;
  padding: 28px 28px 26px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 32px;
  appearance: none;
  -webkit-appearance: none;
  color: var(--ink);
  text-align: left;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 121, 155, 0.14), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(119, 159, 255, 0.14), transparent 34%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.48));
  box-shadow:
    0 24px 72px rgba(89, 43, 112, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  transform: translateZ(0);
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    filter 0.22s ease;
}

button.subscription-plan::before,
.subscription-plan::before {
  content: "";
  position: absolute;
  inset: -60% -30%;
  z-index: -1;
  background: conic-gradient(
    from 120deg,
    transparent,
    rgba(233, 30, 99, 0.2),
    rgba(65, 105, 225, 0.22),
    rgba(255, 107, 53, 0.18),
    transparent
  );
  opacity: 0;
  animation: pricingGlow 8s linear infinite;
}

button.subscription-plan:hover {
  transform: translateY(-4px);
  border-color: rgba(233, 30, 99, 0.32);
  box-shadow:
    0 26px 74px rgba(89, 43, 112, 0.18),
    0 0 42px rgba(233, 30, 99, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.premium-pricing.compact .subscription-plan {
  min-height: 162px;
  padding: 18px;
  border-radius: 24px;
}

.premium-pricing.compact .plan-top-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
}

.premium-pricing.compact .plan-top-icon svg {
  width: 24px;
  height: 24px;
}

.premium-pricing.compact .plan-title {
  font-size: 14px;
  text-align: left;
}

.premium-pricing.compact .plan-price {
  justify-content: flex-start;
  font-size: 34px;
}

.premium-pricing.compact .plan-price small {
  font-size: 12px;
}

.plan-top-icon {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.45)),
    rgba(255, 255, 255, 0.58);
  box-shadow:
    0 18px 42px rgba(89, 43, 112, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.plan-top-icon svg {
  width: 32px;
  height: 32px;
  color: var(--pink);
  stroke-width: 2.1;
}

.plan-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 6px;
  font-size: clamp(52px, 7vw, 68px);
  line-height: 0.95;
  font-weight: 950;
  background: linear-gradient(90deg, var(--pink), var(--magenta), var(--blue));
  -webkit-background-clip: text;
  color: transparent;
}

.plan-price small {
  color: #73708f;
  font-size: 17px;
  font-weight: 800;
  background: none;
}

.plan-title,
.subscription-plan span.plan-title {
  color: #2d2038;
  font-size: 21px;
  font-weight: 900;
  text-align: center;
}

.plan-divider {
  width: 100%;
  height: 1px;
  margin: 2px 0 6px;
  background: linear-gradient(90deg, transparent, rgba(104, 91, 125, 0.2), transparent);
}

.plan-feature,
.subscription-plan span.plan-feature {
  position: relative;
  padding-left: 26px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 750;
}

.plan-feature::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: -1px;
  width: 19px;
  height: 19px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--pink);
  font-size: 13px;
  line-height: 1;
  border: 1.5px solid var(--pink);
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 0 16px rgba(233, 30, 99, 0.16);
}

.plan-cta {
  min-height: 52px;
  margin-top: 12px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--pink);
  font-size: 16px;
  font-weight: 950;
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    0 16px 32px rgba(89, 43, 112, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.primary-cta {
  color: white;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent),
    linear-gradient(135deg, var(--pink), var(--magenta), var(--blue));
  box-shadow:
    0 18px 44px rgba(210, 37, 146, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.plan-badge {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 8px 16px;
  border-radius: 999px;
  color: white !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  background: linear-gradient(135deg, var(--pink), var(--orange));
  box-shadow: 0 12px 26px rgba(233, 30, 99, 0.25);
}

.plan-badge svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

.subscription-plan:has(.plan-badge) .plan-top-icon {
  margin-top: 18px;
}

button.subscription-plan.active,
.subscription-plan.active {
  color: white;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 211, 92, 0.34), transparent 28%),
    radial-gradient(circle at 100% 0%, rgba(118, 160, 255, 0.34), transparent 36%),
    linear-gradient(135deg, var(--pink), var(--magenta) 48%, var(--blue));
  border-color: rgba(255, 255, 255, 0.86);
  box-shadow:
    0 28px 86px rgba(210, 37, 146, 0.32),
    0 0 58px rgba(83, 133, 255, 0.23),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: translateY(-3px);
}

.subscription-plan.active::before {
  opacity: 1;
}

.subscription-plan.active .plan-kicker,
.subscription-plan.active .plan-title,
.subscription-plan.active .plan-feature,
.subscription-plan.active span {
  color: rgba(255, 255, 255, 0.84);
}

.subscription-plan.active .plan-price {
  color: white;
  background: none;
  -webkit-background-clip: initial;
}

.subscription-plan.active .plan-price small,
.subscription-plan.active .plan-title {
  color: rgba(255, 255, 255, 0.86);
}

.subscription-plan.active .plan-top-icon {
  background: rgba(255, 255, 255, 0.22);
}

.subscription-plan.active .plan-top-icon svg {
  color: white;
}

.subscription-plan.active .plan-feature::before {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.42);
}

.subscription-plan.active .plan-cta {
  color: #ef3f79;
  background: rgba(255, 255, 255, 0.84);
}

.setup-card {
  max-width: 510px;
  min-height: 86px;
  margin: 12px auto 10px;
  padding: 18px 22px;
  border-radius: 26px;
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 16px;
  align-items: center;
  color: #463852;
  background:
    radial-gradient(circle at 5% 0%, rgba(255, 121, 155, 0.12), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    0 22px 62px rgba(89, 43, 112, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
  cursor: pointer;
}

.billing-setup-card {
  max-width: none;
  margin: 12px 0;
}

.setup-card input {
  width: 20px;
  height: 20px;
  accent-color: var(--pink);
}

.setup-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.45)),
    rgba(255, 255, 255, 0.58);
  color: var(--magenta);
  box-shadow:
    0 16px 34px rgba(89, 43, 112, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.setup-copy {
  display: grid;
  gap: 3px;
  line-height: 1.35;
}

.setup-copy strong {
  color: #2d2038;
  font-size: 18px;
}

.setup-copy b {
  color: var(--pink);
  font-size: 28px;
}

.onboarding-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.onboarding-dots {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(92, 71, 112, 0.22);
}

.dot.active {
  width: 30px;
  background: linear-gradient(90deg, var(--pink), var(--blue));
}

@keyframes pricingGlow {
  to {
    transform: rotate(360deg);
  }
}

.auth-actions.split {
  margin-top: 14px;
  align-items: center;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 20px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-row > div {
  min-width: 0;
}

.brand-row.compact {
  gap: 10px;
  margin-bottom: 18px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
  font-size: 20px;
  background:
    radial-gradient(circle at 30% 28%, #ffd35c, transparent 28%),
    linear-gradient(135deg, var(--orange), var(--pink) 45%, var(--magenta) 78%, var(--blue));
  box-shadow:
    0 16px 42px rgba(225, 37, 126, 0.32),
    inset 0 1px 8px rgba(255, 255, 255, 0.46);
}

.brand-logo {
  width: 132px;
  height: 56px;
  flex: 0 0 132px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  padding: 12px 14px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 211, 92, 0.34), transparent 34%),
    linear-gradient(135deg, var(--pink), var(--magenta) 55%, var(--blue));
  box-shadow:
    0 16px 42px rgba(225, 37, 126, 0.3),
    inset 0 1px 8px rgba(255, 255, 255, 0.46);
}

.brand-logo img {
  width: 100%;
  height: auto;
  display: block;
}

.compact-logo {
  width: 92px;
  height: 40px;
  flex-basis: 92px;
  border-radius: 15px;
  padding: 9px 11px;
}

.brand-row.compact .brand-mark {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  border-radius: 15px;
  font-size: 15px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--pink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 0.95;
  font-weight: 900;
  background: linear-gradient(90deg, var(--pink), var(--magenta), var(--orange));
  -webkit-background-clip: text;
  color: transparent;
}

h2 {
  margin-bottom: 0;
  font-size: 28px;
}

h3 {
  margin-bottom: 14px;
  font-size: 24px;
}

.lead {
  margin: 28px 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.auth-form,
.stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: #4e4359;
  font-size: 13px;
  font-weight: 750;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(99, 80, 125, 0.18);
  border-radius: 16px;
  padding: 13px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

textarea {
  resize: vertical;
  min-height: 92px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(198, 35, 217, 0.46);
  box-shadow:
    0 0 0 4px rgba(198, 35, 217, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.auth-actions,
.hero-actions,
.topbar-actions,
.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.btn,
.link-btn,
.nav-item,
.package,
.subscription-plan,
.dot {
  border: 0;
  cursor: pointer;
}

.btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 15px;
  padding: 12px 16px;
  text-decoration: none;
  font-weight: 800;
  color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.btn[data-loading="true"] {
  position: relative;
  opacity: 0.82;
}

.btn-spinner,
.progress-spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.72s linear infinite;
}

.btn.primary .btn-spinner {
  color: #fff;
}

.btn.primary {
  color: white;
  background: linear-gradient(135deg, var(--pink), var(--magenta) 54%, var(--orange));
  box-shadow: 0 16px 34px rgba(218, 36, 130, 0.28);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.72);
}

.btn.text {
  color: #372744;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.btn.full {
  width: 100%;
}

.btn svg,
.nav-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
}

.link-btn {
  justify-self: start;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 750;
}

.form-status,
.muted {
  color: var(--muted);
  line-height: 1.5;
}

.form-status[data-kind="success"] {
  color: #07965b;
  font-weight: 800;
}

.form-status[data-kind="error"] {
  color: #d93063;
  font-weight: 800;
}

.training-progress {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 14px;
  padding: 14px 15px;
  border-radius: 18px;
  color: #352446;
  background:
    linear-gradient(135deg, rgba(233, 30, 99, 0.1), rgba(65, 105, 225, 0.1)),
    rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.training-progress strong {
  display: block;
  margin-bottom: 2px;
  font-size: 14px;
}

.training-progress p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.progress-spinner {
  width: 28px;
  height: 28px;
  color: var(--pink);
  border-width: 3px;
  box-shadow: 0 0 24px rgba(233, 30, 99, 0.22);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.app-view {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  min-height: calc(100vh - 48px);
}

.sidebar {
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  border-radius: 30px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 11px 12px;
  border-radius: 15px;
  color: #5c5166;
  background: transparent;
  font-weight: 800;
  text-align: left;
}

.nav-item.active {
  color: white;
  background: linear-gradient(135deg, rgba(233, 30, 99, 0.92), rgba(65, 105, 225, 0.88));
  box-shadow: 0 14px 30px rgba(90, 63, 170, 0.22);
}

.sidebar .full {
  margin-top: auto;
}

.content {
  min-width: 0;
  display: grid;
  gap: 18px;
  align-content: start;
}

.topbar {
  border-radius: 28px;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.notice {
  border-radius: 18px;
  padding: 14px 16px;
  color: #6b2545;
  background: rgba(255, 225, 235, 0.82);
  border: 1px solid rgba(233, 30, 99, 0.18);
}

.paywall {
  border-radius: 28px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.paywall h3,
.paywall p {
  margin-bottom: 8px;
}

.paywall p {
  max-width: 820px;
  color: var(--muted);
  line-height: 1.5;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  gap: 18px;
}

.hero {
  min-height: 360px;
  border-radius: 34px;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(420px, 1fr);
  gap: 26px;
  overflow: hidden;
}

.hero-copy {
  align-self: center;
}

.hero-copy h3 {
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1;
  max-width: 680px;
  background: linear-gradient(90deg, var(--pink), var(--magenta), var(--blue));
  -webkit-background-clip: text;
  color: transparent;
}

.hero-copy p {
  color: var(--muted);
  max-width: 580px;
  line-height: 1.55;
}

.hero-device {
  min-height: 320px;
  position: relative;
}

.phone-card,
.ai-core {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.46);
  box-shadow:
    inset 0 1px 8px rgba(255, 255, 255, 0.9),
    0 24px 70px rgba(66, 76, 180, 0.16);
  backdrop-filter: blur(18px);
}

.phone-card {
  width: 38%;
  min-width: 180px;
  height: 82%;
  top: 10%;
  border-radius: 30px;
  padding: 20px;
}

.phone-card span {
  display: inline-flex;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.72);
}

.phone-card.comments {
  left: 0;
  box-shadow: 0 24px 70px rgba(233, 30, 99, 0.14);
}

.phone-card.comments span {
  color: var(--pink);
}

.phone-card.direct {
  right: 0;
  box-shadow: 0 24px 70px rgba(65, 105, 225, 0.18);
}

.phone-card.direct span {
  color: var(--blue);
}

.mini-post {
  height: 92px;
  margin: 18px 0;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent),
    url("./assets/instagram-automation-style.png") center/cover;
  opacity: 0.82;
}

.comment-line,
.bubble {
  height: 22px;
  margin: 12px 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.comment-line.short {
  width: 70%;
}

.bubble {
  height: 42px;
  border-radius: 16px 16px 16px 4px;
}

.bubble.right {
  margin-left: 25%;
  background: rgba(117, 143, 255, 0.38);
  border-radius: 16px 16px 4px 16px;
}

.ai-core {
  left: 50%;
  top: 50%;
  width: 160px;
  height: 160px;
  transform: translate(-50%, -50%);
  border-radius: 34px;
  display: grid;
  place-items: center;
  color: white;
  background:
    linear-gradient(rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08)),
    linear-gradient(135deg, rgba(255, 120, 90, 0.9), rgba(215, 34, 175, 0.86), rgba(87, 129, 255, 0.84));
}

.ai-core svg {
  width: 46px;
  height: 46px;
}

.ai-core strong {
  font-size: 48px;
  line-height: 1;
}

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

.metric,
.panel {
  border-radius: 26px;
  padding: 20px;
}

.metric {
  display: grid;
  gap: 8px;
}

.metric span {
  color: var(--muted);
  font-weight: 750;
}

.metric strong {
  font-size: 27px;
}

.metric small {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.search {
  max-width: 300px;
}

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

.post-card,
.integration-card,
.activity-item,
.payment-row {
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.56);
}

.post-card {
  display: grid;
  gap: 10px;
  cursor: pointer;
  min-height: 220px;
}

.post-card:hover {
  border-color: rgba(233, 30, 99, 0.26);
}

.pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 26px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(107, 145, 255, 0.12);
  font-size: 12px;
  font-weight: 850;
}

.pill.pink {
  color: var(--pink);
  background: rgba(233, 30, 99, 0.12);
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.switch-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.toggle-grid,
.package-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

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

.check-list li {
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.54);
  color: #4d3d60;
  font-weight: 750;
}

.preview-box,
.payment-element {
  margin: 16px 0;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.62);
}

.preview-box p {
  margin: 12px 0 0;
  color: var(--muted);
}

.token-meter {
  display: grid;
  gap: 4px;
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(233, 30, 99, 0.12), rgba(65, 105, 225, 0.12)),
    rgba(255, 255, 255, 0.56);
}

.subscription-box {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 109, 70, 0.13), rgba(198, 35, 217, 0.11)),
    rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.subscription-box strong {
  font-size: 18px;
}

.subscription-box small {
  color: var(--muted);
  line-height: 1.45;
}

.token-meter strong {
  font-size: 44px;
  background: linear-gradient(90deg, var(--pink), var(--blue));
  -webkit-background-clip: text;
  color: transparent;
}

.package {
  display: grid;
  gap: 4px;
  min-width: 130px;
  padding: 14px;
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.75);
  text-align: left;
  font-weight: 850;
}

.package span {
  color: var(--muted);
}

.package.active {
  color: white;
  background: linear-gradient(135deg, var(--pink), var(--blue));
}

.package.active span {
  color: rgba(255, 255, 255, 0.8);
}

.activity-list,
.compact-list {
  display: grid;
  gap: 10px;
}

.activity-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
}

.activity-type {
  min-width: 82px;
}

.activity-item p {
  margin-bottom: 4px;
}

.activity-item small,
.payment-row small {
  color: var(--muted);
}

@media (max-width: 1120px) {
  .auth-view,
  .hero {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: 420px;
  }

  .hero-device {
    min-height: 300px;
  }

  .metric-grid,
  .posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .shell {
    padding: 14px;
  }

  .app-view {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .section-head,
  .paywall {
    align-items: stretch;
    flex-direction: column;
  }

  .pricing-picker {
    grid-template-columns: 1fr;
  }

  .grid.two,
  .metric-grid,
  .posts-grid {
    grid-template-columns: 1fr;
  }

  .hero-device {
    display: none;
  }
}

@media (max-width: 540px) {
  .auth-panel,
  .hero,
  .panel,
  .metric {
    border-radius: 22px;
    padding: 18px;
  }

  .auth-visual {
    min-height: 260px;
  }

  .auth-visual img {
    max-height: 260px;
  }

  .auth-actions,
  .onboarding-actions,
  .topbar-actions,
  .hero-actions {
    display: grid;
  }

  nav {
    grid-template-columns: 1fr;
  }
}

/* Premium cabinet redesign */
:root {
  --bg: #fbf8fb;
  --ink: #20182f;
  --muted: #756f84;
  --pink: #f85f91;
  --magenta: #d951bd;
  --orange: #ff7567;
  --blue: #6d9cff;
  --icy: #dfeaff;
  --blush: #fff0f4;
  --glass: rgba(255, 255, 255, 0.68);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --line: rgba(96, 86, 125, 0.14);
  --shadow: 0 28px 90px rgba(91, 65, 112, 0.14);
}

html {
  background:
    linear-gradient(135deg, rgba(255, 241, 246, 0.78), rgba(248, 250, 255, 0.9) 52%, rgba(255, 248, 244, 0.72)),
    #fbf8fb;
}

body {
  font-family: "Manrope", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
}

h1,
.pricing-title h2,
.hero-copy h3,
.plan-price {
  font-family: "Unbounded", "Manrope", ui-sans-serif, system-ui, sans-serif;
}

h1 {
  font-size: 54px;
  line-height: 1.02;
  background: linear-gradient(90deg, #ec2f7f, #ca48d4 54%, #ff7358);
  -webkit-background-clip: text;
  color: transparent;
  overflow-wrap: anywhere;
}

.shell {
  padding: 22px;
}

.auth-view {
  display: block;
  min-height: calc(100vh - 44px);
}

.onboarding-stage,
.pricing-stage {
  min-height: calc(100vh - 44px);
  position: relative;
  z-index: 1;
}

.onboarding-showcase {
  min-height: calc(100vh - 44px);
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(360px, 0.72fr);
  gap: 34px;
  align-items: center;
}

.onboarding-image-frame {
  position: relative;
  min-height: calc(100vh - 90px);
  border-radius: 36px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 246, 250, 0.42)),
    rgba(255, 255, 255, 0.44);
  box-shadow: 0 34px 110px rgba(91, 65, 112, 0.12);
}

.onboarding-image-frame img {
  width: min(100%, 1180px);
  height: min(calc(100vh - 140px), 760px);
  object-fit: contain;
  filter: drop-shadow(0 30px 80px rgba(89, 72, 120, 0.16));
  position: relative;
  z-index: 2;
}

.onboarding-copy {
  border-radius: 34px;
  padding: 36px;
  align-self: center;
}

.onboarding-copy .lead {
  margin: 22px 0;
}

.onboarding-copy .btn.full {
  margin-top: 14px;
}

.pricing-stage {
  display: grid;
  place-items: center;
}

.pricing-shell {
  width: min(100%, 1480px);
  min-height: calc(100vh - 52px);
  position: relative;
  overflow: hidden;
  border-radius: 40px;
  padding: 54px 64px;
}

.pricing-shell > :not(.pricing-decor) {
  position: relative;
  z-index: 2;
}

.pricing-title {
  max-width: 640px;
}

.pricing-title h2 {
  margin: 0 0 12px;
  font-size: 48px;
  line-height: 1.06;
  color: #111028;
}

.pricing-title p {
  color: #74708e;
  font-size: 18px;
  line-height: 1.55;
}

.pricing-shell .pricing-head,
.pricing-shell .pricing-picker {
  max-width: min(1240px, 100%);
}

.pricing-shell .pricing-head {
  margin-top: 28px;
  align-items: flex-end;
}

.pricing-shell .pricing-head strong {
  max-width: 52%;
  text-align: right;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.pricing-shell .pricing-picker {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  align-items: stretch;
}

.pricing-shell .subscription-plan {
  min-width: 0;
  min-height: 430px;
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: max-content;
  align-content: start;
  border-radius: 36px;
  padding: 28px 30px 30px;
}

.pricing-shell .lifetime-plan {
  border-color: rgba(109, 156, 255, 0.38);
}

.lifetime-plan .lifetime-badge {
  background: linear-gradient(135deg, #6d9cff, #c954d5 58%, #f05283);
}

.plan-art {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
}

.plan-art img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  filter: drop-shadow(0 18px 38px rgba(99, 100, 150, 0.18));
}

.pricing-shell .plan-price {
  justify-content: flex-start;
  min-width: 0;
  max-width: 100%;
  font-size: clamp(42px, 4vw, 56px);
  letter-spacing: 0;
  background: linear-gradient(90deg, #f05283, #c954d5 58%, #6d9cff);
  -webkit-background-clip: text;
  overflow-wrap: anywhere;
}

.pricing-shell .lifetime-plan .plan-price {
  flex-wrap: wrap;
  row-gap: 4px;
  font-size: clamp(38px, 3.45vw, 50px);
}

.pricing-shell .lifetime-plan .plan-price small {
  flex: 1 0 100%;
  font-size: 14px;
  line-height: 1.25;
}

.pricing-shell .plan-title {
  text-align: left;
  font-size: 24px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.pricing-shell .plan-feature {
  line-height: 1.34;
  overflow-wrap: anywhere;
}

.pricing-shell .plan-cta {
  width: 100%;
  min-width: 0;
  margin-top: 10px;
  padding: 0 16px;
  text-align: center;
  overflow-wrap: anywhere;
}

.pricing-shell .subscription-plan.active .plan-cta {
  color: #ef3f79;
  background: rgba(255, 255, 255, 0.88);
}

.pricing-shell .setup-card {
  max-width: 650px;
  margin: 28px auto 14px;
}

.pricing-shell .token-warning {
  max-width: 760px;
  margin: 16px auto;
}

.pricing-actions {
  justify-content: center;
  margin-top: 22px;
}

.image-icon {
  overflow: hidden;
}

.image-icon img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.decor-icon {
  opacity: 0.86;
}

.decor-instagram {
  left: 40px;
  top: 260px;
  width: 150px;
  height: 150px;
}

.decor-ai {
  right: 90px;
  top: 150px;
  width: 150px;
  height: 150px;
}

.decor-chat {
  left: 112px;
  bottom: 120px;
  width: 112px;
  height: 112px;
}

.decor-tokens {
  right: 110px;
  bottom: 96px;
  width: 142px;
  height: 142px;
}

.auth-view > #authPanel {
  width: min(100%, 560px);
  margin: 9vh auto;
}

.app-view {
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 26px;
}

.sidebar {
  border-radius: 30px;
  padding: 24px 18px;
}

.nav-item {
  min-height: 50px;
  border-radius: 18px;
  color: #2b2540;
  background: transparent;
}

.nav-item.active {
  color: #ef3f79;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 246, 249, 0.72)),
    rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(248, 95, 145, 0.28);
  box-shadow: 0 18px 42px rgba(248, 95, 145, 0.18);
}

.topbar {
  min-height: 104px;
  border-radius: 30px;
  padding: 22px 28px;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.user-avatar {
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #f05283;
  font-weight: 800;
  font-size: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 238, 245, 0.66)),
    rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(248, 95, 145, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 18px 40px rgba(248, 95, 145, 0.14);
}

.token-pill {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 16px;
  color: #2c2440;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(96, 86, 125, 0.12);
}

.token-pill svg {
  width: 18px;
  height: 18px;
  color: #6d77aa;
}

.topbar-brand-icon {
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 20px;
  object-fit: contain;
}

.paywall {
  border-color: rgba(109, 156, 255, 0.24);
  background:
    linear-gradient(135deg, rgba(250, 253, 255, 0.9), rgba(238, 245, 255, 0.68)),
    rgba(255, 255, 255, 0.72);
}

.paywall .btn.primary {
  background: rgba(255, 255, 255, 0.78);
  color: #2f5fae;
  border: 1px solid rgba(109, 156, 255, 0.24);
  box-shadow: 0 16px 34px rgba(109, 156, 255, 0.14);
}

.hero {
  min-height: 380px;
  grid-template-columns: minmax(310px, 0.76fr) minmax(420px, 1fr);
  align-items: center;
  border-radius: 34px;
  padding: 42px 48px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.88), rgba(255, 245, 249, 0.62) 50%, rgba(239, 246, 255, 0.72)),
    rgba(255, 255, 255, 0.7);
}

.hero-copy h3 {
  max-width: 540px;
  margin-bottom: 18px;
  color: #15132e;
  background: none;
  font-size: 42px;
  line-height: 1.15;
}

.hero-copy p {
  max-width: 560px;
  font-size: 17px;
}

.feature-chips,
.behavior-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.feature-chips span,
.behavior-chips span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 999px;
  color: #625c76;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.72);
}

.feature-chips svg {
  width: 16px;
  height: 16px;
  color: #f85f91;
}

.hero-illustration {
  min-height: 310px;
  position: relative;
  isolation: isolate;
}

.hero-cube {
  position: absolute;
  object-fit: contain;
  filter: drop-shadow(0 28px 44px rgba(83, 104, 174, 0.2));
  animation: floatIcon 7s ease-in-out infinite;
}

.hero-instagram {
  left: 5%;
  top: 31%;
  width: 150px;
  height: 150px;
}

.hero-ai {
  left: 38%;
  top: 10%;
  width: 230px;
  height: 230px;
  animation-delay: -1.4s;
}

.hero-direct {
  right: 3%;
  top: 29%;
  width: 170px;
  height: 170px;
  animation-delay: -2.6s;
}

.flow-line {
  position: absolute;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(248, 95, 145, 0.18), rgba(248, 95, 145, 0.56), rgba(109, 156, 255, 0.38));
  box-shadow: 0 0 26px rgba(248, 95, 145, 0.2);
}

.line-one {
  left: 19%;
  top: 52%;
  width: 28%;
  transform: rotate(-5deg);
}

.line-two {
  right: 16%;
  top: 54%;
  width: 28%;
  transform: rotate(4deg);
  background: linear-gradient(90deg, rgba(109, 156, 255, 0.28), rgba(109, 156, 255, 0.62));
}

.glass-bubble {
  position: absolute;
  width: 72px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #6d9cff;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: 0 20px 44px rgba(109, 156, 255, 0.14);
}

.bubble-one {
  left: 24%;
  top: 16%;
  color: #f85f91;
}

.bubble-two {
  left: 58%;
  top: 6%;
  color: #f85f91;
}

.bubble-three {
  right: 12%;
  bottom: 13%;
}

.metric-grid {
  gap: 22px;
}

.metric {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 24px 26px;
}

.metric strong {
  margin: 8px 0 6px;
  display: block;
  font-size: 28px;
}

.metric-icon {
  width: 92px;
  height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 18px 34px rgba(99, 100, 150, 0.16));
}

.dashboard-insights {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 22px;
}

.compact-headline {
  align-items: center;
}

.period-select {
  max-width: 160px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.analytics-panel,
.quick-setup,
.behavior-card {
  padding: 28px;
}

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

.mini-stat {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.68);
}

.mini-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mini-stat strong {
  font-size: 28px;
  color: #20182f;
}

.stats-chart {
  height: 152px;
  display: flex;
  align-items: end;
  gap: 7px;
  padding: 16px 14px 12px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.28)),
    rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.66);
}

.chart-bar {
  flex: 1;
  min-width: 6px;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, #f85f91, #ff7567 48%, #6d9cff);
  box-shadow: 0 12px 22px rgba(248, 95, 145, 0.14);
}

.quick-setup .section-head img {
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.setup-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.setup-step {
  min-height: 148px;
  display: grid;
  gap: 7px;
  justify-items: center;
  align-content: center;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
}

.setup-step strong {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #f85f91;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.setup-step.active strong {
  color: white;
  background: linear-gradient(135deg, #f85f91, #ff7567);
  box-shadow: 0 14px 28px rgba(248, 95, 145, 0.24);
}

.setup-step span {
  font-weight: 850;
}

.setup-step small {
  color: var(--muted);
}

.behavior-card {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
}

.behavior-chips {
  margin: 0;
}

.behavior-chips img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.behavior-chips svg {
  width: 18px;
  height: 18px;
  color: #6d9cff;
}

.panel,
.post-card,
.integration-card,
.activity-item,
.payment-row {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.46)),
    rgba(255, 255, 255, 0.56);
}

.btn.primary {
  background: linear-gradient(135deg, #f85f91, #ff6b63 55%, #f04493);
  box-shadow: 0 18px 38px rgba(248, 95, 145, 0.28);
}

.btn.ghost,
.btn.text {
  background: rgba(255, 255, 255, 0.7);
}

@media (max-width: 1180px) {
  .onboarding-showcase,
  .hero,
  .dashboard-insights {
    grid-template-columns: 1fr;
  }

  .pricing-shell .pricing-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pricing-shell .lifetime-plan {
    grid-column: 1 / -1;
    max-width: 620px;
    justify-self: center;
  }

  .onboarding-image-frame {
    min-height: 520px;
  }

  .hero-illustration {
    min-height: 280px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .shell {
    padding: 12px;
  }

  .onboarding-showcase {
    gap: 14px;
  }

  .onboarding-image-frame {
    min-height: 58vh;
  }

  .onboarding-image-frame img {
    height: 54vh;
  }

  .onboarding-copy,
  .pricing-shell,
  .hero,
  .analytics-panel,
  .quick-setup,
  .behavior-card {
    border-radius: 26px;
    padding: 22px;
  }

  .pricing-title h2 {
    font-size: 36px;
  }

  .pricing-shell .pricing-picker {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .pricing-shell .lifetime-plan {
    grid-column: auto;
    max-width: none;
  }

  .pricing-shell .subscription-plan {
    min-height: auto;
    padding: 24px;
  }

  .pricing-shell .plan-price,
  .pricing-shell .lifetime-plan .plan-price {
    font-size: clamp(42px, 12vw, 56px);
  }

  .pricing-shell .pricing-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .pricing-shell .pricing-head strong {
    max-width: 100%;
    text-align: left;
  }

  .topbar-title,
  .topbar-actions,
  .behavior-card {
    align-items: stretch;
    flex-direction: column;
  }

  .token-pill {
    justify-content: center;
  }

  .hero-illustration {
    min-height: 250px;
  }

  .hero-instagram {
    width: 120px;
    height: 120px;
  }

  .hero-ai {
    width: 170px;
    height: 170px;
  }

  .hero-direct {
    width: 135px;
    height: 135px;
  }

  .setup-progress,
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  h1 {
    font-size: 32px;
    line-height: 1.08;
  }

  .onboarding-copy .brand-row {
    display: grid;
    align-items: flex-start;
  }

  .onboarding-copy .brand-logo {
    width: 116px;
    height: 50px;
    flex-basis: 116px;
  }

  .onboarding-copy h1 {
    font-size: 34px;
    overflow-wrap: normal;
    word-break: normal;
  }

  .onboarding-copy .lead {
    font-size: 16px;
  }

  .onboarding-copy h2 {
    font-size: 28px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .hero-copy h3 {
    font-size: 32px;
  }

  .pricing-title h2 {
    font-size: 32px;
  }

  .pricing-shell .plan-price {
    font-size: 42px;
  }

  .metric {
    min-height: 132px;
  }

  .metric-icon {
    width: 70px;
    height: 70px;
  }

  .decor-icon {
    display: none;
  }
}

/* Reference cabinet pass */
:root {
  --card-radius: 28px;
  --card-shadow: 0 26px 70px rgba(54, 44, 84, 0.12);
  --soft-border: rgba(115, 103, 145, 0.13);
  --hot: #ff4778;
  --hot-2: #d749d2;
  --navy: #111026;
  --blue-strong: #3e78ff;
  --green: #10b981;
}

body {
  background:
    linear-gradient(125deg, rgba(255, 246, 249, 0.92), rgba(248, 251, 255, 0.96) 54%, rgba(255, 250, 247, 0.92)),
    #fbf8fb;
}

.shell::before {
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.22)),
    linear-gradient(90deg, rgba(255, 70, 130, 0.05), rgba(67, 121, 255, 0.05));
  opacity: 1;
}

.glass,
.panel,
.metric,
.post-card,
.integration-card,
.activity-item,
.payment-row {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.62)),
    rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    var(--card-shadow);
  backdrop-filter: blur(26px) saturate(1.12);
}

.app-view {
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 24px;
}

.sidebar {
  padding: 30px 18px;
  border-radius: 28px;
}

.sidebar .brand {
  margin: 0 14px 34px;
  font-size: 20px;
  color: #0f1028;
}

.sidebar .brand svg {
  width: 30px;
  height: 30px;
  color: var(--hot);
}

.nav-item {
  min-height: 58px;
  padding: 15px 18px;
  border-radius: 18px;
  color: #18172e;
  font-size: 15px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.nav-item:hover {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.58);
}

.nav-item.active {
  color: var(--hot);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 250, 0.72));
  border: 1px solid rgba(255, 71, 120, 0.25);
  box-shadow: 0 20px 44px rgba(255, 71, 120, 0.16);
}

.content {
  gap: 24px;
}

.topbar {
  min-height: 100px;
  border-radius: 28px;
  padding: 24px 30px;
}

.topbar h2 {
  margin: 0;
  color: var(--navy);
  font-size: 26px;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--hot);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.token-pill,
.connection-pill,
.saved-pill {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 16px;
  color: #25243d;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(95, 88, 124, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.connection-pill {
  color: #078d55;
  background: rgba(236, 255, 245, 0.82);
  border-color: rgba(16, 185, 129, 0.22);
}

.btn {
  border-radius: 16px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  color: white;
  background: linear-gradient(135deg, #ff5b78, #ec2c83 54%, #d34fd3);
  box-shadow: 0 18px 38px rgba(236, 44, 131, 0.24);
}

.btn.primary:hover {
  box-shadow: 0 24px 52px rgba(236, 44, 131, 0.28);
  filter: saturate(1.05);
}

.btn.ghost {
  color: #19172f;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(95, 88, 124, 0.12);
}

.btn.compact {
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 13px;
}

.btn-brand-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.nav-brand-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex: 0 0 20px;
}

.channel-logo {
  width: 54px;
  height: 54px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 54px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 16px 34px rgba(55, 48, 78, 0.12);
}

.channel-logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.channel-logo.image-logo {
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
}

.channel-logo.image-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.channel-logo.mini {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 11px;
}

.channel-logo.mini img {
  width: 21px;
  height: 21px;
}

.channel-logo.large {
  width: 112px;
  height: 112px;
  flex-basis: 112px;
  border-radius: 28px;
}

.channel-logo.large img {
  width: 64px;
  height: 64px;
}

.channel-logo.hero {
  width: 140px;
  height: 140px;
  flex-basis: 140px;
  border-radius: 34px;
}

.channel-logo.hero img {
  width: 82px;
  height: 82px;
}

.channel-logo.instagram {
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.96), transparent 38%),
    linear-gradient(135deg, rgba(255, 214, 86, 0.9), rgba(255, 64, 128, 0.88) 48%, rgba(89, 91, 255, 0.78));
}

.channel-logo.whatsapp {
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.96), transparent 40%),
    linear-gradient(135deg, rgba(221, 255, 238, 0.95), rgba(38, 211, 103, 0.86));
}

.channel-logo.threads {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.96), transparent 38%),
    linear-gradient(135deg, rgba(33, 36, 52, 0.96), rgba(7, 9, 18, 0.92));
}

.page-title-block {
  padding: 0 28px;
}

.page-title-block h2 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: clamp(34px, 3vw, 46px);
  line-height: 1.04;
  letter-spacing: 0;
}

.page-title-block p {
  margin: 0;
  color: #65617a;
  font-size: 17px;
}

.dashboard-kpis,
.timing-kpis,
.billing-kpis,
.activity-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.timing-kpis {
  grid-template-columns: repeat(4, minmax(210px, 1fr));
}

.metric {
  min-height: 128px;
  border-radius: 22px;
  padding: 22px 26px;
}

.metric.mini {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.metric > i,
.metric.mini > svg {
  width: 62px;
  height: 62px;
  padding: 16px;
  border-radius: 20px;
  color: var(--hot);
  background: linear-gradient(145deg, rgba(255, 242, 246, 0.9), rgba(244, 250, 255, 0.8));
  box-shadow: 0 16px 34px rgba(255, 71, 120, 0.12);
}

.metric span {
  color: #67627c;
  font-size: 13px;
  font-weight: 800;
}

.metric strong {
  color: #10102a;
  font-size: 30px;
  line-height: 1.1;
}

.metric small {
  color: #7d7690;
  font-size: 13px;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
}

.performance-hero,
.tokens-hero {
  min-height: 220px;
  border-radius: 28px;
  padding: 34px 38px;
}

.performance-hero {
  grid-template-columns: minmax(320px, 0.72fr) minmax(420px, 1fr);
}

.performance-hero .hero-copy h3 {
  font-size: 36px;
}

.compact-flow {
  min-height: 210px;
}

.compact-flow .hero-instagram {
  left: 12%;
  top: 28%;
  width: 120px;
  height: 120px;
}

.compact-flow .hero-ai {
  left: 43%;
  top: 5%;
  width: 170px;
  height: 170px;
}

.compact-flow .hero-direct {
  right: 7%;
  top: 27%;
  width: 130px;
  height: 130px;
}

.hero-cube,
.connect-visual-icon,
.timing-hero-art img,
.tokens-hero img,
.token-security-card img,
.ai-ready-card img,
.posts-side-card > img {
  animation: floatIcon 6.5s ease-in-out infinite;
}

.analytics-cards {
  display: grid;
  grid-template-columns: minmax(360px, 1.18fr) minmax(230px, 0.78fr) minmax(300px, 0.98fr) minmax(300px, 0.98fr);
  gap: 18px;
  align-items: stretch;
}

.chart-card {
  min-height: 236px;
  border-radius: 24px;
  overflow: hidden;
}

.wide-chart {
  position: relative;
  overflow: hidden;
}

.chart-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.chart-head h3,
.panel h3 {
  margin: 0;
  color: #12112c;
  font-size: 17px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #6e6880;
  font-size: 12px;
}

.pink-line,
.blue-line {
  width: 18px;
  height: 3px;
  border-radius: 99px;
  background: var(--hot);
}

.blue-line {
  background: var(--blue-strong);
}

.line-chart {
  height: 160px;
  padding-right: 88px;
}

.line-chart svg {
  width: 100%;
  height: 100%;
}

.grid-line {
  fill: none;
  stroke: rgba(37, 34, 62, 0.08);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  filter: drop-shadow(0 10px 14px rgba(255, 71, 120, 0.14));
  stroke-dasharray: 900;
  animation: drawLine 1.2s ease both;
}

.comments-line {
  stroke: var(--hot);
}

.dms-line {
  stroke: var(--blue-strong);
  animation-delay: 120ms;
}

.chart-side-values {
  position: absolute;
  right: 20px;
  top: 90px;
  display: grid;
  gap: 4px;
  width: 74px;
}

.chart-side-values strong {
  color: var(--hot);
  font-size: 26px;
}

.chart-side-values span {
  color: #148a57;
  font-size: 13px;
}

.bar-chart {
  height: 150px;
  align-items: end;
}

.bar-chart .chart-bar {
  background: linear-gradient(180deg, rgba(255, 112, 130, 0.92), rgba(255, 112, 112, 0.64));
  border: 1px solid rgba(255, 92, 112, 0.25);
  animation: growBar 520ms ease both;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.donut {
  width: 136px;
  height: 136px;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, white 0 44%, transparent 45%),
    conic-gradient(var(--donut-segments, #e5e8f4 0% 100%));
  box-shadow: 0 22px 46px rgba(109, 156, 255, 0.15);
}

.donut strong {
  display: block;
  color: #181631;
  font-size: 24px;
}

.donut span {
  color: #77718a;
  font-size: 12px;
}

.donut-legend {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #615b76;
  font-size: 13px;
}

.donut-legend li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.donut-legend b {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--legend-color, #ff6d9b);
}

.donut-legend span,
.donut-legend em {
  min-width: 0;
  font-style: normal;
}

.donut-legend span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donut-legend em {
  margin-left: auto;
  color: #3c3852;
  font-weight: 800;
}

.area-chart {
  min-height: 150px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(62, 120, 255, 0.2), rgba(62, 120, 255, 0.02)),
    repeating-linear-gradient(0deg, transparent 0 35px, rgba(17, 16, 38, 0.06) 36px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(240, 247, 255, 0.8));
  position: relative;
  overflow: hidden;
}

.area-chart::before {
  content: "";
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: 30%;
  height: 80px;
  border: 4px solid var(--blue-strong);
  border-color: var(--blue-strong) transparent transparent transparent;
  border-radius: 50%;
  opacity: 0.72;
}

.area-chart.tall {
  min-height: 230px;
}

.dashboard-bottom {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(300px, 1.05fr) minmax(300px, 1.08fr);
  gap: 16px;
}

.table-card,
.conversion-card {
  border-radius: 24px;
}

.mini-table {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.mini-table > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px 54px 58px;
  gap: 8px;
  align-items: center;
  min-height: 54px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
}

.mini-table span {
  color: #302c45;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-table b:last-child,
.conversion-row b {
  color: #0ca766;
}

.link-row {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  color: #2463d9;
  background: transparent;
  font-weight: 800;
}

.activity-item[role="button"] {
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.activity-item[role="button"]:hover,
.activity-item[role="button"]:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 34px rgba(61, 56, 86, 0.08);
  outline: 0;
}

.conversion-row {
  min-height: 74px;
  display: grid;
  grid-template-columns: 48px minmax(58px, 0.55fr) minmax(0, 1fr) minmax(82px, auto);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.6);
}

.conversion-row + .conversion-row {
  margin-top: 10px;
}

.conversion-row svg {
  width: 44px;
  height: 44px;
  padding: 11px;
  border-radius: 16px;
  color: var(--hot);
  background: rgba(255, 241, 245, 0.9);
}

.conversion-row span,
.conversion-row b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversion-row b {
  font-size: 12px;
  text-align: right;
}

.connect-grid-ref {
  display: grid;
  grid-template-columns: minmax(420px, 1.55fr) minmax(340px, 0.95fr);
  gap: 22px;
  align-items: stretch;
}

.connect-visual-card {
  min-height: 290px;
  position: relative;
  overflow: hidden;
}

.connect-visual-icon {
  position: absolute;
  width: 190px;
  height: 190px;
  object-fit: contain;
  filter: drop-shadow(0 28px 44px rgba(99, 100, 150, 0.17));
}

.connect-visual-icon.left {
  left: 9%;
  top: 18%;
}

.connect-visual-icon.right {
  right: 8%;
  top: 18%;
  animation-delay: -1.5s;
}

.security-shield {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 136px;
  height: 136px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  color: #4e86ff;
  border-radius: 36px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(236, 246, 255, 0.66));
  box-shadow: inset 0 1px 0 white, 0 24px 54px rgba(78, 134, 255, 0.16);
}

.security-shield svg {
  width: 52px;
  height: 52px;
}

.connect-line {
  position: absolute;
  top: 48%;
  width: 30%;
  height: 8px;
  border-radius: 999px;
}

.connect-line.pink {
  left: 24%;
  background: linear-gradient(90deg, transparent, rgba(255, 71, 120, 0.64));
}

.connect-line.blue {
  right: 24%;
  background: linear-gradient(90deg, rgba(78, 134, 255, 0.56), transparent);
}

.connect-status-card {
  min-height: 290px;
  display: grid;
  align-content: center;
  gap: 16px;
}

.connect-status-card > span {
  color: #6f6881;
}

.connect-status-card strong {
  color: var(--hot);
  font-size: 30px;
}

.connect-status-card strong.connected {
  color: #10a76a;
}

.connect-status-card .xl {
  width: fit-content;
  min-height: 62px;
  padding-inline: 28px;
  border-radius: 17px;
}

.whatsapp-status-card {
  background:
    radial-gradient(circle at 20% 18%, rgba(37, 211, 102, 0.12), transparent 34%),
    radial-gradient(circle at 95% 8%, rgba(255, 63, 120, 0.12), transparent 28%),
    rgba(255, 255, 255, 0.82);
}

.whatsapp-status-card strong.connected {
  color: #0ca76c;
}

.whatsapp-connect-btn {
  background: linear-gradient(135deg, #25d366, #18b86c 45%, #2cc5d7);
  box-shadow: 0 18px 38px rgba(37, 211, 102, 0.24);
}

.whatsapp-details {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.whatsapp-details span {
  display: block;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  color: #585169;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(214, 218, 234, 0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-status {
  padding: 12px;
  border-radius: 16px;
  box-shadow: none;
}

.compact-status h4 {
  margin: 8px 0 4px;
}

.compact-warning {
  color: #ff3f78;
  font-size: 0.78rem;
  line-height: 1.35;
}

.permissions-card,
.checklist-card,
.token-security-card {
  min-height: 0;
}

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

.permission-grid div {
  min-height: 92px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 6px 14px;
  align-content: center;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.permission-grid svg {
  grid-row: span 2;
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: 14px;
  color: var(--hot);
  background: rgba(255, 239, 245, 0.86);
}

.permission-grid strong,
.vertical-steps strong {
  color: #17152e;
}

.permission-grid span,
.vertical-steps span {
  color: #6f6881;
  font-size: 13px;
}

.vertical-steps {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.vertical-steps > div {
  display: grid;
  grid-template-columns: 48px 30px minmax(0, 1fr);
  gap: 12px 14px;
  align-items: start;
}

.vertical-steps b {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, #ff6a83, #ea2d82);
  box-shadow: 0 16px 34px rgba(234, 45, 130, 0.22);
}

.vertical-steps svg {
  color: var(--hot);
  margin-top: 8px;
}

.vertical-steps span {
  grid-column: 3;
  line-height: 1.42;
}

.token-security-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 22px;
  align-content: center;
  align-items: center;
  text-align: left;
  background: linear-gradient(145deg, rgba(250, 253, 255, 0.92), rgba(239, 247, 255, 0.72));
  border-color: rgba(109, 156, 255, 0.2);
}

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

.connect-visual-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(360px, 0.78fr);
  gap: 34px;
  align-items: center;
  min-height: 330px;
  padding: 42px;
  background:
    radial-gradient(circle at 18% 45%, rgba(255, 65, 132, 0.12), transparent 34%),
    radial-gradient(circle at 86% 24%, rgba(70, 135, 255, 0.13), transparent 32%),
    rgba(255, 255, 255, 0.82);
}

.connect-hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 18px;
  max-width: 620px;
}

.connect-hero-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 14px;
  color: var(--hot);
  font-size: 13px;
  font-weight: 850;
  background: rgba(255, 244, 249, 0.86);
  border: 1px solid rgba(255, 71, 120, 0.16);
}

.badge-brand-icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 18px;
  object-fit: contain;
}

.connect-hero-copy h3,
.channel-hero-copy h3 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(32px, 3.2vw, 52px);
  line-height: 1.06;
  letter-spacing: 0;
}

.connect-hero-copy p,
.channel-hero-copy p {
  margin: 0;
  max-width: 560px;
  color: #67617d;
  font-size: 17px;
  line-height: 1.65;
}

.connect-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.connect-hero-pills span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 14px;
  color: #2f3a66;
  font-size: 13px;
  font-weight: 850;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(95, 88, 124, 0.08);
}

.channel-logo-cloud {
  position: relative;
  z-index: 2;
  min-height: 230px;
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 22px;
  align-items: start;
  justify-items: center;
}

.channel-logo-cloud .channel-logo:nth-child(2) {
  margin-top: 80px;
}

.channel-logo-cloud .channel-logo:nth-child(3) {
  margin-top: 22px;
}

.connect-visual-card .security-shield {
  left: auto;
  right: 15%;
  top: 66%;
  width: 108px;
  height: 108px;
  border-radius: 28px;
  color: #d944d7;
}

.connect-visual-card .security-shield svg {
  width: 42px;
  height: 42px;
}

.connect-flow-caption {
  position: absolute;
  right: 38px;
  bottom: 30px;
  z-index: 3;
  display: grid;
  gap: 2px;
  padding: 12px 15px;
  border-radius: 16px;
  color: #514b67;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 42px rgba(59, 54, 84, 0.12);
}

.connect-flow-caption span {
  color: var(--hot);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.connect-composition-frame {
  position: relative;
  z-index: 2;
  justify-self: end;
  width: min(100%, 560px);
  overflow: hidden;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 26px 70px rgba(87, 76, 128, 0.14);
}

.connect-composition-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.channel-connect-card {
  align-content: stretch;
  min-height: 330px;
}

.channel-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #3b3650;
  font-weight: 900;
}

.threads-status-card {
  background:
    radial-gradient(circle at 18% 18%, rgba(50, 50, 72, 0.12), transparent 35%),
    radial-gradient(circle at 95% 8%, rgba(79, 134, 255, 0.13), transparent 28%),
    rgba(255, 255, 255, 0.82);
}

.threads-connect-btn {
  background: linear-gradient(135deg, #1d2233, #3b4264 52%, #5a8cff);
  box-shadow: 0 18px 38px rgba(50, 61, 100, 0.22);
}

.page-heading-actions {
  align-items: start;
  margin-bottom: 6px;
}

.page-heading-actions .page-title-block {
  padding: 0;
}

.channel-page-hero {
  position: relative;
  min-height: 280px;
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(340px, 0.7fr);
  gap: 28px;
  align-items: center;
  overflow: hidden;
  padding: 36px 40px;
}

.whatsapp-page-hero {
  background:
    radial-gradient(circle at 28% 48%, rgba(37, 211, 102, 0.12), transparent 35%),
    radial-gradient(circle at 92% 26%, rgba(93, 164, 255, 0.16), transparent 32%),
    rgba(255, 255, 255, 0.82);
}

.instagram-page-hero {
  background:
    radial-gradient(circle at 28% 48%, rgba(255, 71, 120, 0.12), transparent 35%),
    radial-gradient(circle at 92% 26%, rgba(93, 164, 255, 0.15), transparent 32%),
    rgba(255, 255, 255, 0.82);
}

.threads-page-hero {
  background:
    radial-gradient(circle at 26% 46%, rgba(255, 65, 132, 0.12), transparent 35%),
    radial-gradient(circle at 92% 26%, rgba(99, 126, 255, 0.16), transparent 32%),
    rgba(255, 255, 255, 0.82);
}

.channel-hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 16px;
}

.whatsapp-badge {
  color: #0f9a62;
  background: rgba(230, 255, 241, 0.88);
  border-color: rgba(37, 211, 102, 0.18);
}

.threads-badge {
  color: var(--hot);
}

.channel-hero-art {
  position: relative;
  min-height: 220px;
  display: grid;
  place-items: center;
}

.channel-hero-image {
  display: block;
  width: min(100%, 560px);
  height: auto;
  border-radius: 26px;
  object-fit: contain;
  filter: drop-shadow(0 28px 54px rgba(91, 75, 142, 0.16));
}

.ai-cube {
  position: absolute;
  right: 18px;
  top: 34px;
  width: 138px;
  height: 138px;
  display: grid;
  place-items: center;
  border-radius: 30px;
  color: #da50d6;
  font-size: 44px;
  font-weight: 950;
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.94), transparent 38%),
    linear-gradient(145deg, rgba(255, 224, 252, 0.8), rgba(226, 234, 255, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 white, 0 24px 54px rgba(127, 82, 205, 0.18);
}

.hero-link-line {
  position: absolute;
  left: 44%;
  width: 34%;
  height: 10px;
  border-radius: 999px;
  opacity: 0.72;
}

.hero-link-line.one {
  top: 88px;
  background: linear-gradient(90deg, rgba(37, 211, 102, 0.55), rgba(68, 173, 255, 0.44));
}

.hero-link-line.two {
  top: 132px;
  background: linear-gradient(90deg, rgba(255, 65, 132, 0.42), rgba(89, 121, 255, 0.52));
}

.channel-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.channel-kpis .metric {
  min-height: 118px;
}

.channel-kpis .metric > i {
  width: 54px;
  height: 54px;
  padding: 15px;
  border-radius: 16px;
  color: #2e6fec;
  background: rgba(239, 246, 255, 0.9);
  box-shadow: 0 16px 30px rgba(68, 112, 210, 0.12);
}

.empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 24px;
  color: #77718a;
  text-align: center;
  border: 1px dashed rgba(95, 88, 124, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
}

.empty-state svg {
  width: 34px;
  height: 34px;
  color: var(--hot);
}

.empty-state.table-empty,
.empty-state.compact-empty,
.empty-state.billing-empty,
.empty-state.errors-empty {
  min-height: 76px;
  grid-template-columns: auto minmax(0, 1fr);
  justify-content: start;
  place-items: center start;
  text-align: left;
}

.posts-empty {
  grid-column: 1 / -1;
  min-height: 260px;
}

.token-security-card img {
  width: 132px;
  height: 132px;
  object-fit: contain;
  justify-self: center;
}

.token-security-card svg {
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 14px;
  color: #2d6eea;
  background: white;
}

.safe-note {
  padding: 0 28px;
  color: #6f6881;
}

.posts-toolbar {
  align-items: center;
}

.toolbar-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search-wrap {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(95, 88, 124, 0.13);
}

.search-wrap input {
  border: 0;
  background: transparent;
  box-shadow: none;
  min-width: 220px;
}

.posts-layout-ref {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
}

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

.ref-post {
  min-height: 340px;
  padding: 16px;
  gap: 12px;
  border-radius: 22px;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.ref-post:hover {
  transform: translateY(-3px);
  box-shadow: 0 32px 76px rgba(54, 44, 84, 0.16);
}

.ref-post.demo-card {
  cursor: default;
}

.post-thumb {
  position: relative;
  height: 150px;
  overflow: hidden;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 222, 232, 0.9), rgba(235, 245, 255, 0.92)),
    rgba(255, 255, 255, 0.8);
}

.post-thumb > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
  transform: scale(1.02);
}

.post-thumb span {
  position: absolute;
  left: 12px;
  top: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: white;
  box-shadow: 0 10px 22px rgba(255, 71, 120, 0.18);
}

.post-thumb span img {
  width: 22px;
  height: 22px;
}

.post-thumb time {
  position: absolute;
  right: 12px;
  top: 12px;
  max-width: 120px;
  color: #32314d;
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.ref-post h4 {
  margin: 4px 0 0;
  color: #222038;
  font-size: 15px;
  line-height: 1.35;
}

.ref-post p {
  min-height: 42px;
  margin: 0;
  color: #4c4865;
  line-height: 1.45;
}

.post-card-footer,
.post-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.post-card-footer {
  padding-top: 10px;
  border-top: 1px solid rgba(95, 88, 124, 0.08);
}

.post-card-footer > span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #4d4860;
  font-size: 13px;
}

.toggle-on,
.toggle-off {
  width: 34px;
  height: 20px;
  position: relative;
  display: inline-block;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff5b78, #ec2c83);
}

.toggle-off {
  background: #d4d7e2;
}

.toggle-on::after,
.toggle-off::after {
  content: "";
  position: absolute;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
}

.toggle-on::after {
  right: 3px;
}

.toggle-off::after {
  left: 3px;
}

.post-card-footer small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.post-card-footer small.ready {
  color: #007a5c;
  background: rgba(223, 250, 239, 0.9);
}

.post-card-footer small.warn {
  color: #d36b12;
  background: rgba(255, 244, 230, 0.92);
}

.post-card-actions small,
.post-comments-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #77718a;
}

.post-comments-action {
  min-width: 0;
  padding: 6px 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.post-comments-action span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-comments-action:hover,
.post-comments-action:focus-visible {
  color: var(--hot);
  outline: none;
}

.post-comments-action:focus-visible span {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.posts-side-card {
  display: grid;
  align-content: start;
  gap: 18px;
}

.posts-side-card > img {
  width: 190px;
  height: 190px;
  object-fit: contain;
  justify-self: center;
}

.post-side-stat {
  min-height: 86px;
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 2px 16px;
  align-content: center;
  padding: 15px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.post-side-stat svg {
  grid-row: span 2;
  width: 54px;
  height: 54px;
  padding: 14px;
  border-radius: 16px;
  color: var(--hot);
  background: rgba(255, 241, 245, 0.9);
}

.post-side-stat strong {
  color: #111026;
  font-size: 28px;
}

.info-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  color: #2b61c9;
  background: rgba(239, 246, 255, 0.86);
}

.pager-line {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  color: #77718a;
}

.pager-line button,
.pager-line b {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(95, 88, 124, 0.1);
}

.ai-layout-ref {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.ai-main-column {
  display: grid;
  gap: 18px;
}

.form-card,
.ai-option-card,
.ai-ready-card {
  border-radius: 24px;
}

.form-card h3,
.ai-option-card h3 {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-card h3 svg,
.ai-option-card h3 svg {
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: 14px;
  color: var(--hot);
  background: rgba(255, 241, 245, 0.9);
}

.input-with-icon span {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.input-with-icon svg {
  flex: 0 0 22px;
  color: #2d6eea;
}

.hidden-fields {
  display: none;
}

.prompt-card-ref textarea {
  min-height: 164px;
  border-color: rgba(255, 71, 120, 0.24);
}

.ai-ready-card {
  display: grid;
  place-items: center;
  text-align: center;
}

.ai-ready-card img {
  width: 230px;
  height: 230px;
  object-fit: contain;
}

.ai-ready-card h3 {
  color: #088553;
  font-size: 26px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.chip-row button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 14px;
  color: #342f48;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(255, 71, 120, 0.14);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.chip-row button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 71, 120, 0.34);
  box-shadow: 0 14px 34px rgba(233, 30, 99, 0.14);
}

.chip-row button.active {
  color: #fff;
  border-color: rgba(255, 71, 120, 0.7);
  background: linear-gradient(135deg, #ff5b78, #d72fd8);
  box-shadow: 0 16px 34px rgba(233, 30, 99, 0.22);
}

.chip-row button:focus-visible {
  outline: 3px solid rgba(65, 105, 225, 0.28);
  outline-offset: 2px;
}

.ai-option-card {
  min-height: 150px;
}

.switch-row {
  width: 100%;
  justify-content: space-between;
  gap: 18px;
  min-height: 48px;
  padding: 10px 0;
}

.switch-row > span {
  display: grid;
  min-width: 0;
  gap: 3px;
  color: #51485f;
  font-weight: 800;
  line-height: 1.25;
}

.switch-row > span small {
  display: block;
  color: #817790;
  font-size: 12px;
  font-weight: 650;
}

.switch-row input[type="checkbox"] {
  appearance: none;
  flex: 0 0 48px;
  width: 48px;
  min-width: 48px;
  height: 28px;
  border-radius: 999px;
  border: 0;
  background: #d5dae8;
  position: relative;
  cursor: pointer;
  box-shadow:
    inset 0 1px 4px rgba(32, 24, 48, 0.16),
    0 10px 24px rgba(40, 45, 80, 0.08);
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

.switch-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 4px 12px rgba(38, 29, 55, 0.18);
  transition: transform 160ms ease;
}

.switch-row input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #ff5b78, #ec2c83);
}

.switch-row input[type="checkbox"]:checked::after {
  transform: translateX(20px);
}

.channel-service-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.channel-service-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(95, 88, 124, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.instagram-service-card {
  border-color: rgba(255, 71, 120, 0.16);
}

.whatsapp-service-card {
  border-color: rgba(37, 211, 102, 0.18);
}

.threads-service-card {
  border-color: rgba(47, 52, 76, 0.16);
}

.channel-service-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
}

.channel-service-head strong,
.channel-service-head small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-service-head strong {
  color: var(--navy);
}

.channel-service-head small {
  color: #7d758b;
  font-size: 12px;
}

.channel-service-head input[type="checkbox"] {
  appearance: none;
  width: 48px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #d5dae8;
  position: relative;
  cursor: pointer;
  box-shadow: inset 0 1px 4px rgba(32, 24, 48, 0.16);
}

.channel-service-head input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 6px 12px rgba(32, 24, 48, 0.16);
  transition: transform 160ms ease;
}

.channel-service-head input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #ff5b78, #d72fd8);
}

.channel-service-head input[type="checkbox"]:checked::after {
  transform: translateX(20px);
}

.compact-service-grid {
  gap: 10px;
}

.channel-service-card label {
  color: #51485f;
  font-size: 12px;
  font-weight: 850;
}

.channel-service-card input,
.channel-service-card select,
.channel-service-card textarea {
  margin-top: 6px;
}

.switch-row input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(65, 105, 225, 0.28);
  outline-offset: 3px;
}

.save-bar-ref {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  border-radius: 22px;
}

.save-bar-ref > span:first-child {
  margin-right: auto;
  min-width: 0;
}

.save-bar-ref .form-status,
.save-bar-ref .saved-pill {
  white-space: nowrap;
}

.timing-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timing-hero-art {
  min-height: 132px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  flex: 1;
}

.timing-hero-art img {
  width: 128px;
  height: 128px;
  object-fit: contain;
  margin-left: -18px;
}

.timing-layout-ref {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(340px, 1fr);
  gap: 18px;
}

.delay-card label {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(180px, 1fr) minmax(120px, auto);
  gap: 16px;
  align-items: center;
  margin-top: 22px;
}

.delay-card label > span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.range-line {
  width: 100%;
  accent-color: var(--hot);
}

.safety-card {
  display: grid;
  gap: 18px;
}

.limit-row {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(95, 88, 124, 0.08);
}

.limit-row b {
  min-width: 150px;
  height: 42px;
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(95, 88, 124, 0.1);
}

.limit-row button {
  color: #4860a2;
  background: transparent;
  font-weight: 900;
  min-width: 28px;
}

.limit-row input {
  width: 76px;
  min-height: 34px;
  padding: 4px 8px;
  border: 0;
  color: #15142d;
  background: transparent;
  text-align: center;
  font: inherit;
  font-weight: 800;
}

.quiet-timeline {
  height: 54px;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  align-items: center;
  margin: 24px 0;
}

.quiet-timeline span,
.quiet-timeline b {
  height: 28px;
  border-radius: 8px;
  background: rgba(109, 156, 255, 0.22);
}

.quiet-timeline b {
  background: rgba(109, 156, 255, 0.46);
}

.handoff-card .switch-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.54);
}

.handoff-card .switch-row span {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 2px 12px;
  min-width: 0;
}

.handoff-card .switch-row svg {
  grid-row: span 2;
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: 13px;
  color: var(--hot);
  background: rgba(255, 241, 245, 0.9);
}

.handoff-card small {
  color: #77718a;
  line-height: 1.36;
}

.tokens-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(280px, 0.6fr) minmax(260px, 0.6fr);
  align-items: center;
  overflow: hidden;
}

.tokens-hero h3 {
  margin: 0;
  font-size: 18px;
}

.tokens-hero strong#billingTokens {
  display: block;
  margin: 8px 0;
  color: #111026;
  font-size: 58px;
  line-height: 0.95;
}

.tokens-hero img {
  width: 260px;
  height: 190px;
  justify-self: end;
  object-fit: contain;
}

.billing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.usage-meter {
  display: grid;
  gap: 8px;
}

.usage-meter b {
  width: min(100%, 330px);
  height: 10px;
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(30, 34, 56, 0.12);
}

.usage-meter i {
  display: block;
  width: 30%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2e7bff, #75a6ff);
}

.usage-meter strong {
  font-size: 18px;
}

.tokens-layout-ref {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(420px, 1.08fr) minmax(260px, 0.62fr);
  gap: 18px;
}

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

.token-split span {
  padding: 13px;
  border-radius: 14px;
  color: #6f6881;
  background: rgba(255, 255, 255, 0.58);
}

.token-split b {
  display: block;
  margin-top: 5px;
  color: #1c1a35;
}

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

.visual-packs .package {
  min-height: 210px;
  align-content: end;
  justify-items: center;
  text-align: center;
  position: relative;
}

.visual-packs .package img {
  width: 96px;
  height: 76px;
  object-fit: contain;
}

.visual-packs .package strong {
  font-size: 26px;
}

.visual-packs .package b {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  color: white;
  background: var(--hot);
  font-size: 10px;
}

.subscription-ref {
  text-align: center;
}

.subscription-ref img {
  width: 118px;
  height: 118px;
  object-fit: contain;
}

.subscription-ref > strong {
  display: block;
  color: var(--hot);
  font-size: 30px;
}

.billing-table {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(95, 88, 124, 0.09);
  border-radius: 16px;
}

.billing-table .payment-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.75fr) minmax(120px, 0.75fr) minmax(240px, 1.45fr) minmax(100px, 0.7fr) minmax(110px, 0.7fr) minmax(130px, 0.8fr);
  gap: 14px;
  align-items: center;
  min-height: 54px;
  padding: 12px 16px;
  border-radius: 0;
  box-shadow: none;
  border: 0;
  border-bottom: 1px solid rgba(95, 88, 124, 0.08);
}

.payment-row b {
  justify-self: start;
  min-width: 72px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #07965d;
  background: rgba(219, 249, 235, 0.92);
  text-align: center;
}

.payment-row span,
.payment-row strong,
.payment-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-open {
  overflow: hidden;
}

.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 28px;
}

.detail-modal.hidden {
  display: none;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 18, 41, 0.38);
  backdrop-filter: blur(14px);
}

.detail-card {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 32px));
  max-height: min(82vh, 760px);
  overflow: auto;
  padding: 28px;
  border-radius: 30px;
  box-shadow: 0 30px 90px rgba(34, 29, 58, 0.24);
}

.detail-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #25243d;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(95, 88, 124, 0.12);
}

.detail-head {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding-right: 44px;
}

.detail-head h3 {
  margin: 2px 0 4px;
  color: #15142a;
  font-size: clamp(22px, 3vw, 30px);
}

.detail-head small {
  display: block;
  color: var(--muted);
  line-height: 1.5;
}

.detail-body {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.detail-block {
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(95, 88, 124, 0.1);
}

.detail-block h4 {
  margin: 0 0 8px;
  color: #5f587c;
  font-size: 12px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-block p {
  margin: 0;
  color: #1d1a34;
  font-weight: 650;
  line-height: 1.55;
  white-space: pre-wrap;
}

.detail-block.reply-block {
  background: linear-gradient(135deg, rgba(255, 237, 244, 0.9), rgba(235, 244, 255, 0.9));
  border-color: rgba(255, 72, 132, 0.18);
}

.detail-block.reason-block p,
.detail-block.muted-block p {
  color: #5f587c;
  font-weight: 600;
}

.detail-modal[data-mode="post-comments"] .detail-card {
  width: min(980px, calc(100vw - 32px));
}

.post-comments-list {
  max-height: min(64vh, 640px);
  display: grid;
  gap: 14px;
  overflow: auto;
  padding-right: 4px;
}

.post-comment-thread {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(95, 88, 124, 0.1);
}

.post-comment-thread-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(95, 88, 124, 0.08);
}

.post-comment-thread-title span {
  color: #15142a;
  font-weight: 900;
}

.post-comment-thread-title small {
  color: #77718a;
  font-weight: 800;
}

.post-comment-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.post-comment-row.child {
  margin-left: 28px;
  padding-left: 16px;
  border-left: 2px solid rgba(255, 72, 132, 0.16);
}

.post-comment-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: var(--hot);
  font-weight: 950;
  background: linear-gradient(145deg, rgba(255, 242, 246, 0.96), rgba(244, 250, 255, 0.86));
  border: 1px solid rgba(255, 72, 132, 0.12);
  box-shadow: 0 14px 32px rgba(255, 72, 132, 0.12);
}

.post-comment-content {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.post-comment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.post-comment-head strong {
  min-width: 0;
  color: #15142a;
  overflow-wrap: anywhere;
}

.post-comment-head small {
  flex: 0 1 auto;
  color: #77718a;
  font-size: 12px;
  text-align: right;
  overflow-wrap: anywhere;
}

.post-comment-text {
  margin: 0;
  color: #292640;
  font-weight: 650;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment-reply-block {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(245, 248, 255, 0.82);
  border: 1px solid rgba(83, 126, 255, 0.13);
}

.comment-reply-block.public {
  background: linear-gradient(135deg, rgba(255, 241, 247, 0.92), rgba(255, 250, 252, 0.86));
  border-color: rgba(255, 72, 132, 0.18);
}

.comment-reply-block.private {
  background: linear-gradient(135deg, rgba(238, 246, 255, 0.94), rgba(248, 252, 255, 0.9));
  border-color: rgba(83, 126, 255, 0.18);
}

.comment-reply-block.muted {
  color: #77718a;
  background: rgba(255, 255, 255, 0.64);
  border-style: dashed;
}

.comment-reply-block strong {
  color: #5f587c;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.comment-reply-block p {
  margin: 0;
  color: #1d1a34;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.post-comment-reason {
  color: #77718a;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.activity-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(420px, 1fr) auto;
  gap: 20px;
  align-items: center;
}

.segmented-select {
  min-height: 48px;
  border-radius: 16px;
}

.activity-layout-ref {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.78fr);
  gap: 18px;
}

.activity-side-stack {
  display: grid;
  gap: 18px;
}

.activity-list {
  gap: 0;
}

.chats-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(220px, 0.34fr);
  gap: 16px;
  align-items: center;
}

.chats-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.34fr) minmax(0, 1fr) minmax(280px, 0.31fr);
  gap: 18px;
  align-items: start;
}

.chats-list-panel,
.chat-detail-panel {
  min-height: 680px;
}

.chats-list {
  display: grid;
  gap: 10px;
}

.chat-row {
  width: 100%;
  border: 1px solid rgba(95, 88, 124, 0.1);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.62);
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  color: var(--navy);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.chat-row:hover,
.chat-row.active {
  border-color: rgba(238, 50, 128, 0.36);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 36px rgba(238, 50, 128, 0.1);
  transform: translateY(-1px);
}

.chat-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--hot);
  font-weight: 900;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.96), rgba(255, 242, 248, 0.8)),
    linear-gradient(135deg, rgba(255, 78, 132, 0.16), rgba(84, 135, 255, 0.14));
  box-shadow: inset 0 0 0 1px rgba(238, 50, 128, 0.14);
}

.chat-row b,
.chat-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-row b {
  white-space: nowrap;
  font-size: 15px;
}

.chat-row small {
  color: #7a728c;
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.chat-row em {
  color: #918aa0;
  font-style: normal;
  font-size: 12px;
  justify-self: end;
  white-space: nowrap;
}

.chat-status-dot {
  grid-column: 2 / 4;
  justify-self: start;
  font-size: 11px;
  line-height: 1;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(238, 50, 128, 0.08);
  color: var(--hot);
}

.chat-status-active {
  background: rgba(220, 250, 237, 0.9);
  color: #078154;
}

.chat-status-manual,
.chat-status-disabled {
  background: rgba(255, 242, 230, 0.95);
  color: #c9650e;
}

.chat-status-important {
  background: rgba(244, 235, 255, 0.95);
  color: #7b47d9;
}

.chat-avatar.channel-whatsapp {
  color: #0f9a62;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.96), rgba(230, 255, 241, 0.82)),
    linear-gradient(135deg, rgba(37, 211, 102, 0.18), rgba(70, 170, 255, 0.12));
  box-shadow: inset 0 0 0 1px rgba(37, 211, 102, 0.2);
}

.chat-avatar.channel-threads {
  color: #1d2233;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.96), rgba(239, 240, 247, 0.82)),
    linear-gradient(135deg, rgba(39, 43, 64, 0.15), rgba(255, 71, 120, 0.1));
  box-shadow: inset 0 0 0 1px rgba(39, 43, 64, 0.18);
}

.channel-side-panel {
  min-height: 680px;
  display: grid;
  align-content: start;
  gap: 16px;
}

.channel-side-panel .section-head svg {
  width: 36px;
  height: 36px;
  padding: 9px;
  border-radius: 12px;
  color: var(--hot);
  background: rgba(255, 241, 247, 0.9);
}

.action-stack,
.quick-template-list,
.rule-list {
  display: grid;
  gap: 9px;
}

.action-stack button,
.quick-template-list > button,
.rule-list button {
  min-height: 44px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  color: #2f2b45;
  text-align: left;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(95, 88, 124, 0.08);
  cursor: pointer;
}

.quick-template-list > button {
  grid-template-columns: 28px minmax(0, 1fr);
}

.rule-list button {
  grid-template-columns: 28px minmax(0, 0.56fr) minmax(0, 0.9fr);
}

.action-stack svg,
.quick-template-list > button svg,
.rule-list svg {
  width: 20px;
  height: 20px;
  color: #2f6fed;
}

.action-stack button:hover,
.quick-template-list > button:hover,
.rule-list button:hover {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 30px rgba(65, 54, 90, 0.08);
}

.mini-insight-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(95, 88, 124, 0.08);
}

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

.insight-metrics span,
.profile-stats span {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: #77718a;
  font-size: 12px;
}

.insight-metrics b,
.profile-stats b {
  color: var(--navy);
  font-size: 20px;
}

.mini-area-chart,
.mini-line-chart {
  min-height: 78px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(235, 250, 241, 0.72), rgba(255, 255, 255, 0.38));
}

.mini-area-chart span,
.mini-line-chart span {
  min-height: 12px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, #25d366, rgba(37, 211, 102, 0.24));
}

.mini-chart-empty {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  color: #8a8498;
  font-size: 12px;
  font-style: normal;
  text-align: center;
}

.bar-chart .mini-chart-empty {
  min-width: 100%;
}

.mini-area-chart.is-empty,
.mini-line-chart.is-empty {
  align-items: center;
}

.mini-area-chart span:nth-child(1) { height: 18px; }
.mini-area-chart span:nth-child(2) { height: 28px; }
.mini-area-chart span:nth-child(3) { height: 42px; }
.mini-area-chart span:nth-child(4) { height: 50px; }
.mini-area-chart span:nth-child(5) { height: 48px; }
.mini-area-chart span:nth-child(6) { height: 62px; }

.threads-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.82fr) minmax(300px, 0.62fr);
  gap: 18px;
  align-items: start;
}

.threads-posts-panel {
  grid-column: span 2;
}

.threads-post-list,
.threads-reply-queue,
.threads-activity-list {
  display: grid;
  gap: 12px;
}

.threads-post-row,
.queue-row,
.activity-mini-row {
  display: grid;
  gap: 10px;
  align-items: center;
  padding: 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(95, 88, 124, 0.08);
}

.threads-post-row {
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
}

.threads-post-row strong,
.queue-row strong {
  display: block;
  color: var(--navy);
}

.threads-post-row p,
.queue-row p {
  margin: 2px 0 0;
  color: #5d5870;
  line-height: 1.45;
}

.threads-post-row small,
.queue-row small,
.activity-mini-row small {
  color: #8b8496;
  white-space: nowrap;
}

.threads-post-row b {
  color: #3e4462;
  font-size: 12px;
}

.queue-row {
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

.threads-insights-panel,
.threads-profile-panel,
.threads-rules-panel,
.threads-activity-panel {
  display: grid;
  gap: 16px;
}

.insight-main {
  display: grid;
  gap: 4px;
}

.insight-main strong {
  color: var(--navy);
  font-size: 34px;
}

.mini-line-chart {
  background: linear-gradient(180deg, rgba(255, 241, 248, 0.72), rgba(255, 255, 255, 0.38));
}

.mini-line-chart span {
  background: linear-gradient(180deg, #ff4f8a, rgba(87, 128, 255, 0.24));
}

.mini-line-chart span:nth-child(1) { height: 52px; }
.mini-line-chart span:nth-child(2) { height: 34px; }
.mini-line-chart span:nth-child(3) { height: 40px; }
.mini-line-chart span:nth-child(4) { height: 58px; }
.mini-line-chart span:nth-child(5) { height: 38px; }
.mini-line-chart span:nth-child(6) { height: 54px; }
.mini-line-chart span:nth-child(7) { height: 46px; }

.interaction-bars {
  display: grid;
  gap: 10px;
}

.interaction-bars label {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
  color: #5c566e;
  font-size: 13px;
}

.interaction-bars span {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(231, 234, 244, 0.9);
}

.interaction-bars b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff5c8d, #5a86ff);
}

.interaction-bars em {
  color: #77718a;
  font-style: normal;
  text-align: right;
}

.activity-mini-row {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.activity-mini-row svg {
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 12px;
  color: #2f6fed;
  background: rgba(239, 246, 255, 0.9);
}

.threads-profile-card {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.chat-detail-empty {
  min-height: 520px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
  color: #756e86;
}

.chat-detail-empty > svg {
  width: 72px;
  height: 72px;
  color: var(--hot);
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 240, 247, 0.88);
}

.chat-detail-content {
  display: grid;
  gap: 16px;
}

.chat-detail-head {
  align-items: start;
  gap: 14px;
}

.chat-detail-head small {
  color: #7a728c;
  font-weight: 650;
}

.chat-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.48fr);
  gap: 18px;
  align-items: start;
}

.chat-columns h4 {
  margin: 0 0 12px;
  color: var(--navy);
}

.chat-messages-list {
  max-height: 560px;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding: 4px 8px 4px 2px;
}

.chat-summary {
  border: 1px solid rgba(90, 120, 255, 0.16);
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(239, 245, 255, 0.75);
  color: #5f5b74;
}

.chat-summary p {
  margin: 4px 0 0;
  line-height: 1.45;
}

.chat-message {
  display: flex;
}

.chat-message > div {
  max-width: min(78%, 620px);
  border-radius: 19px;
  padding: 12px 14px;
  background: rgba(248, 246, 251, 0.92);
  color: var(--navy);
  box-shadow: inset 0 0 0 1px rgba(95, 88, 124, 0.07);
}

.chat-message.outbound {
  justify-content: end;
}

.chat-message.outbound > div {
  color: white;
  background: linear-gradient(135deg, #ff4f82, #c53bd9 62%, #6689ff);
  box-shadow: 0 16px 34px rgba(238, 50, 128, 0.16);
}

.chat-message p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-message small {
  display: block;
  margin-top: 6px;
  color: inherit;
  opacity: 0.68;
  font-size: 11px;
}

.chat-settings-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(95, 88, 124, 0.08);
}

.chat-settings-card textarea {
  min-height: 84px;
  resize: vertical;
}

.chat-settings-card .btn {
  justify-content: center;
}

.activity-item.refined {
  grid-template-columns: 56px 1fr 80px 92px;
  align-items: center;
  min-height: 76px;
  padding: 12px 14px;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid rgba(95, 88, 124, 0.08);
  box-shadow: none;
  background: rgba(255, 255, 255, 0.42);
}

.activity-item.refined.compact-row {
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  min-height: 64px;
  padding: 10px 8px;
}

.activity-item.refined.compact-row .event-icon {
  width: 38px;
  height: 38px;
}

.activity-item.refined.compact-row p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.activity-item.refined.compact-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, #4fd19a, #26b47d);
}

.event-icon.message {
  background: linear-gradient(135deg, #55b7ff, #2d6eea);
}

.event-icon.token {
  background: linear-gradient(135deg, #a36cff, #6f52e8);
}

.event-icon.comment {
  background: linear-gradient(135deg, #ff8b4f, #ff653d);
}

.activity-item p {
  margin: 0 0 5px;
  color: #1b1932;
  font-weight: 850;
}

.status-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  color: #06945c;
  background: rgba(219, 249, 235, 0.92);
  font-size: 12px;
  font-weight: 850;
}

.status-badge.error {
  color: var(--hot);
  background: rgba(255, 236, 242, 0.9);
}

.health-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  align-items: center;
}

.health-card img {
  width: 150px;
  height: 150px;
  object-fit: contain;
}

.health-card strong {
  color: #0ead6b;
  font-size: 28px;
}

.health-card ul {
  grid-column: 2;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.health-card li {
  display: flex;
  justify-content: space-between;
  color: #615b76;
}

.health-card b {
  color: #0ead6b;
}

.errors-card {
  border-radius: 24px;
}

.warning-row {
  min-height: 62px;
  display: grid;
  grid-template-columns: 44px 1fr 100px 120px;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 249, 245, 0.9);
  border: 1px solid rgba(255, 128, 64, 0.18);
}

.warning-row + .warning-row {
  margin-top: 8px;
}

.warning-row svg {
  width: 42px;
  height: 42px;
  padding: 9px;
  border-radius: 14px;
  color: #ff7a2f;
  background: white;
}

.warning-row span {
  display: grid;
  gap: 3px;
  color: #1d1a32;
  font-weight: 850;
}

.warning-row small {
  color: #6f6881;
  font-weight: 500;
}

.warning-row b {
  color: #ff7a2f;
  justify-self: start;
}

.warning-row button {
  min-height: 38px;
  border-radius: 12px;
  color: #2e3556;
  background: white;
  border: 1px solid rgba(95, 88, 124, 0.12);
}

input,
textarea,
select {
  border-radius: 14px;
  border: 1px solid rgba(95, 88, 124, 0.14);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

textarea {
  resize: vertical;
}

@keyframes drawLine {
  from {
    stroke-dashoffset: 900;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes growBar {
  from {
    transform: scaleY(0.35);
    transform-origin: bottom;
  }
  to {
    transform: scaleY(1);
    transform-origin: bottom;
  }
}

@media (max-width: 1280px) {
  .analytics-cards,
  .dashboard-bottom,
  .tokens-layout-ref,
  .activity-layout-ref,
  .channel-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .posts-layout-ref,
  .connect-grid-ref,
  .ai-layout-ref,
  .timing-layout-ref,
  .channel-service-settings,
  .threads-workspace-grid {
    grid-template-columns: 1fr;
  }

  .connect-visual-card,
  .channel-page-hero {
    grid-template-columns: 1fr;
  }

  .threads-posts-panel {
    grid-column: auto;
  }

  .posts-side-card {
    grid-row: auto;
  }

  .activity-side-stack {
    grid-column: span 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .app-view {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .topbar,
  .paywall,
  .timing-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .toolbar-actions {
    justify-content: flex-start;
  }

  .dashboard-kpis,
  .timing-kpis,
  .billing-kpis,
  .activity-kpis,
  .analytics-cards,
  .dashboard-bottom,
  .tokens-layout-ref,
  .activity-layout-ref,
  .activity-side-stack,
  .posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .performance-hero,
  .tokens-hero,
  .activity-toolbar,
  .channel-page-hero {
    grid-template-columns: 1fr;
  }

  .billing-table .payment-row {
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 10px;
  }

  .sidebar nav,
  .dashboard-kpis,
  .timing-kpis,
  .billing-kpis,
  .activity-kpis,
  .channel-kpis,
  .analytics-cards,
  .dashboard-bottom,
  .tokens-layout-ref,
  .activity-layout-ref,
  .activity-side-stack,
  .posts-grid,
  .permission-grid,
  .channel-service-settings,
  .grid.two,
  .grid.three,
  .visual-packs {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 18px;
  }

  .sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .nav-item {
    min-height: 48px;
    padding: 12px;
    font-size: 14px;
  }

  .topbar,
  .panel,
  .metric,
  .post-card,
  .tokens-hero {
    border-radius: 22px;
    padding: 18px;
  }

  .page-title-block {
    padding: 0 8px;
  }

  .page-title-block h2 {
    font-size: 32px;
  }

  .hero-illustration,
  .connect-visual-card,
  .timing-hero-art,
  .channel-hero-art {
    display: none;
  }

  .metric {
    min-height: 108px;
  }

  .search-wrap input {
    min-width: 0;
    width: 100%;
  }

  .activity-item.refined,
  .warning-row,
  .conversion-row,
  .delay-card label {
    grid-template-columns: 1fr;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .save-bar-ref,
  .billing-actions,
  .post-card-footer,
  .post-card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .connect-status-card .xl,
  .btn {
    width: 100%;
    justify-content: center;
  }

  .top-language {
    order: -1;
    margin-right: 0;
  }

  .language-switch {
    align-self: flex-start;
  }
}

/* Stability and live-data refinements. Keep this layer last so older ref mock CSS cannot
   reintroduce side rails, full-width KPI stacks, or malformed switches. */
.app-view {
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  min-height: 720px;
  align-self: start;
}

.sidebar nav {
  align-content: start;
}

.content {
  min-width: 0;
}

.posts-layout-ref {
  grid-template-columns: 1fr;
}

.posts-side-card {
  order: -1;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) 92px repeat(2, minmax(150px, 190px)) minmax(230px, 0.9fr);
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
}

.posts-side-card h3 {
  grid-column: 1;
  margin-bottom: 2px;
}

.posts-side-card > p:not(.info-strip) {
  grid-column: 1;
  margin: 0;
}

.posts-side-card > img {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 86px;
  height: 86px;
}

.posts-side-card .post-side-stat {
  min-height: 74px;
  padding: 12px;
}

.posts-side-card .post-side-stat svg {
  width: 46px;
  height: 46px;
}

.posts-side-card .info-strip {
  grid-column: 5;
  grid-row: 1 / span 2;
  min-height: 74px;
}

.posts-grid {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
}

.post-thumb > img {
  opacity: 0.96;
}

.post-card-actions {
  align-items: center;
}

.post-card-actions > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.post-card-actions .post-context-action {
  color: #1f5fd1;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.switch-row > span {
  flex: 1 1 auto;
}

.switch-row input[type="checkbox"] {
  flex: 0 0 48px;
  margin: 0;
}

.activity-kpis,
.billing-kpis,
.timing-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
}

.activity-kpis .metric,
.billing-kpis .metric,
.timing-kpis .metric {
  min-width: 0;
}

.activity-layout-ref {
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.75fr);
}

.donut {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1.05;
}

.donut strong,
.donut span {
  margin: 0;
  text-align: center;
}

#tokenUsageChart {
  display: block;
  padding: 14px;
}

#tokenUsageChart::before,
#dashboardTokenUsageChart::before {
  display: none;
}

#tokenUsageChart svg,
#dashboardTokenUsageChart svg {
  width: 100%;
  height: 100%;
  min-height: 190px;
}

#dashboardTokenUsageChart {
  display: block;
  padding: 12px;
}

.usage-area {
  fill: rgba(78, 134, 255, 0.15);
}

.token-line {
  stroke: #4e86ff;
}

.auto-topup-row {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(95, 88, 124, 0.1);
}

.auto-topup-row svg {
  width: 18px;
  height: 18px;
  color: var(--hot);
}

.pack-buy-btn {
  width: min(360px, 100%);
  margin: 16px auto 0;
  justify-content: center;
  box-shadow: 0 18px 42px rgba(244, 63, 122, 0.22);
}

.payment-element:empty {
  display: none;
}

.pager-line button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

@media (max-width: 1280px) {
  .posts-side-card {
    grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(150px, 1fr));
  }

  .posts-side-card > img {
    display: none;
  }

  .posts-side-card .info-strip {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .posts-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }

  .activity-layout-ref {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .sidebar {
    position: static;
    height: auto;
    min-height: 0;
  }

  .activity-kpis,
  .billing-kpis,
  .timing-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .posts-side-card,
  .posts-grid {
    grid-template-columns: 1fr;
  }

  .detail-modal {
    padding: 14px;
    align-items: end;
  }

  .detail-card {
    width: 100%;
    max-height: 88vh;
    padding: 22px;
    border-radius: 24px 24px 18px 18px;
  }

  .detail-modal[data-mode="post-comments"] .detail-card {
    width: 100%;
  }

  .detail-head {
    grid-template-columns: 46px minmax(0, 1fr);
    padding-right: 34px;
  }

  .post-comments-list {
    max-height: 66vh;
  }

  .post-comment-row,
  .post-comment-row.child {
    grid-template-columns: 36px minmax(0, 1fr);
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  .post-comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 13px;
  }

  .post-comment-head {
    display: grid;
    gap: 3px;
  }

  .post-comment-head small {
    text-align: left;
  }
}

.account-selector {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 16px;
  color: #25243d;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(95, 88, 124, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.account-selector svg {
  width: 20px;
  height: 20px;
  color: var(--hot);
}

.account-selector select {
  width: min(210px, 24vw);
  min-width: 150px;
  border: 0;
  padding: 8px 28px 8px 4px;
  background: transparent;
  color: #25243d;
  font-weight: 850;
  outline: 0;
}

.account-choice {
  width: 100%;
  display: grid;
  gap: 6px;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.account-select-button {
  width: 100%;
  display: grid;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.account-choice:hover,
.account-choice.active {
  border-color: rgba(248, 67, 122, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 18px 42px rgba(248, 67, 122, 0.13);
}

.account-choice small {
  color: #77748b;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.account-choice.needs-reconnect {
  border-color: rgba(255, 111, 97, 0.38);
  background: linear-gradient(135deg, rgba(255, 245, 247, 0.86), rgba(255, 255, 255, 0.72));
}

.account-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 111, 145, 0.18);
  color: #7b748d;
  font-size: 12px;
  font-weight: 800;
}

.account-card-actions > span {
  flex: 1 1 100%;
}

.account-card-actions .btn {
  flex: 1 1 auto;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 12px;
  white-space: nowrap;
}

.reconnect-account-btn svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 980px) {
  .account-selector select {
    width: min(56vw, 220px);
  }

  .account-card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .account-card-actions .btn {
    justify-content: center;
    width: 100%;
  }
}

/* Final UI stability overrides for real cabinet data. */
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 46px !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #251832 50%),
    linear-gradient(135deg, #251832 50%, transparent 50%);
  background-position:
    calc(100% - 21px) 50%,
    calc(100% - 15px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.account-selector select {
  padding-right: 40px !important;
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
}

.btn.primary .btn-brand-icon,
.topbar .btn.primary .btn-brand-icon {
  filter: none;
}

.btn.primary svg,
.topbar .btn.primary svg {
  color: #fff;
  stroke: currentColor;
}

.activity-layout-ref {
  align-items: start;
}

.activity-side-stack,
.activity-breakdown-card {
  align-self: start;
}

.activity-item.refined {
  grid-template-columns: 56px minmax(0, 1fr) minmax(68px, 82px) minmax(96px, 136px);
}

.activity-item.refined > div,
.activity-item.refined p,
.activity-item.refined small {
  min-width: 0;
}

.activity-item.refined p {
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
}

.activity-item.refined small {
  overflow-wrap: anywhere;
}

.activity-item.refined > small {
  text-align: center;
}

.status-badge {
  max-width: 136px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.15;
}

.status-badge.manual {
  color: #8b4c00;
  background: rgba(255, 239, 213, 0.92);
}

.donut strong,
.donut span {
  width: 100%;
}

#postEditor {
  padding-top: 28px;
}

#postEditor label {
  gap: 10px;
  margin-bottom: 14px;
  line-height: 1.25;
}

#postEditor .grid.two {
  gap: 22px;
  align-items: start;
  margin-bottom: 12px;
}

#postEditor input,
#postEditor textarea {
  margin-top: 4px;
}

#postEditor .switch-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

@media (max-width: 1280px) {
  .activity-layout-ref {
    grid-template-columns: 1fr;
  }

  .activity-side-stack {
    grid-column: auto;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .chats-layout,
  .chat-columns {
    grid-template-columns: 1fr;
  }

  .chats-list-panel,
  .chat-detail-panel {
    min-height: auto;
  }

  .chat-messages-list {
    max-height: 460px;
  }
}

@media (max-width: 720px) {
  .chats-toolbar {
    grid-template-columns: 1fr;
  }

  .chat-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .chat-row em {
    grid-column: 2;
    justify-self: start;
  }

  .chat-status-dot {
    grid-column: 2;
  }

  .chat-message > div {
    max-width: 92%;
  }
}

/* Mobile cabinet refinement: keep cards readable and move chat detail into a sheet. */
@media (max-width: 720px) {
  body {
    overflow-x: hidden;
  }

  .shell {
    padding: 8px;
  }

  .app-view {
    gap: 10px;
  }

  .content {
    gap: 12px;
  }

  .sidebar {
    border-radius: 22px;
    padding: 16px;
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .nav-item {
    min-height: 42px;
    padding: 10px 12px;
    justify-content: flex-start;
  }

  .topbar {
    min-height: 0;
    padding: 18px;
    border-radius: 24px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .topbar-title {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: 100%;
  }

  .topbar-title .avatar {
    width: 58px;
    height: 58px;
  }

  .topbar-title h2 {
    font-size: 25px;
    line-height: 1.05;
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .language-switch,
  .account-selector,
  .token-pill,
  .connection-pill,
  .topbar-actions .btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  .account-selector select {
    width: 100%;
    min-width: 0;
    text-align: center;
  }

  .notice {
    padding: 12px 14px;
    border-radius: 16px;
    line-height: 1.35;
  }

  .page-title-block {
    padding: 0 10px;
  }

  .page-title-block h2 {
    font-size: 32px;
  }

  .page-title-block p {
    font-size: 15px;
    line-height: 1.45;
  }

  .metric-grid,
  .dashboard-kpis,
  .timing-kpis,
  .billing-kpis,
  .activity-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .metric,
  .metric.mini {
    min-height: 128px;
    padding: 16px;
    border-radius: 20px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    overflow: hidden;
    text-align: left;
  }

  .metric > i,
  .metric.mini > svg,
  .metric-icon {
    width: 42px;
    height: 42px;
    padding: 10px;
    border-radius: 16px;
  }

  .metric div,
  .metric span,
  .metric strong,
  .metric small {
    min-width: 0;
  }

  .metric span,
  .metric small {
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }

  .metric strong {
    max-width: 100%;
    font-size: clamp(22px, 7vw, 30px);
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .metric strong small {
    display: inline;
    font-size: 12px;
  }

  .dashboard-kpis .metric {
    min-height: 118px;
  }

  .performance-hero,
  .tokens-hero {
    min-height: 0;
    padding: 24px 18px;
    border-radius: 24px;
  }

  .performance-hero h2,
  .tokens-hero strong#billingTokens {
    font-size: clamp(34px, 11vw, 48px);
    line-height: 1.02;
  }

  .dashboard-bottom,
  .billing-main-grid,
  .timing-layout-ref,
  .activity-layout-ref {
    grid-template-columns: 1fr;
  }

  .activity-toolbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .activity-layout-ref {
    gap: 12px;
  }

  .activity-side-stack {
    grid-template-columns: 1fr;
  }

  .activity-item.refined {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    padding: 13px 0;
    align-items: start;
  }

  .activity-item.refined > small,
  .activity-item.refined .status-badge {
    grid-column: 2;
    justify-self: start;
    text-align: left;
  }

  .activity-item.refined p {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }

  .status-badge {
    max-width: 100%;
    white-space: nowrap;
    overflow-wrap: normal;
  }

  .link-row[data-tab-jump="activity"],
  .link-row[data-activity-filter="error"] {
    display: none;
  }

  .billing-kpis .metric,
  .timing-kpis .metric,
  .activity-kpis .metric {
    min-height: 126px;
  }

  .token-usage-card,
  .token-pack-card,
  .subscription-ref,
  .recent-events-card,
  .activity-breakdown-card,
  .health-card,
  .errors-card {
    border-radius: 22px;
  }

  .token-usage-card .period-select,
  .activity-toolbar select,
  .activity-toolbar .search-wrap {
    width: 100%;
  }

  .usage-chart,
  #tokenUsageChart {
    max-width: 100%;
    overflow: hidden;
  }

  .chat-detail-panel {
    display: none;
  }

  .chat-detail-panel.mobile-open {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    align-items: end;
    min-height: 0;
    padding: 18px 10px 0;
    border: 0;
    border-radius: 0;
    background: rgba(17, 13, 31, 0.34);
    box-shadow: none;
    overflow: hidden;
  }

  .chat-detail-panel.mobile-open::before {
    content: "";
    position: absolute;
    inset: 0;
  }

  .chat-detail-panel.mobile-open .chat-detail-content,
  .chat-detail-panel.mobile-open .chat-detail-empty {
    position: relative;
    z-index: 1;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    padding: 22px 16px 18px;
    border-radius: 26px 26px 0 0;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 251, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 -18px 54px rgba(31, 25, 50, 0.24);
  }

  .chat-detail-close {
    display: none;
  }

  .chat-detail-panel.mobile-open .chat-detail-close {
    display: grid;
    position: absolute;
    top: 26px;
    right: 18px;
    z-index: 2;
  }

  .chat-detail-head {
    padding-right: 42px;
  }

  .chat-detail-head h3,
  .chat-detail-head small {
    overflow-wrap: anywhere;
  }

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

  .chat-messages-list {
    max-height: 42vh;
  }

  .chat-message > div {
    max-width: 94%;
  }

  .chat-settings-card {
    padding: 14px;
  }

  .grid.two,
  #postEditor .grid.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .metric-grid,
  .dashboard-kpis,
  .timing-kpis,
  .billing-kpis,
  .activity-kpis {
    gap: 10px;
  }

  .metric,
  .metric.mini {
    padding: 14px 12px;
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .metric > i,
  .metric.mini > svg,
  .metric-icon {
    width: 38px;
    height: 38px;
  }

  .metric strong {
    font-size: clamp(21px, 7vw, 27px);
  }
}

/* Mobile polish pass: keep dense live data readable without changing desktop. */
@media (max-width: 720px) {
  .topbar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .account-selector,
  .token-pill,
  #connectTopBtn {
    grid-column: 1 / -1;
  }

  .topbar-actions .language-switch,
  .topbar-actions .connection-pill,
  .topbar-actions #refreshBtn {
    width: 100%;
  }

  .metric,
  .metric.mini {
    align-content: center;
    isolation: isolate;
  }

  .metric > div {
    display: grid;
    gap: 4px;
    align-content: center;
  }

  .timing-kpis .metric strong,
  .billing-kpis .metric strong,
  .activity-kpis .metric strong {
    font-size: clamp(21px, 6.2vw, 28px);
    overflow-wrap: normal;
    word-break: normal;
  }

  .timing-kpis .metric span,
  .billing-kpis .metric span,
  .activity-kpis .metric span,
  .timing-kpis .metric small,
  .billing-kpis .metric small,
  .activity-kpis .metric small {
    line-height: 1.25;
  }

  .timing-kpis .metric strong,
  .timing-kpis .metric small {
    max-width: 100%;
  }

  .token-usage-card .card-head,
  .token-pack-card .card-head,
  .recent-events-card .card-head,
  .activity-breakdown-card .card-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: start;
  }

  .token-usage-card .period-select {
    max-width: 100%;
  }

  .token-pack-options {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .activity-item.refined > div {
    min-width: 0;
  }

  .activity-item.refined p,
  .activity-item.refined small {
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }

  .activity-item.refined p {
    line-height: 1.35;
  }

  .activity-item.refined small {
    line-height: 1.4;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .donut-legend {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .topbar {
    padding: 16px;
  }

  .topbar-title {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .topbar-title .avatar,
  .topbar-title .user-avatar {
    width: 52px;
    height: 52px;
  }

  .metric,
  .metric.mini {
    min-height: 118px;
  }

  .timing-kpis .metric strong,
  .billing-kpis .metric strong,
  .activity-kpis .metric strong {
    font-size: clamp(20px, 6vw, 25px);
  }
}

@media (max-width: 430px) {
  .topbar-actions {
    grid-template-columns: 1fr;
  }

  .topbar-actions .language-switch,
  .topbar-actions .account-selector,
  .topbar-actions .token-pill,
  .topbar-actions .connection-pill,
  .topbar-actions .btn {
    grid-column: 1;
    max-width: 100%;
    min-width: 0;
  }

  .topbar-actions .btn,
  .token-pill,
  .connection-pill {
    overflow: hidden;
  }

  .topbar-actions .btn span,
  .token-pill strong,
  .connection-pill strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .metric-grid,
  .dashboard-kpis,
  .timing-kpis,
  .billing-kpis,
  .activity-kpis {
    grid-template-columns: 1fr;
  }

  .metric,
  .metric.mini {
    min-height: 104px;
    grid-template-columns: 52px minmax(0, 1fr);
    text-align: left;
  }

  .metric > i,
  .metric.mini > svg,
  .metric-icon {
    width: 48px;
    height: 48px;
  }

  .metric strong,
  .timing-kpis .metric strong,
  .billing-kpis .metric strong,
  .activity-kpis .metric strong {
    font-size: clamp(27px, 8vw, 34px);
    overflow-wrap: normal;
    word-break: keep-all;
  }

  .dashboard-kpis .metric strong#metricTokens,
  .token-pill strong {
    letter-spacing: -0.01em;
  }

  .performance-hero .hero-copy {
    min-width: 0;
    width: 100%;
  }

  .performance-hero .hero-copy h3 {
    max-width: 100%;
    font-size: clamp(29px, 8.2vw, 34px);
    line-height: 1.08;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }

  .performance-hero .hero-copy p {
    max-width: 100%;
  }

  .chart-card.wide-chart {
    min-height: 0;
  }

  .chart-card .chart-head {
    display: grid;
    gap: 8px;
  }

  .chart-card .legend {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .line-chart {
    height: 136px;
    padding-right: 0;
  }

  .chart-side-values {
    position: static;
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
  }

  .chart-side-values strong,
  .chart-side-values span {
    min-width: 0;
  }

  .chart-side-values strong {
    font-size: 24px;
  }

  .area-chart {
    min-height: 145px;
  }

  .activity-item.refined,
  .activity-item.refined.compact-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .activity-item.refined .status-badge {
    max-width: min(100%, 190px);
  }
}

/* Hard 350px QA pass: these overrides must win against earlier desktop/tablet grids. */
@media (max-width: 520px) {
  html,
  body,
  .shell,
  .app-view,
  .content,
  .tab-panel.active {
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-view {
    gap: 12px !important;
  }

  .topbar {
    width: 100%;
    padding: 18px !important;
    gap: 14px !important;
    overflow: hidden;
  }

  .topbar-title {
    grid-template-columns: 56px minmax(0, 1fr) !important;
    width: 100%;
    min-width: 0;
  }

  .topbar-title h2,
  .page-head h2,
  .tab-panel > h2 {
    font-size: clamp(28px, 8.2vw, 36px) !important;
    line-height: 1.08 !important;
    max-width: 100%;
    overflow-wrap: break-word;
  }

  .topbar-actions {
    width: 100%;
    min-width: 0;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .topbar-actions > *,
  .topbar-actions .btn,
  .topbar-actions .account-selector,
  .topbar-actions .token-pill,
  .topbar-actions .connection-pill,
  .topbar-actions .language-switch {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-column: 1 !important;
  }

  .topbar-actions .btn,
  #connectTopBtn,
  #refreshBtn {
    min-height: 48px;
    justify-content: center;
    text-align: center;
    white-space: normal !important;
    overflow: hidden;
    line-height: 1.2;
  }

  #connectTopBtn {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .topbar-actions select,
  .topbar-actions strong {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .dashboard-kpis,
  .metric-grid,
  .timing-kpis,
  .billing-kpis,
  .activity-kpis,
  .analytics-cards,
  .dashboard-bottom,
  .billing-main-grid,
  .tokens-layout-ref,
  .timing-layout-ref,
  .activity-layout-ref,
  .activity-side-stack {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  .metric,
  .metric.mini {
    width: 100%;
    min-width: 0 !important;
    min-height: 96px !important;
    display: grid !important;
    grid-template-columns: 54px minmax(0, 1fr) !important;
    gap: 14px !important;
    padding: 15px 18px !important;
    text-align: left !important;
    align-items: center !important;
  }

  .metric > i,
  .metric.mini > svg,
  .metric-icon {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
  }

  .metric > div,
  .metric .metric-body {
    min-width: 0;
  }

  .metric strong,
  .metric .metric-value,
  .metric #metricTokens,
  .metric #billingTokens,
  .timing-kpis .metric strong,
  .billing-kpis .metric strong,
  .activity-kpis .metric strong {
    max-width: 100%;
    font-size: clamp(28px, 8vw, 34px) !important;
    line-height: 1.05 !important;
    letter-spacing: -0.01em;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }

  .metric span,
  .metric small {
    max-width: 100%;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
  }

  .performance-hero,
  .tokens-hero {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    min-height: 0 !important;
    padding: 20px !important;
    overflow: hidden;
  }

  .performance-hero .hero-copy,
  .tokens-hero .hero-copy {
    min-width: 0;
    width: 100%;
  }

  .performance-hero .hero-copy h3,
  .performance-hero h2,
  .tokens-hero h2 {
    max-width: 100%;
    font-size: clamp(25px, 7.3vw, 31px) !important;
    line-height: 1.12 !important;
    letter-spacing: 0 !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    hyphens: auto;
  }

  .performance-hero .hero-illustration,
  .tokens-hero .hero-visual {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .chart-card,
  .dashboard-card,
  .recent-events-card,
  .activity-breakdown-card,
  .conversion-card,
  .token-usage-card,
  .token-pack-card {
    min-width: 0;
    overflow: hidden;
    padding: 18px !important;
  }

  .chart-head,
  .card-head,
  .activity-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .chart-head .legend,
  .legend {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .line-chart,
  .area-chart,
  .bar-chart {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 142px !important;
    padding-right: 0 !important;
    overflow: hidden;
  }

  .chart-side-values {
    position: static !important;
    transform: none !important;
    width: 100%;
    margin-top: 10px;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px 12px;
  }

  .chart-side-values strong,
  .chart-side-values span {
    min-width: 0;
    white-space: normal;
  }

  .donut-wrap {
    grid-template-columns: minmax(0, 1fr) !important;
    justify-items: center;
  }

  .donut-visual,
  .donut-chart {
    max-width: 180px;
  }

  .donut-center {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  .donut-legend {
    width: 100%;
    min-width: 0;
  }

  .activity-item.refined,
  .activity-item.refined.compact-row,
  .activity-list .activity-item {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    gap: 10px 12px !important;
    align-items: start !important;
  }

  .activity-item.refined > div,
  .activity-item.refined p,
  .activity-item.refined small {
    min-width: 0;
    max-width: 100%;
  }

  .activity-item.refined p {
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    line-height: 1.32 !important;
  }

  .activity-item.refined small,
  .activity-item.refined .status-badge {
    grid-column: 2 !important;
    justify-self: start !important;
  }

  .status-badge {
    max-width: 100%;
    white-space: normal !important;
    text-align: center;
    line-height: 1.2;
  }
}

@media (max-width: 360px) {
  .topbar,
  .performance-hero,
  .tokens-hero,
  .chart-card,
  .dashboard-card,
  .recent-events-card,
  .activity-breakdown-card,
  .conversion-card,
  .token-usage-card,
  .token-pack-card {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .performance-hero .hero-copy h3,
  .performance-hero h2,
  .tokens-hero h2 {
    font-size: 25px !important;
  }

  .metric strong,
  .metric .metric-value,
  .metric #metricTokens,
  .metric #billingTokens,
  .timing-kpis .metric strong,
  .billing-kpis .metric strong,
  .activity-kpis .metric strong {
    font-size: 28px !important;
  }
}

/* Global scrollbar styling: transparent rail with soft SABSUS pink thumb. */
html,
body,
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(233, 30, 99, 0.46) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track,
*::-webkit-scrollbar-corner {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  min-height: 52px;
  border: 3px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 82, 132, 0.68),
      rgba(221, 47, 184, 0.48)
    )
    padding-box;
  box-shadow: 0 0 18px rgba(233, 30, 99, 0.16);
}

*::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(
      180deg,
      rgba(255, 82, 132, 0.84),
      rgba(221, 47, 184, 0.64)
    )
    padding-box;
}

@media (max-width: 520px) {
  *::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  *::-webkit-scrollbar-thumb {
    border-width: 2px;
  }
}
