.mediator-terms {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mediator-terms .card {
  background: #fff;
  border-radius: 0.5rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 0.75rem 0.9rem;
}

.mediator-terms__intro {
  margin-bottom: 0.35rem;
}

.mediator-terms__eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.6);
  margin-bottom: 0.35rem;
}

.mediator-terms__title {
  font-size: 1.35rem;
  margin: 0 0 0.2rem;
}

.mediator-terms__description {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(15, 23, 42, 0.75);
}

.mediator-terms__selection {
  border-left: 3px solid #4338ca;
  background: rgba(79, 70, 229, 0.04);
}

.mediator-terms__selection-title {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.mediator-terms__selection-subtitle {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: rgba(15, 23, 42, 0.85);
}

.mediator-terms__selection-hint {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(15, 23, 42, 0.75);
}

.mediator-terms__selection-hint a {
  color: #4338ca;
  text-decoration: underline;
}

.mediator-terms__selection-feedback {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #0f172a;
}

.mediator-terms__create-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.65rem;
}

.mediator-terms__create-title {
  margin: 0;
  font-size: 1rem;
}

.mediator-terms__create-note {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.65);
}

.mediator-terms__field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.65rem;
}

.mediator-terms__field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.85);
}

.mediator-terms__field input,
.mediator-terms__field textarea {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 0.45rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: #fff;
}

.mediator-terms__field input:focus,
.mediator-terms__field textarea:focus {
  border-color: rgba(79, 70, 229, 0.65);
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.15);
  outline: none;
}

.mediator-terms__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.mediator-terms__submit {
  border: none;
  border-radius: 0.35rem;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  font-size: 0.9rem;
  background: #1d4ed8;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.mediator-terms__submit:disabled {
  opacity: 0.5;
  cursor: default;
}

.mediator-terms__create-feedback {
  margin: 0;
  font-size: 0.9rem;
}

.mediator-terms__create-feedback[data-variant="error"],
.mediator-terms__error[data-variant="error"],
.term-card__status--error {
  color: #dc2626;
}

.mediator-terms__create-feedback[data-variant="success"],
.mediator-terms__selection-feedback {
  color: #16a34a;
}

.mediator-terms__list-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.2rem;
}

.mediator-terms__refresh {
  border: 1px solid rgba(37, 99, 235, 0.4);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.mediator-terms__refresh:hover {
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(37, 99, 235, 0.6);
}

.mediator-terms__error,
.mediator-terms__empty {
  font-size: 0.92rem;
  margin: 0.35rem 0 0.65rem;
  color: rgba(15, 23, 42, 0.8);
}

.mediator-terms__loading {
  font-size: 0.9rem;
  color: rgba(15, 23, 42, 0.65);
  margin-bottom: 0.5rem;
}

.mediator-terms__items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.term-card {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 0.55rem;
  padding: 0.65rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.term-card__header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.term-card__title {
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
}

.term-card__topic {
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.75);
}

.term-card__text {
  font-size: 0.95rem;
  color: rgba(15, 23, 42, 0.9);
  line-height: 1.4;
}

.term-card__text + textarea {
  display: none;
}

.term-card__inputs {
  display: none;
  flex-direction: column;
  gap: 0.45rem;
}

.term-card__inputs input,
.term-card__inputs textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(15, 23, 42, 0.2);
  font-size: 0.9rem;
  background: #fff;
  color: #0f172a;
}

.term-card__actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.term-card__action {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(15, 23, 42, 0.55);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.term-card__action:hover,
.term-card__action:focus-visible {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.08);
  outline: none;
}

.term-card__action--primary {
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 0.15rem 0.75rem;
}

.term-card__action--danger {
  color: rgba(220, 38, 38, 0.7);
}

.term-card__action--danger:hover,
.term-card__action--danger:focus-visible {
  background: rgba(248, 113, 113, 0.12);
  color: #dc2626;
}

.term-card__action--ghost {
  color: rgba(15, 23, 42, 0.45);
  border-bottom: 1px dashed rgba(148, 163, 184, 0.6);
  border-radius: 0;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.term-card__action--icon {
  width: 1.65rem;
  height: 1.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.25rem;
}

.term-card__action[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.term-card__status {
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.7);
  margin: 0;
}

.term-card--editing {
  background: #fff;
  border-color: rgba(79, 70, 229, 0.4);
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.08);
}

.term-card--editing .term-card__text {
  display: none;
}

.term-card--editing .term-card__inputs {
  display: flex;
}

.term-card--editing .term-card__action--ghost {
  display: inline-flex;
}

.term-card__action[data-term-send] {
  margin-left: auto;
}

@media (min-width: 768px) {
  .mediator-terms__create {
    padding: 1.5rem;
  }

  .term-card {
    padding: 1.1rem;
  }

  .mediator-terms__list-title {
    font-size: 1.2rem;
  }
}
