:root {
  --frame-width: 1440px;
  --content-width: 1360px;
  --ink: #222222;
  --muted: #6b6b6b;
  --accent: #6a59f6;
  --surface: #F8F8F8;
  --lavender: #ecebff;
  --background-faq: #B2A7FF;
  --light-lavender: #f8f8ff;
  --white: #ffffff;
  --active-text: #5F4CE3;
  --btn-submit: #D9D9D9;
}

* {
  box-sizing: border-box;
  font-family: "Manrope", Arial, sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 20px;
  color: #52555C;
}

body {
  margin: 0;
  background: #ffffff;
  font-family: "Manrope", Arial, sans-serif;
  color: var(--ink);
  line-height: 1.6;
}

.frame {
  width: min(100%, var(--frame-width));
  margin: 0 auto;
  background: #ffffff;
}

.app {
  width: 100%;
  position: relative;
  min-height: 100vh;
}

header,
main,
footer {
  width: min(100% - 40px, var(--content-width));
  margin: 0 auto;
}

img {
  pointer-events: none;
}

[hidden] {
  display: none !important;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
}

.brand {
  font-weight: 700;
  font-size: 18px;
  display: inline-flex;
  gap: 4px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.nav {
  display: flex;
  gap: 32px;
  font-size: 14px;
}

.auth-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.auth-user {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.auth-link {
  border: 1px solid #d9d9f2;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.auth-link-primary {
  border: none;
  color: #fff;
  background: linear-gradient(90deg, #6a59f6 0%, #5b47e6 100%);
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
  font-weight: 500;
  font-style: Medium;
  font-size: 16px;
  line-height: 24px;
}

.nav a:hover {
  color: var(--accent);
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 32px 16px;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 20, 30, 0.5);
  cursor: pointer;
}

.auth-modal-dialog {
  position: relative;
  z-index: 2;
  width: min(420px, calc(100% - 32px));
  margin: 0 auto;
  max-height: calc(100dvh - 64px);
  background: #fff;
  border-radius: 16px;
  padding: 56px 24px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  overflow-y: auto;
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: #f0f0f8;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  color: var(--accent);
}

.auth-modal-dialog > h3 {
  margin: 0 56px 18px 0;
}

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

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-form input {
  height: 44px;
  border: 1px solid #d9d9f2;
  border-radius: 12px;
  padding: 0 12px;
}

.auth-form button {
  margin-top: 8px;
  height: 44px;
  border: none;
  border-radius: 999px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(90deg, #6a59f6 0%, #5b47e6 100%);
  cursor: pointer;
}

.auth-status {
  min-height: 20px;
  font-size: 14px;
  margin: 12px 0 0;
}

.auth-status.error {
  color: #d02020;
}

.auth-status.success {
  color: #5f4ce3;
}

.auth-switch {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.auth-switch button {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}

.profile-modal-dialog {
  width: min(1080px, calc(100% - 32px));
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.audience-analysis-modal-dialog {
  width: min(980px, calc(100% - 32px));
  max-height: calc(100vh - 96px);
  overflow: auto;
  border-radius: 28px;
  padding-top: 48px;
}

.auth-modal[data-hook="audience-analysis-modal"] {
  align-items: center;
  padding-top: 24px;
  padding-bottom: 24px;
}

.audience-analysis-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 48px 18px 0;
}

.audience-analysis-head h3 {
  margin: 0 0 8px;
}

.audience-analysis-subtitle {
  margin: 0;
  color: var(--muted);
}

.audience-analysis-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.audience-analysis-section {
  padding: 18px 20px;
  border: 1px solid #e2defb;
  border-radius: 18px;
  background: #faf9ff;
}

.audience-analysis-section h4 {
  margin: 0 0 12px;
}

.audience-analysis-summary p {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
}

.audience-analysis-item + .audience-analysis-item {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(106, 89, 246, 0.1);
}

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

.audience-analysis-item-text {
  margin: 0;
  font-size: 15px;
  line-height: 22px;
}

.audience-analysis-confidence,
.audience-analysis-share-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.audience-analysis-confidence.is-high {
  background: #eef1ff;
  color: #4d4bc7;
}

.audience-analysis-confidence.is-medium {
  background: #f4efff;
  color: #5f4ce3;
}

.audience-analysis-confidence.is-low,
.audience-analysis-share-hint {
  background: #f1efff;
  color: #5f4ce3;
}

.audience-analysis-evidence {
  margin-top: 10px;
}

.audience-analysis-evidence strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.audience-analysis-evidence ul,
.audience-analysis-plain-list {
  margin: 0;
  padding-left: 18px;
}

.audience-analysis-evidence li,
.audience-analysis-plain-list li {
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}

.audience-analysis-empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.profile-block {
  margin-top: 14px;
}

.profile-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.profile-tab {
  border: 1px solid #dddff5;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 16px;
  font-size: 14px;
  line-height: 20px;
}

.profile-tab.active {
  background: #f1efff;
  border-color: #cfc8ff;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(106, 89, 246, 0.08);
}

.profile-panel {
  min-height: 440px;
}

.profile-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.profile-panel-head p {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 20px;
}

.profile-block h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-weight: 600;
  font-size: 16px;
  line-height: 22px;
}

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

.profile-card,
.profile-thread-card,
.profile-thread-view,
.profile-billing-card,
.profile-empty-state {
  border: 1px solid #e6e6f8;
  border-radius: 18px;
  background: #ffffff;
}

.profile-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-card__head,
.profile-thread-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.profile-card__title,
.profile-thread-card__title,
.profile-thread-view__title {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
}

.profile-card__subtitle,
.profile-thread-card__subtitle,
.profile-thread-view__subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.profile-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f3f1ff;
  color: var(--accent);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.profile-chip.is-neutral {
  background: #f3f4f8;
  color: #57606a;
}

.profile-chip.is-success {
  background: #f1efff;
  color: #5f4ce3;
}

.profile-chip.is-warning {
  background: #fff7e7;
  color: #9b6a00;
}

.profile-chip.is-danger {
  background: #fff0f0;
  color: #b33b3b;
}

.profile-card__meta {
  display: grid;
  gap: 8px;
}

.profile-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  line-height: 18px;
  color: #5b6070;
}

.profile-meta-row span:first-child {
  color: #8b90a0;
}

.profile-card__error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff7f7;
  color: #8b3d3d;
  font-size: 13px;
  line-height: 19px;
}

.profile-card__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-action {
  padding: 11px 16px;
  font-size: 14px;
  line-height: 20px;
}

.profile-action.secondary {
  background: #f5f6fb;
  color: var(--ink);
  border: 1px solid #e2e4ef;
}

.profile-chat-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 14px;
}

.profile-thread-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-thread-card {
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.profile-thread-card:hover {
  border-color: #cfc8ff;
  transform: translateY(-1px);
}

.profile-thread-card.active {
  border-color: #c3baff;
  box-shadow: 0 10px 24px rgba(106, 89, 246, 0.08);
}

.profile-thread-view {
  min-height: 420px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-thread-view__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ececf8;
}

.profile-thread-view__actions {
  margin-top: auto;
}

.profile-thread-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-thread-message {
  max-width: min(82%, 540px);
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink);
}

.profile-thread-message.assistant {
  background: #f1efff;
  align-self: flex-start;
}

.profile-thread-message.user {
  background: linear-gradient(135deg, #6a59f6, #7f70ff);
  color: #ffffff;
  align-self: flex-end;
}

.profile-thread-message__time {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 14px;
  opacity: 0.72;
}

.profile-empty-state {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 28px;
}

.profile-empty-state strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 24px;
}

.profile-empty-state p {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 20px;
  max-width: 420px;
}

.profile-billing-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-billing-badge {
  display: inline-flex;
  align-self: flex-start;
  border-radius: 999px;
  background: #1b1b1b;
  color: #ffffff;
  font-size: 11px;
  line-height: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 10px;
}

.profile-billing-card strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 28px;
}

.profile-billing-card p {
  margin: 0;
}

.profile-billing-list {
  margin: 0;
  padding-left: 18px;
  color: #545a66;
  display: grid;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
}

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

  .profile-chat-layout {
    grid-template-columns: 1fr;
  }

  .profile-thread-view {
    min-height: 320px;
  }
}

/* Sections */
main section {
  margin-bottom: 80px;
}

main section:last-child {
  margin-bottom: 0px;
}

h1 {
  font-size: 40px;
  font-weight: 500;
  line-height: 48px;
  margin: 0 0 24px 0;
}

h2 {
  font-size: 32px;
  font-weight: 500;
  line-height: 40px;
  margin: 0 0 16px 0;
}

h3 {
  font-size: 20px;
  font-weight: 500;
  line-height: 28px;
  margin: 0 0 16px 0;
}

h4 {
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  margin: 0 0 4px 0;
}

p {
  margin: 0 0 16px 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 24px;
}

/* Buttons */
button {
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  background: var(--accent);
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  cursor: pointer;
  transition: all 0.2s;
}

button:active {
  transform: translateY(0);
}

button.secondary {
  background: #ffffff;
  color: var(--accent);
  border: 1px solid #e6e6e6;
}

button:disabled {
  pointer-events: none;
  cursor: not-allowed;
  transform: none;
}

button.button-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Forms */
input,
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #e6e6e6;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

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

label {
  display: block;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}

label input,
label textarea {
  margin-top: 8px;
}

input[type="text"]:disabled {
  background: white;
}

/* Hero Section */
#hero {
  background: linear-gradient(to bottom, #F1EFFF 0%, var(--lavender) 30%, #B5ACF5 100%);
  border-radius: 44px;
  padding: 25px;
  margin-top: 20px;
  position: relative;
  overflow: visible;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 50px;
  min-height: 450px;
  width: 100%;
}

.hero-content {
  flex: 1;
  max-width: 600px;
  background: white;
  padding: 100px 25px 100px 25px;
  border-radius: 24px;
  margin-bottom: 25px;
}

#hero h1 {
  margin-bottom: 20px;
  text-align: center;
}

#hero p {
  font-size: 18px;
  margin-bottom: 32px;
  text-align: center;
}

.hero-image {
  flex-shrink: 0;
  width: 340px;
  position: relative;
  z-index: 1;
  align-self: flex-end;
  margin-bottom: -75px;
  margin-left: 50px;
  flex-basis: content;
}

.hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-button {
  display: flex;
  margin: 0 auto;
}

.nav-link {
  text-decoration: none;
}

.floating-label {
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(106, 89, 246, 0.15);
  white-space: nowrap;
  animation: float 3s ease-in-out infinite;
}

.floating-label:nth-child(2) {
  top: 20%;
  right: -10%;
  animation-delay: 0s;
}

.floating-label:nth-child(3) {
  top: 35%;
  left: -12%;
  right: auto;
  animation-delay: 1s;
}

.floating-label:nth-child(4) {
  bottom: 50%;
  right: -10%;
  animation-delay: 2s;
}

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

.fund-banner {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  gap: 24px;
  width: 100%;
  min-height: 50px;
  z-index: 2;
}

.fund-banner-text {
  font-size: 12px;
  color: var(--white);
  line-height: 1.5;
}

.fund-banner-logo {
  display: flex;
  height: 48px;
  gap: 24px;
  width: auto;
  margin-left: auto;
}

.fund-banner-logo img {
  width: auto;
}

/* About Section */
#about {
  background: var(--surface);
  border-radius: 44px;
  padding: 24px;
}

.section-tag {
  display: inline-block;
  background: var(--white);
  color: var(--text-primary);
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}

.about-tags {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.about-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #e6e6e6;
  padding: 10px 16px;
  border-radius: 16px;
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
}

.about-tag svg {
  color: var(--accent);
  flex-shrink: 0;
}

.about-chips {
  max-width: 40%;
  height: auto;
  display: flex;
  background-color: var(--white);
  border-radius: 16px;
  padding: 8px 16px;
  transition-duration: 0.3s;
}

.about-chips img {
  width: 24px;
  height: 24px;
}

.about-chips p {
  margin: 0 8px 0 8px;
  align-content: space-around;
  transition-duration: 0.3s;
}

/* How Section */
#how {
  background-color: var(--surface);
  padding: 24px;
  border-radius: 44px;
}

.how-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.tabs {
  display: flex;
  flex-flow: row wrap;
  margin-top: 24px;
  gap: 4px;
}

.how-controls {
  display: flex;
  flex-flow: row wrap;
  align-items: flex-start;
  gap: 4px;
}

.how-controls .tabs {
  margin-top: 24px;
}

.tabs-actions {
  margin-top: 24px;
  margin-left: auto;
}

.tabs .tab {
  background: #ffffff;
  color: var(--ink);
  border-radius: 24px 24px 0 0;
  padding: 12px 24px;
  font-weight: 500;
}

.tabs .tab[aria-selected="true"] {
  background: #F1EFFF;
  color: black;
  border-color: var(--accent);
}

.tabs-steps {
  gap: 12px;
}

.tabs-steps .tab {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  border-radius: 22px;
  border: 1px solid #ddd9fb;
  padding: 14px 18px;
}

.tab-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #efeaff;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.tab-step-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 2px;
}

.tab-step-copy strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 20px;
}

.tab-step-copy small {
  color: #7b7f8d;
  font-size: 12px;
  line-height: 16px;
}

.tabs-steps .tab[aria-selected="true"] .tab-step-index {
  background: linear-gradient(135deg, #6a59f6, #897dff);
  color: #ffffff;
}

.tabs .free-try,
.tabs-actions .free-try {
  margin-bottom: 12px;
}

.tab-content {
  display: none;
  background: #F1EFFF;
  border-radius: 0 24px 24px 24px;
}

.audience .another-segments {
  margin-top: 36px;
  display: inline-block;
  width: 100%;
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;
  text-align: center;
  color: var(--active-text);
  cursor: pointer;
}

.analysis-work>.tab-content {
  border-radius: 24px;
}

#segmentation-work {
  background-color: var(--surface);
  padding: 24px;
  border-radius: 16px;
}

.tab-content.active {
  display: block;
  padding: 24px;
}

.tab-description {
  margin-top: 24px;
  margin-bottom: 24px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.tab-image {
  width: 100%;
  max-width: 800px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  display: block;
}

.tab-analyze-form {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px;
  max-width: 700px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.tab-analyze-form h3 {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 600;
}

/* Analyze Section */
.analyze-form-container,
.analyze-loading-container {
  width: 100%;
  background: var(--surface);
  border-radius: 16px;
}

.analyze-form-container {
  padding: 24px;
}

.analyze-form-container--static {
  background: #f1efff;
  border: 1px solid #ddd9fb;
}

.analyze-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.analyze-header h3 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 24px;
}

.cancel-link {
  color: var(--active-text);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}

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

.analyze-hint {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.analyze-disabled-note {
  margin: 10px 0 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #6f7280;
  font-size: 10px;
  line-height: 14px;
}

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

.analyze-input-row {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.analyze-submit-btn {
  background: var(--accent);
  color: #ffffff;
}

.analyze-submit-btn.is-disabled,
.analyze-submit-btn:disabled {
  pointer-events: none;
  background: #e4e5ea;
  color: #7c8090;
  border: 1px solid #d6d8e0;
  box-shadow: none;
}

.analyze-input-wrapper {
  flex: 1;
}

.analyze-input-wrapper input {
  width: 100%;
  padding: 16px 20px;
  border: 1px solid #d7d9e4;
  border-radius: 12px;
  font-size: 16px;
  background: #fff;
}

.analyze-input-wrapper input:disabled {
  border-color: #dfe1ea;
  background: #f4f5f9;
  color: #9ea3b5;
}

.analyze-input-row button {
  padding: 16px 32px;
  white-space: nowrap;
}

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

.analysis-stage-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid #e0def3;
  background: #ffffff;
  opacity: 0.72;
  transition: opacity 0.2s, transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.analysis-stage-step.is-active,
.analysis-stage-step.is-complete {
  opacity: 1;
  border-color: #cfc8ff;
  box-shadow: 0 10px 28px rgba(106, 89, 246, 0.08);
}

.analysis-stage-step.is-active {
  transform: translateY(-1px);
}

.analysis-stage-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #efeaff;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.analysis-stage-step.is-active .analysis-stage-index,
.analysis-stage-step.is-complete .analysis-stage-index {
  background: linear-gradient(135deg, #6a59f6, #897dff);
  color: #ffffff;
}

.analysis-stage-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.analysis-stage-copy strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 20px;
}

.analysis-stage-copy small {
  color: #7b7f8d;
  font-size: 12px;
  line-height: 16px;
}

.analyze-type-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

.analyze-type-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin: 0;
  position: relative;
}

.radio-label input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

.radio-disabled:disabled {
  pointer-events: none;
  accent-color: var(--accent);
  background-color: var(--accent);
}

.radio-label-tooltip {
  padding-right: 4px;
}

.radio-tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ecebff;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: help;
}

.radio-tooltip-content {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 5;
  width: min(280px, 70vw);
  padding: 12px 14px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #d9d6f7;
  box-shadow: 0 16px 34px rgba(45, 45, 66, 0.14);
  color: #61667a;
  font-size: 13px;
  line-height: 18px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.radio-label-tooltip:hover .radio-tooltip-content,
.radio-label-tooltip:focus-within .radio-tooltip-content {
  opacity: 1;
  transform: translateY(0);
}

/* Loading State */
.analyze-loading-container {
  display: flex;
  gap: 40px;
  align-items: flex-end;
}

.loading-content {
  flex: 1;
  padding: 24px 0 24px 24px;
}

.loading-image {
  flex-shrink: 0;
  width: 246px;
}

.loading-image img {
  width: 100%;
  height: auto;
  display: block;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}

.progress-time {
  color: var(--text-secondary);
}

.progress-percent {
  font-weight: 600;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--lavender);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--lavender) 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-status {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.progress-note {
  margin-bottom: 20px;
  color: #717688;
  font-size: 14px;
  line-height: 20px;
}

.status-message {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
}

.status-message.info {
  background: #e3f2fd;
  color: #1565c0;
}

.status-message.error {
  background: #ffebee;
  color: #c62828;
}

.status-message.success {
  background: #eef1ff;
  color: #4d4bc7;
}

/* Group Info Block */
.group-info-block {
  background: #F1EFFF;
  border-radius: 24px;
  padding: 32px;
  margin-bottom: 32px;
  position: relative;
}

.group-info-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.group-info-header h3 {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}

.group-info-header a {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}

.group-info-header a:hover {
  text-decoration: underline;
}

.group-info-content {
  display: flex;
  gap: 24px;
  align-items: center;
}

.group-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--lavender);
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(106, 89, 246, 0.15);
}

.group-details {
  flex: 1;
}

.group-details p {
  margin: 0 0 6px 0;
  font-size: 15px;
  color: var(--ink);
}

.group-details p span {
  color: var(--muted);
  font-size: 17px;
  line-height: 24px;
}

.group-info-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  min-width: 280px;
}

.group-info-actions button {
  padding: 12px 24px;
  font-size: 14px;
}

.compare-controls {
  width: 100%;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compare-controls-label {
  color: var(--muted);
  font-size: 13px;
}

.compare-controls select {
  width: 100%;
  border: 1px solid var(--lavender-dark);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ink);
  background: var(--white);
}

.compare-controls-actions {
  display: flex;
  gap: 8px;
}

.compare-controls-actions button {
  padding: 8px 12px;
  font-size: 12px;
  line-height: 16px;
}

.compare-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.compare-status.error {
  color: #d13b3b;
}

.card-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.cluster-compare-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  line-height: 16px;
  background: var(--white);
  color: var(--muted);
}

.cluster-compare-badge.pos {
  color: #5f4ce3;
}

.cluster-compare-badge.neg {
  color: #d13b3b;
}

.cluster-compare-badge.new {
  color: var(--accent);
}

.cluster-compare-meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

/* Segmentation Section */
.segmentation {
  background: var(--surface);
  padding: 24px;
}

.segment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.segments-grid {
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.cluster-card, .cluster-card-dis {
  background: var(--lavender);
  border-radius: 20px;
  padding: 24px;
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-header {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: start;
  margin-bottom: 24px;
}

.card-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  background: #d8d8d8;
  flex: 0 0 120px;
  margin-right: 0;
}

.card-img img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.card-status {
  margin-left: 0;
  font-weight: 500;
  font-size: 24px;
  line-height: 32px;
  color: var(--active-text);
  display: flex;
  align-self: start;
  justify-self: end;
  text-align: right;
  white-space: nowrap;
}

.card-header-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.card-header-info p {
  font-size: 17px;
  line-height: 24px;
  margin-bottom: 0;
}

.card-header-title {
  display: block;
  font-weight: 500;
  font-size: 20px;
  line-height: 28px;
  margin: 0 0 4px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.info-like .info-dislike {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
}

.info-tags {
  display: flex;
  flex-direction: row;
  flex-flow: wrap;
  gap: 8px
}

.info-like .info-dislike {
  gap: 8px;
}

.info-like>span {
  font-size: 17px;
  line-height: 24px;
  margin-bottom: 8px;
}

.info-dislike>span {
  font-size: 17px;
  line-height: 24px;
  margin-bottom: 8px;
}

.btn-dis {
  pointer-events: none;
  cursor: default;
}

.tag {
  padding: 8px 16px;
  background: var(--white);
  border-radius: 16px;
  font-family: Manrope;
  font-size: 15px;
  line-height: 20px;
}

.cluster-card:hover {
  transform: translateY(-4px);
}

.cluster-meta {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.cluster-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #d8d8d8;
  object-fit: cover;
}

.cluster-info h4 {
  font-size: 18px;
  margin-bottom: 4px;
}

.cluster-info p {
  font-size: 14px;
  margin: 0;
  color: var(--muted);
}

.cluster-share {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
}

.cluster-tags-section {
  margin-bottom: 16px;
}

.cluster-tags-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.cluster-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cluster-card-actions {
  margin-top: auto;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cluster-card button, .cluster-card-dis button  {
  align-self: flex-start;
}

.cluster-card-actions > button {
  margin-top: 0;
  flex: 1 1 240px;
}

.cluster-card-secondary {
  background: #ffffff;
  color: var(--accent);
  border: 1px solid #cdc7ff;
}

@media (max-width: 1120px) {
  .analysis-stage-strip {
    grid-template-columns: 1fr;
  }

  .card-header {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .card-status {
    grid-column: 2;
    justify-self: start;
    text-align: left;
  }

  .audience-analysis-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .tabs-steps .tab {
    width: 100%;
    min-width: 0;
  }

  .how-controls {
    flex-direction: column;
  }

  .tabs-actions {
    margin-left: 0;
  }

  .analyze-input-row,
  .analyze-type-row {
    flex-direction: column;
    align-items: stretch;
  }

  .analyze-input-row button {
    width: 100%;
  }

  .radio-label-tooltip {
    flex-wrap: wrap;
  }

  .radio-tooltip-content {
    width: min(100%, 280px);
  }

  .card-header {
    grid-template-columns: 1fr;
  }

  .card-img,
  .card-header-info,
  .card-status {
    grid-column: auto;
    justify-self: start;
  }

  .audience-analysis-head,
  .audience-analysis-item-top {
    flex-direction: column;
    margin-right: 0;
  }

  .cluster-card-actions > button {
    flex-basis: 100%;
  }
}

.cluster-tags span {
  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}

/* Chat Section */
.chat-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 64px;
  width: min(100%, 1240px);
  margin: 0 auto 8px;
  padding: 16px 24px;
}

.chat-header-back img {
    margin-right: 5px;
}

.chat-header-back {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 0;
  white-space: nowrap;
}

.chat-header a {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.chat-title {
  max-width: 100%;
  padding: 0 220px;
  text-align: center;
  font-weight: 600;
}

.chat-title h3{
  margin: 0;
}

.chat-title p{
  font-size: 15px;
  margin: 0;
}

.chat-body {
  min-height: 400px;
  height: auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 20px;
  padding: 24px;
}

.chat-content {
  width: min(100%, 1240px);
  margin: 0 auto;
}

.chat-log {
  width: 100%;
  max-height: 420px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.chat-message {
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
}

.chat-message.user {
  flex-direction: row-reverse;
}

.chat-message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--lavender);
  flex-shrink: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.chat-message.assistant .chat-message-avatar {
  background-image: url('/site/img/geek.png');
}

.chat-message.user .chat-message-avatar {
  background-image: url('/site/img/no-foto-chat.png');
}

.chat-message-avatar img {
  width: 40px;
  height: 40px;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

.chat-message-content {
  max-width: 320px;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
}

.chat-message.assistant .chat-message-content {
  background: var(--lavender);
}

.chat-message.user .chat-message-content {
  background: var(--accent);
  color: #ffffff;
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
  animation: typingPulse 1.2s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

#chat form {
  display: flex;
  gap: 12px;
}

#chat form label {
  flex: 1;
  margin: 0;
}

#chat form button {
  flex-shrink: 0;
}

.chat-footer {
  width: min(100%, 1240px);
  margin: 0 auto;
}

.chat-reload {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  width: auto;
  border-radius: 999px;
  cursor: pointer;
}

.chat-reload img {
  width: 17px;
  height: 17px;
  margin: 0;
}

.chat-reload p {
  color: var(--active-text);
  margin: 0;
  white-space: nowrap;
}

.chat-input-area {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* ── Portrait card above chat ── */
.portrait-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px 20px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(106, 89, 246, 0.12);
}

.portrait-card__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--lavender);
  margin-bottom: 12px;
  flex-shrink: 0;
}

.portrait-card__avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.portrait-card__name {
  font-weight: 600;
  font-size: 18px;
  line-height: 24px;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.portrait-card__subtitle {
  font-size: 13px;
  line-height: 18px;
  color: #6b7280;
  margin-bottom: 10px;
}

.portrait-card__desc {
  font-size: 13px;
  line-height: 1.5;
  color: #374151;
  max-width: 400px;
  margin: 0 0 12px;
}

.portrait-card__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.portrait-card__tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--lavender);
  color: var(--active-text);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}

.submit {
  display: flex;
  width: 100%;
  background: var(--white);
  align-items: center;
  border-radius: 16px;
  padding: 8px 16px;
}

.submit-form {
  width: 100%;
}

.submit-form-img {
  align-content: center;
}

.submit-form-input {
  border: 0;
  width: 100%;
}

.submit-form-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--btn-submit);
  padding: 0;
  overflow: hidden;
}

.submit-form-btn img {
  display: block;
}

/* AI Disclaimer */
.ai-disclaimer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 12px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.ai-disclaimer svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* FAQ Section */
#faq {
  background: var(--background-faq);
  border-radius: 44px;
  padding: 24px;
  margin-left: 24px;
  margin-right: 24px;
}

#faq .section-tag {
  margin-bottom: 12px;
}

#faq h2 {
  margin-bottom: 32px;
  color: var(--white);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: #ffffff;
  border-radius: 24px;
  padding: 32px 24px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.5s;
}

.faq-item[open] {
  padding-bottom: 24px;
  border-color: var(--background-faq);
}

.faq-item summary {
  font-weight: 600;
  font-size: 16px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 24px;
  font-weight: 400;
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "−";
  background: var(--background-faq);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  color: white;
  font-size: 20px;
  line-height: 1;
}

.faq-content {
  margin-top: 16px;
}

.faq-content p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.faq-content ul {
  margin: 12px 0;
  padding-left: 20px;
}

.faq-content li {
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.faq-warning {
  padding: 12px 16px;
  padding-left: 0;
  border-radius: 8px;
  font-weight: 600;
  font-size: 17px;
  line-height: 24px;
}

details p {
  margin-top: 16px;
  padding-right: 40px;
}

/* Feedback Section */
.feedback {
  background: var(--surface);
  border-radius: 24px 24px 0px 0px;
  padding: 48px;
  padding-bottom: 24px;
  display: flex;
  gap: 32px;
  width: 100%;
  justify-content: space-between;
}

.feedback > div {
  flex: 1 1 0;
  min-width: 0;
}

#feedback form {
  max-width: 600px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feedback-form-list {
  background-color: var(--white);
  border-radius: 12px;
  gap: 4px;
  position: relative;
}

.feedback-form-list input,
.feedback-form-list textarea {
  display: block;
  width: 100%;
  padding: 20px 8px 8px 20px;
  border-radius: 16px;
  border: 0;
  height: 100%;
  font-size: 15px;
  line-height: 20px;
}

.feedback-form-list textarea {
  min-height: 124px;
  resize: vertical;
}

.feedback-label {
  position: absolute;
  left: 20px;
  top: 15px;
  transition: all 0.2s;
  pointer-events: none; /* Чтобы клик проходил сквозь текст */
  background-color: none; /* Для эффекта перекрытия границы */
}

.feedback-input:focus + .feedback-label,
.feedback-input:not(:placeholder-shown) + .feedback-label {
  transform: translateY(-12px);
}

.feedback-form-list:last-child {
  display: flex;
  background: none;
  padding: 0;
  gap: 8px;
}

.feedback-form-list:last-child button {
  width: 40%;
}

.feedback-form-list:last-child span {
  width: 60%;
}

.feedback-error-text {
  font-size: 15px;
  line-height: 20px;
  color:#FF383C;
}

.bold-text {
  font-weight: 700;
  font-style: bold;
}

section[data-section="feedback"] {
  position: relative;
}

.feedback-toast {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(19, 24, 38, 0.12);
  max-width: 320px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 2;
}

.feedback-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.feedback-toast .toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 16px;
  flex: 0 0 28px;
}

.feedback-toast.success .toast-icon {
  background: #2bb673;
}

.feedback-toast.error .toast-icon {
  background: #e26060;
}

.feedback-toast .toast-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.feedback-toast .toast-message {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

@media (max-width: 768px) {
  .feedback-toast {
    position: static;
    margin-top: 16px;
    max-width: none;
    width: 100%;
  }
}

/* Footer */
footer {
  padding: 48px;
  font-size: 13px;
  color: var(--muted);
  padding-top: 0;
  background-color: var(--surface);
  border-radius: 0 0 16px 16px;
  margin-bottom: 24px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-bottom: 32px;
  padding-top: 32px;
  border-top: 1px solid #ebebeb;
  border-bottom: 1px solid #ebebeb;
  margin-bottom: 20px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  width: 50%;
}

.footer-links a {
  color: var(--ink);
  text-decoration: none;
  font-size: 17px;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.footer-contact span {
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-contact a {
  color: #9484FF;
  text-decoration: none;
  font-weight: 500;
  font-size: 24px;
  line-height: 32px;
  text-align: right;
  overflow-wrap: anywhere;
}

.footer-disclaimer {
  width: 50%;
  color: var(--text-secondary);
  line-height: 1.6;
  font-style: italic;
  font-size: 13px;
}

.footer-disclaimer p {
  margin: 0 0 8px 0;
}

.footer-disclaimer p:last-child {
  margin-bottom: 0;
}

/* View States with smooth transitions */
.view {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
}

.view.active {
  opacity: 1;
  visibility: visible;
  position: relative;
}

.view.fade-out {
  opacity: 0;
}

section[data-section] {
  display: none;
}

section[data-section].active {
  display: block;
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.6s linear infinite;
}

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

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typingPulse {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.4s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
  header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 0;
  }

  .brand {
    order: 1;
  }

  .auth-controls {
    order: 2;
    margin-left: auto;
    max-width: min(100%, 220px);
    gap: 8px;
  }

  .auth-user {
    width: 100%;
    text-align: right;
  }

  .auth-link {
    padding: 8px 12px;
    font-size: 13px;
    line-height: 18px;
  }

  .nav {
    order: 3;
    width: 100%;
    gap: 16px;
    flex-wrap: wrap;
  }

  .auth-modal-dialog {
    width: min(420px, calc(100% - 16px));
    max-height: calc(100dvh - 24px);
    padding: 52px 16px 18px;
  }

  .auth-form {
    padding-top: 0;
  }

  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 28px;
  }

  #hero {
    padding: 48px 32px;
    flex-direction: column;
    min-height: auto;
  }

  .hero-image {
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
  }

  .floating-label {
    display: none;
  }

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

  .how-head,
  .segment-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .chat-header {
    min-height: auto;
    width: 100%;
    min-height: 72px;
    padding: 12px;
  }

  .chat-header-back {
    position: absolute;
    left: 12px;
    top: 12px;
    transform: none;
    margin-bottom: 0;
  }

  .chat-title,
  .chat-content,
  .chat-footer {
    width: 100%;
  }

  .chat-title {
    padding: 0 56px;
  }

  .chat-reload {
    right: 12px;
    top: 12px;
    transform: none;
    padding: 8px;
  }

  .chat-reload p {
    display: none;
  }

  .about-tags {
    flex-direction: column;
  }

  .tabs {
    flex-wrap: wrap;
  }

  .group-info-content {
    flex-direction: column;
    text-align: center;
  }

  .group-info-actions {
    align-items: center;
    width: 100%;
  }

  .group-info-actions button {
    width: 100%;
  }

  .feedback {
    flex-direction: column;
    gap: 24px;
    padding: 24px 20px;
    border-radius: 20px 20px 0 0;
  }

  .feedback > div {
    width: 100%;
  }

  .feedback-form-list:last-child {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .feedback-form-list:last-child button,
  .feedback-form-list:last-child span {
    width: 100%;
  }

  .feedback-form-list:last-child button {
    min-height: 52px;
  }

  footer {
    padding: 24px 20px;
  }

  .footer-top,
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-links,
  .footer-disclaimer,
  .footer-contact {
    width: 100%;
  }

  .footer-contact {
    align-items: flex-start;
  }

  .footer-contact a {
    font-size: 18px;
    line-height: 24px;
    text-align: left;
  }

  .footer-disclaimer {
    max-width: none;
  }

  #faq {
    margin-left: 0;
    margin-right: 0;
  }
}
