:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --surface-muted: #f1f5f9;
  --text: #1a2332;
  --text-strong: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #2d9c4a;
  --accent-hover: #248a3f;
  --accent-soft: rgba(45, 156, 74, 0.12);
  --accent-ring: rgba(45, 156, 74, 0.28);
  --mint-glow: rgba(134, 239, 172, 0.45);
  --lavender-glow: rgba(199, 210, 254, 0.5);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --sidebar-width: 228px;
  --persona-panel-max-h: min(34vh, 300px);
  --persona-form-max-h: min(28vh, 248px);
  --persona-btn-row-h: 3.25rem;
}

.text-accent {
  color: var(--accent);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

/* Dashboard only: keep layout within the viewport so the chat composer stays visible */
body:has(.app-shell) {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

body {
  margin: 0;
  font-family: Outfit, sans-serif;
  background:
    radial-gradient(ellipse 70% 50% at 0% 0%, var(--lavender-glow), transparent 55%),
    radial-gradient(ellipse 60% 45% at 100% 0%, var(--mint-glow), transparent 50%),
    radial-gradient(ellipse 55% 40% at 100% 100%, rgba(186, 230, 253, 0.35), transparent 50%),
    radial-gradient(ellipse 50% 40% at 0% 100%, var(--accent-soft), transparent 45%),
    var(--bg);
  color: var(--text);
}

@keyframes login-bg-shift {
  0% {
    background-position:
      0% 0%,
      100% 0%,
      100% 100%,
      0% 100%;
  }
  100% {
    background-position:
      18% 12%,
      82% 8%,
      88% 88%,
      12% 92%;
  }
}

@keyframes login-backdrop-shift {
  0% {
    opacity: 0.85;
    transform: scale(1) translate(0, 0);
  }
  50% {
    opacity: 1;
    transform: scale(1.04) translate(1.5%, -1%);
  }
  100% {
    opacity: 0.9;
    transform: scale(1.02) translate(-1%, 1.5%);
  }
}

.login-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 1.5vh, 16px) clamp(10px, 1.5vw, 14px);
  overflow-x: hidden;
  background-color: #eef3f9;
  background-image:
    radial-gradient(ellipse 80% 65% at 12% 8%, rgba(134, 239, 172, 0.52), transparent 56%),
    radial-gradient(ellipse 78% 60% at 88% 12%, rgba(199, 210, 254, 0.5), transparent 54%),
    radial-gradient(ellipse 72% 58% at 92% 90%, rgba(125, 211, 252, 0.42), transparent 52%),
    radial-gradient(ellipse 70% 55% at 8% 88%, rgba(74, 222, 128, 0.4), transparent 50%);
  background-size: 135% 135%, 130% 130%, 132% 132%, 128% 128%;
  background-repeat: no-repeat;
  background-position:
    0% 0%,
    100% 0%,
    100% 100%,
    0% 100%;
  animation: login-bg-shift 24s ease-in-out infinite alternate;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 45%, rgba(196, 181, 253, 0.28), transparent 58%),
    radial-gradient(ellipse 60% 50% at 20% 70%, rgba(45, 156, 74, 0.18), transparent 52%);
  animation: login-backdrop-shift 20s ease-in-out infinite alternate;
}

.login-layout {
  position: relative;
  z-index: 1;
  width: min(1320px, 97vw);
  min-height: min(640px, 84vh);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 14px;
  align-items: stretch;
}

.login-hero,
.login-card {
  position: relative;
  border: 1.5px solid rgba(45, 156, 74, 0.38);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.login-hero {
  padding: clamp(36px, 4vh, 52px) clamp(36px, 3.5vw, 48px);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-hero-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(22px, 3vw, 40px);
  margin-bottom: clamp(28px, 4vh, 48px);
}

.login-hero-logo {
  display: block;
  width: auto;
  height: auto;
  max-height: clamp(88px, 15vh, 124px);
  max-width: min(400px, 50vw);
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.12)) drop-shadow(0 0 24px rgba(255, 255, 255, 0.65));
}

.login-hero-logo--unipd {
  max-height: clamp(72px, 12vh, 96px);
  max-width: clamp(72px, 12vh, 96px);
  aspect-ratio: 1;
}

.login-hero-logo-divider {
  width: 1.5px;
  height: clamp(72px, 14vh, 100px);
  align-self: center;
  background: linear-gradient(180deg, transparent, rgba(100, 116, 139, 0.45), transparent);
}

.login-hero-eyebrow {
  margin: 0 0 14px;
  font-size: clamp(12px, 1.3vw, 14px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.login-hero-title {
  margin: 0;
  font-family: Sora, sans-serif;
  font-size: clamp(30px, 3.6vw, 42px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.75);
}

.login-hero-lede {
  margin: clamp(12px, 1.8vh, 18px) 0 0;
  max-width: min(48ch, 100%);
  color: var(--muted);
  font-size: clamp(16px, 1.65vw, 19px);
  line-height: 1.5;
}

.login-hero-points {
  margin: clamp(24px, 3vh, 36px) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: clamp(12px, 1.8vh, 18px);
  max-width: min(50ch, 100%);
}

.login-hero-points li {
  position: relative;
  padding-left: clamp(20px, 2vw, 24px);
  color: var(--text);
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.45;
}

.login-hero-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: clamp(8px, 1vw, 10px);
  height: clamp(8px, 1vw, 10px);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-card {
  width: 100%;
  padding: clamp(36px, 4vh, 52px) clamp(36px, 3.5vw, 48px);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-card-accent {
  display: none;
}

.login-card-title {
  margin: 8px 0 0;
  font-family: Sora, sans-serif;
  font-size: clamp(28px, 2.8vw, 34px);
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.2;
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.75);
}

.login-card-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.45;
}

.login-form {
  margin-top: clamp(26px, 3.5vh, 34px);
  display: grid;
  gap: 14px;
}

.login-form label {
  font-size: clamp(15px, 1.4vw, 16px);
  font-weight: 600;
  color: var(--text);
}

.login-form > input {
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.22);
  color: var(--text-strong);
  font-size: clamp(15px, 1.4vw, 17px);
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.login-form > input:focus {
  outline: none;
  border-color: rgba(45, 156, 74, 0.55);
  background: rgba(255, 255, 255, 0.32);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.login-password-field {
  position: relative;
  display: block;
}

.login-password-field input {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.22);
  color: var(--text-strong);
  font-size: clamp(15px, 1.4vw, 17px);
  padding: 12px 44px 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.login-password-field input:focus {
  outline: none;
  border-color: rgba(45, 156, 74, 0.55);
  background: rgba(255, 255, 255, 0.32);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.login-password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.login-password-toggle:hover {
  color: var(--text-strong);
  background: var(--surface-muted);
}

.login-password-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.login-password-toggle svg {
  grid-area: 1 / 1;
}

.login-form button[type="submit"] {
  margin-top: 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: clamp(16px, 1.5vw, 18px);
  padding: 13px 16px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  box-shadow: 0 4px 14px rgba(45, 156, 74, 0.35);
}

.login-form button[type="submit"]:hover {
  background: var(--accent-hover);
}

.error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  color: #b91c1c;
  padding: 12px 14px;
  margin-top: 16px;
  font-size: clamp(14px, 1.35vw, 16px);
  line-height: 1.45;
}

/* —— Projects hub (post-login) —— */
.projects-page {
  --projects-panel-pad-y: clamp(18px, 2.2vh, 26px);
  position: relative;
  min-height: 100dvh;
  box-sizing: border-box;
  padding: clamp(10px, 1.5vh, 16px) clamp(12px, 2vw, 20px);
  overflow-x: hidden;
  background-color: #eef3f9;
  background-image:
    radial-gradient(ellipse 80% 65% at 12% 8%, rgba(134, 239, 172, 0.4), transparent 56%),
    radial-gradient(ellipse 78% 60% at 88% 12%, rgba(199, 210, 254, 0.45), transparent 54%);
}

.projects-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 55% at 50% 40%, rgba(196, 181, 253, 0.2), transparent 58%);
}

.projects-page-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: clamp(260px, 18vw, 300px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(16px, 2.5vw, 36px);
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 clamp(8px, 1.5vw, 20px);
}

.projects-account-rail {
  justify-self: start;
  width: 100%;
  max-width: 300px;
  padding-top: max(0px, calc(var(--projects-panel-pad-y) - 11px));
  position: sticky;
  top: clamp(10px, 1.5vh, 16px);
}

.projects-account-menu {
  position: relative;
}

.projects-account-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px 12px 12px;
  border: 1.5px solid rgba(45, 156, 74, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.projects-account-trigger:hover {
  border-color: rgba(45, 156, 74, 0.45);
  box-shadow: 0 8px 22px rgba(45, 156, 74, 0.12);
}

.projects-account-trigger::-webkit-details-marker {
  display: none;
}

.projects-account-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.projects-account-avatar svg {
  width: 22px;
  height: 22px;
}

.projects-account-trigger__text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
}

.projects-account-trigger__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.projects-account-trigger__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.projects-account-chevron {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-right: 2px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.projects-account-menu:not([open]) .projects-account-chevron {
  transform: rotate(-45deg);
}

.projects-account-dropdown {
  margin-top: 12px;
  padding: 18px 18px 20px;
  border: 1.5px solid rgba(45, 156, 74, 0.22);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
  display: flex;
  flex-direction: column;
}

.projects-account-dropdown__title {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.projects-account-dropdown__user {
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(45, 156, 74, 0.12);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-strong);
  word-break: break-word;
}

.projects-account-info {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.projects-account-info__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.projects-account-info__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.projects-account-info__icon svg {
  width: 16px;
  height: 16px;
}

.projects-account-info__copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.projects-account-info__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.projects-account-info__value {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-strong);
}

.projects-account-dropdown > .sidebar-partners {
  margin-top: 16px;
  margin-bottom: 0;
  padding: 14px 12px;
  gap: 12px 16px;
}

.projects-account-dropdown .sidebar-partner-logo {
  height: clamp(50px, 6.5vh, 58px);
  max-width: min(230px, 100%);
}

.projects-account-dropdown .sidebar-partner-logo--unipd {
  max-width: clamp(48px, 6vh, 56px);
  max-height: clamp(48px, 6vh, 56px);
}

.projects-account-signout {
  padding-top: 14px;
  margin-top: 0;
}

.projects-account-dropdown__hint {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(45, 156, 74, 0.08);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
}

.account-sign-out {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: none;
  background-color: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.account-sign-out:hover,
.account-sign-out:focus-visible {
  background-color: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}

.account-sign-out:active {
  background-color: #1f7a38;
  color: #fff;
}

.projects-center {
  display: flex;
  justify-content: stretch;
  min-width: 0;
}

.projects-shell {
  position: relative;
  width: 100%;
  max-width: none;
}

.projects-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2vh, 12px);
}

.projects-logo--stat4value {
  max-height: clamp(56px, 7.5vh, 72px);
  max-width: min(280px, 38vw);
}

.projects-logo--unipd {
  max-height: clamp(52px, 7vh, 68px);
  max-width: clamp(52px, 7vh, 68px);
  aspect-ratio: 1;
}

.projects-logo {
  width: auto;
  object-fit: contain;
  display: block;
}

.projects-panel-head {
  margin-bottom: clamp(14px, 2vh, 20px);
}

.projects-panel-head__text {
  flex: 1 1 auto;
  min-width: 0;
}

.projects-header-text {
  flex: 1 1 220px;
  min-width: 0;
}

.projects-header-text h1 {
  margin: 0;
  font-family: Sora, sans-serif;
  font-size: clamp(22px, 2.8vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.projects-eyebrow {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: clamp(13px, 1.5vw, 15px);
  line-height: 1.4;
}

.projects-logout {
  display: inline-block;
  font-size: 15px;
  font-weight: 600;
  color: #9f1239;
  text-decoration: none;
  white-space: nowrap;
  padding: 8px 4px;
}

.projects-logout:hover {
  color: #7f1d1d;
  text-decoration: underline;
}

.projects-grid {
  display: grid;
  grid-template-columns: minmax(200px, 28%) minmax(0, 1fr);
  gap: clamp(10px, 1.5vw, 14px);
  align-items: start;
}

.projects-main-panel {
  padding: var(--projects-panel-pad-y) clamp(20px, 2.8vw, 32px) clamp(14px, 1.8vh, 20px);
  border: 1.5px solid rgba(45, 156, 74, 0.32);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
}

.projects-main-panel > h1 {
  margin: 0 0 8px;
  font-family: Sora, sans-serif;
  font-size: clamp(22px, 2.8vw, 28px);
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: var(--text-strong);
}

.projects-panel-head__text > h1 {
  margin: 0 0 8px;
  font-family: Sora, sans-serif;
  font-size: clamp(22px, 2.8vw, 28px);
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: var(--text-strong);
}

.projects-account-trigger__name {
  line-height: 1.15;
}

.projects-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-bottom: 8px;
}

.projects-title-row h1 {
  margin: 0;
  font-family: Sora, sans-serif;
  font-size: clamp(22px, 2.8vw, 28px);
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: var(--text-strong);
}

.projects-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.projects-action-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 999px;
  background-color: var(--accent);
  background-image: none;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.projects-action-btn:hover:not(:disabled) {
  background-color: var(--accent-hover);
  filter: none;
}

.projects-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.projects-action-btn--pending:disabled {
  opacity: 0.55;
  background-color: #94a3b8;
  background-image: none;
  cursor: not-allowed;
}

.projects-sentiment-status {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.projects-instruction {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.projects-panel-head__text .projects-instruction {
  margin: 0;
}

.projects-list-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.projects-list-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.projects-loading {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.projects-list-heading {
  margin: 0;
  font-family: Sora, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-strong);
}

.projects-list-history {
  margin-top: 4px;
  border: 1.5px solid rgba(45, 156, 74, 0.22);
  border-radius: var(--radius-md);
  background: rgba(248, 250, 252, 0.9);
  overflow: hidden;
}

.projects-list-history__summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  user-select: none;
}

.projects-list-history__summary::-webkit-details-marker {
  display: none;
}

.projects-list-history__summary::after {
  content: "▾";
  float: right;
  font-size: 16px;
  font-weight: 400;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.projects-list-history:not([open]) .projects-list-history__summary::after {
  transform: rotate(-90deg);
}

.projects-list-history__body {
  padding: 0 12px 12px;
}

.projects-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.projects-row {
  display: flex;
  align-items: center;
  gap: 22px;
  width: 100%;
  min-height: 88px;
  padding: 22px 24px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.projects-row:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(45, 156, 74, 0.1);
}

.projects-row.is-active {
  border-color: var(--accent);
  background: rgba(45, 156, 74, 0.05);
  box-shadow: 0 4px 14px rgba(45, 156, 74, 0.1);
}

.projects-row__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  flex: 0 1 280px;
  min-width: 170px;
  max-width: 320px;
}

.projects-row__toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
  align-items: center;
  justify-content: stretch;
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  padding-right: 44px;
}

.projects-hub-btn {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  font-size: 15px;
  line-height: 1.2;
  background-color: var(--accent);
  background-image: none;
  color: #fff;
  filter: none;
}

.projects-hub-btn:hover:not(:disabled) {
  background-color: var(--accent-hover);
  filter: none;
}

.projects-hub-btn__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.projects-row__action-store {
  display: none !important;
}

.projects-row__toolbar .projects-action-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  padding: 9px 14px;
  font-size: 12px;
}

.projects-row__toolbar .projects-hub-btn {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  padding: 16px 28px;
  font-size: 15px;
  background-color: var(--accent);
  background-image: none;
  color: #fff;
}

.projects-modal--hub .projects-hub-modal__panel {
  width: min(560px, 100%);
  max-height: none;
  overflow: visible;
  padding: 28px;
  border-radius: 20px;
  border-color: rgba(45, 156, 74, 0.28);
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.16);
  background:
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(45, 156, 74, 0.08), transparent 55%),
    #fff;
  animation: projects-hub-modal-in 180ms ease-out;
}

@keyframes projects-hub-modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.projects-hub-modal__header {
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.projects-hub-modal__heading h2 {
  margin: 0;
  font-family: Sora, sans-serif;
  font-size: 22px;
  line-height: 1.25;
  color: var(--text-strong);
}

.projects-hub-modal__heading .projects-modal__subtitle {
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
}

.projects-hub-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.projects-hub-modal__actions[hidden] {
  display: none !important;
}

.projects-hub-action {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1.5px solid rgba(45, 156, 74, 0.22);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f4fbf6 100%);
  color: var(--text-strong);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(45, 156, 74, 0.08);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.projects-hub-action:hover:not(:disabled) {
  border-color: rgba(45, 156, 74, 0.5);
  background: linear-gradient(180deg, #ffffff 0%, #eaf8ee 100%);
  box-shadow: 0 10px 24px rgba(45, 156, 74, 0.14);
  transform: translateY(-1px);
}

.projects-hub-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.projects-hub-action:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  background: #f8fafc;
  border-color: var(--border);
}

.projects-hub-action.projects-action-btn--pending:disabled {
  opacity: 0.62;
  background: #f1f5f9;
}

.projects-hub-action__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 14px rgba(45, 156, 74, 0.28);
}

.projects-hub-action__icon svg {
  width: 20px;
  height: 20px;
}

.projects-hub-action__copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}

.projects-hub-action__label {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.25;
  color: var(--text-strong);
}

.projects-hub-action__meta {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--muted);
}

.projects-hub-action__chevron {
  flex-shrink: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--accent);
  opacity: 0.7;
}

.projects-hub-action:disabled .projects-hub-action__icon {
  background: #94a3b8;
  box-shadow: none;
}

.projects-hub-action:disabled .projects-hub-action__chevron {
  color: #94a3b8;
}

.projects-hub-action-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.projects-hub-inline-hint {
  margin: 0;
  padding: 0 4px 2px 62px;
  font-size: 12px;
  line-height: 1.35;
  color: #92600a;
}

.projects-hub-inline-hint[hidden] {
  display: none !important;
}

.projects-row > .projects-action-hint,
.projects-action-hint--run,
.projects-action-hint--view {
  display: none !important;
}

.projects-row__tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.projects-row__name {
  font-weight: 700;
  font-size: 18px;
  line-height: 1.25;
  color: var(--text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.projects-row-btn[data-action="dashboard"] {
  /* inherits toolbar pill sizing */
}

.projects-row-delete {
  flex-shrink: 0;
  border: 1px solid #fecaca;
  background: #fff;
  color: #dc2626;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 999px;
  line-height: 1;
  font-size: 15px;
  padding: 0;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.projects-row__toolbar .projects-row-delete {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.projects-row-delete:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #f87171;
}

.projects-row__toolbar .projects-row-delete:hover:not(:disabled) {
  transform: translateY(-50%) scale(1.05);
}

.projects-row-delete:focus-visible {
  outline: 2px solid #f87171;
  outline-offset: 2px;
}

.projects-row-delete:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.projects-row .projects-action-btn:not(.projects-hub-btn):not(.projects-hub-action) {
  width: auto;
  min-width: 0;
  padding: 9px 14px;
  text-align: center;
  font-size: 12px;
}

.projects-row .projects-hub-btn {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  max-width: none;
  padding: 16px 28px;
  font-size: 15px;
  text-align: center;
  background-color: var(--accent);
  background-image: none;
  color: #fff;
}

.projects-action-hint {
  margin: 0;
  padding: 0 2px;
  font-size: 10px;
  line-height: 1.35;
  text-align: center;
  color: #64748b;
}

.projects-action-hint[hidden] {
  display: none;
}

.projects-action-hint--run {
  color: #92600a;
}

.projects-action-hint--view {
  color: #64748b;
}

.projects-row--hint-info .projects-action-hint--run {
  color: var(--text-strong, #1a1a1a);
  font-weight: 500;
}

.projects-row:not([data-status-loaded="true"]) .projects-action-hint {
  display: none !important;
}

.projects-row .projects-action-btn[data-action="run-sentiment"] {
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.projects-row--analyzing .projects-action-btn[data-action="run-sentiment"]:disabled,
.projects-row--run-pending .projects-action-btn[data-action="run-sentiment"]:disabled {
  opacity: 0.88;
  cursor: wait;
}

.projects-row--survey-running .projects-action-btn[data-action="run-survey"]:disabled {
  opacity: 0.88;
  cursor: wait;
}

.projects-row--validation-running .projects-action-btn[data-action="run-validation"]:disabled {
  opacity: 0.88;
  cursor: wait;
}

.projects-row__date {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.projects-list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  font: inherit;
  color: inherit;
}

.projects-list-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(45, 156, 74, 0.1);
}

.projects-list-item.is-active {
  border-color: var(--accent);
  background: rgba(45, 156, 74, 0.06);
  box-shadow: 0 4px 14px rgba(45, 156, 74, 0.12);
}

.projects-list-item__tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.projects-list-item__name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-strong);
}

.projects-list-item__meta {
  font-size: 12px;
  color: var(--muted);
}

.projects-list-item__date {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}

.projects-create-toggle {
  align-self: flex-start;
  margin-top: 8px;
  padding: 14px 36px;
  min-width: min(280px, 100%);
  border: none;
  border-radius: 999px;
  background-color: var(--accent);
  background-image: none;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  cursor: pointer;
  filter: none;
  transition: background-color 0.15s ease;
}

.projects-create-toggle:hover {
  background-color: var(--accent-hover);
  filter: none;
}

.projects-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.projects-modal.is-open {
  display: flex;
}

.projects-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(4px);
}

.projects-modal__panel {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(90dvh, 720px);
  overflow-y: auto;
  padding: clamp(16px, 2vh, 22px);
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1.5px solid rgba(45, 156, 74, 0.32);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
}

.projects-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.projects-modal__header h2 {
  margin: 0;
  font-family: Sora, sans-serif;
  font-size: 18px;
}

.projects-modal__close {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
}

.projects-modal__close:hover {
  color: var(--text-strong);
}

.projects-modal--danger .projects-modal__panel {
  width: min(440px, 100%);
  border-color: rgba(220, 38, 38, 0.35);
}

.projects-modal__panel--compact {
  max-height: none;
  overflow: visible;
}

.projects-delete-lead {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-strong);
}

.projects-delete-lead strong {
  color: #b91c1c;
}

.projects-delete-desc {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.projects-delete-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.projects-delete-btn-cancel,
.projects-delete-btn-confirm {
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.projects-delete-btn-cancel {
  background: var(--surface-muted);
  color: var(--text-strong);
  border: 1px solid var(--border);
}

.projects-delete-btn-cancel:hover {
  background: #f1f5f9;
}

.projects-delete-btn-confirm {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.28);
}

.projects-delete-btn-confirm:hover:not(:disabled) {
  background: #b91c1c;
}

.projects-delete-btn-confirm:disabled {
  opacity: 0.7;
  cursor: wait;
}

.projects-field--full {
  grid-column: 1 / -1;
}

.projects-list-panel,
.projects-create-panel {
  padding: clamp(12px, 1.5vh, 16px) clamp(12px, 1.5vw, 16px);
  border: 1.5px solid rgba(45, 156, 74, 0.32);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
}

.projects-panel-head {
  margin-bottom: 10px;
}

.projects-panel-head h2 {
  margin: 0;
  font-family: Sora, sans-serif;
  font-size: clamp(14px, 1.5vw, 16px);
  line-height: 1.25;
}

.projects-panel-hint {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}

.projects-error {
  margin: 0 0 10px;
  padding: 8px 12px;
  font-size: 13px;
}

.project-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(420px, 55dvh);
  overflow-y: auto;
}

.project-card {
  display: block;
  width: 100%;
  text-align: left;
  text-decoration: none;
  color: inherit;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(45, 156, 74, 0.12);
}

.project-card.is-active {
  border-color: var(--accent);
  background: rgba(45, 156, 74, 0.06);
}

.project-card__name {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-strong);
}

.project-card__meta {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.project-card__meta--muted {
  font-size: 11px;
}

.project-card__date {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}

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

.projects-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.projects-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px clamp(8px, 1.2vw, 12px);
}

.projects-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.projects-form label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.projects-form label .required {
  color: #b91c1c;
}

.projects-form input:not([type="radio"]):not([type="checkbox"]),
.projects-form select,
.projects-form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  box-sizing: border-box;
}

.projects-form textarea {
  resize: vertical;
  min-height: 3.2em;
  max-height: 8em;
}

.projects-submit {
  width: 100%;
  margin: 0;
  padding: 11px 16px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.projects-submit:hover:not(:disabled) {
  filter: brightness(1.05);
}

.projects-submit:disabled {
  cursor: wait;
  opacity: 0.92;
}

.projects-form.is-submitting input:not([type="radio"]):not([type="checkbox"]),
.projects-form.is-submitting textarea,
.projects-form.is-submitting select {
  pointer-events: none;
}

.projects-modal__subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.projects-field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.survey-mode-section {
  margin: 0 0 14px;
}

.survey-mode-legend {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong, #1a1a1a);
}

.projects-form .survey-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.projects-form .survey-mode-option {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  font-weight: 400;
  line-height: 1.35;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.projects-form .survey-mode-option input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.projects-form .survey-mode-option__radio {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 2px solid #c5cdd8;
  border-radius: 50%;
  background: #fff;
  box-sizing: border-box;
  position: relative;
}

.projects-form .survey-mode-option input[type="radio"]:checked + .survey-mode-option__radio {
  border-color: var(--accent, #2f9e44);
}

.projects-form .survey-mode-option input[type="radio"]:checked + .survey-mode-option__radio::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, #2f9e44);
  transform: translate(-50%, -50%);
}

.projects-form .survey-mode-option__card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.projects-form .survey-mode-option__card strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong, #1a1a1a);
  line-height: 1.3;
}

.projects-form .survey-mode-option__hint {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.35;
}

.projects-form .survey-mode-option:has(input[type="radio"]:checked) {
  border-color: var(--accent, #2f9e44);
  box-shadow: 0 0 0 1px rgba(47, 158, 68, 0.18);
  background: rgba(47, 158, 68, 0.04);
}

.projects-form .survey-mode-option input[type="radio"]:focus-visible + .survey-mode-option__radio {
  outline: 2px solid var(--accent, #2f9e44);
  outline-offset: 2px;
}

.survey-mode-summary {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.survey-manual-panel {
  margin-bottom: 8px;
}

.survey-demographic-fields {
  display: contents;
}

.survey-manual-note {
  margin: 0 0 14px;
}

.projects-submit.is-busy {
  position: relative;
}

.projects-nav-overlay {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 4000;
  background: rgba(238, 242, 247, 0.72);
  backdrop-filter: blur(10px) saturate(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(1.05);
  align-items: center;
  justify-content: center;
}

.projects-nav-overlay.is-visible {
  display: flex;
  animation: projects-nav-overlay-fade-in 170ms ease-out both;
}

.projects-nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  max-width: min(440px, calc(100vw - 48px));
  padding: 32px 40px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
}

.projects-nav-spinner {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 3px solid rgba(45, 156, 74, 0.22);
  border-top-color: var(--accent);
  animation: projects-nav-spin 0.85s linear infinite;
}

.projects-nav-overlay p {
  margin: 0;
  font-family: Sora, sans-serif;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.35;
  color: var(--text-strong);
  font-weight: 600;
}

.projects-nav-subtext {
  margin: 0;
  max-width: 32ch;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted);
}

@keyframes projects-nav-overlay-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Tablet: stack columns, keep 2-col form */
@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .projects-page-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .projects-account-rail {
    max-width: 360px;
    position: static;
  }

  .projects-center {
    justify-content: stretch;
  }

  .projects-shell {
    width: 100%;
  }

  .project-cards {
    max-height: min(280px, 35dvh);
  }
}

/* Narrow tablet / large phone */
@media (max-width: 768px) {
  .projects-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  .projects-row__info {
    flex: 1 1 100%;
    max-width: none;
  }

  .projects-row__toolbar {
    justify-content: stretch;
    flex-wrap: wrap;
    min-width: 0;
    width: 100%;
    padding-right: 40px;
  }

  .projects-hub-btn,
  .projects-row__toolbar .projects-hub-btn {
    flex: 1 1 calc(50% - 24px);
    min-width: 140px;
    max-width: none;
    padding: 12px 18px;
  }

  .projects-row__toolbar .projects-action-btn:not(.projects-hub-btn) {
    flex: 1 1 calc(50% - 4px);
    min-width: 120px;
  }

  .projects-form-grid {
    grid-template-columns: 1fr;
  }

  .projects-form .survey-mode-toggle {
    grid-template-columns: 1fr;
  }

  .project-cards {
    max-height: none;
    overflow: visible;
  }
}

/* Phone */
@media (max-width: 480px) {
  .projects-page {
    padding: 8px 10px 20px;
  }

  .projects-form input,
  .projects-form select,
  .projects-form textarea {
    font-size: 16px;
  }
}

.sidebar-project-name {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sidebar-back-projects {
  display: block;
  width: 100%;
  margin-top: 8px;
  text-align: center;
  text-decoration: none;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
}

.sidebar-back-projects:hover {
  color: #fff;
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  .login-page,
  .login-backdrop {
    animation: none;
  }
}

@media (max-width: 900px) {
  .login-layout {
    grid-template-columns: 1fr;
    width: min(640px, 100%);
    gap: 14px;
  }

  .login-hero {
    min-height: auto;
    text-align: center;
  }

  .login-card {
    min-height: auto;
  }

  .login-hero-logos {
    justify-content: center;
  }

  .login-hero-logo {
    object-position: center;
    max-width: min(520px, 90vw);
    max-height: min(172px, 32vw);
  }

  .login-hero-logo-divider {
    height: min(120px, 26vw);
  }

  .login-hero-lede,
  .login-hero-points {
    margin-left: auto;
    margin-right: auto;
    text-align: left;
  }

  .login-hero-points li {
    text-align: left;
  }
}

.app-shell {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  box-sizing: border-box;
  overflow: hidden;
}

@keyframes dashboard-shell-enter {
  from {
    opacity: 0;
    transform: translate3d(18px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.app-shell.app-shell--enter {
  animation: dashboard-shell-enter 220ms cubic-bezier(0.25, 0.9, 0.3, 1) both;
}

.app-shell > .history-sidebar {
  min-height: 0;
}

.history-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.history-sidebar > .brand,
.history-sidebar > .sidebar-partners,
.history-sidebar > .sidebar-new-persona-btn {
  flex-shrink: 0;
}

.history-sidebar > .sidebar-panel--history {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar-panel--history.is-open {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0 8px 8px;
}

/* Match original <summary> look — reset native <button> chrome */
.sidebar-panel--history .sidebar-panel__summary {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 4px;
  width: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  user-select: none;
  flex-shrink: 0;
}

.sidebar-panel--history .sidebar-panel__summary:hover {
  color: var(--text);
}

.sidebar-panel--history .sidebar-panel__summary:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

.sidebar-panel--history:not(.is-open) .sidebar-panel__summary {
  margin: 0 2px 4px;
  padding: 0 4px 0 0;
  width: auto;
}

.sidebar-panel--history.is-open > .sidebar-panel__body {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.sidebar-panel--history.is-open > .sidebar-panel__body::-webkit-scrollbar {
  width: 6px;
}

.sidebar-panel--history.is-open > .sidebar-panel__body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.sidebar-panel--history:not(.is-open) > .sidebar-panel__body {
  display: none;
}

.brand h1 {
  margin: 0;
  font-size: 15px;
  font-family: Sora, sans-serif;
  line-height: 1.25;
  color: var(--text-strong);
}

.brand p,
.brand small {
  margin: 6px 0 0;
  color: var(--muted);
}

.history-title {
  margin: 0 2px -6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.sidebar-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.sidebar-panel:not(.is-open) {
  flex: 0 0 auto;
}

.sidebar-panel--history:not(.is-open) {
  flex: 0 0 auto;
}

.sidebar-panel__summary {
  margin: 0 2px 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  user-select: none;
}

.sidebar-panel__summary::-webkit-details-marker {
  display: none;
}

.sidebar-panel__summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.sidebar-panel[open] > .sidebar-panel__summary::after,
.sidebar-panel.is-open > .sidebar-panel__summary::after {
  transform: rotate(45deg);
  margin-top: -3px;
}

.sidebar-panel__body {
  min-height: 0;
}

.history-list {
  display: grid;
  gap: 6px;
  align-content: start;
}

.history-entry {
  position: relative;
}

.history-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text-strong);
  cursor: pointer;
  padding: 7px 28px 7px 9px;
  display: grid;
  gap: 2px;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.history-item:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
}

.history-item-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item small {
  color: var(--muted);
  font-size: 10px;
}

.history-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-ring);
}

.history-delete {
  position: absolute;
  top: 5px;
  right: 5px;
  border: 1px solid #fecaca;
  background: #fff;
  color: #dc2626;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  line-height: 18px;
  font-size: 15px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.history-delete:hover {
  background: #fef2f2;
  border-color: #f87171;
  transform: scale(1.05);
}

.history-delete:focus-visible {
  outline: 2px solid #f87171;
  outline-offset: 2px;
}

.toast-area {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 5000;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 28px));
  pointer-events: none;
}

.toast-area .toast {
  pointer-events: auto;
}

.toast {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-strong);
  box-shadow: var(--shadow-lg);
  padding: 11px 12px;
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast-success {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.toast-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.toast-info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
}

.toast-confirm .toast-text {
  color: var(--text-strong);
  margin-bottom: 9px;
  font-weight: 600;
}

.toast-danger {
  border-color: #fecaca;
  background: #fef2f2;
  box-shadow: var(--shadow-lg);
}

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

.toast-actions button {
  border: none;
  border-radius: 9px;
  padding: 7px 11px;
  font-weight: 600;
  cursor: pointer;
}

.toast-btn-cancel {
  background: var(--surface-muted);
  color: var(--text);
  border: 1px solid var(--border);
}

.toast-btn-delete {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.toast-btn-delete:hover {
  background: #b91c1c;
}

.toast-hide {
  opacity: 0;
  transform: translateY(-6px);
}

.history-empty {
  color: var(--muted);
  font-size: 12px;
}

.history-empty.is-loading {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 2px;
}

.history-empty.is-loading::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  animation: history-loading-spin 0.95s linear infinite;
  flex-shrink: 0;
}

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

.main-pane {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.personas-top,
.persona-setup-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  flex: 0 0 auto;
}

.persona-setup-panel[open] {
  flex: 0 0 auto;
  max-height: var(--persona-panel-max-h);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.persona-setup-panel[open] > .persona-setup-panel__summary {
  flex: 0 0 auto;
}

.persona-setup-panel[open] > .persona-setup-form {
  flex: 0 0 auto;
  max-height: var(--persona-form-max-h);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Slightly taller cap when creating a new persona (panel still compact) */
.app-shell[data-selected-persona=""] {
  --persona-panel-max-h: min(40vh, 330px);
  --persona-form-max-h: min(33vh, 270px);
}

/* Active chat: keep persona panel small so chat stays visible */
.app-shell[data-selected-persona]:not([data-selected-persona=""]) .persona-setup-panel[open] {
  --persona-panel-max-h: min(30vh, 260px);
  --persona-form-max-h: min(24vh, 215px);
}

.persona-setup-panel__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
}

.persona-setup-panel__summary::-webkit-details-marker {
  display: none;
}

.persona-setup-panel__summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.persona-setup-panel[open] > .persona-setup-panel__summary::after {
  transform: rotate(45deg);
  margin-top: -3px;
}

.personas-top h2,
.persona-setup-panel__summary h2 {
  margin: 0;
  font-family: Sora, sans-serif;
  font-size: 13px;
  line-height: 1.25;
  color: var(--text-strong);
}

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

.secondary-action {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text-strong);
  font-weight: 600;
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.secondary-action:hover {
  text-decoration: none;
}

.secondary-action:disabled {
  opacity: 0.72;
  cursor: wait;
}

.persona-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.persona-card {
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--persona-color), var(--border) 70%);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--persona-color), var(--surface) 88%);
  color: var(--text-strong);
  cursor: pointer;
  padding: 14px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  box-shadow: var(--shadow-sm);
}

.persona-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.persona-card.active {
  border-color: color-mix(in srgb, var(--persona-color), #fff 30%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--persona-color), transparent 60%);
}

.persona-card.pending {
  transform: scale(0.99);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--persona-color), #ffffff 55%);
  opacity: 0.88;
}

.persona-card:disabled {
  cursor: wait;
}

.persona-card h3 {
  margin: 0;
  font-size: 16px;
}

.persona-card p {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.persona-setup-panel[open] .persona-setup-form {
  margin-top: 6px;
  border-top: 1px solid var(--border);
  padding-top: 6px;
}

.persona-setup-form {
  min-height: 0;
}

.persona-setup-scroll {
  flex: 0 1 auto;
  min-height: 0;
  max-height: calc(var(--persona-form-max-h) - var(--persona-btn-row-h) - 0.5rem);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.persona-setup-actions {
  flex: 0 0 var(--persona-btn-row-h);
  padding-top: 8px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.persona-setup-actions button {
  width: 100%;
}

.persona-setup-form.is-locked {
  opacity: 0.58;
}

.persona-setup-form textarea {
  resize: vertical;
  min-height: 36px;
  max-height: 72px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-strong);
  padding: 8px;
  font-size: 13px;
}

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

.feature-control {
  display: grid;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 6px;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 10px;
}

.feature-control > span {
  font-weight: 600;
  color: var(--text-strong);
  font-size: 10px;
  line-height: 1.2;
}

.feature-control select {
  width: 100%;
  max-width: 100%;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-strong);
  padding: 3px 5px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slider-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

.slider-row input[type="range"] {
  width: 100%;
}

.slider-row output {
  min-width: 24px;
  text-align: right;
  color: var(--accent);
  font-weight: 700;
}

#startSimulationBtn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  background: var(--accent);
  box-shadow: 0 3px 10px rgba(45, 156, 74, 0.3);
  transition: background 0.15s ease;
}

#startSimulationBtn:hover {
  background: var(--accent-hover);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 6px;
  flex-shrink: 0;
}

.sidebar-partners {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  padding: 12px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  flex-shrink: 0;
}

.sidebar-partner-logo {
  display: block;
  height: clamp(44px, 6vh, 52px);
  width: auto;
  max-width: min(200px, 100%);
  object-fit: contain;
  object-position: center;
  opacity: 1;
}

.sidebar-partner-logo--unipd {
  max-width: clamp(40px, 5.5vh, 48px);
  max-height: clamp(40px, 5.5vh, 48px);
  width: auto;
  aspect-ratio: 1;
}

.sidebar-new-persona-btn {
  width: 100%;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 600;
  font-size: 11px;
  line-height: 1.3;
  padding: 8px 10px;
  cursor: pointer;
  text-align: center;
  flex-shrink: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sidebar-new-persona-btn:hover {
  border-color: var(--accent-hover);
  background: rgba(45, 156, 74, 0.18);
}

.sidebar-new-persona-btn:disabled {
  opacity: 0.72;
  cursor: wait;
}

.manager-box {
  padding-top: 0;
  border-top: none;
}

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

.manager-box .account-sign-out {
  margin-top: 10px;
}

.chat-pane {
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.chat-log {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 10px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  scrollbar-width: thin;
}

.chat-log--welcome {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0 20px;
}

.chat-start-compose {
  width: min(100%, 640px);
  margin: 0 auto;
}

.chat-start-compose__title {
  margin: 0 0 16px;
  font-family: Sora, sans-serif;
  font-size: clamp(17px, 2.2vw, 22px);
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  color: var(--text-strong);
}

.chat-start-compose__form {
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.chat-start-compose__form textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  max-height: 160px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-strong);
  font-size: 14px;
  line-height: 1.4;
  padding: 11px 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chat-start-compose__form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.bubble {
  max-width: 78%;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
}

.bubble .role {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 4px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 600;
}

.bubble p {
  margin: 0;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-strong);
}

.bubble.user {
  justify-self: end;
  background: var(--accent);
  border: 1px solid var(--accent-hover);
}

.bubble.user .role {
  color: rgba(255, 255, 255, 0.85);
}

.bubble.user p {
  color: #fff;
}

.bubble.assistant {
  justify-self: start;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.bubble.typing {
  min-width: 96px;
  min-height: 44px;
}

.bubble.typing .typing-dots {
  padding: 4px 0 2px;
}

.typing-dots {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 18px;
}

.typing-dots span {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  animation: typing-bounce 1.1s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.55;
  }
  40% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.empty-state {
  place-self: center;
  text-align: center;
  font-size: 13px;
}

.empty-state h3 {
  margin-bottom: 6px;
  font-size: 15px;
  color: var(--text-strong);
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  flex-shrink: 0;
  align-self: stretch;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 8px 10px;
}

.chat-form textarea {
  resize: vertical;
  min-height: 48px;
  max-height: 120px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-strong);
  font-size: 13px;
  line-height: 1.35;
  padding: 8px 11px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chat-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.chat-form button {
  align-self: center;
  height: 48px;
  border: none;
  border-radius: var(--radius-sm);
  min-width: 84px;
  padding: 0 20px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  background: var(--accent);
  box-shadow: 0 3px 10px rgba(45, 156, 74, 0.28);
  transition: background 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-form button:hover {
  background: var(--accent-hover);
}

.chat-form.chat-form--hidden {
  display: none;
}

@media (max-height: 820px) {
  :root {
    --persona-panel-max-h: min(36vh, 280px);
    --persona-form-max-h: min(30vh, 230px);
  }

  .app-shell[data-selected-persona=""] {
    --persona-panel-max-h: min(40vh, 300px);
    --persona-form-max-h: min(33vh, 250px);
  }
}

@media (max-height: 640px) {
  :root {
    --persona-panel-max-h: min(38vh, 260px);
    --persona-form-max-h: min(31vh, 210px);
  }

  .app-shell[data-selected-persona=""] {
    --persona-panel-max-h: min(42vh, 280px);
    --persona-form-max-h: min(34vh, 230px);
  }
}

@media (max-width: 1280px) {
  .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1040px) {
  :root {
    --sidebar-width: 212px;
  }

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

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .history-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    max-height: min(190px, 28vh);
    flex: 0 1 auto;
    overflow: hidden;
  }

  .history-sidebar:has(.sidebar-panel--history.is-open),
  .history-sidebar.is-history-expanded {
    max-height: min(360px, 52vh);
    overflow: hidden;
  }

  .history-sidebar:has(.sidebar-panel--history.is-open) .sidebar-partners,
  .history-sidebar.is-history-expanded .sidebar-partners {
    display: none;
  }

  .sidebar-panel--history:not(.is-open) {
    margin-bottom: -4px;
  }

  .sidebar-panel--history.is-open,
  .history-sidebar.is-history-expanded .sidebar-panel--history {
    flex: 1 1 0;
    min-height: 0;
  }

  .sidebar-panel--history.is-open > .sidebar-panel__body,
  .history-sidebar.is-history-expanded .sidebar-panel__body {
    flex: 1 1 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .history-entry {
    min-width: 0;
  }

  .main-pane {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    --persona-panel-max-h: min(38dvh, 300px);
    --persona-form-max-h: min(31dvh, 250px);
  }

  .app-shell[data-selected-persona=""] .main-pane {
    --persona-panel-max-h: min(42dvh, 320px);
    --persona-form-max-h: min(34dvh, 265px);
  }

  .chat-pane {
    flex: 1 1 auto;
    min-height: min(42dvh, 340px);
  }

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

@media (max-width: 680px) {
  .main-pane {
    --persona-panel-max-h: min(40dvh, 290px);
    --persona-form-max-h: min(32dvh, 235px);
  }

  .app-shell[data-selected-persona=""] .main-pane {
    --persona-panel-max-h: min(44dvh, 310px);
    --persona-form-max-h: min(35dvh, 255px);
  }

  .feature-grid,
  .persona-list {
    grid-template-columns: 1fr;
  }

  .login-hero-logos {
    justify-content: center;
  }

  .login-hero-logo {
    max-height: 56px;
    object-position: center;
  }
}

/* --- App section nav (Persona / Sentiment) --- */
.sidebar-app-nav {
  display: grid;
  gap: 6px;
  margin: 10px 0 12px;
}

.sidebar-nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sidebar-nav-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.sidebar-nav-link.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text-strong);
}

/* --- Sentiment analysis page --- */
body:has(.sentiment-shell),
body:has(.sentiment-page) {
  height: auto;
  max-height: none;
  overflow: auto;
}

.sentiment-shell {
  min-height: 100dvh;
}

.sentiment-page-body,
.sentiment-main {
  overflow: auto;
  padding: 18px 20px 28px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.sentiment-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sentiment-header h2 {
  margin: 0;
  font-family: Sora, sans-serif;
  font-size: 22px;
}

.sentiment-lede {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 52ch;
}

.sentiment-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

.sentiment-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.primary-action {
  border: none;
  border-radius: 10px;
  background-color: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.primary-action:hover,
.primary-action:focus-visible {
  background-color: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}

.primary-action:active {
  background-color: #1f7a38;
  color: #fff;
}

.primary-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

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

.metric-card strong {
  font-size: 24px;
  font-family: Sora, sans-serif;
}

.metric-card strong.pos {
  color: var(--accent);
}

.metric-card strong.neg {
  color: #dc2626;
}

.card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.card-panel h3 {
  margin: 0 0 10px;
  font-family: Sora, sans-serif;
  font-size: 16px;
}

.sentiment-summary {
  min-height: 340px;
  padding: 24px 26px;
}

.sentiment-summary__body p {
  margin: 0 0 0.85rem;
  line-height: 1.6;
  color: var(--text);
}

.sentiment-summary__body p:last-child {
  margin-bottom: 0;
}

.sentiment-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.sentiment-charts--stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  width: 100%;
  margin: 0;
  grid-template-columns: unset;
}

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

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

.chart-card {
  margin: 0;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}

.chart-card--centered {
  width: 100%;
  max-width: none;
  align-items: stretch;
}

.chart-card__caption {
  margin: 0 0 10px;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
}

.chart-card img {
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  object-fit: contain;
  object-position: left top;
  display: block;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.chart-card:not(.chart-card--scatter) img {
  min-height: 240px;
}

.chart-card--scatter {
  padding-bottom: 8px;
}

.chart-card--scatter img {
  min-height: 0;
  height: auto;
  vertical-align: top;
}

.polarity-plotly-host {
  width: 100%;
}

/* Polarity scatter: plot left, colourful legend right (ViolaPulse-style) */
.pv-scatter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  grid-template-rows: auto;
  column-gap: 16px;
  align-items: start;
  width: 100%;
}

.pv-scatter__plot-wrap {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  width: 100%;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  overflow: hidden;
}

.pv-scatter__plot {
  width: 100%;
  height: 440px;
  min-height: 440px;
}

.pv-scatter__legend {
  grid-column: 2;
  grid-row: 1;
  width: 200px;
  padding: 6px 0 0 4px;
}

.pv-scatter__legend-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}

.pv-scatter__legend-items {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.pv-scatter__legend-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 8px;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  line-height: 1.3;
  color: var(--text);
}

.pv-scatter__legend-item:hover .pv-scatter__legend-label {
  opacity: 0.85;
}

.pv-scatter__legend-item.is-off {
  opacity: 0.38;
}

.pv-scatter__legend-item.is-off .pv-scatter__legend-label {
  text-decoration: line-through;
}

.pv-scatter__legend-dot {
  display: block;
  justify-self: center;
  align-self: center;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.15);
}

.pv-scatter__legend-label {
  min-width: 0;
}

.polarity-plotly__empty {
  margin: 0;
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.chart-card--scatter .pv-scatter {
  min-height: 440px;
}

.sentiment-methodology {
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  border-left: 3px solid var(--accent);
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
}

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

.sentiment-category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.sentiment-category-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}

.sentiment-category-list .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

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

.sample-list li {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.sample-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.sample-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.sample-meta .pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-strong);
  font-weight: 600;
}

.sample-list p {
  margin: 0;
  line-height: 1.45;
  font-size: 14px;
}

.sentiment-empty {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
}

.sentiment-empty h3 {
  margin: 0 0 8px;
}

.sentiment-empty p {
  margin: 0 0 16px;
  color: var(--muted);
}

.sentiment-scope-bar {
  display: grid;
  gap: 10px;
}

.sentiment-scope-bar__head {
  display: grid;
  gap: 4px;
}

.sentiment-scope-label {
  font-family: Sora, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
}

.sentiment-scope-hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.sentiment-scope-bar__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.sentiment-scope-select {
  flex: 1;
  min-width: 220px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: Outfit, sans-serif;
}

.sentiment-stale-banner {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  background: #fffbeb;
  color: #92400e;
}

.sentiment-stale-banner strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.sentiment-stale-banner p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.sentiment-view-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.sentiment-view-banner.is-session {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
}

.view-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.sentiment-view-banner.is-session .view-badge {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.view-meta {
  font-size: 13px;
  color: var(--muted);
  width: 100%;
}

.sentiment-charts--session {
  grid-template-columns: 1fr;
}

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

.sentiment-taxonomy h3 {
  margin: 0 0 4px;
  font-family: Sora, sans-serif;
  font-size: 15px;
}

.sentiment-taxonomy-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
}

.aspect-chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.aspect-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.aspect-chip.is-detected {
  border: 1.5px solid rgba(45, 156, 74, 0.38);
  background: linear-gradient(180deg, #f7fcf8 0%, #e8f6ed 100%);
  color: #1f6b38;
  box-shadow: 0 1px 3px rgba(45, 156, 74, 0.1);
  cursor: default;
}

.aspect-chip--placeholder {
  font-style: italic;
  color: var(--muted);
}

.sentiment-aspect-insights .aspect-insight-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.aspect-insight-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.aspect-insight-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.aspect-insight-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
}

.aspect-insight-item strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.aspect-insight-meta {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.aspect-insight-item p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.sentiment-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(238, 243, 249, 0.92);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease, visibility 0.14s ease;
}

.sentiment-loading-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.app-nav-overlay {
  z-index: 10000;
}

.sentiment-loading-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 40px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  max-width: min(440px, calc(100vw - 48px));
}

.sentiment-loading-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 18px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: sentiment-spin 0.85s linear infinite;
}

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

.sentiment-loading-title {
  margin: 0 0 8px;
  font-family: Sora, sans-serif;
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 600;
  line-height: 1.35;
}

.sentiment-loading-sub {
  margin: 0;
  font-size: clamp(14px, 1.6vw, 16px);
  color: var(--muted);
  line-height: 1.45;
}

body.sentiment-is-loading {
  overflow: hidden;
}

.sentiment-page {
  min-height: 100dvh;
  background: #eef3f9;
  display: flex;
  flex-direction: column;
}

.sentiment-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(45, 156, 74, 0.25);
  background: rgba(255, 255, 255, 0.96);
}

.sentiment-topbar__brand {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 24px);
  flex-shrink: 0;
}

.sentiment-topbar__logo {
  max-height: clamp(52px, 7vh, 68px);
  width: auto;
  max-width: min(280px, 38vw);
  object-fit: contain;
}

.sentiment-topbar__logo--unipd {
  max-height: clamp(48px, 6.5vh, 64px);
  max-width: clamp(48px, 6.5vh, 64px);
  aspect-ratio: 1;
}

.sentiment-topbar__center {
  flex: 1 1 220px;
  min-width: 0;
}

.sentiment-topbar__center h1 {
  margin: 0;
  font-family: Sora, sans-serif;
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.sentiment-topbar__project {
  margin: 6px 0 0;
  font-size: clamp(17px, 2vw, 22px);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

.sentiment-topbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.sentiment-topbar__actions .primary-action,
.sentiment-scope-bar__row .primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
}

.sentiment-topbar__actions .primary-action:hover,
.sentiment-scope-bar__row .primary-action:hover {
  color: #fff;
  text-decoration: none;
}

.sentiment-topbar__actions .primary-action--pending:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.sentiment-topbar__actions button.primary-action {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.sentiment-page-body {
  flex: 1;
  width: min(1360px, 100%);
  margin: 0 auto;
  padding: 18px 20px 28px;
  box-sizing: border-box;
}

.sentiment-aspect-table .sentiment-table-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--muted);
}

.aspect-table-wrap {
  overflow-x: auto;
}

.aspect-sentiment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.aspect-sentiment-table th,
.aspect-sentiment-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
}

.aspect-sentiment-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.aspect-table-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.aspect-source-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--surface-muted);
  color: var(--muted);
}

.aspect-source-pill--emergent {
  background: #fef3c7;
  color: #92400e;
}

.aspect-source-pill--llm {
  background: #e0e7ff;
  color: #3730a3;
}

.aspect-source-pill--taxonomy {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

@media (max-width: 900px) {
  .sentiment-charts--aspects {
    grid-template-columns: 1fr;
  }
}

.persona-score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.persona-score-table th,
.persona-score-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.persona-score-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 600;
}

.persona-score-table td.pos,
.persona-score-table td.neg {
  font-weight: 600;
  font-family: Sora, sans-serif;
}

.table-link {
  color: var(--accent-hover);
  font-weight: 600;
  text-decoration: none;
  font-size: 13px;
}

.table-link:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .sentiment-metrics,
  .sentiment-charts,
  .sentiment-charts--pair,
  .sentiment-charts--grid {
    grid-template-columns: 1fr;
  }

  .chart-card:not(.chart-card--scatter) img {
    min-height: 200px;
  }

  .chart-card--scatter img {
    min-height: 0;
  }
}

.survey-metrics {
  margin-top: 16px;
}

.survey-executive {
  padding: 22px 24px;
}

.survey-executive__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.survey-executive__head h3 {
  margin: 0;
}

.survey-executive__headline {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-strong, #1a1a1a);
}

.survey-executive__setup {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.survey-overview__demographics {
  margin: 16px 0 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.survey-overview__demographics h4 {
  margin: 0 0 6px;
  font-size: 14px;
  font-family: Sora, sans-serif;
}

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

.survey-overview__chart {
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.survey-overview__chart h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-family: Sora, sans-serif;
}

.survey-executive__para {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.survey-executive__para:last-of-type {
  margin-bottom: 18px;
}

.survey-fit-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.survey-fit-badge--strong {
  background: rgba(47, 158, 68, 0.12);
  color: #1f7a35;
  border: 1px solid rgba(47, 158, 68, 0.22);
}

.survey-fit-badge--moderate {
  background: rgba(245, 158, 11, 0.12);
  color: #9a6700;
  border: 1px solid rgba(245, 158, 11, 0.22);
}

.survey-fit-badge--weak {
  background: rgba(220, 38, 38, 0.08);
  color: #b42318;
  border: 1px solid rgba(220, 38, 38, 0.18);
}

.survey-fit-badge--unknown {
  background: rgba(0, 0, 0, 0.04);
  color: var(--muted);
  border: 1px solid var(--border);
}

.survey-snapshot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.survey-snapshot-tile {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fafbfc;
}

.survey-snapshot-tile__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 6px;
}

.survey-snapshot-tile__value {
  display: block;
  font-size: 22px;
  line-height: 1.1;
  font-family: Sora, sans-serif;
  color: var(--text-strong, #1a1a1a);
  margin-bottom: 4px;
}

.survey-snapshot-tile__hint {
  display: block;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
}

.survey-insight-block .survey-insight-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.survey-insight-block .survey-insight {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-strong, #1a1a1a);
}

.survey-insight-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.survey-insight {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #fff;
}

.survey-insight strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.survey-insight p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-strong, #1a1a1a);
}

.survey-insight--gap {
  border-color: rgba(220, 38, 38, 0.18);
  background: rgba(220, 38, 38, 0.03);
}

.survey-insight--gap strong {
  color: #b42318;
}

.survey-insight--aligned {
  border-color: rgba(47, 158, 68, 0.2);
  background: rgba(47, 158, 68, 0.04);
}

.survey-insight--aligned strong {
  color: #1f7a35;
}

.survey-gap {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.survey-gap--low {
  background: rgba(47, 158, 68, 0.12);
  color: #1f7a35;
}

.survey-gap--medium {
  background: rgba(245, 158, 11, 0.14);
  color: #9a6700;
}

.survey-gap--high {
  background: rgba(220, 38, 38, 0.1);
  color: #b42318;
}

@media (max-width: 900px) {
  .survey-snapshot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .survey-insight-list {
    grid-template-columns: 1fr;
  }
}

.survey-intro-panel {
  margin-bottom: 0;
}

.survey-chart-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.survey-chart-overview {
  margin-bottom: 0;
}

.survey-chart-overview__summary {
  cursor: pointer;
  list-style: none;
}

.survey-chart-overview__summary::-webkit-details-marker {
  display: none;
}

.survey-chart-overview__summary h3 {
  display: inline;
  margin: 0;
  font-size: 16px;
}

.survey-utility-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.survey-utility-panel h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.survey-utility-summary {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.survey-utility-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.survey-utility-table-wrap {
  overflow-x: auto;
  margin-top: 8px;
}

.survey-corr-panel {
  margin-top: 8px;
}

.survey-corr-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.survey-corr-zoom-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-strong);
}

.survey-corr-zoom {
  width: 140px;
  accent-color: #4c6ef5;
}

.survey-corr-toolbar__hint,
.survey-corr-scroll-status {
  font-size: 11px;
  color: var(--muted);
  flex: 1 1 180px;
}

.survey-corr-table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 0;
  overflow: auto;
  max-height: min(75vh, 780px);
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  --corr-font-size: 12px;
  --corr-col-scale: 1;
  --corr-row-label-width: 240px;
  position: relative;
}

.survey-corr-table-wrap.is-scrollable-x {
  box-shadow: inset -14px 0 14px -14px rgba(0, 0, 0, 0.1);
}

.survey-corr-table-wrap.is-scrollable-x.is-scrolled-x {
  box-shadow:
    inset 14px 0 14px -14px rgba(0, 0, 0, 0.08),
    inset -14px 0 14px -14px rgba(0, 0, 0, 0.1);
}

.survey-corr-table-wrap.is-scrollable-x.is-scrolled-x-end {
  box-shadow: inset 14px 0 14px -14px rgba(0, 0, 0, 0.08);
}

.survey-corr-scroll-hint {
  margin: 0;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.survey-corr-pairs {
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 4px;
}

.survey-corr-pairs .survey-insight {
  overflow-wrap: anywhere;
}

.survey-utility-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.survey-corr-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--corr-font-size, 12px);
}

.survey-utility-table th,
.survey-utility-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.survey-corr-table th,
.survey-corr-table td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: center;
  vertical-align: middle;
}

.survey-corr-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-muted);
  font-weight: 600;
}

.survey-corr-table thead th.survey-corr-col-label {
  writing-mode: horizontal-tb;
  transform: none;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
  text-align: center;
  vertical-align: bottom;
  line-height: 1.3;
  padding: 10px 8px 8px;
  font-size: calc(var(--corr-font-size, 12px) * 0.95);
}

.survey-corr-table tbody th,
.survey-corr-table .survey-corr-row-label {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--surface);
  font-weight: 600;
  text-align: left;
  width: var(--corr-row-label-width, 240px);
  min-width: var(--corr-row-label-width, 240px);
  max-width: var(--corr-row-label-width, 240px);
  white-space: normal;
  overflow: hidden;
  text-overflow: unset;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  padding: 8px 12px 8px 10px;
  box-shadow: 4px 0 8px -4px rgba(0, 0, 0, 0.12);
}

.survey-corr-table thead th.survey-corr-corner,
.survey-corr-table thead th:first-child {
  left: 0;
  z-index: 4;
  background: var(--surface-muted);
  width: var(--corr-row-label-width, 240px);
  min-width: var(--corr-row-label-width, 240px);
  max-width: none;
}

.survey-corr-table .survey-corr-cell {
  min-width: 52px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.survey-segment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.survey-segment-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 14px 16px;
  background: var(--surface-alt);
}

.survey-segment-card__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.survey-segment-card__head span {
  color: var(--muted);
  font-size: 12px;
}

.survey-segment-card__block {
  margin-top: 14px;
}

.survey-segment-card__block + .survey-segment-card__block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.survey-segment-card__label {
  margin: 0 0 8px;
  font-family: Sora, sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-strong);
}

.survey-segment-card ul,
.survey-corr-pairs ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
}

.survey-segment-card li span,
.survey-corr-pairs li span {
  color: var(--muted);
}

.survey-demo-dimension {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: var(--surface-alt);
}

.survey-demo-dimension summary {
  cursor: pointer;
  font-size: 13px;
}

.survey-demo-question {
  margin-top: 10px;
}

.survey-demo-question > p {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--text);
}

.survey-demo-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.survey-demo-bar-row {
  display: grid;
  grid-template-columns: minmax(80px, 120px) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  max-width: 100%;
  min-width: 0;
}

.survey-demo-bar-row__label {
  color: var(--muted);
}

.survey-demo-bar-row__track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
}

.survey-demo-bar-row__fill {
  height: 100%;
  border-radius: 999px;
  background: #4c6ef5;
}

.survey-demo-bar-row__value {
  text-align: right;
  font-weight: 600;
}

.survey-corr-cell {
  text-align: center;
  font-size: 10px;
  min-width: 42px;
}

.survey-corr-cell--strong-pos {
  background: rgba(47, 158, 68, 0.35);
}

.survey-corr-cell--moderate-pos {
  background: rgba(47, 158, 68, 0.18);
}

.survey-corr-cell--strong-neg {
  background: rgba(220, 38, 38, 0.28);
}

.survey-corr-cell--moderate-neg {
  background: rgba(220, 38, 38, 0.14);
}

.survey-corr-cell--weak {
  background: transparent;
}

.survey-corr-pairs {
  margin-top: 12px;
}

.survey-question-results {
  margin-bottom: 0;
}

.survey-charts-panel {
  margin-bottom: 0;
}

.survey-charts-panel h3 {
  margin-bottom: 6px;
}

.survey-proof-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.survey-charts-grid--single {
  grid-template-columns: 1fr;
}

.survey-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
}

.survey-chart-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fafbfc;
  padding: 14px 16px;
}

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

.survey-chart-card h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-family: Sora, sans-serif;
}

.survey-chart-card__hint {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.survey-chart-card__body--donut {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.survey-donut__seg--same {
  stroke: #2f9e44;
}

.survey-donut__seg--diff {
  stroke: #868e96;
}

.survey-donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

.survey-donut-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.survey-donut-legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.survey-donut-legend__swatch--same {
  background: #2f9e44;
}

.survey-donut-legend__swatch--diff {
  background: #868e96;
}

.survey-section-bar {
  margin-bottom: 12px;
}

.survey-section-bar:last-child {
  margin-bottom: 0;
}

.survey-section-bar__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
}

.survey-section-bar__label {
  font-weight: 600;
  color: var(--text-strong, #1a1a1a);
}

.survey-section-bar__count {
  color: var(--muted);
  white-space: nowrap;
}

.survey-section-bar__track {
  display: flex;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.05);
}

.survey-section-bar__seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  min-width: 2px;
}

.survey-section-bar__seg--same {
  background: #2f9e44;
}

.survey-section-bar__seg--diff {
  background: #868e96;
}

.survey-top-share-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.survey-top-share-row {
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.survey-top-share-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.survey-top-share-row__meta {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.survey-top-share-row__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong, #1a1a1a);
  line-height: 1.35;
}

.survey-top-share-row__badge {
  display: inline-flex;
  align-self: start;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.survey-top-share-row__badge--same {
  background: rgba(47, 158, 68, 0.1);
  color: #1f7a35;
}

.survey-top-share-row__badge--diff {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-strong, #1a1a1a);
}

.survey-top-share-row__bars {
  display: grid;
  gap: 6px;
}

.survey-top-share-row__barline {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: center;
}

.survey-top-share-row__who {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

@media (max-width: 900px) {
  .survey-overview__metrics {
    grid-template-columns: 1fr;
  }

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

  .survey-charts-grid {
    grid-template-columns: 1fr;
  }
}

.survey-q-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 10px 0 14px;
}

.survey-q-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.survey-q-legend__item::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.survey-q-legend__item--synth::before {
  background: #f76707;
}

.survey-q-legend__item--real::before {
  background: #4c6ef5;
}

.survey-q-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.survey-q-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
}

.survey-q-card__summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  position: relative;
}

.survey-q-card__summary::-webkit-details-marker {
  display: none;
}

.survey-q-card__summary::after {
  content: "▾";
  position: absolute;
  right: 16px;
  top: 18px;
  color: var(--muted);
  font-size: 14px;
}

.survey-q-card[open] .survey-q-card__summary::after {
  content: "▴";
}

.survey-q-card__head {
  display: grid;
  gap: 6px;
  padding-right: 28px;
}

.survey-q-card__peek {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-top: 4px;
}

.survey-q-peek-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: baseline;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fafbfc;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.survey-q-peek-line__who {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  white-space: nowrap;
}

.survey-q-peek-line--synth .survey-q-peek-line__pct {
  color: #c2410c;
  font-weight: 700;
}

.survey-q-peek-line--real .survey-q-peek-line__pct {
  color: #364fc7;
  font-weight: 700;
}

.survey-q-peek-line__answer {
  color: var(--text-strong, #1a1a1a);
  line-height: 1.35;
}

.survey-q-badge {
  display: inline-flex;
  align-self: start;
  margin-top: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.survey-q-badge--same {
  background: rgba(47, 158, 68, 0.1);
  color: #1f7a35;
  border: 1px solid rgba(47, 158, 68, 0.18);
}

.survey-q-badge--diff {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-strong, #1a1a1a);
  border: 1px solid var(--border);
}

.survey-q-card__body {
  padding: 0 16px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.survey-q-card__note {
  margin: 12px 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.survey-q-dist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.survey-q-dist__head,
.survey-q-dist__row {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) 1fr 1fr;
  gap: 12px;
  align-items: center;
}

.survey-q-dist__head {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.survey-q-dist__label {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-strong, #1a1a1a);
}

.survey-q-dist__label--top {
  font-weight: 600;
}

.survey-q-dist__tag {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.survey-dist-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

.survey-dist-bar__track {
  height: 10px;
  min-width: 0;
  max-width: 100%;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.survey-dist-bar__fill {
  height: 100%;
  border-radius: 999px;
  min-width: 2px;
}

.survey-dist-bar--synth .survey-dist-bar__fill {
  background: #f76707;
}

.survey-dist-bar--real .survey-dist-bar__fill {
  background: #4c6ef5;
}

.survey-dist-bar__pct {
  font-size: 12px;
  font-weight: 600;
  min-width: 36px;
  text-align: right;
  color: var(--text-strong, #1a1a1a);
}

@media (max-width: 760px) {
  .survey-q-card__peek {
    grid-template-columns: 1fr;
  }

  .survey-q-dist__head {
    display: none;
  }

  .survey-q-dist__row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }
}

.survey-chart-lazy {
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.survey-question-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.survey-question-table th,
.survey-question-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  text-align: left;
  vertical-align: top;
}

.survey-q-section {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.65;
}

.survey-q-text {
  display: block;
  margin-top: 2px;
}

.survey-cohort-panel {
  margin-top: 0;
}

.survey-cohort-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.survey-cohort-member {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.survey-cohort-member__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.survey-cohort-member__summary::-webkit-details-marker {
  display: none;
}

.survey-cohort-member__index {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(45, 156, 74, 0.12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.survey-cohort-member__name {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-strong);
}

.survey-cohort-member__count {
  font-size: 11px;
  color: var(--muted);
}

.survey-cohort-member__body {
  padding: 0 12px 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.survey-member-answers {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 8px;
}

.survey-member-answers th,
.survey-member-answers td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  text-align: left;
  vertical-align: top;
}

.survey-member-answers th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.survey-answer-source {
  font-size: 10px;
  color: var(--muted);
}

.survey-demographics-banner {
  margin-top: 0;
}

.survey-member-demographics {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.survey-member-demographics__title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.survey-member-demographics__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.survey-demo-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(47, 158, 68, 0.08);
  border: 1px solid rgba(47, 158, 68, 0.16);
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-strong, #1a1a1a);
}

.survey-demo-chip strong {
  font-weight: 600;
}

.survey-topbar-hint,
.validation-topbar-hint {
  margin-top: 4px;
}

.projects-modal--wide .projects-modal__panel {
  max-width: 760px;
}

.projects-modal--survey .projects-survey-modal__panel {
  width: min(1040px, 100%);
  max-width: none;
  max-height: min(92dvh, 900px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  border-color: rgba(45, 156, 74, 0.28);
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.16);
  background:
    radial-gradient(ellipse 70% 45% at 0% 0%, rgba(45, 156, 74, 0.08), transparent 55%),
    #fff;
}

.projects-survey-modal__header {
  flex-shrink: 0;
  margin: 0;
  padding: 22px 28px 16px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.projects-survey-modal__header h2 {
  font-size: 22px;
}

.projects-survey-modal__form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
}

.projects-survey-modal__body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
  gap: 20px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 20px 28px;
}

.projects-survey-modal__main,
.projects-survey-modal__side {
  min-width: 0;
}

.projects-survey-modal__sample {
  margin-bottom: 4px;
}

.projects-survey-modal__sample .projects-field {
  max-width: 280px;
}

.survey-demo-balance {
  margin-top: 8px;
  padding: 16px;
  border: 1.5px solid rgba(45, 156, 74, 0.2);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fcf8 100%);
}

.survey-demo-balance__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.survey-demo-balance__head .survey-mode-legend {
  margin-bottom: 4px;
}

.survey-demo-balance__head .projects-field-hint {
  margin: 0;
}

.survey-demo-balance__reset {
  flex-shrink: 0;
  border: 1.5px solid rgba(45, 156, 74, 0.35);
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
}

.survey-demo-balance__reset:hover {
  background: var(--accent-soft);
}

.survey-demo-balance__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.survey-demo-dim {
  padding: 12px;
  border: 1.5px solid rgba(226, 232, 240, 0.95);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.survey-demo-dim.is-invalid {
  border-color: rgba(185, 28, 28, 0.55);
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.14);
  background: #fffafa;
}

.survey-demo-dim__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.survey-demo-dim__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-strong);
}

.survey-demo-dim__total {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.survey-demo-dim__total.is-valid {
  color: var(--accent);
}

.survey-demo-dim__total.is-invalid {
  color: #b91c1c;
}

.survey-demo-dim__options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.survey-demo-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: center;
  margin: 0;
  font-weight: 400;
}

.survey-demo-option__label {
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-strong);
}

.survey-demo-option__input {
  width: 100%;
  padding: 7px 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  text-align: center;
}

.survey-demo-option__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.survey-demo-balance__status {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.survey-demo-balance__status.is-valid {
  color: var(--accent-hover);
}

.survey-demo-balance__status.is-invalid {
  color: #b91c1c;
  font-weight: 600;
}

.survey-demo-balance.is-error {
  border-color: rgba(180, 83, 9, 0.45);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.12);
  animation: survey-demo-balance-shake 320ms ease;
}

@keyframes survey-demo-balance-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@media (max-width: 900px) {
  .survey-demo-balance__grid {
    grid-template-columns: 1fr;
  }

  .survey-demo-balance__head {
    flex-direction: column;
  }
}

.projects-survey-modal__side-card {
  position: sticky;
  top: 0;
  padding: 18px;
  border: 1.5px solid rgba(45, 156, 74, 0.2);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f5fbf7 100%);
  box-shadow: 0 8px 22px rgba(45, 156, 74, 0.08);
}

.projects-survey-modal__side-title {
  margin: 0 0 14px;
  font-family: Sora, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
}

.projects-survey-modal__side .survey-config-dynamic {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.projects-survey-modal__side .projects-field {
  margin: 0;
}

.projects-survey-modal__side textarea {
  min-height: 64px;
  resize: vertical;
}

.projects-survey-modal__footer {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 28px 20px;
  border-top: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.96);
}

.projects-survey-modal__footer .projects-submit {
  width: auto;
  min-width: 200px;
  margin: 0;
  padding: 12px 28px;
  border-radius: 999px;
  background-color: var(--accent);
  background-image: none;
  color: #fff;
  transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.projects-survey-modal__footer .projects-submit:hover:not(:disabled) {
  background-color: var(--accent-hover);
  filter: none;
}

.projects-survey-modal__footer .projects-submit:disabled,
.projects-survey-modal__footer .projects-submit.is-locked {
  background-color: #94a3b8;
  background-image: none;
  color: #f8fafc;
  opacity: 1;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}

.projects-survey-modal__form.is-submitting .projects-survey-modal__footer .projects-submit:disabled {
  background-color: var(--accent);
  cursor: wait;
  opacity: 0.88;
}

@media (max-width: 900px) {
  .projects-survey-modal__body {
    grid-template-columns: 1fr;
  }

  .projects-survey-modal__side-card {
    position: static;
  }
}

.survey-config-intro {
  margin-bottom: 16px;
  padding: 14px 16px;
}

.survey-config-section {
  margin: 14px 0 0;
}

.survey-mode-legend {
  margin: 0 0 12px;
  font-family: Sora, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
}

.survey-module-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.survey-module-core {
  padding: 16px 18px;
  border: 1.5px solid rgba(47, 158, 68, 0.24);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(47, 158, 68, 0.1), rgba(47, 158, 68, 0.04));
  box-shadow: 0 4px 14px rgba(45, 156, 74, 0.06);
}

.survey-module-core__label,
.survey-module-group__label {
  margin: 0 0 12px;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3f6212;
}

.survey-module-core__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.survey-module-core__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(47, 158, 68, 0.28);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.survey-module-core__chip-id {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #166534;
  background: rgba(47, 158, 68, 0.14);
}

.survey-module-core__chip-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong, #1a1a1a);
}

.survey-module-group {
  margin: 0;
  padding: 16px;
  border: 1.5px solid rgba(226, 232, 240, 0.95);
  border-radius: 16px;
  background: #fff;
  min-width: 0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.survey-module-group:first-of-type {
  padding-top: 16px;
  border-top: 1.5px solid rgba(226, 232, 240, 0.95);
}

.projects-form .survey-module-group__label {
  float: none;
  width: 100%;
}

.survey-module-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.projects-form .survey-module-option {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 14px 15px;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  cursor: pointer;
  font-weight: 400;
  line-height: 1.35;
  min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.projects-form .survey-module-option:hover {
  border-color: rgba(47, 158, 68, 0.45);
  background: linear-gradient(180deg, #ffffff 0%, #f2faf4 100%);
  box-shadow: 0 6px 16px rgba(45, 156, 74, 0.1);
  transform: translateY(-1px);
}

.projects-form .survey-module-option:has(.survey-module-option__input:checked) {
  border-color: #2f9e44;
  background: linear-gradient(180deg, #ffffff 0%, #eaf8ee 100%);
  box-shadow: 0 0 0 1px rgba(47, 158, 68, 0.14), 0 8px 18px rgba(45, 156, 74, 0.12);
}

.projects-form .survey-module-option__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.projects-form .survey-module-option__dot {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 2px solid #c5cdd8;
  border-radius: 50%;
  background: #fff;
  box-sizing: border-box;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.projects-form .survey-module-option:has(.survey-module-option__input:checked) .survey-module-option__dot {
  border-color: #2f9e44;
  background: rgba(47, 158, 68, 0.08);
}

.projects-form .survey-module-option:has(.survey-module-option__input:checked) .survey-module-option__dot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2f9e44;
  transform: translate(-50%, -50%);
}

.projects-form .survey-module-option__card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.projects-form .survey-module-option__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.projects-form .survey-module-option__id {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #2f9e44;
}

.projects-form .survey-module-option__title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong, #1a1a1a);
  line-height: 1.3;
}

.projects-form .survey-module-option__hint {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted, #64748b);
  line-height: 1.35;
}

@media (max-width: 1100px) {
  .survey-module-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .survey-module-list {
    grid-template-columns: 1fr;
  }

  .projects-survey-modal__header,
  .projects-survey-modal__body,
  .projects-survey-modal__footer {
    padding-left: 16px;
    padding-right: 16px;
  }
}

.survey-config-preview__title {
  font-weight: 600;
  margin-bottom: 8px;
}

.survey-config-preview__meta {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
}

.survey-config-preview__list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 360px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.survey-config-preview__list li,
.survey-config-preview__item {
  margin: 0;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 4px 8px;
  align-items: start;
}

.survey-config-preview__item--disabled {
  opacity: 0.55;
}

.survey-config-preview__item--blocked {
  border-color: rgba(217, 119, 6, 0.35);
  background: rgba(251, 191, 36, 0.08);
}

.survey-config-preview__item--included {
  border-color: rgba(47, 158, 68, 0.28);
}

.survey-config-preview__id {
  font-weight: 700;
  font-family: Sora, sans-serif;
  font-size: 11px;
}

.survey-config-preview__badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 1px 6px;
  border-radius: 999px;
  width: fit-content;
}

.survey-config-preview__badge--included {
  color: #2f9e44;
  background: rgba(47, 158, 68, 0.12);
}

.survey-config-preview__badge--blocked {
  color: #b45309;
  background: rgba(251, 191, 36, 0.2);
}

.survey-config-preview__badge--disabled {
  color: var(--muted);
  background: var(--surface-muted);
}

.survey-config-preview__title-inline {
  grid-column: 1 / -1;
  font-weight: 600;
  font-size: 11px;
  color: var(--text-strong);
}

.survey-config-preview__text {
  grid-column: 1 / -1;
  color: var(--text);
}

.survey-module-panel {
  margin-top: 16px;
}

.survey-funnel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px;
}

.survey-funnel__stage {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 56px;
  gap: 10px;
  align-items: center;
  max-width: 100%;
  min-width: 0;
}

.survey-funnel__track {
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.survey-funnel__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f76707, #ff922b);
}

.survey-funnel__arrow {
  text-align: center;
  color: var(--text-muted, #64748b);
  font-size: 18px;
  line-height: 1;
}

.survey-ranked-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.survey-ranked-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.survey-ranked-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}

.survey-ranked-row__rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(22, 101, 52, 0.1);
  color: #166534;
  font-family: Sora, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.survey-ranked-row__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.survey-ranked-row__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.survey-ranked-row__label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-strong);
}

.survey-ranked-row__score {
  flex-shrink: 0;
  font-family: Sora, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-strong);
  white-space: nowrap;
}

.survey-ranked-row__scale {
  margin-left: 1px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.survey-ranked-row__bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

.survey-ranked-row__track {
  height: 10px;
  min-width: 0;
  max-width: 100%;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.survey-ranked-row__fill {
  height: 100%;
  min-width: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e8590c, #ff922b);
}

.survey-ranked-row__pct {
  min-width: 40px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-align: right;
  color: var(--text-strong);
}

.survey-ranked-row__meta {
  font-size: 11px;
  color: var(--muted);
}

.projects-field-hint-inline {
  font-weight: 400;
  color: var(--text-muted, #64748b);
  font-size: 12px;
}

.survey-report-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  position: sticky;
  top: 8px;
  z-index: 5;
  backdrop-filter: blur(8px);
}

.survey-report-nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.survey-report-nav__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.survey-report-nav__btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-strong, #1a1a1a);
  cursor: pointer;
}

.survey-report-nav__btn:hover {
  border-color: rgba(47, 158, 68, 0.45);
  color: #166534;
}

.survey-report-nav__link {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-strong, #1a1a1a);
  background: rgba(0, 0, 0, 0.04);
}

.survey-report-nav__link:hover {
  background: rgba(247, 103, 7, 0.12);
  color: #c2410c;
}

.survey-report-section {
  margin-top: 12px;
  padding: 0;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.survey-report-section__body {
  padding: 0 16px 16px 48px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

#surveyResults.sentiment-results {
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.survey-report-section__summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.survey-report-section__summary::-webkit-details-marker {
  display: none;
}

.survey-report-section__chevron {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(47, 158, 68, 0.1);
  position: relative;
  transition: transform 0.15s ease, background 0.15s ease;
}

.survey-report-section__chevron::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid #2f9e44;
  border-bottom: 2px solid #2f9e44;
  transform: translate(-60%, -70%) rotate(45deg);
  transition: transform 0.15s ease;
}

.survey-report-section[open] .survey-report-section__chevron::before {
  transform: translate(-50%, -35%) rotate(-135deg);
}

.survey-report-section[open] .survey-report-section__chevron {
  background: rgba(47, 158, 68, 0.18);
}

.survey-report-section__head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.survey-report-section__title {
  font-size: 15px;
  font-weight: 700;
  font-family: Sora, sans-serif;
  color: var(--text-strong, #1a1a1a);
  line-height: 1.25;
}

.survey-report-section__sub {
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.35;
}

.survey-report-section__summary:hover .survey-report-section__title {
  color: #166534;
}

@media (max-width: 720px) {
  .survey-report-section__body {
    padding-left: 16px;
  }

  .survey-report-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .survey-report-nav__actions {
    justify-content: flex-end;
  }
}

.survey-meta-line {
  margin-top: 12px;
}

.survey-insight-block {
  margin-top: 16px;
  max-width: 100%;
  min-width: 0;
}

.survey-insight-block h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-family: Sora, sans-serif;
}

.survey-radar-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.survey-radar-row {
  display: grid;
  grid-template-columns: minmax(100px, 28%) minmax(0, 1fr) 52px;
  gap: 10px;
  align-items: center;
  max-width: 100%;
  min-width: 0;
}

.survey-radar-row__label,
.survey-radar-row__value {
  font-size: 12px;
}

.survey-persona-var {
  margin-top: 18px;
}

.survey-persona-var h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.survey-persona-dist-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.survey-persona-dist-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(52px, auto) minmax(96px, auto);
  grid-template-areas:
    "label label label"
    "bar pct count";
  gap: 6px 14px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
}

.survey-persona-dist-row:nth-child(even) {
  background: rgba(0, 0, 0, 0.04);
}

.survey-persona-dist-row__label {
  grid-area: label;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  word-break: break-word;
}

.survey-persona-dist-row__bar {
  grid-area: bar;
  min-width: 0;
}

.survey-persona-dist-row__track {
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.survey-persona-dist-row__fill {
  height: 100%;
  border-radius: 999px;
  background: #4c6ef5;
  min-width: 2px;
}

.survey-persona-dist-row__pct {
  grid-area: pct;
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.survey-persona-dist-row__count {
  grid-area: count;
  font-size: 11px;
  color: var(--text-muted, #64748b);
  text-align: right;
  white-space: nowrap;
}

.survey-rating-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.survey-rating-card {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
}

.survey-rating-card__summary {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.survey-rating-card__summary::-webkit-details-marker {
  display: none;
}

.survey-rating-card__family {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #c2410c;
}

.survey-rating-card__text {
  font-size: 13px;
  line-height: 1.4;
}

.survey-rating-card__mean {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-strong, #1a1a1a);
}

.survey-rating-card__body {
  padding: 0 14px 14px;
}

.survey-rating-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-muted, #64748b);
}

.survey-histogram {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  align-items: end;
  height: 88px;
  padding-top: 8px;
}

.survey-histogram__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 4px;
}

.survey-histogram__bar {
  width: 100%;
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #ff922b, #f76707);
}

.survey-histogram__label {
  font-size: 10px;
  color: var(--text-muted, #64748b);
}

.survey-demo-bar-row__rank {
  width: 24px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, #64748b);
}

.survey-demo-bar-row__meta {
  font-size: 11px;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

.survey-choice-block__q {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.survey-demo-dimension {
  margin-top: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
}

.survey-demo-dimension summary {
  cursor: pointer;
  font-size: 13px;
}

.survey-corr-cell--pos {
  background: rgba(47, 158, 68, 0.15);
}

.survey-corr-cell--pos-strong {
  background: rgba(47, 158, 68, 0.32);
  font-weight: 700;
}

.survey-corr-cell--neg {
  background: rgba(250, 82, 82, 0.12);
}

.survey-corr-cell--neg-strong {
  background: rgba(250, 82, 82, 0.28);
  font-weight: 700;
}

.survey-segment-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.5;
}

.survey-segment-card .survey-ranked-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.survey-report-section__body > .sentiment-scope-hint,
.survey-overview__chart .sentiment-scope-hint {
  margin-bottom: 14px;
}

@media (max-width: 720px) {
  .survey-ranked-row__top {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .survey-ranked-row__score {
    font-size: 16px;
  }

  .survey-rating-card__summary {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .survey-radar-row {
    grid-template-columns: 1fr;
  }

  .survey-funnel__stage {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
