* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #fce7f3 0%, #fdf2f8 50%, #f3e8ff 100%);
  min-height: 100vh;
  color: #374151;
}

#app {
  min-height: 100vh;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 20px;
}

.screen.active {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Cards */
.card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  padding: 30px;
  width: 100%;
  max-width: 500px;
  margin: 20px auto;
}

.start-card {
  margin-top: 30px;
}

.results-card {
  max-width: 750px;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6b7280;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 16px;
  transition: color 0.2s;
}

.back-link:hover {
  color: #374151;
}

/* Abandon link */
.abandon-link {
  display: block;
  text-align: right;
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 4px;
  transition: color 0.2s;
}

.abandon-link:hover {
  color: #ef4444;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 30px;
}

.header h1 {
  font-size: 1.5rem;
  background: linear-gradient(135deg, #ec4899, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.subtitle {
  color: #9ca3af;
  font-size: 0.95rem;
}

/* Form Elements */
.form-section {
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #4b5563;
  margin-bottom: 8px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #fbcfe8;
  border-radius: 12px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #ec4899;
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

.form-group input::placeholder {
  color: #d1d5db;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Initial Questions */
.initial-questions {
  background: #f9fafb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.initial-questions h3 {
  font-size: 0.95rem;
  color: #4b5563;
  margin-bottom: 16px;
}

.initial-question {
  margin-bottom: 16px;
}

.initial-question:last-child {
  margin-bottom: 0;
}

.initial-question label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 10px;
}

.rating-buttons-row {
  display: flex;
  justify-content: space-between;
  gap: 3px;
}

.rating-btn-small {
  flex: 1 1 0;
  max-width: 32px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  background: #e5e7eb;
  color: #6b7280;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.rating-btn-small:hover {
  background: #fce7f3;
}

.rating-btn-small.selected {
  background: linear-gradient(135deg, #ec4899, #a855f7);
  color: white;
  transform: scale(1.1);
}

.rating-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.7rem;
  color: #9ca3af;
}

/* Buttons */
.btn {
  padding: 16px 24px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #ec4899, #a855f7);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Instructions */
.instructions {
  margin-top: 24px;
  padding: 20px;
  background: #f9fafb;
  border-radius: 12px;
}

.instructions h3 {
  font-size: 0.95rem;
  color: #4b5563;
  margin-bottom: 10px;
}

.instructions p {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 10px;
}

.instructions ul {
  list-style: none;
  font-size: 0.85rem;
  color: #6b7280;
}

.instructions li {
  margin-bottom: 6px;
  padding-left: 8px;
}

/* Questions Screen */
#questions-screen {
  flex-direction: column;
  align-items: center;
}

.questions-header {
  position: relative;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  padding: 20px;
  width: 100%;
  max-width: 650px;
  position: sticky;
  top: 10px;
  z-index: 100;
  text-align: center;
  margin-bottom: 20px;
}

.questions-header h2 {
  font-size: 1.3rem;
  background: linear-gradient(135deg, #ec4899, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.questions-header p {
  color: #9ca3af;
  font-size: 0.9rem;
  margin-top: 4px;
}

.progress-container {
  margin-top: 12px;
}

.progress-bar {
  background: #e5e7eb;
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #ec4899, #a855f7);
  border-radius: 10px;
  transition: width 0.3s ease;
  width: 0%;
}

#progress-text {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 6px;
}

.needs-container {
  width: 100%;
  max-width: 650px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 100px;
}

/* Need Card */
.need-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  padding: 20px;
  transition: box-shadow 0.3s;
}

.need-card.completed {
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.need-card-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.need-number {
  font-weight: 600;
  color: #ec4899;
  font-size: 0.9rem;
}

.need-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1f2937;
}

.need-description {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 16px;
  font-style: italic;
}

/* Sections inside need card */
.need-section {
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 12px;
}

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

.need-section-mine {
  background: #eff6ff;
  border: 1px solid #dbeafe;
}

.need-section-partner {
  background: #f0fdf4;
  border: 1px solid #dcfce7;
}

.need-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.need-section-mine .need-section-title {
  color: #2563eb;
}

.need-section-partner .need-section-title {
  color: #16a34a;
}

/* Dimension rows */
.dimension-row {
  margin-bottom: 10px;
}

.dimension-row:last-child {
  margin-bottom: 0;
}

.dimension-label {
  font-size: 0.82rem;
  color: #4b5563;
  margin-bottom: 6px;
  font-weight: 500;
}

.dimension-buttons {
  display: flex;
  gap: 3px;
}

.dim-btn {
  flex: 1 1 0;
  max-width: 30px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  background: white;
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.need-section-mine .dim-btn:hover {
  background: #dbeafe;
}

.need-section-partner .dim-btn:hover {
  background: #dcfce7;
}

.need-section-mine .dim-btn.selected {
  background: #3b82f6;
  color: white;
  transform: scale(1.1);
}

.need-section-partner .dim-btn.selected {
  background: #22c55e;
  color: white;
  transform: scale(1.1);
}

.dimension-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: #9ca3af;
  margin-top: 3px;
}

/* Toggle buttons for exclusivity */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-row .dimension-label {
  margin-bottom: 0;
  flex-shrink: 0;
}

.toggle-buttons {
  display: flex;
  gap: 6px;
}

.toggle-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 2px solid #d1d5db;
  background: white;
  color: #6b7280;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-btn:hover {
  border-color: #9ca3af;
}

.need-section-mine .toggle-btn.selected {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.need-section-partner .toggle-btn.selected {
  background: #22c55e;
  border-color: #22c55e;
  color: white;
}

.questions-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  background: white;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.questions-footer .btn {
  max-width: 650px;
  margin: 0 auto;
  display: block;
}

/* Results Screen */
#results-screen {
  align-items: flex-start;
  padding-top: 20px;
}

.results-card h2 {
  text-align: center;
  font-size: 1.5rem;
  background: linear-gradient(135deg, #ec4899, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}

.initial-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.initial-result-box {
  background: linear-gradient(135deg, #fdf2f8, #faf5ff);
  border: 1px solid #f9a8d4;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.initial-result-value {
  font-size: 2rem;
  font-weight: 700;
  color: #a855f7;
}

.initial-result-label {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 4px;
}

/* Results sections */
.results-section {
  margin-bottom: 24px;
}

.results-section h3 {
  font-size: 1.05rem;
  color: #1f2937;
  margin-bottom: 4px;
}

.results-section-desc {
  font-size: 0.82rem;
  color: #9ca3af;
  margin-bottom: 12px;
}

.chart-container {
  overflow-x: auto;
}

.bar-chart {
  width: 100%;
  display: block;
}

/* Top unmet needs */
.top-unmet-section {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.top-unmet-section h3 {
  font-size: 1rem;
  color: #b91c1c;
  margin-bottom: 12px;
}

.unmet-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #fecaca;
}

.unmet-item:last-child {
  border-bottom: none;
}

.unmet-name {
  font-weight: 500;
  color: #374151;
  font-size: 0.9rem;
}

.unmet-gap {
  font-weight: 700;
  color: #dc2626;
  font-size: 0.9rem;
}

/* Exclusivity */
.exclusivity-section {
  background: #f9fafb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.exclusivity-section h3 {
  font-size: 1rem;
  color: #4b5563;
  margin-bottom: 12px;
}

.exclusivity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.exclusivity-column h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.exclusivity-column.mine h4 {
  color: #2563eb;
}

.exclusivity-column.partner h4 {
  color: #16a34a;
}

.exclusivity-list {
  list-style: none;
  font-size: 0.82rem;
  color: #6b7280;
}

.exclusivity-list li {
  padding: 3px 0;
}

.exclusivity-none {
  font-style: italic;
  color: #9ca3af;
  font-size: 0.82rem;
}

/* Interpretation */
.interpretation {
  background: #f9fafb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.interpretation h4 {
  font-size: 0.95rem;
  color: #4b5563;
  margin-bottom: 10px;
}

.interpretation ul {
  list-style: none;
  font-size: 0.85rem;
  color: #6b7280;
}

.interpretation li {
  margin-bottom: 4px;
}

.buttons-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.privacy-note {
  text-align: center;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 16px;
}

/* Loading state */
.btn.loading {
  pointer-events: none;
}

.btn.loading svg {
  animation: spin 1s linear infinite;
}

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

/* Responsive adjustments */
@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .initial-results {
    grid-template-columns: 1fr;
  }

  .buttons-row {
    grid-template-columns: 1fr;
  }

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

  .card {
    padding: 20px 16px;
  }

  .rating-btn-small {
    font-size: 0.7rem;
  }

  .dim-btn {
    font-size: 0.7rem;
  }

  .need-section {
    padding: 10px;
  }

  .toggle-row {
    flex-wrap: wrap;
    gap: 6px;
  }
}

@media (max-width: 380px) {
  .rating-btn-small,
  .dim-btn {
    font-size: 0.65rem;
  }

  .rating-buttons-row,
  .dimension-buttons {
    gap: 2px;
  }

  .initial-questions {
    padding: 14px;
  }

  .need-section {
    padding: 8px;
  }

  .need-card {
    padding: 14px;
  }
}
