.ai-form-card .ai-property-line {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.88rem;
  color: var(--ev-gray);
  line-height: 1.45;
}

.ai-form-card .ai-property-line--warn {
  color: #b45309;
}

.ai-form-card #listingCopySelect,
.ai-form-card #marketAnalysisSelect {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ai-tools-page .page-subtitle {
  margin-top: 0.25rem;
  color: var(--ev-gray);
}

.ai-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 1.5rem 0 0;
  border-bottom: 1px solid var(--ev-border-subtle);
}

.ai-tab {
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ev-gray);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
}

.ai-tab:hover:not(.active) {
  color: var(--ev-black);
}

.ai-tab.active {
  color: var(--ev-black);
  font-weight: 500;
  border-bottom-color: var(--ev-red);
}

.ai-panel {
  display: none;
  padding-top: 1.5rem;
}

.ai-panel.active {
  display: block;
}

.ai-tool-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .ai-tool-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.ai-form-card,
.ai-result-card {
  border: 1px solid var(--ev-border-subtle);
  border-radius: 8px;
  padding: 1.25rem 1.35rem;
  background: #fafafa;
}

.ai-form-card h2,
.ai-result-card h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.ai-form-card .field {
  display: block;
  margin-bottom: 1rem;
}

.ai-form-card .field:last-of-type {
  margin-bottom: 1.25rem;
}

.ai-form-card label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--ev-charcoal);
}

.ai-form-card input,
.ai-form-card select,
.ai-form-card textarea {
  display: block;
  width: 100%;
  margin-top: 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--ev-border);
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
}

.ai-form-card textarea {
  min-height: 4.5rem;
  resize: vertical;
}

.ai-result-card {
  min-height: 12rem;
  position: relative;
}

.ai-result-placeholder {
  color: var(--ev-gray);
  font-size: 0.95rem;
  margin: 0;
}

.ai-result-body {
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 1rem;
  margin: 0;
}

.ai-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.ai-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ev-gray);
  font-size: 0.95rem;
}

.ai-spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--ev-border-subtle);
  border-top-color: var(--ev-red);
  border-radius: 50%;
  animation: ai-spin 0.7s linear infinite;
}

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

.ai-error {
  color: var(--ev-red);
  margin: 0;
  font-size: 0.95rem;
}

.ai-seller-score {
  margin-bottom: 1.25rem;
}

.ai-seller-score-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.ai-seller-score-value {
  font-size: 1.35rem;
  color: var(--ev-red);
}

.ai-progress-track {
  height: 0.5rem;
  background: var(--ev-border-subtle);
  border-radius: 4px;
  overflow: hidden;
}

.ai-progress-fill {
  height: 100%;
  background: var(--ev-red);
  border-radius: 4px;
  transition: width 0.35s ease;
}

.ai-priority {
  display: inline-block;
  margin: 0.5rem 0 1rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 4px;
  background: var(--ev-light);
  border: 1px solid var(--ev-border-subtle);
}

.ai-priority--high {
  border-color: var(--ev-red);
  color: var(--ev-red);
}

.ai-seller-message {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  background: var(--ev-white);
  border-left: 3px solid var(--ev-red);
  border-radius: 0 6px 6px 0;
}

.ai-seller-message h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ev-charcoal);
}

.ai-seller-message p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
}

.ai-seller-section {
  margin-top: 1rem;
}

.ai-seller-section h3 {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ev-gray);
}

.ai-seller-section p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
}

.ai-score-breakdown {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.88rem;
}

.ai-score-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

@media (max-width: 768px) {
  .ai-tools-page .page-title {
    font-size: 28px;
    margin-top: 20px;
  }

  .ai-tabs {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    margin: 1rem -0.5rem 0;
    padding: 0 0.5rem;
    scrollbar-width: none;
    border-bottom: 1px solid #E8E4DF;
  }

  .ai-tabs::-webkit-scrollbar {
    display: none;
  }

  .ai-tab {
    flex: 0 0 auto;
    min-height: 48px;
    padding: 0 1rem;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom-width: 3px;
    transition: transform 80ms ease;
  }

  .ai-tab:active {
    transform: scale(0.97);
  }

  .ai-tab.active {
    border-bottom-color: #8B1A2B;
    color: #1A1614;
  }

  .ai-tool-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .ai-form-card,
  .ai-result-card {
    background: #FFFFFF;
    border: 1px solid #E8E4DF;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 12px rgba(26, 22, 20, 0.08);
  }

  .ai-form-card h2,
  .ai-result-card h2 {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6B6460;
    margin-bottom: 12px;
  }

  .ai-form-card .field input,
  .ai-form-card .field select,
  .ai-form-card .field textarea {
    min-height: 52px;
    font-size: 16px;
    border-radius: 8px;
    border: 1.5px solid #E8E4DF;
  }

  .ai-form-card .field textarea {
    min-height: 120px;
  }

  .ai-form-card .btn-primary,
  .ai-generate-actions .btn-primary {
    width: 100%;
    min-height: 52px;
    background: #8B1A2B;
    border-radius: 6px;
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .ai-form-card .btn-primary:active {
    transform: scale(0.97);
  }
}
