* {
  box-sizing: border-box;
}

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f5f5f5;
  color: #222;
}

main {
  max-width: 960px;
  margin: 2rem auto;
  padding: 2rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

h1 {
  margin-top: 0;
}

.advisor-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.form-row,
.taxonomy-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  font-weight: 600;
}

select,
input[type='text'] {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 4px;
  padding: 0.6rem 1rem;
  font-size: 1rem;
}

button.primary {
  background: #002d72;
  color: #fff;
  transition: background 0.2s;
}

button.primary:hover:not(:disabled) {
  background: #001c48;
}

button.primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

button.secondary:hover {
  background: #d0d0d0 !important;
}

button.plain-button {
  background: transparent;
  color: #666;
  padding: 0.25rem 0;
  align-self: flex-start;
}

.taxonomy-fieldset {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1rem;
}

.taxonomy-helper {
  margin: 0.5rem 0 0;
  color: #444;
  font-size: 0.95rem;
}

.taxonomy-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.taxonomy-row {
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 0.75rem;
  background: #fafafa;
}

.taxonomy-row label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.taxonomy-row small {
  color: #666;
}

.taxonomy-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.taxonomy-selected__empty {
  color: #777;
  font-size: 0.9rem;
}

.taxonomy-chip {
  background: #e6efff;
  border: 1px solid #b6cef2;
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.taxonomy-chip:hover {
  background: #d2e4ff;
}

.taxonomy-suggestions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.taxonomy-suggestion {
  text-align: left;
  border: 1px solid #d8d8d8;
  border-radius: 4px;
  background: #fff;
  padding: 0.35rem 0.5rem;
}

.taxonomy-suggestion:hover {
  border-color: #002d72;
  color: #002d72;
}

.taxonomy-suggestions__empty {
  color: #777;
  font-size: 0.9rem;
}

.results {
  display: grid;
  gap: 1.5rem;
}

.results-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.summary-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.summary-card--confirmed {
  border-left: 4px solid #0d7a43;
}

.summary-card--limited {
  border-left: 4px solid #b57600;
}

.summary-card--excluded {
  border-left: 4px solid #b30021;
}

.summary-card__value {
  font-size: 1.5rem;
}

.summary-card__label {
  color: #555;
}

.results-group h3 {
  margin-bottom: 0.75rem;
}

.placements-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.placement-card {
  padding: 0.75rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fdfdfd;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.results-group--confirmed .placement-card {
  border-left: 4px solid #0d7a43;
}

.results-group--limited .placement-card {
  border-left: 4px solid #b57600;
}

.results-group--excluded .placement-card {
  border-left: 4px solid #b30021;
}

.placement-header {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.35rem;
}

.placement-title {
  font-weight: 600;
}

.placement-reason {
  color: #333;
  line-height: 1.4;
}

.placement-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.placement-badge {
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-size: 0.8rem;
  padding: 0.18rem 0.55rem;
  white-space: nowrap;
}

.placement-badge--warning {
  background: #fff3d9;
  color: #7a4b00;
}

.placement-badge--success {
  background: #e6f4ea;
  color: #155724;
}

.placement-summary,
.placement-context {
  margin-top: 0.45rem;
  color: #555;
  font-size: 0.92rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.placement-summary a {
  color: #002d72;
  text-decoration: none;
}

.placement-summary a:hover {
  text-decoration: underline;
}

.placement-details {
  margin-top: 0.55rem;
}

.placement-details summary {
  cursor: pointer;
  color: #002d72;
  font-weight: 600;
}

.empty-state {
  color: #666;
  font-style: italic;
}

.error {
  color: #b30021;
  font-weight: 600;
}

@media (max-width: 720px) {
  .results-summary {
    grid-template-columns: 1fr;
  }

  .placement-header {
    flex-direction: column;
  }

  .placement-badges {
    justify-content: flex-start;
  }
}